diff options
author | Mark Wielaard <mark@klomp.org> | 2004-07-30 20:21:18 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2004-07-30 20:21:18 +0000 |
commit | 0a1ee49acec6767674474aa5a527cd21c6343377 (patch) | |
tree | 90745caa5c53a0ba15da4c0a301b533d758cdf75 | |
parent | 7f9052c8f07ced68f49d3c13d21ab200fd9b0382 (diff) | |
download | classpath-0a1ee49acec6767674474aa5a527cd21c6343377.tar.gz |
* javax/swing/AbstractButton.java: Reformat.
* javax/swing/ActionMap.java: Likewise.
* javax/swing/ComponentInputMap.java: Likewise.
* javax/swing/DefaultDesktopManager.java: Likewise.
* javax/swing/ImageIcon.java: Likewise.
* javax/swing/InputMap.java: Likewise.
* javax/swing/JButton.java: Likewise.
* javax/swing/JEditorPane.java: Likewise.
* javax/swing/JInternalFrame.java: Likewise.
* javax/swing/JMenu.java: Likewise.
* javax/swing/JMenuBar.java: Likewise.
* javax/swing/JMenuItem.java: Likewise.
* javax/swing/JOptionPane.java: Likewise.
* javax/swing/JPopupMenu.java: Likewise.
* javax/swing/JRootPane.java: Likewise.
* javax/swing/JScrollPane.java: Likewise.
* javax/swing/JTable.java: Likewise.
* javax/swing/JTextField.java: Likewise.
* javax/swing/JToolBar.java: Likewise.
* javax/swing/MenuSelectionManager.java: Likewise.
* javax/swing/RepaintManager.java: Likewise.
* javax/swing/ScrollPaneLayout.java: Likewise.
* javax/swing/UIManager.java: Likewise.
* javax/swing/ViewportLayout.java: Likewise.
-rw-r--r-- | ChangeLog | 27 | ||||
-rw-r--r-- | javax/swing/AbstractButton.java | 18 | ||||
-rw-r--r-- | javax/swing/ActionMap.java | 92 | ||||
-rw-r--r-- | javax/swing/ComponentInputMap.java | 10 | ||||
-rw-r--r-- | javax/swing/DefaultDesktopManager.java | 2 | ||||
-rw-r--r-- | javax/swing/ImageIcon.java | 8 | ||||
-rw-r--r-- | javax/swing/InputMap.java | 94 | ||||
-rw-r--r-- | javax/swing/JButton.java | 150 | ||||
-rw-r--r-- | javax/swing/JEditorPane.java | 2 | ||||
-rw-r--r-- | javax/swing/JInternalFrame.java | 2 | ||||
-rw-r--r-- | javax/swing/JMenu.java | 4 | ||||
-rw-r--r-- | javax/swing/JMenuBar.java | 8 | ||||
-rw-r--r-- | javax/swing/JMenuItem.java | 20 | ||||
-rw-r--r-- | javax/swing/JOptionPane.java | 4 | ||||
-rw-r--r-- | javax/swing/JPopupMenu.java | 24 | ||||
-rw-r--r-- | javax/swing/JRootPane.java | 7 | ||||
-rw-r--r-- | javax/swing/JScrollPane.java | 2 | ||||
-rw-r--r-- | javax/swing/JTable.java | 4 | ||||
-rw-r--r-- | javax/swing/JTextField.java | 1 | ||||
-rw-r--r-- | javax/swing/JToolBar.java | 266 | ||||
-rw-r--r-- | javax/swing/MenuSelectionManager.java | 8 | ||||
-rw-r--r-- | javax/swing/RepaintManager.java | 2 | ||||
-rw-r--r-- | javax/swing/ScrollPaneLayout.java | 14 | ||||
-rw-r--r-- | javax/swing/UIManager.java | 8 | ||||
-rw-r--r-- | javax/swing/ViewportLayout.java | 2 |
25 files changed, 404 insertions, 375 deletions
@@ -1,3 +1,30 @@ +2004-07-30 Mark Wielaard <mark@klomp.org> + + * javax/swing/AbstractButton.java: Reformat. + * javax/swing/ActionMap.java: Likewise. + * javax/swing/ComponentInputMap.java: Likewise. + * javax/swing/DefaultDesktopManager.java: Likewise. + * javax/swing/ImageIcon.java: Likewise. + * javax/swing/InputMap.java: Likewise. + * javax/swing/JButton.java: Likewise. + * javax/swing/JEditorPane.java: Likewise. + * javax/swing/JInternalFrame.java: Likewise. + * javax/swing/JMenu.java: Likewise. + * javax/swing/JMenuBar.java: Likewise. + * javax/swing/JMenuItem.java: Likewise. + * javax/swing/JOptionPane.java: Likewise. + * javax/swing/JPopupMenu.java: Likewise. + * javax/swing/JRootPane.java: Likewise. + * javax/swing/JScrollPane.java: Likewise. + * javax/swing/JTable.java: Likewise. + * javax/swing/JTextField.java: Likewise. + * javax/swing/JToolBar.java: Likewise. + * javax/swing/MenuSelectionManager.java: Likewise. + * javax/swing/RepaintManager.java: Likewise. + * javax/swing/ScrollPaneLayout.java: Likewise. + * javax/swing/UIManager.java: Likewise. + * javax/swing/ViewportLayout.java: Likewise. + 2004-07-30 Craig Black <craig.black@aonix.com> * gnu/java/awt/peer/gtk/GdkGraphics.java diff --git a/javax/swing/AbstractButton.java b/javax/swing/AbstractButton.java index 3c2a4cdea..36a7f97e9 100644 --- a/javax/swing/AbstractButton.java +++ b/javax/swing/AbstractButton.java @@ -731,10 +731,10 @@ public abstract class AbstractButton extends JComponent if (old != mne) { - getModel().setMnemonic(mne); + getModel().setMnemonic(mne); if (text != null && ! text.equals("")) - { + { // Since lower case char = upper case char for // mnemonic, we will convert both text and mnemonic // to upper case before checking if mnemonic character occurs @@ -744,9 +744,9 @@ public abstract class AbstractButton extends JComponent setDisplayedMnemonicIndex(upperCaseText.indexOf(upperCaseMne)); } - firePropertyChange(MNEMONIC_CHANGED_PROPERTY, old, mne); - revalidate(); - repaint(); + firePropertyChange(MNEMONIC_CHANGED_PROPERTY, old, mne); + revalidate(); + repaint(); } } @@ -1153,9 +1153,9 @@ public abstract class AbstractButton extends JComponent if (t != old) { firePropertyChange(TEXT_CHANGED_PROPERTY, old, t); - revalidate(); - repaint(); - } + revalidate(); + repaint(); + } } /** @@ -1441,7 +1441,7 @@ public abstract class AbstractButton extends JComponent // Set actionCommand to button's text by default if it is not specified if (actionCommand != null) - setActionCommand((String)(a.getValue(Action.ACTION_COMMAND_KEY))); + setActionCommand((String)(a.getValue(Action.ACTION_COMMAND_KEY))); else setActionCommand(getText()); } diff --git a/javax/swing/ActionMap.java b/javax/swing/ActionMap.java index 2a5c67aa4..1b1f8401c 100644 --- a/javax/swing/ActionMap.java +++ b/javax/swing/ActionMap.java @@ -50,7 +50,7 @@ import java.util.Set; /** - * @author Andrew Selkirk + * @author Andrew Selkirk * @author Michael Koch */ public class ActionMap @@ -58,154 +58,154 @@ public class ActionMap { private static final long serialVersionUID = -6277518704513986346L; - /** - * actionMap - */ - private Map actionMap = new HashMap(); + /** + * actionMap + */ + private Map actionMap = new HashMap(); - /** - * parent - */ + /** + * parent + */ private ActionMap parent; - /** + /** * Creates a new <code>ActionMap</code> instance. - */ + */ public ActionMap() { } - /** + /** * Returns an action associated with an object. * * @param key the key of the enty * * @return the action associated with key, may be null - */ + */ public Action get(Object key) { Object result = actionMap.get(key); if (result == null) - result = parent.get(key); + result = parent.get(key); - return (Action) result; + return (Action) result; } - /** + /** * Puts a new <code>Action</code> into the <code>ActionMap</code>. * If action is null an existing entry will be removed. * * @param key the key for the entry * @param action the action. - */ + */ public void put(Object key, Action action) { if (action == null) - actionMap.remove(key); + actionMap.remove(key); else - actionMap.put(key, action); + actionMap.put(key, action); } - /** + /** * Remove an entry from the <code>ActionMap</code>. * * @param key the key of the entry to remove - */ + */ public void remove(Object key) { - actionMap.remove(key); + actionMap.remove(key); } - /** + /** * Returns the parent of this <code>ActionMap</code>. * * @return the parent, may be null. - */ + */ public ActionMap getParent() { - return parent; + return parent; } - /** + /** * Sets a parent for this <code>ActionMap</code>. * * @param parentMap the new parent - */ + */ public void setParent(ActionMap parentMap) { - parent = parentMap; + parent = parentMap; } - /** + /** * Returns the number of entries in this <code>ActionMap</code>. * * @return the number of entries - */ + */ public int size() { - return actionMap.size(); + return actionMap.size(); } - /** + /** * Clears the <code>ActionMap</code>. - */ + */ public void clear() { - actionMap.clear(); + actionMap.clear(); } - /** + /** * Returns all keys of entries in this <code>ActionMap</code>. * * @return an array of keys - */ + */ public Object[] keys() { return actionMap.keySet().toArray(); } - /** + /** * Returns all keys of entries in this <code>ActionMap</code> * and all its parents. * * @return an array of keys - */ + */ public Object[] allKeys() { Set set = new HashSet(); if (parent != null) - set.addAll(Arrays.asList(parent.allKeys())); + set.addAll(Arrays.asList(parent.allKeys())); set.addAll(actionMap.keySet()); return set.toArray(); } - /** - * writeObject + /** + * writeObject * * @param stream the stream to write to * * @exception IOException If an error occurs - */ + */ private void writeObject(ObjectOutputStream stream) throws IOException { - // TODO + // TODO } - /** - * readObject + /** + * readObject * * @param stream the stream to read from * * @exception ClassNotFoundException If the serialized class cannot be found * @exception IOException If an error occurs - */ + */ private void readObject(ObjectInputStream stream) throws ClassNotFoundException, IOException { - // TODO + // TODO } } diff --git a/javax/swing/ComponentInputMap.java b/javax/swing/ComponentInputMap.java index 84110c5f0..1c85892f5 100644 --- a/javax/swing/ComponentInputMap.java +++ b/javax/swing/ComponentInputMap.java @@ -39,17 +39,17 @@ package javax.swing; /** - * @author Andrew Selkirk + * @author Andrew Selkirk * @author Michael Koch */ public class ComponentInputMap extends InputMap { - /** + /** * The component to notify. - */ - private JComponent component; + */ + private JComponent component; - /** + /** * Creates <code>ComponentInputMap</code> object that notifies the given * component about changes to it. * diff --git a/javax/swing/DefaultDesktopManager.java b/javax/swing/DefaultDesktopManager.java index 6678c931c..3ddc80385 100644 --- a/javax/swing/DefaultDesktopManager.java +++ b/javax/swing/DefaultDesktopManager.java @@ -84,7 +84,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable private transient Container pane; /** - * An array of Rectangles that holds the bounds of the JDesktopIcons in the + * An array of Rectangles that holds the bounds of the JDesktopIcons in the * JDesktopPane when looking for where to place a new icon. */ private transient Rectangle[] iconRects; diff --git a/javax/swing/ImageIcon.java b/javax/swing/ImageIcon.java index c0e8e0d31..e25676afc 100644 --- a/javax/swing/ImageIcon.java +++ b/javax/swing/ImageIcon.java @@ -1,4 +1,4 @@ -/* ImageIcon.java -- +/* ImageIcon.java -- Copyright (C) 2002, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -57,7 +57,7 @@ public class ImageIcon public ImageIcon() { } - + public ImageIcon(String file) { this(file, file); @@ -98,12 +98,12 @@ public class ImageIcon this.image = Toolkit.getDefaultToolkit().createImage(image.getSource()); this.description = description; } - + public ImageObserver getImageObserver() { return observer; } - + public void setImageObserver(ImageObserver newObserver) { observer = newObserver; diff --git a/javax/swing/InputMap.java b/javax/swing/InputMap.java index fdcc8280f..4655aa1c4 100644 --- a/javax/swing/InputMap.java +++ b/javax/swing/InputMap.java @@ -50,7 +50,7 @@ import java.util.Set; /** - * @author Andrew Selkirk + * @author Andrew Selkirk * @author Michael Koch * * @since 1.3 @@ -60,155 +60,155 @@ public class InputMap { private static final long serialVersionUID = -5429059542008604257L; - /** - * inputMap - */ - private Map inputMap = new HashMap(); + /** + * inputMap + */ + private Map inputMap = new HashMap(); - /** - * parent - */ + /** + * parent + */ private InputMap parent; - /** + /** * Creates a new <code>InputMap</code> instance. - */ + */ public InputMap() { - // TODO + // TODO } - /** + /** * Returns the binding for keystroke. * * @param key the key of the enty * * @return the binding associated with keystroke may be null - */ + */ public Object get(KeyStroke keystroke) { Object result = inputMap.get(keystroke); if (result == null) - result = parent.get(keystroke); - return result; + result = parent.get(keystroke); + return result; } - /** + /** * Puts a new entry into the <code>InputMap</code>. * If actionMapKey is null an existing entry will be removed. * * @param keystroke the keystroke for the entry * @param actionMapKey the action. - */ + */ public void put(KeyStroke keystroke, Object actionMapKey) { if (actionMapKey == null) - inputMap.remove(keystroke); + inputMap.remove(keystroke); else - inputMap.put(keystroke, actionMapKey); + inputMap.put(keystroke, actionMapKey); } - /** + /** * Remove an entry from the <code>InputMap</code>. * * @param key the key of the entry to remove - */ + */ public void remove(KeyStroke keystroke) { - inputMap.remove(keystroke); + inputMap.remove(keystroke); } - /** + /** * Returns the parent of this <code>InputMap</code>. * * @return the parent, may be null. - */ + */ public InputMap getParent() { - return parent; + return parent; } - /** + /** * Sets a parent for this <code>InputMap</code>. * * @param parentMap the new parent - */ + */ public void setParent(InputMap parentMap) { - parent = parentMap; + parent = parentMap; } - /** + /** * Returns the number of entries in this <code>InputMap</code>. * * @return the number of entries - */ + */ public int size() { - return inputMap.size(); + return inputMap.size(); } - /** + /** * Clears the <code>InputMap</code>. - */ + */ public void clear() { - inputMap.clear(); + inputMap.clear(); } - /** + /** * Returns all keys of entries in this <code>InputMap</code>. * * @return an array of keys - */ + */ public KeyStroke[] keys() { KeyStroke[] array = new KeyStroke[size()]; return (KeyStroke[]) inputMap.keySet().toArray(array); } - /** + /** * Returns all keys of entries in this <code>InputMap</code> * and all its parents. * * @return an array of keys - */ + */ public KeyStroke[] allKeys() { Set set = new HashSet(); if (parent != null) - set.addAll(Arrays.asList(parent.allKeys())); + set.addAll(Arrays.asList(parent.allKeys())); set.addAll(inputMap.keySet()); KeyStroke[] array = new KeyStroke[size()]; return (KeyStroke[]) set.toArray(array); } - /** - * writeObject + /** + * writeObject * * @param stream the stream to write to * * @exception IOException If an error occurs - */ + */ private void writeObject(ObjectOutputStream stream) throws IOException { - // TODO + // TODO } - /** - * readObject + /** + * readObject * * @param stream the stream to read from * * @exception ClassNotFoundException If the serialized class cannot be found * @exception IOException If an error occurs - */ + */ private void readObject(ObjectInputStream stream) throws ClassNotFoundException, IOException { - // TODO + // TODO } } diff --git a/javax/swing/JButton.java b/javax/swing/JButton.java index 13e3d5716..dea37811a 100644 --- a/javax/swing/JButton.java +++ b/javax/swing/JButton.java @@ -53,90 +53,90 @@ public class JButton extends AbstractButton private static final long serialVersionUID = -1907255238954382202L; boolean def; boolean is_def; - - public JButton() - { - this(null, null); - } - - public JButton(Action a) - { - this(); - setAction(a); - } - - public JButton(Icon icon) - { - this(null, icon); - } - - public JButton(String text) - { - this(text, null); - } - - public JButton(String text, Icon icon) - { - super(text, icon); - } - - public Object[] getSelectedObjects() - { - return null; - } - - protected void configurePropertiesFromAction(Action a) - { - //Factory method which sets the AbstractButton's properties according to values from the Action instance. - super.configurePropertiesFromAction(a); - } - - public AccessibleContext getAccessibleContext() - { - //Gets the AccessibleContext associated with this JButton. - return null; - } - - public String getUIClassID() - { + + public JButton() + { + this(null, null); + } + + public JButton(Action a) + { + this(); + setAction(a); + } + + public JButton(Icon icon) + { + this(null, icon); + } + + public JButton(String text) + { + this(text, null); + } + + public JButton(String text, Icon icon) + { + super(text, icon); + } + + public Object[] getSelectedObjects() + { + return null; + } + + protected void configurePropertiesFromAction(Action a) + { + //Factory method which sets the AbstractButton's properties according to values from the Action instance. + super.configurePropertiesFromAction(a); + } + + public AccessibleContext getAccessibleContext() + { + //Gets the AccessibleContext associated with this JButton. + return null; + } + + public String getUIClassID() + { //Returns a string that specifies the name of the L&F class that renders this component. - return "ButtonUI"; - } - - public boolean isDefaultButton() - { - //Returns whether or not this button is the default button on the RootPane. - return is_def; - } - - public boolean isDefaultCapable() - { - //Returns whether or not this button is capable of being the default button on the RootPane. - return def; - } - - protected String paramString() - { - return "JButton"; - } - + return "ButtonUI"; + } + + public boolean isDefaultButton() + { + //Returns whether or not this button is the default button on the RootPane. + return is_def; + } + + public boolean isDefaultCapable() + { + //Returns whether or not this button is capable of being the default button on the RootPane. + return def; + } + + protected String paramString() + { + return "JButton"; + } + /** * Overrides JComponent.removeNotify to check if this button is currently * set as the default button on the RootPane, and if so, sets the RootPane's * default button to null to ensure the RootPane doesn't hold onto an invalid * button reference. */ - public void removeNotify() - { - } - - public void setDefaultCapable(boolean defaultCapable) + public void removeNotify() + { + } + + public void setDefaultCapable(boolean defaultCapable) { def = defaultCapable; } - - public void updateUI() - { + + public void updateUI() + { setUI((ButtonUI) UIManager.getUI(this)); - } + } } diff --git a/javax/swing/JEditorPane.java b/javax/swing/JEditorPane.java index a36eba757..0f24e808f 100644 --- a/javax/swing/JEditorPane.java +++ b/javax/swing/JEditorPane.java @@ -221,7 +221,7 @@ public class JEditorPane extends JTextComponent } /** - * Establishes the default bindings of type to classname. + * Establishes the default bindings of type to classname. */ public static void registerEditorKitForContentType(String type, String classname, diff --git a/javax/swing/JInternalFrame.java b/javax/swing/JInternalFrame.java index 12c9d139d..99d552010 100644 --- a/javax/swing/JInternalFrame.java +++ b/javax/swing/JInternalFrame.java @@ -1,4 +1,4 @@ -/* JInternalFrame.java -- +/* JInternalFrame.java -- Copyright (C) 2002, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. diff --git a/javax/swing/JMenu.java b/javax/swing/JMenu.java index 60e94418d..72ce22acc 100644 --- a/javax/swing/JMenu.java +++ b/javax/swing/JMenu.java @@ -349,7 +349,7 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement // display popup associated with this menu if (selected) { - super.setArmed(true); + super.setArmed(true); super.setSelected(true); // FIXME: The popup menu should be shown on the screen after certain @@ -357,7 +357,7 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement // this amount of seconds. 'delay' property is 0 by default. if (this.isShowing()) { - fireMenuSelected(); + fireMenuSelected(); int x = 0; int y = 0; diff --git a/javax/swing/JMenuBar.java b/javax/swing/JMenuBar.java index f63b3630c..01b6233ba 100644 --- a/javax/swing/JMenuBar.java +++ b/javax/swing/JMenuBar.java @@ -1,4 +1,4 @@ -/* JMenuBar.java -- +/* JMenuBar.java -- Copyright (C) 2002, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -83,7 +83,7 @@ public class JMenuBar extends JComponent implements Accessible, MenuElement /** Fired in a PropertyChangeEvent when the "model" changes. */ public static final String MODEL_CHANGED_PROPERTY = "model"; - + /** Fired in a PropertyChangeEvent when the "margin" changes. */ public static final String MARGIN_CHANGED_PROPERTY = "margin"; private static final long serialVersionUID = -8191026883931977036L; @@ -311,7 +311,7 @@ public class JMenuBar extends JComponent implements Accessible, MenuElement * This method does nothing by default. This method is need for the * MenuElement interface to be implemented. * - * @param isIncluded true if menuBar is included in the selection + * @param isIncluded true if menuBar is included in the selection * and false otherwise */ public void menuSelectionChanged(boolean isIncluded) @@ -320,7 +320,7 @@ public class JMenuBar extends JComponent implements Accessible, MenuElement } /** - * Paints border of the menu bar, if its borderPainted property is set to + * Paints border of the menu bar, if its borderPainted property is set to * true. * * @param g The graphics context with which to paint the border diff --git a/javax/swing/JMenuItem.java b/javax/swing/JMenuItem.java index b13727171..562126834 100644 --- a/javax/swing/JMenuItem.java +++ b/javax/swing/JMenuItem.java @@ -323,11 +323,11 @@ public class JMenuItem extends AbstractButton implements Accessible, break; case MouseEvent.MOUSE_ENTERED: if (isRolloverEnabled()) - model.setRollover(true); + model.setRollover(true); break; case MouseEvent.MOUSE_EXITED: if (isRolloverEnabled()) - model.setRollover(false); + model.setRollover(false); // for JMenu last element on the path is its popupMenu. // JMenu shouldn't me disarmed. @@ -335,11 +335,11 @@ public class JMenuItem extends AbstractButton implements Accessible, setArmed(false); break; case MouseEvent.MOUSE_PRESSED: - if ((event.getModifiers() & InputEvent.BUTTON1_MASK) != 0) - { - model.setArmed(true); - model.setPressed(true); - } + if ((event.getModifiers() & InputEvent.BUTTON1_MASK) != 0) + { + model.setArmed(true); + model.setPressed(true); + } break; case MouseEvent.MOUSE_RELEASED: break; @@ -529,14 +529,14 @@ public class JMenuItem extends AbstractButton implements Accessible, { if (changed) { - model.setArmed(true); + model.setArmed(true); if (this.getParent() instanceof JPopupMenu) ((JPopupMenu) this.getParent()).setSelected(this); } else { - model.setArmed(false); + model.setArmed(false); if (this.getParent() instanceof JPopupMenu) ((JPopupMenu) this.getParent()).getSelectionModel().clearSelection(); @@ -548,7 +548,7 @@ public class JMenuItem extends AbstractButton implements Accessible, * * @return $MenuElement[]$ Returns array of sub-components for this menu * item. By default menuItem doesn't have any subcomponents and so - * empty array is returned instead. + * empty array is returned instead. */ public MenuElement[] getSubElements() { diff --git a/javax/swing/JOptionPane.java b/javax/swing/JOptionPane.java index 070427072..3298f2246 100644 --- a/javax/swing/JOptionPane.java +++ b/javax/swing/JOptionPane.java @@ -66,7 +66,7 @@ public class JOptionPane extends JComponent implements Accessible { /** DOCUMENT ME! */ private static final long serialVersionUID = 686071432213084821L; - + /** * Creates a new AccessibleJOptionPane object. */ @@ -87,7 +87,7 @@ public class JOptionPane extends JComponent implements Accessible /** DOCUMENT ME! */ private static final long serialVersionUID = 5231143276678566796L; - + /** The value returned when cancel option is selected. */ public static final int CANCEL_OPTION = 2; diff --git a/javax/swing/JPopupMenu.java b/javax/swing/JPopupMenu.java index 9c06400de..724c3a2b4 100644 --- a/javax/swing/JPopupMenu.java +++ b/javax/swing/JPopupMenu.java @@ -179,12 +179,12 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement } /** - * Adds given menu item to the popup menu - * - * @param item menu item to add to the popup menu - * - * @return menu item that was added to the popup menu - */ + * Adds given menu item to the popup menu + * + * @param item menu item to add to the popup menu + * + * @return menu item that was added to the popup menu + */ public JMenuItem add(JMenuItem item) { this.insert(item, -1); @@ -463,7 +463,7 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement if (label != this.label) { String oldLabel = this.label; - this.label = label; + this.label = label; firePropertyChange(LABEL_CHANGED_PROPERTY, oldLabel, label); } } @@ -621,11 +621,11 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. - Insets insets = rootContainer.getInsets(); - popup.show(popupLocation.x - insets.left, - popupLocation.y - insets.top, size.width, - size.height); - } + Insets insets = rootContainer.getInsets(); + popup.show(popupLocation.x - insets.left, + popupLocation.y - insets.top, size.width, + size.height); + } } else { diff --git a/javax/swing/JRootPane.java b/javax/swing/JRootPane.java index 34cd80088..5414e8a59 100644 --- a/javax/swing/JRootPane.java +++ b/javax/swing/JRootPane.java @@ -47,6 +47,7 @@ import java.io.Serializable; import javax.accessibility.AccessibleRole; import javax.swing.plaf.RootPaneUI; + /** * This class is where JComponents are added to. Unlike awt where you could * just say frame.add(), with swing you need to say frame.getRootPane() @@ -96,7 +97,7 @@ public class JRootPane extends JComponent protected RootLayout() { } - + /** * DOCUMENT ME! * @@ -226,8 +227,8 @@ public class JRootPane extends JComponent { glassPane.setBounds(0, 0, containerSize.width, containerSize.height); - contentPane.setBounds(0, 0, containerSize.width, - containerSize.height); + contentPane.setBounds(0, 0, containerSize.width, + containerSize.height); } layeredPane.setSize(containerSize.width, containerSize.height); diff --git a/javax/swing/JScrollPane.java b/javax/swing/JScrollPane.java index c2f58a6e6..471408035 100644 --- a/javax/swing/JScrollPane.java +++ b/javax/swing/JScrollPane.java @@ -497,7 +497,7 @@ public class JScrollPane || vsb.getMaximum() != vs.height || vsb.getValue() != vr.y || vsb.getVisibleAmount() != vr.height)) - vsb.setValue(vr.y, vr.height, 0, vs.height); + vsb.setValue(vr.y, vr.height, 0, vs.height); if (hsb != null && (hsb.getMinimum() != 0 diff --git a/javax/swing/JTable.java b/javax/swing/JTable.java index c628b7152..9a3413213 100644 --- a/javax/swing/JTable.java +++ b/javax/swing/JTable.java @@ -41,8 +41,8 @@ package javax.swing; import java.awt.Color; import java.awt.Dimension; import java.awt.Rectangle; -import java.util.Vector; import java.util.Hashtable; +import java.util.Vector; import javax.accessibility.Accessible; import javax.swing.event.CellEditorListener; @@ -72,7 +72,7 @@ public class JTable extends JComponent public static final int AUTO_RESIZE_NEXT_COLUMN = 1; public static final int AUTO_RESIZE_OFF = 0; public static final int AUTO_RESIZE_SUBSEQUENT_COLUMNS = 2; - + protected boolean autoCreateColumnsFromModel; protected int autoResizeMode; protected TableCellEditor cellEditor; diff --git a/javax/swing/JTextField.java b/javax/swing/JTextField.java index 8872af690..86be4b7b4 100644 --- a/javax/swing/JTextField.java +++ b/javax/swing/JTextField.java @@ -42,6 +42,7 @@ import java.awt.Font; import java.awt.FontMetrics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; + import javax.accessibility.AccessibleStateSet; import javax.swing.text.Document; import javax.swing.text.JTextComponent; diff --git a/javax/swing/JToolBar.java b/javax/swing/JToolBar.java index 7b5121e76..5412afa6d 100644 --- a/javax/swing/JToolBar.java +++ b/javax/swing/JToolBar.java @@ -102,7 +102,7 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible } } - /** + /** * This is the private JToolBar layout manager. */ private class DefaultToolBarLayout implements LayoutManager @@ -112,7 +112,7 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible * * @param name The name of the component added. * @param comp The component that was added. - */ + */ public void addLayoutComponent(String name, Component comp) { // Do nothing. @@ -144,7 +144,7 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible Dimension tdims = c.getSize(); int start = 0; Dimension pref; - + if (getOrientation() == SwingUtilities.HORIZONTAL) { start += insets.left; @@ -196,14 +196,14 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible return preferredLayoutSize(parent); } - /** + /** * This method returns the preferred size of the given container given the * child components. * * @param parent The container to measure. * * @return The preferred size of the given container. - */ + */ public Dimension preferredLayoutSize(Container parent) { int orientation = getOrientation(); @@ -261,23 +261,23 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible return new Dimension(w, h); } - /** + /** * This method is called when the given component is removed from the * container. * * @param comp The component removed. - */ + */ public void removeLayoutComponent(Component comp) { // Do nothing. } } - /** + /** * This is an extension of JSeparator used in toolbars. Unlike JSeparator, * nothing is painted for this Separator, it is only blank space that * separates components. - */ + */ public static class Separator extends JSeparator { /** DOCUMENT ME! */ @@ -301,70 +301,70 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible setPreferredSize(size); } // Separator() - /** + /** * This method returns the String ID of the UI class of Separator. * * @return The UI class' String ID. - */ + */ public String getUIClassID() { return "ToolBarSeparatorUI"; - } // getUIClassID() + } // getUIClassID() - /** + /** * This method returns the preferred size of the Separator. * * @return The preferred size of the Separator. - */ + */ public Dimension getPreferredSize() { return super.getPreferredSize(); - } // getPreferredSize() + } // getPreferredSize() - /** + /** * This method returns the maximum size of the Separator. * * @return The maximum size of the Separator. - */ + */ public Dimension getMaximumSize() { return super.getPreferredSize(); - } // getMaximumSize() + } // getMaximumSize() - /** + /** * This method returns the minimum size of the Separator. * * @return The minimum size of the Separator. - */ + */ public Dimension getMinimumSize() { return super.getPreferredSize(); - } // getMinimumSize() + } // getMinimumSize() - /** + /** * This method returns the size of the Separator. * * @return The size of the Separator. - */ + */ public Dimension getSeparatorSize() { return super.getPreferredSize(); - } // getSeparatorSize() + } // getSeparatorSize() - /** + /** * This method sets the size of the Separator. * * @param size The new size of the Separator. - */ + */ public void setSeparatorSize(Dimension size) { setPreferredSize(size); - } // setSeparatorSize() - } // Separator + } // setSeparatorSize() + } // Separator /** DOCUMENT ME! */ - private static final long serialVersionUID = -1269915519555129643L; - + private static final long serialVersionUID = -1269915519555129643L; + /** Whether the JToolBar paints its border. */ private transient boolean paintBorder = true; @@ -378,10 +378,10 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible private transient boolean rollover; /** The orientation of the JToolBar. */ - private int orientation = HORIZONTAL; + private int orientation = HORIZONTAL; /** Fired in a PropertyChangeEvent when the orientation property changes. */ - public static final String ORIENTATION_CHANGED_PROPERTY = "orientation"; + public static final String ORIENTATION_CHANGED_PROPERTY = "orientation"; /** Fired in a PropertyChangeEvent when the floatable property changes. */ public static final String FLOATABLE_CHANGED_PROPERTY = "floatable"; @@ -395,127 +395,127 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible /** Fired in a PropertyChangeEvent when the rollover property changes. */ public static final String ROLLOVER_CHANGED_PROPERTY = "rollover"; - /** + /** * This method creates a new JToolBar object with horizontal orientation * and no name. - */ + */ public JToolBar() { this(null, HORIZONTAL); - } // JToolBar() + } // JToolBar() - /** + /** * This method creates a new JToolBar with the given orientation and no * name. * - * @param orientation JToolBar orientation (HORIZONTAL or VERTICAL) - */ + * @param orientation JToolBar orientation (HORIZONTAL or VERTICAL) + */ public JToolBar(int orientation) { - this(null, orientation); - } // JToolBar() + this(null, orientation); + } // JToolBar() - /** + /** * This method creates a new JToolBar object with the given name and * horizontal orientation. * - * @param name Name assigned to undocked tool bar. - */ + * @param name Name assigned to undocked tool bar. + */ public JToolBar(String name) { - this(name, HORIZONTAL); - } // JToolBar() + this(name, HORIZONTAL); + } // JToolBar() - /** + /** * This method creates a new JToolBar object with the given name and * orientation. * - * @param name Name assigned to undocked tool bar. - * @param orientation JToolBar orientation (HORIZONTAL or VERTICAL) - */ + * @param name Name assigned to undocked tool bar. + * @param orientation JToolBar orientation (HORIZONTAL or VERTICAL) + */ public JToolBar(String name, int orientation) { - setName(name); + setName(name); setOrientation(orientation); setLayout(new DefaultToolBarLayout()); revalidate(); - updateUI(); - } // JToolBar() + updateUI(); + } // JToolBar() - /** + /** * This method adds a new JButton that performs the given Action to the * JToolBar. * * @param action The Action to add to the JToolBar. * * @return The JButton that wraps the Action. - */ + */ public JButton add(Action action) { JButton b = createActionComponent(action); add(b); return b; - } // add() + } // add() - /** + /** * This method paints the border if the borderPainted property is true. * * @param graphics The graphics object to paint with. - */ + */ protected void paintBorder(Graphics graphics) { if (paintBorder && isFloatable()) super.paintBorder(graphics); - } // paintBorder() + } // paintBorder() - /** + /** * This method returns the UI class used to paint this JToolBar. * * @return The UI class for this JToolBar. - */ + */ public ToolBarUI getUI() { - return (ToolBarUI) ui; - } // getUI() + return (ToolBarUI) ui; + } // getUI() - /** + /** * This method sets the UI used with the JToolBar. * * @param ui The UI used with the JToolBar. - */ + */ public void setUI(ToolBarUI ui) { - super.setUI(ui); - } // setUI() + super.setUI(ui); + } // setUI() - /** + /** * This method resets the UI used to the Look and Feel defaults. - */ + */ public void updateUI() { - setUI((ToolBarUI)UIManager.getUI(this)); + setUI((ToolBarUI) UIManager.getUI(this)); revalidate(); repaint(); - } // updateUI() + } // updateUI() - /** + /** * This method returns the String identifier for the UI class to the used * with the JToolBar. * * @return The String identifier for the UI class. - */ + */ public String getUIClassID() { return "ToolBarUI"; - } // getUIClassID() + } // getUIClassID() - /** + /** * This method sets the rollover property for the JToolBar. In rollover * mode, JButtons inside the JToolBar will only display their borders when * the mouse is moving over them. * * @param b The new rollover property. - */ + */ public void setRollover(boolean b) { if (b != rollover) @@ -555,37 +555,37 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible return i; return -1; - } // getComponentIndex() + } // getComponentIndex() - /** + /** * This method returns the component at the given index. * * @param index The index of the component. * * @return The component at the given index. - */ + */ public Component getComponentAtIndex(int index) { return getComponent(index); - } // getComponentAtIndex() + } // getComponentAtIndex() - /** + /** * This method returns the margin property. * * @return The margin property. - */ + */ public Insets getMargin() { return margin; - } // getMargin() + } // getMargin() - /** + /** * This method sets the margin property. The margin property determines the * extra space between the children components of the JToolBar and the * border. * * @param margin The margin property. - */ + */ public void setMargin(Insets margin) { if ((this.margin != null && margin == null) @@ -601,24 +601,24 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible revalidate(); repaint(); } - } // setMargin() + } // setMargin() - /** + /** * This method returns the borderPainted property. * * @return The borderPainted property. - */ + */ public boolean isBorderPainted() { return paintBorder; - } // isBorderPainted() + } // isBorderPainted() - /** + /** * This method sets the borderPainted property. If set to false, the border * will not be painted. * * @param painted Whether the border will be painted. - */ + */ public void setBorderPainted(boolean painted) { if (painted != paintBorder) @@ -628,24 +628,24 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible paintBorder); repaint(); } - } // setBorderPainted() + } // setBorderPainted() - /** + /** * This method returns the floatable property. * * @return The floatable property. - */ + */ public boolean isFloatable() { return floatable; - } // isFloatable() + } // isFloatable() - /** + /** * This method sets the floatable property. If set to false, the JToolBar * cannot be dragged. * * @param floatable Whether the JToolBar can be dragged. - */ + */ public void setFloatable(boolean floatable) { if (floatable != this.floatable) @@ -653,86 +653,86 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible this.floatable = floatable; firePropertyChange(FLOATABLE_CHANGED_PROPERTY, ! floatable, floatable); } - } // setFloatable() + } // setFloatable() - /** + /** * This method returns the orientation of the JToolBar. * * @return The orientation of the JToolBar. - */ + */ public int getOrientation() { return orientation; - } // getOrientation() + } // getOrientation() - /** + /** * This method sets the layout manager to be used with the JToolBar. * * @param mgr The Layout Manager used with the JToolBar. - */ + */ public void setLayout(LayoutManager mgr) { - super.setLayout(mgr); + super.setLayout(mgr); revalidate(); repaint(); - } // setLayout() + } // setLayout() - /** + /** * This method sets the orientation property for JToolBar. * * @param orientation The new orientation for JToolBar. * * @throws IllegalArgumentException If the orientation is not HORIZONTAL or * VERTICAL. - */ + */ public void setOrientation(int orientation) { - if (orientation != HORIZONTAL && orientation != VERTICAL) + if (orientation != HORIZONTAL && orientation != VERTICAL) throw new IllegalArgumentException(orientation + " is not a legal orientation"); - if (orientation != this.orientation) - { - int oldOrientation = this.orientation; - this.orientation = orientation; - firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation, - this.orientation); + if (orientation != this.orientation) + { + int oldOrientation = this.orientation; + this.orientation = orientation; + firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation, + this.orientation); revalidate(); repaint(); - } - } // setOrientation() + } + } // setOrientation() - /** + /** * This method adds a Separator of default size to the JToolBar. - */ + */ public void addSeparator() { add(new Separator()); - } // addSeparator() + } // addSeparator() - /** + /** * This method adds a Separator with the given size to the JToolBar. * * @param size The size of the Separator. - */ + */ public void addSeparator(Dimension size) { add(new Separator(size)); - } // addSeparator() + } // addSeparator() - /** + /** * This method is used to create JButtons which can be added to the JToolBar * for the given action. * * @param action The action to create a JButton for. * * @return The JButton created from the action. - */ + */ protected JButton createActionComponent(Action action) { return new JButton(action); - } // createActionComponent() + } // createActionComponent() - /** + /** * This method creates a pre-configured PropertyChangeListener which updates * the control as changes are made to the Action. However, this is no * longer the recommended way of adding Actions to Containers. As such, @@ -741,36 +741,36 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible * @param button The JButton to configure a PropertyChangeListener for. * * @return null. - */ + */ protected PropertyChangeListener createActionChangeListener(JButton button) { // XXX: As specified, this returns null. But seems kind of strange, usually deprecated methods don't just return null, verify! return null; - } // createActionChangeListener() + } // createActionChangeListener() - /** + /** * This method overrides Container's addImpl method. If a JButton is added, * it is disabled. * * @param component The Component to add. * @param constraints The Constraints placed on the component. * @param index The index to place the Component at. - */ + */ protected void addImpl(Component component, Object constraints, int index) { // XXX: Sun says disable button but test cases show otherwise. super.addImpl(component, constraints, index); } // addImpl() - /** + /** * This method returns a String description of the JToolBar. * * @return A String description of the JToolBar. - */ + */ protected String paramString() { return "JToolBar"; - } // paramString() + } // paramString() /** * getAccessibleContext @@ -781,7 +781,7 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible { if (accessibleContext == null) accessibleContext = new AccessibleJToolBar(); - + return accessibleContext; } } diff --git a/javax/swing/MenuSelectionManager.java b/javax/swing/MenuSelectionManager.java index a61ca4ec5..a842c47e3 100644 --- a/javax/swing/MenuSelectionManager.java +++ b/javax/swing/MenuSelectionManager.java @@ -272,10 +272,10 @@ public class MenuSelectionManager MenuElement[] subComponents = ((MenuElement) mouseOverMenuComp) .getSubElements(); - for (int i = 0; i < subComponents.length; i++) - { - subComponents[i].processMouseEvent(event, path, manager); - } + for (int i = 0; i < subComponents.length; i++) + { + subComponents[i].processMouseEvent(event, path, manager); + } */ } } diff --git a/javax/swing/RepaintManager.java b/javax/swing/RepaintManager.java index 05b974f91..29cee02ea 100644 --- a/javax/swing/RepaintManager.java +++ b/javax/swing/RepaintManager.java @@ -263,7 +263,7 @@ public class RepaintManager && ancestor instanceof JComponent && ((JComponent) ancestor).isValidateRoot()) component = (JComponent) ancestor; - + if (invalidComponents.contains(component)) return; diff --git a/javax/swing/ScrollPaneLayout.java b/javax/swing/ScrollPaneLayout.java index 5e51e1895..9d2494b4c 100644 --- a/javax/swing/ScrollPaneLayout.java +++ b/javax/swing/ScrollPaneLayout.java @@ -237,7 +237,7 @@ public class ScrollPaneLayout if (viewportBorder != null) { - viewportInsets = viewportBorder.getBorderInsets(parent); + viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); @@ -308,12 +308,12 @@ public class ScrollPaneLayout if (viewportBorder != null) { - viewportInsets = viewportBorder.getBorderInsets(parent); + viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); } - + if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); @@ -321,7 +321,7 @@ public class ScrollPaneLayout maybeSetMinimumSize(viewport, viewportSize); maybeSetMinimumSize(colHead, columnHeaderSize); maybeSetMinimumSize(rowHead, rowHeaderSize); - + if (vsbPolicy != VERTICAL_SCROLLBAR_NEVER) maybeSetMinimumSize(vsb, verticalScrollBarSize); @@ -418,7 +418,7 @@ public class ScrollPaneLayout if (!showVsb) x3 = x4; - + if (!showHsb) y3 = y4; @@ -436,7 +436,7 @@ public class ScrollPaneLayout if (showVsb) { vsb.setVisible(true); - vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); + vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); @@ -444,7 +444,7 @@ public class ScrollPaneLayout if (showHsb) { hsb.setVisible(true); - hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); + hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); diff --git a/javax/swing/UIManager.java b/javax/swing/UIManager.java index eca96f910..4aaed6f77 100644 --- a/javax/swing/UIManager.java +++ b/javax/swing/UIManager.java @@ -1,5 +1,5 @@ /* UIManager.java -- - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -92,7 +92,7 @@ public class UIManager implements Serializable * * @param listener the listener to add */ - public static void addPropertyChangeListener (PropertyChangeListener listener) + public static void addPropertyChangeListener(PropertyChangeListener listener) { // FIXME } @@ -102,7 +102,7 @@ public class UIManager implements Serializable * * @param listener the listener to remove */ - public static void removePropertyChangeListener (PropertyChangeListener listener) + public static void removePropertyChangeListener(PropertyChangeListener listener) { // FIXME } @@ -114,7 +114,7 @@ public class UIManager implements Serializable * * @since 1.4 */ - public static PropertyChangeListener[] getPropertyChangeListeners () + public static PropertyChangeListener[] getPropertyChangeListeners() { // FIXME throw new Error ("Not implemented"); diff --git a/javax/swing/ViewportLayout.java b/javax/swing/ViewportLayout.java index 4738baccd..190eaaaf5 100644 --- a/javax/swing/ViewportLayout.java +++ b/javax/swing/ViewportLayout.java @@ -67,7 +67,7 @@ public class ViewportLayout implements LayoutManager, Serializable { JViewport vp = (JViewport)parent; Component view = vp.getView(); - return view.getPreferredSize(); + return view.getPreferredSize(); } public Dimension minimumLayoutSize(Container parent) { |