This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gui] Patch: javax.swing reformatted
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Tue, 29 Jun 2004 11:13:57 +0200
- Subject: [gui] Patch: javax.swing reformatted
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
I just commited the attached patch to reformat javax.swing a bit to
make code changes more easily to read.
Michael
2004-06-29 Michael Koch <konqueror@gmx.de>
* javax/swing/JButton.java,
javax/swing/text/DefaultEditorKit.java,
javax/swing/text/EditorKit.java,
javax/swing/text/Segment.java,
javax/swing/text/StyledEditorKit.java:
Reformatted.
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFA4TLYWSOgCCdjSDsRAq8eAJsEXA32GAHXkSdobBCdrBMoINmIDQCgkNHa
WaH7JUrtlM3C/9KnWIJ8pzc=
=4PXO
-----END PGP SIGNATURE-----
Index: javax/swing/JButton.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JButton.java,v
retrieving revision 1.4.2.4
diff -u -b -B -r1.4.2.4 JButton.java
--- javax/swing/JButton.java 24 Jun 2004 05:31:31 -0000 1.4.2.4
+++ javax/swing/JButton.java 29 Jun 2004 09:09:58 -0000
@@ -54,7 +54,6 @@
boolean def;
boolean is_def;
-
public JButton()
{
this(null, null);
@@ -127,11 +126,13 @@
}
public void setDefaultCapable(boolean defaultCapable)
- { def = defaultCapable; }
+ {
+ def = defaultCapable;
+ }
public void updateUI()
{
- ButtonUI b = (ButtonUI)UIManager.getUI(this);
+ ButtonUI b = (ButtonUI) UIManager.getUI(this);
setUI(b);
}
}
Index: javax/swing/text/DefaultEditorKit.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/DefaultEditorKit.java,v
retrieving revision 1.4.8.1
diff -u -b -B -r1.4.8.1 DefaultEditorKit.java
--- javax/swing/text/DefaultEditorKit.java 29 Jun 2004 07:49:11 -0000 1.4.8.1
+++ javax/swing/text/DefaultEditorKit.java 29 Jun 2004 09:09:58 -0000
@@ -47,7 +48,6 @@
public class DefaultEditorKit extends EditorKit
{
private static final long serialVersionUID = 9017245433028523428L;
-
public static final String backwardAction = "caret-backward";
public static final String beepAction = "beep";
public static final String beginAction = "caret-begin";
@@ -79,16 +79,19 @@
public static final String selectionBackwardAction = "selection-backward";
public static final String selectionBeginAction = "selection-begin";
public static final String selectionBeginLineAction = "selection-begin-line";
- public static final String selectionBeginParagraphAction = "selection-begin-paragraph";
+ public static final String selectionBeginParagraphAction =
+ "selection-begin-paragraph";
public static final String selectionBeginWordAction = "selection-begin-word";
public static final String selectionDownAction = "selection-down";
public static final String selectionEndAction = "selection-end";
public static final String selectionEndLineAction = "selection-end-line";
- public static final String selectionEndParagraphAction = "selection-end-paragraph";
+ public static final String selectionEndParagraphAction =
+ "selection-end-paragraph";
public static final String selectionEndWordAction = "selection-end-word";
public static final String selectionForwardAction = "selection-forward";
public static final String selectionNextWordAction = "selection-next-word";
- public static final String selectionPreviousWordAction = "selection-previous-word";
+ public static final String selectionPreviousWordAction =
+ "selection-previous-word";
public static final String selectionUpAction = "selection-up";
public static final String selectLineAction = "select-line";
public static final String selectParagraphAction = "select-paragraph";
Index: javax/swing/text/EditorKit.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/EditorKit.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 EditorKit.java
--- javax/swing/text/EditorKit.java 10 Jan 2004 21:07:44 -0000 1.2
+++ javax/swing/text/EditorKit.java 29 Jun 2004 09:09:58 -0000
@@ -44,7 +44,9 @@
import javax.swing.Action;
import javax.swing.JEditorPane;
-public abstract class EditorKit implements Cloneable
+
+public abstract class EditorKit
+ implements Cloneable
{
EditorKit()
{
Index: javax/swing/text/Segment.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/Segment.java,v
retrieving revision 1.2.8.1
diff -u -b -B -r1.2.8.1 Segment.java
--- javax/swing/text/Segment.java 29 Jun 2004 07:49:11 -0000 1.2.8.1
+++ javax/swing/text/Segment.java 29 Jun 2004 09:09:58 -0000
@@ -39,7 +39,9 @@
import java.text.CharacterIterator;
-public class Segment implements Cloneable, CharacterIterator
+
+public class Segment
+ implements Cloneable, CharacterIterator
{
char[] array;
int count;
@@ -47,9 +49,12 @@
public Object clone()
{
- try {
+ try
+ {
return super.clone();
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
System.err.println("Huuuhhh, this class implements cloneable !!!!!!");
System.err.println("I think there is a bug in this JVM somewhere");
}
Index: javax/swing/text/StyledEditorKit.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/StyledEditorKit.java,v
retrieving revision 1.3.8.1
diff -u -b -B -r1.3.8.1 StyledEditorKit.java
--- javax/swing/text/StyledEditorKit.java 9 Jun 2004 08:40:11 -0000 1.3.8.1
+++ javax/swing/text/StyledEditorKit.java 29 Jun 2004 09:09:58 -0000
@@ -48,329 +47,236 @@
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
+
/**
* StyledEditorKit
+ *
* @author Andrew Selkirk
- * @version 1.0
*/
public class StyledEditorKit extends DefaultEditorKit
{
static final long serialVersionUID = 7002391892985555948L;
- //-------------------------------------------------------------
- // Classes ----------------------------------------------------
- //-------------------------------------------------------------
-
/**
* UnderlineAction
*/
- public static class UnderlineAction extends StyledEditorKit.StyledTextAction {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
+ public static class UnderlineAction extends StyledEditorKit.StyledTextAction
+ {
/**
* Constructor UnderlineAction
*/
- public UnderlineAction() {
+ public UnderlineAction()
+ {
super("TODO");
// TODO
- } // UnderlineAction()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
+ }
/**
* actionPerformed
* @param event TODO
*/
- public void actionPerformed(ActionEvent event) {
+ public void actionPerformed(ActionEvent event)
+ {
// TODO
- } // actionPerformed()
-
-
- } // UnderlineAction
+ }
+ }
/**
* ItalicAction
*/
- public static class ItalicAction extends StyledEditorKit.StyledTextAction {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
+ public static class ItalicAction extends StyledEditorKit.StyledTextAction
+ {
/**
* Constructor ItalicAction
*/
- public ItalicAction() {
+ public ItalicAction()
+ {
super("TODO");
// TODO
- } // ItalicAction()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
+ }
/**
* actionPerformed
* @param event TODO
*/
- public void actionPerformed(ActionEvent event) {
+ public void actionPerformed(ActionEvent event)
+ {
// TODO
- } // actionPerformed()
-
-
- } // ItalicAction
+ }
+ }
/**
* BoldAction
*/
- public static class BoldAction extends StyledEditorKit.StyledTextAction {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
+ public static class BoldAction extends StyledEditorKit.StyledTextAction
+ {
/**
* Constructor BoldAction
*/
- public BoldAction() {
+ public BoldAction()
+ {
super("TODO");
// TODO
- } // BoldAction()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
+ }
/**
* actionPerformed
* @param event TODO
*/
- public void actionPerformed(ActionEvent event) {
+ public void actionPerformed(ActionEvent event)
+ {
// TODO
- } // actionPerformed()
-
-
- } // BoldAction
+ }
+ }
/**
* AlignmentAction
*/
- public static class AlignmentAction extends StyledEditorKit.StyledTextAction {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
+ public static class AlignmentAction extends StyledEditorKit.StyledTextAction
+ {
/**
* a
*/
private int a;
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
/**
* Constructor AlignmentAction
* @param nm TODO
* @param a TODO
*/
- public AlignmentAction(String nm, int a) {
+ public AlignmentAction(String nm, int a)
+ {
super("TODO");
// TODO
- } // AlignmentAction()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
+ }
/**
* actionPerformed
* @param event TODO
*/
- public void actionPerformed(ActionEvent event) {
+ public void actionPerformed(ActionEvent event)
+ {
// TODO
- } // actionPerformed()
-
-
- } // AlignmentAction
+ }
+ }
/**
* ForegroundAction
*/
- public static class ForegroundAction extends StyledEditorKit.StyledTextAction {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
+ public static class ForegroundAction extends StyledEditorKit.StyledTextAction
+ {
/**
* fg
*/
private Color fg;
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
/**
* Constructor ForegroundAction
* @param nm TODO
* @param fg TODO
*/
- public ForegroundAction(String nm, Color fg) {
+ public ForegroundAction(String nm, Color fg)
+ {
super("TODO");
// TODO
- } // ForegroundAction()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
+ }
/**
* actionPerformed
* @param event TODO
*/
- public void actionPerformed(ActionEvent event) {
+ public void actionPerformed(ActionEvent event)
+ {
// TODO
- } // actionPerformed()
-
-
- } // ForegroundAction
+ }
+ }
/**
* FontSizeAction
*/
- public static class FontSizeAction extends StyledEditorKit.StyledTextAction {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
+ public static class FontSizeAction extends StyledEditorKit.StyledTextAction
+ {
/**
* size
*/
private int size;
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
/**
* Constructor FontSizeAction
* @param nm TODO
* @param size TODO
*/
- public FontSizeAction(String nm, int size) {
+ public FontSizeAction(String nm, int size)
+ {
super("TODO");
// TODO
- } // FontSizeAction()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
+ }
/**
* actionPerformed
* @param event TODO
*/
- public void actionPerformed(ActionEvent event) {
+ public void actionPerformed(ActionEvent event)
+ {
// TODO
- } // actionPerformed()
-
-
- } // FontSizeAction
+ }
+ }
/**
* FontFamilyAction
*/
- public static class FontFamilyAction extends StyledEditorKit.StyledTextAction {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
+ public static class FontFamilyAction extends StyledEditorKit.StyledTextAction
+ {
/**
* family
*/
private String family;
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
/**
* Constructor FontFamilyAction
* @param nm TODO
* @param family TODO
*/
- public FontFamilyAction(String nm, String family) {
+ public FontFamilyAction(String nm, String family)
+ {
super("TODO");
// TODO
- } // FontFamilyAction()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
+ }
/**
* actionPerformed
* @param event TODO
*/
- public void actionPerformed(ActionEvent event) {
+ public void actionPerformed(ActionEvent event)
+ {
// TODO
- } // actionPerformed()
-
-
- } // FontFamilyAction
+ }
+ }
/**
* StyledTextAction
*/
- public abstract static class StyledTextAction extends TextAction {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
+ public abstract static class StyledTextAction extends TextAction
+ {
/**
* Constructor StyledTextAction
* @param nm TODO
*/
- public StyledTextAction(String nm) {
+ public StyledTextAction(String nm)
+ {
super(nm);
// TODO
- } // StyledTextAction()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
+ }
/**
* getEditor
* @param event TODO
* @returns JEditorPane
*/
- protected final JEditorPane getEditor(ActionEvent event) {
+ protected final JEditorPane getEditor(ActionEvent event)
+ {
return null; // TODO
- } // getEditor()
+ }
/**
* setCharacterAttributes
@@ -378,27 +284,32 @@
* @param value1 TODO
* @param value2 TODO
*/
- protected final void setCharacterAttributes(JEditorPane value0, AttributeSet value1, boolean value2) {
+ protected final void setCharacterAttributes(JEditorPane value0,
+ AttributeSet value1,
+ boolean value2)
+ {
// TODO
- } // setCharacterAttributes()
+ }
/**
* getStyledDocument
* @param value0 TODO
* @returns StyledDocument
*/
- protected final StyledDocument getStyledDocument(JEditorPane value0) {
+ protected final StyledDocument getStyledDocument(JEditorPane value0)
+ {
return null; // TODO
- } // getStyledDocument()
+ }
/**
* getStyledEditorKit
* @param value0 TODO
* @returns StyledEditorKit
*/
- protected final StyledEditorKit getStyledEditorKit(JEditorPane value0) {
+ protected final StyledEditorKit getStyledEditorKit(JEditorPane value0)
+ {
return null; // TODO
- } // getStyledEditorKit()
+ }
/**
* setParagraphAttributes
@@ -406,72 +317,53 @@
* @param value1 TODO
* @param value2 TODO
*/
- protected final void setParagraphAttributes(JEditorPane value0, AttributeSet value1, boolean value2) {
+ protected final void setParagraphAttributes(JEditorPane value0,
+ AttributeSet value1,
+ boolean value2)
+ {
// TODO
- } // setParagraphAttributes()
-
-
- } // StyledTextAction
+ }
+ }
/**
* StyledViewFactory
*/
- static class StyledViewFactory implements ViewFactory {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
+ static class StyledViewFactory
+ implements ViewFactory
+ {
/**
* Constructor StyledViewFactory
*/
- StyledViewFactory() {
+ StyledViewFactory()
+ {
// TODO
- } // StyledViewFactory()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
+ }
/**
* create
* @param value0 TODO
* @returns View
*/
- public View create(Element value0) {
+ public View create(Element value0)
+ {
return null; // TODO
- } // create()
-
-
- } // StyledViewFactory
+ }
+ }
/**
* AttributeTracker
*/
- class AttributeTracker implements CaretListener, PropertyChangeListener, Serializable {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
+ class AttributeTracker
+ implements CaretListener, PropertyChangeListener, Serializable
+ {
/**
* Constructor AttributeTracker
* @param value0 TODO
*/
- AttributeTracker(StyledEditorKit value0) {
+ AttributeTracker(StyledEditorKit value0)
+ {
// TODO
- } // AttributeTracker()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
+ }
/**
* updateInputAttributes
@@ -479,33 +371,29 @@
* @param value1 TODO
* @param value2 TODO
*/
- void updateInputAttributes(int value0, int value1, JTextComponent value2) {
+ void updateInputAttributes(int value0, int value1, JTextComponent value2)
+ {
// TODO
- } // updateInputAttributes()
+ }
/**
* propertyChange
* @param value0 TODO
*/
- public void propertyChange(PropertyChangeEvent value0) {
+ public void propertyChange(PropertyChangeEvent value0)
+ {
// TODO
- } // propertyChange()
+ }
/**
* caretUpdate
* @param value0 TODO
*/
- public void caretUpdate(CaretEvent value0) {
+ public void caretUpdate(CaretEvent value0)
+ {
// TODO
- } // caretUpdate()
-
-
- } // AttributeTracker
-
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
+ }
+ }
/**
* currentRun
@@ -522,96 +410,93 @@
*/
MutableAttributeSet inputAttributes;
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
/**
* Constructor StyledEditorKit
*/
- public StyledEditorKit() {
+ public StyledEditorKit()
+ {
// TODO
- } // StyledEditorKit()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
+ }
/**
* clone
* @returns Object
*/
- public Object clone() {
+ public Object clone()
+ {
return null; // TODO
- } // clone()
+ }
/**
* getActions
* @returns Action[]
*/
- public Action[] getActions() {
+ public Action[] getActions()
+ {
return null; // TODO
- } // getActions()
+ }
/**
* getInputAttributes
* @returns MutableAttributeSet
*/
- public MutableAttributeSet getInputAttributes() {
+ public MutableAttributeSet getInputAttributes()
+ {
return null; // TODO
- } // getInputAttributes()
+ }
/**
* getCharacterAttributeRun
* @returns Element
*/
- public Element getCharacterAttributeRun() {
+ public Element getCharacterAttributeRun()
+ {
return null; // TODO
- } // getCharacterAttributeRun()
+ }
/**
* createDefaultDocument
* @returns Document
*/
- public Document createDefaultDocument() {
+ public Document createDefaultDocument()
+ {
return null; // TODO
- } // createDefaultDocument()
+ }
/**
* install
* @param component TODO
*/
- public void install(JEditorPane component) {
+ public void install(JEditorPane component)
+ {
// TODO
- } // install()
+ }
/**
* deinstall
* @param component TODO
*/
- public void deinstall(JEditorPane component) {
+ public void deinstall(JEditorPane component)
+ {
// TODO
- } // deinstall()
+ }
/**
* getViewFactory
* @returns ViewFactory
*/
- public ViewFactory getViewFactory() {
+ public ViewFactory getViewFactory()
+ {
return null; // TODO
- } // getViewFactory()
+ }
/**
* createInputAttributes
* @param element TODO
* @param set TODO
*/
- protected void createInputAttributes(Element element,
- MutableAttributeSet set) {
+ protected void createInputAttributes(Element element, MutableAttributeSet set)
+ {
// TODO
- } // createInputAttributes()
-
-
-} // StyledEditorKit
+ }
+}