diff options
Diffstat (limited to 'libjava/classpath/javax/swing/plaf')
136 files changed, 7007 insertions, 7031 deletions
diff --git a/libjava/classpath/javax/swing/plaf/BorderUIResource.java b/libjava/classpath/javax/swing/plaf/BorderUIResource.java index 317cb09..1742494 100644 --- a/libjava/classpath/javax/swing/plaf/BorderUIResource.java +++ b/libjava/classpath/javax/swing/plaf/BorderUIResource.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -96,8 +96,8 @@ public class BorderUIResource implements Border, UIResource, Serializable * called. */ private static Border loweredBevelBorderUIResource; - - + + /** * A shared instance of a {@link BevelBorderUIResource} whose * <code>bevelType</code> is {@link @@ -106,8 +106,8 @@ public class BorderUIResource implements Border, UIResource, Serializable * called. */ private static Border raisedBevelBorderUIResource; - - + + /** * A shared instance of a {@link LineBorderUIResource} for * a one-pixel thick black line, or <code>null</code> if @@ -132,7 +132,7 @@ public class BorderUIResource implements Border, UIResource, Serializable etchedBorderUIResource = new EtchedBorderUIResource(); return etchedBorderUIResource; } - + /** * Returns a shared instance of {@link BevelBorderUIResource} whose @@ -170,8 +170,8 @@ public class BorderUIResource implements Border, UIResource, Serializable BevelBorder.RAISED); return raisedBevelBorderUIResource; } - - + + /** * Returns a shared instance of {@link LineBorderUIResource} for * a black, one-pixel width border. @@ -193,23 +193,23 @@ public class BorderUIResource implements Border, UIResource, Serializable * The wrapped border. */ private Border delegate; - - + + /** * Constructs a <code>BorderUIResource</code> for wrapping * a <code>Border</code> object. - * + * * @param delegate the border to be wrapped. */ public BorderUIResource(Border delegate) { if (delegate == null) throw new IllegalArgumentException(); - + this.delegate = delegate; } - + /** * Paints the border around an enclosed component by calling * the <code>paintBorder</code> method of the wrapped delegate. @@ -226,8 +226,8 @@ public class BorderUIResource implements Border, UIResource, Serializable { delegate.paintBorder(c, g, x, y, width, height); } - - + + /** * Measures the width of this border by calling the * <code>getBorderInsets</code> method of the wrapped @@ -240,11 +240,11 @@ public class BorderUIResource implements Border, UIResource, Serializable * width of the border at the respective edge. */ public Insets getBorderInsets(Component c) - { + { return delegate.getBorderInsets(c); } - - + + /** * Determines whether this border fills every pixel in its area * when painting by calling the <code>isBorderOpaque</code> @@ -255,7 +255,7 @@ public class BorderUIResource implements Border, UIResource, Serializable * can shine through the border. */ public boolean isBorderOpaque() - { + { return delegate.isBorderOpaque(); } @@ -272,12 +272,12 @@ public class BorderUIResource implements Border, UIResource, Serializable * @author Brian Jones (cbj@gnu.org) * @author Sascha Brawer (brawer@dandelis.ch) */ - public static class BevelBorderUIResource + public static class BevelBorderUIResource extends BevelBorder implements UIResource, Serializable { private static final long serialVersionUID = -1275542891108351642L; - + /** * Constructs a BevelBorderUIResource whose colors will be derived * from the background of the enclosed component. The background @@ -296,12 +296,12 @@ public class BorderUIResource implements Border, UIResource, Serializable * @throws IllegalArgumentException if <code>bevelType</code> has * an unsupported value. */ - public BevelBorderUIResource(int bevelType) - { + public BevelBorderUIResource(int bevelType) + { super(bevelType); } - - + + /** * Constructs a BevelBorderUIResource given its appearance type * and two colors for its highlight and shadow. @@ -334,9 +334,9 @@ public class BorderUIResource implements Border, UIResource, Serializable * @throws NullPointerException if <code>highlight</code> or * <code>shadow</code> is <code>null</code>. */ - public BevelBorderUIResource(int bevelType, - Color highlight, - Color shadow) + public BevelBorderUIResource(int bevelType, + Color highlight, + Color shadow) { super(bevelType, highlight, shadow); } @@ -382,15 +382,15 @@ public class BorderUIResource implements Border, UIResource, Serializable Color highlightOuter, Color highlightInner, Color shadowOuter, - Color shadowInner) + Color shadowInner) { super(bevelType, highlightOuter, highlightInner, shadowOuter, shadowInner); } } - - + + /** * A {@link javax.swing.border.CompoundBorder} that also implements the * {@link UIResource} marker interface. This is useful for @@ -408,7 +408,7 @@ public class BorderUIResource implements Border, UIResource, Serializable implements UIResource, Serializable { private static final long serialVersionUID = 7550017084975167341L; - + /** * Constructs a CompoundBorderUIResource with the specified inside * and outside borders. @@ -429,8 +429,8 @@ public class BorderUIResource implements Border, UIResource, Serializable super(outsideBorder, insideBorder); } } - - + + /** * An {@link javax.swing.border.EmptyBorder} that also implements the * {@link UIResource} marker interface. This is useful for @@ -447,12 +447,12 @@ public class BorderUIResource implements Border, UIResource, Serializable * @author Brian Jones (cbj@gnu.org) * @author Sascha Brawer (brawer@dandelis.ch) */ - public static class EmptyBorderUIResource + public static class EmptyBorderUIResource extends EmptyBorder implements UIResource, Serializable { private static final long serialVersionUID = -4914187529340071708L; - + /** * Constructs an empty border given the number of pixels required * on each side. @@ -473,8 +473,8 @@ public class BorderUIResource implements Border, UIResource, Serializable { super(top, left, bottom, right); } - - + + /** * Constructs an empty border given the number of pixels required * on each side, passed in an Insets object. @@ -486,8 +486,8 @@ public class BorderUIResource implements Border, UIResource, Serializable super(insets); } } - - + + /** * An {@link javax.swing.border.EtchedBorder} that also implements the * {@link UIResource} marker interface. This is useful for @@ -509,7 +509,7 @@ public class BorderUIResource implements Border, UIResource, Serializable implements UIResource, Serializable { private static final long serialVersionUID = -8186391754165296656L; - + /** * Constructs an EtchedBorderUIResource that appears lowered into * the surface. The colors will be derived from the background @@ -519,8 +519,8 @@ public class BorderUIResource implements Border, UIResource, Serializable { super(); } - - + + /** * Constructs an EtchedBorderUIResource with the specified * appearance. The colors will be derived from the background @@ -537,12 +537,12 @@ public class BorderUIResource implements Border, UIResource, Serializable * @throws IllegalArgumentException if <code>etchType</code> has * an unsupported value. */ - public EtchedBorderUIResource(int etchType) + public EtchedBorderUIResource(int etchType) { super(etchType); } - - + + /** * Constructs a lowered EtchedBorderUIResource, explicitly * selecting the colors that will be used for highlight and @@ -560,8 +560,8 @@ public class BorderUIResource implements Border, UIResource, Serializable { super(highlight, shadow); } - - + + /** * Constructs an EtchedBorderUIResource with the specified * appearance, explicitly selecting the colors that will be used @@ -590,8 +590,8 @@ public class BorderUIResource implements Border, UIResource, Serializable super(etchType, highlight, shadow); } } - - + + /** * A {@link javax.swing.border.LineBorder} that also implements the * {@link UIResource} marker interface. This is useful for @@ -612,7 +612,7 @@ public class BorderUIResource implements Border, UIResource, Serializable implements UIResource, Serializable { private static final long serialVersionUID = -6171232338180172310L; - + /** * Constructs a LineBorderUIResource given its color. The border * will be one pixel thick and have plain corners. @@ -621,10 +621,10 @@ public class BorderUIResource implements Border, UIResource, Serializable */ public LineBorderUIResource(Color color) { - super(color); + super(color); } - - + + /** * Constructs a LineBorder given its color and thickness. The * border will have plain corners. @@ -636,13 +636,13 @@ public class BorderUIResource implements Border, UIResource, Serializable { super(color, thickness); } - - + + /* Note: Since JDK1.3, javax.swing.border.LineBorder also has a * constructor which accepts a value for the roundedCorners * property. However, as of JDK1.4.1, the LineBorderUIResource * subclass does not have a corresponding constructor. - * + * * A request for enhancing the Swing API has been filed with Sun: * http://developer.java.sun.com/developer/bugParade/bugs/4879999.html */ @@ -669,7 +669,7 @@ public class BorderUIResource implements Border, UIResource, Serializable implements UIResource, Serializable { private static final long serialVersionUID = -8107923147541851122L; - + /** * Constructs a MatteBorderUIResource given the width on each side * and a fill color. @@ -690,8 +690,8 @@ public class BorderUIResource implements Border, UIResource, Serializable { super(top, left, bottom, right, color); } - - + + /** * Constructs a MatteBorderUIResource given the width on each side * and an icon for tiling the border area. @@ -712,8 +712,8 @@ public class BorderUIResource implements Border, UIResource, Serializable { super(top, left, bottom, right, tileIcon); } - - + + /** * Constructs a MatteBorderUIResource given an icon for tiling the * border area. The icon width is used for the border insets at @@ -724,15 +724,15 @@ public class BorderUIResource implements Border, UIResource, Serializable * height="150" alt="[A picture of a MatteBorder made by this * constructor]" /></p> * - * @param tileIcon an icon for tiling the border area. + * @param tileIcon an icon for tiling the border area. */ public MatteBorderUIResource(Icon tileIcon) { super(tileIcon); } } - - + + /** * A {@link javax.swing.border.TitledBorder} that also implements the * {@link UIResource} marker interface. This is useful for @@ -750,7 +750,7 @@ public class BorderUIResource implements Border, UIResource, Serializable implements UIResource, Serializable { private static final long serialVersionUID = 7667113547406407427L; - + /** * Constructs a TitledBorderUIResource given the text of its title. * @@ -761,8 +761,8 @@ public class BorderUIResource implements Border, UIResource, Serializable { super(title); } - - + + /** * Constructs an initially untitled TitledBorderUIResource * given another border. @@ -775,8 +775,8 @@ public class BorderUIResource implements Border, UIResource, Serializable { super(border); } - - + + /** * Constructs a TitledBorder given its border and title text. * @@ -878,8 +878,8 @@ public class BorderUIResource implements Border, UIResource, Serializable super(border, title, titleJustification, titlePosition, titleFont); } - - + + /** * Constructs a TitledBorder given its border, title text, * horizontal alignment, vertical position, font, and color. @@ -928,4 +928,3 @@ public class BorderUIResource implements Border, UIResource, Serializable } } } - diff --git a/libjava/classpath/javax/swing/plaf/ColorChooserUI.java b/libjava/classpath/javax/swing/plaf/ColorChooserUI.java index 1609141..e9cb32c 100644 --- a/libjava/classpath/javax/swing/plaf/ColorChooserUI.java +++ b/libjava/classpath/javax/swing/plaf/ColorChooserUI.java @@ -56,4 +56,3 @@ public abstract class ColorChooserUI extends ComponentUI /* The constructor does not do anything. */ } } - diff --git a/libjava/classpath/javax/swing/plaf/ColorUIResource.java b/libjava/classpath/javax/swing/plaf/ColorUIResource.java index 36e10f2..3c9db2e 100644 --- a/libjava/classpath/javax/swing/plaf/ColorUIResource.java +++ b/libjava/classpath/javax/swing/plaf/ColorUIResource.java @@ -62,7 +62,7 @@ public class ColorUIResource extends Color implements UIResource * @param g the green intensity, which must be in the range [0 .. 255]. * @param b the blue intensity, which must be in the range [0 .. 255]. * - * @throws IllegalArgumentException if any of the values is outside the + * @throws IllegalArgumentException if any of the values is outside the * specified range. */ public ColorUIResource(int r, int g, int b) @@ -95,7 +95,7 @@ public class ColorUIResource extends Color implements UIResource * @param g the green intensity, which must be in the range [0.0 .. 1.0]. * @param b the blue intensity, which must be in the range [0.0 .. 1.0]. * - * @throws IllegalArgumentException if any of the values is outside the + * @throws IllegalArgumentException if any of the values is outside the * specified range. */ public ColorUIResource(float r, float g, float b) diff --git a/libjava/classpath/javax/swing/plaf/ComboBoxUI.java b/libjava/classpath/javax/swing/plaf/ComboBoxUI.java index 58f6e81..0a06d26 100644 --- a/libjava/classpath/javax/swing/plaf/ComboBoxUI.java +++ b/libjava/classpath/javax/swing/plaf/ComboBoxUI.java @@ -55,7 +55,7 @@ public abstract class ComboBoxUI extends ComponentUI { // Nothing to do here. } - + /** * Sets the visibility of the popup button. * @@ -77,7 +77,7 @@ public abstract class ComboBoxUI extends ComponentUI * visible, <code>false</code> otherwise. */ public abstract boolean isPopupVisible(JComboBox c); - + /** * Determines whether the combo box can receive input focus. * @@ -88,5 +88,5 @@ public abstract class ComboBoxUI extends ComponentUI * input focus, <code>false</code> otherwise. */ public abstract boolean isFocusTraversable(JComboBox c); - + } diff --git a/libjava/classpath/javax/swing/plaf/ComponentInputMapUIResource.java b/libjava/classpath/javax/swing/plaf/ComponentInputMapUIResource.java index cfc43e4..4553562 100644 --- a/libjava/classpath/javax/swing/plaf/ComponentInputMapUIResource.java +++ b/libjava/classpath/javax/swing/plaf/ComponentInputMapUIResource.java @@ -66,4 +66,3 @@ public class ComponentInputMapUIResource extends ComponentInputMap super(component); } } - diff --git a/libjava/classpath/javax/swing/plaf/ComponentUI.java b/libjava/classpath/javax/swing/plaf/ComponentUI.java index be7b68a..35f2de3 100644 --- a/libjava/classpath/javax/swing/plaf/ComponentUI.java +++ b/libjava/classpath/javax/swing/plaf/ComponentUI.java @@ -80,7 +80,7 @@ import javax.swing.JComponent; * * @author Sascha Brawer (brawer@dandelis.ch) */ -public abstract class ComponentUI +public abstract class ComponentUI { /** * Constructs a new UI delegate. @@ -89,8 +89,8 @@ public abstract class ComponentUI { // Nothing to do here. } - - + + /** * Sets up the specified component so it conforms the the design * guidelines of the implemented look and feel. When the look and @@ -145,8 +145,8 @@ public abstract class ComponentUI { // The default implementation does not change any properties. } - - + + /** * Paints the component according to the design guidelines * of the look and feel. Most subclasses will want to override @@ -162,8 +162,8 @@ public abstract class ComponentUI // Nothing is done here. This method is meant to be overridden by // subclasses. } - - + + /** * Fills the specified component with its background color * (unless the <code>opaque</code> property is <code>false</code>) @@ -192,7 +192,7 @@ public abstract class ComponentUI } paint(g, c); } - + /** * Determines the preferred size of a component. The default * implementation returns <code>null</code>, which means that @@ -209,8 +209,8 @@ public abstract class ComponentUI { return null; } - - + + /** * Determines the minimum size of a component. The default * implementation calls {@link #getPreferredSize}, but subclasses @@ -265,7 +265,7 @@ public abstract class ComponentUI * inside its parent. */ public boolean contains(JComponent c, int x, int y) - { + { /* JComponent.contains calls the ui delegate for hit * testing. Therefore, endless mutual recursion would result if we * called c.contains(x, y) here. @@ -282,8 +282,8 @@ public abstract class ComponentUI return (x >= 0) && (x < c.getWidth()) && (y >= 0) && (y < c.getHeight()); } - - + + /** * Creates a delegate object for the specified component. Users * should use the <code>createUI</code> method of a suitable @@ -298,7 +298,7 @@ public abstract class ComponentUI "javax.swing.plaf.ComponentUI does not implement createUI; call " + "createUI on a subclass."); } - + /** * Counts the number of accessible children in the component. The diff --git a/libjava/classpath/javax/swing/plaf/FileChooserUI.java b/libjava/classpath/javax/swing/plaf/FileChooserUI.java index e9be8f2..fafd21d2 100644 --- a/libjava/classpath/javax/swing/plaf/FileChooserUI.java +++ b/libjava/classpath/javax/swing/plaf/FileChooserUI.java @@ -63,7 +63,7 @@ public abstract class FileChooserUI extends ComponentUI // Nothing to do here. } - + /** * Returns a <code>FileFilter</code> that accepts every file. While * the filtering itself is not specific to any look and feel, the diff --git a/libjava/classpath/javax/swing/plaf/IconUIResource.java b/libjava/classpath/javax/swing/plaf/IconUIResource.java index 8ac9e08..48503f8 100644 --- a/libjava/classpath/javax/swing/plaf/IconUIResource.java +++ b/libjava/classpath/javax/swing/plaf/IconUIResource.java @@ -63,7 +63,7 @@ public class IconUIResource implements Icon, UIResource, Serializable /** - * The icon that is wrapped by this <code>IconUIResource</code> (never + * The icon that is wrapped by this <code>IconUIResource</code> (never * <code>null</code>). */ private Icon delegate; diff --git a/libjava/classpath/javax/swing/plaf/SplitPaneUI.java b/libjava/classpath/javax/swing/plaf/SplitPaneUI.java index 59ededf..faf17cb 100644 --- a/libjava/classpath/javax/swing/plaf/SplitPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/SplitPaneUI.java @@ -93,8 +93,8 @@ public abstract class SplitPaneUI extends ComponentUI * @return the current location of the divider. */ public abstract int getDividerLocation(JSplitPane pane); - - + + /** * Determines the minimum location of the divider. * diff --git a/libjava/classpath/javax/swing/plaf/TabbedPaneUI.java b/libjava/classpath/javax/swing/plaf/TabbedPaneUI.java index 01a7720..59136e0 100644 --- a/libjava/classpath/javax/swing/plaf/TabbedPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/TabbedPaneUI.java @@ -60,8 +60,8 @@ public abstract class TabbedPaneUI extends ComponentUI { // Nothing to do here. } - - + + /** * Determines which tab lies at a given position. * @@ -79,7 +79,7 @@ public abstract class TabbedPaneUI extends ComponentUI */ public abstract int tabForCoordinate(JTabbedPane pane, int x, int y); - + /** * Calculates the bounding box of a tab. @@ -108,4 +108,3 @@ public abstract class TabbedPaneUI extends ComponentUI */ public abstract int getTabRunCount(JTabbedPane pane); } - diff --git a/libjava/classpath/javax/swing/plaf/TextUI.java b/libjava/classpath/javax/swing/plaf/TextUI.java index 9f2737c..424cee9 100644 --- a/libjava/classpath/javax/swing/plaf/TextUI.java +++ b/libjava/classpath/javax/swing/plaf/TextUI.java @@ -61,7 +61,7 @@ public abstract class TextUI extends ComponentUI { /** * Constructs a new <code>TextUI</code>. - */ + */ public TextUI() { // Nothing to do here. @@ -155,7 +155,7 @@ public abstract class TextUI extends ComponentUI */ public abstract int viewToModel(JTextComponent tc, Point loc, Position.Bias[] outBias); - + /** @@ -235,7 +235,7 @@ public abstract class TextUI extends ComponentUI Position.Bias startBias, Position.Bias endBias); - + /** * Retrieves the <code>EditorKit</code> managing policies and * persistent state. @@ -246,8 +246,8 @@ public abstract class TextUI extends ComponentUI * @return the <code>EditorKit</code> used by <code>tc</code>. */ public abstract EditorKit getEditorKit(JTextComponent tc); - - + + /** * Retrieves the root of the view tree that visually presents * the text. diff --git a/libjava/classpath/javax/swing/plaf/UIResource.java b/libjava/classpath/javax/swing/plaf/UIResource.java index fe398fe..511aaa7 100644 --- a/libjava/classpath/javax/swing/plaf/UIResource.java +++ b/libjava/classpath/javax/swing/plaf/UIResource.java @@ -1,4 +1,4 @@ -/* UIResource.java +/* UIResource.java Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -44,14 +44,14 @@ package javax.swing.plaf; * renderer with <code>ComponentUI.uninstallUI()</code> the renderer * property is set to <code>null</code>. * <br> - * A comparison against null can be used with all properties except for - * the <code>java.awt.Component</code> properties font, foreground, and + * A comparison against null can be used with all properties except for + * the <code>java.awt.Component</code> properties font, foreground, and * background. The container can provide the value of the properties if * they are initialized or set to <code>null</code>. - * + * * @author Brian Jones * - * @see ComponentUI + * @see ComponentUI */ public interface UIResource { diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicArrowButton.java b/libjava/classpath/javax/swing/plaf/basic/BasicArrowButton.java index 781269b..1d6e887 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicArrowButton.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicArrowButton.java @@ -51,15 +51,15 @@ import javax.swing.SwingConstants; * A button that displays an arrow (triangle) that points {@link #NORTH}, * {@link #SOUTH}, {@link #EAST} or {@link #WEST}. This button is used by * the {@link BasicComboBoxUI} class. - * + * * @see BasicComboBoxUI#createArrowButton */ public class BasicArrowButton extends JButton implements SwingConstants { - /** - * The direction that the arrow points. - * + /** + * The direction that the arrow points. + * * @see #getDirection() */ protected int direction; @@ -89,7 +89,7 @@ public class BasicArrowButton extends JButton implements SwingConstants * in the specified direction. If the <code>direction</code> is not one of * the specified constants, no arrow is drawn. * - * @param direction The direction the arrow points in (one of: + * @param direction The direction the arrow points in (one of: * {@link #NORTH}, {@link #SOUTH}, {@link #EAST} and {@link #WEST}). */ public BasicArrowButton(int direction) @@ -103,7 +103,7 @@ public class BasicArrowButton extends JButton implements SwingConstants * Creates a new BasicArrowButton object with the given colors and * direction. * - * @param direction The direction to point in (one of: + * @param direction The direction to point in (one of: * {@link #NORTH}, {@link #SOUTH}, {@link #EAST} and {@link #WEST}). * @param background The background color. * @param shadow The shadow color. @@ -133,7 +133,7 @@ public class BasicArrowButton extends JButton implements SwingConstants } /** - * Returns the direction of the arrow (one of: {@link #NORTH}, + * Returns the direction of the arrow (one of: {@link #NORTH}, * {@link #SOUTH}, {@link #EAST} and {@link #WEST}). * * @return The direction of the arrow. @@ -146,7 +146,7 @@ public class BasicArrowButton extends JButton implements SwingConstants /** * Sets the direction of the arrow. * - * @param dir The new direction of the arrow (one of: {@link #NORTH}, + * @param dir The new direction of the arrow (one of: {@link #NORTH}, * {@link #SOUTH}, {@link #EAST} and {@link #WEST}). */ public void setDirection(int dir) @@ -163,23 +163,23 @@ public class BasicArrowButton extends JButton implements SwingConstants public void paint(Graphics g) { super.paint(g); - + int height = getHeight(); int size = height / 4; - + int x = (getWidth() - size) / 2; int y = (height - size) / 2; - + ButtonModel m = getModel(); if (m.isArmed()) { x++; y++; } - + paintTriangle(g, x, y, size, direction, isEnabled()); } - + /** * Returns the preferred size of the arrow button. * @@ -220,17 +220,17 @@ public class BasicArrowButton extends JButton implements SwingConstants } /** - * Paints a triangle with the given size, location and direction. It is + * Paints a triangle with the given size, location and direction. It is * difficult to explain the rationale behind the positioning of the triangle - * relative to the given (x, y) position - by trial and error we seem to - * match the behaviour of the reference implementation (which is missing a + * relative to the given (x, y) position - by trial and error we seem to + * match the behaviour of the reference implementation (which is missing a * specification for this method). * * @param g the graphics device. * @param x the x-coordinate for the triangle's location. * @param y the y-coordinate for the triangle's location. * @param size the arrow size (depth). - * @param direction the direction of the arrow (one of: {@link #NORTH}, + * @param direction the direction of the arrow (one of: {@link #NORTH}, * {@link #SOUTH}, {@link #EAST} and {@link #WEST}). * @param isEnabled if <code>true</code> the arrow is drawn in the enabled * state, otherwise it is drawn in the disabled state. @@ -258,11 +258,11 @@ public class BasicArrowButton extends JButton implements SwingConstants } g.setColor(savedColor); } - + /** - * Paints an upward-pointing triangle. This method is called by the + * Paints an upward-pointing triangle. This method is called by the * {@link #paintTriangle(Graphics, int, int, int, int, boolean)} method. - * + * * @param g the graphics device. * @param x the x-coordinate for the anchor point. * @param y the y-coordinate for the anchor point. @@ -270,7 +270,7 @@ public class BasicArrowButton extends JButton implements SwingConstants * @param isEnabled if <code>true</code> the arrow is drawn in the enabled * state, otherwise it is drawn in the disabled state. */ - private void paintTriangleNorth(Graphics g, int x, int y, int size, + private void paintTriangleNorth(Graphics g, int x, int y, int size, boolean isEnabled) { int tipX = x + (size - 2) / 2; @@ -297,11 +297,11 @@ public class BasicArrowButton extends JButton implements SwingConstants g.drawLine(baseX1 + 1, baseY + 1, baseX2 + 1, baseY + 1); } } - + /** - * Paints an downward-pointing triangle. This method is called by the + * Paints an downward-pointing triangle. This method is called by the * {@link #paintTriangle(Graphics, int, int, int, int, boolean)} method. - * + * * @param g the graphics device. * @param x the x-coordinate for the anchor point. * @param y the y-coordinate for the anchor point. @@ -309,7 +309,7 @@ public class BasicArrowButton extends JButton implements SwingConstants * @param isEnabled if <code>true</code> the arrow is drawn in the enabled * state, otherwise it is drawn in the disabled state. */ - private void paintTriangleSouth(Graphics g, int x, int y, int size, + private void paintTriangleSouth(Graphics g, int x, int y, int size, boolean isEnabled) { int tipX = x + (size - 2) / 2; @@ -337,11 +337,11 @@ public class BasicArrowButton extends JButton implements SwingConstants g.drawLine(tipX + 1, tipY + 1, baseX2 + 1, baseY + 1); } } - + /** - * Paints a right-pointing triangle. This method is called by the + * Paints a right-pointing triangle. This method is called by the * {@link #paintTriangle(Graphics, int, int, int, int, boolean)} method. - * + * * @param g the graphics device. * @param x the x-coordinate for the anchor point. * @param y the y-coordinate for the anchor point. @@ -349,7 +349,7 @@ public class BasicArrowButton extends JButton implements SwingConstants * @param isEnabled if <code>true</code> the arrow is drawn in the enabled * state, otherwise it is drawn in the disabled state. */ - private void paintTriangleEast(Graphics g, int x, int y, int size, + private void paintTriangleEast(Graphics g, int x, int y, int size, boolean isEnabled) { int tipX = x + (size - 1); @@ -357,7 +357,7 @@ public class BasicArrowButton extends JButton implements SwingConstants int baseX = x; int baseY1 = tipY - (size - 1); int baseY2 = tipY + (size - 1); - + Polygon triangle = new Polygon(); triangle.addPoint(tipX, tipY); triangle.addPoint(baseX, baseY1); @@ -378,11 +378,11 @@ public class BasicArrowButton extends JButton implements SwingConstants g.drawLine(baseX + 1, baseY2 + 1, tipX + 1, tipY + 1); } } - + /** - * Paints a left-pointing triangle. This method is called by the + * Paints a left-pointing triangle. This method is called by the * {@link #paintTriangle(Graphics, int, int, int, int, boolean)} method. - * + * * @param g the graphics device. * @param x the x-coordinate for the anchor point. * @param y the y-coordinate for the anchor point. @@ -390,7 +390,7 @@ public class BasicArrowButton extends JButton implements SwingConstants * @param isEnabled if <code>true</code> the arrow is drawn in the enabled * state, otherwise it is drawn in the disabled state. */ - private void paintTriangleWest(Graphics g, int x, int y, int size, + private void paintTriangleWest(Graphics g, int x, int y, int size, boolean isEnabled) { int tipX = x; @@ -398,7 +398,7 @@ public class BasicArrowButton extends JButton implements SwingConstants int baseX = x + (size - 1); int baseY1 = tipY - (size - 1); int baseY2 = tipY + (size - 1); - + Polygon triangle = new Polygon(); triangle.addPoint(tipX, tipY); triangle.addPoint(baseX, baseY1); @@ -418,5 +418,5 @@ public class BasicArrowButton extends JButton implements SwingConstants g.drawLine(baseX + 1, baseY1 + 1, baseX + 1, baseY2 + 1); } } - + } diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicBorders.java b/libjava/classpath/javax/swing/plaf/basic/BasicBorders.java index 5e2cf2e..83afc33 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicBorders.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicBorders.java @@ -252,7 +252,7 @@ public class BasicBorders * <code>UIDefaults</code> of the currently active look and feel * using the keys <code>“SplitPane.darkShadow”</code> and * <code>“SplitPane.highlight”</code>. - * + * * <p><img src="doc-files/BasicBorders.SplitPaneBorder-1.png" width="520" * height="200" alt="[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" /> * @@ -284,7 +284,7 @@ public class BasicBorders * other two edges is the background color of the divider. * * <p><img src="doc-files/BasicBorders.SplitPaneDividerBorder-1.png" - * width="520" height="200" alt= + * width="520" height="200" alt= * "[A screen shot for JSplitPane.HORIZONTAL_SPLIT]" /> * * @return an instance of <code>SplitPaneDividerBorder</code>, which is @@ -332,7 +332,7 @@ public class BasicBorders UIManager.getColor("TextField.light"), UIManager.getColor("TextField.highlight")); } - + /** * Returns a two-pixel thick, green @@ -407,8 +407,8 @@ public class BasicBorders return sharedMarginBorder; } - - + + /** * A border whose appearance depends on the state of * the enclosed button. @@ -429,36 +429,36 @@ public class BasicBorders * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5. */ static final long serialVersionUID = -157053874580739687L; - - + + /** * The color for drawing the shaded parts of the border. * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel */ protected Color shadow; - - + + /** * The color for drawing the dark shaded parts of the border. * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel */ protected Color darkShadow; - - + + /** * The color for drawing the highlighted parts of the border. * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel */ protected Color highlight; - - + + /** * The color for drawing the bright highlighted parts of the border. * @see javax.swing.plaf.basic.BasicGraphicsUtils#drawBezel */ protected Color lightHighlight; - - + + /** * Constructs a new border for drawing a button in the Basic * look and feel. @@ -485,7 +485,7 @@ public class BasicBorders ? lightHighlight : Color.white; } - + /** * Paints the ButtonBorder around a given component. @@ -503,10 +503,10 @@ public class BasicBorders int x, int y, int width, int height) { ButtonModel bmodel = null; - + if (c instanceof AbstractButton) bmodel = ((AbstractButton) c).getModel(); - + BasicGraphicsUtils.drawBezel( g, x, y, width, height, /* pressed */ (bmodel != null) @@ -516,8 +516,8 @@ public class BasicBorders && ((JButton) c).isDefaultButton(), shadow, darkShadow, highlight, lightHighlight); } - - + + /** * Measures the width of this border. * @@ -534,7 +534,7 @@ public class BasicBorders * <code>bottom</code> fields indicate the width of the * border at the respective edge. * - * @see #getBorderInsets(java.awt.Component, java.awt.Insets) + * @see #getBorderInsets(java.awt.Component, java.awt.Insets) */ public Insets getBorderInsets(Component c) { @@ -545,7 +545,7 @@ public class BasicBorders return getBorderInsets(c, null); } - + /** * Measures the width of this border, storing the results into a * pre-existing Insets object. @@ -583,8 +583,8 @@ public class BasicBorders return insets; } } - - + + /** * A border that makes its enclosed component appear as lowered * into the surface. Typically used for text fields. @@ -668,7 +668,7 @@ public class BasicBorders ? lightHighlight : Color.white; } - + /** * Paints the FieldBorder around a given component. * @@ -688,8 +688,8 @@ public class BasicBorders shadow, darkShadow, highlight, lightHighlight); } - - + + /** * Measures the width of this border. * @@ -749,8 +749,8 @@ public class BasicBorders return insets; } } - - + + /** * An invisible, but spacing border whose margin is determined * by calling the <code>getMargin()</code> method of the enclosed @@ -772,8 +772,8 @@ public class BasicBorders * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5. */ static final long serialVersionUID = -3035848353448896090L; - - + + /** * Constructs a new MarginBorder. */ @@ -781,7 +781,7 @@ public class BasicBorders { // Nothing to do here. } - + /** * Measures the width of this border. * @@ -797,8 +797,8 @@ public class BasicBorders { return getBorderInsets(c, new Insets(0, 0, 0, 0)); } - - + + /** * Determines the insets of this border by calling the * <code>getMargin()</code> method of the enclosed component. The @@ -839,7 +839,7 @@ public class BasicBorders margin = ((JToolBar) c).getMargin(); else if (c instanceof JTextComponent) margin = ((JTextComponent) c).getMargin(); - + if (margin == null) insets.top = insets.left = insets.bottom = insets.right = 0; else @@ -853,7 +853,7 @@ public class BasicBorders return insets; } } - + /** * A border for drawing a separator line below JMenuBar. @@ -872,8 +872,8 @@ public class BasicBorders * of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5. */ static final long serialVersionUID = -6909056571935227506L; - - + + /** * The shadow color, which is used for the upper line of the * two-pixel thick bottom edge. @@ -949,7 +949,7 @@ public class BasicBorders g.setColor(highlight); g.drawLine(x + 1, y + 1, x + width - 3, y + 1); - g.drawLine(x + width - 1, y, x + width - 1, y + 1); + g.drawLine(x + width - 1, y, x + width - 1, y + 1); } finally { @@ -1098,7 +1098,7 @@ public class BasicBorders { lowered = button.isSelected() || (/* mouse inside */ bmodel.isArmed() && bmodel.isPressed()); - focused = button.hasFocus() && button.isFocusPainted(); + focused = button.hasFocus() && button.isFocusPainted(); } if (lowered) @@ -1112,8 +1112,8 @@ public class BasicBorders shadow, darkShadow, highlight, lightHighlight); } - - + + /** * Measures the width of this border. * @@ -1124,7 +1124,7 @@ public class BasicBorders * <code>bottom</code> fields indicate the width of the * border at the respective edge. * - * @see #getBorderInsets(java.awt.Component, java.awt.Insets) + * @see #getBorderInsets(java.awt.Component, java.awt.Insets) */ public Insets getBorderInsets(Component c) { @@ -1135,7 +1135,7 @@ public class BasicBorders return getBorderInsets(c, null); } - + /** * Measures the width of this border, storing the results into a * pre-existing Insets object. @@ -1439,7 +1439,7 @@ public class BasicBorders y += rect.y - 1; int right = x + rect.width + 1; int bottom = y + rect.height + 1; - + Color oldColor = g.getColor(); try { @@ -1466,7 +1466,7 @@ public class BasicBorders } } - + /** * Measures the width of this border. * @@ -1616,7 +1616,7 @@ public class BasicBorders return true; } - + /** * Determines the JSplitPane whose divider is being painted. * @@ -1661,7 +1661,7 @@ public class BasicBorders */ static final long serialVersionUID = -3528666548001058394L; - + /** * Constructs a new border for drawing a JToggleButton in * the Basic look and feel. @@ -1708,7 +1708,7 @@ public class BasicBorders * is selected or not. */ BasicGraphicsUtils.drawBezel(g, x, y, width, height, - /* pressed */ false, + /* pressed */ false, /* default */ false, shadow, darkShadow, highlight, lightHighlight); @@ -1725,7 +1725,7 @@ public class BasicBorders * <code>bottom</code> fields indicate the width of the * border at the respective edge. * - * @see #getBorderInsets(java.awt.Component, java.awt.Insets) + * @see #getBorderInsets(java.awt.Component, java.awt.Insets) */ public Insets getBorderInsets(Component c) { @@ -1736,7 +1736,7 @@ public class BasicBorders return getBorderInsets(c, null); } - + /** * Measures the width of this border, storing the results into a * pre-existing Insets object. diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicButtonListener.java b/libjava/classpath/javax/swing/plaf/basic/BasicButtonListener.java index c99de2c..22033b6 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicButtonListener.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicButtonListener.java @@ -131,7 +131,7 @@ public class BasicButtonListener { // Do nothing here. } - + public void propertyChange(PropertyChangeEvent e) { // Store the TextLayout for this in a client property for speed-up @@ -166,31 +166,31 @@ public class BasicButtonListener * * @param b the button to check */ - protected void checkOpacity(AbstractButton b) - { + protected void checkOpacity(AbstractButton b) + { b.setOpaque(b.isContentAreaFilled()); } - - public void focusGained(FocusEvent e) - { + + public void focusGained(FocusEvent e) + { if (e.getSource() instanceof AbstractButton) { AbstractButton button = (AbstractButton) e.getSource(); if (button.isFocusPainted()) - button.repaint(); + button.repaint(); } } - + public void focusLost(FocusEvent e) { if (e.getSource() instanceof AbstractButton) { AbstractButton button = (AbstractButton) e.getSource(); if (button.isFocusPainted()) - button.repaint(); + button.repaint(); } } - + public void installKeyboardActions(JComponent c) { ButtonUI ui = ((AbstractButton) c).getUI(); @@ -198,7 +198,7 @@ public class BasicButtonListener { // Install InputMap. BasicButtonUI basicUI = (BasicButtonUI) ui; - String prefix = basicUI.getPropertyPrefix(); + String prefix = basicUI.getPropertyPrefix(); InputMap focusInputMap = (InputMap) UIManager.get(prefix + "focusInputMap"); SwingUtilities.replaceUIInputMap(c, JComponent.WHEN_FOCUSED, @@ -212,11 +212,11 @@ public class BasicButtonListener } SwingUtilities.replaceUIActionMap(c, am); } - - c.getActionMap().put("pressed", - new AbstractAction() + + c.getActionMap().put("pressed", + new AbstractAction() { - public void actionPerformed(ActionEvent e) + public void actionPerformed(ActionEvent e) { AbstractButton button = (AbstractButton) e.getSource(); ButtonModel model = button.getModel(); @@ -225,11 +225,11 @@ public class BasicButtonListener model.setPressed(true); } }); - - c.getActionMap().put("released", - new AbstractAction() + + c.getActionMap().put("released", + new AbstractAction() { - public void actionPerformed(ActionEvent e) + public void actionPerformed(ActionEvent e) { AbstractButton button = (AbstractButton) e.getSource(); ButtonModel model = button.getModel(); @@ -237,7 +237,7 @@ public class BasicButtonListener model.setPressed(false); model.setArmed(false); } - }); + }); } /** @@ -259,23 +259,23 @@ public class BasicButtonListener SwingUtilities.replaceUIActionMap(c, null); SwingUtilities.replaceUIInputMap(c, JComponent.WHEN_FOCUSED, null); } - + public void stateChanged(ChangeEvent e) { // Need to repaint when the button state changes. ((AbstractButton) e.getSource()).repaint(); } - + public void mouseMoved(MouseEvent e) { // Nothing to do here. } - + public void mouseDragged(MouseEvent e) { // Nothing to do here. } - + public void mouseClicked(MouseEvent e) { // Nothing to do here. @@ -305,7 +305,7 @@ public class BasicButtonListener } /** - * Accept a mouse release event and set the button's + * Accept a mouse release event and set the button's * "pressed" property to <code>true</code>, if the model * is armed. If the model is not armed, ignore the event. * diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicButtonUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicButtonUI.java index 9f685bb..1697c24 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicButtonUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicButtonUI.java @@ -120,7 +120,7 @@ public class BasicButtonUI extends ButtonUI * * @return A new UI capable of drawing the component */ - public static ComponentUI createUI(final JComponent c) + public static ComponentUI createUI(final JComponent c) { if (sharedUI == null) sharedUI = new BasicButtonUI(); @@ -129,9 +129,9 @@ public class BasicButtonUI extends ButtonUI /** * Returns the default gap between the button's text and icon (in pixels). - * + * * @param b the button (ignored). - * + * * @return The gap. */ public int getDefaultTextIconGap(AbstractButton b) @@ -141,19 +141,19 @@ public class BasicButtonUI extends ButtonUI /** * Sets the text shift offset to zero. - * + * * @see #setTextShiftOffset() */ protected void clearTextShiftOffset() { textShiftOffset = 0; } - + /** * Returns the text shift offset. - * + * * @return The text shift offset. - * + * * @see #clearTextShiftOffset() * @see #setTextShiftOffset() */ @@ -164,7 +164,7 @@ public class BasicButtonUI extends ButtonUI /** * Sets the text shift offset to the value in {@link #defaultTextShiftOffset}. - * + * * @see #clearTextShiftOffset() */ protected void setTextShiftOffset() @@ -185,7 +185,7 @@ public class BasicButtonUI extends ButtonUI /** * Installs the default settings. - * + * * @param b the button (<code>null</code> not permitted). */ protected void installDefaults(AbstractButton b) @@ -218,7 +218,7 @@ public class BasicButtonUI extends ButtonUI /** * Removes the defaults added by {@link #installDefaults(AbstractButton)}. - * + * * @param b the button (<code>null</code> not permitted). */ protected void uninstallDefaults(AbstractButton b) @@ -229,11 +229,11 @@ public class BasicButtonUI extends ButtonUI /** * Creates and returns a new instance of {@link BasicButtonListener}. This - * method provides a hook to make it easy for subclasses to install a + * method provides a hook to make it easy for subclasses to install a * different listener. - * + * * @param b the button. - * + * * @return A new listener. */ protected BasicButtonListener createButtonListener(AbstractButton b) @@ -249,7 +249,7 @@ public class BasicButtonUI extends ButtonUI /** * Installs listeners for the button. - * + * * @param b the button (<code>null</code> not permitted). */ protected void installListeners(AbstractButton b) @@ -259,7 +259,7 @@ public class BasicButtonUI extends ButtonUI { b.addChangeListener(listener); b.addPropertyChangeListener(listener); - b.addFocusListener(listener); + b.addFocusListener(listener); b.addMouseListener(listener); b.addMouseMotionListener(listener); } @@ -271,7 +271,7 @@ public class BasicButtonUI extends ButtonUI /** * Uninstalls listeners for the button. - * + * * @param b the button (<code>null</code> not permitted). */ protected void uninstallListeners(AbstractButton b) @@ -281,7 +281,7 @@ public class BasicButtonUI extends ButtonUI { b.removeChangeListener(listener); b.removePropertyChangeListener(listener); - b.removeFocusListener(listener); + b.removeFocusListener(listener); b.removeMouseListener(listener); b.removeMouseMotionListener(listener); } @@ -304,12 +304,12 @@ public class BasicButtonUI extends ButtonUI /** * Install the BasicButtonUI as the UI for a particular component. * This means registering all the UI's listeners with the component, - * and setting any properties of the button which are particular to + * and setting any properties of the button which are particular to * this look and feel. * * @param c The component to install the UI into */ - public void installUI(final JComponent c) + public void installUI(final JComponent c) { super.installUI(c); if (c instanceof AbstractButton) @@ -395,7 +395,7 @@ public class BasicButtonUI extends ButtonUI * * @return The preferred dimensions of the component */ - public Dimension getPreferredSize(JComponent c) + public Dimension getPreferredSize(JComponent c) { AbstractButton b = (AbstractButton) c; Dimension d = BasicGraphicsUtils.getPreferredButtonSize(b, @@ -417,7 +417,7 @@ public class BasicButtonUI extends ButtonUI i = b.getRolloverSelectedIcon(); else if (b.getRolloverIcon() != null) i = b.getRolloverIcon(); - } + } else if (b.isSelected() && b.isEnabled()) { @@ -434,7 +434,7 @@ public class BasicButtonUI extends ButtonUI } /** - * Paint the component, which is an {@link AbstractButton}, according to + * Paint the component, which is an {@link AbstractButton}, according to * its current state. * * @param g The graphics context to paint with @@ -462,13 +462,13 @@ public class BasicButtonUI extends ButtonUI g.setFont(f); Icon icon = b.getIcon(); String text = b.getText(); - text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f), + text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f), text, icon, - b.getVerticalAlignment(), + b.getVerticalAlignment(), b.getHorizontalAlignment(), - b.getVerticalTextPosition(), + b.getVerticalTextPosition(), b.getHorizontalTextPosition(), - viewR, iconR, textR, + viewR, iconR, textR, text == null ? 0 : b.getIconTextGap()); @@ -541,7 +541,7 @@ public class BasicButtonUI extends ButtonUI /** * Paints the background area of an {@link AbstractButton} in the pressed - * state. This means filling the supplied area with a darker than normal + * state. This means filling the supplied area with a darker than normal * background. * * @param g The graphics context to paint with @@ -557,7 +557,7 @@ public class BasicButtonUI extends ButtonUI g.fillRect(area.x, area.y, area.width, area.height); } } - + /** * Paints the "text" property of an {@link AbstractButton}. * @@ -567,8 +567,8 @@ public class BasicButtonUI extends ButtonUI * @param text The text to paint */ protected void paintText(Graphics g, JComponent c, Rectangle textRect, - String text) - { + String text) + { AbstractButton b = (AbstractButton) c; Font f = b.getFont(); g.setFont(f); @@ -602,10 +602,10 @@ public class BasicButtonUI extends ButtonUI * @since 1.4 */ protected void paintText(Graphics g, AbstractButton b, Rectangle textRect, - String text) + String text) { paintText(g, (JComponent) b, textRect, text); - } + } /** * A helper method that finds the BasicButtonListener for the specified diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java index e45970e..79ce7b8 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java @@ -52,7 +52,7 @@ import javax.swing.plaf.ComponentUI; */ public class BasicCheckBoxMenuItemUI extends BasicMenuItemUI { - + /** * Creates a new BasicCheckBoxMenuItemUI object. */ @@ -60,7 +60,7 @@ public class BasicCheckBoxMenuItemUI extends BasicMenuItemUI { super(); } - + /** * Factory method to create a BasicCheckBoxMenuItemUI for the given {@link * JComponent}, which should be a JCheckBoxMenuItem diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicCheckBoxUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicCheckBoxUI.java index 43001b8..0a4da00 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicCheckBoxUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicCheckBoxUI.java @@ -47,14 +47,14 @@ import javax.swing.plaf.ComponentUI; * A UI delegate for the {@link JCheckBox} component. */ public class BasicCheckBoxUI extends BasicRadioButtonUI -{ - +{ + /** - * Returns a UI delegate (that is, an instance of this class) for the + * Returns a UI delegate (that is, an instance of this class) for the * specified component. - * + * * @param c the component (this should be a {@link JCheckBox}). - * + * * @return A new instance of <code>BasicCheckBoxUI</code>. */ public static ComponentUI createUI(JComponent c) @@ -63,7 +63,7 @@ public class BasicCheckBoxUI extends BasicRadioButtonUI } /** - * Returns the prefix for entries in the {@link UIManager} defaults table + * Returns the prefix for entries in the {@link UIManager} defaults table * (<code>"CheckBox."</code> in this case). * * @return "CheckBox." @@ -73,7 +73,3 @@ public class BasicCheckBoxUI extends BasicRadioButtonUI return "CheckBox."; } } - - - - diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicColorChooserUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicColorChooserUI.java index f37cbd7..10b5643 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicColorChooserUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicColorChooserUI.java @@ -74,12 +74,12 @@ public class BasicColorChooserUI extends ColorChooserUI public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName() == JColorChooser.CHOOSER_PANELS_PROPERTY) - makeTabs(chooser.getChooserPanels()); + makeTabs(chooser.getChooserPanels()); else if (e.getPropertyName() == JColorChooser.PREVIEW_PANEL_PROPERTY) - updatePreviewPanel(chooser.getPreviewPanel()); + updatePreviewPanel(chooser.getPreviewPanel()); else if (e.getPropertyName() == JColorChooser.SELECTION_MODEL_PROPERTY) - ((AbstractColorChooserPanel) pane.getSelectedComponent()) - .updateChooser(); + ((AbstractColorChooserPanel) pane.getSelectedComponent()) + .updateChooser(); chooser.repaint(); } @@ -100,10 +100,10 @@ public class BasicColorChooserUI extends ColorChooserUI { if (pane != null) { - AbstractColorChooserPanel panel = (AbstractColorChooserPanel) pane - .getSelectedComponent(); - if (panel != null) - panel.updateChooser(); + AbstractColorChooserPanel panel = (AbstractColorChooserPanel) pane + .getSelectedComponent(); + if (panel != null) + panel.updateChooser(); } chooser.repaint(); } @@ -190,30 +190,30 @@ public class BasicColorChooserUI extends ColorChooserUI { if (c instanceof JColorChooser) { - chooser = (JColorChooser) c; - chooser.setLayout(new BorderLayout()); + chooser = (JColorChooser) c; + chooser.setLayout(new BorderLayout()); - // Do this first, so we avoid doing work for property change events. - defaultChoosers = createDefaultChoosers(); - chooser.setChooserPanels(defaultChoosers); - pane = new JTabbedPane(); + // Do this first, so we avoid doing work for property change events. + defaultChoosers = createDefaultChoosers(); + chooser.setChooserPanels(defaultChoosers); + pane = new JTabbedPane(); - pane.addChangeListener(new ChangeListener() - { - public void stateChanged(ChangeEvent e) - { - pane.repaint(); - } - }); + pane.addChangeListener(new ChangeListener() + { + public void stateChanged(ChangeEvent e) + { + pane.repaint(); + } + }); - makeTabs(defaultChoosers); + makeTabs(defaultChoosers); - chooser.add(pane, BorderLayout.NORTH); + chooser.add(pane, BorderLayout.NORTH); - installPreviewPanel(); + installPreviewPanel(); - installDefaults(); - installListeners(); + installDefaults(); + installListeners(); } } @@ -274,9 +274,9 @@ public class BasicColorChooserUI extends ColorChooserUI { if (prevContainer == null) { - prevContainer = new JPanel(); - prevContainer.setLayout(new BorderLayout()); - chooser.add(prevContainer, BorderLayout.CENTER); + prevContainer = new JPanel(); + prevContainer.setLayout(new BorderLayout()); + chooser.add(prevContainer, BorderLayout.CENTER); } prevContainer.removeAll(); prevContainer.add(preview, BorderLayout.CENTER); diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicComboBoxEditor.java b/libjava/classpath/javax/swing/plaf/basic/BasicComboBoxEditor.java index d879261..b04f3fa 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicComboBoxEditor.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicComboBoxEditor.java @@ -69,7 +69,7 @@ public class BasicComboBoxEditor extends Object implements ComboBoxEditor, } /** - * Returns the component that will be used by the combo box to display and + * Returns the component that will be used by the combo box to display and * edit the currently selected item in the combo box. * * @return The editor component, which is a {@link JTextField} in this case. @@ -138,7 +138,7 @@ public class BasicComboBoxEditor extends Object implements ComboBoxEditor, } /** - * Adds an {@link ActionListener} to the editor component. If the user will + * Adds an {@link ActionListener} to the editor component. If the user will * edit currently selected item in the textfield and pressEnter, then action * will be performed. The actionPerformed of this ActionListener should * change the selected item of the comboBox to the newly editted selected @@ -163,7 +163,7 @@ public class BasicComboBoxEditor extends Object implements ComboBoxEditor, } /** - * A subclass of {@link BasicComboBoxEditor} that implements the + * A subclass of {@link BasicComboBoxEditor} that implements the * {@link UIResource} interface. */ public static class UIResource extends BasicComboBoxEditor diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicComboBoxRenderer.java b/libjava/classpath/javax/swing/plaf/basic/BasicComboBoxRenderer.java index 3c8d1e8..761d7d1 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicComboBoxRenderer.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicComboBoxRenderer.java @@ -51,12 +51,12 @@ import javax.swing.border.Border; import javax.swing.border.EmptyBorder; /** - * A renderer for a {@link JComboBox}. + * A renderer for a {@link JComboBox}. * * @author Olga Rodimina */ -public class BasicComboBoxRenderer - extends JLabel +public class BasicComboBoxRenderer + extends JLabel implements ListCellRenderer, Serializable { /** @@ -75,7 +75,7 @@ public class BasicComboBoxRenderer /** * Returns preferredSize of the renderer - * + * * @return preferredSize of the renderer */ public Dimension getPreferredSize() diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicComboBoxUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicComboBoxUI.java index ff636d6..07d4f42 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicComboBoxUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicComboBoxUI.java @@ -100,9 +100,9 @@ public class BasicComboBoxUI extends ComboBoxUI protected JComboBox comboBox; /** - * The component that is responsible for displaying/editing the selected - * item of the combo box. - * + * The component that is responsible for displaying/editing the selected + * item of the combo box. + * * @see BasicComboBoxEditor#getEditorComponent() */ protected Component editor; @@ -144,11 +144,11 @@ public class BasicComboBoxUI extends ComboBoxUI * Popup list containing the combo box's menu items. */ protected ComboPopup popup; - + protected KeyListener popupKeyListener; - + protected MouseListener popupMouseListener; - + protected MouseMotionListener popupMouseMotionListener; /** @@ -187,7 +187,7 @@ public class BasicComboBoxUI extends ComboBoxUI } /** - * A factory method to create a UI delegate for the given + * A factory method to create a UI delegate for the given * {@link JComponent}, which should be a {@link JComboBox}. * * @param c The {@link JComponent} a UI is being created for. @@ -203,7 +203,7 @@ public class BasicComboBoxUI extends ComboBoxUI * Installs the UI for the given {@link JComponent}. * * @param c the JComponent to install a UI for. - * + * * @see #uninstallUI(JComponent) */ public void installUI(JComponent c) @@ -230,7 +230,7 @@ public class BasicComboBoxUI extends ComboBoxUI { currentEditor = createEditor(); comboBox.setEditor(currentEditor); - } + } installComponents(); installListeners(); @@ -246,7 +246,7 @@ public class BasicComboBoxUI extends ComboBoxUI * Uninstalls the UI for the given {@link JComponent}. * * @param c The JComponent that is having this UI removed. - * + * * @see #installUI(JComponent) */ public void uninstallUI(JComponent c) @@ -262,9 +262,9 @@ public class BasicComboBoxUI extends ComboBoxUI } /** - * Installs the defaults that are defined in the {@link BasicLookAndFeel} + * Installs the defaults that are defined in the {@link BasicLookAndFeel} * for this {@link JComboBox}. - * + * * @see #uninstallDefaults() */ protected void installDefaults() @@ -276,7 +276,7 @@ public class BasicComboBoxUI extends ComboBoxUI /** * Creates and installs the listeners for this UI. - * + * * @see #uninstallListeners() */ protected void installListeners() @@ -312,7 +312,7 @@ public class BasicComboBoxUI extends ComboBoxUI /** * Uninstalls the defaults and sets any objects created during * install to <code>null</code>. - * + * * @see #installDefaults() */ protected void uninstallDefaults() @@ -322,7 +322,7 @@ public class BasicComboBoxUI extends ComboBoxUI if (comboBox.getForeground() instanceof UIResource) comboBox.setForeground(null); - + if (comboBox.getBackground() instanceof UIResource) comboBox.setBackground(null); @@ -331,7 +331,7 @@ public class BasicComboBoxUI extends ComboBoxUI /** * Detaches all the listeners we attached in {@link #installListeners}. - * + * * @see #installListeners() */ protected void uninstallListeners() @@ -429,7 +429,7 @@ public class BasicComboBoxUI extends ComboBoxUI } /** - * Creates and returns a layout manager for the combo box. Subclasses can + * Creates and returns a layout manager for the combo box. Subclasses can * override this method to provide a different layout. * * @return a layout manager for the combo box. @@ -452,7 +452,7 @@ public class BasicComboBoxUI extends ComboBoxUI /** * Creates the component that will be responsible for displaying/editing - * the selected item in the combo box. This editor is used only when combo + * the selected item in the combo box. This editor is used only when combo * box is editable. * * @return A new component that will be responsible for displaying/editing @@ -484,7 +484,7 @@ public class BasicComboBoxUI extends ComboBoxUI /** * Uninstalls components from this {@link JComboBox}. - * + * * @see #installComponents() */ protected void uninstallComponents() @@ -546,7 +546,7 @@ public class BasicComboBoxUI extends ComboBoxUI } /** - * Unconfigures the editor for this combo box. + * Unconfigures the editor for this combo box. */ protected void unconfigureEditor() { @@ -558,7 +558,7 @@ public class BasicComboBoxUI extends ComboBoxUI /** * Configures the arrow button. - * + * * @see #configureArrowButton() */ public void configureArrowButton() @@ -569,7 +569,7 @@ public class BasicComboBoxUI extends ComboBoxUI arrowButton.setFocusable(false); arrowButton.addMouseListener(popup.getMouseListener()); arrowButton.addMouseMotionListener(popup.getMouseMotionListener()); - + // Mark the button as not closing the popup, we handle this ourselves. arrowButton.putClientProperty(BasicLookAndFeel.DONT_CANCEL_POPUP, Boolean.TRUE); @@ -578,7 +578,7 @@ public class BasicComboBoxUI extends ComboBoxUI /** * Unconfigures the arrow button. - * + * * @see #configureArrowButton() * * @specnote The specification says this method is implementation specific @@ -613,7 +613,7 @@ public class BasicComboBoxUI extends ComboBoxUI * * @param c The JComboBox to check * - * @return <code>true</code> if popup part of the JComboBox is visible and + * @return <code>true</code> if popup part of the JComboBox is visible and * <code>false</code> otherwise. */ public boolean isPopupVisible(JComboBox c) @@ -917,12 +917,12 @@ public class BasicComboBoxUI extends ComboBoxUI = new DefaultListCellRenderer(); /** - * Returns the default size for the display area of a combo box that does + * Returns the default size for the display area of a combo box that does * not contain any elements. This method returns the width and height of - * a single space in the current font, plus a margin of 1 pixel. + * a single space in the current font, plus a margin of 1 pixel. * * @return The default display size. - * + * * @see #getDisplaySize() */ protected Dimension getDefaultSize() @@ -937,7 +937,7 @@ public class BasicComboBoxUI extends ComboBoxUI } /** - * Returns the size of the display area for the combo box. This size will be + * Returns the size of the display area for the combo box. This size will be * the size of the combo box, not including the arrowButton. * * @return The size of the display area for the combo box. @@ -950,11 +950,11 @@ public class BasicComboBoxUI extends ComboBoxUI { renderer = DEFAULT_RENDERER; } - + Object prototype = comboBox.getPrototypeDisplayValue(); if (prototype != null) { - Component comp = renderer.getListCellRendererComponent(listBox, + Component comp = renderer.getListCellRendererComponent(listBox, prototype, -1, false, false); currentValuePane.add(comp); comp.setFont(comboBox.getFont()); @@ -971,7 +971,7 @@ public class BasicComboBoxUI extends ComboBoxUI { for (int i = 0; i < size; ++i) { - Component comp = renderer.getListCellRendererComponent(listBox, + Component comp = renderer.getListCellRendererComponent(listBox, model.getElementAt(i), -1, false, false); currentValuePane.add(comp); comp.setFont(comboBox.getFont()); @@ -1009,7 +1009,7 @@ public class BasicComboBoxUI extends ComboBoxUI (InputMap) UIManager.get("ComboBox.ancestorInputMap")); // Install any action maps here. } - + /** * Uninstalls the keyboard actions for the {@link JComboBox} there were * installed by in {@link #installListeners}. @@ -1024,7 +1024,7 @@ public class BasicComboBoxUI extends ComboBoxUI /** * A {@link LayoutManager} used to position the sub-components of the * {@link JComboBox}. - * + * * @see BasicComboBoxUI#createLayoutManager() */ public class ComboBoxLayoutManager implements LayoutManager @@ -1040,7 +1040,7 @@ public class BasicComboBoxUI extends ComboBoxUI /** * Adds a component to the layout. This method does nothing, since the * layout manager doesn't need to track the components. - * + * * @param name the name to associate the component with (ignored). * @param comp the component (ignored). */ @@ -1052,7 +1052,7 @@ public class BasicComboBoxUI extends ComboBoxUI /** * Removes a component from the layout. This method does nothing, since * the layout manager doesn't need to track the components. - * + * * @param comp the component. */ public void removeLayoutComponent(Component comp) @@ -1063,7 +1063,7 @@ public class BasicComboBoxUI extends ComboBoxUI /** * Returns preferred layout size of the JComboBox. * - * @param parent the Container for which the preferred size should be + * @param parent the Container for which the preferred size should be * calculated. * * @return The preferred size for the given container @@ -1075,9 +1075,9 @@ public class BasicComboBoxUI extends ComboBoxUI /** * Returns the minimum layout size. - * + * * @param parent the container. - * + * * @return The minimum size. */ public Dimension minimumLayoutSize(Container parent) @@ -1095,7 +1095,7 @@ public class BasicComboBoxUI extends ComboBoxUI */ public void layoutContainer(Container parent) { - // Position editor component to the left of arrow button if combo box is + // Position editor component to the left of arrow button if combo box is // editable Insets i = getInsets(); int arrowSize = comboBox.getHeight() - (i.top + i.bottom); @@ -1152,7 +1152,7 @@ public class BasicComboBoxUI extends ComboBoxUI } /** - * Handles {@link ItemEvent}s fired by the {@link JComboBox} when its + * Handles {@link ItemEvent}s fired by the {@link JComboBox} when its * selected item changes. */ public class ItemHandler extends Object implements ItemListener @@ -1297,7 +1297,7 @@ public class BasicComboBoxUI extends ComboBoxUI } } } - + } /** @@ -1328,7 +1328,7 @@ public class BasicComboBoxUI extends ComboBoxUI /** * Invoked whenever bound property of JComboBox changes. - * + * * @param e the event. */ public void propertyChange(PropertyChangeEvent e) @@ -1404,7 +1404,7 @@ public class BasicComboBoxUI extends ComboBoxUI isMinimumSizeDirty = true; comboBox.revalidate(); } - // FIXME: Need to handle changes in other bound properties. + // FIXME: Need to handle changes in other bound properties. } } } diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicComboPopup.java b/libjava/classpath/javax/swing/plaf/basic/BasicComboPopup.java index 11f832a..3e54ca7 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicComboPopup.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicComboPopup.java @@ -483,7 +483,7 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup */ protected void installListListeners() { - // mouse listener listening to mouse events occuring in the + // mouse listener listening to mouse events occuring in the // combo box's list of items. listMouseListener = createListMouseListener(); list.addMouseListener(listMouseListener); @@ -613,7 +613,7 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup */ protected void autoScrollUp() { - // scroll up the scroll bar to make the item above visible + // scroll up the scroll bar to make the item above visible JScrollBar scrollbar = scroller.getVerticalScrollBar(); int scrollToNext = list.getScrollableUnitIncrement(super.getBounds(), SwingConstants.VERTICAL, @@ -621,8 +621,8 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup scrollbar.setValue(scrollbar.getValue() - scrollToNext); - // If we haven't reached the begging of the combo box's list of items, - // then highlight next element above currently highlighted element + // If we haven't reached the begging of the combo box's list of items, + // then highlight next element above currently highlighted element if (list.getSelectedIndex() != 0) list.setSelectedIndex(list.getSelectedIndex() - 1); } @@ -633,7 +633,7 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup */ protected void autoScrollDown() { - // scroll scrollbar down to make next item visible + // scroll scrollbar down to make next item visible JScrollBar scrollbar = scroller.getVerticalScrollBar(); int scrollToNext = list.getScrollableUnitIncrement(super.getBounds(), SwingConstants.VERTICAL, @@ -713,12 +713,12 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup for (int i = 0; i < maxRowCount; i++) { - Component comp = rend.getListCellRendererComponent(list, - comboBox.getModel() - .getElementAt(i), - -1, false, false); - Dimension dim = comp.getPreferredSize(); - totalHeight += dim.height; + Component comp = rend.getListCellRendererComponent(list, + comboBox.getModel() + .getElementAt(i), + -1, false, false); + Dimension dim = comp.getPreferredSize(); + totalHeight += dim.height; } return totalHeight == 0 ? 100 : totalHeight; @@ -995,9 +995,9 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup { if (e.getPropertyName().equals("renderer")) { - list.setCellRenderer(comboBox.getRenderer()); - if (isVisible()) - hide(); + list.setCellRenderer(comboBox.getRenderer()); + if (isVisible()) + hide(); } if (e.getPropertyName().equals("model")) { diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicDesktopIconUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicDesktopIconUI.java index 3f87302..e522938 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicDesktopIconUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicDesktopIconUI.java @@ -118,7 +118,7 @@ public class BasicDesktopIconUI extends DesktopIconUI yOffset = e.getY(); pane = frame.getDesktopPane(); if (pane != null) - pane.getDesktopManager().beginDraggingFrame(desktopIcon); + pane.getDesktopManager().beginDraggingFrame(desktopIcon); } /** @@ -129,7 +129,7 @@ public class BasicDesktopIconUI extends DesktopIconUI public void mouseReleased(MouseEvent e) { if (pane != null) - pane.getDesktopManager().endDraggingFrame(desktopIcon); + pane.getDesktopManager().endDraggingFrame(desktopIcon); xOffset = 0; yOffset = 0; } @@ -147,9 +147,9 @@ public class BasicDesktopIconUI extends DesktopIconUI int newHeight) { if (pane != null) - pane.getDesktopManager().dragFrame(f, newX, newY); + pane.getDesktopManager().dragFrame(f, newX, newY); else - desktopIcon.setBounds(newX, newY, newWidth, newHeight); + desktopIcon.setBounds(newX, newY, newWidth, newHeight); } } @@ -308,7 +308,7 @@ public class BasicDesktopIconUI extends DesktopIconUI /** The PropertyChangeListener listening to the JDesktopIcon. */ private transient PropertyChangeListener propertyHandler; - + /** The default icon used when no frame icon is given by the JInternalFrame. */ static Icon defaultIcon = new InternalFrameDefaultMenuIcon(); @@ -389,15 +389,15 @@ public class BasicDesktopIconUI extends DesktopIconUI { if (c instanceof JDesktopIcon) { - desktopIcon = (JDesktopIcon) c; - desktopIcon.setLayout(new BorderLayout()); - frame = desktopIcon.getInternalFrame(); + desktopIcon = (JDesktopIcon) c; + desktopIcon.setLayout(new BorderLayout()); + frame = desktopIcon.getInternalFrame(); - installDefaults(); - installComponents(); - installListeners(); + installDefaults(); + installComponents(); + installListeners(); - desktopIcon.setOpaque(true); + desktopIcon.setOpaque(true); } } @@ -409,11 +409,11 @@ public class BasicDesktopIconUI extends DesktopIconUI public void uninstallUI(JComponent c) { desktopIcon.setOpaque(false); - + uninstallListeners(); uninstallComponents(); uninstallDefaults(); - + frame = null; desktopIcon.setLayout(null); desktopIcon = null; @@ -444,7 +444,7 @@ public class BasicDesktopIconUI extends DesktopIconUI protected void uninstallComponents() { desktopIcon.remove(button); - + button = null; } @@ -460,29 +460,29 @@ public class BasicDesktopIconUI extends DesktopIconUI propertyHandler = new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent e) - { - if (e.getPropertyName().equals(JInternalFrame.TITLE_PROPERTY)) - button.setText(desktopIcon.getInternalFrame().getTitle()); - else if (e.getPropertyName().equals(JInternalFrame.FRAME_ICON_PROPERTY)) - { - Icon use = desktopIcon.getInternalFrame().getFrameIcon(); - if (use == null) - use = defaultIcon; - button.setIcon(use); - } - desktopIcon.revalidate(); - desktopIcon.repaint(); - } + public void propertyChange(PropertyChangeEvent e) + { + if (e.getPropertyName().equals(JInternalFrame.TITLE_PROPERTY)) + button.setText(desktopIcon.getInternalFrame().getTitle()); + else if (e.getPropertyName().equals(JInternalFrame.FRAME_ICON_PROPERTY)) + { + Icon use = desktopIcon.getInternalFrame().getFrameIcon(); + if (use == null) + use = defaultIcon; + button.setIcon(use); + } + desktopIcon.revalidate(); + desktopIcon.repaint(); + } }; frame.addPropertyChangeListener(propertyHandler); button.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) - { + public void actionPerformed(ActionEvent e) + { deiconize(); - } + } }); } @@ -492,10 +492,10 @@ public class BasicDesktopIconUI extends DesktopIconUI protected void uninstallListeners() { // button is nulled so no need to remove it. - + frame.removePropertyChangeListener(propertyHandler); propertyHandler = null; - + desktopIcon.removeMouseMotionListener(mouseHandler); desktopIcon.removeMouseListener(mouseHandler); } @@ -506,7 +506,7 @@ public class BasicDesktopIconUI extends DesktopIconUI protected void installDefaults() { // FIXME: Move border to defaults. - desktopIcon.setBorder(new DesktopIconBorder()); + desktopIcon.setBorder(new DesktopIconBorder()); } /** @@ -578,7 +578,7 @@ public class BasicDesktopIconUI extends DesktopIconUI /** * This method deiconizes the JInternalFrame associated with the JDesktopIcon. */ - public void deiconize() + public void deiconize() { try { diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicDesktopPaneUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicDesktopPaneUI.java index 4116858..cbc3f9f 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicDesktopPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicDesktopPaneUI.java @@ -94,7 +94,7 @@ public class BasicDesktopPaneUI extends DesktopPaneUI public boolean isEnabled() { if (desktop.getSelectedFrame() != null) - return desktop.getSelectedFrame().isClosable(); + return desktop.getSelectedFrame().isClosable(); return false; } } @@ -133,7 +133,7 @@ public class BasicDesktopPaneUI extends DesktopPaneUI public boolean isEnabled() { if (desktop.getSelectedFrame() != null) - return desktop.getSelectedFrame().isMaximizable(); + return desktop.getSelectedFrame().isMaximizable(); return false; } } @@ -172,7 +172,7 @@ public class BasicDesktopPaneUI extends DesktopPaneUI public boolean isEnabled() { if (desktop.getSelectedFrame() != null) - return desktop.getSelectedFrame().isIconifiable(); + return desktop.getSelectedFrame().isIconifiable(); return false; } } @@ -191,23 +191,23 @@ public class BasicDesktopPaneUI extends DesktopPaneUI */ public void actionPerformed(ActionEvent e) { - // This is supposed to set the next selected frame. + // This is supposed to set the next selected frame. JInternalFrame[] frames = desktop.getAllFrames(); if (frames.length == 0) - return; + return; JInternalFrame sFrame = frames[0]; if (desktop.getSelectedFrame() != null) - sFrame = desktop.getSelectedFrame(); + sFrame = desktop.getSelectedFrame(); int i = 0; for (; i < frames.length; i++) - if (frames[i] == sFrame) - break; + if (frames[i] == sFrame) + break; - // FIXME: Navigate actions go reverse too. + // FIXME: Navigate actions go reverse too. if (i == frames.length) - i = 0; + i = 0; desktop.setSelectedFrame(frames[i]); } @@ -399,11 +399,11 @@ public class BasicDesktopPaneUI extends DesktopPaneUI { if (c instanceof JDesktopPane) { - desktop = (JDesktopPane) c; + desktop = (JDesktopPane) c; - installDefaults(); - installDesktopManager(); - installKeyboardActions(); + installDefaults(); + installDesktopManager(); + installKeyboardActions(); } } diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicDirectoryModel.java b/libjava/classpath/javax/swing/plaf/basic/BasicDirectoryModel.java index b1fb727..62657ad 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicDirectoryModel.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicDirectoryModel.java @@ -54,7 +54,7 @@ import javax.swing.filechooser.FileSystemView; /** * Implements an AbstractListModel for directories where the source - * of the files is a JFileChooser object. + * of the files is a JFileChooser object. * * This class is used for sorting and ordering the file list in * a JFileChooser L&F object. @@ -188,7 +188,7 @@ public class BasicDirectoryModel extends AbstractListModel if (filechooser.accept(files[i])) accepted.add(files[i]); } - + // Occasional check if we have been interrupted. if (isInterrupted()) return; @@ -286,7 +286,7 @@ public class BasicDirectoryModel extends AbstractListModel List added = newCache.subList(start, end); UpdateSwingRequest r = new UpdateSwingRequest(added, start, - null, 0); + null, 0); invokeLater(r); newCache = null; } @@ -332,10 +332,10 @@ public class BasicDirectoryModel extends AbstractListModel { public int compare(Object o1, Object o2) { - if (lt((File) o1, (File) o2)) - return -1; - else - return 1; + if (lt((File) o1, (File) o2)) + return -1; + else + return 1; } }; @@ -366,7 +366,7 @@ public class BasicDirectoryModel extends AbstractListModel } /** - * Fires a content change event. + * Fires a content change event. */ public void fireContentsChanged() { @@ -397,7 +397,7 @@ public class BasicDirectoryModel extends AbstractListModel } /** - * Returns the (java.io.File) object at + * Returns the (java.io.File) object at * an index in the list. * * @param index The list index @@ -441,7 +441,7 @@ public class BasicDirectoryModel extends AbstractListModel } /** - * Returns the size of the list, which only includes directories + * Returns the size of the list, which only includes directories * if the JFileChooser is set to DIRECTORIES_ONLY. * * Otherwise, both directories and files are included in the count. @@ -537,12 +537,12 @@ public class BasicDirectoryModel extends AbstractListModel || property.equals(JFileChooser.FILE_VIEW_CHANGED_PROPERTY) ) { - validateFileCache(); + validateFileCache(); } } /** - * Renames a file - However, does <I>not</I> re-sort the list + * Renames a file - However, does <I>not</I> re-sort the list * or replace the old file with the new one in the list. * * @param oldFile The old file @@ -584,4 +584,3 @@ public class BasicDirectoryModel extends AbstractListModel } } } - diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicEditorPaneUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicEditorPaneUI.java index d514a87..6ddd251 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicEditorPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicEditorPaneUI.java @@ -1,4 +1,4 @@ -/* BasicEditorPaneUI.java -- +/* BasicEditorPaneUI.java -- Copyright (C) 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java index 4b6e2f7..347686d 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java @@ -72,7 +72,7 @@ import javax.swing.plaf.metal.MetalIconFactory; /** - * A UI delegate for the {@link JFileChooser} component under the + * A UI delegate for the {@link JFileChooser} component under the * {@link BasicLookAndFeel}. */ public class BasicFileChooserUI extends FileChooserUI @@ -89,7 +89,7 @@ public class BasicFileChooserUI extends FileChooserUI { // Nothing to do here. } - + /** * Returns <code>true</code> always, as all files are accepted by this * filter. @@ -116,7 +116,7 @@ public class BasicFileChooserUI extends FileChooserUI /** * Handles a user action to approve the dialog selection. - * + * * @see BasicFileChooserUI#getApproveSelectionAction() */ protected class ApproveSelectionAction extends AbstractAction @@ -131,7 +131,7 @@ public class BasicFileChooserUI extends FileChooserUI /** * Sets the current selection and closes the dialog. - * + * * @param e the action event. */ public void actionPerformed(ActionEvent e) @@ -159,8 +159,8 @@ public class BasicFileChooserUI extends FileChooserUI else { File f = new File(filechooser.getCurrentDirectory(), getFileName()); - if ( selectedDir != null ) - f = selectedDir; + if ( selectedDir != null ) + f = selectedDir; if (filechooser.isTraversable(f)) { filechooser.setCurrentDirectory(f); @@ -212,7 +212,7 @@ public class BasicFileChooserUI extends FileChooserUI } /** - * Retrieves the icon associated with the specified file/directory, if + * Retrieves the icon associated with the specified file/directory, if * there is one. * * @param f the file/directory. @@ -225,8 +225,8 @@ public class BasicFileChooserUI extends FileChooserUI } /** - * Returns a description of the given file/directory. In this - * implementation, the description is the same as the name returned by + * Returns a description of the given file/directory. In this + * implementation, the description is the same as the name returned by * {@link #getName(File)}. * * @param f the file/directory. @@ -249,11 +249,11 @@ public class BasicFileChooserUI extends FileChooserUI { Icon val = getCachedIcon(f); if (val != null) - return val; + return val; if (filechooser.isTraversable(f)) - val = directoryIcon; + val = directoryIcon; else - val = fileIcon; + val = fileIcon; cacheIcon(f, val); return val; } @@ -287,9 +287,9 @@ public class BasicFileChooserUI extends FileChooserUI public String getTypeDescription(File f) { if (filechooser.isTraversable(f)) - return dirDescText; + return dirDescText; else - return fileDescText; + return fileDescText; } /** @@ -308,7 +308,7 @@ public class BasicFileChooserUI extends FileChooserUI /** * Handles an action to cancel the file chooser. - * + * * @see BasicFileChooserUI#getCancelSelectionAction() */ protected class CancelSelectionAction extends AbstractAction @@ -338,7 +338,7 @@ public class BasicFileChooserUI extends FileChooserUI /** * An action to handle changes to the parent directory (for example, via * a click on the "up folder" button). - * + * * @see BasicFileChooserUI#getChangeToParentDirectoryAction() */ protected class ChangeToParentDirectoryAction extends AbstractAction @@ -366,7 +366,7 @@ public class BasicFileChooserUI extends FileChooserUI /** * A mouse listener that handles double-click events. - * + * * @see BasicFileChooserUI#createDoubleClickListener(JFileChooser, JList) */ protected class DoubleClickListener extends MouseAdapter @@ -392,7 +392,7 @@ public class BasicFileChooserUI extends FileChooserUI /** * Handles a mouse click event. - * + * * @param e the event. */ public void mouseClicked(MouseEvent e) @@ -422,7 +422,7 @@ public class BasicFileChooserUI extends FileChooserUI String path = p.toString(); File f = fsv.createFileObject(path); filechooser.setSelectedFile(f); - + if (filechooser.isMultiSelectionEnabled()) { int[] inds = list.getSelectedIndices(); @@ -431,7 +431,7 @@ public class BasicFileChooserUI extends FileChooserUI allFiles[i] = (File) list.getModel().getElementAt(inds[i]); filechooser.setSelectedFiles(allFiles); } - + if (filechooser.isTraversable(f)) { setDirectorySelected(true); @@ -444,18 +444,18 @@ public class BasicFileChooserUI extends FileChooserUI } lastSelected = path; parentPath = f.getParent(); - + if (f.isFile()) setFileName(f.getName()); - else if (filechooser.getFileSelectionMode() != - JFileChooser.FILES_ONLY) + else if (filechooser.getFileSelectionMode() != + JFileChooser.FILES_ONLY) setFileName(path); } } /** * Handles a mouse entered event (NOT IMPLEMENTED). - * + * * @param e the mouse event. */ public void mouseEntered(MouseEvent e) @@ -465,9 +465,9 @@ public class BasicFileChooserUI extends FileChooserUI } /** - * An action that changes the file chooser to display the user's home - * directory. - * + * An action that changes the file chooser to display the user's home + * directory. + * * @see BasicFileChooserUI#getGoHomeAction() */ protected class GoHomeAction extends AbstractAction @@ -497,7 +497,7 @@ public class BasicFileChooserUI extends FileChooserUI /** * An action that handles the creation of a new folder/directory. - * + * * @see BasicFileChooserUI#getNewFolderAction() */ protected class NewFolderAction extends AbstractAction @@ -519,12 +519,12 @@ public class BasicFileChooserUI extends FileChooserUI { try { - filechooser.getFileSystemView().createNewFolder(filechooser - .getCurrentDirectory()); + filechooser.getFileSystemView().createNewFolder(filechooser + .getCurrentDirectory()); } catch (IOException ioe) { - return; + return; } filechooser.rescanCurrentDirectory(); filechooser.repaint(); @@ -533,7 +533,7 @@ public class BasicFileChooserUI extends FileChooserUI /** * A listener for selection events in the file list. - * + * * @see BasicFileChooserUI#createListSelectionListener(JFileChooser) */ protected class SelectionListener implements ListSelectionListener @@ -556,24 +556,24 @@ public class BasicFileChooserUI extends FileChooserUI JList list = (JList) e.getSource(); Object f = list.getSelectedValue(); if (f == null) - return; + return; File file = filechooser.getFileSystemView().createFileObject(f.toString()); if (! filechooser.isTraversable(file)) - { - selectedDir = null; - filechooser.setSelectedFile(file); - } + { + selectedDir = null; + filechooser.setSelectedFile(file); + } else - { - selectedDir = file; - filechooser.setSelectedFile(null); - } + { + selectedDir = file; + filechooser.setSelectedFile(null); + } } } /** * DOCUMENT ME! - * + * * @see BasicFileChooserUI#getUpdateAction() */ protected class UpdateAction extends AbstractAction @@ -722,46 +722,46 @@ public class BasicFileChooserUI extends FileChooserUI // FIXME: describe what is contained in the bottom panel /** The bottom panel. */ JPanel bottomPanel; - + /** The close panel. */ JPanel closePanel; /** Text box that displays file name */ JTextField entry; - + /** Current parent path */ String parentPath; - + /** * The action for the 'approve' button. * @see #getApproveSelectionAction() */ private ApproveSelectionAction approveSelectionAction; - + /** * The action for the 'cancel' button. * @see #getCancelSelectionAction() */ private CancelSelectionAction cancelSelectionAction; - + /** * The action for the 'go home' control button. * @see #getGoHomeAction() */ private GoHomeAction goHomeAction; - + /** * The action for the 'up folder' control button. * @see #getChangeToParentDirectoryAction() */ private ChangeToParentDirectoryAction changeToParentDirectoryAction; - + /** * The action for the 'new folder' control button. * @see #getNewFolderAction() */ private NewFolderAction newFolderAction; - + /** * The action for ???. // FIXME: what is this? * @see #getUpdateAction() @@ -774,7 +774,7 @@ public class BasicFileChooserUI extends FileChooserUI * the directory on "Open" when in that mode. */ private File selectedDir; - + // -- end private -- /** @@ -810,7 +810,7 @@ public class BasicFileChooserUI extends FileChooserUI /** * Installs the UI for the specified component. - * + * * @param c the component (should be a {@link JFileChooser}). */ public void installUI(JComponent c) @@ -825,7 +825,7 @@ public class BasicFileChooserUI extends FileChooserUI installDefaults(fc); installComponents(fc); installListeners(fc); - + File path = filechooser.getCurrentDirectory(); if (path != null) parentPath = path.getParent(); @@ -834,7 +834,7 @@ public class BasicFileChooserUI extends FileChooserUI /** * Uninstalls this UI from the given component. - * + * * @param c the component (should be a {@link JFileChooser}). */ public void uninstallUI(JComponent c) @@ -868,7 +868,7 @@ public class BasicFileChooserUI extends FileChooserUI if (parentFiles.size() == 0) return; - } + } /** * Creates and install the subcomponents for the file chooser. @@ -996,9 +996,9 @@ public class BasicFileChooserUI extends FileChooserUI directoryOpenButtonText = "Open"; directoryOpenButtonToolTipText = "Open selected directory"; - directoryOpenButtonMnemonic + directoryOpenButtonMnemonic = new Integer((String) UIManager.get("FileChooser.directoryOpenButtonMnemonic")).intValue(); - + helpButtonText = "Help"; helpButtonToolTipText = "FileChooser help"; helpButtonMnemonic = new Integer((String) UIManager.get("FileChooser.helpButtonMnemonic")).intValue(); @@ -1010,7 +1010,7 @@ public class BasicFileChooserUI extends FileChooserUI saveButtonText = "Save"; saveButtonToolTipText = "Save selected file"; saveButtonMnemonic = new Integer((String) UIManager.get("FileChooser.saveButtonMnemonic")).intValue(); - + updateButtonText = "Update"; updateButtonToolTipText = "Update directory listing"; updateButtonMnemonic = new Integer((String) UIManager.get("FileChooser.updateButtonMnemonic")).intValue(); @@ -1041,7 +1041,7 @@ public class BasicFileChooserUI extends FileChooserUI saveButtonText = null; saveButtonToolTipText = null; - + updateButtonText = null; updateButtonToolTipText = null; } @@ -1067,9 +1067,9 @@ public class BasicFileChooserUI extends FileChooserUI /** * Creates a listener to handle changes to the properties of the given * file chooser component. - * + * * @param fc the file chooser component. - * + * * @return A new listener. */ public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) @@ -1080,7 +1080,7 @@ public class BasicFileChooserUI extends FileChooserUI /** * Returns the current file name. - * + * * @return The current file name. */ public String getFileName() @@ -1092,7 +1092,7 @@ public class BasicFileChooserUI extends FileChooserUI * Returns the current directory name. * * @return The directory name. - * + * * @see #setDirectoryName(String) */ public String getDirectoryName() @@ -1105,12 +1105,12 @@ public class BasicFileChooserUI extends FileChooserUI * Sets the file name. * * @param filename the file name. - * + * * @see #getFileName() */ public void setFileName(String filename) { - // FIXME: it might be the case that this method provides an access + // FIXME: it might be the case that this method provides an access // point for the JTextField (or whatever) a subclass is using... //this.filename = filename; } @@ -1119,7 +1119,7 @@ public class BasicFileChooserUI extends FileChooserUI * Sets the directory name (NOT IMPLEMENTED). * * @param dirname the directory name. - * + * * @see #getDirectoryName() */ public void setDirectoryName(String dirname) @@ -1149,7 +1149,7 @@ public class BasicFileChooserUI extends FileChooserUI } /** - * Returns the {@link JFileChooser} component that this UI delegate + * Returns the {@link JFileChooser} component that this UI delegate * represents. * * @return The component represented by this UI delegate. @@ -1184,7 +1184,7 @@ public class BasicFileChooserUI extends FileChooserUI /** * Returns the tool tip text for the approve (open/save) button. This first * checks the file chooser to see if a value has been explicitly set - if - * not, a default value appropriate for the type of file chooser is + * not, a default value appropriate for the type of file chooser is * returned. * * @param fc the file chooser. @@ -1236,7 +1236,7 @@ public class BasicFileChooserUI extends FileChooserUI } /** - * Returns <code>true</code> if a directory is selected, and + * Returns <code>true</code> if a directory is selected, and * <code>false</code> otherwise. * * @return A boolean. @@ -1295,7 +1295,7 @@ public class BasicFileChooserUI extends FileChooserUI * @param fc the file chooser component. * * @return The file view. - * + * * @see JFileChooser#getFileView() */ public FileView getFileView(JFileChooser fc) @@ -1309,7 +1309,7 @@ public class BasicFileChooserUI extends FileChooserUI * @param fc the file chooser (<code>null</code> not permitted). * * @return The dialog title. - * + * * @see JFileChooser#getDialogTitle() */ public String getDialogTitle(JFileChooser fc) @@ -1326,7 +1326,7 @@ public class BasicFileChooserUI extends FileChooserUI * @param fc the file chooser (<code>null</code> not permitted). * * @return The approve button mnemonic. - * + * * @see JFileChooser#getApproveButtonMnemonic() */ public int getApproveButtonMnemonic(JFileChooser fc) @@ -1345,7 +1345,7 @@ public class BasicFileChooserUI extends FileChooserUI * @param fc the file chooser (<code>null</code> not permitted). * * @return The approve button text. - * + * * @see JFileChooser#getApproveButtonText() */ public String getApproveButtonText(JFileChooser fc) @@ -1362,7 +1362,7 @@ public class BasicFileChooserUI extends FileChooserUI } /** - * Creates and returns a new action that will be used with the "new folder" + * Creates and returns a new action that will be used with the "new folder" * button. * * @return A new instance of {@link NewFolderAction}. @@ -1375,7 +1375,7 @@ public class BasicFileChooserUI extends FileChooserUI } /** - * Creates and returns a new action that will be used with the "home folder" + * Creates and returns a new action that will be used with the "home folder" * button. * * @return A new instance of {@link GoHomeAction}. @@ -1426,7 +1426,7 @@ public class BasicFileChooserUI extends FileChooserUI /** * Returns the update action (an instance of {@link UpdateAction}). * - * @return An action. + * @return An action. */ public Action getUpdateAction() { diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicFormattedTextFieldUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicFormattedTextFieldUI.java index 9c7f1c4..5559214 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicFormattedTextFieldUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicFormattedTextFieldUI.java @@ -66,4 +66,4 @@ public class BasicFormattedTextFieldUI extends BasicTextFieldUI { return "FormattedTextField"; } -}
\ No newline at end of file +} diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicGraphicsUtils.java b/libjava/classpath/javax/swing/plaf/basic/BasicGraphicsUtils.java index e73c39b..f270d33 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicGraphicsUtils.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicGraphicsUtils.java @@ -142,7 +142,7 @@ public class BasicGraphicsUtils g.setColor(darkShadow); g.drawLine(x + 1, y + 1, x2 - 2, y + 1); // top, inner g.drawLine(x + 1, y + 2, x + 1, y2 - 2); // left, inner - + g.setColor(highlight); g.drawLine(x + 1, y2 - 1, x2 - 1, y2 - 1); // bottom, inner g.drawLine(x2 - 1, y + 1, x2 - 1, y2 - 2); // right, inner @@ -156,8 +156,8 @@ public class BasicGraphicsUtils g.setColor(oldColor); } } - - + + /** * Determines the width of the border that gets painted by * {@link #drawEtchedRect}. @@ -229,7 +229,7 @@ public class BasicGraphicsUtils { return new Insets(2, 2, 2, 2); } - + /** * Draws a border that is suitable for buttons of the Basic look and @@ -310,8 +310,8 @@ public class BasicGraphicsUtils g.setColor(oldColor); } } - - + + /** * Draws a rectangle that appears lowered into the surface, given * four colors that are used for drawing. @@ -363,8 +363,8 @@ public class BasicGraphicsUtils darkShadow, shadow, highlight, lightHighlight); } - - + + /** * Draws a String at the given location, underlining the first * occurence of a specified character. The algorithm for determining @@ -390,7 +390,7 @@ public class BasicGraphicsUtils * the GNU Classpath implementation does not underline * anything if <code>underlinedChar</code> is outside * the range of <code>char</code>. - * + * * @param x the x coordinate of the text, as it would be passed to * {@link java.awt.Graphics#drawString(java.lang.String, * int, int)}. @@ -436,7 +436,7 @@ public class BasicGraphicsUtils * <code>text</code>. If <code>underlinedIndex</code> falls * outside the range <code>[0, text.length() - 1]</code>, the * text will be drawn without underlining anything. - * + * * @param x the x coordinate of the text, as it would be passed to * {@link java.awt.Graphics#drawString(java.lang.String, * int, int)}. @@ -518,7 +518,7 @@ public class BasicGraphicsUtils underline.width = underlineX1 - underlineX2; } - + underline.height = lineMetrics.getUnderlineThickness(); underline.y = lineMetrics.getUnderlineOffset(); if (underline.y == 0) @@ -597,7 +597,7 @@ public class BasicGraphicsUtils * <code>text</code>. If <code>underlinedIndex</code> falls * outside the range <code>[0, text.length() - 1]</code>, the * text will be drawn without underlining anything. - * + * * @param x the x coordinate of the text, as it would be passed to * {@link java.awt.Graphics#drawString(java.lang.String, * int, int)}. @@ -683,7 +683,7 @@ public class BasicGraphicsUtils underline.width = underlineX1 - underlineX2; } - + underline.height = lineMetrics.getUnderlineThickness(); underline.y = lineMetrics.getUnderlineOffset(); if (underline.y == 0) @@ -761,8 +761,8 @@ public class BasicGraphicsUtils * and <code>height</code> fields indicate the preferred * extent in pixels. * - * @see javax.swing.SwingUtilities#layoutCompoundLabel(JComponent, - * FontMetrics, String, Icon, int, int, int, int, Rectangle, Rectangle, + * @see javax.swing.SwingUtilities#layoutCompoundLabel(JComponent, + * FontMetrics, String, Icon, int, int, int, int, Rectangle, Rectangle, * Rectangle, int) */ public static Dimension getPreferredButtonSize(AbstractButton b, @@ -795,7 +795,7 @@ public class BasicGraphicsUtils b.getFontMetrics(b.getFont()), // see comment above b.getText(), b.getIcon(), - b.getVerticalAlignment(), + b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicHTML.java b/libjava/classpath/javax/swing/plaf/basic/BasicHTML.java index 6e26d53..a7ce8b1 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicHTML.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicHTML.java @@ -145,7 +145,7 @@ public class BasicHTML { if (view != null) view.setParent(null); - + if (v != null) v.setParent(this); diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicIconFactory.java b/libjava/classpath/javax/swing/plaf/basic/BasicIconFactory.java index cad0d0e..1b5afa7 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicIconFactory.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicIconFactory.java @@ -53,16 +53,16 @@ public class BasicIconFactory implements Serializable { static final long serialVersionUID = 5605588811185324383L; - private static class DummyIcon + private static class DummyIcon implements Icon - { - public int getIconHeight() - { - return 10; + { + public int getIconHeight() + { + return 10; } - public int getIconWidth() - { - return 10; + public int getIconWidth() + { + return 10; } public void paintIcon(Component c, Graphics g, int x, int y) { @@ -118,7 +118,7 @@ public class BasicIconFactory implements Serializable } /** - * The icon used for {@link JCheckBoxMenuItem}s in the + * The icon used for {@link JCheckBoxMenuItem}s in the * {@link BasicLookAndFeel}. This icon has a size of 9x9 pixels. */ static class CheckBoxMenuItemIcon @@ -155,14 +155,14 @@ public class BasicIconFactory implements Serializable public void paintIcon(Component c, Graphics g, int x, int y) { JCheckBoxMenuItem item = (JCheckBoxMenuItem) c; - if (item.isSelected()) + if (item.isSelected()) { // paint the check... g.setColor(Color.black); g.drawLine(x + 1, y + 3, x + 1, y + 4); g.drawLine(x + 2, y + 4, x + 2, y + 5); for (int i = 0; i < 5; i++) - g.drawLine(x + 3 + i, y + 5 - i, x + 3 + i, y + 6 - i); + g.drawLine(x + 3 + i, y + 5 - i, x + 3 + i, y + 6 - i); } } } @@ -212,7 +212,7 @@ public class BasicIconFactory implements Serializable } /** The cached CheckBoxIcon instance. */ private static CheckBoxIcon checkBoxIcon; - + /** The cached RadioButtonIcon instance. */ private static RadioButtonIcon radioButtonIcon; @@ -246,34 +246,34 @@ public class BasicIconFactory implements Serializable { return new DummyIcon(); } - + /** * Returns a new instance of a 4 x 8 icon showing a small black triangle that - * points to the right. This is displayed in menu items that have a + * points to the right. This is displayed in menu items that have a * sub menu. - * + * * @return The icon. */ public static Icon getMenuArrowIcon() { return new Icon() { - public int getIconHeight() - { - return 8; - } - public int getIconWidth() - { - return 4; - } - public void paintIcon(Component c, Graphics g, int x, int y) - { - Color saved = g.getColor(); - g.setColor(Color.BLACK); + public int getIconHeight() + { + return 8; + } + public int getIconWidth() + { + return 4; + } + public void paintIcon(Component c, Graphics g, int x, int y) + { + Color saved = g.getColor(); + g.setColor(Color.BLACK); for (int i = 0; i < 4; i++) g.drawLine(x + i, y + i, x + i, y + 7 - i); - g.setColor(saved); - } + g.setColor(saved); + } }; } @@ -308,19 +308,19 @@ public class BasicIconFactory implements Serializable /** * Creates and returns an icon used when rendering {@link JCheckBoxMenuItem} * components. - * + * * @return An icon. */ public static Icon getCheckBoxMenuItemIcon() { return new CheckBoxMenuItemIcon(); } - + public static Icon getRadioButtonMenuItemIcon() { return getRadioButtonIcon(); } - + public static Icon createEmptyFrameIcon() { return new DummyIcon(); diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java b/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java index ea8b460..4846605 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java @@ -89,7 +89,7 @@ public class BasicInternalFrameTitlePane extends JComponent { super("Close"); } - + /** * This method is called when something closes the JInternalFrame. * @@ -371,7 +371,7 @@ public class BasicInternalFrameTitlePane extends JComponent { Icon frameIcon = frame.getFrameIcon(); if (frameIcon == null) - frameIcon = BasicDesktopIconUI.defaultIcon; + frameIcon = BasicDesktopIconUI.defaultIcon; frameIcon.paintIcon(this, g, 0, 0); } @@ -453,8 +453,8 @@ public class BasicInternalFrameTitlePane extends JComponent } if (title != null) - title.setBounds(insets.left + menupref.width, insets.top, - loc - menupref.width - insets.left, height); + title.setBounds(insets.left + menupref.width, insets.top, + loc - menupref.width - insets.left, height); } /** @@ -581,7 +581,7 @@ public class BasicInternalFrameTitlePane extends JComponent /** The icon displayed in the close button. */ protected Icon closeIcon; - + /** The JInternalFrame that this TitlePane is used in. */ protected JInternalFrame frame; @@ -620,7 +620,7 @@ public class BasicInternalFrameTitlePane extends JComponent * This is package-private to avoid an accessor method. */ transient JLabel title; - + static { // not constants in JDK @@ -739,7 +739,7 @@ public class BasicInternalFrameTitlePane extends JComponent selectedTitleColor = UIManager.getColor("InternalFrame.activeTitleBackground"); notSelectedTextColor = UIManager.getColor("InternalFrame.inactiveTitleForeground"); notSelectedTitleColor = UIManager.getColor("InternalFrame.inactiveTitleBackground"); - + closeIcon = UIManager.getIcon("InternalFrame.closeIcon"); iconIcon = UIManager.getIcon("InternalFrame.iconifyIcon"); maxIcon = UIManager.getIcon("InternalFrame.maximizeIcon"); @@ -755,7 +755,7 @@ public class BasicInternalFrameTitlePane extends JComponent selectedTitleColor = null; notSelectedTextColor = null; notSelectedTitleColor = null; - + closeIcon = null; iconIcon = null; maxIcon = null; @@ -894,17 +894,17 @@ public class BasicInternalFrameTitlePane extends JComponent paintTitleBackground(g); if (frame.getTitle() != null && title != null) { - Color saved = g.getColor(); + Color saved = g.getColor(); Font f = title.getFont(); g.setFont(f); FontMetrics fm = g.getFontMetrics(f); - if (frame.isSelected()) - g.setColor(selectedTextColor); - else - g.setColor(notSelectedTextColor); - title.setText(getTitle(frame.getTitle(), fm, title.getBounds().width)); - SwingUtilities.paintComponent(g, title, null, title.getBounds()); - g.setColor(saved); + if (frame.isSelected()) + g.setColor(selectedTextColor); + else + g.setColor(notSelectedTextColor); + title.setText(getTitle(frame.getTitle(), fm, title.getBounds().width)); + SwingUtilities.paintComponent(g, title, null, title.getBounds()); + g.setColor(saved); } } @@ -964,7 +964,7 @@ public class BasicInternalFrameTitlePane extends JComponent { // FIXME: Implement postClosingEvent when I figure out what // it's supposed to do. - // It says that this fires an WINDOW_CLOSING like event. + // It says that this fires an WINDOW_CLOSING like event. // So the closest thing is some kind of InternalFrameEvent. // But none is fired. // Can't see it called or anything. diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java index 87c5268..da37e2b 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java @@ -170,10 +170,10 @@ public class BasicInternalFrameUI extends InternalFrameUI implements SwingConstants { /** - * The current shape of the cursor. + * The current shape of the cursor. */ transient int showingCursor; - + /** FIXME: Use for something. */ protected final int RESIZE_NONE = 0; @@ -188,7 +188,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** Cache rectangle that can be reused. */ private transient Rectangle cacheRect = new Rectangle(); - + /** * This method is called when the mouse is clicked. * @@ -209,7 +209,7 @@ public class BasicInternalFrameUI extends InternalFrameUI { // We do nothing if the attempt has been vetoed. } - + // There is nothing to do when the mouse is clicked // on the border. } @@ -288,7 +288,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when the mouse exits the JInternalFrame. - * + * * @param e The MouseEvent. */ public void mouseExited(MouseEvent e) @@ -302,7 +302,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when the mouse is moved inside the JInternalFrame. - * + * * @param e The MouseEvent. */ public void mouseMoved(MouseEvent e) @@ -318,10 +318,10 @@ public class BasicInternalFrameUI extends InternalFrameUI setCursor(e); } } - + /** * Set the mouse cursor, how applicable. - * + * * @param e the current mouse event. */ void setCursor(MouseEvent e) @@ -337,7 +337,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when the mouse is pressed. - * + * * @param e The MouseEvent. */ public void mousePressed(MouseEvent e) @@ -381,7 +381,7 @@ public class BasicInternalFrameUI extends InternalFrameUI dm.endDraggingFrame(frame); frame.putClientProperty("bufferedDragging", null); } - + setCursor(e); } @@ -398,7 +398,7 @@ public class BasicInternalFrameUI extends InternalFrameUI { Rectangle b = frame.getBounds(); int corner = InternalFrameBorder.cornerSize; - + if (x < corner && y < corner) return Cursor.NW_RESIZE_CURSOR; else if (x > b.width - corner && y < corner) @@ -429,7 +429,7 @@ public class BasicInternalFrameUI extends InternalFrameUI { /** * This method is called when the JDesktopPane is hidden. - * + * * @param e * The ComponentEvent fired. */ @@ -440,7 +440,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when the JDesktopPane is moved. - * + * * @param e * The ComponentEvent fired. */ @@ -451,7 +451,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when the JDesktopPane is resized. - * + * * @param e * The ComponentEvent fired. */ @@ -469,7 +469,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when the JDesktopPane is shown. - * + * * @param e * The ComponentEvent fired. */ @@ -487,7 +487,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when the given Component is added to the * JInternalFrame. - * + * * @param name * The name of the Component. * @param c @@ -501,7 +501,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is used to set the bounds of the children of the * JInternalFrame. - * + * * @param c * The Container to lay out. */ @@ -562,7 +562,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method returns the minimum layout size. - * + * * @param c * The Container to find a minimum layout size for. * @return The minimum dimensions for the JInternalFrame. @@ -574,7 +574,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * Th8is method returns the preferred layout size. - * + * * @param c * The Container to find a preferred layout size for. * @return The preferred dimensions for the JInternalFrame. @@ -586,7 +586,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * DOCUMENT ME! - * + * * @param c * DOCUMENT ME! * @param min @@ -694,7 +694,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when the mouse enters the glass pane. - * + * * @param e * The MouseEvent. */ @@ -705,7 +705,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when the mouse is clicked on the glass pane. - * + * * @param e * The MouseEvent. */ @@ -716,7 +716,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when the mouse is dragged in the glass pane. - * + * * @param e * The MouseEvent. */ @@ -727,7 +727,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when the mouse exits the glass pane. - * + * * @param e * The MouseEvent. */ @@ -738,7 +738,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when the mouse is moved in the glass pane. - * + * * @param e * The MouseEvent. */ @@ -749,7 +749,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when the mouse is pressed in the glass pane. - * + * * @param e * The MouseEvent. */ @@ -764,7 +764,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when the mouse is released in the glass pane. - * + * * @param e * The MouseEvent. */ @@ -776,7 +776,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This is a helper method that dispatches the GlassPane MouseEvents to the * proper component. - * + * * @param e the mouse event to be dispatched */ private void handleEvent(MouseEvent e) @@ -885,7 +885,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method is called when one of the JInternalFrame's properties change. - * + * * @param evt * The PropertyChangeEvent. */ @@ -971,8 +971,8 @@ public class BasicInternalFrameUI extends InternalFrameUI class InternalFrameBorder extends AbstractBorder implements UIResource { - /** - * The width of the border. + /** + * The width of the border. */ static final int bSize = 5; @@ -983,7 +983,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method returns whether the border is opaque. - * + * * @return Whether the border is opaque. */ public boolean isBorderOpaque() @@ -993,7 +993,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method returns the insets of the border. - * + * * @param c * The Component to find border insets for. * @return The border insets. @@ -1005,7 +1005,7 @@ public class BasicInternalFrameUI extends InternalFrameUI /** * This method paints the border. - * + * * @param c * The Component that owns the border. * @param g @@ -1051,9 +1051,9 @@ public class BasicInternalFrameUI extends InternalFrameUI g.fill3DRect(0, cornerSize, bSize, b.height - 2 * cornerSize, false); g.fill3DRect(cornerSize, 0, b.width - 2 * cornerSize, bSize, false); - g.fill3DRect(cornerSize, b.height - bSize, b.width - 2 * cornerSize, + g.fill3DRect(cornerSize, b.height - bSize, b.width - 2 * cornerSize, bSize, false); - g.fill3DRect(b.width - bSize, cornerSize, bSize, + g.fill3DRect(b.width - bSize, cornerSize, bSize, b.height - 2 * cornerSize, false); g.translate(-x, -y); @@ -1595,7 +1595,7 @@ public class BasicInternalFrameUI extends InternalFrameUI replacePane(northPane, c); northPane = c; // the following is needed to make internal frames draggable when using - // the JGoodies PlasticLookAndFeel, because it overrides the + // the JGoodies PlasticLookAndFeel, because it overrides the // createNorthPane() method and doesn't assign anything to the titlePane // field. It is possible there is another way to make this work, but // I didn't find it... diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicLabelUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicLabelUI.java index 045740d..9469b56 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicLabelUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicLabelUI.java @@ -114,7 +114,7 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener /** * Returns the preferred size of this component as calculated by the - * {@link #layoutCL(JLabel, FontMetrics, String, Icon, Rectangle, Rectangle, + * {@link #layoutCL(JLabel, FontMetrics, String, Icon, Rectangle, Rectangle, * Rectangle)} method. * * @param c This {@link JComponent} to get a preferred size for. @@ -188,7 +188,7 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener /** * The method that paints the label according to its current state. - * + * * @param g The {@link Graphics} object to paint with. * @param c The {@link JComponent} to paint. */ @@ -217,7 +217,7 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener text = layoutCL(b, fm, text, icon, vr, ir, tr); if (icon != null) - icon.paintIcon(b, g, ir.x, ir.y); + icon.paintIcon(b, g, ir.x, ir.y); if (text != null && ! text.equals("")) { @@ -239,7 +239,7 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener /** * This method is simply calls SwingUtilities's layoutCompoundLabel. - * + * * @param label The label to lay out. * @param fontMetrics The FontMetrics for the font used. * @param text The text to paint. @@ -247,7 +247,7 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener * @param viewR The entire viewable rectangle. * @param iconR The icon bounds rectangle. * @param textR The text bounds rectangle. - * + * * @return A possibly clipped version of the text. */ protected String layoutCL(JLabel label, FontMetrics fontMetrics, String text, @@ -421,11 +421,11 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener { // add a keystroke for the given mnemonic mapping to 'press'; InputMap keyMap = new InputMap(); - keyMap.put(KeyStroke.getKeyStroke(mnemonic, KeyEvent.VK_ALT), + keyMap.put(KeyStroke.getKeyStroke(mnemonic, KeyEvent.VK_ALT), "press"); - SwingUtilities.replaceUIInputMap(l, + SwingUtilities.replaceUIInputMap(l, JComponent.WHEN_IN_FOCUSED_WINDOW, keyMap); - + // add an action to focus the component when 'press' happens ActionMap map = new ActionMap(); map.put("press", new AbstractAction() { @@ -439,7 +439,7 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener }); SwingUtilities.replaceUIActionMap(l, map); } - } + } } /** @@ -450,7 +450,7 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener protected void uninstallKeyboardActions(JLabel l) { SwingUtilities.replaceUIActionMap(l, null); - SwingUtilities.replaceUIInputMap(l, JComponent.WHEN_IN_FOCUSED_WINDOW, + SwingUtilities.replaceUIInputMap(l, JComponent.WHEN_IN_FOCUSED_WINDOW, null); } @@ -500,9 +500,9 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener int newMnemonic = ((Integer) e.getNewValue()).intValue(); InputMap keyMap = label.getInputMap( JComponent.WHEN_IN_FOCUSED_WINDOW); - keyMap.put(KeyStroke.getKeyStroke(oldMnemonic, + keyMap.put(KeyStroke.getKeyStroke(oldMnemonic, KeyEvent.ALT_DOWN_MASK), null); - keyMap.put(KeyStroke.getKeyStroke(newMnemonic, + keyMap.put(KeyStroke.getKeyStroke(newMnemonic, KeyEvent.ALT_DOWN_MASK), "press"); } } @@ -512,8 +512,8 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener InputMap keyMap = label.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); int mnemonic = label.getDisplayedMnemonic(); if (mnemonic > 0) - keyMap.put(KeyStroke.getKeyStroke(mnemonic, KeyEvent.ALT_DOWN_MASK), - "press"); + keyMap.put(KeyStroke.getKeyStroke(mnemonic, KeyEvent.ALT_DOWN_MASK), + "press"); } } diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicListUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicListUI.java index befc227..0e33957 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicListUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicListUI.java @@ -78,7 +78,7 @@ import javax.swing.plaf.ListUI; import javax.swing.plaf.UIResource; /** - * The Basic Look and Feel UI delegate for the + * The Basic Look and Feel UI delegate for the * JList. */ public class BasicListUI extends ListUI @@ -111,7 +111,7 @@ public class BasicListUI extends ListUI } /** - * Helper method to repaint the focused cell's + * Helper method to repaint the focused cell's * lost or acquired focus state. */ protected void repaintCellFocus() @@ -170,7 +170,7 @@ public class BasicListUI extends ListUI public class ListSelectionHandler implements ListSelectionListener { /** - * Called when the list selection changes. + * Called when the list selection changes. * * @param e The event representing the change */ @@ -197,7 +197,7 @@ public class BasicListUI extends ListUI ActionListener target; String bindingCommandName; - public ActionListenerProxy(ActionListener li, + public ActionListenerProxy(ActionListener li, String cmd) { target = li; @@ -237,13 +237,13 @@ public class BasicListUI extends ListUI { int lead = list.getLeadSelectionIndex(); int max = list.getModel().getSize() - 1; - DefaultListSelectionModel selModel + DefaultListSelectionModel selModel = (DefaultListSelectionModel) list.getSelectionModel(); String command = e.getActionCommand(); // Do nothing if list is empty if (max == -1) return; - + if (command.equals("selectNextRow")) { selectNextIndex(); @@ -265,7 +265,7 @@ public class BasicListUI extends ListUI } else if (command.equals("selectLastRow")) { - list.setSelectedIndex(list.getModel().getSize() - 1); + list.setSelectedIndex(list.getModel().getSize() - 1); } else if (command.equals("selectLastRowChangeLead")) { @@ -276,7 +276,7 @@ public class BasicListUI extends ListUI int target; if (lead == list.getLastVisibleIndex()) { - target = Math.min(max, lead + (list.getLastVisibleIndex() + target = Math.min(max, lead + (list.getLastVisibleIndex() - list.getFirstVisibleIndex() + 1)); } else @@ -288,7 +288,7 @@ public class BasicListUI extends ListUI int target; if (lead == list.getLastVisibleIndex()) { - target = Math.min(max, lead + (list.getLastVisibleIndex() + target = Math.min(max, lead + (list.getLastVisibleIndex() - list.getFirstVisibleIndex() + 1)); } else @@ -300,7 +300,7 @@ public class BasicListUI extends ListUI int target; if (lead == list.getFirstVisibleIndex()) { - target = Math.max(0, lead - (list.getLastVisibleIndex() + target = Math.max(0, lead - (list.getLastVisibleIndex() - list.getFirstVisibleIndex() + 1)); } else @@ -312,7 +312,7 @@ public class BasicListUI extends ListUI int target; if (lead == list.getFirstVisibleIndex()) { - target = Math.max(0, lead - (list.getLastVisibleIndex() + target = Math.max(0, lead - (list.getLastVisibleIndex() - list.getFirstVisibleIndex() + 1)); } else @@ -344,12 +344,12 @@ public class BasicListUI extends ListUI int target; if (lead == list.getFirstVisibleIndex()) { - target = Math.max(0, lead - (list.getLastVisibleIndex() + target = Math.max(0, lead - (list.getLastVisibleIndex() - list.getFirstVisibleIndex() + 1)); } else target = list.getFirstVisibleIndex(); - list.setSelectedIndex(target); + list.setSelectedIndex(target); } else if (command.equals("selectLastRowExtendSelection")) { @@ -360,7 +360,7 @@ public class BasicListUI extends ListUI int target; if (lead == list.getLastVisibleIndex()) { - target = Math.min(max, lead + (list.getLastVisibleIndex() + target = Math.min(max, lead + (list.getLastVisibleIndex() - list.getFirstVisibleIndex() + 1)); } else @@ -384,7 +384,7 @@ public class BasicListUI extends ListUI { selModel.moveLeadSelectionIndex(Math.max(0, lead - 1)); } - } + } else if (command.equals("addToSelection")) { list.addSelectionInterval(lead, lead); @@ -402,20 +402,20 @@ public class BasicListUI extends ListUI list.removeSelectionInterval(lead, lead); selModel.setAnchorSelectionIndex(lead); } - else + else { - // DEBUG: uncomment the following line to print out + // DEBUG: uncomment the following line to print out // key bindings that aren't implemented yet - + // System.out.println ("not implemented: "+e.getActionCommand()); } - + list.ensureIndexIsVisible(list.getLeadSelectionIndex()); } } /** - * A helper class which listens for {@link MouseEvent}s + * A helper class which listens for {@link MouseEvent}s * from the {@link JList}. */ public class MouseInputHandler implements MouseInputListener @@ -436,20 +436,20 @@ public class BasicListUI extends ListUI { if (list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION) list.setSelectedIndex(index); - else if (list.getSelectionMode() == + else if (list.getSelectionMode() == ListSelectionModel.SINGLE_INTERVAL_SELECTION) // COMPAT: the IBM VM is compatible with the following line of code. - // However, compliance with Sun's VM would correspond to replacing - // getAnchorSelectionIndex() with getLeadSelectionIndex().This is - // both unnatural and contradictory to the way they handle other + // However, compliance with Sun's VM would correspond to replacing + // getAnchorSelectionIndex() with getLeadSelectionIndex().This is + // both unnatural and contradictory to the way they handle other // similar UI interactions. list.setSelectionInterval(list.getAnchorSelectionIndex(), index); else // COMPAT: both Sun and IBM are compatible instead with: // list.setSelectionInterval // (list.getLeadSelectionIndex(),index); - // Note that for IBM this is contradictory to what they did in - // the above situation for SINGLE_INTERVAL_SELECTION. + // Note that for IBM this is contradictory to what they did in + // the above situation for SINGLE_INTERVAL_SELECTION. // The most natural thing to do is the following: if (list.isSelectedIndex(list.getAnchorSelectionIndex())) list.getSelectionModel().setLeadSelectionIndex(index); @@ -467,7 +467,7 @@ public class BasicListUI extends ListUI } else list.setSelectedIndex(index); - + list.ensureIndexIsVisible(list.getLeadSelectionIndex()); } @@ -530,7 +530,7 @@ public class BasicListUI extends ListUI return; if (!event.isShiftDown() && !event.isControlDown()) list.setSelectedIndex(index); - + list.ensureIndexIsVisible(list.getLeadSelectionIndex()); } @@ -664,7 +664,7 @@ public class BasicListUI extends ListUI /** The width of a single cell in the list. */ protected int cellWidth; - /** + /** * An array of varying heights of cells in the list, in cases where each * cell might have a different height. This field is used when the * <code>fixedCellHeight</code> property of the list is not set. Otherwise @@ -692,7 +692,7 @@ public class BasicListUI extends ListUI * The {@link CellRendererPane} that is used for painting. */ protected CellRendererPane rendererPane; - + /** The action bound to KeyStrokes. */ ListAction action; @@ -729,7 +729,7 @@ public class BasicListUI extends ListUI * @param index1 The first row to include in the bounds * @param index2 The last row to incude in the bounds * - * @return A rectangle encompassing the range of rows between + * @return A rectangle encompassing the range of rows between * <code>index1</code> and <code>index2</code> inclusive, or null * such a rectangle couldn't be calculated for the given indexes. */ @@ -953,7 +953,7 @@ public class BasicListUI extends ListUI } /** - * Resets to <code>null</code> those defaults which were installed in + * Resets to <code>null</code> those defaults which were installed in * {@link #installDefaults} */ protected void uninstallDefaults() @@ -1002,7 +1002,7 @@ public class BasicListUI extends ListUI list.removeMouseMotionListener(mouseInputListener); list.removePropertyChangeListener(propertyChangeListener); } - + /** * Installs keyboard actions for this UI in the {@link JList}. */ @@ -1125,7 +1125,7 @@ public class BasicListUI extends ListUI * Gets the size this list would prefer to assume. This is calculated by * calling {@link #getCellBounds} over the entire list. * - * @param c Ignored; uses the saved {@link JList} reference + * @param c Ignored; uses the saved {@link JList} reference * * @return DOCUMENT ME! */ @@ -1150,7 +1150,7 @@ public class BasicListUI extends ListUI { // We cast to double here to force double divisions. double modelSize = size; - int neededColumns = (int) Math.ceil(modelSize / visibleRows); + int neededColumns = (int) Math.ceil(modelSize / visibleRows); int adjustedRows = (int) Math.ceil(modelSize / neededColumns); h = maxCellHeight * adjustedRows; w = cellWidth * neededColumns; @@ -1220,7 +1220,7 @@ public class BasicListUI extends ListUI * cell in the list. * * @param g The graphics context to paint with - * @param c Ignored; uses the saved {@link JList} reference + * @param c Ignored; uses the saved {@link JList} reference */ public void paint(Graphics g, JComponent c) { @@ -1238,7 +1238,7 @@ public class BasicListUI extends ListUI int startIndex = locationToIndex(list, new Point(clip.x, clip.y)); int endIndex = locationToIndex(list, new Point(clip.x + clip.width, clip.y + clip.height)); - + for (int row = startIndex; row <= endIndex; ++row) { Rectangle bounds = getCellBounds(list, row, row); diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java b/libjava/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java index 1543094..9a1f544 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java @@ -96,7 +96,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel * are targetted at a menu/submenu/menubar or not. If not, * the MenuSelectionManager is messaged to close the currently opened menus, * if any. - * + * * @author Roman Kennke (kennke@aicas.com) */ private class PopupHelper implements AWTEventListener @@ -227,9 +227,9 @@ public abstract class BasicLookAndFeel extends LookAndFeel } /** - * Creates and returns a new instance of the default resources for this look + * Creates and returns a new instance of the default resources for this look * and feel. - * + * * @return The UI defaults. */ public UIDefaults getDefaults() @@ -247,9 +247,9 @@ public abstract class BasicLookAndFeel extends LookAndFeel } /** - * Populates the <code>defaults</code> table with mappings between class IDs + * Populates the <code>defaults</code> table with mappings between class IDs * and fully qualified class names for the UI delegates. - * + * * @param defaults the defaults table (<code>null</code> not permitted). */ protected void initClassDefaults(UIDefaults defaults) @@ -314,7 +314,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel * {@link #loadSystemColors(UIDefaults, String[], boolean)}. If the * look and feel is a native look and feel, these defaults may be overridden * by the corresponding SystemColor constants. - * + * * @param defaults the defaults table (<code>null</code> not permitted). */ protected void initSystemColorDefaults(UIDefaults defaults) @@ -365,7 +365,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel * <code>false</code> * @param useNative when <code>true</code>, installs the values of the * SystemColor constants, when <code>false</code>, install the values - * from <code>systemColors</code> + * from <code>systemColors</code> */ protected void loadSystemColors(UIDefaults defaults, String[] systemColors, boolean useNative) @@ -479,19 +479,19 @@ public abstract class BasicLookAndFeel extends LookAndFeel protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; - + Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); - + uiDefaults = new Object[] { "AbstractUndoableEdit.undoText", "Undo", "AbstractUndoableEdit.redoText", "Redo", "Button.background", new ColorUIResource(Color.LIGHT_GRAY), "Button.border", - new UIDefaults.LazyValue() + new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { @@ -528,7 +528,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel return BasicIconFactory.getCheckBoxIcon(); } }, - "CheckBox.checkIcon", + "CheckBox.checkIcon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) @@ -549,7 +549,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel "CheckBoxMenuItem.background", new ColorUIResource(light), "CheckBoxMenuItem.border", new BasicBorders.MarginBorder(), "CheckBoxMenuItem.borderPainted", Boolean.FALSE, - "CheckBoxMenuItem.checkIcon", + "CheckBoxMenuItem.checkIcon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) @@ -637,7 +637,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel "EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12), "EditorPane.foreground", new ColorUIResource(Color.black), "EditorPane.inactiveForeground", new ColorUIResource(Color.gray), - "EditorPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { + "EditorPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { KeyStroke.getKeyStroke("shift UP"), "selection-up", KeyStroke.getKeyStroke("ctrl RIGHT"), "caret-next-word", KeyStroke.getKeyStroke("shift ctrl LEFT"), "selection-previous-word", @@ -782,21 +782,21 @@ public abstract class BasicLookAndFeel extends LookAndFeel "InternalFrame.border", new UIDefaults.LazyValue() { - public Object createValue(UIDefaults table) - { - Color lineColor = new Color(238, 238, 238); - Border inner = BorderFactory.createLineBorder(lineColor, 1); - Color shadowInner = new Color(184, 207, 229); - Color shadowOuter = new Color(122, 138, 153); - Border outer = BorderFactory.createBevelBorder(BevelBorder.RAISED, - Color.WHITE, - Color.WHITE, - shadowOuter, - shadowInner); - Border border = new BorderUIResource.CompoundBorderUIResource(outer, - inner); - return border; - } + public Object createValue(UIDefaults table) + { + Color lineColor = new Color(238, 238, 238); + Border inner = BorderFactory.createLineBorder(lineColor, 1); + Color shadowInner = new Color(184, 207, 229); + Color shadowOuter = new Color(122, 138, 153); + Border outer = BorderFactory.createBevelBorder(BevelBorder.RAISED, + Color.WHITE, + Color.WHITE, + shadowOuter, + shadowInner); + Border border = new BorderUIResource.CompoundBorderUIResource(outer, + inner); + return border; + } }, "InternalFrame.borderColor", new ColorUIResource(light), "InternalFrame.borderDarkShadow", new ColorUIResource(Color.BLACK), @@ -1459,60 +1459,60 @@ public abstract class BasicLookAndFeel extends LookAndFeel "TextPane.foreground", new ColorUIResource(Color.black), "TextPane.inactiveForeground", new ColorUIResource(Color.gray), "TextPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { - KeyStroke.getKeyStroke("shift UP"), "selection-up", - KeyStroke.getKeyStroke("ctrl RIGHT"), "caret-next-word", - KeyStroke.getKeyStroke("shift ctrl LEFT"), "selection-previous-word", - KeyStroke.getKeyStroke("shift KP_UP"), "selection-up", - KeyStroke.getKeyStroke("DOWN"), "caret-down", - KeyStroke.getKeyStroke("shift ctrl T"), "previous-link-action", - KeyStroke.getKeyStroke("ctrl LEFT"), "caret-previous-word", - KeyStroke.getKeyStroke("CUT"), "cut-to-clipboard", - KeyStroke.getKeyStroke("END"), "caret-end-line", - KeyStroke.getKeyStroke("shift PAGE_UP"), "selection-page-up", - KeyStroke.getKeyStroke("KP_UP"), "caret-up", - KeyStroke.getKeyStroke("DELETE"), "delete-next", - KeyStroke.getKeyStroke("ctrl HOME"), "caret-begin", - KeyStroke.getKeyStroke("shift LEFT"), "selection-backward", - KeyStroke.getKeyStroke("ctrl END"), "caret-end", - KeyStroke.getKeyStroke("BACK_SPACE"), "delete-previous", - KeyStroke.getKeyStroke("shift ctrl RIGHT"), "selection-next-word", - KeyStroke.getKeyStroke("LEFT"), "caret-backward", - KeyStroke.getKeyStroke("KP_LEFT"), "caret-backward", - KeyStroke.getKeyStroke("shift KP_RIGHT"), "selection-forward", - KeyStroke.getKeyStroke("ctrl SPACE"), "activate-link-action", - KeyStroke.getKeyStroke("ctrl H"), "delete-previous", - KeyStroke.getKeyStroke("ctrl BACK_SLASH"), "unselect", - KeyStroke.getKeyStroke("ENTER"), "insert-break", - KeyStroke.getKeyStroke("shift HOME"), "selection-begin-line", - KeyStroke.getKeyStroke("RIGHT"), "caret-forward", - KeyStroke.getKeyStroke("shift ctrl PAGE_UP"), "selection-page-left", - KeyStroke.getKeyStroke("shift DOWN"), "selection-down", - KeyStroke.getKeyStroke("PAGE_DOWN"), "page-down", - KeyStroke.getKeyStroke("shift KP_LEFT"), "selection-backward", - KeyStroke.getKeyStroke("shift ctrl O"), "toggle-componentOrientation", - KeyStroke.getKeyStroke("ctrl X"), "cut-to-clipboard", - KeyStroke.getKeyStroke("shift ctrl PAGE_DOWN"), "selection-page-right", - KeyStroke.getKeyStroke("ctrl C"), "copy-to-clipboard", - KeyStroke.getKeyStroke("ctrl KP_RIGHT"), "caret-next-word", - KeyStroke.getKeyStroke("shift END"), "selection-end-line", - KeyStroke.getKeyStroke("ctrl KP_LEFT"), "caret-previous-word", - KeyStroke.getKeyStroke("HOME"), "caret-begin-line", - KeyStroke.getKeyStroke("ctrl V"), "paste-from-clipboard", - KeyStroke.getKeyStroke("KP_DOWN"), "caret-down", - KeyStroke.getKeyStroke("ctrl A"), "select-all", - KeyStroke.getKeyStroke("shift RIGHT"), "selection-forward", - KeyStroke.getKeyStroke("shift ctrl END"), "selection-end", - KeyStroke.getKeyStroke("COPY"), "copy-to-clipboard", - KeyStroke.getKeyStroke("shift ctrl KP_LEFT"), "selection-previous-word", - KeyStroke.getKeyStroke("ctrl T"), "next-link-action", - KeyStroke.getKeyStroke("shift KP_DOWN"), "selection-down", - KeyStroke.getKeyStroke("TAB"), "insert-tab", - KeyStroke.getKeyStroke("UP"), "caret-up", - KeyStroke.getKeyStroke("shift ctrl HOME"), "selection-begin", - KeyStroke.getKeyStroke("shift PAGE_DOWN"), "selection-page-down", - KeyStroke.getKeyStroke("KP_RIGHT"), "caret-forward", - KeyStroke.getKeyStroke("shift ctrl KP_RIGHT"), "selection-next-word", - KeyStroke.getKeyStroke("PAGE_UP"), "page-up", + KeyStroke.getKeyStroke("shift UP"), "selection-up", + KeyStroke.getKeyStroke("ctrl RIGHT"), "caret-next-word", + KeyStroke.getKeyStroke("shift ctrl LEFT"), "selection-previous-word", + KeyStroke.getKeyStroke("shift KP_UP"), "selection-up", + KeyStroke.getKeyStroke("DOWN"), "caret-down", + KeyStroke.getKeyStroke("shift ctrl T"), "previous-link-action", + KeyStroke.getKeyStroke("ctrl LEFT"), "caret-previous-word", + KeyStroke.getKeyStroke("CUT"), "cut-to-clipboard", + KeyStroke.getKeyStroke("END"), "caret-end-line", + KeyStroke.getKeyStroke("shift PAGE_UP"), "selection-page-up", + KeyStroke.getKeyStroke("KP_UP"), "caret-up", + KeyStroke.getKeyStroke("DELETE"), "delete-next", + KeyStroke.getKeyStroke("ctrl HOME"), "caret-begin", + KeyStroke.getKeyStroke("shift LEFT"), "selection-backward", + KeyStroke.getKeyStroke("ctrl END"), "caret-end", + KeyStroke.getKeyStroke("BACK_SPACE"), "delete-previous", + KeyStroke.getKeyStroke("shift ctrl RIGHT"), "selection-next-word", + KeyStroke.getKeyStroke("LEFT"), "caret-backward", + KeyStroke.getKeyStroke("KP_LEFT"), "caret-backward", + KeyStroke.getKeyStroke("shift KP_RIGHT"), "selection-forward", + KeyStroke.getKeyStroke("ctrl SPACE"), "activate-link-action", + KeyStroke.getKeyStroke("ctrl H"), "delete-previous", + KeyStroke.getKeyStroke("ctrl BACK_SLASH"), "unselect", + KeyStroke.getKeyStroke("ENTER"), "insert-break", + KeyStroke.getKeyStroke("shift HOME"), "selection-begin-line", + KeyStroke.getKeyStroke("RIGHT"), "caret-forward", + KeyStroke.getKeyStroke("shift ctrl PAGE_UP"), "selection-page-left", + KeyStroke.getKeyStroke("shift DOWN"), "selection-down", + KeyStroke.getKeyStroke("PAGE_DOWN"), "page-down", + KeyStroke.getKeyStroke("shift KP_LEFT"), "selection-backward", + KeyStroke.getKeyStroke("shift ctrl O"), "toggle-componentOrientation", + KeyStroke.getKeyStroke("ctrl X"), "cut-to-clipboard", + KeyStroke.getKeyStroke("shift ctrl PAGE_DOWN"), "selection-page-right", + KeyStroke.getKeyStroke("ctrl C"), "copy-to-clipboard", + KeyStroke.getKeyStroke("ctrl KP_RIGHT"), "caret-next-word", + KeyStroke.getKeyStroke("shift END"), "selection-end-line", + KeyStroke.getKeyStroke("ctrl KP_LEFT"), "caret-previous-word", + KeyStroke.getKeyStroke("HOME"), "caret-begin-line", + KeyStroke.getKeyStroke("ctrl V"), "paste-from-clipboard", + KeyStroke.getKeyStroke("KP_DOWN"), "caret-down", + KeyStroke.getKeyStroke("ctrl A"), "select-all", + KeyStroke.getKeyStroke("shift RIGHT"), "selection-forward", + KeyStroke.getKeyStroke("shift ctrl END"), "selection-end", + KeyStroke.getKeyStroke("COPY"), "copy-to-clipboard", + KeyStroke.getKeyStroke("shift ctrl KP_LEFT"), "selection-previous-word", + KeyStroke.getKeyStroke("ctrl T"), "next-link-action", + KeyStroke.getKeyStroke("shift KP_DOWN"), "selection-down", + KeyStroke.getKeyStroke("TAB"), "insert-tab", + KeyStroke.getKeyStroke("UP"), "caret-up", + KeyStroke.getKeyStroke("shift ctrl HOME"), "selection-begin", + KeyStroke.getKeyStroke("shift PAGE_DOWN"), "selection-page-down", + KeyStroke.getKeyStroke("KP_RIGHT"), "caret-forward", + KeyStroke.getKeyStroke("shift ctrl KP_RIGHT"), "selection-next-word", + KeyStroke.getKeyStroke("PAGE_UP"), "page-up", KeyStroke.getKeyStroke("PASTE"), "paste-from-clipboard" }), "TextPane.margin", new InsetsUIResource(3, 3, 3, 3), diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicMenuBarUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicMenuBarUI.java index cd25a3b..b9e2912 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicMenuBarUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicMenuBarUI.java @@ -109,20 +109,20 @@ public class BasicMenuBarUI extends MenuBarUI defaultManager.setSelectedPath(me); } } - + } protected ChangeListener changeListener; /*ContainerListener that listens to the ContainerEvents fired from menu bar*/ protected ContainerListener containerListener; - + /*Property change listeners that listener to PropertyChangeEvent from menu bar*/ private PropertyChangeListener propertyChangeListener; /* menu bar for which this UI delegate is for*/ protected JMenuBar menuBar; - + /* MouseListener that listens to the mouseEvents fired from menu bar*/ private MouseInputListener mouseListener; @@ -398,7 +398,7 @@ public class BasicMenuBarUI extends MenuBarUI menuBar.repaint(); } } - + private class MouseInputHandler implements MouseInputListener { /** @@ -409,7 +409,7 @@ public class BasicMenuBarUI extends MenuBarUI public void mouseClicked(MouseEvent e) { MenuElement[] me = menuBar.getSubElements(); - + for (int i = 0; i < me.length; i++) { JMenu menu = menuBar.getMenu(i); @@ -417,7 +417,7 @@ public class BasicMenuBarUI extends MenuBarUI menu.setSelected(false); } } - + /** * Handles mouse pressed event * @@ -427,7 +427,7 @@ public class BasicMenuBarUI extends MenuBarUI { // TODO: What should be done here, if anything? } - + /** * Handles mouse released event * @@ -437,7 +437,7 @@ public class BasicMenuBarUI extends MenuBarUI { // TODO: What should be done here, if anything? } - + /** * Handles mouse exited event * @@ -447,7 +447,7 @@ public class BasicMenuBarUI extends MenuBarUI { // TODO: What should be done here, if anything? } - + /** * Handles mouse dragged event * @@ -457,7 +457,7 @@ public class BasicMenuBarUI extends MenuBarUI { // TODO: What should be done here, if anything? } - + /** * Handles mouse moved event * @@ -467,7 +467,7 @@ public class BasicMenuBarUI extends MenuBarUI { // TODO: What should be done here, if anything? } - + /** * Handles mouse entered event * diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicMenuItemUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicMenuItemUI.java index 5fafb41..40b5393 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicMenuItemUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicMenuItemUI.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -128,7 +128,7 @@ public class BasicMenuItemUI extends MenuItemUI * Number of spaces between icon and text. */ protected int defaultTextIconGap = 4; - + /** * Color of the text when menu item is disabled */ @@ -222,14 +222,14 @@ public class BasicMenuItemUI extends MenuItemUI /** * A class to handle PropertChangeEvents for the JMenuItem - * @author Anthony Balkissoon abalkiss at redhat dot com. + * @author Anthony Balkissoon abalkiss at redhat dot com. */ class PropertyChangeHandler implements PropertyChangeListener { /** * This method is called when a property of the menuItem is changed. * Currently it is only used to update the accelerator key bindings. - * + * * @param e * the PropertyChangeEvent */ @@ -238,7 +238,7 @@ public class BasicMenuItemUI extends MenuItemUI String property = e.getPropertyName(); if (property.equals("accelerator")) { - InputMap map = SwingUtilities.getUIInputMap(menuItem, + InputMap map = SwingUtilities.getUIInputMap(menuItem, JComponent.WHEN_IN_FOCUSED_WINDOW); if (map != null) map.remove((KeyStroke) e.getOldValue()); @@ -266,7 +266,7 @@ public class BasicMenuItemUI extends MenuItemUI } } } - + /** * A class to handle accelerator keys. This is the Action we will * perform when the accelerator key for this JMenuItem is pressed. @@ -282,9 +282,9 @@ public class BasicMenuItemUI extends MenuItemUI public void actionPerformed(ActionEvent event) { doClick(MenuSelectionManager.defaultManager()); - } + } } - + /** * Creates a new BasicMenuItemUI object. */ @@ -308,7 +308,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Create MenuDragMouseListener to listen for mouse dragged events. - * + * * @param c * menu item to listen to * @return The MenuDragMouseListener @@ -321,7 +321,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Creates MenuKeyListener to listen to key events occuring when menu item is * visible on the screen. - * + * * @param c * menu item to listen to * @return The MenuKeyListener @@ -333,7 +333,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Handles mouse input events occuring for this menu item - * + * * @param c * menu item to listen to * @return The MouseInputListener @@ -346,7 +346,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Factory method to create a BasicMenuItemUI for the given {@link * JComponent}, which should be a {@link JMenuItem}. - * + * * @param c * The {@link JComponent} a UI is being created for. * @return A BasicMenuItemUI for the {@link JComponent}. @@ -358,7 +358,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Programatically clicks menu item. - * + * * @param msm * MenuSelectionManager for the menu hierarchy */ @@ -370,7 +370,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Returns maximum size for the specified menu item - * + * * @param c * component for which to get maximum size * @return Maximum size for the specified menu item. @@ -382,7 +382,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Returns minimum size for the specified menu item - * + * * @param c * component for which to get minimum size * @return Minimum size for the specified menu item. @@ -394,7 +394,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Returns path to this menu item. - * + * * @return $MenuElement[]$ Returns array of menu elements that constitute a * path to this menu item. */ @@ -420,7 +420,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Returns preferred size for the given menu item. - * + * * @param c * menu item for which to get preferred size * @param checkIcon @@ -504,20 +504,20 @@ public class BasicMenuItemUI extends MenuItemUI /** * Returns preferred size of the given component - * + * * @param c * component for which to return preferred size * @return $Dimension$ preferred size for the given component */ public Dimension getPreferredSize(JComponent c) { - return getPreferredMenuItemSize(c, checkIcon, arrowIcon, + return getPreferredMenuItemSize(c, checkIcon, arrowIcon, defaultTextIconGap); } /** * Returns the prefix for entries in the {@link UIDefaults} table. - * + * * @return "MenuItem" */ protected String getPropertyPrefix() @@ -527,7 +527,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * This method installs the components for this {@link JMenuItem}. - * + * * @param menuItem * The {@link JMenuItem} to install components for. */ @@ -548,15 +548,15 @@ public class BasicMenuItemUI extends MenuItemUI prefix + ".foreground", prefix + ".font"); menuItem.setMargin(UIManager.getInsets(prefix + ".margin")); acceleratorFont = UIManager.getFont(prefix + ".acceleratorFont"); - acceleratorForeground = UIManager.getColor(prefix + acceleratorForeground = UIManager.getColor(prefix + ".acceleratorForeground"); - acceleratorSelectionForeground = UIManager.getColor(prefix + acceleratorSelectionForeground = UIManager.getColor(prefix + ".acceleratorSelectionForeground"); selectionBackground = UIManager.getColor(prefix + ".selectionBackground"); selectionForeground = UIManager.getColor(prefix + ".selectionForeground"); acceleratorDelimiter = UIManager.getString(prefix + ".acceleratorDelimiter"); checkIcon = UIManager.getIcon(prefix + ".checkIcon"); - + menuItem.setHorizontalTextPosition(SwingConstants.TRAILING); menuItem.setHorizontalAlignment(SwingConstants.LEADING); } @@ -566,16 +566,16 @@ public class BasicMenuItemUI extends MenuItemUI */ protected void installKeyboardActions() { - InputMap focusedWindowMap = SwingUtilities.getUIInputMap(menuItem, + InputMap focusedWindowMap = SwingUtilities.getUIInputMap(menuItem, JComponent.WHEN_IN_FOCUSED_WINDOW); if (focusedWindowMap == null) focusedWindowMap = new ComponentInputMapUIResource(menuItem); KeyStroke accelerator = menuItem.getAccelerator(); if (accelerator != null) focusedWindowMap.put(accelerator, "doClick"); - SwingUtilities.replaceUIInputMap(menuItem, + SwingUtilities.replaceUIInputMap(menuItem, JComponent.WHEN_IN_FOCUSED_WINDOW, focusedWindowMap); - + ActionMap UIActionMap = SwingUtilities.getUIActionMap(menuItem); if (UIActionMap == null) UIActionMap = new ActionMapUIResource(); @@ -605,7 +605,7 @@ public class BasicMenuItemUI extends MenuItemUI * Installs and initializes all fields for this UI delegate. Any properties of * the UI that need to be initialized and/or set to defaults will be done now. * It will also install any listeners necessary. - * + * * @param c * The {@link JComponent} that is having this UI installed. */ @@ -621,7 +621,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Paints given menu item using specified graphics context - * + * * @param g * The graphics context used to paint this menu item * @param c @@ -635,7 +635,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Paints background of the menu item - * + * * @param g * The graphics context used to paint this menu item * @param menuItem @@ -664,7 +664,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Paints specified menu item - * + * * @param g * The graphics context used to paint this menu item * @param c @@ -808,7 +808,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Paints label for the given menu item - * + * * @param g * The graphics context used to paint this menu item * @param menuItem @@ -864,7 +864,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * This method uninstalls the components for this {@link JMenuItem}. - * + * * @param menuItem * The {@link JMenuItem} to uninstall components for. */ @@ -901,7 +901,7 @@ public class BasicMenuItemUI extends MenuItemUI * Uninstalls any keyboard actions. */ protected void uninstallKeyboardActions() - { + { SwingUtilities.replaceUIInputMap(menuItem, JComponent.WHEN_IN_FOCUSED_WINDOW, null); } @@ -922,7 +922,7 @@ public class BasicMenuItemUI extends MenuItemUI * Performs the opposite of installUI. Any properties or resources that need * to be cleaned up will be done now. It will also uninstall any listeners it * has. In addition, any properties of this UI will be nulled. - * + * * @param c * The {@link JComponent} that is having this UI uninstalled. */ @@ -937,7 +937,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * This method calls paint. - * + * * @param g * The graphics context used to paint this menu item * @param c @@ -966,7 +966,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * This method is called when mouse is clicked on the menu item. It forwards * this event to MenuSelectionManager. - * + * * @param e * A {@link MouseEvent}. */ @@ -979,7 +979,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * This method is called when mouse is dragged inside the menu item. It * forwards this event to MenuSelectionManager. - * + * * @param e * A {@link MouseEvent}. */ @@ -994,7 +994,7 @@ public class BasicMenuItemUI extends MenuItemUI * item is considered to be selected and selection path in * MenuSelectionManager is set. This event is also forwarded to * MenuSelection Manager for further processing. - * + * * @param e * A {@link MouseEvent}. */ @@ -1012,7 +1012,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * This method is called when mouse exits menu item. The event is forwarded * to MenuSelectionManager for processing. - * + * * @param e * A {@link MouseEvent}. */ @@ -1025,7 +1025,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * This method is called when mouse is inside the menu item. This event is * forwarder to MenuSelectionManager for further processing. - * + * * @param e * A {@link MouseEvent}. */ @@ -1038,7 +1038,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * This method is called when mouse is pressed. This event is forwarded to * MenuSelectionManager for further processing. - * + * * @param e * A {@link MouseEvent}. */ @@ -1052,7 +1052,7 @@ public class BasicMenuItemUI extends MenuItemUI * This method is called when mouse is released. If the mouse is released * inside this menuItem, then this menu item is considered to be chosen and * the menu hierarchy should be closed. - * + * * @param e * A {@link MouseEvent}. */ @@ -1078,7 +1078,7 @@ public class BasicMenuItemUI extends MenuItemUI { /** * Tbis method is invoked when mouse is dragged over the menu item. - * + * * @param e * The MenuDragMouseEvent */ @@ -1091,7 +1091,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Tbis method is invoked when mouse enters the menu item while it is being * dragged. - * + * * @param e * The MenuDragMouseEvent */ @@ -1104,7 +1104,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Tbis method is invoked when mouse exits the menu item while it is being * dragged - * + * * @param e the MenuDragMouseEvent */ public void menuDragMouseExited(MenuDragMouseEvent e) @@ -1115,7 +1115,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * Tbis method is invoked when mouse was dragged and released inside the * menu item. - * + * * @param e * The MenuDragMouseEvent */ @@ -1140,7 +1140,7 @@ public class BasicMenuItemUI extends MenuItemUI { /** * This method is invoked when key has been pressed - * + * * @param e * A {@link MenuKeyEvent}. */ @@ -1151,7 +1151,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * This method is invoked when key has been pressed - * + * * @param e * A {@link MenuKeyEvent}. */ @@ -1163,7 +1163,7 @@ public class BasicMenuItemUI extends MenuItemUI /** * This method is invoked when key has been typed It handles the mnemonic * key for the menu item. - * + * * @param e * A {@link MenuKeyEvent}. */ @@ -1172,7 +1172,7 @@ public class BasicMenuItemUI extends MenuItemUI // TODO: What should be done here, if anything? } } - + /** * Helper class that listens for item changes to the properties of the {@link * JMenuItem}. diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicMenuUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicMenuUI.java index 355e043..4897ee4 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicMenuUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicMenuUI.java @@ -98,7 +98,7 @@ public class BasicMenuUI extends BasicMenuItemUI defaultManager.setSelectedPath(newPath); } } - + } protected ChangeListener changeListener; @@ -233,7 +233,7 @@ public class BasicMenuUI extends BasicMenuItemUI */ protected void installDefaults() { - + LookAndFeel.installBorder(menuItem, "Menu.border"); LookAndFeel.installColorsAndFont(menuItem, "Menu.background", "Menu.foreground", "Menu.font"); @@ -502,9 +502,9 @@ public class BasicMenuUI extends BasicMenuItemUI { JMenu menu = (JMenu) menuItem; if (menu.isTopLevelMenu()) - ((JMenuBar) menu.getParent()).setSelected(menu); + ((JMenuBar) menu.getParent()).setSelected(menu); else - ((JPopupMenu) menu.getParent()).setSelected(menu); + ((JPopupMenu) menu.getParent()).setSelected(menu); } } diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicOptionPaneUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicOptionPaneUI.java index e238085..a03d224 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicOptionPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicOptionPaneUI.java @@ -100,7 +100,7 @@ public class BasicOptionPaneUI extends OptionPaneUI JOptionPane op = (JOptionPane) event.getSource(); op.setValue(new Integer(JOptionPane.CLOSED_OPTION)); } - + } /** @@ -136,18 +136,18 @@ public class BasicOptionPaneUI extends OptionPaneUI Object value = new Integer(JOptionPane.CLOSED_OPTION); Object[] options = optionPane.getOptions(); if (options != null) - value = new Integer(buttonIndex); + value = new Integer(buttonIndex); else { - String text = ((JButton) e.getSource()).getText(); - if (text.equals(OK_STRING)) - value = new Integer(JOptionPane.OK_OPTION); - if (text.equals(CANCEL_STRING)) - value = new Integer(JOptionPane.CANCEL_OPTION); - if (text.equals(YES_STRING)) - value = new Integer(JOptionPane.YES_OPTION); - if (text.equals(NO_STRING)) - value = new Integer(JOptionPane.NO_OPTION); + String text = ((JButton) e.getSource()).getText(); + if (text.equals(OK_STRING)) + value = new Integer(JOptionPane.OK_OPTION); + if (text.equals(CANCEL_STRING)) + value = new Integer(JOptionPane.CANCEL_OPTION); + if (text.equals(YES_STRING)) + value = new Integer(JOptionPane.YES_OPTION); + if (text.equals(NO_STRING)) + value = new Integer(JOptionPane.NO_OPTION); } optionPane.setValue(value); resetInputValue(); @@ -155,7 +155,7 @@ public class BasicOptionPaneUI extends OptionPaneUI Window owner = SwingUtilities.windowForComponent(optionPane); if (owner instanceof JDialog) - ((JDialog) owner).dispose(); + ((JDialog) owner).dispose(); //else we probably have some kind of internal frame. JInternalFrame inf = (JInternalFrame) SwingUtilities.getAncestorOfClass( @@ -265,21 +265,21 @@ public class BasicOptionPaneUI extends OptionPaneUI Component[] buttonList = container.getComponents(); int x = container.getInsets().left; if (getCentersChildren()) - x += (int) ((double) (container.getSize().width) / 2 - - (double) (buttonRowLength(container)) / 2); + x += (int) ((double) (container.getSize().width) / 2 + - (double) (buttonRowLength(container)) / 2); for (int i = 0; i < buttonList.length; i++) { - Dimension dims = buttonList[i].getPreferredSize(); - if (syncAllWidths) - { - buttonList[i].setBounds(x, 0, widthOfWidestButton, dims.height); - x += widthOfWidestButton + getPadding(); - } - else - { - buttonList[i].setBounds(x, 0, dims.width, dims.height); - x += dims.width + getPadding(); - } + Dimension dims = buttonList[i].getPreferredSize(); + if (syncAllWidths) + { + buttonList[i].setBounds(x, 0, widthOfWidestButton, dims.height); + x += widthOfWidestButton + getPadding(); + } + else + { + buttonList[i].setBounds(x, 0, dims.width, dims.height); + x += dims.width + getPadding(); + } } } @@ -301,10 +301,10 @@ public class BasicOptionPaneUI extends OptionPaneUI for (int i = 0; i < buttonList.length; i++) { - Dimension dims = buttonList[i].getPreferredSize(); - buttonLength += dims.width + getPadding(); - widest = Math.max(widest, dims.width); - tallest = Math.max(tallest, dims.height); + Dimension dims = buttonList[i].getPreferredSize(); + buttonLength += dims.width + getPadding(); + widest = Math.max(widest, dims.width); + tallest = Math.max(tallest, dims.height); } widthOfWidestButton = widest; @@ -312,10 +312,10 @@ public class BasicOptionPaneUI extends OptionPaneUI int width; if (getSyncAllWidths()) - width = widest * buttonList.length - + getPadding() * (buttonList.length - 1); + width = widest * buttonList.length + + getPadding() * (buttonList.length - 1); else - width = buttonLength; + width = buttonLength; Insets insets = c.getInsets(); width += insets.left + insets.right; @@ -438,10 +438,10 @@ public class BasicOptionPaneUI extends OptionPaneUI /** Whether the JOptionPane contains custom components. */ protected boolean hasCustomComponents; - // The initialFocusComponent seems to always be set to a button (even if - // I try to set initialSelectionValue). This is different from what the - // javadocs state (which should switch this reference to the input component - // if one is present since that is what's going to get focus). + // The initialFocusComponent seems to always be set to a button (even if + // I try to set initialSelectionValue). This is different from what the + // javadocs state (which should switch this reference to the input component + // if one is present since that is what's going to get focus). /** * The button that will receive focus based on initialValue when no input @@ -531,20 +531,20 @@ public class BasicOptionPaneUI extends OptionPaneUI { public void paintIcon(Component c, Graphics g, int x, int y) { - Polygon oct = new Polygon(new int[] { 0, 0, 9, 27, 36, 36, 27, 9 }, - new int[] { 9, 27, 36, 36, 27, 9, 0, 0 }, 8); - g.translate(x, y); + Polygon oct = new Polygon(new int[] { 0, 0, 9, 27, 36, 36, 27, 9 }, + new int[] { 9, 27, 36, 36, 27, 9, 0, 0 }, 8); + g.translate(x, y); - Color saved = g.getColor(); - g.setColor(Color.RED); + Color saved = g.getColor(); + g.setColor(Color.RED); - g.fillPolygon(oct); + g.fillPolygon(oct); - g.setColor(Color.BLACK); - g.drawRect(13, 16, 10, 4); + g.setColor(Color.BLACK); + g.drawRect(13, 16, 10, 4); - g.setColor(saved); - g.translate(-x, -y); + g.setColor(saved); + g.translate(-x, -y); } }; @@ -553,24 +553,24 @@ public class BasicOptionPaneUI extends OptionPaneUI { public void paintIcon(Component c, Graphics g, int x, int y) { - g.translate(x, y); - Color saved = g.getColor(); + g.translate(x, y); + Color saved = g.getColor(); - // Should be purple. - g.setColor(Color.RED); + // Should be purple. + g.setColor(Color.RED); - g.fillOval(0, 0, ICON_SIZE, ICON_SIZE); + g.fillOval(0, 0, ICON_SIZE, ICON_SIZE); - g.setColor(Color.BLACK); - g.drawOval(16, 6, 4, 4); + g.setColor(Color.BLACK); + g.drawOval(16, 6, 4, 4); - Polygon bottomI = new Polygon(new int[] { 15, 15, 13, 13, 23, 23, 21, 21 }, - new int[] { 12, 28, 28, 30, 30, 28, 28, 12 }, - 8); - g.drawPolygon(bottomI); + Polygon bottomI = new Polygon(new int[] { 15, 15, 13, 13, 23, 23, 21, 21 }, + new int[] { 12, 28, 28, 30, 30, 28, 28, 12 }, + 8); + g.drawPolygon(bottomI); - g.setColor(saved); - g.translate(-x, -y); + g.setColor(saved); + g.translate(-x, -y); } }; @@ -579,23 +579,23 @@ public class BasicOptionPaneUI extends OptionPaneUI { public void paintIcon(Component c, Graphics g, int x, int y) { - g.translate(x, y); - Color saved = g.getColor(); - g.setColor(Color.YELLOW); + g.translate(x, y); + Color saved = g.getColor(); + g.setColor(Color.YELLOW); - Polygon triangle = new Polygon(new int[] { 0, 18, 36 }, - new int[] { 36, 0, 36 }, 3); - g.fillPolygon(triangle); + Polygon triangle = new Polygon(new int[] { 0, 18, 36 }, + new int[] { 36, 0, 36 }, 3); + g.fillPolygon(triangle); - g.setColor(Color.BLACK); + g.setColor(Color.BLACK); - Polygon excl = new Polygon(new int[] { 15, 16, 20, 21 }, - new int[] { 8, 26, 26, 8 }, 4); - g.drawPolygon(excl); - g.drawOval(16, 30, 4, 4); + Polygon excl = new Polygon(new int[] { 15, 16, 20, 21 }, + new int[] { 8, 26, 26, 8 }, 4); + g.drawPolygon(excl); + g.drawOval(16, 30, 4, 4); - g.setColor(saved); - g.translate(-x, -y); + g.setColor(saved); + g.translate(-x, -y); } }; @@ -604,32 +604,32 @@ public class BasicOptionPaneUI extends OptionPaneUI { public void paintIcon(Component c, Graphics g, int x, int y) { - g.translate(x, y); - Color saved = g.getColor(); - g.setColor(Color.GREEN); + g.translate(x, y); + Color saved = g.getColor(); + g.setColor(Color.GREEN); - g.fillRect(0, 0, ICON_SIZE, ICON_SIZE); + g.fillRect(0, 0, ICON_SIZE, ICON_SIZE); - g.setColor(Color.BLACK); + g.setColor(Color.BLACK); - g.drawOval(11, 2, 16, 16); - g.drawOval(14, 5, 10, 10); + g.drawOval(11, 2, 16, 16); + g.drawOval(14, 5, 10, 10); - g.setColor(Color.GREEN); - g.fillRect(0, 10, ICON_SIZE, ICON_SIZE - 10); + g.setColor(Color.GREEN); + g.fillRect(0, 10, ICON_SIZE, ICON_SIZE - 10); - g.setColor(Color.BLACK); + g.setColor(Color.BLACK); - g.drawLine(11, 10, 14, 10); + g.drawLine(11, 10, 14, 10); - g.drawLine(24, 10, 17, 22); - g.drawLine(27, 10, 20, 22); - g.drawLine(17, 22, 20, 22); + g.drawLine(24, 10, 17, 22); + g.drawLine(27, 10, 20, 22); + g.drawLine(17, 22, 20, 22); - g.drawOval(17, 25, 3, 3); + g.drawOval(17, 25, 3, 3); - g.setColor(saved); - g.translate(-x, -y); + g.setColor(saved); + g.translate(-x, -y); } }; @@ -659,25 +659,25 @@ public class BasicOptionPaneUI extends OptionPaneUI return; for (int i = 0; i < buttons.length; i++) { - if (buttons[i] != null) - { - Component toAdd; - if (buttons[i] instanceof Component) - toAdd = (Component) buttons[i]; - else - { - if (buttons[i] instanceof Icon) - toAdd = new JButton((Icon) buttons[i]); - else - toAdd = new JButton(buttons[i].toString()); - hasCustomComponents = true; - } - if (toAdd instanceof JButton) - ((JButton) toAdd).addActionListener(createButtonActionListener(i)); - if (i == initialIndex) - initialFocusComponent = toAdd; - container.add(toAdd); - } + if (buttons[i] != null) + { + Component toAdd; + if (buttons[i] instanceof Component) + toAdd = (Component) buttons[i]; + else + { + if (buttons[i] instanceof Icon) + toAdd = new JButton((Icon) buttons[i]); + else + toAdd = new JButton(buttons[i].toString()); + hasCustomComponents = true; + } + if (toAdd instanceof JButton) + ((JButton) toAdd).addActionListener(createButtonActionListener(i)); + if (i == initialIndex) + initialFocusComponent = toAdd; + container.add(toAdd); + } } selectInitialValue(optionPane); } @@ -693,9 +693,9 @@ public class BasicOptionPaneUI extends OptionPaneUI Icon icon = getIcon(); if (icon != null) { - iconLabel = new JLabel(icon); + iconLabel = new JLabel(icon); configureLabel(iconLabel); - top.add(iconLabel, BorderLayout.WEST); + top.add(iconLabel, BorderLayout.WEST); } } @@ -743,38 +743,38 @@ public class BasicOptionPaneUI extends OptionPaneUI hasCustomComponents = internallyCreated; if (msg instanceof Object[]) { - Object[] arr = (Object[]) msg; - for (int i = 0; i < arr.length; i++) - addMessageComponents(container, cons, arr[i], maxll, - internallyCreated); - return; + Object[] arr = (Object[]) msg; + for (int i = 0; i < arr.length; i++) + addMessageComponents(container, cons, arr[i], maxll, + internallyCreated); + return; } else if (msg instanceof Component) { - container.add((Component) msg, cons); - cons.gridy++; + container.add((Component) msg, cons); + cons.gridy++; } else if (msg instanceof Icon) { JLabel label = new JLabel((Icon) msg); configureLabel(label); - container.add(label, cons); - cons.gridy++; + container.add(label, cons); + cons.gridy++; } else { - // Undocumented behaviour. - // if msg.toString().length greater than maxll - // it will create a box and burst the string. - // otherwise, it will just create a label and re-call - // this method with the label o.O - if (msg.toString().length() > maxll || msg.toString().contains("\n")) - { - Box tmp = new Box(BoxLayout.Y_AXIS); - burstStringInto(tmp, msg.toString(), maxll); - addMessageComponents(container, cons, tmp, maxll, true); - } - else + // Undocumented behaviour. + // if msg.toString().length greater than maxll + // it will create a box and burst the string. + // otherwise, it will just create a label and re-call + // this method with the label o.O + if (msg.toString().length() > maxll || msg.toString().contains("\n")) + { + Box tmp = new Box(BoxLayout.Y_AXIS); + burstStringInto(tmp, msg.toString(), maxll); + addMessageComponents(container, cons, tmp, maxll, true); + } + else { JLabel label = new JLabel(msg.toString()); configureLabel(label); @@ -817,7 +817,7 @@ public class BasicOptionPaneUI extends OptionPaneUI if (remainder.length() == 0) return; - // Recursively call ourselves to burst the remainder of the string, + // Recursively call ourselves to burst the remainder of the string, if (remainder.length() > maxll || remainder.contains("\n")) burstStringInto(c, remainder, maxll); else @@ -901,27 +901,27 @@ public class BasicOptionPaneUI extends OptionPaneUI rightSide.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); rightSide.setLayout(new GridBagLayout()); GridBagConstraints con = createConstraints(); - + addMessageComponents(rightSide, con, getMessage(), getMaxCharactersPerLineCount(), false); if (optionPane.getWantsInput()) { - Object[] selection = optionPane.getSelectionValues(); + Object[] selection = optionPane.getSelectionValues(); - if (selection == null) + if (selection == null) inputComponent = new JTextField(15); - else if (selection.length < 20) + else if (selection.length < 20) inputComponent = new JComboBox(selection); - else - inputComponent = new JList(selection); - if (inputComponent != null) - { - addMessageComponents(rightSide, con, inputComponent, + else + inputComponent = new JList(selection); + if (inputComponent != null) + { + addMessageComponents(rightSide, con, inputComponent, getMaxCharactersPerLineCount(), false); - resetSelectedValue(); - selectInitialValue(optionPane); - } + resetSelectedValue(); + selectInitialValue(optionPane); + } } messageArea.add(rightSide, BorderLayout.CENTER); @@ -979,11 +979,11 @@ public class BasicOptionPaneUI extends OptionPaneUI switch (optionPane.getOptionType()) { case JOptionPane.YES_NO_OPTION: - return new Object[] { YES_STRING, NO_STRING }; + return new Object[] { YES_STRING, NO_STRING }; case JOptionPane.YES_NO_CANCEL_OPTION: - return new Object[] { YES_STRING, NO_STRING, CANCEL_STRING }; + return new Object[] { YES_STRING, NO_STRING, CANCEL_STRING }; case JOptionPane.OK_CANCEL_OPTION: - return new Object[] { OK_STRING, CANCEL_STRING }; + return new Object[] { OK_STRING, CANCEL_STRING }; case JOptionPane.DEFAULT_OPTION: return (optionPane.getWantsInput()) ? new Object[] { OK_STRING, CANCEL_STRING } : @@ -1022,17 +1022,17 @@ public class BasicOptionPaneUI extends OptionPaneUI switch (messageType) { case JOptionPane.ERROR_MESSAGE: - tmp = errorIcon; - break; + tmp = errorIcon; + break; case JOptionPane.INFORMATION_MESSAGE: - tmp = infoIcon; - break; + tmp = infoIcon; + break; case JOptionPane.WARNING_MESSAGE: - tmp = warningIcon; - break; + tmp = warningIcon; + break; case JOptionPane.QUESTION_MESSAGE: - tmp = questionIcon; - break; + tmp = questionIcon; + break; } return tmp; // FIXME: Don't cast till the default icons are in. @@ -1055,8 +1055,8 @@ public class BasicOptionPaneUI extends OptionPaneUI for (int i = 0; i < buttons.length; i++) { - if (select == buttons[i]) - return i; + if (select == buttons[i]) + return i; } return 0; } @@ -1251,12 +1251,12 @@ public class BasicOptionPaneUI extends OptionPaneUI { if (c instanceof JOptionPane) { - optionPane = (JOptionPane) c; + optionPane = (JOptionPane) c; - installDefaults(); - installComponents(); - installListeners(); - installKeyboardActions(); + installDefaults(); + installComponents(); + installListeners(); + installKeyboardActions(); } } @@ -1268,16 +1268,16 @@ public class BasicOptionPaneUI extends OptionPaneUI { if (optionPane.getWantsInput() && inputComponent != null) { - Object output = null; - if (inputComponent instanceof JTextField) - output = ((JTextField) inputComponent).getText(); - else if (inputComponent instanceof JComboBox) - output = ((JComboBox) inputComponent).getSelectedItem(); - else if (inputComponent instanceof JList) - output = ((JList) inputComponent).getSelectedValue(); - - if (output != null) - optionPane.setInputValue(output); + Object output = null; + if (inputComponent instanceof JTextField) + output = ((JTextField) inputComponent).getText(); + else if (inputComponent instanceof JComboBox) + output = ((JComboBox) inputComponent).getSelectedItem(); + else if (inputComponent instanceof JList) + output = ((JList) inputComponent).getSelectedValue(); + + if (output != null) + optionPane.setInputValue(output); } } @@ -1291,8 +1291,8 @@ public class BasicOptionPaneUI extends OptionPaneUI { if (inputComponent != null) { - inputComponent.requestFocus(); - return; + inputComponent.requestFocus(); + return; } if (initialFocusComponent != null) initialFocusComponent.requestFocus(); @@ -1307,17 +1307,17 @@ public class BasicOptionPaneUI extends OptionPaneUI { if (inputComponent != null) { - Object init = optionPane.getInitialSelectionValue(); - if (init == null) - return; - if (inputComponent instanceof JTextField) - ((JTextField) inputComponent).setText((String) init); - else if (inputComponent instanceof JComboBox) - ((JComboBox) inputComponent).setSelectedItem(init); - else if (inputComponent instanceof JList) - { - // ((JList) inputComponent).setSelectedValue(init, true); - } + Object init = optionPane.getInitialSelectionValue(); + if (init == null) + return; + if (inputComponent instanceof JTextField) + ((JTextField) inputComponent).setText((String) init); + else if (inputComponent instanceof JComboBox) + ((JComboBox) inputComponent).setSelectedItem(init); + else if (inputComponent instanceof JList) + { + // ((JList) inputComponent).setSelectedValue(init, true); + } } } diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicPanelUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicPanelUI.java index 458f102..959462a 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicPanelUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicPanelUI.java @@ -54,13 +54,13 @@ public class BasicPanelUI extends PanelUI * stateless). */ static BasicPanelUI sharedUI; - + /** * Returns a UI delegate for the specified component. - * + * * @param panel the panel. */ - public static ComponentUI createUI(JComponent panel) + public static ComponentUI createUI(JComponent panel) { if (sharedUI == null) sharedUI = new BasicPanelUI(); @@ -69,7 +69,7 @@ public class BasicPanelUI extends PanelUI /** * Installs this UI delegate in the specified component. - * + * * @param c the component (should be a {@link JPanel}, <code>null</code> not * permitted). */ @@ -85,19 +85,19 @@ public class BasicPanelUI extends PanelUI /** * Installs the defaults for this UI delegate in the specified panel. - * + * * @param p the panel (<code>null</code> not permitted). */ protected void installDefaults(JPanel p) { LookAndFeel.installColorsAndFont(p, "Panel.background", "Panel.foreground", "Panel.font"); - + // A test against the reference implementation shows that this method will // install a border if one is defined in the UIDefaults table (even though // the BasicLookAndFeel doesn't actually define a "Panel.border"). This - // test was written after discovering that a null argument to - // uninstallDefaults throws a NullPointerException in + // test was written after discovering that a null argument to + // uninstallDefaults throws a NullPointerException in // LookAndFeel.uninstallBorder()... LookAndFeel.installBorder(p, "Panel.border"); } @@ -123,10 +123,10 @@ public class BasicPanelUI extends PanelUI // (1) doesn't actually remove the installed colors and font installed // by installDefaults(), it isn't necessary; // (2) throws a NullPointerException in LookAndFeel.uninstallBorder() if - // p is null. Strangely, no border is installed by the + // p is null. Strangely, no border is installed by the // BasicLookAndFeel - perhaps this is needed by another LAF? - + LookAndFeel.uninstallBorder(p); } - + } diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicPasswordFieldUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicPasswordFieldUI.java index 76dcfc4..cc83917 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicPasswordFieldUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicPasswordFieldUI.java @@ -56,7 +56,7 @@ public class BasicPasswordFieldUI extends BasicTextFieldUI { return new PasswordView(elem); } - + public static ComponentUI createUI(JComponent c) { return new BasicPasswordFieldUI(); diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicPopupMenuUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicPopupMenuUI.java index 8c0fe67..6cd433b 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicPopupMenuUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicPopupMenuUI.java @@ -255,7 +255,7 @@ public class BasicPopupMenuUI extends PopupMenuUI /** * Finds the next child element that is enabled and visible. - * + * * @param children the children to search through * @param start the start index * @param end the end index @@ -282,7 +282,7 @@ public class BasicPopupMenuUI extends PopupMenuUI /** * Finds the previous child element that is enabled and visible. - * + * * @param children the children to search through * @param start the start index * @param end the end index @@ -349,7 +349,7 @@ public class BasicPopupMenuUI extends PopupMenuUI else { int popupIndex = len-1; - if (len > 2 + if (len > 2 && (path[popupIndex] instanceof JPopupMenu || path[--popupIndex] instanceof JPopupMenu) && ! ((JMenu) path[popupIndex - 1]).isTopLevelMenu()) @@ -773,7 +773,7 @@ public class BasicPopupMenuUI extends PopupMenuUI am.put(action.getValue(Action.NAME), action); action = new NavigateAction("cancel"); am.put(action.getValue(Action.NAME), action); - + return am; } @@ -916,7 +916,7 @@ public class BasicPopupMenuUI extends PopupMenuUI */ public void popupMenuWillBecomeInvisible(PopupMenuEvent event) { - // remove listener that listens to component events fired + // remove listener that listens to component events fired // by the top - level window that this popup belongs to. Component invoker = popupMenu.getInvoker(); Component rootContainer = SwingUtilities.getRoot(invoker); @@ -931,30 +931,30 @@ public class BasicPopupMenuUI extends PopupMenuUI */ public void popupMenuWillBecomeVisible(PopupMenuEvent event) { - // Adds topWindowListener to top-level window to listener to + // Adds topWindowListener to top-level window to listener to // ComponentEvents fired by it. We need to cancel this popup menu // if topWindow to which this popup belongs was resized or moved. - Component invoker = popupMenu.getInvoker(); + Component invoker = popupMenu.getInvoker(); Component rootContainer = SwingUtilities.getRoot(invoker); if (rootContainer != null) rootContainer.addComponentListener(topWindowListener); // if this popup menu is a free floating popup menu, // then by default its first element should be always selected when - // this popup menu becomes visible. + // this popup menu becomes visible. MenuSelectionManager manager = MenuSelectionManager.defaultManager(); if (manager.getSelectedPath().length == 0) { - // Set selected path to point to the first item in the popup menu - MenuElement[] path = new MenuElement[2]; - path[0] = popupMenu; - Component[] comps = popupMenu.getComponents(); - if (comps.length != 0 && comps[0] instanceof MenuElement) - { - path[1] = (MenuElement) comps[0]; - manager.setSelectedPath(path); - } + // Set selected path to point to the first item in the popup menu + MenuElement[] path = new MenuElement[2]; + path[0] = popupMenu; + Component[] comps = popupMenu.getComponents(); + if (comps.length != 0 && comps[0] instanceof MenuElement) + { + path[1] = (MenuElement) comps[0]; + manager.setSelectedPath(path); + } } } } diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicProgressBarUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicProgressBarUI.java index 12bbe01..bff6385 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicProgressBarUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicProgressBarUI.java @@ -71,13 +71,13 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ProgressBarUI; /** - * The Basic Look and Feel UI delegate for the + * The Basic Look and Feel UI delegate for the * JProgressBar. */ public class BasicProgressBarUI extends ProgressBarUI { /** - * A helper class that listens for ChangeEvents + * A helper class that listens for ChangeEvents * from the progressBar's model. * * @specnote Apparently this class was intended to be protected, @@ -99,13 +99,13 @@ public class BasicProgressBarUI extends ProgressBarUI } /** - * This helper class is used to listen for + * This helper class is used to listen for * PropertyChangeEvents from the progressBar. */ private class PropertyChangeHandler implements PropertyChangeListener { /** - * Called every time the properties of the + * Called every time the properties of the * progressBar change. * * @param e The PropertyChangeEvent given by the progressBar. @@ -163,11 +163,11 @@ public class BasicProgressBarUI extends ProgressBarUI { // Nothing to do here. } - + } /** - * This helper class is used to listen for + * This helper class is used to listen for * the animationTimer's intervals. On every interval, * the bouncing box should move. */ @@ -215,7 +215,7 @@ public class BasicProgressBarUI extends ProgressBarUI * Holds the value of the bouncing box that is returned by {@link #getBox}. * * @since 1.5 - */ + */ protected Rectangle boxRect; /** The timer used to move the bouncing box. */ @@ -230,7 +230,7 @@ public class BasicProgressBarUI extends ProgressBarUI // | frame0 | frame1 | frame2 | frame 3 | frame 4 | // | | frame7 | frame6 | frame 5 | | // +-----------------------------------------------+ - + /** The current animation index. */ private transient int animationIndex; @@ -260,7 +260,7 @@ public class BasicProgressBarUI extends ProgressBarUI /** * The size of the box returned by {@link #getBox} against the orientation * direction of the progress bar. This is package private to avoid accessor - * method. + * method. */ transient int boxIndependent = - 1; @@ -346,7 +346,7 @@ public class BasicProgressBarUI extends ProgressBarUI /** * This method returns the size and position of the bouncing box - * for the current animation index. It stores the values in the + * for the current animation index. It stores the values in the * given rectangle and returns it. It returns null if no box should * be drawn. * @@ -487,7 +487,7 @@ public class BasicProgressBarUI extends ProgressBarUI * rectangle (the bounds without the insets) if the * progressBar is horizontal. * - * @return The preferred size of the progressBar minus + * @return The preferred size of the progressBar minus * insets if it's horizontal. */ protected Dimension getPreferredInnerHorizontal() @@ -512,7 +512,7 @@ public class BasicProgressBarUI extends ProgressBarUI /** * This method returns the preferred size of the inner - * rectangle (the bounds without insets) if the + * rectangle (the bounds without insets) if the * progressBar is vertical. * * @return The preferred size of the progressBar minus @@ -539,7 +539,7 @@ public class BasicProgressBarUI extends ProgressBarUI } /** - * This method returns the preferred size of the + * This method returns the preferred size of the * given JComponent. If it returns null, then it * is up to the LayoutManager to give it a size. * @@ -585,7 +585,7 @@ public class BasicProgressBarUI extends ProgressBarUI /** * This method returns the point (the top left of the bounding box) - * where the text should be painted. + * where the text should be painted. * * @param g The Graphics object to measure FontMetrics with. * @param progressString The string to paint. @@ -602,7 +602,7 @@ public class BasicProgressBarUI extends ProgressBarUI Rectangle tr = new Rectangle(); Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); - + if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) vr.setBounds(x, y, width, height); else @@ -616,7 +616,7 @@ public class BasicProgressBarUI extends ProgressBarUI SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, vr, ir, tr, 0); - + if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) return new Point(tr.x, tr.y); else @@ -651,7 +651,7 @@ public class BasicProgressBarUI extends ProgressBarUI } /** - * This method is called if the painting to be done is + * This method is called if the painting to be done is * for a determinate progressBar. * * @param g The Graphics object to paint with. @@ -672,17 +672,17 @@ public class BasicProgressBarUI extends ProgressBarUI int amountFull = getAmountFull(insets, or.width, or.height); - if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) - { - g.setColor(c.getForeground()); - g.fillRect(vr.x, vr.y, amountFull, vr.height); - } - else - { - g.setColor(c.getForeground()); - g.fillRect(vr.x, vr.y + vr.height - amountFull, vr.width, + if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) + { + g.setColor(c.getForeground()); + g.fillRect(vr.x, vr.y, amountFull, vr.height); + } + else + { + g.setColor(c.getForeground()); + g.fillRect(vr.x, vr.y + vr.height - amountFull, vr.width, amountFull); - } + } if (progressBar.isStringPainted() && !progressBar.getString().equals("")) paintString(g, 0, 0, or.width, or.height, amountFull, insets); @@ -739,13 +739,13 @@ public class BasicProgressBarUI extends ProgressBarUI String str = progressBar.getString(); int full = getAmountFull(b, width, height); Point placement = getStringPlacement(g, progressBar.getString(), - x + b.left, y + b.top, + x + b.left, y + b.top, width - b.left - b.right, height - b.top - b.bottom); Color savedColor = g.getColor(); Shape savedClip = g.getClip(); FontMetrics fm = g.getFontMetrics(progressBar.getFont()); - + if (progressBar.getOrientation() == JProgressBar.VERTICAL) { AffineTransform rotate = AffineTransform.getRotateInstance(Math.PI / 2); @@ -756,7 +756,7 @@ public class BasicProgressBarUI extends ProgressBarUI { placement.y += fm.getAscent(); } - + g.setColor(getSelectionForeground()); g.setClip(0, 0, full + b.left, height); g.drawString(str, placement.x, placement.y); @@ -770,7 +770,7 @@ public class BasicProgressBarUI extends ProgressBarUI /** * This method sets the current animation index. If the index is greater than * the number of frames, it resets to 0. - * + * * @param newValue The new animation index. */ protected void setAnimationIndex(int newValue) @@ -849,10 +849,10 @@ public class BasicProgressBarUI extends ProgressBarUI if (cycleTime % repaintInterval != 0 && (cycleTime / repaintInterval) % 2 != 0) { - int div = (cycleTime / repaintInterval) + 2; - div /= 2; - div *= 2; - cycleTime = div * repaintInterval; + int div = (cycleTime / repaintInterval) + 2; + div /= 2; + div *= 2; + cycleTime = div * repaintInterval; } setAnimationIndex(0); numFrames = cycleTime / repaintInterval; @@ -874,7 +874,7 @@ public class BasicProgressBarUI extends ProgressBarUI } /** - * This method registers listeners to all the + * This method registers listeners to all the * components that this UI delegate needs to listen to. */ protected void installListeners() @@ -895,7 +895,7 @@ public class BasicProgressBarUI extends ProgressBarUI } /** - * This method unregisters listeners to all the + * This method unregisters listeners to all the * components that were listened to. */ protected void uninstallListeners() @@ -930,13 +930,13 @@ public class BasicProgressBarUI extends ProgressBarUI super.installUI(c); if (c instanceof JProgressBar) { - progressBar = (JProgressBar) c; + progressBar = (JProgressBar) c; - animationTimer = new Timer(200, null); - animationTimer.setRepeats(true); + animationTimer = new Timer(200, null); + animationTimer.setRepeats(true); - installDefaults(); - installListeners(); + installDefaults(); + installListeners(); } if (progressBar.isIndeterminate()) startAnimationTimer(); diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java index 3cea0d9..ff374d1 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java @@ -72,7 +72,7 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI * * @return a new instance of <code>BasicRadioButtonUI</code> */ - public static ComponentUI createUI(final JComponent c) + public static ComponentUI createUI(final JComponent c) { return new BasicRadioButtonUI(); } @@ -158,7 +158,7 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI Icon currentIcon = getCurrentIcon(b); // Do the layout. - String text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f), + String text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f), b.getText(), currentIcon == null ? getDefaultIcon() : currentIcon, b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), @@ -184,13 +184,13 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI paintFocus(g, textR, size); } } - - /** - * Determines the icon to be displayed for the specified radio button. - * - * @param b the radio button - * - * @return the icon + + /** + * Determines the icon to be displayed for the specified radio button. + * + * @param b the radio button + * + * @return the icon */ private Icon getCurrentIcon(AbstractButton b) { @@ -246,14 +246,14 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI // one will be used for layout calculations and painting instead. // The other icon properties are ignored. AbstractButton b = (AbstractButton) c; - + Insets insets = b.getInsets(); String text = b.getText(); Icon i = b.getIcon(); if (i == null) - i = getDefaultIcon(); - + i = getDefaultIcon(); + textR.x = 0; textR.y = 0; textR.width = 0; @@ -269,7 +269,7 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI SwingUtilities.layoutCompoundLabel(b, // for the component orientation b.getFontMetrics(b.getFont()), - text, i, b.getVerticalAlignment(), + text, i, b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicRootPaneUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicRootPaneUI.java index e20bc2b..26c7a53 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicRootPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicRootPaneUI.java @@ -130,7 +130,7 @@ public class BasicRootPaneUI extends RootPaneUI } } - public static ComponentUI createUI(JComponent x) + public static ComponentUI createUI(JComponent x) { return new BasicRootPaneUI(); } diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java index 400ede0..9f24f8a 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java @@ -85,7 +85,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, */ protected class ArrowButtonListener extends MouseAdapter { - + /** * Move the thumb in the direction specified by the button's arrow. If * this button is held down, then it should keep moving the thumb. @@ -285,13 +285,13 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, currentMouseY = e.getY(); if (scrollbar.getValueIsAdjusting()) { - int value; - if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL) - value = valueForXPosition(currentMouseX) - offset; - else - value = valueForYPosition(currentMouseY) - offset; + int value; + if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL) + value = valueForXPosition(currentMouseX) - offset; + else + value = valueForYPosition(currentMouseY) - offset; - scrollbar.setValue(value); + scrollbar.setValue(value); } } @@ -321,38 +321,38 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, int value; if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL) - value = valueForXPosition(currentMouseX); + value = valueForXPosition(currentMouseX); else - value = valueForYPosition(currentMouseY); + value = valueForYPosition(currentMouseY); if (! thumbRect.contains(e.getPoint())) { - scrollTimer.stop(); - scrollListener.setScrollByBlock(true); - if (value > scrollbar.getValue()) - { - trackHighlight = INCREASE_HIGHLIGHT; - scrollListener.setDirection(POSITIVE_SCROLL); - } - else - { - trackHighlight = DECREASE_HIGHLIGHT; - scrollListener.setDirection(NEGATIVE_SCROLL); - } + scrollTimer.stop(); + scrollListener.setScrollByBlock(true); + if (value > scrollbar.getValue()) + { + trackHighlight = INCREASE_HIGHLIGHT; + scrollListener.setDirection(POSITIVE_SCROLL); + } + else + { + trackHighlight = DECREASE_HIGHLIGHT; + scrollListener.setDirection(NEGATIVE_SCROLL); + } scrollTimer.setDelay(100); - scrollTimer.start(); + scrollTimer.start(); } else { - // We'd like to keep track of where the cursor - // is inside the thumb. - // This works because the scrollbar's value represents - // "lower" edge of the thumb. The value at which - // the cursor is at must be greater or equal - // to that value. + // We'd like to keep track of where the cursor + // is inside the thumb. + // This works because the scrollbar's value represents + // "lower" edge of the thumb. The value at which + // the cursor is at must be greater or equal + // to that value. scrollListener.setScrollByBlock(false); - scrollbar.setValueIsAdjusting(true); + scrollbar.setValueIsAdjusting(true); offset = value - scrollbar.getValue(); } scrollbar.repaint(); @@ -394,17 +394,17 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, { int value; if (scrollbar.getOrientation() == HORIZONTAL) - value = valueForXPosition(currentMouseX); + value = valueForXPosition(currentMouseX); else - value = valueForYPosition(currentMouseY); + value = valueForYPosition(currentMouseY); if (thumbRect.contains(currentMouseX, currentMouseY)) return false; - + if (direction == POSITIVE_SCROLL) - return value > scrollbar.getValue(); + return value > scrollbar.getValue(); else - return value < scrollbar.getValue(); + return value < scrollbar.getValue(); } } @@ -488,7 +488,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, /** The scrollbar this UI is acting for. */ protected JScrollBar scrollbar; - + /** True if the mouse is over the thumb. */ boolean thumbRollover; @@ -767,7 +767,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, } /** - * Installs the input map from the look and feel defaults, and a + * Installs the input map from the look and feel defaults, and a * corresponding action map. Note the the keyboard bindings will only * work when the {@link JScrollBar} component has the focus, which is rare. */ @@ -775,7 +775,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, { InputMap keyMap = getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - SwingUtilities.replaceUIInputMap(scrollbar, + SwingUtilities.replaceUIInputMap(scrollbar, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(scrollbar, map); @@ -788,25 +788,25 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, protected void uninstallKeyboardActions() { SwingUtilities.replaceUIActionMap(scrollbar, null); - SwingUtilities.replaceUIInputMap(scrollbar, + SwingUtilities.replaceUIInputMap(scrollbar, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); } - InputMap getInputMap(int condition) + InputMap getInputMap(int condition) { if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) return (InputMap) UIManager.get("ScrollBar.focusInputMap"); return null; } - + /** - * Returns the action map for the {@link JScrollBar}. All scroll bars - * share a single action map which is created the first time this method is + * Returns the action map for the {@link JScrollBar}. All scroll bars + * share a single action map which is created the first time this method is * called, then stored in the UIDefaults table for subsequent access. - * + * * @return The shared action map. */ - ActionMap getActionMap() + ActionMap getActionMap() { ActionMap map = (ActionMap) UIManager.get("ScrollBar.actionMap"); @@ -821,23 +821,23 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, /** * Creates the action map shared by all {@link JSlider} instances. - * This method is called once by {@link #getActionMap()} when it - * finds no action map in the UIDefaults table...after the map is - * created, it gets added to the defaults table so that subsequent - * calls to {@link #getActionMap()} will return the same shared + * This method is called once by {@link #getActionMap()} when it + * finds no action map in the UIDefaults table...after the map is + * created, it gets added to the defaults table so that subsequent + * calls to {@link #getActionMap()} will return the same shared * instance. - * + * * @return The action map. */ ActionMap createActionMap() { ActionMap map = new ActionMapUIResource(); - map.put("positiveUnitIncrement", + map.put("positiveUnitIncrement", new AbstractAction("positiveUnitIncrement") { public void actionPerformed(ActionEvent event) { JScrollBar sb = (JScrollBar) event.getSource(); - if (sb.isVisible()) + if (sb.isVisible()) { int delta = sb.getUnitIncrement(1); sb.setValue(sb.getValue() + delta); @@ -845,12 +845,12 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, } } ); - map.put("positiveBlockIncrement", + map.put("positiveBlockIncrement", new AbstractAction("positiveBlockIncrement") { public void actionPerformed(ActionEvent event) { JScrollBar sb = (JScrollBar) event.getSource(); - if (sb.isVisible()) + if (sb.isVisible()) { int delta = sb.getBlockIncrement(1); sb.setValue(sb.getValue() + delta); @@ -858,12 +858,12 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, } } ); - map.put("negativeUnitIncrement", + map.put("negativeUnitIncrement", new AbstractAction("negativeUnitIncrement") { public void actionPerformed(ActionEvent event) { JScrollBar sb = (JScrollBar) event.getSource(); - if (sb.isVisible()) + if (sb.isVisible()) { int delta = sb.getUnitIncrement(-1); sb.setValue(sb.getValue() + delta); @@ -871,12 +871,12 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, } } ); - map.put("negativeBlockIncrement", + map.put("negativeBlockIncrement", new AbstractAction("negativeBlockIncrement") { public void actionPerformed(ActionEvent event) { JScrollBar sb = (JScrollBar) event.getSource(); - if (sb.isVisible()) + if (sb.isVisible()) { int delta = sb.getBlockIncrement(-1); sb.setValue(sb.getValue() + delta); @@ -884,24 +884,24 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, } } ); - map.put("minScroll", + map.put("minScroll", new AbstractAction("minScroll") { public void actionPerformed(ActionEvent event) { JScrollBar sb = (JScrollBar) event.getSource(); - if (sb.isVisible()) + if (sb.isVisible()) { sb.setValue(sb.getMinimum()); } } } ); - map.put("maxScroll", + map.put("maxScroll", new AbstractAction("maxScroll") { public void actionPerformed(ActionEvent event) { JScrollBar sb = (JScrollBar) event.getSource(); - if (sb.isVisible()) + if (sb.isVisible()) { sb.setValue(sb.getMaximum()); } @@ -910,7 +910,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, ); return map; } - + /** * This method installs any listeners for the scrollbar. This method also * installs listeners for things such as the JButtons and the timer. @@ -973,10 +973,10 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, { if (scrollbarContainer instanceof JScrollBar) { - if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL) - layoutHScrollbar((JScrollBar) scrollbarContainer); - else - layoutVScrollbar((JScrollBar) scrollbarContainer); + if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL) + layoutHScrollbar((JScrollBar) scrollbarContainer); + else + layoutVScrollbar((JScrollBar) scrollbarContainer); } } @@ -992,7 +992,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); - + // calculate and update the track bounds SwingUtilities.calculateInnerArea(scrollbar, trackRect); trackRect.width -= incrDims.getWidth(); @@ -1000,7 +1000,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, trackRect.x += decrDims.getWidth(); updateThumbRect(); - + decrButton.setBounds(vr.x, vr.y, decrDims.width, trackRect.height); incrButton.setBounds(trackRect.x + trackRect.width, vr.y, incrDims.width, trackRect.height); @@ -1018,13 +1018,13 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); - + // Update rectangles SwingUtilities.calculateInnerArea(scrollbar, trackRect); trackRect.height -= incrDims.getHeight(); trackRect.height -= decrDims.getHeight(); trackRect.y += decrDims.getHeight(); - + updateThumbRect(); decrButton.setBounds(vr.x, vr.y, trackRect.width, decrDims.height); @@ -1076,14 +1076,14 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, thumbRect.height = Math.max(extent * trackRect.height / (max - min), getMinimumThumbSize().height); int availableHeight = trackRect.height - thumbRect.height; - thumbRect.y = trackRect.y + thumbRect.y = trackRect.y + (value - min) * availableHeight / (max - min - extent); thumbRect.width = trackRect.width; } } } - + /** * This method returns the minimum size required for the layout. * @@ -1367,7 +1367,7 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, decrButton.removeMouseListener(buttonListener); if (incrButton != null) incrButton.removeMouseListener(buttonListener); - + propertyChangeListener = null; modelListener = null; buttonListener = null; @@ -1469,39 +1469,39 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, value = min; return value; } - + /** * Returns true if the mouse is over the thumb. - * + * * @return true if the mouse is over the thumb. - * + * * @since 1.5 */ public boolean isThumbRollover() { - return thumbRollover; + return thumbRollover; } - + /** * Set thumbRollover to active. This indicates * whether or not the mouse is over the thumb. - * + * * @param active - true if the mouse is over the thumb. - * + * * @since 1.5 */ protected void setThumbRollover(boolean active) { thumbRollover = active; } - + /** - * Indicates whether the user can position the thumb with + * Indicates whether the user can position the thumb with * a mouse click (i.e. middle button). - * + * * @return true if the user can position the thumb with a mouse * click. - * + * * @since 1.5 */ public boolean getSupportsAbsolutePositioning() diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java index a719428..7123948 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java @@ -127,7 +127,7 @@ public class BasicScrollPaneUI extends ScrollPaneUI viewPosition.y = vsb.getValue(); vp.setViewPosition(viewPosition); } - + } /** @@ -144,7 +144,7 @@ public class BasicScrollPaneUI extends ScrollPaneUI * changes. When the extents size has changed, this method calls * {@link BasicScrollPaneUI#syncScrollPaneWithViewport()} to adjust the * scrollbars extents as well. - * + * * @param event the change event */ public void stateChanged(ChangeEvent event) @@ -221,7 +221,7 @@ public class BasicScrollPaneUI extends ScrollPaneUI /** * Scroll with the mouse wheel. - * + * * @author Audrius Meskauskas (audriusa@Bioinformatics.org) */ public void mouseWheelMoved(MouseWheelEvent e) @@ -245,11 +245,11 @@ public class BasicScrollPaneUI extends ScrollPaneUI } } } - + /** * Adds/removes the mouse wheel listener when the component is added/removed * to/from the scroll pane view port. - * + * * @author Audrius Meskauskas (audriusa@bioinformatics.org) */ class ViewportContainerListener implements ContainerListener @@ -261,7 +261,7 @@ public class BasicScrollPaneUI extends ScrollPaneUI { e.getChild().addMouseWheelListener(mouseWheelListener); } - + /** * Remove the mouse wheel listener. */ @@ -270,18 +270,18 @@ public class BasicScrollPaneUI extends ScrollPaneUI e.getChild().removeMouseWheelListener(mouseWheelListener); } } - + /** * The number of pixels by that we should scroll the content that does * not implement Scrollable. */ static int SCROLL_NON_SCROLLABLES = 10; - + /** * The number of rows to scroll per mouse wheel click. From impression, * Sun seems using the value 3. */ - static int ROWS_PER_WHEEL_CLICK = 3; + static int ROWS_PER_WHEEL_CLICK = 3; /** The Scrollpane for which the UI is provided by this class. */ protected JScrollPane scrollpane; @@ -310,14 +310,14 @@ public class BasicScrollPaneUI extends ScrollPaneUI * The mousewheel listener for the scrollpane. */ MouseWheelListener mouseWheelListener; - + /** * The listener to add and remove the mouse wheel listener to/from * the component container. */ ContainerListener containerListener; - public static ComponentUI createUI(final JComponent c) + public static ComponentUI createUI(final JComponent c) { return new BasicScrollPaneUI(); } @@ -348,8 +348,8 @@ public class BasicScrollPaneUI extends ScrollPaneUI if (vpBorder != null && vpBorder instanceof UIResource) p.setViewportBorder(null); } - - public void installUI(final JComponent c) + + public void installUI(final JComponent c) { super.installUI(c); installDefaults((JScrollPane) c); @@ -371,31 +371,31 @@ public class BasicScrollPaneUI extends ScrollPaneUI if (hsbChangeListener == null) hsbChangeListener = createHSBChangeListener(); sp.getHorizontalScrollBar().getModel().addChangeListener(hsbChangeListener); - + if (vsbChangeListener == null) vsbChangeListener = createVSBChangeListener(); sp.getVerticalScrollBar().getModel().addChangeListener(vsbChangeListener); if (viewportChangeListener == null) viewportChangeListener = createViewportChangeListener(); - + if (mouseWheelListener == null) mouseWheelListener = createMouseWheelListener(); - + if (containerListener == null) containerListener = new ViewportContainerListener(); - + JViewport v = sp.getViewport(); v.addChangeListener(viewportChangeListener); v.addContainerListener(containerListener); - + // Add mouse wheel listeners to the componets that are probably already // in the view port. for (int i = 0; i < v.getComponentCount(); i++) v.getComponent(i).addMouseWheelListener(mouseWheelListener); } - InputMap getInputMap(int condition) + InputMap getInputMap(int condition) { if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) return (InputMap) UIManager.get("ScrollPane.ancestorInputMap"); @@ -403,13 +403,13 @@ public class BasicScrollPaneUI extends ScrollPaneUI } /** - * Returns the action map for the {@link JScrollPane}. All scroll panes - * share a single action map which is created the first time this method is + * Returns the action map for the {@link JScrollPane}. All scroll panes + * share a single action map which is created the first time this method is * called, then stored in the UIDefaults table for subsequent access. - * + * * @return The shared action map. */ - ActionMap getActionMap() + ActionMap getActionMap() { ActionMap map = (ActionMap) UIManager.get("ScrollPane.actionMap"); @@ -424,24 +424,24 @@ public class BasicScrollPaneUI extends ScrollPaneUI /** * Creates the action map shared by all {@link JSlider} instances. - * This method is called once by {@link #getActionMap()} when it - * finds no action map in the UIDefaults table...after the map is - * created, it gets added to the defaults table so that subsequent - * calls to {@link #getActionMap()} will return the same shared + * This method is called once by {@link #getActionMap()} when it + * finds no action map in the UIDefaults table...after the map is + * created, it gets added to the defaults table so that subsequent + * calls to {@link #getActionMap()} will return the same shared * instance. - * + * * @return The action map. */ ActionMap createActionMap() { ActionMap map = new ActionMapUIResource(); - map.put("scrollLeft", + map.put("scrollLeft", new AbstractAction("scrollLeft") { public void actionPerformed(ActionEvent event) { JScrollPane sp = (JScrollPane) event.getSource(); JScrollBar sb = sp.getHorizontalScrollBar(); - if (sb.isVisible()) + if (sb.isVisible()) { int delta = sb.getBlockIncrement(-1); sb.setValue(sb.getValue() + delta); @@ -449,31 +449,31 @@ public class BasicScrollPaneUI extends ScrollPaneUI } } ); - map.put("scrollEnd", + map.put("scrollEnd", new AbstractAction("scrollEnd") { public void actionPerformed(ActionEvent event) { JScrollPane sp = (JScrollPane) event.getSource(); JScrollBar sb1 = sp.getHorizontalScrollBar(); - if (sb1.isVisible()) + if (sb1.isVisible()) { sb1.setValue(sb1.getMaximum()); } JScrollBar sb2 = sp.getVerticalScrollBar(); - if (sb2.isVisible()) + if (sb2.isVisible()) { sb2.setValue(sb2.getMaximum()); } } } ); - map.put("unitScrollUp", + map.put("unitScrollUp", new AbstractAction("unitScrollUp") { public void actionPerformed(ActionEvent event) { JScrollPane sp = (JScrollPane) event.getSource(); JScrollBar sb = sp.getVerticalScrollBar(); - if (sb.isVisible()) + if (sb.isVisible()) { int delta = sb.getUnitIncrement(-1); sb.setValue(sb.getValue() + delta); @@ -481,13 +481,13 @@ public class BasicScrollPaneUI extends ScrollPaneUI } } ); - map.put("unitScrollLeft", + map.put("unitScrollLeft", new AbstractAction("unitScrollLeft") { public void actionPerformed(ActionEvent event) { JScrollPane sp = (JScrollPane) event.getSource(); JScrollBar sb = sp.getHorizontalScrollBar(); - if (sb.isVisible()) + if (sb.isVisible()) { int delta = sb.getUnitIncrement(-1); sb.setValue(sb.getValue() + delta); @@ -495,13 +495,13 @@ public class BasicScrollPaneUI extends ScrollPaneUI } } ); - map.put("scrollUp", + map.put("scrollUp", new AbstractAction("scrollUp") { public void actionPerformed(ActionEvent event) { JScrollPane sp = (JScrollPane) event.getSource(); JScrollBar sb = sp.getVerticalScrollBar(); - if (sb.isVisible()) + if (sb.isVisible()) { int delta = sb.getBlockIncrement(-1); sb.setValue(sb.getValue() + delta); @@ -509,13 +509,13 @@ public class BasicScrollPaneUI extends ScrollPaneUI } } ); - map.put("scrollRight", + map.put("scrollRight", new AbstractAction("scrollRight") { public void actionPerformed(ActionEvent event) { JScrollPane sp = (JScrollPane) event.getSource(); JScrollBar sb = sp.getHorizontalScrollBar(); - if (sb.isVisible()) + if (sb.isVisible()) { int delta = sb.getBlockIncrement(1); sb.setValue(sb.getValue() + delta); @@ -523,31 +523,31 @@ public class BasicScrollPaneUI extends ScrollPaneUI } } ); - map.put("scrollHome", + map.put("scrollHome", new AbstractAction("scrollHome") { public void actionPerformed(ActionEvent event) { JScrollPane sp = (JScrollPane) event.getSource(); JScrollBar sb1 = sp.getHorizontalScrollBar(); - if (sb1.isVisible()) + if (sb1.isVisible()) { sb1.setValue(sb1.getMinimum()); } JScrollBar sb2 = sp.getVerticalScrollBar(); - if (sb2.isVisible()) + if (sb2.isVisible()) { sb2.setValue(sb2.getMinimum()); } } } ); - map.put("scrollDown", + map.put("scrollDown", new AbstractAction("scrollDown") { public void actionPerformed(ActionEvent event) { JScrollPane sp = (JScrollPane) event.getSource(); JScrollBar sb = sp.getVerticalScrollBar(); - if (sb.isVisible()) + if (sb.isVisible()) { int delta = sb.getBlockIncrement(1); sb.setValue(sb.getValue() + delta); @@ -555,13 +555,13 @@ public class BasicScrollPaneUI extends ScrollPaneUI } } ); - map.put("unitScrollDown", + map.put("unitScrollDown", new AbstractAction("unitScrollDown") { public void actionPerformed(ActionEvent event) { JScrollPane sp = (JScrollPane) event.getSource(); JScrollBar sb = sp.getVerticalScrollBar(); - if (sb.isVisible()) + if (sb.isVisible()) { int delta = sb.getUnitIncrement(1); sb.setValue(sb.getValue() + delta); @@ -569,13 +569,13 @@ public class BasicScrollPaneUI extends ScrollPaneUI } } ); - map.put("unitScrollRight", + map.put("unitScrollRight", new AbstractAction("unitScrollRight") { public void actionPerformed(ActionEvent event) { JScrollPane sp = (JScrollPane) event.getSource(); JScrollBar sb = sp.getHorizontalScrollBar(); - if (sb.isVisible()) + if (sb.isVisible()) { int delta = sb.getUnitIncrement(1); sb.setValue(sb.getValue() + delta); @@ -585,7 +585,7 @@ public class BasicScrollPaneUI extends ScrollPaneUI ); return map; } - + /** * Installs additional keyboard actions on the scrollpane. This is a hook * method provided to subclasses in order to install their own keyboard @@ -597,7 +597,7 @@ public class BasicScrollPaneUI extends ScrollPaneUI { InputMap keyMap = getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - SwingUtilities.replaceUIInputMap(sp, + SwingUtilities.replaceUIInputMap(sp, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(sp, map); @@ -613,10 +613,10 @@ public class BasicScrollPaneUI extends ScrollPaneUI protected void uninstallKeyboardActions(JScrollPane sp) { SwingUtilities.replaceUIActionMap(sp, null); - SwingUtilities.replaceUIInputMap(sp, + SwingUtilities.replaceUIInputMap(sp, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); } - + /** * Creates and returns the change listener for the horizontal scrollbar. * @@ -661,7 +661,7 @@ public class BasicScrollPaneUI extends ScrollPaneUI * Creates and returns the mouse wheel listener for the scrollpane. * * @return the mouse wheel listener for the scrollpane - * + * * @since 1.4 */ protected MouseWheelListener createMouseWheelListener() @@ -669,7 +669,7 @@ public class BasicScrollPaneUI extends ScrollPaneUI return new MouseWheelHandler(); } - public void uninstallUI(final JComponent c) + public void uninstallUI(final JComponent c) { uninstallDefaults((JScrollPane) c); uninstallListeners(c); @@ -680,7 +680,7 @@ public class BasicScrollPaneUI extends ScrollPaneUI * Uninstalls all the listeners that have been installed in * {@link #installListeners(JScrollPane)}. * - * @param c the scrollpane from which to uninstall the listeners + * @param c the scrollpane from which to uninstall the listeners */ protected void uninstallListeners(JComponent c) { @@ -690,17 +690,17 @@ public class BasicScrollPaneUI extends ScrollPaneUI .removeChangeListener(hsbChangeListener); sp.getVerticalScrollBar().getModel() .removeChangeListener(vsbChangeListener); - + JViewport v = sp.getViewport(); v.removeChangeListener(viewportChangeListener); v.removeContainerListener(containerListener); - + for (int i = 0; i < v.getComponentCount(); i++) v.getComponent(i).removeMouseWheelListener(mouseWheelListener); } - public Dimension getMinimumSize(JComponent c) + public Dimension getMinimumSize(JComponent c) { JScrollPane p = (JScrollPane) c; ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout(); @@ -821,15 +821,3 @@ public class BasicScrollPaneUI extends ScrollPaneUI syncScrollPaneWithViewport(); } } - - - - - - - - - - - - diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicSeparatorUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicSeparatorUI.java index 97caa3a..2c80822 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicSeparatorUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicSeparatorUI.java @@ -86,10 +86,10 @@ public class BasicSeparatorUI extends SeparatorUI if (c instanceof JSeparator) { - JSeparator s = (JSeparator) c; + JSeparator s = (JSeparator) c; - installDefaults(s); - installListeners(s); + installDefaults(s); + installListeners(s); } } @@ -104,10 +104,10 @@ public class BasicSeparatorUI extends SeparatorUI { if (c instanceof JSeparator) { - JSeparator s = (JSeparator) c; + JSeparator s = (JSeparator) c; - uninstallListeners(s); - uninstallDefaults(s); + uninstallListeners(s); + uninstallDefaults(s); } } @@ -138,7 +138,7 @@ public class BasicSeparatorUI extends SeparatorUI /** * This method installs any listeners that need - * to be attached to the JSeparator or any of its + * to be attached to the JSeparator or any of its * components. * * @param s The JSeparator that is being installed. @@ -156,15 +156,15 @@ public class BasicSeparatorUI extends SeparatorUI */ protected void uninstallListeners(JSeparator s) { - // Separators don't receive events. + // Separators don't receive events. } /** - * The separator is made of two lines. The top line will be - * the shadow color (or left line if it's vertical). The bottom - * or right line will be the highlight color. The two lines will - * be centered inside the bounds box. If the separator is horizontal, - * then it will be vertically centered, or if it's vertical, it will + * The separator is made of two lines. The top line will be + * the shadow color (or left line if it's vertical). The bottom + * or right line will be the highlight color. The two lines will + * be centered inside the bounds box. If the separator is horizontal, + * then it will be vertically centered, or if it's vertical, it will * be horizontally centered. * * @param g The Graphics object to paint with @@ -175,15 +175,15 @@ public class BasicSeparatorUI extends SeparatorUI Rectangle r = new Rectangle(); SwingUtilities.calculateInnerArea(c, r); Color saved = g.getColor(); - + JSeparator s; if (c instanceof JSeparator) s = (JSeparator) c; else return; - + if (s.getOrientation() == JSeparator.HORIZONTAL) - { + { int midAB = r.height / 2; g.setColor(shadow); g.drawLine(r.x, r.y + midAB - 1, r.x + r.width, r.y + midAB - 1); @@ -204,7 +204,7 @@ public class BasicSeparatorUI extends SeparatorUI } /** - * This method returns the preferred size of the + * This method returns the preferred size of the * JComponent. * * @param c The JComponent to measure. @@ -216,8 +216,8 @@ public class BasicSeparatorUI extends SeparatorUI Dimension pref = new Dimension(2, 0); if (c instanceof JSeparator) { - JSeparator s = (JSeparator) c; - if (s.getOrientation() == JSeparator.HORIZONTAL) + JSeparator s = (JSeparator) c; + if (s.getOrientation() == JSeparator.HORIZONTAL) pref = new Dimension(0, 2); } return pref; diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java index 474a422..b9d5643 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicSliderUI.java @@ -81,12 +81,12 @@ import javax.swing.plaf.SliderUI; * BasicSliderUI.java This is the UI delegate in the Basic look and feel that * paints JSliders. * </p> - * + * * <p> * The UI delegate keeps track of 6 rectangles that place the various parts of * the JSlider inside the component. * </p> - * + * * <p> * The rectangles are organized as follows: * </p> @@ -110,27 +110,27 @@ import javax.swing.plaf.SliderUI; * | | | | | | * | | | | | * </pre> - * + * * <p> * The space between the contentRect and the focusRect are the FocusInsets. * </p> - * + * * <p> * The space between the focusRect and the component bounds is the insetCache * which are the component's insets. * </p> - * + * * <p> * The top of the thumb is the top of the contentRect. The trackRect has to be * as tall as the thumb. * </p> - * + * * <p> * The trackRect and tickRect do not start from the left edge of the * focusRect. They are trackBuffer away from each side of the focusRect. This * is so that the thumb has room to move. * </p> - * + * * <p> * The labelRect does start right against the contentRect's left and right * edges and it gets all remaining space. @@ -420,8 +420,8 @@ public class BasicSliderUI extends SliderUI if (slider.getSnapToTicks()) value = findClosestTick(value); - // If the thumb is hit, then we don't need to set the timers to - // move it. + // If the thumb is hit, then we don't need to set the timers to + // move it. if (! thumbRect.contains(e.getPoint())) { // The mouse has hit some other part of the slider. @@ -605,16 +605,16 @@ public class BasicSliderUI extends SliderUI /** * Returns true if the user is dragging the slider. - * + * * @return true if the slider is being dragged. - * + * * @since 1.5 */ protected boolean isDragging() { return dragging; } - + /** * Gets the shadow color to be used for this slider. The shadow color is the * color used for drawing the top and left edges of the track. @@ -1099,15 +1099,15 @@ public class BasicSliderUI extends SliderUI } /** - * Updates the <code>contentRect</code> field to an area inside the - * <code>focusRect</code>. This method does not need to be called if the + * Updates the <code>contentRect</code> field to an area inside the + * <code>focusRect</code>. This method does not need to be called if the * orientation changes. */ protected void calculateContentRect() { contentRect.x = focusRect.x + focusInsets.left; contentRect.y = focusRect.y + focusInsets.top; - + contentRect.width = focusRect.width - focusInsets.left - focusInsets.right; contentRect.height = focusRect.height - focusInsets.top - focusInsets.bottom; @@ -1134,9 +1134,9 @@ public class BasicSliderUI extends SliderUI } /** - * Calculates the gap size between the edge of the <code>contentRect</code> + * Calculates the gap size between the edge of the <code>contentRect</code> * and the edge of the <code>trackRect</code>, storing the result in the - * <code>trackBuffer</code> field. Sufficient space needs to be reserved + * <code>trackBuffer</code> field. Sufficient space needs to be reserved * for the slider thumb and/or the labels at each end of the slider track. */ protected void calculateTrackBuffer() @@ -1145,11 +1145,11 @@ public class BasicSliderUI extends SliderUI { int w = Math.max(getWidthOfLowValueLabel(), getWidthOfHighValueLabel()); trackBuffer = Math.max(thumbRect.width / 2, w / 2); - + } else { - int h = Math.max(getHeightOfLowValueLabel(), + int h = Math.max(getHeightOfLowValueLabel(), getHeightOfHighValueLabel()); trackBuffer = Math.max(thumbRect.height / 2, h / 2); } @@ -1157,10 +1157,10 @@ public class BasicSliderUI extends SliderUI /** * Returns the size of the slider's thumb. The size is hard coded to - * <code>11 x 20</code> for horizontal sliders, and <code>20 x 11</code> for - * vertical sliders. Note that a new instance of {@link Dimension} is - * returned for every call to this method (this seems wasteful, but - * {@link Dimension} instances are not immutable, so this is probably + * <code>11 x 20</code> for horizontal sliders, and <code>20 x 11</code> for + * vertical sliders. Note that a new instance of {@link Dimension} is + * returned for every call to this method (this seems wasteful, but + * {@link Dimension} instances are not immutable, so this is probably * unavoidable). * * @return The size of the slider's thumb. @@ -1232,7 +1232,7 @@ public class BasicSliderUI extends SliderUI tickRect.y = trackRect.y + trackRect.height; tickRect.width = trackRect.width; tickRect.height = getTickLength(); - + // this makes our Mauve tests pass...can't explain it! if (!slider.getPaintTicks()) { @@ -1257,7 +1257,7 @@ public class BasicSliderUI extends SliderUI } /** - * Calculates the <code>labelRect</code> field, taking into account the + * Calculates the <code>labelRect</code> field, taking into account the * orientation of the slider. */ protected void calculateLabelRect() @@ -1353,7 +1353,7 @@ public class BasicSliderUI extends SliderUI * there are no labels. * * @return The width of the label whose key has the highest value. - * + * * @see #getHighestValueLabel() */ protected int getWidthOfHighValueLabel() @@ -1370,7 +1370,7 @@ public class BasicSliderUI extends SliderUI * there are no labels. * * @return The width of the label whose key has the lowest value. - * + * * @see #getLowestValueLabel() */ protected int getWidthOfLowValueLabel() @@ -1455,7 +1455,7 @@ public class BasicSliderUI extends SliderUI /** * Returns the label whose key has the highest value. * - * @return The label whose key has the highest value or <code>null</code> if + * @return The label whose key has the highest value or <code>null</code> if * no label table exists. */ protected Component getHighestValueLabel() @@ -1527,7 +1527,7 @@ public class BasicSliderUI extends SliderUI protected void recalculateIfOrientationChanged() { // Examining a test program shows that either Sun calls private - // methods that we don't know about, or these don't do anything. + // methods that we don't know about, or these don't do anything. calculateThumbSize(); calculateTrackBuffer(); calculateTrackRect(); @@ -1549,7 +1549,7 @@ public class BasicSliderUI extends SliderUI Color saved_color = g.getColor(); g.setColor(getFocusColor()); - + g.drawRect(focusRect.x, focusRect.y, focusRect.width, focusRect.height); g.setColor(saved_color); @@ -1564,16 +1564,16 @@ public class BasicSliderUI extends SliderUI * with the highlight color. * </p> * <pre> - * a---d - * | | + * a---d + * | | * | | a------------------------d * | | | | * | | b------------------------c * | | - * | | + * | | * b---c * </pre> - * + * * <p> * The b-a-d path needs to be drawn with the shadow color and the b-c-d path * needs to be drawn with the highlight color. @@ -1676,7 +1676,7 @@ public class BasicSliderUI extends SliderUI } } - /* Minor ticks start at 1/4 of the height (or width) of the tickRect and + /* Minor ticks start at 1/4 of the height (or width) of the tickRect and extend to 1/2 of the tickRect. Major ticks start at 1/4 of the height and extend to 3/4. @@ -1849,7 +1849,7 @@ public class BasicSliderUI extends SliderUI * \ / | / * d e-----d * </pre> - * + * * <p> * In the case of vertical thumbs, we highlight the path b-a-e-d and shadow * the path b-c-d. In the case of horizontal thumbs, we highlight the path @@ -1958,10 +1958,10 @@ public class BasicSliderUI extends SliderUI /** * Moves the thumb one block in the direction specified (a block is 1/10th - * of the slider range). If the slider snaps to ticks, this method is + * of the slider range). If the slider snaps to ticks, this method is * responsible for snapping it to a tick after the thumb has been moved. * - * @param direction the direction (positive values increment the thumb + * @param direction the direction (positive values increment the thumb * position by one block, zero/negative values decrement the thumb position * by one block). */ @@ -1981,11 +1981,11 @@ public class BasicSliderUI extends SliderUI } /** - * Moves the thumb one unit in the specified direction. If the slider snaps - * to ticks, this method is responsible for snapping it to a tick after the + * Moves the thumb one unit in the specified direction. If the slider snaps + * to ticks, this method is responsible for snapping it to a tick after the * thumb has been moved. * - * @param direction the direction (positive values increment the thumb + * @param direction the direction (positive values increment the thumb * position by one, zero/negative values decrement the thumb position by * one). */ @@ -2021,7 +2021,7 @@ public class BasicSliderUI extends SliderUI } /** - * Returns the x-coordinate (relative to the component) for the given slider + * Returns the x-coordinate (relative to the component) for the given slider * value. This method assumes that the <code>trackRect</code> field is * set up. * @@ -2049,8 +2049,8 @@ public class BasicSliderUI extends SliderUI } /** - * Returns the y-coordinate (relative to the component) for the given slider - * value. This method assumes that the <code>trackRect</code> field is + * Returns the y-coordinate (relative to the component) for the given slider + * value. This method assumes that the <code>trackRect</code> field is * set up. * * @param value the slider value. @@ -2093,8 +2093,8 @@ public class BasicSliderUI extends SliderUI int value; - // If the length is 0, you shouldn't be able to even see where the slider - // is. This really shouldn't ever happen, but just in case, we'll return + // If the length is 0, you shouldn't be able to even see where the slider + // is. This really shouldn't ever happen, but just in case, we'll return // the middle. if (len == 0) return (max - min) / 2; @@ -2129,8 +2129,8 @@ public class BasicSliderUI extends SliderUI int value; - // If the length is 0, you shouldn't be able to even see where the slider - // is. This really shouldn't ever happen, but just in case, we'll return + // If the length is 0, you shouldn't be able to even see where the slider + // is. This really shouldn't ever happen, but just in case, we'll return // the middle. if (len == 0) return (max - min) / 2; @@ -2164,14 +2164,14 @@ public class BasicSliderUI extends SliderUI int minorSpace = slider.getMinorTickSpacing(); // The default value to return is value + minor or - // value + major. + // value + major. // Initializing at min - value leaves us with a default // return value of min, which always has tick marks // (if ticks are painted). int minor = min - value; int major = min - value; - // If there are no major tick marks or minor tick marks + // If there are no major tick marks or minor tick marks // e.g. snap is set to true but no ticks are set, then // we can just return the value. if (majorSpace <= 0 && minorSpace <= 0) @@ -2208,8 +2208,8 @@ public class BasicSliderUI extends SliderUI else return value + minor; } - - InputMap getInputMap(int condition) + + InputMap getInputMap(int condition) { if (condition == JComponent.WHEN_FOCUSED) return (InputMap) UIManager.get("Slider.focusInputMap"); @@ -2218,12 +2218,12 @@ public class BasicSliderUI extends SliderUI /** * Returns the action map for the {@link JSlider}. All sliders share - * a single action map which is created the first time this method is + * a single action map which is created the first time this method is * called, then stored in the UIDefaults table for subsequent access. - * + * * @return The shared action map. */ - ActionMap getActionMap() + ActionMap getActionMap() { ActionMap map = (ActionMap) UIManager.get("Slider.actionMap"); @@ -2238,18 +2238,18 @@ public class BasicSliderUI extends SliderUI /** * Creates the action map shared by all {@link JSlider} instances. - * This method is called once by {@link #getActionMap()} when it - * finds no action map in the UIDefaults table...after the map is - * created, it gets added to the defaults table so that subsequent - * calls to {@link #getActionMap()} will return the same shared + * This method is called once by {@link #getActionMap()} when it + * finds no action map in the UIDefaults table...after the map is + * created, it gets added to the defaults table so that subsequent + * calls to {@link #getActionMap()} will return the same shared * instance. - * + * * @return The action map. */ ActionMap createActionMap() { ActionMap map = new ActionMapUIResource(); - map.put("positiveUnitIncrement", + map.put("positiveUnitIncrement", new AbstractAction("positiveUnitIncrement") { public void actionPerformed(ActionEvent event) { @@ -2262,7 +2262,7 @@ public class BasicSliderUI extends SliderUI } } ); - map.put("negativeUnitIncrement", + map.put("negativeUnitIncrement", new AbstractAction("negativeUnitIncrement") { public void actionPerformed(ActionEvent event) { @@ -2275,7 +2275,7 @@ public class BasicSliderUI extends SliderUI } } ); - map.put("positiveBlockIncrement", + map.put("positiveBlockIncrement", new AbstractAction("positiveBlockIncrement") { public void actionPerformed(ActionEvent event) { @@ -2288,7 +2288,7 @@ public class BasicSliderUI extends SliderUI } } ); - map.put("negativeBlockIncrement", + map.put("negativeBlockIncrement", new AbstractAction("negativeBlockIncrement") { public void actionPerformed(ActionEvent event) { @@ -2301,7 +2301,7 @@ public class BasicSliderUI extends SliderUI } } ); - map.put("minScroll", + map.put("minScroll", new AbstractAction("minScroll") { public void actionPerformed(ActionEvent event) { @@ -2309,11 +2309,11 @@ public class BasicSliderUI extends SliderUI if (slider.getInverted()) slider.setValue(slider.getMaximum()); else - slider.setValue(slider.getMinimum()); + slider.setValue(slider.getMinimum()); } } ); - map.put("maxScroll", + map.put("maxScroll", new AbstractAction("maxScroll") { public void actionPerformed(ActionEvent event) { @@ -2321,7 +2321,7 @@ public class BasicSliderUI extends SliderUI if (slider.getInverted()) slider.setValue(slider.getMinimum()); else - slider.setValue(slider.getMaximum()); + slider.setValue(slider.getMaximum()); } } ); diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicSpinnerUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicSpinnerUI.java index 254a9a4..00c8537 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicSpinnerUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicSpinnerUI.java @@ -173,7 +173,7 @@ public class BasicSpinnerUI extends SpinnerUI if (e instanceof JSpinner.DefaultEditor) { JSpinner.DefaultEditor de = (JSpinner.DefaultEditor) e; - de.getTextField().setBorder(null); + de.getTextField().setBorder(null); } spinner.setLayout(createLayout()); spinner.setOpaque(true); @@ -199,36 +199,36 @@ public class BasicSpinnerUI extends SpinnerUI { c.addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent evt) - { - if (! spinner.isEnabled()) - return; - increment(); - timer.setInitialDelay(500); - timer.start(); - } - - public void mouseReleased(MouseEvent evt) - { - timer.stop(); - } - - void increment() - { - Object next = BasicSpinnerUI.this.spinner.getNextValue(); - if (next != null) - BasicSpinnerUI.this.spinner.getModel().setValue(next); - } - - volatile boolean mouseDown; - Timer timer = new Timer(50, - new ActionListener() - { - public void actionPerformed(ActionEvent event) - { - increment(); - } - }); + public void mousePressed(MouseEvent evt) + { + if (! spinner.isEnabled()) + return; + increment(); + timer.setInitialDelay(500); + timer.start(); + } + + public void mouseReleased(MouseEvent evt) + { + timer.stop(); + } + + void increment() + { + Object next = BasicSpinnerUI.this.spinner.getNextValue(); + if (next != null) + BasicSpinnerUI.this.spinner.getModel().setValue(next); + } + + volatile boolean mouseDown; + Timer timer = new Timer(50, + new ActionListener() + { + public void actionPerformed(ActionEvent event) + { + increment(); + } + }); }); } @@ -239,36 +239,36 @@ public class BasicSpinnerUI extends SpinnerUI { c.addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent evt) - { - if (! spinner.isEnabled()) - return; - decrement(); - timer.setInitialDelay(500); - timer.start(); - } - - public void mouseReleased(MouseEvent evt) - { - timer.stop(); - } - - void decrement() - { - Object prev = BasicSpinnerUI.this.spinner.getPreviousValue(); - if (prev != null) - BasicSpinnerUI.this.spinner.getModel().setValue(prev); - } - - volatile boolean mouseDown; - Timer timer = new Timer(50, - new ActionListener() - { - public void actionPerformed(ActionEvent event) - { - decrement(); - } - }); + public void mousePressed(MouseEvent evt) + { + if (! spinner.isEnabled()) + return; + decrement(); + timer.setInitialDelay(500); + timer.start(); + } + + public void mouseReleased(MouseEvent evt) + { + timer.stop(); + } + + void decrement() + { + Object prev = BasicSpinnerUI.this.spinner.getPreviousValue(); + if (prev != null) + BasicSpinnerUI.this.spinner.getModel().setValue(prev); + } + + volatile boolean mouseDown; + Timer timer = new Timer(50, + new ActionListener() + { + public void actionPerformed(ActionEvent event) + { + decrement(); + } + }); }); } @@ -384,7 +384,7 @@ public class BasicSpinnerUI extends SpinnerUI Dimension e = prefSize(editor); Dimension n = prefSize(next); Dimension p = prefSize(previous); - Dimension s = parent.getSize(); + Dimension s = parent.getSize(); int x = l2r ? i.left : i.right; int y = i.top; diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneDivider.java b/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneDivider.java index 95468ca..53f7db6 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneDivider.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneDivider.java @@ -61,7 +61,7 @@ import javax.swing.border.Border; /** * The divider that separates the two parts of a JSplitPane in the Basic look * and feel. - * + * * <p> * Implementation status: We do not have a real implementation yet. Currently, * it is mostly a stub to allow compiling other parts of the @@ -138,62 +138,62 @@ public class BasicSplitPaneDivider extends Container public void paint(Graphics g) { if (splitPane != null) - { - // Fill background. - g.setColor(splitPane.getBackground()); - g.fillRect(0, 0, getWidth(), getHeight()); - - // Draw arrow. - int size; - if (direction == LEFT) - { - if (orientation == JSplitPane.VERTICAL_SPLIT) - { - size = Math.min(getHeight(), ONE_TOUCH_SIZE); - xpoints[0] = 0; - xpoints[1] = size / 2; - xpoints[2] = size; - ypoints[0] = size; - ypoints[1] = 0; - ypoints[2] = size; - } - else - { - size = Math.min(getWidth(), ONE_TOUCH_SIZE); - xpoints[0] = size; - xpoints[1] = 0; - xpoints[2] = size; - ypoints[0] = 0; - ypoints[1] = size / 2; - ypoints[2] = size; - } - } - else - { - if (orientation == JSplitPane.VERTICAL_SPLIT) - { - size = Math.min(getHeight(), ONE_TOUCH_SIZE); - xpoints[0] = 0; - xpoints[1] = size / 2; - xpoints[2] = size; - ypoints[0] = 0; - ypoints[1] = size; - ypoints[2] = 0; - } - else - { - size = Math.min(getWidth(), ONE_TOUCH_SIZE); - xpoints[0] = 0; - xpoints[1] = size; - xpoints[2] = 0; - ypoints[0] = 0; - ypoints[1] = size / 2; - ypoints[2] = size; - } - } - g.setColor(Color.BLACK); - g.fillPolygon(xpoints, ypoints, 3); - } + { + // Fill background. + g.setColor(splitPane.getBackground()); + g.fillRect(0, 0, getWidth(), getHeight()); + + // Draw arrow. + int size; + if (direction == LEFT) + { + if (orientation == JSplitPane.VERTICAL_SPLIT) + { + size = Math.min(getHeight(), ONE_TOUCH_SIZE); + xpoints[0] = 0; + xpoints[1] = size / 2; + xpoints[2] = size; + ypoints[0] = size; + ypoints[1] = 0; + ypoints[2] = size; + } + else + { + size = Math.min(getWidth(), ONE_TOUCH_SIZE); + xpoints[0] = size; + xpoints[1] = 0; + xpoints[2] = size; + ypoints[0] = 0; + ypoints[1] = size / 2; + ypoints[2] = size; + } + } + else + { + if (orientation == JSplitPane.VERTICAL_SPLIT) + { + size = Math.min(getHeight(), ONE_TOUCH_SIZE); + xpoints[0] = 0; + xpoints[1] = size / 2; + xpoints[2] = size; + ypoints[0] = 0; + ypoints[1] = size; + ypoints[2] = 0; + } + else + { + size = Math.min(getWidth(), ONE_TOUCH_SIZE); + xpoints[0] = 0; + xpoints[1] = size; + xpoints[2] = 0; + ypoints[0] = 0; + ypoints[1] = size / 2; + ypoints[2] = size; + } + } + g.setColor(Color.BLACK); + g.fillPolygon(xpoints, ypoints, 3); + } } } @@ -212,66 +212,66 @@ public class BasicSplitPaneDivider extends Container int newLoc; if (ev.getSource() == leftButton) - { - if (orientation == JSplitPane.VERTICAL_SPLIT) - { - if (currentLoc - >= splitPane.getHeight() - insets.bottom - getHeight()) - { - newLoc = Math.min(splitPane.getMaximumDividerLocation(), - lastLoc); - } - else - { - newLoc = insets.top; - } - } - else - { - if (currentLoc - >= splitPane.getWidth() - insets.right - getWidth()) - { - newLoc = Math.min(splitPane.getMaximumDividerLocation(), - lastLoc); - } - else - { - newLoc = insets.left; - } - } - } + { + if (orientation == JSplitPane.VERTICAL_SPLIT) + { + if (currentLoc + >= splitPane.getHeight() - insets.bottom - getHeight()) + { + newLoc = Math.min(splitPane.getMaximumDividerLocation(), + lastLoc); + } + else + { + newLoc = insets.top; + } + } + else + { + if (currentLoc + >= splitPane.getWidth() - insets.right - getWidth()) + { + newLoc = Math.min(splitPane.getMaximumDividerLocation(), + lastLoc); + } + else + { + newLoc = insets.left; + } + } + } else - { - if (orientation == JSplitPane.VERTICAL_SPLIT) - { - if (currentLoc == insets.top) - { - newLoc = Math.min(splitPane.getMaximumDividerLocation(), - lastLoc); - } - else - { - newLoc = splitPane.getHeight() - insets.top - getHeight(); - } - } - else - { - if (currentLoc == insets.left) - { - newLoc = Math.min(splitPane.getMaximumDividerLocation(), - lastLoc); - } - else - { - newLoc = splitPane.getWidth() - insets.left - getWidth(); - } - } - } + { + if (orientation == JSplitPane.VERTICAL_SPLIT) + { + if (currentLoc == insets.top) + { + newLoc = Math.min(splitPane.getMaximumDividerLocation(), + lastLoc); + } + else + { + newLoc = splitPane.getHeight() - insets.top - getHeight(); + } + } + else + { + if (currentLoc == insets.left) + { + newLoc = Math.min(splitPane.getMaximumDividerLocation(), + lastLoc); + } + else + { + newLoc = splitPane.getWidth() - insets.left - getWidth(); + } + } + } if (currentLoc != newLoc) - { - splitPane.setDividerLocation(newLoc); - splitPane.setLastDividerLocation(currentLoc); - } + { + splitPane.setDividerLocation(newLoc); + splitPane.setLastDividerLocation(currentLoc); + } } } @@ -315,7 +315,7 @@ public class BasicSplitPaneDivider extends Container /** * The listener for handling mouse events from both the divider and the * containing <code>JSplitPane</code>. - * + * * <p> * The reason for also handling MouseEvents from the containing * <code>JSplitPane</code> is that users should be able to start a drag @@ -398,11 +398,11 @@ public class BasicSplitPaneDivider extends Container /* Remove the connection to the existing JSplitPane. */ if (splitPane != null) { - splitPane.removePropertyChangeListener(this); - removeMouseListener(mouseHandler); - removeMouseMotionListener(mouseHandler); - splitPane = null; - hiddenDivider = null; + splitPane.removePropertyChangeListener(this); + removeMouseListener(mouseHandler); + removeMouseMotionListener(mouseHandler); + splitPane = null; + hiddenDivider = null; } /* Establish the connection to the new JSplitPane. */ @@ -411,11 +411,11 @@ public class BasicSplitPaneDivider extends Container splitPane = newUI.getSplitPane(); if (splitPane != null) { - splitPane.addPropertyChangeListener(this); - addMouseListener(mouseHandler); - addMouseMotionListener(mouseHandler); - hiddenDivider = splitPaneUI.getNonContinuousLayoutDivider(); - orientation = splitPane.getOrientation(); + splitPane.addPropertyChangeListener(this); + addMouseListener(mouseHandler); + addMouseMotionListener(mouseHandler); + hiddenDivider = splitPaneUI.getNonContinuousLayoutDivider(); + orientation = splitPane.getOrientation(); if (splitPane.isOneTouchExpandable()) oneTouchExpandableChanged(); } @@ -465,9 +465,9 @@ public class BasicSplitPaneDivider extends Container { if (border != this.border) { - Border oldValue = this.border; - this.border = border; - firePropertyChange("border", oldValue, border); + Border oldValue = this.border; + this.border = border; + firePropertyChange("border", oldValue, border); } } @@ -539,7 +539,7 @@ public class BasicSplitPaneDivider extends Container oneTouchExpandableChanged(); else if (e.getPropertyName().equals(JSplitPane.ORIENTATION_PROPERTY)) { - orientation = splitPane.getOrientation(); + orientation = splitPane.getOrientation(); invalidate(); if (splitPane != null) splitPane.revalidate(); @@ -560,8 +560,8 @@ public class BasicSplitPaneDivider extends Container super.paint(g); if (border != null) { - dividerSize = getSize(); - border.paintBorder(this, g, 0, 0, dividerSize.width, dividerSize.height); + dividerSize = getSize(); + border.paintBorder(this, g, 0, 0, dividerSize.width, dividerSize.height); } } @@ -573,20 +573,20 @@ public class BasicSplitPaneDivider extends Container { if (splitPane.isOneTouchExpandable()) { - leftButton = createLeftOneTouchButton(); - if (leftButton != null) - leftButton.addActionListener(new OneTouchAction()); + leftButton = createLeftOneTouchButton(); + if (leftButton != null) + leftButton.addActionListener(new OneTouchAction()); - rightButton = createRightOneTouchButton(); - if (rightButton != null) - rightButton.addActionListener(new OneTouchAction()); + rightButton = createRightOneTouchButton(); + if (rightButton != null) + rightButton.addActionListener(new OneTouchAction()); - // Only add them when both are non-null. - if (leftButton != null && rightButton != null) + // Only add them when both are non-null. + if (leftButton != null && rightButton != null) { add(leftButton); add(rightButton); - } + } } invalidate(); if (splitPane != null) @@ -678,28 +678,28 @@ public class BasicSplitPaneDivider extends Container switch (locationIndex) { case 1: - splitPane.setDividerLocation(splitPane.getLastDividerLocation()); - break; + splitPane.setDividerLocation(splitPane.getLastDividerLocation()); + break; case 0: - int top = (orientation == JSplitPane.HORIZONTAL_SPLIT) ? insets.left - : insets.top; - splitPane.setDividerLocation(top); - break; + int top = (orientation == JSplitPane.HORIZONTAL_SPLIT) ? insets.left + : insets.top; + splitPane.setDividerLocation(top); + break; case 2: - int bottom; - if (orientation == JSplitPane.HORIZONTAL_SPLIT) - bottom = splitPane.getBounds().width - insets.right - dividerSize; - else - bottom = splitPane.getBounds().height - insets.bottom - dividerSize; - splitPane.setDividerLocation(bottom); - break; + int bottom; + if (orientation == JSplitPane.HORIZONTAL_SPLIT) + bottom = splitPane.getBounds().width - insets.right - dividerSize; + else + bottom = splitPane.getBounds().height - insets.bottom - dividerSize; + splitPane.setDividerLocation(bottom); + break; } } /** * The listener for handling mouse events from both the divider and the * containing <code>JSplitPane</code>. - * + * * <p> * The reason for also handling MouseEvents from the containing * <code>JSplitPane</code> is that users should be able to start a drag @@ -724,9 +724,9 @@ public class BasicSplitPaneDivider extends Container isDragging = true; currentDividerLocation = 1; if (orientation == JSplitPane.HORIZONTAL_SPLIT) - dragger = new DragController(e); + dragger = new DragController(e); else - dragger = new VerticalDragController(e); + dragger = new VerticalDragController(e); prepareForDragging(); } @@ -836,7 +836,7 @@ public class BasicSplitPaneDivider extends Container protected void continueDrag(int newX, int newY) { if (isValid()) - dragDividerTo(adjust(newX, newY)); + dragDividerTo(adjust(newX, newY)); } /** @@ -848,7 +848,7 @@ public class BasicSplitPaneDivider extends Container protected void continueDrag(MouseEvent e) { if (isValid()) - dragDividerTo(positionForMouseEvent(e)); + dragDividerTo(positionForMouseEvent(e)); } /** @@ -1000,7 +1000,7 @@ public class BasicSplitPaneDivider extends Container x = insets.left; y = 0; } - + leftButton.setBounds(x, y + ONE_TOUCH_OFFSET, size, size * 2); rightButton.setBounds(x, y + ONE_TOUCH_OFFSET diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java index b7cc425..ca96075 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java @@ -89,7 +89,7 @@ public class BasicSplitPaneUI extends SplitPaneUI // 3 components at a time. // LEFT/TOP = 0 // RIGHT/BOTTOM = 1 - // DIVIDER = 2 + // DIVIDER = 2 /** * This array contains the components in the JSplitPane. The left/top @@ -338,7 +338,7 @@ public class BasicSplitPaneUI extends SplitPaneUI // Layout divider. loc += sizes[0]; setComponentToSize(components[2], sizes[2], loc, insets, dims); - // Layout component#2. + // Layout component#2. loc += sizes[2]; setComponentToSize(components[1], sizes[1], loc, insets, dims); } @@ -483,7 +483,7 @@ public class BasicSplitPaneUI extends SplitPaneUI */ protected void setComponentToSize(Component c, int size, int location, Insets insets, Dimension containerSize) - { + { if (insets != null) { if (axis == SwingConstants.HORIZONTAL) @@ -752,7 +752,7 @@ public class BasicSplitPaneUI extends SplitPaneUI tmpSizes[0] += newSpace / 2; tmpSizes[1] += newSpace / 2; - + layoutManager.setSizes(tmpSizes); } else if (e.getPropertyName().equals(JSplitPane.ORIENTATION_PROPERTY)) @@ -986,12 +986,12 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the input map for the specified condition. - * + * * @param condition the condition. - * + * * @return The input map. */ - InputMap getInputMap(int condition) + InputMap getInputMap(int condition) { if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) return (InputMap) UIManager.get("SplitPane.ancestorInputMap"); @@ -1000,12 +1000,12 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the action map for the {@link JSplitPane}. All sliders share - * a single action map which is created the first time this method is + * a single action map which is created the first time this method is * called, then stored in the UIDefaults table for subsequent access. - * + * * @return The shared action map. */ - ActionMap getActionMap() + ActionMap getActionMap() { ActionMap map = (ActionMap) UIManager.get("SplitPane.actionMap"); @@ -1020,18 +1020,18 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Creates the action map shared by all {@link JSlider} instances. - * This method is called once by {@link #getActionMap()} when it - * finds no action map in the UIDefaults table...after the map is - * created, it gets added to the defaults table so that subsequent - * calls to {@link #getActionMap()} will return the same shared + * This method is called once by {@link #getActionMap()} when it + * finds no action map in the UIDefaults table...after the map is + * created, it gets added to the defaults table so that subsequent + * calls to {@link #getActionMap()} will return the same shared * instance. - * + * * @return The action map. */ ActionMap createActionMap() { ActionMap map = new ActionMapUIResource(); - map.put("toggleFocus", + map.put("toggleFocus", new AbstractAction("toggleFocus") { public void actionPerformed(ActionEvent event) { @@ -1039,7 +1039,7 @@ public class BasicSplitPaneUI extends SplitPaneUI } } ); - map.put("startResize", + map.put("startResize", new AbstractAction("startResize") { public void actionPerformed(ActionEvent event) { @@ -1047,7 +1047,7 @@ public class BasicSplitPaneUI extends SplitPaneUI } } ); - map.put("selectMax", + map.put("selectMax", new AbstractAction("selectMax") { public void actionPerformed(ActionEvent event) { @@ -1055,7 +1055,7 @@ public class BasicSplitPaneUI extends SplitPaneUI } } ); - map.put("selectMin", + map.put("selectMin", new AbstractAction("selectMin") { public void actionPerformed(ActionEvent event) { @@ -1063,7 +1063,7 @@ public class BasicSplitPaneUI extends SplitPaneUI } } ); - map.put("negativeIncrement", + map.put("negativeIncrement", new AbstractAction("negativeIncrement") { public void actionPerformed(ActionEvent event) { @@ -1074,7 +1074,7 @@ public class BasicSplitPaneUI extends SplitPaneUI } } ); - map.put("positiveIncrement", + map.put("positiveIncrement", new AbstractAction("positiveIncrement") { public void actionPerformed(ActionEvent event) { @@ -1092,7 +1092,7 @@ public class BasicSplitPaneUI extends SplitPaneUI // FIXME: implement this } } - ); + ); map.put("focusOutForward", new AbstractAction("focusOutForward") { public void actionPerformed(ActionEvent event) @@ -1100,7 +1100,7 @@ public class BasicSplitPaneUI extends SplitPaneUI // FIXME: implement this } } - ); + ); return map; } @@ -1112,7 +1112,7 @@ public class BasicSplitPaneUI extends SplitPaneUI { InputMap keyMap = getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - SwingUtilities.replaceUIInputMap(splitPane, + SwingUtilities.replaceUIInputMap(splitPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(splitPane, map); @@ -1124,7 +1124,7 @@ public class BasicSplitPaneUI extends SplitPaneUI protected void uninstallKeyboardActions() { SwingUtilities.replaceUIActionMap(splitPane, null); - SwingUtilities.replaceUIInputMap(splitPane, + SwingUtilities.replaceUIInputMap(splitPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); } diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java index fe36021..c42f9ca 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java @@ -82,7 +82,7 @@ import javax.swing.text.View; /** * This is the Basic Look and Feel's UI delegate for JTabbedPane. - * + * * @author Lillian Angel (langel@redhat.com) * @author Kim Ho (kho@redhat.com) * @author Roman Kennke (kennke@aicas.com) @@ -90,11 +90,11 @@ import javax.swing.text.View; */ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { - + static class NavigateAction extends AbstractAction { int direction; - + NavigateAction(String name, int dir) { super(name); @@ -108,9 +108,9 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants ui.navigateSelectedTab(direction); } - + } - + static class NavigatePageDownAction extends AbstractAction { @@ -123,17 +123,17 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { JTabbedPane tp = (JTabbedPane) event.getSource(); BasicTabbedPaneUI ui = (BasicTabbedPaneUI) tp.getUI(); - + int i = tp.getSelectedIndex(); - + if (i < 0) i = 0; - + ui.selectNextTabInRun(i); } - + } - + static class NavigatePageUpAction extends AbstractAction { @@ -146,17 +146,17 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { JTabbedPane tp = (JTabbedPane) event.getSource(); BasicTabbedPaneUI ui = (BasicTabbedPaneUI) tp.getUI(); - + int i = tp.getSelectedIndex(); - + if (i < 0) i = 0; - + ui.selectPreviousTabInRun(i); - } + } } - + static class RequestFocusAction extends AbstractAction { @@ -169,7 +169,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { ((JTabbedPane) event.getSource()).requestFocus(); } - + } static class RequestFocusForVisibleComponentAction extends AbstractAction @@ -183,18 +183,18 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants public void actionPerformed(ActionEvent event) { JTabbedPane tp = (JTabbedPane) event.getSource(); - + // FIXME: This should select a suitable component within // the tab content. However I dont know whether we have // to search for this component or wether the called is // supposed to do that. tp.getSelectedComponent().requestFocus(); } - + } /** - * A helper class that handles focus. + * A helper class that handles focus. * <p>The purpose of this class is to implement a more flexible focus * handling for the tabbed pane, which is used to determine whether the * focus indicator should be painted or not. When in scrolling layout @@ -262,7 +262,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants e.setSource(s); } } - + /** * This method is called when the mouse is pressed. The index cannot * change to a tab that is not enabled. @@ -281,9 +281,9 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants redispatchEvent(e); e.setSource(s); } - + int placement = tabPane.getTabPlacement(); - + if (s == incrButton) { if(!incrButton.isEnabled()) @@ -294,7 +294,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants switch (placement) { case JTabbedPane.TOP: - case JTabbedPane.BOTTOM: + case JTabbedPane.BOTTOM: currentScrollOffset = getTabAreaInsets(placement).left; for (int i = 0; i < currentScrollLocation; i++) currentScrollOffset += rects[i].width; @@ -305,30 +305,30 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants currentScrollOffset += rects[i].height; break; } - + updateViewPosition(); updateButtons(); - + tabPane.repaint(); } else if (s == decrButton) { if(!decrButton.isEnabled()) return; - + // The scroll location may be zero but the offset // greater than zero because of an adjustement to // make a partially visible tab completely visible. if (currentScrollLocation > 0) currentScrollLocation--; - + // Set the offset back to 0 and recompute it. currentScrollOffset = 0; switch (placement) { case JTabbedPane.TOP: - case JTabbedPane.BOTTOM: + case JTabbedPane.BOTTOM: // Take the tab area inset into account. if (currentScrollLocation > 0) currentScrollOffset = getTabAreaInsets(placement).left; @@ -340,14 +340,14 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants // Take the tab area inset into account. if (currentScrollLocation > 0) currentScrollOffset = getTabAreaInsets(placement).top; - + for (int i = 0; i < currentScrollLocation; i++) currentScrollOffset += rects[i].height; - } - + } + updateViewPosition(); updateButtons(); - + tabPane.repaint(); } else if (tabPane.isEnabled()) @@ -355,12 +355,12 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants int index = tabForCoordinate(tabPane, e.getX(), e.getY()); if (!tabPane.isEnabledAt(index)) return; - + if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT && s == panel) { scrollTab(index, placement); - + tabPane.setSelectedIndex(index); tabPane.repaint(); } @@ -370,9 +370,9 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants tabPane.revalidate(); tabPane.repaint(); } - + } - + } /** @@ -393,7 +393,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants redispatchEvent(e); e.setSource(s); } - + int tabIndex = tabForCoordinate(tabPane, e.getX(), e.getY()); setRolloverTab(tabIndex); } @@ -416,7 +416,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants redispatchEvent(e); e.setSource(s); } - + setRolloverTab(-1); } @@ -434,17 +434,17 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { ev.setSource(tabPane); tabPane.dispatchEvent(ev); - + ev.setSource(s); } int tabIndex = tabForCoordinate(tabPane, ev.getX(), ev.getY()); setRolloverTab(tabIndex); } - - /** Modifies the mouse event to originate from + + /** Modifies the mouse event to originate from * the tabbed pane and redispatches it. - * + * * @param me */ void redispatchEvent(MouseEvent me) @@ -455,10 +455,10 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants viewPos.y -= viewport.getY(); me.translatePoint(-viewPos.x, -viewPos.y); tabPane.dispatchEvent(me); - + me.translatePoint(viewPos.x, viewPos.y); } - + } /** @@ -483,18 +483,18 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants if (e.getPropertyName().equals("tabLayoutPolicy")) { currentScrollLocation = currentScrollOffset = 0; - + layoutManager = createLayoutManager(); - + tabPane.setLayout(layoutManager); } else if (e.getPropertyName().equals("tabPlacement") - && tabPane.getTabLayoutPolicy() + && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); - + // If the tab placement value was changed of a tabbed pane // in SCROLL_TAB_LAYOUT mode we investigate the change to // implement the following behavior which was observed in @@ -502,7 +502,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants // The scrolling offset will be reset if we change to // a direction which is orthogonal to the current // direction and stays the same if it is parallel. - + int oldPlacement = ((Integer) e.getOldValue()).intValue(); int newPlacement = ((Integer) e.getNewValue()).intValue(); switch (newPlacement) @@ -512,22 +512,22 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants if (oldPlacement == JTabbedPane.TOP || oldPlacement == JTabbedPane.BOTTOM) break out; - + currentScrollOffset = getTabAreaInsets(newPlacement).left; break; default: if (oldPlacement == JTabbedPane.LEFT || oldPlacement == JTabbedPane.RIGHT) break out; - + currentScrollOffset = getTabAreaInsets(newPlacement).top; } - + updateViewPosition(); updateButtons(); } } - + tabPane.revalidate(); tabPane.repaint(); } @@ -592,7 +592,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants c = tabPane.getComponentAt(i); if (c == null) continue; - dims = minimum ? c.getMinimumSize() : c.getPreferredSize(); + dims = minimum ? c.getMinimumSize() : c.getPreferredSize(); if (dims != null) { height = Math.max(height, dims.height); @@ -605,7 +605,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants || tabPlacement == SwingConstants.BOTTOM) { width = Math.max(calculateMaxTabWidth(tabPlacement), width); - + height += preferredTabAreaHeight(tabPlacement, width - tabAreaInsets.left - tabAreaInsets.right); @@ -613,7 +613,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants else { height = Math.max(calculateMaxTabHeight(tabPlacement), height); - + width += preferredTabAreaWidth(tabPlacement, height - tabAreaInsets.top - tabAreaInsets.bottom); @@ -648,7 +648,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants Insets insets = tabPane.getInsets(); Insets tabAreaInsets = getTabAreaInsets(tabPlacement); Dimension size = tabPane.getSize(); - + // The coordinates of the upper left corner of the tab area. int x; int y; @@ -787,11 +787,11 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants rotateTabRuns(tabPlacement, selectedRun); } } - + // Suppress padding if we have only one tab run. if (runCount == 1) return; - + // Pad the runs. int tabRunOverlay = getTabRunOverlay(tabPlacement); for (int i = runCount - 1; i >= 0; --i) @@ -838,7 +838,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants x -= maxTabWidth - tabRunOverlay; else x += maxTabWidth - tabRunOverlay; - + } } padSelectedTab(tabPlacement, selectedIndex); @@ -859,13 +859,13 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants Insets insets = tabPane.getInsets(); int selectedIndex = tabPane.getSelectedIndex(); - + Component selectedComponent = null; if (selectedIndex >= 0) selectedComponent = tabPane.getComponentAt(selectedIndex); // The RI doesn't seem to change the component if the new selected // component == null. This is probably so that applications can add - // one single component for every tab. + // one single component for every tab. if (selectedComponent != null) { setVisibleComponent(selectedComponent); @@ -892,7 +892,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants compX = insets.left + contentBorderInsets.left; compY = insets.top + contentBorderInsets.top; break; - case BOTTOM: + case BOTTOM: tabAreaHeight = calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); compX = insets.left + contentBorderInsets.left; @@ -902,7 +902,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants default: tabAreaHeight = calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); - + compX = insets.left + contentBorderInsets.left; compY = tabAreaHeight + insets.top + contentBorderInsets.top; } @@ -938,9 +938,9 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants // If there is more free space in an adjacent run AND the tab // in the run can fit in the adjacent run, move it. This method // is not perfect, it is merely an approximation. - // If you play around with Sun's JTabbedPane, you'll see that - // it does do some pretty strange things with regards to not moving tabs - // that should be moved. + // If you play around with Sun's JTabbedPane, you'll see that + // it does do some pretty strange things with regards to not moving tabs + // that should be moved. // start = the x position where the tabs will begin // max = the maximum position of where the tabs can go to // (tabAreaInsets.left + the width of the tab area) @@ -1046,7 +1046,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants int runWidth = rects[end].x + rects[end].width; int spaceRemaining = max - runWidth; int numTabs = end - start + 1; - + // now divvy up the space. int spaceAllocated = spaceRemaining / numTabs; int currX = rects[start].x; @@ -1054,13 +1054,13 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { rects[i].x = currX; rects[i].width += spaceAllocated; - + currX += rects[i].width; - // This is used because since the spaceAllocated + // This is used because since the spaceAllocated // variable is an int, it rounds down. Sometimes, // we don't fill an entire row, so we make it do // so now. - + if (i == end && rects[i].x + rects[i].width != max) rects[i].width = max - rects[i].x; } @@ -1332,11 +1332,11 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants for (int i = 0; i < tabCount; i++) { width = calculateTabWidth(tabPlacement, i, fm); - + // The proper instances should exists because // assureRectsCreated() was being run already. rects[i].setBounds(runWidth, top, width, maxHeight); - + runWidth += width; } tabAreaRect.width = tabPane.getWidth() - insets.left - insets.right; @@ -1396,7 +1396,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants tabAreaRect.x = contentRect.x + contentRect.width; } } - + // Unlike the behavior in the WRAP_TAB_LAYOUT the selected // tab is not padded specially. } @@ -1415,7 +1415,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants if (tabCount == 0) return; int tabPlacement = tabPane.getTabPlacement(); - + if (tabPlacement == SwingConstants.TOP || tabPlacement == SwingConstants.BOTTOM) { @@ -1452,11 +1452,11 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants - incrDims.height, incrDims.width, incrDims.height); } - + tabAreaRect.width -= decrDims.width + incrDims.width; - + updateButtons(); - + incrButton.setVisible(true); decrButton.setVisible(true); } @@ -1464,7 +1464,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { incrButton.setVisible(false); decrButton.setVisible(false); - + currentScrollOffset = 0; currentScrollLocation = 0; } @@ -1524,9 +1524,9 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants } viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width, tabAreaRect.height); - + updateViewPosition(); - + viewport.repaint(); } } @@ -1550,7 +1550,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { selectedRun = getRunForTab(tabPane.getTabCount(), tabPane.getSelectedIndex()); - + if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) tabPane.revalidate(); tabPane.repaint(); @@ -1587,7 +1587,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants else g.fillRect(0, currentScrollOffset, tabAreaRect.width, tabAreaRect.height); - + paintTabArea(g, placement, tabPane.getSelectedIndex()); } } @@ -1649,7 +1649,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants /** The starting visible tab in the run in SCROLL_TAB_MODE. * This is package-private to avoid an accessor method. */ transient int currentScrollLocation; - + transient int currentScrollOffset; /** A reusable rectangle. */ @@ -1789,13 +1789,13 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants * The currently visible component. */ private Component visibleComponent; - + private Color selectedColor; - + private Rectangle tempTextRect = new Rectangle(); - + private Rectangle tempIconRect = new Rectangle(); - + /** * Creates a new BasicTabbedPaneUI object. */ @@ -1884,10 +1884,10 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants Point p = new Point(w, h); return p; } - + /** TabbedPanes in scrolling mode should use this method to * scroll properly to the tab given by the index argument. - * + * * @param index The tab to scroll to. * @param placement The tab's placement. */ @@ -1902,7 +1902,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants switch (placement) { case JTabbedPane.TOP: - case JTabbedPane.BOTTOM: + case JTabbedPane.BOTTOM: if ((diff = rects[index].x + rects[index].width - decrButton.getX() - currentScrollOffset) > 0) @@ -1930,17 +1930,17 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants else currentScrollOffset += diff; } - + currentScrollLocation = tabForCoordinate(tabPane, rects[index].x, currentScrollOffset); } - + updateViewPosition(); updateButtons(); } } - + /** Sets the enabled state of the increase and decrease button * according to the current scrolling offset and tab pane width * (or height in TOP/BOTTOM placement). @@ -1948,7 +1948,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants final void updateButtons() { int tc = tabPane.getTabCount(); - + // The increase button should be enabled as long as the // right/bottom border of the last tab is under the left/top // border of the decrease button. @@ -1978,7 +1978,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants final void updateViewPosition() { Point p = viewport.getViewPosition(); - + // The unneeded coordinate must be set to zero // in order to correctly handle placement changes. switch (tabPane.getTabPlacement()) @@ -1992,10 +1992,10 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants p.x = currentScrollOffset; p.y = 0; } - + viewport.setViewPosition(p); } - + /** * This method creates a new BasicTabbedPaneUI. * @@ -2019,12 +2019,12 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants if (c instanceof JTabbedPane) { tabPane = (JTabbedPane) c; - + installComponents(); installDefaults(); installListeners(); installKeyboardActions(); - + layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); } @@ -2063,7 +2063,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { runCount = 1; tabRuns[0] = 0; - + incrButton = createIncreaseButton(); incrButton.addMouseListener(mouseListener); @@ -2075,16 +2075,16 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants panel.setSize(Integer.MAX_VALUE, Integer.MAX_VALUE); panel.addMouseListener(mouseListener); panel.addFocusListener(focusListener); - + viewport = new ScrollingViewport(); viewport.setBackground(Color.LIGHT_GRAY); viewport.setView(panel); viewport.setLayout(null); - + tabPane.add(incrButton); tabPane.add(decrButton); tabPane.add(viewport); - + return new TabbedPaneScrollLayout(); } } @@ -2104,7 +2104,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { if (incrButton != null) tabPane.remove(incrButton); - + if (decrButton != null) tabPane.remove(decrButton); @@ -2140,7 +2140,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants contentBorderInsets = UIManager.getInsets("TabbedPane.contentBorderInsets"); tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); - + // Although 'TabbedPane.contentAreaColor' is not defined in the defaults // of BasicLookAndFeel it is used by this class. selectedColor = UIManager.getColor("TabbedPane.contentAreaColor"); @@ -2162,7 +2162,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants tabAreaRect = null; contentRect = null; tabRuns = null; - + tempIconRect = null; tempTextRect = null; @@ -2176,7 +2176,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants shadow = null; lightHighlight = null; highlight = null; - + selectedColor = null; } @@ -2205,13 +2205,13 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants tabPane.removePropertyChangeListener(propertyChangeListener); tabPane.removeChangeListener(tabChangeListener); tabPane.removeMouseListener(mouseListener); - + if (incrButton != null) incrButton.removeMouseListener(mouseListener); - + if (decrButton != null) decrButton.removeMouseListener(mouseListener); - + if (panel != null) { panel.removeMouseListener(mouseListener); @@ -2277,7 +2277,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keyMap); - + ActionMap map = getActionMap(); SwingUtilities.replaceUIActionMap(tabPane, map); } @@ -2332,11 +2332,11 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants if (tabPane.getTabCount() == 0) return; - + int index = tabPane.getSelectedIndex(); if (index < 0) index = 0; - + int tabPlacement = tabPane.getTabPlacement(); // Paint the tab area only in WRAP_TAB_LAYOUT Mode from this method @@ -2349,7 +2349,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants tabAreaRect.width, tabAreaRect.height); paintTabArea(g, tabPlacement, index); } - + paintContentBorder(g, tabPlacement, index); } @@ -2363,9 +2363,9 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants */ protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { - // Please note: the ordering of the painting is important. + // Please note: the ordering of the painting is important. // we WANT to paint the outermost run first and then work our way in. - + // The following drawing code works for both tab layouts. int tabCount = tabPane.getTabCount(); @@ -2387,7 +2387,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants } } } - + // Paint selected tab in front of every other tab. if (selectedIndex >= 0) paintTab(g, tabPlacement, rects, selectedIndex, @@ -2430,10 +2430,10 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants // Paint the text. paintText(g, tabPlacement, tabPane.getFont(), fm, tabIndex, title, textRect, isSelected); - + // Paint icon if necessary. paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected); - + // Paint focus indicator. paintFocusIndicator(g, tabPlacement, rects, tabIndex, iconRect, textRect, isSelected); @@ -2675,7 +2675,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants w = rect.width - 6; h = rect.height - 5; } - + BasicGraphicsUtils.drawDashedRect(g, x, y, w, h); } } @@ -2707,44 +2707,44 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants g.setColor(darkShadow); // Outer right line. g.drawLine(x + w - 1, y + 2, x + w - 1, y + h); - + // Upper right corner. g.drawLine(x + w - 2, y + 1, x + w - 1, y + 2); - + g.setColor(lightHighlight); - + // Left line. g.drawLine(x, y + 3, x, y + h); - + // Upper line. g.drawLine(x + 3, y, x + w - 3, y); - + // Upper left corner. g.drawLine(x, y + 2, x + 2, y); - + break; case SwingConstants.LEFT: g.setColor(lightHighlight); // Top line. g.drawLine(x + 3, y, x + w - 1, y); - + // Top left border. g.drawLine(x + 2, y, x, y + 2); - + // Left line. g.drawLine(x, y + 3, x, y + h - 4); - + // Bottom left corner. g.drawLine(x, y + h - 3, x + 1, y + h - 2); - + g.setColor(darkShadow); // Outer bottom line. g.drawLine(x + 2, y + h - 1, x + w - 1, y + h - 1); - + g.setColor(shadow); // Inner bottom line. g.drawLine(x + 2, y + h - 2, x + w - 1, y + h - 2); - + break; case SwingConstants.BOTTOM: g.setColor(shadow); @@ -2757,17 +2757,17 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants g.setColor(darkShadow); // Outer right line. g.drawLine(x + w - 1, y, x + w - 1, y + h - 3); - + // Bottom right corner. g.drawLine(x + w - 1, y + h - 2, x + w - 3, y + h); - + // Bottom line. g.drawLine(x + 2, y + h, x + w - 4, y + h); - + g.setColor(lightHighlight); // Left line. g.drawLine(x, y, x, y + h - 3); - + // Bottom left corner. g.drawLine(x, y + h - 2, x + 1, y + h - 1); break; @@ -2775,31 +2775,31 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants g.setColor(lightHighlight); // Top line. g.drawLine(x, y, x + w - 3, y); - + g.setColor(darkShadow); // Top right corner. g.drawLine(x + w - 2, y + 1, x + w - 1, y + 2); - + // Outer right line. g.drawLine(x + w - 1, y + 3, x + w - 1, y + h - 3); - + // Bottom right corner. g.drawLine(x + w - 2, y + h - 2, x + w - 3, y + h - 1); - + // Bottom line. g.drawLine(x, y + h - 1, x + w - 4, y + h - 1); - + g.setColor(shadow); - + // Inner right line. g.drawLine(x + w - 2, y + 2, x + w - 2, y + h - 3); - + // Inner bottom line. g.drawLine(x, y + h - 2, x + w - 3, y + h - 2); - + break; } - + g.setColor(saved); } @@ -2820,7 +2820,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants boolean isSelected) { Color saved = g.getColor(); - + if (isSelected) g.setColor(selectedColor); else @@ -2931,17 +2931,17 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { g.drawLine(x, y, startgap, y); g.drawLine(endgap, y, x + w - 1, y); - + g.setColor(selectedColor); g.drawLine(startgap, y, endgap - 1, y); } else g.drawLine(x, y, x + w, y); - + g.setColor(selectedColor); g.drawLine(x, y + 1, x + w - 1, y + 1); g.drawLine(x, y + 2, x + w - 1, y + 2); - + g.setColor(saved); } @@ -2971,13 +2971,13 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { g.drawLine(x, y, x, startgap); g.drawLine(x, endgap, x, y + h - 1); - + g.setColor(selectedColor); g.drawLine(x, startgap, x, endgap - 1); } else g.drawLine(x, y, x, y + h - 1); - + g.setColor(selectedColor); g.drawLine(x + 1, y + 1, x + 1, y + h - 4); @@ -3014,7 +3014,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants g.setColor(darkShadow); g.drawLine(x, y + h - 1, startgap , y + h - 1); g.drawLine(endgap, y + h - 1, x + w - 1, y + h - 1); - + g.setColor(selectedColor); g.drawLine(startgap, y + h - 1, endgap - 1, y + h - 1); g.drawLine(startgap, y + h - 2, endgap - 1, y + h - 2); @@ -3026,7 +3026,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants g.setColor(darkShadow); g.drawLine(x, y + h - 1, x + w - 1, y + h - 1); } - + g.setColor(selectedColor); g.drawLine(x + 1, y + h - 3, x + w - 2, y + h - 3); @@ -3062,7 +3062,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants g.setColor(darkShadow); g.drawLine(x + w - 1, y, x + w - 1, startgap); g.drawLine(x + w - 1, endgap, x + w - 1, y + h - 2); - + g.setColor(selectedColor); g.drawLine(x + w - 2, startgap, x + w - 2, endgap - 1); g.drawLine(x + w - 1, startgap, x + w - 1, endgap - 1); @@ -3074,7 +3074,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants g.setColor(darkShadow); g.drawLine(x + w - 1, y, x + w - 1, y + h - 2); } - + g.setColor(selectedColor); g.drawLine(x + w - 3, y + 1, x + w - 3, y + h - 4); @@ -3085,10 +3085,10 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants * <p>This method returns the bounds of a tab for the given index * and shifts it by the current scrolling offset if the tabbed * pane is in scrolling tab layout mode.</p> - * + * * <p>Subclassses should retrievs a tab's bounds by this method * if they want to find out whether the tab is currently visible.</p> - * + * * @param pane The JTabbedPane. * @param i The index to look for. * @@ -3099,13 +3099,13 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants // Need to re-layout container if tab does not exist. if (i >= rects.length) layoutManager.layoutContainer(pane); - + // Properly shift coordinates if scrolling has taken // place. if (pane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Rectangle r = new Rectangle(rects[i]); - + switch(pane.getTabPlacement()) { case SwingConstants.TOP: @@ -3115,10 +3115,10 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants default: r.y -= currentScrollOffset; } - + return r; } - + return rects[i]; } @@ -3148,9 +3148,9 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants // Note: This code is tab layout mode agnostic. if (! tabPane.isValid()) tabPane.validate(); - + int tabCount = tabPane.getTabCount(); - + // If the user clicked outside of any tab rect the // selection should not change. int index = tabPane.getSelectedIndex(); @@ -3168,7 +3168,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants /** * <p>This method returns the tab bounds in the given rectangle.</p> - * + * * <p>The returned rectangle will be shifted by the current scroll * offset if the tabbed pane is in scrolling tab layout mode.</p>. * @@ -3652,7 +3652,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { current = getNextTabIndexInRun(tabPane.getTabCount(), current); - + if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) scrollTab(current, tabPane.getTabPlacement()); @@ -3668,7 +3668,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants { current = getPreviousTabIndexInRun(tabPane.getTabCount(), current); - + if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) scrollTab(current, tabPane.getTabPlacement()); @@ -3698,7 +3698,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants protected void selectPreviousTab(int current) { current = getPreviousTabIndex(current); - + if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) scrollTab(current, tabPane.getTabPlacement()); @@ -3825,10 +3825,10 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants int index = getNextTabIndex(base); int run = getRunForTab(tabCount, base); if (base == lastTabInRun(tabCount, run)) - index = (run > 0) + index = (run > 0) ? lastTabInRun(tabCount, getPreviousTabRun(run)) + 1 : 0; - + return index; } @@ -3847,7 +3847,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants int run = getRunForTab(tabCount, base); if (index == lastTabInRun(tabCount, getPreviousTabRun(run))) index = lastTabInRun(tabCount, run); - + return index; } @@ -3933,8 +3933,8 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants break; } } - - ActionMap getActionMap() + + ActionMap getActionMap() { ActionMap map = (ActionMap) UIManager.get("TabbedPane.actionMap"); @@ -3950,25 +3950,25 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants ActionMap createActionMap() { ActionMap map = new ActionMapUIResource(); - + map.put("navigatePageDown", new NavigatePageDownAction()); map.put("navigatePageUp", new NavigatePageUpAction()); map.put("navigateDown", new NavigateAction("navigateDown", SwingConstants.SOUTH)); - + map.put("navigateUp", new NavigateAction("navigateUp", SwingConstants.NORTH)); - + map.put("navigateLeft", new NavigateAction("navigateLeft", SwingConstants.WEST)); - + map.put("navigateRight", new NavigateAction("navigateRight", SwingConstants.EAST)); - + map.put("requestFocusForVisibleComponent", new RequestFocusForVisibleComponentAction()); map.put("requestFocus", new RequestFocusAction()); - + return map; } diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicTableHeaderUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicTableHeaderUI.java index 8a8eeb8..7ff234e 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicTableHeaderUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicTableHeaderUI.java @@ -71,28 +71,28 @@ public class BasicTableHeaderUI extends TableHeaderUI * where mouse cursor changes shape into "resize" */ static int COLUMN_BOUNDARY_TOLERANCE = 3; - + public static ComponentUI createUI(JComponent h) { return new BasicTableHeaderUI(); } - + /** * The table header that is using this interface. */ protected JTableHeader header; - + /** * The mouse input listener, responsible for mouse manipulations with * the table header. */ protected MouseInputListener mouseInputListener; - + /** * Paint the header cell. */ protected CellRendererPane rendererPane; - + /** * The header cell border. */ @@ -102,12 +102,12 @@ public class BasicTableHeaderUI extends TableHeaderUI * Original mouse cursor prior to resizing. */ private Cursor originalCursor; - + /** * If not null, one of the columns is currently being dragged. */ Rectangle draggingHeaderRect; - + /** * Handles column movement and rearrangement by mouse. The same instance works * both as mouse listener and the mouse motion listner. @@ -117,7 +117,7 @@ public class BasicTableHeaderUI extends TableHeaderUI { /** * If true, the cursor is being already shown in the alternative "resize" - * shape. + * shape. */ boolean showingResizeCursor; @@ -127,11 +127,11 @@ public class BasicTableHeaderUI extends TableHeaderUI * column dragging). */ int draggingFrom = - 1; - + /** * The number of the column being dragged. */ - int draggingColumnNumber; + int draggingColumnNumber; /** * The previous preferred width of the column. @@ -245,7 +245,7 @@ public class BasicTableHeaderUI extends TableHeaderUI if (onBoundary) { - originalCursor = header.getCursor(); + originalCursor = header.getCursor(); if (p < x) header.setCursor(Cursor.getPredefinedCursor( Cursor.W_RESIZE_CURSOR)); @@ -351,7 +351,7 @@ public class BasicTableHeaderUI extends TableHeaderUI /** * Stop the dragging session. - * + * * @param e the "mouse release" mouse event, needed to determing the final * location for the dragged column. */ @@ -365,11 +365,11 @@ public class BasicTableHeaderUI extends TableHeaderUI // Find where have we dragged the column. int x = e.getX(); int p = 0; - + int col = model.getColumnCount() - 1; int n = model.getColumnCount(); - // This loop does not find the column if the mouse if out of the + // This loop does not find the column if the mouse if out of the // right boundary of the table header. Then we make this column the // rightmost column. Scan: for (int i = 0; i < n; i++) @@ -385,17 +385,17 @@ public class BasicTableHeaderUI extends TableHeaderUI header.getTable().moveColumn(draggingColumnNumber, col); } } - + /** * Create and return the mouse input listener. - * + * * @return the mouse listener ({@link MouseInputHandler}, if not overridden. */ protected MouseInputListener createMouseInputListener() { return new MouseInputHandler(); } - + /** * Construct a new BasicTableHeaderUI, create mouse listeners. */ @@ -448,7 +448,7 @@ public class BasicTableHeaderUI extends TableHeaderUI { // AFAICS, the RI does nothing here. } - + /** * Remove the previously installed listeners. */ @@ -464,9 +464,9 @@ public class BasicTableHeaderUI extends TableHeaderUI uninstallKeyboardActions(); uninstallDefaults(); } - + /** - * Repaint the table header. + * Repaint the table header. */ public void paint(Graphics gfx, JComponent c) { @@ -474,7 +474,7 @@ public class BasicTableHeaderUI extends TableHeaderUI int ncols = cmod.getColumnCount(); if (ncols == 0) return; - + Rectangle clip = gfx.getClipBounds(); TableCellRenderer defaultRend = header.getDefaultRenderer(); @@ -505,38 +505,38 @@ public class BasicTableHeaderUI extends TableHeaderUI bounds.width, bounds.height); } } - + // This displays a running rectangle that is much simplier than the total // animation, as it is seen in Sun's application. // TODO animate the collumn dragging like in Sun's jre. if (draggingHeaderRect != null) { - gfx.setColor(header.getForeground()); + gfx.setColor(header.getForeground()); gfx.drawRect(draggingHeaderRect.x, draggingHeaderRect.y + 2, draggingHeaderRect.width - 1, draggingHeaderRect.height - 6); } } - + /** * Get the preferred header size. - * + * * @param ignored unused - * + * * @return the preferred size of the associated header. */ public Dimension getPreferredSize(JComponent ignored) { TableColumnModel cmod = header.getColumnModel(); TableCellRenderer defaultRend = header.getDefaultRenderer(); - int ncols = cmod.getColumnCount(); + int ncols = cmod.getColumnCount(); Dimension ret = new Dimension(0, 0); int spacing = 0; - if (header.getTable() != null + if (header.getTable() != null && header.getTable().getIntercellSpacing() != null) spacing = header.getTable().getIntercellSpacing().width; - - for (int i = 0; i < ncols; ++i) + + for (int i = 0; i < ncols; ++i) { TableColumn col = cmod.getColumn(i); TableCellRenderer rend = col.getHeaderRenderer(); @@ -556,11 +556,11 @@ public class BasicTableHeaderUI extends TableHeaderUI Dimension d = comp.getPreferredSize(); ret.width += spacing; - ret.height = Math.max(d.height, ret.height); + ret.height = Math.max(d.height, ret.height); } ret.width = cmod.getTotalColumnWidth(); return ret; } - - + + } diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java index a672173..f5a4bcb 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicTableUI.java @@ -82,15 +82,15 @@ import javax.swing.table.TableModel; public class BasicTableUI extends TableUI { - public static ComponentUI createUI(JComponent comp) + public static ComponentUI createUI(JComponent comp) { return new BasicTableUI(); } - protected FocusListener focusListener; - protected KeyListener keyListener; - protected MouseInputListener mouseInputListener; - protected CellRendererPane rendererPane; + protected FocusListener focusListener; + protected KeyListener keyListener; + protected MouseInputListener mouseInputListener; + protected CellRendererPane rendererPane; protected JTable table; /** The normal cell border. */ @@ -108,7 +108,7 @@ public class BasicTableUI extends TableUI * Handles key events for the JTable. Key events should be handled through * the InputMap/ActionMap mechanism since JDK1.3. This class is only there * for backwards compatibility. - * + * * @author Roman Kennke (kennke@aicas.com) */ public class KeyHandler implements KeyListener @@ -125,7 +125,7 @@ public class BasicTableUI extends TableUI { // Key events should be handled through the InputMap/ActionMap mechanism // since JDK1.3. This class is only there for backwards compatibility. - + // Editor activation is a specific kind of response to ''any'' // character key. Hence it is handled here. if (!table.isEditing() && table.isEnabled()) @@ -208,13 +208,13 @@ public class BasicTableUI extends TableUI ListSelectionModel rowModel = table.getSelectionModel(); if (lo_row != -1 && hi_row != -1) { - if (controlPressed && rowModel.getSelectionMode() + if (controlPressed && rowModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) rowModel.addSelectionInterval(lo_row, hi_row); else rowModel.setSelectionInterval(lo_row, hi_row); } - + // Update the columns int lo_col = table.columnAtPoint(begin); int hi_col = table.columnAtPoint(curr); @@ -222,14 +222,14 @@ public class BasicTableUI extends TableUI getSelectionModel(); if (lo_col != -1 && hi_col != -1) { - if (controlPressed && colModel.getSelectionMode() != + if (controlPressed && colModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) colModel.addSelectionInterval(lo_col, hi_col); else colModel.setSelectionInterval(lo_col, hi_col); } } - + /** * For the double click, start the cell editor. */ @@ -254,7 +254,7 @@ public class BasicTableUI extends TableUI } } - public void mouseDragged(MouseEvent e) + public void mouseDragged(MouseEvent e) { if (table.isEnabled()) { @@ -278,7 +278,7 @@ public class BasicTableUI extends TableUI // Nothing to do here. } - public void mousePressed(MouseEvent e) + public void mousePressed(MouseEvent e) { if (table.isEnabled()) { @@ -292,12 +292,12 @@ public class BasicTableUI extends TableUI //if control is pressed and the cell is already selected, deselect it if (e.isControlDown() && table.isCellSelected( table.rowAtPoint(begin), table.columnAtPoint(begin))) - { + { table.getSelectionModel(). - removeSelectionInterval(table.rowAtPoint(begin), + removeSelectionInterval(table.rowAtPoint(begin), table.rowAtPoint(begin)); table.getColumnModel().getSelectionModel(). - removeSelectionInterval(table.columnAtPoint(begin), + removeSelectionInterval(table.columnAtPoint(begin), table.columnAtPoint(begin)); } else @@ -314,7 +314,7 @@ public class BasicTableUI extends TableUI } } - public void mouseReleased(MouseEvent e) + public void mouseReleased(MouseEvent e) { if (table.isEnabled()) { @@ -374,12 +374,12 @@ public class BasicTableUI extends TableUI } } - protected FocusListener createFocusListener() + protected FocusListener createFocusListener() { return new FocusHandler(); } - protected MouseInputListener createMouseInputListener() + protected MouseInputListener createMouseInputListener() { return new MouseInputHandler(); } @@ -396,16 +396,16 @@ public class BasicTableUI extends TableUI } /** - * Return the maximum size of the table. The maximum height is the row - * height times the number of rows. The maximum width is the sum of + * Return the maximum size of the table. The maximum height is the row + * height times the number of rows. The maximum width is the sum of * the maximum widths of each column. - * + * * @param comp the component whose maximum size is being queried, * this is ignored. * @return a Dimension object representing the maximum size of the table, * or null if the table has no elements. */ - public Dimension getMaximumSize(JComponent comp) + public Dimension getMaximumSize(JComponent comp) { int maxTotalColumnWidth = 0; for (int i = 0; i < table.getColumnCount(); i++) @@ -415,16 +415,16 @@ public class BasicTableUI extends TableUI } /** - * Return the minimum size of the table. The minimum height is the row - * height times the number of rows. The minimum width is the sum of + * Return the minimum size of the table. The minimum height is the row + * height times the number of rows. The minimum width is the sum of * the minimum widths of each column. - * + * * @param comp the component whose minimum size is being queried, * this is ignored. * @return a Dimension object representing the minimum size of the table, * or null if the table has no elements. */ - public Dimension getMinimumSize(JComponent comp) + public Dimension getMinimumSize(JComponent comp) { int minTotalColumnWidth = 0; for (int i = 0; i < table.getColumnCount(); i++) @@ -440,7 +440,7 @@ public class BasicTableUI extends TableUI * * @return the preferred size for the table of that UI */ - public Dimension getPreferredSize(JComponent comp) + public Dimension getPreferredSize(JComponent comp) { int prefTotalColumnWidth = 0; TableColumnModel tcm = table.getColumnModel(); @@ -458,13 +458,13 @@ public class BasicTableUI extends TableUI * Returns the table height. This helper method is used by * {@link #getMinimumSize(JComponent)}, {@link #getPreferredSize(JComponent)} * and {@link #getMaximumSize(JComponent)} to determine the table height. - * + * * @return the table height */ private int getHeight() { int height = 0; - int rowCount = table.getRowCount(); + int rowCount = table.getRowCount(); if (rowCount > 0 && table.getColumnCount() > 0) { Rectangle r = table.getCellRect(rowCount - 1, 0, true); @@ -473,7 +473,7 @@ public class BasicTableUI extends TableUI return height; } - protected void installDefaults() + protected void installDefaults() { LookAndFeel.installColorsAndFont(table, "Table.background", "Table.foreground", "Table.font"); @@ -486,7 +486,7 @@ public class BasicTableUI extends TableUI /** * Installs keyboard actions on the table. */ - protected void installKeyboardActions() + protected void installKeyboardActions() { // Install the input map. InputMap inputMap = @@ -597,14 +597,14 @@ public class BasicTableUI extends TableUI { JTable table = (JTable) e.getSource(); - DefaultListSelectionModel rowModel + DefaultListSelectionModel rowModel = (DefaultListSelectionModel) table.getSelectionModel(); - DefaultListSelectionModel colModel + DefaultListSelectionModel colModel = (DefaultListSelectionModel) table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); int rowMax = table.getModel().getRowCount() - 1; - + int colLead = colModel.getLeadSelectionIndex(); int colMax = table.getModel().getColumnCount() - 1; @@ -626,7 +626,7 @@ public class BasicTableUI extends TableUI table.editCellAt(rowLead, colLead); } else if (command.equals("selectFirstRowExtendSelection")) - { + { rowModel.setLeadSelectionIndex(0); } else if (command.equals("selectFirstColumn")) @@ -636,7 +636,7 @@ public class BasicTableUI extends TableUI else if (command.equals("selectFirstColumnExtendSelection")) { colModel.setLeadSelectionIndex(0); - } + } else if (command.equals("selectLastRow")) { rowModel.setSelectionInterval(rowMax, rowMax); @@ -670,11 +670,11 @@ public class BasicTableUI extends TableUI { int target; if (rowLead == getFirstVisibleRowIndex(table)) - target = Math.max(0, rowLead - (getLastVisibleRowIndex(table) + target = Math.max(0, rowLead - (getLastVisibleRowIndex(table) - getFirstVisibleRowIndex(table) + 1)); else target = getFirstVisibleRowIndex(table); - + rowModel.setLeadSelectionIndex(target); colModel.setLeadSelectionIndex(colLead); } @@ -692,7 +692,7 @@ public class BasicTableUI extends TableUI - getFirstVisibleColumnIndex(table) + 1)); else target = getLastVisibleColumnIndex(table); - + colModel.setSelectionInterval(target, target); rowModel.setSelectionInterval(rowLead, rowLead); } @@ -705,11 +705,11 @@ public class BasicTableUI extends TableUI { int target; if (colLead == getFirstVisibleColumnIndex(table)) - target = Math.max(0, colLead - (getLastVisibleColumnIndex(table) + target = Math.max(0, colLead - (getLastVisibleColumnIndex(table) - getFirstVisibleColumnIndex(table) + 1)); else target = getFirstVisibleColumnIndex(table); - + colModel.setSelectionInterval(target, target); rowModel.setSelectionInterval(rowLead, rowLead); } @@ -731,71 +731,71 @@ public class BasicTableUI extends TableUI || command.equals("selectPreviousColumnCell")) { // If nothing is selected, select the first cell in the table - if (table.getSelectedRowCount() == 0 && + if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; } - + // If the lead selection index isn't selected (ie a remove operation // happened, then set the lead to the first selected cell in the // table if (!table.isCellSelected(rowLead, colLead)) { - rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), + rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); - colModel.addSelectionInterval(colModel.getMinSelectionIndex(), + colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; } - + // multRowsSelected and multColsSelected tell us if multiple rows or // columns are selected, respectively boolean multRowsSelected, multColsSelected; multRowsSelected = table.getSelectedRowCount() > 1 && table.getRowSelectionAllowed(); - + multColsSelected = table.getSelectedColumnCount() > 1 && table.getColumnSelectionAllowed(); - + // If there is just one selection, select the next cell, and wrap // when you get to the edges of the table. if (!multColsSelected && !multRowsSelected) { - if (command.indexOf("Column") != -1) - advanceSingleSelection(colModel, colMax, rowModel, rowMax, + if (command.indexOf("Column") != -1) + advanceSingleSelection(colModel, colMax, rowModel, rowMax, command.equals("selectPreviousColumnCell")); else - advanceSingleSelection(rowModel, rowMax, colModel, colMax, + advanceSingleSelection(rowModel, rowMax, colModel, colMax, command.equals("selectPreviousRowCell")); return; } - - + + // rowMinSelected and rowMaxSelected are the minimum and maximum // values respectively of selected cells in the row selection model // Similarly for colMinSelected and colMaxSelected. - int rowMaxSelected = table.getRowSelectionAllowed() ? + int rowMaxSelected = table.getRowSelectionAllowed() ? rowModel.getMaxSelectionIndex() : table.getModel().getRowCount() - 1; - int rowMinSelected = table.getRowSelectionAllowed() ? - rowModel.getMinSelectionIndex() : 0; - int colMaxSelected = table.getColumnSelectionAllowed() ? - colModel.getMaxSelectionIndex() : + int rowMinSelected = table.getRowSelectionAllowed() ? + rowModel.getMinSelectionIndex() : 0; + int colMaxSelected = table.getColumnSelectionAllowed() ? + colModel.getMaxSelectionIndex() : table.getModel().getColumnCount() - 1; - int colMinSelected = table.getColumnSelectionAllowed() ? + int colMinSelected = table.getColumnSelectionAllowed() ? colModel.getMinSelectionIndex() : 0; - + // If there are multiple rows and columns selected, select the next - // cell and wrap at the edges of the selection. - if (command.indexOf("Column") != -1) + // cell and wrap at the edges of the selection. + if (command.indexOf("Column") != -1) advanceMultipleSelection(table, colModel, colMinSelected, colMaxSelected, rowModel, rowMinSelected, rowMaxSelected, command.equals("selectPreviousColumnCell"), true); - + else advanceMultipleSelection(table, rowModel, rowMinSelected, rowMaxSelected, colModel, colMinSelected, @@ -812,11 +812,11 @@ public class BasicTableUI extends TableUI { int target; if (colLead == getFirstVisibleColumnIndex(table)) - target = Math.max(0, colLead - (getLastVisibleColumnIndex(table) + target = Math.max(0, colLead - (getLastVisibleColumnIndex(table) - getFirstVisibleColumnIndex(table) + 1)); else target = getFirstVisibleColumnIndex(table); - + colModel.setLeadSelectionIndex(target); rowModel.setLeadSelectionIndex(rowLead); } @@ -828,7 +828,7 @@ public class BasicTableUI extends TableUI - getFirstVisibleRowIndex(table) + 1)); else target = getLastVisibleRowIndex(table); - + rowModel.setSelectionInterval(target, target); colModel.setSelectionInterval(colLead, colLead); } @@ -836,11 +836,11 @@ public class BasicTableUI extends TableUI { int target; if (colLead == getLastVisibleColumnIndex(table)) - target = Math.min(colMax, colLead + (getLastVisibleColumnIndex(table) + target = Math.min(colMax, colLead + (getLastVisibleColumnIndex(table) - getFirstVisibleColumnIndex(table) + 1)); else target = getLastVisibleColumnIndex(table); - + colModel.setLeadSelectionIndex(target); rowModel.setLeadSelectionIndex(rowLead); } @@ -857,29 +857,29 @@ public class BasicTableUI extends TableUI { int target; if (rowLead == getLastVisibleRowIndex(table)) - target = Math.min(rowMax, rowLead + (getLastVisibleRowIndex(table) + target = Math.min(rowMax, rowLead + (getLastVisibleRowIndex(table) - getFirstVisibleRowIndex(table) + 1)); else target = getLastVisibleRowIndex(table); - + rowModel.setLeadSelectionIndex(target); colModel.setLeadSelectionIndex(colLead); - } + } else if (command.equals("scrollUpChangeSelection")) { int target; if (rowLead == getFirstVisibleRowIndex(table)) - target = Math.max(0, rowLead - (getLastVisibleRowIndex(table) + target = Math.max(0, rowLead - (getLastVisibleRowIndex(table) - getFirstVisibleRowIndex(table) + 1)); else target = getFirstVisibleRowIndex(table); - + rowModel.setSelectionInterval(target, target); colModel.setSelectionInterval(colLead, colLead); } else if (command.equals("selectNextRowChangeLead")) { - if (rowModel.getSelectionMode() + if (rowModel.getSelectionMode() != ListSelectionModel.MULTIPLE_INTERVAL_SELECTION) { // just "selectNextRow" @@ -892,7 +892,7 @@ public class BasicTableUI extends TableUI } else if (command.equals("selectPreviousRowChangeLead")) { - if (rowModel.getSelectionMode() + if (rowModel.getSelectionMode() != ListSelectionModel.MULTIPLE_INTERVAL_SELECTION) { // just selectPreviousRow @@ -905,8 +905,8 @@ public class BasicTableUI extends TableUI } else if (command.equals("selectNextColumnChangeLead")) { - if (colModel.getSelectionMode() - != ListSelectionModel.MULTIPLE_INTERVAL_SELECTION) + if (colModel.getSelectionMode() + != ListSelectionModel.MULTIPLE_INTERVAL_SELECTION) { // just selectNextColumn rowModel.setSelectionInterval(rowLead, rowLead); @@ -918,14 +918,14 @@ public class BasicTableUI extends TableUI } else if (command.equals("selectPreviousColumnChangeLead")) { - if (colModel.getSelectionMode() - != ListSelectionModel.MULTIPLE_INTERVAL_SELECTION) + if (colModel.getSelectionMode() + != ListSelectionModel.MULTIPLE_INTERVAL_SELECTION) { // just selectPreviousColumn rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(Math.max(colLead - 1, 0), Math.max(colLead - 1, 0)); - + } else colModel.moveLeadSelectionIndex(Math.max(colLead - 1, 0)); @@ -955,12 +955,12 @@ public class BasicTableUI extends TableUI rowModel.removeSelectionInterval(rowLead, rowLead); else rowModel.addSelectionInterval(rowLead, rowLead); - + if (colModel.isSelectedIndex(colLead)) colModel.removeSelectionInterval(colLead, colLead); else colModel.addSelectionInterval(colLead, colLead); - + rowModel.setAnchorSelectionIndex(rowLead); colModel.setAnchorSelectionIndex(colLead); } @@ -968,31 +968,31 @@ public class BasicTableUI extends TableUI { table.editingStopped(new ChangeEvent(command)); } - else + else { // If we're here that means we bound this TableAction class // to a keyboard input but we either want to ignore that input // or we just haven't implemented its action yet. - + // Uncomment the following line to print the names of unused bindings // when their keys are pressed - + // System.out.println ("not implemented: "+e.getActionCommand()); } // Any commands whose keyStrokes should be used by the Editor should not - // cause editing to be stopped: ie, the SPACE sends "addToSelection" but + // cause editing to be stopped: ie, the SPACE sends "addToSelection" but // if the table is in editing mode, the space should not cause us to stop // editing because it should be used by the Editor. if (table.isEditing() && command != "startEditing" && command != "addToSelection") table.editingStopped(new ChangeEvent("update")); - + table.scrollRectToVisible(table.getCellRect( - rowModel.getLeadSelectionIndex(), colModel.getLeadSelectionIndex(), + rowModel.getLeadSelectionIndex(), colModel.getLeadSelectionIndex(), false)); } - + /** * Returns the column index of the first visible column. * @return the column index of the first visible column. @@ -1005,7 +1005,7 @@ public class BasicTableUI extends TableUI r.translate((int) r.getWidth() - 1, 0); return table.columnAtPoint(r.getLocation()); } - + /** * Returns the column index of the last visible column. * @@ -1016,9 +1016,9 @@ public class BasicTableUI extends TableUI Rectangle r = table.getVisibleRect(); if (or.isLeftToRight()) r.translate((int) r.getWidth() - 1, 0); - return table.columnAtPoint(r.getLocation()); + return table.columnAtPoint(r.getLocation()); } - + /** * Returns the row index of the first visible row. * @@ -1031,7 +1031,7 @@ public class BasicTableUI extends TableUI r.translate((int) r.getWidth() - 1, 0); return table.rowAtPoint(r.getLocation()); } - + /** * Returns the row index of the last visible row. * @@ -1067,7 +1067,7 @@ public class BasicTableUI extends TableUI * rows (ENTER) * @param firstMin the first selected index in firstModel * @param firstMax the last selected index in firstModel - * @param secondModel the ListSelectionModel for rows (TAB) or + * @param secondModel the ListSelectionModel for rows (TAB) or * columns (ENTER) * @param secondMin the first selected index in secondModel * @param secondMax the last selected index in secondModel @@ -1076,41 +1076,41 @@ public class BasicTableUI extends TableUI */ void advanceMultipleSelection(JTable table, ListSelectionModel firstModel, int firstMin, - int firstMax, ListSelectionModel secondModel, + int firstMax, ListSelectionModel secondModel, int secondMin, int secondMax, boolean reverse, boolean eventIsTab) { - // If eventIsTab, all the "firsts" correspond to columns, otherwise, to + // If eventIsTab, all the "firsts" correspond to columns, otherwise, to // rows "seconds" correspond to the opposite int firstLead = firstModel.getLeadSelectionIndex(); int secondLead = secondModel.getLeadSelectionIndex(); - int numFirsts = eventIsTab ? + int numFirsts = eventIsTab ? table.getModel().getColumnCount() : table.getModel().getRowCount(); - int numSeconds = eventIsTab ? + int numSeconds = eventIsTab ? table.getModel().getRowCount() : table.getModel().getColumnCount(); // check if we have to wrap the "firsts" around, going to the other side - if ((firstLead == firstMax && !reverse) || + if ((firstLead == firstMax && !reverse) || (reverse && firstLead == firstMin)) { - firstModel.addSelectionInterval(reverse ? firstMax : firstMin, + firstModel.addSelectionInterval(reverse ? firstMax : firstMin, reverse ? firstMax : firstMin); - + // check if we have to wrap the "seconds" - if ((secondLead == secondMax && !reverse) || + if ((secondLead == secondMax && !reverse) || (reverse && secondLead == secondMin)) - secondModel.addSelectionInterval(reverse ? secondMax : secondMin, + secondModel.addSelectionInterval(reverse ? secondMax : secondMin, reverse ? secondMax : secondMin); // if we're not wrapping the seconds, we have to find out where we - // are within the secondModel and advance to the next cell (or + // are within the secondModel and advance to the next cell (or // go back to the previous cell if reverse == true) else { int[] secondsSelected; - if (eventIsTab && table.getRowSelectionAllowed() || + if (eventIsTab && table.getRowSelectionAllowed() || !eventIsTab && table.getColumnSelectionAllowed()) - secondsSelected = eventIsTab ? + secondsSelected = eventIsTab ? table.getSelectedRows() : table.getSelectedColumns(); else { @@ -1129,9 +1129,9 @@ public class BasicTableUI extends TableUI else while (secondsSelected[secondIndex] >= secondLead) secondIndex--; - + // and select it - updating the lead selection index - secondModel.addSelectionInterval(secondsSelected[secondIndex], + secondModel.addSelectionInterval(secondsSelected[secondIndex], secondsSelected[secondIndex]); } } @@ -1140,9 +1140,9 @@ public class BasicTableUI extends TableUI else { int[] firstsSelected; - if (eventIsTab && table.getColumnSelectionAllowed() || + if (eventIsTab && table.getColumnSelectionAllowed() || !eventIsTab && table.getRowSelectionAllowed()) - firstsSelected = eventIsTab ? + firstsSelected = eventIsTab ? table.getSelectedColumns() : table.getSelectedRows(); else { @@ -1155,16 +1155,16 @@ public class BasicTableUI extends TableUI if (!reverse) while (firstsSelected[firstIndex] <= firstLead) firstIndex++; - else + else while (firstsSelected[firstIndex] >= firstLead) firstIndex--; - firstModel.addSelectionInterval(firstsSelected[firstIndex], + firstModel.addSelectionInterval(firstsSelected[firstIndex], firstsSelected[firstIndex]); secondModel.addSelectionInterval(secondLead, secondLead); } } - - /** + + /** * A helper method for the key bindings. Used because the actions * for TAB, SHIFT-TAB, ENTER, and SHIFT-ENTER are very similar. * @@ -1180,15 +1180,15 @@ public class BasicTableUI extends TableUI * @param reverse true if SHIFT was pressed for the event */ - void advanceSingleSelection(ListSelectionModel firstModel, int firstMax, - ListSelectionModel secondModel, int secondMax, + void advanceSingleSelection(ListSelectionModel firstModel, int firstMax, + ListSelectionModel secondModel, int secondMax, boolean reverse) { // for TABs, "first" corresponds to columns and "seconds" to rows. // the opposite is true for ENTERs int firstLead = firstModel.getLeadSelectionIndex(); int secondLead = secondModel.getLeadSelectionIndex(); - + // if we are going backwards subtract 2 because we later add 1 // for a net change of -1 if (reverse && (firstLead == 0)) @@ -1198,15 +1198,15 @@ public class BasicTableUI extends TableUI secondLead += secondMax + 1; secondLead -= 2; } - + // do we have to wrap the "seconds"? if (reverse && (firstLead == 0) || !reverse && (firstLead == firstMax)) - secondModel.setSelectionInterval((secondLead + 1) % (secondMax + 1), + secondModel.setSelectionInterval((secondLead + 1) % (secondMax + 1), (secondLead + 1) % (secondMax + 1)); // if not, just reselect the current lead else secondModel.setSelectionInterval(secondLead, secondLead); - + // if we are going backwards, subtract 2 because we add 1 later // for net change of -1 if (reverse) @@ -1217,12 +1217,12 @@ public class BasicTableUI extends TableUI firstLead -= 2; } // select the next "first" - firstModel.setSelectionInterval((firstLead + 1) % (firstMax + 1), + firstModel.setSelectionInterval((firstLead + 1) % (firstMax + 1), (firstLead + 1) % (firstMax + 1)); } } - protected void installListeners() + protected void installListeners() { if (focusListener == null) focusListener = createFocusListener(); @@ -1232,7 +1232,7 @@ public class BasicTableUI extends TableUI table.addKeyListener(keyListener); if (mouseInputListener == null) mouseInputListener = createMouseInputListener(); - table.addMouseListener(mouseInputListener); + table.addMouseListener(mouseInputListener); table.addMouseMotionListener(mouseInputListener); if (propertyChangeListener == null) propertyChangeListener = new PropertyChangeHandler(); @@ -1259,17 +1259,17 @@ public class BasicTableUI extends TableUI SwingUtilities.replaceUIActionMap(table, null); } - protected void uninstallListeners() + protected void uninstallListeners() { - table.removeFocusListener(focusListener); + table.removeFocusListener(focusListener); table.removeKeyListener(keyListener); - table.removeMouseListener(mouseInputListener); + table.removeMouseListener(mouseInputListener); table.removeMouseMotionListener(mouseInputListener); table.removePropertyChangeListener(propertyChangeListener); propertyChangeListener = null; } - public void installUI(JComponent comp) + public void installUI(JComponent comp) { table = (JTable) comp; rendererPane = new CellRendererPane(); @@ -1280,11 +1280,11 @@ public class BasicTableUI extends TableUI installListeners(); } - public void uninstallUI(JComponent c) + public void uninstallUI(JComponent c) { uninstallListeners(); uninstallKeyboardActions(); - uninstallDefaults(); + uninstallDefaults(); table.remove(rendererPane); rendererPane = null; @@ -1308,11 +1308,11 @@ public class BasicTableUI extends TableUI Component comp = table.prepareRenderer(rend, row, col); rendererPane.paintComponent(g, comp, table, bounds); } - + /** * Paint the associated table. */ - public void paint(Graphics gfx, JComponent ignored) + public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); @@ -1346,19 +1346,19 @@ public class BasicTableUI extends TableUI { widths[i] = cmodel.getColumn(i).getWidth() - columnMargin; } - + Rectangle bounds = table.getCellRect(r0, c0, false); // The left boundary of the area being repainted. int left = bounds.x; - + // The top boundary of the area being repainted. int top = bounds.y; - + // The bottom boundary of the area being repainted. int bottom; - + // paint the cell contents - Color grid = table.getGridColor(); + Color grid = table.getGridColor(); for (int r = r0; r <= rn; ++r) { for (int c = c0; c <= cn; ++c) @@ -1372,18 +1372,18 @@ public class BasicTableUI extends TableUI // Update row height for tables with custom heights. bounds.height = table.getRowHeight(r + 1) - rowMargin; } - + bottom = bounds.y - rowMargin; // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) - { + { Color save = gfx.getColor(); gfx.setColor(grid); int x = left - columnMargin; for (int c = c0; c <= cn; ++c) { - // The vertical grid is draw right from the cells, so we + // The vertical grid is draw right from the cells, so we // add before drawing. x += widths[c] + columnMargin; gfx.drawLine(x, top, x, bottom); @@ -1391,15 +1391,15 @@ public class BasicTableUI extends TableUI gfx.setColor(save); } - // paint horizontal grid lines + // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) - { + { Color save = gfx.getColor(); gfx.setColor(grid); int y = top - rowMargin; for (int r = r0; r <= rn; ++r) { - // The horizontal grid is draw below the cells, so we + // The horizontal grid is draw below the cells, so we // add before drawing. y += table.getRowHeight(r); gfx.drawLine(left, y, p2.x, y); diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicTextAreaUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicTextAreaUI.java index 3f5aa27..b2541b4 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicTextAreaUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicTextAreaUI.java @@ -1,4 +1,4 @@ -/* BasicTextAreaUI.java -- +/* BasicTextAreaUI.java -- Copyright (C) 2004, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -65,9 +65,9 @@ public class BasicTextAreaUI extends BasicTextUI /** * Create the view. Returns a WrappedPlainView if the text area * has lineWrap set to true, otherwise returns a PlainView. If - * lineWrap is true has to check whether the wrap style is word + * lineWrap is true has to check whether the wrap style is word * or character and return an appropriate WrappedPlainView. - * + * * @param elem the element to create a View for * @return an appropriate View for the element */ @@ -94,11 +94,11 @@ public class BasicTextAreaUI extends BasicTextUI { return "TextArea"; } - + /** * Receives notification whenever one of the text component's bound * properties changes. This changes the view to WrappedPlainView - * if setLineWrap(true) is called, and back to PlainView if + * if setLineWrap(true) is called, and back to PlainView if * setLineWrap(false) is called. * * @param ev the property change event diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicTextFieldUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicTextFieldUI.java index 6792aa0..5f6a927 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicTextFieldUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicTextFieldUI.java @@ -60,7 +60,7 @@ public class BasicTextFieldUI extends BasicTextUI { return new FieldView(elem); } - + public static ComponentUI createUI(JComponent c) { return new BasicTextFieldUI(); @@ -85,7 +85,7 @@ public class BasicTextFieldUI extends BasicTextUI * Receives notification whenever one of the text component's bound * properties changes. Here we check for the editable and enabled * properties and adjust the background color accordingly. - * + * * <p>The colors are only changed if they are not a * <code>ColorUIResource</code>.</p> * diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicTextPaneUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicTextPaneUI.java index a988c5a6..507e0a1 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicTextPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicTextPaneUI.java @@ -1,4 +1,4 @@ -/* BasicTextPaneUI.java -- +/* BasicTextPaneUI.java -- Copyright (C) 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicTextUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicTextUI.java index e152a30..bd7cc48 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicTextUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicTextUI.java @@ -126,7 +126,7 @@ public abstract class BasicTextUI extends TextUI private static class FocusHandler implements FocusListener { - public void focusGained(FocusEvent e) + public void focusGained(FocusEvent e) { // Nothing to do here. } @@ -147,7 +147,7 @@ public abstract class BasicTextUI extends TextUI { if (sm != null) sm.checkSystemClipboardAccess(); - + Clipboard cb = Toolkit.getDefaultToolkit().getSystemSelection(); if (cb != null) { @@ -291,7 +291,7 @@ public abstract class BasicTextUI extends TextUI EditorKit editorKit = BasicTextUI.this.getEditorKit(getComponent()); factory = editorKit.getViewFactory(); if (factory == null) - factory = BasicTextUI.this; + factory = BasicTextUI.this; return factory; } @@ -317,7 +317,7 @@ public abstract class BasicTextUI extends TextUI { if (view != null) view.setParent(null); - + if (v != null) v.setParent(this); @@ -718,7 +718,7 @@ public abstract class BasicTextUI extends TextUI if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix + ".selectionBackground"); - textComponent.setSelectionColor(color); + textComponent.setSelectionColor(color); } Insets margin = textComponent.getMargin(); @@ -756,7 +756,7 @@ public abstract class BasicTextUI extends TextUI */ protected void installListeners() { - // + // if (SystemProperties.getProperty("gnu.swing.text.no-xlike-clipboard") == null) { @@ -768,11 +768,11 @@ public abstract class BasicTextUI extends TextUI /** * Returns the name of the keymap for this type of TextUI. - * + * * This is implemented so that the classname of this TextUI * without the package prefix is returned. This way subclasses * don't have to override this method. - * + * * @return the name of the keymap for this TextUI */ protected String getKeymapName() @@ -822,10 +822,10 @@ public abstract class BasicTextUI extends TextUI getInputMap()); SwingUtilities.replaceUIActionMap(textComponent, getActionMap()); } - + /** * Creates an ActionMap to be installed on the text component. - * + * * @return an ActionMap to be installed on the text component */ private ActionMap getActionMap() @@ -963,7 +963,7 @@ public abstract class BasicTextUI extends TextUI */ protected void uninstallKeyboardActions() { - SwingUtilities.replaceUIInputMap(textComponent, JComponent.WHEN_FOCUSED, + SwingUtilities.replaceUIInputMap(textComponent, JComponent.WHEN_FOCUSED, null); SwingUtilities.replaceUIActionMap(textComponent, null); } @@ -1150,7 +1150,7 @@ public abstract class BasicTextUI extends TextUI highlighter.paint(g); g.setColor(oldColor); } - + rootView.paint(g, getVisibleEditorRect()); if (caret != null && textComponent.hasFocus()) @@ -1482,11 +1482,11 @@ public abstract class BasicTextUI extends TextUI // Return null if the component has no valid size. if (width <= 0 || height <= 0) return null; - + Insets insets = textComponent.getInsets(cachedInsets); return new Rectangle(insets.left, insets.top, - width - insets.left - insets.right, - height - insets.top - insets.bottom); + width - insets.left - insets.right, + height - insets.top - insets.bottom); } /** @@ -1507,10 +1507,10 @@ public abstract class BasicTextUI extends TextUI */ protected void modelChanged() { - if (textComponent == null || rootView == null) + if (textComponent == null || rootView == null) return; ViewFactory factory = rootView.getViewFactory(); - if (factory == null) + if (factory == null) return; Document doc = textComponent.getDocument(); if (doc == null) diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicToggleButtonUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicToggleButtonUI.java index 9216486..4550f08 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicToggleButtonUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicToggleButtonUI.java @@ -54,22 +54,22 @@ import javax.swing.plaf.ComponentUI; */ public class BasicToggleButtonUI extends BasicButtonUI { - + /** * Returns a UI delegate for the specified component. - * - * @param component the component (should be an instance of + * + * @param component the component (should be an instance of * {@link JToggleButton}). - * + * * @return An instance of <code>BasicToggleButtonUI</code>. */ public static ComponentUI createUI(JComponent component) { return new BasicToggleButtonUI(); - } + } /** - * Returns the prefix for entries in the {@link UIManager} defaults table + * Returns the prefix for entries in the {@link UIManager} defaults table * (<code>"ToggleButton."</code> in this case). * * @return <code>"ToggleButton."</code> @@ -80,14 +80,14 @@ public class BasicToggleButtonUI extends BasicButtonUI } /** - * Paint the component, which is an {@link AbstractButton}, according to + * Paint the component, which is an {@link AbstractButton}, according to * its current state. * * @param g The graphics context to paint with * @param c The component to paint the state of */ public void paint(Graphics g, JComponent c) - { + { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); @@ -102,13 +102,13 @@ public class BasicToggleButtonUI extends BasicButtonUI SwingUtilities.calculateInnerArea(b, vr); else vr = SwingUtilities.getLocalBounds(b); - String text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f), - b.getText(), currentIcon(b), b.getVerticalAlignment(), - b.getHorizontalAlignment(), b.getVerticalTextPosition(), - b.getHorizontalTextPosition(), vr, ir, tr, b.getIconTextGap() + String text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f), + b.getText(), currentIcon(b), b.getVerticalAlignment(), + b.getHorizontalAlignment(), b.getVerticalTextPosition(), + b.getHorizontalTextPosition(), vr, ir, tr, b.getIconTextGap() + defaultTextShiftOffset); - if ((b.getModel().isArmed() && b.getModel().isPressed()) + if ((b.getModel().isArmed() && b.getModel().isPressed()) || b.isSelected()) paintButtonPressed(g, b); diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java index 7be69ec..f5b2b2d 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java @@ -345,7 +345,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants protected Border createNonRolloverBorder() { Border b = UIManager.getBorder("ToolBar.nonrolloverBorder"); - + if (b == null) { b = new CompoundBorder( @@ -355,7 +355,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants UIManager.getColor("Button.highlight")), BasicBorders.getMarginBorder()); } - + return b; } /** @@ -377,7 +377,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants protected Border createRolloverBorder() { Border b = UIManager.getBorder("ToolBar.rolloverBorder"); - + if (b == null) { b = new CompoundBorder( @@ -387,7 +387,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants UIManager.getColor("Button.highlight")), BasicBorders.getMarginBorder()); } - + return b; } @@ -438,13 +438,13 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants if (loc != -1) { - dragWindow.setBorderColor(dockingBorderColor); - dragWindow.setBackground(dockingColor); + dragWindow.setBorderColor(dockingBorderColor); + dragWindow.setBackground(dockingColor); } else { - dragWindow.setBorderColor(floatingBorderColor); - dragWindow.setBackground(floatingColor); + dragWindow.setBorderColor(floatingBorderColor); + dragWindow.setBackground(floatingColor); } int w = 0; @@ -458,13 +458,13 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants if (((cachedOrientation == SwingConstants.HORIZONTAL) && tmp) || ((cachedOrientation == VERTICAL) && ! tmp)) { - w = cachedBounds.width; - h = cachedBounds.height; + w = cachedBounds.width; + h = cachedBounds.height; } else { - w = cachedBounds.height; - h = cachedBounds.width; + w = cachedBounds.height; + h = cachedBounds.width; } Point p = dragWindow.getOffset(); @@ -507,28 +507,28 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants newParent = ((RootPaneContainer) floatFrame).getContentPane(); else { - floatFrame.hide(); - newParent = origParent; + floatFrame.hide(); + newParent = origParent; } String constraint; switch (aoc) { case SwingConstants.EAST: - constraint = BorderLayout.EAST; - break; + constraint = BorderLayout.EAST; + break; case SwingConstants.NORTH: - constraint = BorderLayout.NORTH; - break; + constraint = BorderLayout.NORTH; + break; case SwingConstants.SOUTH: - constraint = BorderLayout.SOUTH; - break; + constraint = BorderLayout.SOUTH; + break; case SwingConstants.WEST: - constraint = BorderLayout.WEST; - break; + constraint = BorderLayout.WEST; + break; default: - constraint = BorderLayout.CENTER; - break; + constraint = BorderLayout.CENTER; + break; } int newOrientation = SwingConstants.HORIZONTAL; @@ -538,8 +538,8 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants if (aoc != -1) { - constraintBeforeFloating = constraint; - lastGoodOrientation = newOrientation; + constraintBeforeFloating = constraint; + lastGoodOrientation = newOrientation; } newParent.add(toolBar, constraint); @@ -557,10 +557,10 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants if (aoc == -1) { - floatFrame.pack(); - floatFrame.setSize(dims.width + insets.left + insets.right, - dims.height + insets.top + insets.bottom); - floatFrame.show(); + floatFrame.pack(); + floatFrame.setSize(dims.width + insets.left + insets.right, + dims.height + insets.top + insets.bottom); + floatFrame.show(); } newParent.invalidate(); @@ -776,14 +776,14 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants for (int i = 0; i < c.length; i++) { - if (c[i] instanceof JButton) - { - // Don't really care about anything other than JButtons - JButton b = (JButton) c[i]; - - if (b.getBorder() != null) - borders.put(b, b.getBorder()); - } + if (c[i] instanceof JButton) + { + // Don't really care about anything other than JButtons + JButton b = (JButton) c[i]; + + if (b.getBorder() != null) + borders.put(b, b.getBorder()); + } } } @@ -798,11 +798,11 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants if (c instanceof JToolBar) { - toolBar = (JToolBar) c; + toolBar = (JToolBar) c; installDefaults(); installComponents(); - installListeners(); - installKeyboardActions(); + installListeners(); + installKeyboardActions(); } } @@ -894,14 +894,14 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants { if (c instanceof AbstractButton) { - AbstractButton b = (AbstractButton) c; - b.setRolloverEnabled(false); + AbstractButton b = (AbstractButton) c; + b.setRolloverEnabled(false); // Save old border in hashtable. - if (b.getBorder() != null) + if (b.getBorder() != null) borders.put(b, b.getBorder()); - - b.setBorder(nonRolloverBorder); + + b.setBorder(nonRolloverBorder); } } @@ -931,11 +931,11 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants { AbstractButton b = (AbstractButton) c; b.setRolloverEnabled(false); - + // Save old border in hashtable. if (b.getBorder() != null) - borders.put(b, b.getBorder()); - + borders.put(b, b.getBorder()); + b.setBorder(rolloverBorder); } } @@ -1139,7 +1139,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants public void mouseDragged(MouseEvent e) { if (isDragging) - dragTo(e.getPoint(), origin); + dragTo(e.getPoint(), origin); } /** @@ -1182,7 +1182,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants public void mousePressed(MouseEvent e) { if (! toolBar.isFloatable()) - return; + return; Point ssd = e.getPoint(); Insets insets = toolBar.getInsets(); @@ -1190,13 +1190,13 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants // Verify that this click occurs in the top inset. if (toolBar.getOrientation() == SwingConstants.HORIZONTAL) { - if (e.getX() > insets.left) - return; + if (e.getX() > insets.left) + return; } else { - if (e.getY() > insets.top) - return; + if (e.getY() > insets.top) + return; } origin = new Point(0, 0); @@ -1204,16 +1204,16 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants SwingUtilities.convertPointToScreen(ssd, toolBar); if (! (SwingUtilities.getAncestorOfClass(Window.class, toolBar) instanceof UIResource)) - // Need to know who keeps the toolBar if it gets dragged back into it. - origParent = toolBar.getParent(); - + // Need to know who keeps the toolBar if it gets dragged back into it. + origParent = toolBar.getParent(); + if (toolBar.isShowing()) SwingUtilities.convertPointToScreen(origin, toolBar); isDragging = true; if (dragWindow != null) - dragWindow.setOffset(new Point(cachedBounds.width / 2, + dragWindow.setOffset(new Point(cachedBounds.width / 2, cachedBounds.height / 2)); dragTo(e.getPoint(), origin); @@ -1227,7 +1227,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants public void mouseReleased(MouseEvent e) { if (! isDragging || ! toolBar.isFloatable()) - return; + return; isDragging = false; floatAt(e.getPoint(), origin); @@ -1267,7 +1267,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants public Color getBorderColor() { if (borderColor == null) - return Color.BLACK; + return Color.BLACK; return borderColor; } @@ -1341,7 +1341,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants public void setOrientation(int o) { toolBar.setOrientation(o); - if (dragWindow != null) + if (dragWindow != null) dragWindow.setOrientation(o); } } @@ -1364,10 +1364,10 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants if (origParent != null) { - origParent.add(toolBar, - (constraintBeforeFloating != null) - ? constraintBeforeFloating : BorderLayout.NORTH); - toolBar.setOrientation(lastGoodOrientation); + origParent.add(toolBar, + (constraintBeforeFloating != null) + ? constraintBeforeFloating : BorderLayout.NORTH); + toolBar.setOrientation(lastGoodOrientation); } origParent.invalidate(); @@ -1410,16 +1410,16 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants { if (e.getChild() instanceof JButton) { - JButton b = (JButton) e.getChild(); + JButton b = (JButton) e.getChild(); - if (b.getBorder() != null) - borders.put(b, b.getBorder()); + if (b.getBorder() != null) + borders.put(b, b.getBorder()); } if (isRolloverBorders()) - setBorderToRollover(e.getChild()); + setBorderToRollover(e.getChild()); else - setBorderToNonRollover(e.getChild()); + setBorderToNonRollover(e.getChild()); cachedBounds = toolBar.getPreferredSize(); cachedOrientation = toolBar.getOrientation(); @@ -1479,7 +1479,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants /** * Receives notification when the toolbar or one of it's component * receives the keyboard input focus. - * + * * @param e the focus event */ public void focusGained(FocusEvent e) @@ -1491,7 +1491,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants /** * Receives notification when the toolbar or one of it's component * looses the keyboard input focus. - * + * * @param e the focus event */ public void focusLost(FocusEvent e) @@ -1522,15 +1522,15 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants { if (c instanceof JToolBar) { - JToolBar tb = (JToolBar) c; - int orientation = tb.getOrientation(); - - if (! tb.isFloatable()) - return new Insets(regular, regular, regular, regular); - else if (orientation == SwingConstants.HORIZONTAL) - return new Insets(regular, offset, regular, regular); - else - return new Insets(offset, regular, regular, regular); + JToolBar tb = (JToolBar) c; + int orientation = tb.getOrientation(); + + if (! tb.isFloatable()) + return new Insets(regular, regular, regular, regular); + else if (orientation == SwingConstants.HORIZONTAL) + return new Insets(regular, offset, regular, regular); + else + return new Insets(offset, regular, regular, regular); } return new Insets(0, 0, 0, 0); @@ -1568,9 +1568,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants int count = 0; for (int i = x; i < (w + x); i += hgap) - for (int j = ((count++ % 2) == 0) ? y : (y + (2 * size)); j < (h + y); - j += vgap) - g.fillRect(i, j, size, size); + for (int j = ((count++ % 2) == 0) ? y : (y + (2 * size)); j < (h + y); + j += vgap) + g.fillRect(i, j, size, size); g.setColor(saved); } @@ -1590,20 +1590,20 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants { if (c instanceof JToolBar) { - JToolBar tb = (JToolBar) c; - - int orientation = tb.getOrientation(); - - if (orientation == SwingConstants.HORIZONTAL) - { - paintBumps(g, x, y, offset, height, 1, Color.WHITE); - paintBumps(g, x + 1, y + 1, offset - 1, height - 1, 1, Color.GRAY); - } - else - { - paintBumps(g, x, y, width, offset, 1, Color.WHITE); - paintBumps(g, x + 1, y + 1, width - 1, offset - 1, 1, Color.GRAY); - } + JToolBar tb = (JToolBar) c; + + int orientation = tb.getOrientation(); + + if (orientation == SwingConstants.HORIZONTAL) + { + paintBumps(g, x, y, offset, height, 1, Color.WHITE); + paintBumps(g, x + 1, y + 1, offset - 1, height - 1, 1, Color.GRAY); + } + else + { + paintBumps(g, x, y, width, offset, 1, Color.WHITE); + paintBumps(g, x + 1, y + 1, width - 1, offset - 1, 1, Color.GRAY); + } } } } diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicToolTipUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicToolTipUI.java index 94e7bc3..37c084b 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicToolTipUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicToolTipUI.java @@ -80,7 +80,7 @@ public class BasicToolTipUI extends ToolTipUI BasicHTML.updateRenderer(tip, text); } } - + } /** The shared instance of BasicToolTipUI used for all ToolTips. */ @@ -103,7 +103,7 @@ public class BasicToolTipUI extends ToolTipUI } /** - * This method creates a new BasicToolTip UI for the given + * This method creates a new BasicToolTip UI for the given * JComponent. * * @param c The JComponent to create a UI for. @@ -245,10 +245,10 @@ public class BasicToolTipUI extends ToolTipUI if (view != null) view.paint(g, paintR); else - g.drawString(text, paintR.x + 3, paintR.y + ascent); + g.drawString(text, paintR.x + 3, paintR.y + ascent); g.setFont(oldFont); - g.setColor(saved); + g.setColor(saved); } /** diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicTreeUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicTreeUI.java index 1c28a5f..af61a42 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicTreeUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicTreeUI.java @@ -109,7 +109,7 @@ import javax.swing.tree.VariableHeightLayoutCache; /** * A delegate providing the user interface for <code>JTree</code> according to * the Basic look and feel. - * + * * @see javax.swing.JTree * @author Lillian Angel (langel@redhat.com) * @author Sascha Brawer (brawer@dandelis.ch) @@ -174,7 +174,7 @@ public class BasicTreeUI * Set to false when editing and shouldSelectCall() returns true meaning the * node should be selected before editing, used in completeEditing. * GNU Classpath editing is implemented differently, so this value is not - * actually read anywhere. However it is always set correctly to maintain + * actually read anywhere. However it is always set correctly to maintain * interoperability with the derived classes that read this field. */ protected boolean stopEditingInCompleteEditing; @@ -248,7 +248,7 @@ public class BasicTreeUI /** The max height of the nodes in the tree. */ int maxHeight; - + /** The hash color. */ Color hashColor; @@ -294,7 +294,7 @@ public class BasicTreeUI /** * Returns an instance of the UI delegate for the specified component. - * + * * @param c the <code>JComponent</code> for which we need a UI delegate for. * @return the <code>ComponentUI</code> for c. */ @@ -305,7 +305,7 @@ public class BasicTreeUI /** * Returns the Hash color. - * + * * @return the <code>Color</code> of the Hash. */ protected Color getHashColor() @@ -315,7 +315,7 @@ public class BasicTreeUI /** * Sets the Hash color. - * + * * @param color the <code>Color</code> to set the Hash to. */ protected void setHashColor(Color color) @@ -325,7 +325,7 @@ public class BasicTreeUI /** * Sets the left child's indent value. - * + * * @param newAmount is the new indent value for the left child. */ public void setLeftChildIndent(int newAmount) @@ -335,7 +335,7 @@ public class BasicTreeUI /** * Returns the indent value for the left child. - * + * * @return the indent value for the left child. */ public int getLeftChildIndent() @@ -345,7 +345,7 @@ public class BasicTreeUI /** * Sets the right child's indent value. - * + * * @param newAmount is the new indent value for the right child. */ public void setRightChildIndent(int newAmount) @@ -355,7 +355,7 @@ public class BasicTreeUI /** * Returns the indent value for the right child. - * + * * @return the indent value for the right child. */ public int getRightChildIndent() @@ -365,7 +365,7 @@ public class BasicTreeUI /** * Sets the expanded icon. - * + * * @param newG is the new expanded icon. */ public void setExpandedIcon(Icon newG) @@ -375,7 +375,7 @@ public class BasicTreeUI /** * Returns the current expanded icon. - * + * * @return the current expanded icon. */ public Icon getExpandedIcon() @@ -385,7 +385,7 @@ public class BasicTreeUI /** * Sets the collapsed icon. - * + * * @param newG is the new collapsed icon. */ public void setCollapsedIcon(Icon newG) @@ -395,7 +395,7 @@ public class BasicTreeUI /** * Returns the current collapsed icon. - * + * * @return the current collapsed icon. */ public Icon getCollapsedIcon() @@ -405,7 +405,7 @@ public class BasicTreeUI /** * Updates the componentListener, if necessary. - * + * * @param largeModel sets this.largeModel to it. */ protected void setLargeModel(boolean largeModel) @@ -421,7 +421,7 @@ public class BasicTreeUI /** * Returns true if largeModel is set - * + * * @return true if largeModel is set, otherwise false. */ protected boolean isLargeModel() @@ -431,7 +431,7 @@ public class BasicTreeUI /** * Sets the row height. - * + * * @param rowHeight is the height to set this.rowHeight to. */ protected void setRowHeight(int rowHeight) @@ -444,7 +444,7 @@ public class BasicTreeUI /** * Returns the current row height. - * + * * @return current row height. */ protected int getRowHeight() @@ -455,7 +455,7 @@ public class BasicTreeUI /** * Sets the TreeCellRenderer to <code>tcr</code>. This invokes * <code>updateRenderer</code>. - * + * * @param tcr is the new TreeCellRenderer. */ protected void setCellRenderer(TreeCellRenderer tcr) @@ -469,15 +469,15 @@ public class BasicTreeUI // Refresh the layout if necessary. if (treeState != null) { - treeState.invalidateSizes(); - updateSize(); + treeState.invalidateSizes(); + updateSize(); } } /** * Return currentCellRenderer, which will either be the trees renderer, or * defaultCellRenderer, which ever was not null. - * + * * @return the current Cell Renderer */ protected TreeCellRenderer getCellRenderer() @@ -490,7 +490,7 @@ public class BasicTreeUI /** * Sets the tree's model. - * + * * @param model to set the treeModel to. */ protected void setModel(TreeModel model) @@ -515,7 +515,7 @@ public class BasicTreeUI /** * Returns the tree's model - * + * * @return treeModel */ protected TreeModel getModel() @@ -525,7 +525,7 @@ public class BasicTreeUI /** * Sets the root to being visible. - * + * * @param newValue sets the visibility of the root */ protected void setRootVisible(boolean newValue) @@ -536,7 +536,7 @@ public class BasicTreeUI /** * Returns true if the root is visible. - * + * * @return true if the root is visible. */ protected boolean isRootVisible() @@ -546,7 +546,7 @@ public class BasicTreeUI /** * Determines whether the node handles are to be displayed. - * + * * @param newValue sets whether or not node handles should be displayed. */ protected void setShowsRootHandles(boolean newValue) @@ -562,7 +562,7 @@ public class BasicTreeUI /** * Returns true if the node handles are to be displayed. - * + * * @return true if the node handles are to be displayed. */ protected boolean getShowsRootHandles() @@ -572,7 +572,7 @@ public class BasicTreeUI /** * Sets the cell editor. - * + * * @param editor to set the cellEditor to. */ protected void setCellEditor(TreeCellEditor editor) @@ -582,7 +582,7 @@ public class BasicTreeUI /** * Returns the <code>TreeCellEditor</code> for this tree. - * + * * @return the cellEditor for this tree. */ protected TreeCellEditor getCellEditor() @@ -592,7 +592,7 @@ public class BasicTreeUI /** * Configures the receiver to allow, or not allow, editing. - * + * * @param newValue sets the receiver to allow editing if true. */ protected void setEditable(boolean newValue) @@ -602,7 +602,7 @@ public class BasicTreeUI /** * Returns true if the receiver allows editing. - * + * * @return true if the receiver allows editing. */ protected boolean isEditable() @@ -613,7 +613,7 @@ public class BasicTreeUI /** * Resets the selection model. The appropriate listeners are installed on the * model. - * + * * @param newLSM resets the selection model. */ protected void setSelectionModel(TreeSelectionModel newLSM) @@ -628,7 +628,7 @@ public class BasicTreeUI /** * Returns the current selection model. - * + * * @return the current selection model. */ protected TreeSelectionModel getSelectionModel() @@ -640,7 +640,7 @@ public class BasicTreeUI * Returns the Rectangle enclosing the label portion that the last item in * path will be drawn to. Will return null if any component in path is * currently valid. - * + * * @param tree is the current tree the path will be drawn to. * @param path is the current path the tree to draw to. * @return the Rectangle enclosing the label portion that the last item in the @@ -664,7 +664,7 @@ public class BasicTreeUI /** * Returns the max height of all the nodes in the tree. - * + * * @param tree - the current tree * @return the max height. */ @@ -690,11 +690,11 @@ public class BasicTreeUI maxHeight = Math.max(maxHeight, iconHeight + gap); } - + treeState.setRowHeight(maxHeight); return maxHeight; } - + /** * Get the tree node icon. */ @@ -711,7 +711,7 @@ public class BasicTreeUI /** * Returns the path for passed in row. If row is not visible null is returned. - * + * * @param tree is the current tree to return path for. * @param row is the row number of the row to return. * @return the path for passed in row. If row is not visible null is returned. @@ -724,7 +724,7 @@ public class BasicTreeUI /** * Returns the row that the last item identified in path is visible at. Will * return -1 if any of the elments in the path are not currently visible. - * + * * @param tree is the current tree to return the row for. * @param path is the path used to find the row. * @return the row that the last item identified in path is visible at. Will @@ -738,7 +738,7 @@ public class BasicTreeUI /** * Returns the number of rows that are being displayed. - * + * * @param tree is the current tree to return the number of rows for. * @return the number of rows being displayed. */ @@ -752,7 +752,7 @@ public class BasicTreeUI * currently visible this will return null, otherwise it'll always return a * valid path. If you need to test if the returned object is exactly at x,y * you should get the bounds for the returned path and test x,y against that. - * + * * @param tree the tree to search for the closest path * @param x is the x coordinate of the location to search * @param y is the y coordinate of the location to search @@ -766,7 +766,7 @@ public class BasicTreeUI /** * Returns true if the tree is being edited. The item that is being edited can * be returned by getEditingPath(). - * + * * @param tree is the tree to check for editing. * @return true if the tree is being edited. */ @@ -779,7 +779,7 @@ public class BasicTreeUI * Stops the current editing session. This has no effect if the tree is not * being edited. Returns true if the editor allows the editing session to * stop. - * + * * @param tree is the tree to stop the editing on * @return true if the editor allows the editing session to stop. */ @@ -796,7 +796,7 @@ public class BasicTreeUI /** * Cancels the current editing session. - * + * * @param tree is the tree to cancel the editing session on. */ public void cancelEditing(JTree tree) @@ -811,7 +811,7 @@ public class BasicTreeUI /** * Selects the last item in path and tries to edit it. Editing will fail if * the CellEditor won't allow it for the selected item. - * + * * @param tree is the tree to edit on. * @param path is the path in tree to edit on. */ @@ -824,7 +824,7 @@ public class BasicTreeUI /** * Returns the path to the element that is being editted. - * + * * @param tree is the tree to get the editing path from. * @return the path that is being edited. */ @@ -858,7 +858,7 @@ public class BasicTreeUI updateDepthOffset(); setSelectionModel(tree.getSelectionModel()); configureLayoutCache(); - treeState.setRootVisible(tree.isRootVisible()); + treeState.setRootVisible(tree.isRootVisible()); treeSelectionModel.setRowMapper(treeState); updateSize(); } @@ -887,7 +887,7 @@ public class BasicTreeUI * Creates an instance of NodeDimensions that is able to determine the size of * a given node in the tree. The node dimensions must be created before * configuring the layout cache. - * + * * @return the NodeDimensions of a given node in the tree */ protected AbstractLayoutCache.NodeDimensions createNodeDimensions() @@ -898,7 +898,7 @@ public class BasicTreeUI /** * Creates a listener that is reponsible for the updates the UI based on how * the tree changes. - * + * * @return the PropertyChangeListener that is reposnsible for the updates */ protected PropertyChangeListener createPropertyChangeListener() @@ -909,7 +909,7 @@ public class BasicTreeUI /** * Creates the listener responsible for updating the selection based on mouse * events. - * + * * @return the MouseListener responsible for updating. */ protected MouseListener createMouseListener() @@ -920,7 +920,7 @@ public class BasicTreeUI /** * Creates the listener that is responsible for updating the display when * focus is lost/grained. - * + * * @return the FocusListener responsible for updating. */ protected FocusListener createFocusListener() @@ -930,7 +930,7 @@ public class BasicTreeUI /** * Creates the listener reponsible for getting key events from the tree. - * + * * @return the KeyListener responsible for getting key events. */ protected KeyListener createKeyListener() @@ -941,7 +941,7 @@ public class BasicTreeUI /** * Creates the listener responsible for getting property change events from * the selection model. - * + * * @returns the PropertyChangeListener reponsible for getting property change * events from the selection model. */ @@ -953,7 +953,7 @@ public class BasicTreeUI /** * Creates the listener that updates the display based on selection change * methods. - * + * * @return the TreeSelectionListener responsible for updating. */ protected TreeSelectionListener createTreeSelectionListener() @@ -963,7 +963,7 @@ public class BasicTreeUI /** * Creates a listener to handle events from the current editor - * + * * @return the CellEditorListener that handles events from the current editor */ protected CellEditorListener createCellEditorListener() @@ -975,7 +975,7 @@ public class BasicTreeUI * Creates and returns a new ComponentHandler. This is used for the large * model to mark the validCachedPreferredSize as invalid when the component * moves. - * + * * @return a new ComponentHandler. */ protected ComponentListener createComponentListener() @@ -986,7 +986,7 @@ public class BasicTreeUI /** * Creates and returns the object responsible for updating the treestate when * a nodes expanded state changes. - * + * * @return the TreeExpansionListener responsible for updating the treestate */ protected TreeExpansionListener createTreeExpansionListener() @@ -997,7 +997,7 @@ public class BasicTreeUI /** * Creates the object responsible for managing what is expanded, as well as * the size of nodes. - * + * * @return the object responsible for managing what is expanded. */ protected AbstractLayoutCache createLayoutCache() @@ -1007,7 +1007,7 @@ public class BasicTreeUI /** * Returns the renderer pane that renderer components are placed in. - * + * * @return the rendererpane that render components are placed in. */ protected CellRendererPane createCellRendererPane() @@ -1017,7 +1017,7 @@ public class BasicTreeUI /** * Creates a default cell editor. - * + * * @return the default cell editor. */ protected TreeCellEditor createDefaultCellEditor() @@ -1035,7 +1035,7 @@ public class BasicTreeUI /** * Returns the default cell renderer that is used to do the stamping of each * node. - * + * * @return the default cell renderer that is used to do the stamping of each * node. */ @@ -1046,7 +1046,7 @@ public class BasicTreeUI /** * Returns a listener that can update the tree when the model changes. - * + * * @return a listener that can update the tree when the model changes. */ protected TreeModelListener createTreeModelListener() @@ -1099,7 +1099,7 @@ public class BasicTreeUI /** * The vertical element of legs between nodes starts at the bottom of the * parent node by default. This method makes the leg start below that. - * + * * @return the vertical leg buffer */ protected int getVerticalLegBuffer() @@ -1111,7 +1111,7 @@ public class BasicTreeUI * The horizontal element of legs between nodes starts at the right of the * left-hand side of the child node by default. This method makes the leg end * before that. - * + * * @return the horizontal leg buffer */ protected int getHorizontalLegBuffer() @@ -1133,7 +1133,7 @@ public class BasicTreeUI * Updates the expanded state of all the descendants of the <code>path</code> * by getting the expanded descendants from the tree and forwarding to the * tree state. - * + * * @param path the path used to update the expanded states */ protected void updateExpandedDescendants(TreePath path) @@ -1146,7 +1146,7 @@ public class BasicTreeUI /** * Returns a path to the last child of <code>parent</code> - * + * * @param parent is the topmost path to specified * @return a path to the last child of parent */ @@ -1206,24 +1206,24 @@ public class BasicTreeUI { if (tree != null) { - TreeCellRenderer rend = tree.getCellRenderer(); - if (rend != null) - { - createdRenderer = false; - currentCellRenderer = rend; - if (createdCellEditor) - tree.setCellEditor(null); - } - else - { - tree.setCellRenderer(createDefaultCellRenderer()); - createdRenderer = true; - } + TreeCellRenderer rend = tree.getCellRenderer(); + if (rend != null) + { + createdRenderer = false; + currentCellRenderer = rend; + if (createdCellEditor) + tree.setCellEditor(null); + } + else + { + tree.setCellRenderer(createDefaultCellRenderer()); + createdRenderer = true; + } } else { - currentCellRenderer = null; - createdRenderer = false; + currentCellRenderer = null; + createdRenderer = false; } updateCellEditor(); @@ -1262,7 +1262,7 @@ public class BasicTreeUI /** * Messaged from the VisibleTreeNode after it has been expanded. - * + * * @param path is the path that has been expanded. */ protected void pathWasExpanded(TreePath path) @@ -1289,11 +1289,11 @@ public class BasicTreeUI { LookAndFeel.installColorsAndFont(tree, "Tree.background", "Tree.foreground", "Tree.font"); - + hashColor = UIManager.getColor("Tree.hash"); if (hashColor == null) hashColor = Color.black; - + tree.setOpaque(true); rightChildIndent = UIManager.getInt("Tree.rightChildIndent"); @@ -1383,7 +1383,7 @@ public class BasicTreeUI am.put(action.getValue(Action.NAME), action); action = new TreeTraverseAction(1, "selectChild"); am.put(action.getValue(Action.NAME), action); - + // TreeToggleAction. action = new TreeToggleAction("toggleAndAnchor"); am.put(action.getValue(Action.NAME), action); @@ -1401,20 +1401,20 @@ public class BasicTreeUI am.put(action.getValue(Action.NAME), action); action = new TreePageAction(1, "scrollDownChangeLead"); am.put(action.getValue(Action.NAME), action); - + // Tree editing actions action = new TreeStartEditingAction("startEditing"); am.put(action.getValue(Action.NAME), action); action = new TreeCancelEditingAction("cancel"); am.put(action.getValue(Action.NAME), action); - + return am; } /** * Converts the modifiers. - * + * * @param mod - modifier to convert * @returns the new modifier */ @@ -1492,7 +1492,7 @@ public class BasicTreeUI /** * Install the UI for the component - * + * * @param c the component to install UI for */ public void installUI(JComponent c) @@ -1506,7 +1506,7 @@ public class BasicTreeUI installListeners(); completeUIInstall(); } - + /** * Uninstall the defaults for the tree */ @@ -1519,7 +1519,7 @@ public class BasicTreeUI /** * Uninstall the UI for the component - * + * * @param c the component to uninstall UI for */ public void uninstallUI(JComponent c) @@ -1539,7 +1539,7 @@ public class BasicTreeUI * method is invoked from the ComponentUI.update method when the specified * component is being painted. Subclasses should override this method and use * the specified Graphics object to render the content of the component. - * + * * @param g the Graphics context in which to paint * @param c the component being painted; this argument is often ignored, but * might be used if the UI object is stateless and shared by multiple @@ -1548,9 +1548,9 @@ public class BasicTreeUI public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; - + int rows = treeState.getRowCount(); - + if (rows == 0) // There is nothing to do if the tree is empty. return; @@ -1639,7 +1639,7 @@ public class BasicTreeUI /** * Ensures that the rows identified by beginRow through endRow are visible. - * + * * @param beginRow is the first row * @param endRow is the last row */ @@ -1662,7 +1662,7 @@ public class BasicTreeUI /** * Sets the preferred minimum size. - * + * * @param newSize is the new preferred minimum size. */ public void setPreferredMinSize(Dimension newSize) @@ -1672,7 +1672,7 @@ public class BasicTreeUI /** * Gets the preferred minimum size. - * + * * @returns the preferred minimum size. */ public Dimension getPreferredMinSize() @@ -1686,7 +1686,7 @@ public class BasicTreeUI /** * Returns the preferred size to properly display the tree, this is a cover * method for getPreferredSize(c, false). - * + * * @param c the component whose preferred size is being queried; this argument * is often ignored but might be used if the UI object is stateless * and shared by multiple components @@ -1700,7 +1700,7 @@ public class BasicTreeUI /** * Returns the preferred size to represent the tree in c. If checkConsistancy * is true, checkConsistancy is messaged first. - * + * * @param c the component whose preferred size is being queried. * @param checkConsistancy if true must check consistancy * @return the preferred size @@ -1721,7 +1721,7 @@ public class BasicTreeUI /** * Returns the minimum size for this component. Which will be the min * preferred size or (0,0). - * + * * @param c the component whose min size is being queried. * @returns the preferred size or null */ @@ -1733,7 +1733,7 @@ public class BasicTreeUI /** * Returns the maximum size for the component, which will be the preferred * size if the instance is currently in JTree or (0,0). - * + * * @param c the component whose preferred size is being queried * @return the max size or null */ @@ -1763,7 +1763,7 @@ public class BasicTreeUI * with stopEditing, if messageCancel is true the editor is messaged with * cancelEditing. If messageTree is true, the treeModel is messaged with * valueForPathChanged. - * + * * @param messageStop message to stop editing * @param messageCancel message to cancel editing * @param messageTree message to treeModel @@ -1808,7 +1808,7 @@ public class BasicTreeUI /** * Will start editing for node if there is a cellEditor and shouldSelectCall * returns true. This assumes that path is valid and visible. - * + * * @param path is the path to start editing * @param event is the MouseEvent performed on the path * @return true if successful @@ -1826,7 +1826,7 @@ public class BasicTreeUI { if (ed.isCellEditable(event)) { - editingRow = getRowForPath(tree, path); + editingRow = getRowForPath(tree, path); Object value = path.getLastPathComponent(); boolean isSelected = tree.isPathSelected(path); boolean isExpanded = tree.isExpanded(editingPath); @@ -1852,7 +1852,7 @@ public class BasicTreeUI } else editorHasDifferentSize = false; - + // The editing component must be added to its container. We add the // container, not the editing component itself. tree.add(editingComponent); @@ -1880,7 +1880,7 @@ public class BasicTreeUI if (active != null) { MouseInputHandler ih = new MouseInputHandler(tree, active, event); - + } } @@ -1910,13 +1910,13 @@ public class BasicTreeUI } else if (c.isFocusable()) c.requestFocus(); - + } /** * If the <code>mouseX</code> and <code>mouseY</code> are in the expand or * collapse region of the row, this will toggle the row. - * + * * @param path the path we are concerned with * @param mouseX is the cursor's x position * @param mouseY is the cursor's y position @@ -1932,7 +1932,7 @@ public class BasicTreeUI * Returns true if the <code>mouseX</code> and <code>mouseY</code> fall in * the area of row that is used to expand/collpse the node and the node at row * does not represent a leaf. - * + * * @param path the path we are concerned with * @param mouseX is the cursor's x position * @param mouseY is the cursor's y position @@ -1956,13 +1956,13 @@ public class BasicTreeUI width = 18; Insets i = tree.getInsets(); - + int depth; if (isRootVisible()) depth = path.getPathCount()-1; else depth = path.getPathCount()-2; - + int left = getRowX(tree.getRowForPath(path), depth) - width + i.left; cntlClick = mouseX >= left && mouseX <= left + width; @@ -1973,7 +1973,7 @@ public class BasicTreeUI /** * Messaged when the user clicks the particular row, this invokes * toggleExpandState. - * + * * @param path the path we are concerned with * @param mouseX is the cursor's x position * @param mouseY is the cursor's y position @@ -1988,7 +1988,7 @@ public class BasicTreeUI * expanding a path and JTree scroll on expand, ensureRowsAreVisible is * invoked to scroll as many of the children to visible as possible (tries to * scroll to last visible descendant of path). - * + * * @param path the path we are concerned with */ protected void toggleExpandState(TreePath path) @@ -2006,17 +2006,17 @@ public class BasicTreeUI * event as "toggle selection event" if the CTRL button was pressed while * clicking. The event is not counted as toggle event if the associated * tree does not support the multiple selection. - * + * * @param event is the MouseEvent performed on the row. * @return true signifies a mouse event on the node should toggle the * selection of only the row under the mouse. */ protected boolean isToggleSelectionEvent(MouseEvent event) { - return - (tree.getSelectionModel().getSelectionMode() != + return + (tree.getSelectionModel().getSelectionMode() != TreeSelectionModel.SINGLE_TREE_SELECTION) && - ((event.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) != 0); + ((event.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) != 0); } /** @@ -2025,24 +2025,24 @@ public class BasicTreeUI * event" if the SHIFT button was pressed while clicking. The event is not * counted as multiple selection event if the associated tree does not support * the multiple selection. - * + * * @param event is the MouseEvent performed on the node. * @return true signifies a mouse event on the node should select from the * anchor point. */ protected boolean isMultiSelectEvent(MouseEvent event) { - return - (tree.getSelectionModel().getSelectionMode() != + return + (tree.getSelectionModel().getSelectionMode() != TreeSelectionModel.SINGLE_TREE_SELECTION) && - ((event.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) != 0); + ((event.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) != 0); } /** * Returning true indicates the row under the mouse should be toggled based on * the event. This is invoked after checkForClickInExpandControl, implying the * location is not in the expand (toggle) control. - * + * * @param event is the MouseEvent performed on the row. * @return true indicates the row under the mouse should be toggled based on * the event. @@ -2065,10 +2065,10 @@ public class BasicTreeUI * or deselected. If the event identifies a multi selection event, the * selection is updated from the anchor point. Otherwise, the row is selected, * and the previous selection is cleared.</p> - * + * * @param path is the path selected for an event * @param event is the MouseEvent performed on the path. - * + * * @see #isToggleSelectionEvent(MouseEvent) * @see #isMultiSelectEvent(MouseEvent) */ @@ -2108,7 +2108,7 @@ public class BasicTreeUI /** * Returns true if the node at <code>row</code> is a leaf. - * + * * @param row is the row we are concerned with. * @return true if the node at <code>row</code> is a leaf. */ @@ -2121,7 +2121,7 @@ public class BasicTreeUI Object node = pathForRow.getLastPathComponent(); return treeModel.isLeaf(node); } - + /** * The action to start editing at the current lead selection path. */ @@ -2130,26 +2130,26 @@ public class BasicTreeUI { /** * Creates the new tree cancel editing action. - * + * * @param name the name of the action (used in toString). */ public TreeStartEditingAction(String name) { super(name); - } - + } + /** * Start editing at the current lead selection path. - * + * * @param e the ActionEvent that caused this action. */ public void actionPerformed(ActionEvent e) { TreePath lead = tree.getLeadSelectionPath(); - if (!tree.isEditing()) + if (!tree.isEditing()) tree.startEditingAtPath(lead); } - } + } /** * Updates the preferred size when scrolling, if necessary. @@ -2176,7 +2176,7 @@ public class BasicTreeUI /** * Invoked when the component's position changes. - * + * * @param e the event that occurs when moving the component */ public void componentMoved(ComponentEvent e) @@ -2225,7 +2225,7 @@ public class BasicTreeUI /** * Returns the JScrollPane housing the JTree, or null if one isn't found. - * + * * @return JScrollPane housing the JTree, or null if one isn't found. */ protected JScrollPane getScrollPane() @@ -2242,7 +2242,7 @@ public class BasicTreeUI /** * Public as a result of Timer. If the scrollBar is null, or not adjusting, * this stops the timer and updates the sizing. - * + * * @param ae is the action performed */ public void actionPerformed(ActionEvent ae) @@ -2276,7 +2276,7 @@ public class BasicTreeUI /** * Messaged when editing has stopped in the tree. Tells the listeners * editing has stopped. - * + * * @param e is the notification event */ public void editingStopped(ChangeEvent e) @@ -2287,7 +2287,7 @@ public class BasicTreeUI /** * Messaged when editing has been canceled in the tree. This tells the * listeners the editor has canceled editing. - * + * * @param e is the notification event */ public void editingCanceled(ChangeEvent e) @@ -2315,7 +2315,7 @@ public class BasicTreeUI * row. Invoked when a component gains the keyboard focus. The method * repaints the lead row that is shown differently when the tree is in * focus. - * + * * @param e is the focus event that is activated */ public void focusGained(FocusEvent e) @@ -2328,7 +2328,7 @@ public class BasicTreeUI * row. Invoked when a component loses the keyboard focus. The method * repaints the lead row that is shown differently when the tree is in * focus. - * + * * @param e is the focus event that is deactivated */ public void focusLost(FocusEvent e) @@ -2373,7 +2373,7 @@ public class BasicTreeUI * element whose first letter matches the alphanumeric key pressed by the * user. Subsequent same key presses move the keyboard focus to the next * object that starts with the same letter. - * + * * @param e the key typed */ public void keyTyped(KeyEvent e) @@ -2389,22 +2389,22 @@ public class BasicTreeUI return; } } - + // Not found below, search above: for (int row = 0; row < tree.getLeadSelectionRow(); row++) { if (checkMatch(row, typed)) { tree.setSelectionRow(row); - tree.scrollRowToVisible(row); + tree.scrollRowToVisible(row); return; } } } - + /** * Check if the given tree row starts with this character - * + * * @param row the tree row * @param typed the typed char, must be converted to lowercase * @return true if the given tree row starts with this character @@ -2424,7 +2424,7 @@ public class BasicTreeUI /** * Invoked when a key has been pressed. - * + * * @param e the key pressed */ public void keyPressed(KeyEvent e) @@ -2434,7 +2434,7 @@ public class BasicTreeUI /** * Invoked when a key has been released - * + * * @param e the key released */ public void keyReleased(KeyEvent e) @@ -2451,7 +2451,7 @@ public class BasicTreeUI extends MouseAdapter implements MouseMotionListener { - + /** * If the cell has been selected on mouse press. */ @@ -2467,7 +2467,7 @@ public class BasicTreeUI /** * Invoked when a mouse button has been pressed on a component. - * + * * @param e is the mouse event that occured */ public void mousePressed(MouseEvent e) @@ -2488,7 +2488,7 @@ public class BasicTreeUI * MOUSE_DRAGGED events will continue to be delivered to the component where * the drag originated until the mouse button is released (regardless of * whether the mouse position is within the bounds of the component). - * + * * @param e is the mouse event that occured */ public void mouseDragged(MouseEvent e) @@ -2499,7 +2499,7 @@ public class BasicTreeUI /** * Invoked when the mouse button has been moved on a component (with no * buttons no down). - * + * * @param e the mouse event that occured */ public void mouseMoved(MouseEvent e) @@ -2509,7 +2509,7 @@ public class BasicTreeUI /** * Invoked when a mouse button has been released on a component. - * + * * @param e is the mouse event that occured */ public void mouseReleased(MouseEvent e) @@ -2572,7 +2572,7 @@ public class BasicTreeUI /** * Constructor - * + * * @param source that events are coming from * @param destination that receives all events * @param e is the event received @@ -2590,7 +2590,7 @@ public class BasicTreeUI /** * Invoked when the mouse button has been clicked (pressed and released) on * a component. - * + * * @param e mouse event that occured */ public void mouseClicked(MouseEvent e) @@ -2600,7 +2600,7 @@ public class BasicTreeUI /** * Invoked when a mouse button has been pressed on a component. - * + * * @param e mouse event that occured */ public void mousePressed(MouseEvent e) @@ -2610,7 +2610,7 @@ public class BasicTreeUI /** * Invoked when a mouse button has been released on a component. - * + * * @param e mouse event that occured */ public void mouseReleased(MouseEvent e) @@ -2621,7 +2621,7 @@ public class BasicTreeUI /** * Invoked when the mouse enters a component. - * + * * @param e mouse event that occured */ public void mouseEntered(MouseEvent e) @@ -2632,7 +2632,7 @@ public class BasicTreeUI /** * Invoked when the mouse exits a component. - * + * * @param e mouse event that occured */ public void mouseExited(MouseEvent e) @@ -2646,7 +2646,7 @@ public class BasicTreeUI * MOUSE_DRAGGED events will continue to be delivered to the component where * the drag originated until the mouse button is released (regardless of * whether the mouse position is within the bounds of the component). - * + * * @param e mouse event that occured */ public void mouseDragged(MouseEvent e) @@ -2657,7 +2657,7 @@ public class BasicTreeUI /** * Invoked when the mouse cursor has been moved onto a component but no * buttons have been pushed. - * + * * @param e mouse event that occured */ public void mouseMoved(MouseEvent e) @@ -2716,7 +2716,7 @@ public class BasicTreeUI * The calling method is responsible for determining the Y location. If * bounds is null, a newly created Rectangle should be returned, otherwise * the value should be placed in bounds and returned. - * + * * @param cell the value to be represented * @param row row being queried * @param depth the depth of the row @@ -2762,13 +2762,13 @@ public class BasicTreeUI // FIXME: The y should be handled by the layout cache. size = new Rectangle(getRowX(row, depth), prefSize.height * row, prefSize.width, prefSize.height); - + return size; } /** * Returns the amount to indent the given row - * + * * @return amount to indent the given row. */ protected int getRowX(int row, int depth) @@ -2795,7 +2795,7 @@ public class BasicTreeUI /** * This method gets called when a bound property is changed. - * + * * @param event A PropertyChangeEvent object describing the event source and * the property that has changed. */ @@ -2826,7 +2826,7 @@ public class BasicTreeUI } else if (property.equals(JTree.EDITABLE_PROPERTY)) setEditable(((Boolean) event.getNewValue()).booleanValue()); - + } } @@ -2848,7 +2848,7 @@ public class BasicTreeUI /** * This method gets called when a bound property is changed. - * + * * @param event A PropertyChangeEvent object describing the event source and * the property that has changed. */ @@ -2866,7 +2866,7 @@ public class BasicTreeUI { /** * Creates the new tree cancel editing action. - * + * * @param name the name of the action (used in toString). */ public TreeCancelEditingAction(String name) @@ -2876,8 +2876,8 @@ public class BasicTreeUI /** * Invoked when an action occurs, cancels the cell editing (if the - * tree cell is being edited). - * + * tree cell is being edited). + * * @param e event that occured */ public void actionPerformed(ActionEvent e) @@ -2904,7 +2904,7 @@ public class BasicTreeUI /** * Called whenever an item in the tree has been expanded. - * + * * @param event is the event that occured */ public void treeExpanded(TreeExpansionEvent event) @@ -2919,7 +2919,7 @@ public class BasicTreeUI /** * Called whenever an item in the tree has been collapsed. - * + * * @param event is the event that occured */ public void treeCollapsed(TreeExpansionEvent event) @@ -2947,7 +2947,7 @@ public class BasicTreeUI /** * Creates a new TreeHomeAction instance. - * + * * @param dir the direction to go to, <code>-1</code> for home, * <code>1</code> for end * @param name the name of the action @@ -2960,7 +2960,7 @@ public class BasicTreeUI /** * Invoked when an action occurs. - * + * * @param e is the event that occured */ public void actionPerformed(ActionEvent e) @@ -3027,7 +3027,7 @@ public class BasicTreeUI /** * Returns true if the action is enabled. - * + * * @return true if the action is enabled. */ public boolean isEnabled() @@ -3051,7 +3051,7 @@ public class BasicTreeUI /** * Creates a new TreeIncrementAction. - * + * * @param dir up or down, <code>-1</code> for up, <code>1</code> for down * @param name is the name of the direction */ @@ -3063,7 +3063,7 @@ public class BasicTreeUI /** * Invoked when an action occurs. - * + * * @param e is the event that occured */ public void actionPerformed(ActionEvent e) @@ -3138,14 +3138,14 @@ public class BasicTreeUI tree.setAnchorSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } - + // Ensure that the lead path is visible after the increment action. tree.scrollPathToVisible(tree.getLeadSelectionPath()); } /** * Returns true if the action is enabled. - * + * * @return true if the action is enabled. */ public boolean isEnabled() @@ -3177,7 +3177,7 @@ public class BasicTreeUI * children will be null. Use e.getPath() to get the parent of the changed * node(s). e.getChildIndices() returns the index(es) of the changed * node(s). - * + * * @param e is the event that occured */ public void treeNodesChanged(TreeModelEvent e) @@ -3191,7 +3191,7 @@ public class BasicTreeUI * Invoked after nodes have been inserted into the tree. Use e.getPath() to * get the parent of the new node(s). e.getChildIndices() returns the * index(es) of the new node(s) in ascending order. - * + * * @param e is the event that occured */ public void treeNodesInserted(TreeModelEvent e) @@ -3208,7 +3208,7 @@ public class BasicTreeUI * siblings removed. Use e.getPath() to get the former parent of the deleted * node(s). e.getChildIndices() returns, in ascending order, the index(es) * the node(s) had before being deleted. - * + * * @param e is the event that occured */ public void treeNodesRemoved(TreeModelEvent e) @@ -3224,7 +3224,7 @@ public class BasicTreeUI * first element does not identify the current root node the first element * should become the new root of the tree. Use e.getPath() to get the path * to the node. e.getChildIndices() returns null. - * + * * @param e is the event that occured */ public void treeStructureChanged(TreeModelEvent e) @@ -3249,7 +3249,7 @@ public class BasicTreeUI /** * Constructor - * + * * @param direction up or down * @param name is the name of the direction */ @@ -3261,7 +3261,7 @@ public class BasicTreeUI /** * Invoked when an action occurs. - * + * * @param e is the event that occured */ public void actionPerformed(ActionEvent e) @@ -3358,7 +3358,7 @@ public class BasicTreeUI /** * Returns true if the action is enabled. - * + * * @return true if the action is enabled. */ public boolean isEnabled() @@ -3385,7 +3385,7 @@ public class BasicTreeUI /** * Messaged when the selection changes in the tree we're displaying for. * Stops editing, messages super and displays the changed paths. - * + * * @param event the event that characterizes the change. */ public void valueChanged(TreeSelectionEvent event) @@ -3394,15 +3394,15 @@ public class BasicTreeUI TreePath op = event.getOldLeadSelectionPath(); TreePath np = event.getNewLeadSelectionPath(); - + // Repaint of the changed lead selection path. if (op != np) { - Rectangle o = treeState.getBounds(event.getOldLeadSelectionPath(), + Rectangle o = treeState.getBounds(event.getOldLeadSelectionPath(), new Rectangle()); - Rectangle n = treeState.getBounds(event.getNewLeadSelectionPath(), + Rectangle n = treeState.getBounds(event.getNewLeadSelectionPath(), new Rectangle()); - + if (o != null) tree.repaint(o); if (n != null) @@ -3419,7 +3419,7 @@ public class BasicTreeUI { /** * Creates a new TreeToggleAction. - * + * * @param name is the name of <code>Action</code> field */ public TreeToggleAction(String name) @@ -3429,7 +3429,7 @@ public class BasicTreeUI /** * Invoked when an action occurs. - * + * * @param e the event that occured */ public void actionPerformed(ActionEvent e) @@ -3452,7 +3452,7 @@ public class BasicTreeUI /** * Returns true if the action is enabled. - * + * * @return true if the action is enabled, false otherwise */ public boolean isEnabled() @@ -3475,7 +3475,7 @@ public class BasicTreeUI /** * Constructor - * + * * @param direction to traverse * @param name is the name of the direction */ @@ -3487,7 +3487,7 @@ public class BasicTreeUI /** * Invoked when an action occurs. - * + * * @param e the event that occured */ public void actionPerformed(ActionEvent e) @@ -3512,7 +3512,7 @@ public class BasicTreeUI // we just select the parent. We do not select the root if it // is not visible. TreePath parent = current.getParentPath(); - if (parent != null && + if (parent != null && ! (parent.getPathCount() == 1 && ! tree.isRootVisible())) tree.setSelectionPath(parent); } @@ -3534,14 +3534,14 @@ public class BasicTreeUI tree.expandPath(current); } } - + // Ensure that the lead path is visible after the increment action. tree.scrollPathToVisible(tree.getLeadSelectionPath()); } /** * Returns true if the action is enabled. - * + * * @return true if the action is enabled, false otherwise */ public boolean isEnabled() @@ -3553,7 +3553,7 @@ public class BasicTreeUI /** * Returns true if the LookAndFeel implements the control icons. Package * private for use in inner classes. - * + * * @returns true if there are control icons */ boolean hasControlIcons() @@ -3566,7 +3566,7 @@ public class BasicTreeUI /** * Returns control icon. It is null if the LookAndFeel does not implements the * control icons. Package private for use in inner classes. - * + * * @return control icon if it exists. */ Icon getCurrentControlIcon(TreePath path) @@ -3604,7 +3604,7 @@ public class BasicTreeUI /** * Returns the parent of the current node - * + * * @param root is the root of the tree * @param node is the current node * @return is the parent of the current node @@ -3621,7 +3621,7 @@ public class BasicTreeUI /** * Recursively checks the tree for the specified node, starting at the root. - * + * * @param root is starting node to start searching at. * @param node is the node to search for * @return the parent node of node @@ -3648,7 +3648,7 @@ public class BasicTreeUI /** * Selects the specified path in the tree depending on modes. Package private * for use in inner classes. - * + * * @param tree is the tree we are selecting the path in * @param path is the path we are selecting */ @@ -3657,7 +3657,7 @@ public class BasicTreeUI if (path != null) { tree.setSelectionPath(path); - tree.setLeadSelectionPath(path); + tree.setLeadSelectionPath(path); tree.makeVisible(path); tree.scrollPathToVisible(path); } @@ -3666,7 +3666,7 @@ public class BasicTreeUI /** * Returns the path from node to the root. Package private for use in inner * classes. - * + * * @param node the node to get the path to * @param depth the depth of the tree to return a path for * @return an array of tree nodes that represent the path to node. @@ -3689,7 +3689,7 @@ public class BasicTreeUI /** * Draws a vertical line using the given graphic context - * + * * @param g is the graphic context * @param c is the component the new line will belong to * @param x is the horizonal position @@ -3706,7 +3706,7 @@ public class BasicTreeUI /** * Draws a horizontal line using the given graphic context - * + * * @param g is the graphic context * @param c is the component the new line will belong to * @param y is the vertical position @@ -3723,7 +3723,7 @@ public class BasicTreeUI /** * Draws an icon at around a specific position - * + * * @param c is the component the new line will belong to * @param g is the graphic context * @param icon is the icon which will be drawn @@ -3745,7 +3745,7 @@ public class BasicTreeUI /** * Draws a dashed horizontal line. - * + * * @param g - the graphics configuration. * @param y - the y location to start drawing at * @param x1 - the x location to start drawing at @@ -3760,7 +3760,7 @@ public class BasicTreeUI /** * Draws a dashed vertical line. - * + * * @param g - the graphics configuration. * @param x - the x location to start drawing at * @param y1 - the y location to start drawing at @@ -3776,7 +3776,7 @@ public class BasicTreeUI /** * Paints the expand (toggle) part of a row. The receiver should NOT modify * clipBounds, or insets. - * + * * @param g - the graphics configuration * @param clipBounds - * @param insets - @@ -3806,7 +3806,7 @@ public class BasicTreeUI * Paints the horizontal part of the leg. The receiver should NOT modify * clipBounds, or insets. NOTE: parentRow can be -1 if the root is not * visible. - * + * * @param g - the graphics configuration * @param clipBounds - * @param insets - @@ -3834,7 +3834,7 @@ public class BasicTreeUI /** * Paints the vertical part of the leg. The receiver should NOT modify * clipBounds, insets. - * + * * @param g - the graphics configuration. * @param clipBounds - * @param insets - @@ -3845,7 +3845,7 @@ public class BasicTreeUI { Rectangle bounds = getPathBounds(tree, path); TreePath parent = path.getParentPath(); - + boolean paintLine; if (isRootVisible()) paintLine = parent != null; @@ -3854,7 +3854,7 @@ public class BasicTreeUI if (paintLine) { Rectangle parentBounds = getPathBounds(tree, parent); - paintVerticalLine(g, tree, parentBounds.x + 2 * gap, + paintVerticalLine(g, tree, parentBounds.x + 2 * gap, parentBounds.y + parentBounds.height / 2, bounds.y + bounds.height / 2); } @@ -3863,7 +3863,7 @@ public class BasicTreeUI /** * Paints the renderer part of a row. The receiver should NOT modify * clipBounds, or insets. - * + * * @param g - the graphics configuration * @param clipBounds - * @param insets - @@ -3911,7 +3911,7 @@ public class BasicTreeUI /** * Returns true if the expand (toggle) control should be drawn for the * specified row. - * + * * @param path - current path to check for. * @param row - current row to check for. * @param isExpanded - true if the path is expanded @@ -3929,7 +3929,7 @@ public class BasicTreeUI /** * Returns the amount to indent the given row - * + * * @return amount to indent the given row. */ protected int getRowX(int row, int depth) diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicViewportUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicViewportUI.java index 51b902d..11c7d63 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicViewportUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicViewportUI.java @@ -43,7 +43,7 @@ import javax.swing.LookAndFeel; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ViewportUI; -public class BasicViewportUI extends ViewportUI +public class BasicViewportUI extends ViewportUI { protected void installDefaults(JComponent c) { @@ -61,13 +61,13 @@ public class BasicViewportUI extends ViewportUI return new BasicViewportUI(); } - public void installUI(JComponent c) + public void installUI(JComponent c) { super.installUI(c); installDefaults(c); } - public void uninstallUI(JComponent c) + public void uninstallUI(JComponent c) { super.uninstallUI(c); uninstallDefaults(c); diff --git a/libjava/classpath/javax/swing/plaf/metal/DefaultMetalTheme.java b/libjava/classpath/javax/swing/plaf/metal/DefaultMetalTheme.java index 672676f..27c569f 100644 --- a/libjava/classpath/javax/swing/plaf/metal/DefaultMetalTheme.java +++ b/libjava/classpath/javax/swing/plaf/metal/DefaultMetalTheme.java @@ -48,7 +48,7 @@ import javax.swing.plaf.FontUIResource; /** * The default theme for the {@link MetalLookAndFeel}. - * + * * @see MetalLookAndFeel#setCurrentTheme(MetalTheme) */ public class DefaultMetalTheme extends MetalTheme @@ -57,15 +57,15 @@ public class DefaultMetalTheme extends MetalTheme new ColorUIResource(102, 102, 153); private static final ColorUIResource PRIMARY2 = new ColorUIResource(153, 153, 204); - private static final ColorUIResource PRIMARY3 = + private static final ColorUIResource PRIMARY3 = new ColorUIResource(204, 204, 255); - private static final ColorUIResource SECONDARY1 = + private static final ColorUIResource SECONDARY1 = new ColorUIResource(102, 102, 102); - private static final ColorUIResource SECONDARY2 = + private static final ColorUIResource SECONDARY2 = new ColorUIResource(153, 153, 153); - private static final ColorUIResource SECONDARY3 = + private static final ColorUIResource SECONDARY3 = new ColorUIResource(204, 204, 204); - + private static final FontUIResource SUB_TEXT_FONT = new FontUIResource("Dialog", Font.PLAIN, 10); private static final FontUIResource SYSTEM_TEXT_FONT = @@ -74,7 +74,7 @@ public class DefaultMetalTheme extends MetalTheme new FontUIResource("Dialog", Font.PLAIN, 12); private static final FontUIResource WINDOW_TITLE_FONT = new FontUIResource("Dialog", Font.BOLD, 12); - + /** * The control text font for swing.boldMetal=false. */ @@ -108,7 +108,7 @@ public class DefaultMetalTheme extends MetalTheme * Indicates the menu text font. */ static final int MENU_TEXT_FONT = 2; - + /** * Creates a new instance of this theme. */ @@ -119,7 +119,7 @@ public class DefaultMetalTheme extends MetalTheme /** * Returns the name of the theme. - * + * * @return <code>"Steel"</code>. */ public String getName() @@ -129,7 +129,7 @@ public class DefaultMetalTheme extends MetalTheme /** * Returns the first primary color for this theme. - * + * * @return The first primary color. */ protected ColorUIResource getPrimary1() @@ -139,7 +139,7 @@ public class DefaultMetalTheme extends MetalTheme /** * Returns the second primary color for this theme. - * + * * @return The second primary color. */ protected ColorUIResource getPrimary2() @@ -149,7 +149,7 @@ public class DefaultMetalTheme extends MetalTheme /** * Returns the third primary color for this theme. - * + * * @return The third primary color. */ protected ColorUIResource getPrimary3() @@ -159,7 +159,7 @@ public class DefaultMetalTheme extends MetalTheme /** * Returns the first secondary color for this theme. - * + * * @return The first secondary color. */ protected ColorUIResource getSecondary1() @@ -169,7 +169,7 @@ public class DefaultMetalTheme extends MetalTheme /** * Returns the second secondary color for this theme. - * + * * @return The second secondary color. */ protected ColorUIResource getSecondary2() @@ -179,7 +179,7 @@ public class DefaultMetalTheme extends MetalTheme /** * Returns the third secondary color for this theme. - * + * * @return The third secondary color. */ protected ColorUIResource getSecondary3() @@ -190,66 +190,66 @@ public class DefaultMetalTheme extends MetalTheme /** * Returns the font used for text on controls. In this case, the font is * <code>FontUIResource("Dialog", Font.BOLD, 12)</code>, unless the - * <code>swing.boldMetal</code> UI default is set to {@link Boolean#FALSE} + * <code>swing.boldMetal</code> UI default is set to {@link Boolean#FALSE} * in which case it is <code>FontUIResource("Dialog", Font.PLAIN, 12)</code>. - * + * * @return The font. */ public FontUIResource getControlTextFont() { return getFont(CONTROL_TEXT_FONT); } - + /** * Returns the font used for text in menus. In this case, the font is * <code>FontUIResource("Dialog", Font.BOLD, 12)</code>, unless the - * <code>swing.boldMetal</code> UI default is set to {@link Boolean#FALSE} + * <code>swing.boldMetal</code> UI default is set to {@link Boolean#FALSE} * in which case it is <code>FontUIResource("Dialog", Font.PLAIN, 12)</code>. - * + * * @return The font used for text in menus. */ public FontUIResource getMenuTextFont() { return getFont(MENU_TEXT_FONT); } - + /** * Returns the font used for sub text. In this case, the font is * <code>FontUIResource("Dialog", Font.PLAIN, 10)</code>. - * + * * @return The font used for sub text. */ public FontUIResource getSubTextFont() { return SUB_TEXT_FONT; } - + /** * Returns the font used for system text. In this case, the font is * <code>FontUIResource("Dialog", Font.PLAIN, 12)</code>. - * + * * @return The font used for system text. */ public FontUIResource getSystemTextFont() { return SYSTEM_TEXT_FONT; } - + /** * Returns the font used for user text. In this case, the font is * <code>FontUIResource("Dialog", Font.PLAIN, 12)</code>. - * - * @return The font used for user text. + * + * @return The font used for user text. */ public FontUIResource getUserTextFont() { return USER_TEXT_FONT; } - + /** - * Returns the font used for window titles. In this case, the font is + * Returns the font used for window titles. In this case, the font is * <code>FontUIResource("Dialog", Font.BOLD, 12)</code>. - * + * * @return The font used for window titles. */ public FontUIResource getWindowTitleFont() diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalBorders.java b/libjava/classpath/javax/swing/plaf/metal/MetalBorders.java index d4e3a84..2536299 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalBorders.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalBorders.java @@ -104,15 +104,15 @@ public class MetalBorders /** * <p>A border used for {@link JButton} components.</p> - * + * * <p>This {@link Border} implementation can handle only instances of * {@link AbstractButton} and their subclasses.</p> - * + * * <p>If the Metal Look and Feel's current theme is 'Ocean' the border * will be painted with a special highlight when the mouse cursor if * over the button (ie. the property <code>rollover</code> of the * button's model is <code>true</code>) and is not a <b>direct</b> - * child of a {@link JToolBar}.</p> + * child of a {@link JToolBar}.</p> */ public static class ButtonBorder extends AbstractBorder implements UIResource { @@ -230,7 +230,7 @@ public class MetalBorders g.setColor(middle); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); - + // draw crossing pixels of both borders g.setColor(shadow); g.drawRect(x + 1, y + h - 2, 0, 0); @@ -238,11 +238,11 @@ public class MetalBorders } } } - else + else { // draw disabled border g.setColor(MetalLookAndFeel.getInactiveControlTextColor()); - g.drawRect(x, y, w - 2, h - 2); + g.drawRect(x, y, w - 2, h - 2); } } @@ -260,7 +260,7 @@ public class MetalBorders int y, int w, int h) { ButtonModel bmodel = null; - + // The RI will fail with a ClassCastException in such a situation. // This code tries to be more helpful. if (c instanceof AbstractButton) @@ -304,11 +304,11 @@ public class MetalBorders g.drawRect(x, y, w - 1, h - 1); } } - else + else { // draw disabled border g.setColor(MetalLookAndFeel.getInactiveControlTextColor()); - g.drawRect(x, y, w - 2, h - 2); + g.drawRect(x, y, w - 2, h - 2); } } @@ -325,7 +325,7 @@ public class MetalBorders } /** - * Returns the insets of the <code>ButtonBorder</code> in the specified + * Returns the insets of the <code>ButtonBorder</code> in the specified * <code>newInsets</code> object. * * @param c the component for which the border is used (ignored). @@ -357,22 +357,22 @@ public class MetalBorders { // Nothing to do here. } - + /** * Returns the border insets. - * + * * @param c the component (ignored). - * + * * @return The border insets. */ public Insets getBorderInsets(Component c) { return getBorderInsets(c, null); } - + /** * Returns the border insets. - * + * * @param c the component (ignored). * @return The border insets. */ @@ -387,12 +387,12 @@ public class MetalBorders newInsets.bottom = 2; newInsets.right = 3; } - return newInsets; + return newInsets; } - + /** * Paints the border for the specified component. - * + * * @param c the component. * @param g the graphics device. * @param x the x-coordinate. @@ -400,13 +400,13 @@ public class MetalBorders * @param w the width. * @param h the height. */ - public void paintBorder(Component c, Graphics g, int x, int y, int w, + public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { - g.setColor(MetalLookAndFeel.getControlDarkShadow()); - g.drawRect(x, y, w - 1, h - 1); + g.setColor(MetalLookAndFeel.getControlDarkShadow()); + g.drawRect(x, y, w - 1, h - 1); } - + } /** @@ -416,7 +416,7 @@ public class MetalBorders implements UIResource { private static final Insets borderInsets = new Insets(2, 2, 2, 2); - + /** * Creates a new border instance. */ @@ -424,27 +424,27 @@ public class MetalBorders { // Nothing to do here. } - + /** * Returns the border insets. - * + * * @param c the component (ignored). - * + * * @return The border insets. */ public Insets getBorderInsets(Component c) { return borderInsets; } - + /** * Returns the border insets. - * + * * @param c the component (ignored). * @param newInsets an existing insets instance, that will be populated * with the border insets and returned as the result * (<code>null</code> not permitted). - * + * * @return The <code>newInsets</code> reference. */ public Insets getBorderInsets(Component c, Insets newInsets) @@ -453,12 +453,12 @@ public class MetalBorders newInsets.left = borderInsets.left; newInsets.bottom = borderInsets.bottom; newInsets.right = borderInsets.right; - return newInsets; + return newInsets; } - + /** * Paints the border for the specified component. - * + * * @param c the component (ignored). * @param g the graphics device. * @param x the x-coordinate. @@ -466,9 +466,9 @@ public class MetalBorders * @param w the width. * @param h the height. */ - public void paintBorder(Component c, Graphics g, int x, int y, int w, + public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) - { + { Color savedColor = g.getColor(); g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawRect(x, y, w - 2, h - 2); @@ -479,13 +479,13 @@ public class MetalBorders g.drawLine(x + w - 2, y + 1, x + w - 2, y + 1); g.setColor(savedColor); } - + } - + /** - * A border used for a {@link JInternalFrame} when it is being used as a + * A border used for a {@link JInternalFrame} when it is being used as a * palette. - * + * * @since 1.3 */ public static class PaletteBorder extends AbstractBorder @@ -500,12 +500,12 @@ public class MetalBorders { // Nothing to do here. } - + /** * Returns the border insets. - * + * * @param c the component (ignored). - * + * * @return The border insets. */ public Insets getBorderInsets(Component c) @@ -515,26 +515,26 @@ public class MetalBorders /** * Returns the border insets. - * + * * @param c the component (ignored). * @param newInsets an existing insets instance, that will be populated * with the border insets and returned as the result * (<code>null</code> not permitted). - * + * * @return The <code>newInsets</code> reference. */ public Insets getBorderInsets(Component c, Insets newInsets) - { + { newInsets.top = borderInsets.top; newInsets.left = borderInsets.left; newInsets.bottom = borderInsets.bottom; newInsets.right = borderInsets.right; - return newInsets; + return newInsets; } - + /** * Paints the border for the specified component. - * + * * @param c the component (ignored). * @param g the graphics device. * @param x the x-coordinate. @@ -542,26 +542,26 @@ public class MetalBorders * @param w the width. * @param h the height. */ - public void paintBorder(Component c, Graphics g, int x, int y, int w, + public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { Color savedColor = g.getColor(); - + // draw the outline g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); g.drawRect(x, y, w - 1, h - 1); - + // put a dot in each corner g.setColor(MetalLookAndFeel.getControl()); g.fillRect(x, y, 1, 1); g.fillRect(x + w - 1, y, 1, 1); g.fillRect(x + w - 1, y + h - 1, 1, 1); - g.fillRect(x, y + h - 1, 1, 1); + g.fillRect(x, y + h - 1, 1, 1); g.setColor(savedColor); } } - + /** * A border used for the {@link JTextField} component. */ @@ -575,10 +575,10 @@ public class MetalBorders { // Nothing to do here. } - + /** * Paints the border for the specified component. - * + * * @param c the component (ignored). * @param g the graphics device. * @param x the x-coordinate. @@ -586,7 +586,7 @@ public class MetalBorders * @param w the width. * @param h the height. */ - public void paintBorder(Component c, Graphics g, int x, int y, int w, + public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { boolean enabledTextBorder; @@ -608,7 +608,7 @@ public class MetalBorders g.setColor(savedColor); } } - + } /** @@ -626,27 +626,27 @@ public class MetalBorders { // Nothing to do here. } - + /** * Returns the border insets. - * + * * @param c the component (ignored). - * + * * @return The border insets. */ public Insets getBorderInsets(Component c) { return borderInsets; } - + /** * Returns the border insets. - * + * * @param c the component (ignored). * @param newInsets an existing insets instance, that will be populated * with the border insets and returned as the result * (<code>null</code> not permitted). - * + * * @return The <code>newInsets</code> reference. */ public Insets getBorderInsets(Component c, Insets newInsets) @@ -655,12 +655,12 @@ public class MetalBorders newInsets.left = borderInsets.left; newInsets.bottom = borderInsets.bottom; newInsets.right = borderInsets.right; - return newInsets; + return newInsets; } - + /** * Paints the border for the specified component. - * + * * @param c the component. * @param g the graphics device. * @param x the x-coordinate. @@ -668,47 +668,47 @@ public class MetalBorders * @param w the width. * @param h the height. */ - public void paintBorder(Component c, Graphics g, int x, int y, int w, + public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { - + JInternalFrame f = (JInternalFrame) c; if (f.isSelected()) g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); else g.setColor(MetalLookAndFeel.getControlDarkShadow()); - + // fill the border background g.fillRect(x, y, w, 5); g.fillRect(x, y, 5, h); g.fillRect(x + w - 5, y, 5, h); g.fillRect(x, y + h - 5, w, 5); - + // draw a dot in each corner g.setColor(MetalLookAndFeel.getControl()); g.fillRect(x, y, 1, 1); g.fillRect(x + w - 1, y, 1, 1); g.fillRect(x + w - 1, y + h - 1, 1, 1); g.fillRect(x, y + h - 1, 1, 1); - + // draw the lines g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x + 14, y + 2, x + w - 15, y + 2); g.drawLine(x + 14, y + h - 3, x + w - 15, y + h - 3); g.drawLine(x + 2, y + 14, x + 2, y + h - 15); g.drawLine(x + w - 3, y + 14, x + w - 3, y + h - 15); - + // draw the line highlights if (f.isSelected()) g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); - else + else g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(x + 15, y + 3, x + w - 14, y + 3); g.drawLine(x + 15, y + h - 2, x + w - 14, y + h - 2); g.drawLine(x + 3, y + 15, x + 3, y + h - 14); g.drawLine(x + w - 2, y + 15, x + w - 2, y + h - 14); } - + } /** @@ -718,7 +718,7 @@ public class MetalBorders public static class OptionDialogBorder extends AbstractBorder implements UIResource { - + /** * Creates a new border instance. */ @@ -726,22 +726,22 @@ public class MetalBorders { // Nothing to do here. } - + /** * Returns the border insets. - * + * * @param c the component (ignored). - * + * * @return The border insets. */ public Insets getBorderInsets(Component c) { return getBorderInsets(c, null); } - + /** * Returns the border insets. - * + * * @param c the component (ignored). * @return The border insets. */ @@ -756,12 +756,12 @@ public class MetalBorders newInsets.bottom = 3; newInsets.right = 3; } - return newInsets; + return newInsets; } - + /** * Paints the border for the specified component. - * + * * @param c the component. * @param g the graphics device. * @param x the x-coordinate. @@ -769,10 +769,10 @@ public class MetalBorders * @param w the width. * @param h the height. */ - public void paintBorder(Component c, Graphics g, int x, int y, int w, + public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { - + JInternalFrame f = (JInternalFrame) c; g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); if (f.getContentPane() instanceof JOptionPane) @@ -791,32 +791,32 @@ public class MetalBorders Color bc = UIManager.getColor( "OptionPane.warningDialog.border.background"); if (bc != null) - g.setColor(bc); + g.setColor(bc); } else if (type == JOptionPane.ERROR_MESSAGE) { Color bc = UIManager.getColor( "OptionPane.errorDialog.border.background"); if (bc != null) - g.setColor(bc); + g.setColor(bc); } } - + // fill the border background g.fillRect(x, y, w, 3); g.fillRect(x, y, 3, h); g.fillRect(x + w - 3, y, 3, h); g.fillRect(x, y + h - 3, w, 3); - + // draw a dot in each corner g.setColor(MetalLookAndFeel.getControl()); g.fillRect(x, y, 1, 1); g.fillRect(x + w - 1, y, 1, 1); g.fillRect(x + w - 1, y + h - 1, 1, 1); g.fillRect(x, y + h - 1, 1, 1); - + } - + } /** @@ -827,7 +827,7 @@ public class MetalBorders { /** The border insets. */ protected static Insets borderInsets = new Insets(2, 2, 2, 2); - + /** * Creates a new border instance. */ @@ -835,11 +835,11 @@ public class MetalBorders { // Nothing to do here. } - + /** * Paints the border for the component. A border is painted only if the * component is a selected {@link JMenu} or an armed {@link JMenuItem}. - * + * * @param c the component. * @param g the graphics device. * @param x the x-coordinate of the border area. @@ -852,7 +852,7 @@ public class MetalBorders { Color dark = MetalLookAndFeel.getPrimaryControlDarkShadow(); Color light = MetalLookAndFeel.getPrimaryControlHighlight(); - if (c instanceof JMenu) + if (c instanceof JMenu) { JMenu menu = (JMenu) c; if (menu.isSelected()) @@ -868,7 +868,7 @@ public class MetalBorders else if (c instanceof JMenuItem) { JMenuItem item = (JMenuItem) c; - if (item.isArmed()) + if (item.isArmed()) { g.setColor(dark); g.drawLine(x, y, x + w, y); @@ -883,27 +883,27 @@ public class MetalBorders } } } - + /** * Returns the border insets. - * + * * @param c the component (ignored). - * + * * @return The border insets. */ public Insets getBorderInsets(Component c) { return borderInsets; } - + /** * Populates <code>insets</code> with the border insets, then returns it. - * + * * @param c the component (ignored). * @param insets the object to populate with the border insets. - * + * * @return The border insets. - * + * * @throws NullPointerException if <code>insets</code> is <code>null</code>. */ public Insets getBorderInsets(Component c, Insets insets) @@ -925,18 +925,18 @@ public class MetalBorders { /** The border insets. */ protected static Insets borderInsets = new Insets(1, 0, 1, 0); - + /** * Creates a new border instance. */ public MenuBarBorder() { } - + /** * Paints the border for the component. A border is painted only if the * component is a selected {@link JMenu} or an armed {@link JMenuItem}. - * + * * @param c the component. * @param g the graphics device. * @param x the x-coordinate of the border area. @@ -957,30 +957,30 @@ public class MetalBorders g.setColor(UIManager.getColor("MenuBar.borderColor")); else g.setColor(MetalLookAndFeel.getControlShadow()); - + g.drawLine(x, y + h - 1, x + w, y + h - 1); } - + /** * Returns the border insets. - * + * * @param c the component (ignored). - * + * * @return The border insets. */ public Insets getBorderInsets(Component c) { return borderInsets; } - + /** * Populates <code>insets</code> with the border insets, then returns it. - * + * * @param c the component (ignored). * @param insets the object to populate with the border insets. - * + * * @return The border insets. - * + * * @throws NullPointerException if <code>insets</code> is <code>null</code>. */ public Insets getBorderInsets(Component c, Insets insets) @@ -1002,7 +1002,7 @@ public class MetalBorders { /** The border insets. */ private static Insets insets = new Insets(1, 1, 2, 2); - + /** * Constructs a new ScrollPaneBorder. */ @@ -1010,7 +1010,7 @@ public class MetalBorders { // Nothing to do here. } - + /** * Returns the insets of the border for the Component <code>c</code>. * @@ -1045,7 +1045,7 @@ public class MetalBorders // paint left border line g.drawLine(x, y, x, y + h - 2); - + // paint right inner border line g.drawLine(x + w - 2, y, x + w - 2, y + h + 1); @@ -1067,11 +1067,11 @@ public class MetalBorders g.drawLine(x + 1, y + h - 2, x + 1, y + h - 2); } - + } - + /** - * A button border that is only visible when the mouse pointer is within + * A button border that is only visible when the mouse pointer is within * the button's bounds. */ public static class RolloverButtonBorder @@ -1084,10 +1084,10 @@ public class MetalBorders { // Nothing to do here. } - + /** * Paints the border. - * + * * @param c the component. * @param g the graphics device. * @param x the x-coordinate. @@ -1095,7 +1095,7 @@ public class MetalBorders * @param w the width. * @param h the height. */ - public void paintBorder(Component c, Graphics g, int x, int y, int w, + public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { // TODO: What should be done here? Obviously the ButtonBorder already @@ -1104,7 +1104,7 @@ public class MetalBorders super.paintBorder(c, g, x, y, w, h); } } - + /** * This border is used in Toolbar buttons as inner border. */ @@ -1120,7 +1120,7 @@ public class MetalBorders { // Nothing to do here. } - + /** * Returns the insets of the RolloverBorder. * @@ -1175,7 +1175,7 @@ public class MetalBorders { // Nothing to do here. } - + /** * Returns the insets of the border, creating a new Insets instance * with each call. @@ -1187,7 +1187,7 @@ public class MetalBorders { return getBorderInsets(c, null); } - + /** * Returns the insets of the border, using the supplied Insets instance. * @@ -1209,7 +1209,7 @@ public class MetalBorders insets.bottom = borderInsets.bottom; insets.right = borderInsets.right; } - + return insets; } @@ -1234,21 +1234,21 @@ public class MetalBorders // draw dark outer border g.setColor(darkShadow); g.drawRect(x, y, w - 1, h - 1); - + // draw highlighted inner border (only top and left) g.setColor(light); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); } - + } /** * A border used for the {@link JToggleButton} component. - * + * * @since 1.3 */ public static class ToggleButtonBorder - extends ButtonBorder + extends ButtonBorder { /** * Creates a new border instance. @@ -1257,7 +1257,7 @@ public class MetalBorders { // Nothing to do here. } - + /** * Paints the toggle button border. * @@ -1272,7 +1272,7 @@ public class MetalBorders int h) { ButtonModel bmodel = null; - + if (c instanceof AbstractButton) bmodel = ((AbstractButton) c).getModel(); @@ -1314,23 +1314,23 @@ public class MetalBorders g.setColor(shadow); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); - + // draw crossing pixels of both borders g.setColor(shadow); g.drawLine(x + 1, y + h - 2, x + 1, y + h - 2); g.drawLine(x + w - 2, y + 1, x + w - 2, y + 1); - + } // draw corners g.setColor(middle); g.drawLine(x, y + h - 1, x, y + h - 1); g.drawLine(x + w - 1, y, x + w - 1, y); } - else + else { // draw disabled border g.setColor(MetalLookAndFeel.getControlDisabled()); - g.drawRect(x, y, w - 2, h - 2); + g.drawRect(x, y, w - 2, h - 2); } } } @@ -1348,22 +1348,22 @@ public class MetalBorders { // Nothing to do here. } - + /** * Returns the border insets. - * + * * @param c the component (ignored). - * + * * @return The border insets. */ public Insets getBorderInsets(Component c) { return getBorderInsets(c, null); } - + /** * Returns the border insets. - * + * * @param c the component (ignored). * @return The border insets. */ @@ -1371,7 +1371,7 @@ public class MetalBorders { JToolBar tb = (JToolBar) c; if (tb.getOrientation() == JToolBar.HORIZONTAL) - { + { if (newInsets == null) newInsets = new Insets(2, 16, 2, 2); else @@ -1381,10 +1381,10 @@ public class MetalBorders newInsets.bottom = 2; newInsets.right = 2; } - return newInsets; + return newInsets; } else // assume JToolBar.VERTICAL - { + { if (newInsets == null) newInsets = new Insets(16, 2, 2, 2); else @@ -1394,14 +1394,14 @@ public class MetalBorders newInsets.bottom = 2; newInsets.right = 2; } - return newInsets; + return newInsets; } } - + /** * Paints the border for the specified component. - * + * * @param c the component. * @param g the graphics device. * @param x the x-coordinate. @@ -1409,27 +1409,27 @@ public class MetalBorders * @param w the width. * @param h the height. */ - public void paintBorder(Component c, Graphics g, int x, int y, int w, + public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { - + JToolBar tb = (JToolBar) c; if (tb.getOrientation() == JToolBar.HORIZONTAL) { - MetalUtils.fillMetalPattern(tb, g, x + 2, y + 2, x + 11, y + h - 5, - MetalLookAndFeel.getControlHighlight(), + MetalUtils.fillMetalPattern(tb, g, x + 2, y + 2, x + 11, y + h - 5, + MetalLookAndFeel.getControlHighlight(), MetalLookAndFeel.getControlDarkShadow()); } else - { - MetalUtils.fillMetalPattern(tb, g, x + 2, y + 2, x + w - 5, y + 11, - MetalLookAndFeel.getControlHighlight(), + { + MetalUtils.fillMetalPattern(tb, g, x + 2, y + 2, x + w - 5, y + 11, + MetalLookAndFeel.getControlHighlight(), MetalLookAndFeel.getControlDarkShadow()); } } - + } - + /** * A border for table header cells. * @@ -1499,17 +1499,17 @@ public class MetalBorders { Border outer = new ButtonBorder(); Border inner = getMarginBorder(); - buttonBorder = new BorderUIResource.CompoundBorderUIResource(outer, + buttonBorder = new BorderUIResource.CompoundBorderUIResource(outer, inner); } return buttonBorder; } - + /** * Returns a border for use with {@link JToggleButton} components. * * @return A border. - * + * * @since 1.3 */ public static Border getToggleButtonBorder() @@ -1527,23 +1527,23 @@ public class MetalBorders /** * Returns a border instance that is used with a {@link JInternalFrame} when * it is in the iconified state. - * + * * @return A border. - * + * * @since 1.3 */ public static Border getDesktopIconBorder() { if (desktopIconBorder == null) desktopIconBorder = new DesktopIconBorder(); - return desktopIconBorder; + return desktopIconBorder; } /** * Returns a border for use by the {@link JTextField} component. - * + * * @return A border. - * + * * @since 1.3 */ public static Border getTextFieldBorder() @@ -1608,7 +1608,7 @@ public class MetalBorders /** * Returns a shared instance of a compound border for rollover buttons. - * + * * @return A shared border instance. */ static Border getRolloverBorder() @@ -1617,7 +1617,7 @@ public class MetalBorders { Border outer = new MetalBorders.RolloverButtonBorder(); Border inner = MetalBorders.getMarginBorder(); - rolloverBorder = new BorderUIResource.CompoundBorderUIResource(outer, + rolloverBorder = new BorderUIResource.CompoundBorderUIResource(outer, inner); } return rolloverBorder; diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalButtonListener.java b/libjava/classpath/javax/swing/plaf/metal/MetalButtonListener.java index f2f778f..7cf84e5 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalButtonListener.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalButtonListener.java @@ -45,25 +45,25 @@ import javax.swing.plaf.basic.BasicButtonListener; /** * A listener for buttons under the {@link MetalLookAndFeel}. - * + * * @see MetalButtonUI#createButtonListener */ -class MetalButtonListener extends BasicButtonListener +class MetalButtonListener extends BasicButtonListener { - + /** * Creates a new instance. - * + * * @param button the button. */ public MetalButtonListener(AbstractButton button) { super(button); } - + /** * Handles property change events. - * + * * @param e the event. */ public void propertyChange(PropertyChangeEvent e) diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java index 108b3b2..974f0a8 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalButtonUI.java @@ -74,7 +74,7 @@ public class MetalButtonUI * The color used to draw the focus rectangle around the text and/or icon. */ protected Color focusColor; - + /** * The background color for the button when it is pressed. */ @@ -87,12 +87,12 @@ public class MetalButtonUI /** * Returns a UI delegate for the specified component. - * + * * @param c the component (should be a subclass of {@link AbstractButton}). - * + * * @return A new instance of <code>MetalButtonUI</code>. */ - public static ComponentUI createUI(JComponent c) + public static ComponentUI createUI(JComponent c) { if (sharedUI == null) sharedUI = new MetalButtonUI(); @@ -143,9 +143,9 @@ public class MetalButtonUI /** * Installs the default settings for the specified button. - * + * * @param button the button. - * + * * @see #uninstallDefaults(AbstractButton) */ public void installDefaults(AbstractButton button) @@ -157,7 +157,7 @@ public class MetalButtonUI /** * Removes the defaults added by {@link #installDefaults(AbstractButton)}. */ - public void uninstallDefaults(AbstractButton button) + public void uninstallDefaults(AbstractButton button) { // This is overridden to be public, for whatever reason. super.uninstallDefaults(button); @@ -166,22 +166,22 @@ public class MetalButtonUI /** * Paints the background of the button to indicate that it is in the * "pressed" state. - * + * * @param g the graphics context. * @param b the button. */ - protected void paintButtonPressed(Graphics g, AbstractButton b) - { + protected void paintButtonPressed(Graphics g, AbstractButton b) + { if (b.isContentAreaFilled()) { g.setColor(getSelectColor()); g.fillRect(0, 0, b.getWidth(), b.getHeight()); } } - - /** + + /** * Paints the focus rectangle around the button text and/or icon. - * + * * @param g the graphics context. * @param b the button. * @param viewRect the button bounds. @@ -189,7 +189,7 @@ public class MetalButtonUI * @param iconRect the icon bounds. */ protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, - Rectangle textRect, Rectangle iconRect) + Rectangle textRect, Rectangle iconRect) { if (b.isEnabled() && b.hasFocus() && b.isFocusPainted()) { @@ -201,17 +201,17 @@ public class MetalButtonUI g.setColor(savedColor); } } - + /** * Paints the button text. - * + * * @param g the graphics context. * @param c the button. * @param textRect the text bounds. * @param text the text to display. */ protected void paintText(Graphics g, JComponent c, Rectangle textRect, - String text) + String text) { AbstractButton b = (AbstractButton) c; Font f = b.getFont(); @@ -227,7 +227,7 @@ public class MetalButtonUI { g.setColor(getDisabledTextColor()); g.drawString(text, textRect.x, textRect.y + fm.getAscent()); - } + } } /** diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalCheckBoxIcon.java b/libjava/classpath/javax/swing/plaf/metal/MetalCheckBoxIcon.java index 30ee931..5e0ac06 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalCheckBoxIcon.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalCheckBoxIcon.java @@ -134,7 +134,7 @@ public class MetalCheckBoxIcon MetalUtils.paintGradient(g, x, y, getIconWidth(), getIconHeight(), SwingConstants.VERTICAL, "CheckBox.gradient"); border.paintBorder(c, g, x, y, getIconWidth(), getIconHeight()); - + AbstractButton b = (AbstractButton) c; if (b.isSelected()) drawCheck(b, g, x, y); diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalCheckBoxUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalCheckBoxUI.java index c794164..11979e1 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalCheckBoxUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalCheckBoxUI.java @@ -75,10 +75,10 @@ public class MetalCheckBoxUI instance = new MetalCheckBoxUI(); return instance; } - + /** * Returns the prefix for properties defined in the {@link UIDefaults} table. - * + * * @return The property prefix (<code>"CheckBox."</code>). */ public String getPropertyPrefix() @@ -86,4 +86,3 @@ public class MetalCheckBoxUI return "CheckBox."; } } - diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxButton.java b/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxButton.java index 265ea7e..8ec8bad 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxButton.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxButton.java @@ -63,22 +63,22 @@ public class MetalComboBoxButton /** A reference to the JList. */ protected JList listBox; - + /** * Used for rendering the selected item. */ protected CellRendererPane rendererPane; - + /** The button icon. */ protected Icon comboIcon; - + /** Display just the icon, or the icon plus the label. */ protected boolean iconOnly; - + /** * Creates a new button. - * - * @param cb the combo that the button is used for (<code>null</code> not + * + * @param cb the combo that the button is used for (<code>null</code> not * permitted). * @param i the icon displayed on the button. * @param pane the rendering pane. @@ -87,13 +87,13 @@ public class MetalComboBoxButton public MetalComboBoxButton(JComboBox cb, Icon i, CellRendererPane pane, JList list) { - this(cb, i, cb.isEditable(), pane, list); + this(cb, i, cb.isEditable(), pane, list); } - + /** * Creates a new button. - * - * @param cb the combo that the button is used for (<code>null</code> not + * + * @param cb the combo that the button is used for (<code>null</code> not * permitted). * @param i the icon displayed on the button. * @param onlyIcon a flag that specifies whether the button displays only an @@ -116,84 +116,84 @@ public class MetalComboBoxButton setEnabled(comboBox.isEnabled()); setFocusable(comboBox.isEnabled()); } - + /** * Returns the combo box that the button is used with. - * + * * @return The combo box. */ public final JComboBox getComboBox() { return comboBox; } - + /** * Sets the combo box that the button is used with. - * + * * @param cb the combo box. */ public final void setComboBox(JComboBox cb) { comboBox = cb; } - + /** * Returns the icon displayed by the button. By default, this will be an * instance of {@link MetalComboBoxIcon}. - * + * * @return The icon displayed by the button. */ public final Icon getComboIcon() { return comboIcon; } - + /** * Sets the icon displayed by the button. - * + * * @param i the icon. */ public final void setComboIcon(Icon i) { comboIcon = i; } - + /** * Returns a flag that controls whether the button displays an icon only, * or text as well. - * + * * @return A boolean. */ public final boolean isIconOnly() { return iconOnly; } - + /** * Sets the flag that controls whether the button displays an icon only, * or text as well. - * + * * @param isIconOnly the flag. */ public final void setIconOnly(boolean isIconOnly) { iconOnly = isIconOnly; } - + /** * Returns <code>false</code>, to indicate that this component is not part * of the focus traversal group. - * + * * @return <code>false</code> */ public boolean isFocusTraversable() { return false; } - + /** * Enables or disables the button. - * + * * @param enabled the new status. */ public void setEnabled(boolean enabled) @@ -210,10 +210,10 @@ public class MetalComboBoxButton setForeground(UIManager.getColor("ComboBox.disabledForeground")); } } - + /** * Paints the component. - * + * * @param g the graphics device. */ public void paintComponent(Graphics g) @@ -259,7 +259,7 @@ public class MetalComboBoxButton Component comp = renderer.getListCellRendererComponent(listBox, comboBox.getSelectedItem(), -1, false, false); comp.setFont(rendererPane.getFont()); - + if ((model.isArmed() && model.isPressed()) || (comboBox.isFocusOwner() && !comboBox.isPopupVisible())) { diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxEditor.java b/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxEditor.java index 11e4151..8872d74 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxEditor.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxEditor.java @@ -65,10 +65,10 @@ public class MetalComboBoxEditor extends BasicComboBoxEditor { // Nothing to do here. } - + /** * Paints the border for the specified component. - * + * * @param c the component (ignored). * @param g the graphics device. * @param x the x-coordinate. @@ -76,7 +76,7 @@ public class MetalComboBoxEditor extends BasicComboBoxEditor * @param w the width. * @param h the height. */ - public void paintBorder(Component c, Graphics g, int x, int y, int w, + public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { g.translate(x, y); @@ -123,11 +123,11 @@ public class MetalComboBoxEditor extends BasicComboBoxEditor public Insets getBorderInsets(Component c) { return editorBorderInsets; - } + } } - + /** - * A subclass of {@link MetalComboBoxEditor} that implements the + * A subclass of {@link MetalComboBoxEditor} that implements the * {@link javax.swing.plaf.UIResource} interface. */ public static class UIResource extends MetalComboBoxEditor @@ -177,7 +177,7 @@ public class MetalComboBoxEditor extends BasicComboBoxEditor /** The editor's border insets. */ protected static Insets editorBorderInsets = new Insets(2, 2, 2, 0); - + /** * Creates a new editor. */ @@ -186,5 +186,5 @@ public class MetalComboBoxEditor extends BasicComboBoxEditor editor = new EditorTextField("", 9); editor.setBorder(new MetalComboBoxEditorBorder()); } - + } diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxIcon.java b/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxIcon.java index 944ce39..45c8ead 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxIcon.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxIcon.java @@ -48,20 +48,20 @@ import javax.swing.Icon; /** * An icon used by the {@link MetalComboBoxUI} class. */ -public class MetalComboBoxIcon implements Icon, Serializable +public class MetalComboBoxIcon implements Icon, Serializable { - + /** * Creates a new icon. */ - public MetalComboBoxIcon() + public MetalComboBoxIcon() { // nothing required. } - + /** * Returns the icon width, which for this icon is 10 pixels. - * + * * @return <code>10</code>. */ public int getIconWidth() @@ -71,7 +71,7 @@ public class MetalComboBoxIcon implements Icon, Serializable /** * Returns the icon height, which for this icon is 5 pixels. - * + * * @return <code>5</code>. */ public int getIconHeight() @@ -81,7 +81,7 @@ public class MetalComboBoxIcon implements Icon, Serializable /** * Paints the icon at the location (x, y). - * + * * @param c the combo box (ignored here). * @param g the graphics device. * @param x the x coordinate. diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxUI.java index 53d49c3..b9019b7 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalComboBoxUI.java @@ -78,22 +78,22 @@ public class MetalComboBoxUI extends BasicComboBoxUI { // Nothing to do here. } - + /** * Arranges the editor (if visible) and button that comprise the combo * box. - * + * * @param parent the parent. */ public void layoutContainer(Container parent) { layoutComboBox(parent, this); } - + /** - * Calls the <code>layoutContainer(Container)</code> method in the super + * Calls the <code>layoutContainer(Container)</code> method in the super * class. - * + * * @param parent the container. */ public void superLayout(Container parent) @@ -101,9 +101,9 @@ public class MetalComboBoxUI extends BasicComboBoxUI super.layoutContainer(parent); } } - + /** - * A listener used to handle property changes in the {@link JComboBox} + * A listener used to handle property changes in the {@link JComboBox} * component, to ensure that the UI delegate accurately reflects the current * state in the rendering onscreen. */ @@ -117,11 +117,11 @@ public class MetalComboBoxUI extends BasicComboBoxUI { // Nothing to do here. } - + /** * Handles a property change event, updating the UI components as * appropriate. - * + * * @param e the event. */ public void propertyChange(PropertyChangeEvent e) @@ -156,7 +156,7 @@ public class MetalComboBoxUI extends BasicComboBoxUI /** * A popup menu for the combo-box. - * + * * @see #createPopup() * * @deprecated 1.4 @@ -165,20 +165,20 @@ public class MetalComboBoxUI extends BasicComboBoxUI { /** * Creates a new popup. - * + * * @param cBox the combo box. */ public MetalComboPopup(JComboBox cBox) { - super(cBox); + super(cBox); } - + public void delegateFocus(MouseEvent e) { super.delegateFocus(e); } } - + /** * Constructs a new instance of MetalComboBoxUI. */ @@ -198,61 +198,61 @@ public class MetalComboBoxUI extends BasicComboBoxUI { return new MetalComboBoxUI(); } - + /** * Creates an editor for the combo box. - * + * * @return An editor. */ protected ComboBoxEditor createEditor() { - return new MetalComboBoxEditor.UIResource(); + return new MetalComboBoxEditor.UIResource(); } - + /** * Creates a popup for the combo box. - * + * * @return A popup. */ protected ComboPopup createPopup() { return super.createPopup(); } - + /** * Creates a new button for use in rendering the JComboBox. - * + * * @return A button. */ protected JButton createArrowButton() { - JButton button = new MetalComboBoxButton(comboBox, new MetalComboBoxIcon(), - currentValuePane, listBox); + JButton button = new MetalComboBoxButton(comboBox, new MetalComboBoxIcon(), + currentValuePane, listBox); button.setMargin(new Insets(0, 1, 1, 3)); return button; } - + /** * Creates a new property change listener. - * + * * @return A new property change listener. */ public PropertyChangeListener createPropertyChangeListener() { return new MetalPropertyChangeListener(); } - + public void paint(Graphics g, JComponent c) { // do nothing, the button and text field are painted elsewhere } - + /** * Updates the button and text field to reflect a change in the 'editable' * property. - * + * * @param e the event. - * + * * @deprecated 1.4 */ protected void editablePropertyChanged(PropertyChangeEvent e) @@ -265,32 +265,32 @@ public class MetalComboBoxUI extends BasicComboBoxUI comboBox.repaint(); } } - + /** * Creates a new layout manager for the UI delegate. - * + * * @return A new layout manager. */ protected LayoutManager createLayoutManager() { return new MetalComboBoxLayoutManager(); } - + /** * Not used in Classpath. - * + * * @deprecated 1.4 */ protected void removeListeners() { - // no longer used in JDK 1.4 + // no longer used in JDK 1.4 } - + /** * Returns the minimum size for the combo. - * + * * @param c the component - * + * * @return The minimum size for the combo box. */ public Dimension getMinimumSize(JComponent c) @@ -328,7 +328,7 @@ public class MetalComboBoxUI extends BasicComboBoxUI isMinimumSizeDirty = false; return new Dimension(cachedMinimumSize); } - + /** * Configures the editor for this combo box. */ @@ -350,8 +350,8 @@ public class MetalComboBoxUI extends BasicComboBoxUI if (focusListener != null) editor.removeFocusListener(focusListener); } - - /** + + /** * Lays out the ComboBox */ public void layoutComboBox(Container parent, diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalFileChooserUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalFileChooserUI.java index 9bded82..df49edf 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalFileChooserUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalFileChooserUI.java @@ -100,17 +100,17 @@ import javax.swing.table.DefaultTableModel; * A UI delegate for the {@link JFileChooser} component. This class is only * partially implemented and is not usable yet. */ -public class MetalFileChooserUI +public class MetalFileChooserUI extends BasicFileChooserUI { - + /** * A renderer for the files and directories in the file chooser table. */ class TableFileRenderer extends DefaultTableCellRenderer { - + /** * Creates a new renderer. */ @@ -118,17 +118,17 @@ public class MetalFileChooserUI { super(); } - + /** * Returns a component that can render the specified value. - * + * * @param table the table * @param value the string value of the cell * @param isSelected is the item selected? * @param hasFocus does the item have the focus? * @param row the row * @param column the column - * + * * @return The renderer. */ public Component getTableCellRendererComponent(JTable table, Object value, @@ -143,12 +143,12 @@ public class MetalFileChooserUI } else setIcon(null); - + setText(value.toString()); setOpaque(true); setEnabled(table.isEnabled()); setFont(fileList.getFont()); - + if (startEditing && column == 0 || !isSelected) { setBackground(table.getBackground()); @@ -164,20 +164,20 @@ public class MetalFileChooserUI setBorder(UIManager.getBorder("Table.focusCellHighlightBorder")); else setBorder(noFocusBorder); - + return this; } } - + /** * ActionListener for the list view. */ class ListViewActionListener implements ActionListener { - + /** * This method is invoked when an action occurs. - * + * * @param e - * the <code>ActionEvent</code> that occurred */ @@ -195,23 +195,23 @@ public class MetalFileChooserUI if (index.length > 0) for (int i = 0; i < index.length; i++) fileList.getSelectionModel().addSelectionInterval(index[i], index[i]); - + fc.add(fileListPanel, BorderLayout.CENTER); fc.revalidate(); fc.repaint(); } } } - + /** * ActionListener for the details view. */ class DetailViewActionListener implements ActionListener { - + /** * This method is invoked when an action occurs. - * + * * @param e - * the <code>ActionEvent</code> that occurred */ @@ -223,7 +223,7 @@ public class MetalFileChooserUI JFileChooser fc = getFileChooser(); listView = false; fc.remove(fileListPanel); - + if (fileTable == null) createDetailsView(fc); else @@ -235,18 +235,18 @@ public class MetalFileChooserUI for (int i = 0; i < index.length; i++) fileTable.getSelectionModel().addSelectionInterval(index[i], index[i]); } - + fc.add(fileTablePanel, BorderLayout.CENTER); fc.revalidate(); fc.repaint(); } } } - + /** * A property change listener. */ - class MetalFileChooserPropertyChangeListener + class MetalFileChooserPropertyChangeListener implements PropertyChangeListener { /** @@ -255,25 +255,25 @@ public class MetalFileChooserUI public MetalFileChooserPropertyChangeListener() { } - + /** * Handles a property change event. - * + * * @param e the event. */ public void propertyChange(PropertyChangeEvent e) { JFileChooser filechooser = getFileChooser(); - + String n = e.getPropertyName(); if (n.equals(JFileChooser.MULTI_SELECTION_ENABLED_CHANGED_PROPERTY)) { - int mode = -1; + int mode = -1; if (filechooser.isMultiSelectionEnabled()) mode = ListSelectionModel.MULTIPLE_INTERVAL_SELECTION; else mode = ListSelectionModel.SINGLE_SELECTION; - + if (listView) fileList.setSelectionMode(mode); else @@ -282,7 +282,7 @@ public class MetalFileChooserUI else if (n.equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { File file = filechooser.getSelectedFile(); - + if (file != null && filechooser.getDialogType() == JFileChooser.SAVE_DIALOG) { @@ -301,12 +301,12 @@ public class MetalFileChooserUI filechooser.setApproveButtonToolTipText(saveButtonToolTipText); } } - + if (file == null) setFileName(null); - else if (file.isFile() || filechooser.getFileSelectionMode() - != JFileChooser.FILES_ONLY) - setFileName(file.getName()); + else if (file.isFile() || filechooser.getFileSelectionMode() + != JFileChooser.FILES_ONLY) + setFileName(file.getName()); int index = -1; index = getModel().indexOf(file); if (index >= 0) @@ -327,7 +327,7 @@ public class MetalFileChooserUI } } } - + else if (n.equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { if (listView) @@ -349,7 +349,7 @@ public class MetalFileChooserUI boolean hasParent = currentDirectory.getParentFile() != null; getChangeToParentDirectoryAction().setEnabled(hasParent); } - + else if (n.equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY)) { filterModel.propertyChange(e); @@ -369,14 +369,14 @@ public class MetalFileChooserUI getApproveButtonToolTipText(filechooser)); approveButton.setMnemonic(getApproveButtonMnemonic(filechooser)); } - + else if (n.equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) approveButton.setText(getApproveButtonText(filechooser)); - + else if (n.equals( JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) approveButton.setToolTipText(getApproveButtonToolTipText(filechooser)); - + else if (n.equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) approveButton.setMnemonic(getApproveButtonMnemonic(filechooser)); @@ -393,7 +393,7 @@ public class MetalFileChooserUI topPanel.repaint(); topPanel.doLayout(); } - + else if (n.equals( JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { @@ -404,7 +404,7 @@ public class MetalFileChooserUI filechooser.removeChoosableFileFilter( getAcceptAllFileFilter(filechooser)); } - + else if (n.equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); @@ -414,7 +414,7 @@ public class MetalFileChooserUI if (newval != null) getAccessoryPanel().add(newval); } - + if (n.equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || n.equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || n.equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) @@ -425,7 +425,7 @@ public class MetalFileChooserUI if (fileList != null) fileList.removeAll(); startEditing = false; - + // Set text on button back to original. if (filechooser.getDialogType() == JFileChooser.SAVE_DIALOG) { @@ -434,16 +434,16 @@ public class MetalFileChooserUI filechooser.setApproveButtonText(saveButtonText); filechooser.setApproveButtonToolTipText(saveButtonToolTipText); } - + rescanCurrentDirectory(filechooser); } - + filechooser.revalidate(); filechooser.repaint(); } } - - /** + + /** * A combo box model containing the selected directory and all its parent * directories. */ @@ -453,46 +453,46 @@ public class MetalFileChooserUI { /** Storage for the items in the model. */ private List items; - + /** The index of the selected item. */ private int selectedIndex; - + /** * Creates a new model. */ - public DirectoryComboBoxModel() + public DirectoryComboBoxModel() { items = new java.util.ArrayList(); selectedIndex = -1; } - + /** * Returns the number of items in the model. - * + * * @return The number of items in the model. */ public int getSize() { return items.size(); } - + /** * Returns the item at the specified index. - * + * * @param index the item index. - * + * * @return The item. */ public Object getElementAt(int index) { return items.get(index); } - + /** * Returns the depth of the item at the given <code>index</code>. - * + * * @param index the item index. - * + * * @return The depth. */ public int getDepth(int index) @@ -502,22 +502,22 @@ public class MetalFileChooserUI /** * Returns the selected item, or <code>null</code> if no item is selected. - * + * * @return The selected item, or <code>null</code>. */ public Object getSelectedItem() { - if (selectedIndex >= 0) + if (selectedIndex >= 0) return items.get(selectedIndex); else return null; } - + /** * Sets the selected item. This clears all the directories from the * existing list, and repopulates it with the new selected directory * and all its parent directories. - * + * * @param selectedDirectory the selected directory. */ public void setSelectedItem(Object selectedDirectory) @@ -533,7 +533,7 @@ public class MetalFileChooserUI selectedIndex = items.indexOf(selectedDirectory); fireContentsChanged(this, 0, items.size() - 1); } - + } /** @@ -549,10 +549,10 @@ public class MetalFileChooserUI { // Nothing to do here. } - + /** * Handles the action event. - * + * * @param e the event. */ public void actionPerformed(ActionEvent e) @@ -581,17 +581,17 @@ public class MetalFileChooserUI { indentIcon = new IndentIcon(); } - + /** - * Returns a component that can be used to paint the given value within + * Returns a component that can be used to paint the given value within * the list. - * + * * @param list the list. * @param value the value (a {@link File}). * @param index the item index. * @param isSelected is the item selected? * @param cellHasFocus does the list cell have focus? - * + * * @return The list cell renderer. */ public Component getListCellRendererComponent(JList list, Object value, @@ -671,7 +671,7 @@ public class MetalFileChooserUI { icon.paintIcon(c, g, x + depth * INDENT, y); } - + } /** @@ -680,7 +680,7 @@ public class MetalFileChooserUI protected class FileRenderer extends DefaultListCellRenderer { - + /** * Creates a new renderer. */ @@ -688,16 +688,16 @@ public class MetalFileChooserUI { // Nothing to do here. } - + /** * Returns a component that can render the specified value. - * + * * @param list the list. * @param value the value (a {@link File}). * @param index the index. * @param isSelected is the item selected? * @param cellHasFocus does the item have the focus? - * + * * @return The renderer. */ public Component getListCellRendererComponent(JList list, Object value, @@ -751,7 +751,7 @@ public class MetalFileChooserUI /** The index of the selected file filter. */ private Object selected; - + /** * Creates a new model. */ @@ -761,10 +761,10 @@ public class MetalFileChooserUI filters[0] = getAcceptAllFileFilter(getFileChooser()); selected = filters[0]; } - + /** * Handles property changes. - * + * * @param e the property change event. */ public void propertyChange(PropertyChangeEvent e) @@ -788,10 +788,10 @@ public class MetalFileChooserUI fireContentsChanged(this, 0, filters.length); } } - + /** * Sets the selected filter. - * + * * @param filter the filter (<code>null</code> ignored). */ public void setSelectedItem(Object filter) @@ -802,39 +802,39 @@ public class MetalFileChooserUI fireContentsChanged(this, -1, -1); } } - + /** * Returns the selected file filter. - * + * * @return The selected file filter. */ public Object getSelectedItem() { return selected; } - + /** * Returns the number of items in the model. - * + * * @return The number of items in the model. */ public int getSize() { return filters.length; } - + /** * Returns the item at the specified index. - * + * * @param index the item index. - * + * * @return The item at the specified index. */ public Object getElementAt(int index) { return filters[index]; } - + } /** @@ -850,23 +850,23 @@ public class MetalFileChooserUI { // Nothing to do here. } - + /** - * Returns a component that can be used to paint the given value within + * Returns a component that can be used to paint the given value within * the list. - * + * * @param list the list. * @param value the value (a {@link FileFilter}). * @param index the item index. * @param isSelected is the item selected? * @param cellHasFocus does the list cell have focus? - * + * * @return This component as the renderer. */ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); FileFilter filter = (FileFilter) value; setText(filter.getDescription()); @@ -876,10 +876,10 @@ public class MetalFileChooserUI /** * A listener for selection events in the file list. - * + * * @see #createListSelectionListener(JFileChooser) */ - class MetalFileChooserSelectionListener + class MetalFileChooserSelectionListener implements ListSelectionListener { /** @@ -916,28 +916,28 @@ public class MetalFileChooserUI protected class SingleClickListener extends MouseAdapter { - + /** Stores instance of the list */ JList list; - - /** + + /** * Stores the current file that is being edited. * It is null if nothing is currently being edited. */ File editFile; - + /** The current file chooser. */ JFileChooser fc; - + /** The last file selected. */ Object lastSelected; - + /** The textfield used for editing. */ JTextField editField; - + /** * Creates a new listener. - * + * * @param list the directory/file list. */ public SingleClickListener(JList list) @@ -948,10 +948,10 @@ public class MetalFileChooserUI lastSelected = null; startEditing = false; } - + /** * Receives notification of a mouse click event. - * + * * @param e the event. */ public void mouseClicked(MouseEvent e) @@ -974,10 +974,10 @@ public class MetalFileChooserUI else completeEditing(); } - + /** * Sets up the text editor for the current file. - * + * * @param index - * the current index of the item in the list to be edited. */ @@ -991,7 +991,7 @@ public class MetalFileChooserUI startEditing = true; editField = new JTextField(editFile.getName()); editField.addActionListener(new EditingActionListener()); - + Icon icon = getFileView(fc).getIcon(editFile); if (icon != null) { @@ -1000,9 +1000,9 @@ public class MetalFileChooserUI bounds.width -= padding; } editField.setBounds(bounds); - + list.add(editField); - + editField.requestFocus(); editField.selectAll(); } @@ -1010,8 +1010,8 @@ public class MetalFileChooserUI completeEditing(); list.repaint(); } - - /** + + /** * Completes the editing. */ void completeEditing() @@ -1020,12 +1020,12 @@ public class MetalFileChooserUI { String text = editField.getText(); if (text != null && text != "" && !text.equals(fc.getName(editFile))) - { - File f = fc.getFileSystemView(). - createFileObject(fc.getCurrentDirectory(), text); + { + File f = fc.getFileSystemView(). + createFileObject(fc.getCurrentDirectory(), text); if ( editFile.renameTo(f) ) rescanCurrentDirectory(fc); - } + } list.remove(editField); } startEditing = false; @@ -1034,22 +1034,22 @@ public class MetalFileChooserUI editField = null; list.repaint(); } - + /** * ActionListener for the editing text field. */ class EditingActionListener implements ActionListener { - + /** * This method is invoked when an action occurs. - * + * * @param e - * the <code>ActionEvent</code> that occurred */ public void actionPerformed(ActionEvent e) { - if (editField != null) + if (editField != null) completeEditing(); } } @@ -1070,19 +1070,19 @@ public class MetalFileChooserUI /** The last selected file. */ Object lastSelected; - - /** + + /** * Stores the current file that is being edited. * It is null if nothing is currently being edited. */ File editFile; - + /** The textfield used for editing. */ JTextField editField; /** * Creates a new listener. - * + * * @param table the directory/file table * @param fc the JFileChooser */ @@ -1099,7 +1099,7 @@ public class MetalFileChooserUI /** * Receives notification of a mouse click event. - * + * * @param e the event. */ public void mouseClicked(MouseEvent e) @@ -1167,7 +1167,7 @@ public class MetalFileChooserUI /** * Sets up the text editor for the current file. - * + * * @param row - * the current row of the item in the list to be edited. */ @@ -1184,9 +1184,9 @@ public class MetalFileChooserUI // Need to adjust y pos bounds.y = row * table.getRowHeight(); editField.setBounds(bounds); - + table.add(editField); - + editField.requestFocus(); editField.selectAll(); } @@ -1194,8 +1194,8 @@ public class MetalFileChooserUI completeEditing(); table.repaint(); } - - /** + + /** * Completes the editing. */ void completeEditing() @@ -1214,26 +1214,26 @@ public class MetalFileChooserUI editField = null; table.repaint(); } - + /** * ActionListener for the editing text field. */ class EditingActionListener implements ActionListener { - + /** * This method is invoked when an action occurs. - * + * * @param e - * the <code>ActionEvent</code> that occurred */ public void actionPerformed(ActionEvent e) { - if (editField != null) + if (editField != null) completeEditing(); } } - + /** * Closes the dialog. */ @@ -1243,91 +1243,91 @@ public class MetalFileChooserUI if (owner instanceof JDialog) ((JDialog) owner).dispose(); } - } - + } + /** The text for a label describing the directory combo box. */ private String directoryLabel; - + private JComboBox directoryComboBox; - + /** The model for the directory combo box. */ DirectoryComboBoxModel directoryModel; - + /** The text for a label describing the file text field. */ private String fileLabel; - + /** The file name text field. */ private JTextField fileTextField; - + /** The text for a label describing the filter combo box. */ private String filterLabel; - /** - * The top panel (contains the directory combo box and the control buttons). + /** + * The top panel (contains the directory combo box and the control buttons). */ private JPanel topPanel; - + /** A panel containing the control buttons ('up', 'home' etc.). */ private JPanel controls; - /** - * The panel that contains the filename field and the filter combobox. + /** + * The panel that contains the filename field and the filter combobox. */ private JPanel bottomPanel; - /** - * The panel that contains the 'Open' (or 'Save') and 'Cancel' buttons. + /** + * The panel that contains the 'Open' (or 'Save') and 'Cancel' buttons. */ private JPanel buttonPanel; - + private JButton approveButton; - + /** The file list. */ JList fileList; - + /** The file table. */ JTable fileTable; - + /** The panel containing the file list. */ JPanel fileListPanel; - + /** The panel containing the file table. */ JPanel fileTablePanel; - + /** The filter combo box model. */ private FilterComboBoxModel filterModel; /** The action map. */ private ActionMap actionMap; - + /** True if currently in list view. */ boolean listView; - + /** True if we can or have started editing a cell. */ boolean startEditing; - + /** The scrollpane used for the table and list. */ JScrollPane scrollPane; - + /** The text for the label when saving. */ String save; - + /** The text for the label when opening a directory. */ String look; - + /** The label for the file combo box. */ JLabel dirLabel; - + /** Listeners. */ ListSelectionListener listSelList; MouseListener doubleClickList; SingleClickListener singleClickList; TableClickListener tableClickList; - + /** * A factory method that returns a UI delegate for the specified * component. - * + * * @param c the component (which should be a {@link JFileChooser}). */ public static ComponentUI createUI(JComponent c) @@ -1338,7 +1338,7 @@ public class MetalFileChooserUI /** * Creates a new instance of this UI delegate. - * + * * @param filechooser the file chooser component. */ public MetalFileChooserUI(JFileChooser filechooser) @@ -1353,16 +1353,16 @@ public class MetalFileChooserUI super.installUI(c); actionMap = createActionMap(); } - + public void uninstallUI(JComponent c) { super.uninstallUI(c); actionMap = null; } - + /** * Installs the sub-components of the file chooser. - * + * * @param fc the file chooser component. */ public void installComponents(JFileChooser fc) @@ -1373,7 +1373,7 @@ public class MetalFileChooserUI topPanel.add(dirLabel, BorderLayout.WEST); this.controls = new JPanel(); addControlButtons(); - + JPanel dirPanel = new JPanel(new VerticalMidLayout()); directoryModel = createDirectoryComboBoxModel(fc); directoryComboBox = new JComboBox(directoryModel); @@ -1383,16 +1383,16 @@ public class MetalFileChooserUI topPanel.add(controls, BorderLayout.EAST); topPanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8)); fc.add(topPanel, BorderLayout.NORTH); - + JPanel list = createList(fc); list.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); fc.add(list, BorderLayout.CENTER); - + JPanel bottomPanel = getBottomPanel(); filterModel = createFilterComboBoxModel(); JComboBox fileFilterCombo = new JComboBox(filterModel); fileFilterCombo.setRenderer(createFilterComboBoxRenderer()); - + fileTextField = new JTextField(); JPanel fileNamePanel = new JPanel(new VerticalMidLayout()); fileNamePanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 5)); @@ -1401,21 +1401,21 @@ public class MetalFileChooserUI row1.add(new JLabel(this.fileLabel), BorderLayout.WEST); row1.add(fileNamePanel); bottomPanel.add(row1); - + JPanel row2 = new JPanel(new BorderLayout()); row2.add(new JLabel(this.filterLabel), BorderLayout.WEST); row2.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); row2.add(fileFilterCombo); bottomPanel.add(row2); JPanel buttonPanel = new JPanel(new ButtonLayout()); - + approveButton = new JButton(getApproveSelectionAction()); approveButton.setText(getApproveButtonText(fc)); approveButton.setToolTipText(getApproveButtonToolTipText(fc)); approveButton.setMnemonic(getApproveButtonMnemonic(fc)); buttonPanel.add(approveButton); buttonPanel.setBorder(BorderFactory.createEmptyBorder(8, 0, 0, 0)); - + JButton cancelButton = new JButton(getCancelSelectionAction()); cancelButton.setText(cancelButtonText); cancelButton.setToolTipText(cancelButtonToolTipText); @@ -1424,14 +1424,14 @@ public class MetalFileChooserUI bottomPanel.add(buttonPanel, BorderLayout.SOUTH); bottomPanel.setBorder(BorderFactory.createEmptyBorder(0, 8, 8, 8)); fc.add(bottomPanel, BorderLayout.SOUTH); - + fc.add(getAccessoryPanel(), BorderLayout.EAST); } - + /** - * Uninstalls the components added by + * Uninstalls the components added by * {@link #installComponents(JFileChooser)}. - * + * * @param fc the file chooser. */ public void uninstallComponents(JFileChooser fc) @@ -1444,27 +1444,27 @@ public class MetalFileChooserUI fileListPanel = null; fc.remove(topPanel); topPanel = null; - + directoryModel = null; fileTextField = null; directoryComboBox = null; } - + /** - * Returns the panel that contains the 'Open' (or 'Save') and 'Cancel' + * Returns the panel that contains the 'Open' (or 'Save') and 'Cancel' * buttons. - * + * * @return The panel. */ protected JPanel getButtonPanel() { - return buttonPanel; + return buttonPanel; } - + /** * Creates and returns a new panel that will be used for the controls at * the bottom of the file chooser. - * + * * @return A new panel. */ protected JPanel getBottomPanel() @@ -1473,15 +1473,15 @@ public class MetalFileChooserUI bottomPanel = new JPanel(new GridLayout(3, 2)); return bottomPanel; } - + /** * Fetches localised strings for use by the labels and buttons on the * file chooser. - * + * * @param fc the file chooser. */ protected void installStrings(JFileChooser fc) - { + { super.installStrings(fc); look = "Look In: "; save = "Save In: "; @@ -1489,38 +1489,38 @@ public class MetalFileChooserUI directoryLabel = save; else directoryLabel = look; - + fileLabel = "File Name: "; filterLabel = "Files of Type: "; - + this.cancelButtonMnemonic = 0; this.cancelButtonText = "Cancel"; this.cancelButtonToolTipText = "Abort file chooser dialog"; - + this.directoryOpenButtonMnemonic = 0; this.directoryOpenButtonText = "Open"; this.directoryOpenButtonToolTipText = "Open selected directory"; - + this.helpButtonMnemonic = 0; this.helpButtonText = "Help"; this.helpButtonToolTipText = "Filechooser help"; - + this.openButtonMnemonic = 0; this.openButtonText = "Open"; this.openButtonToolTipText = "Open selected file"; - + this.saveButtonMnemonic = 0; this.saveButtonText = "Save"; this.saveButtonToolTipText = "Save selected file"; - + this.updateButtonMnemonic = 0; this.updateButtonText = "Update"; - this.updateButtonToolTipText = "Update directory listing"; + this.updateButtonToolTipText = "Update directory listing"; } - + /** * Installs the listeners required. - * + * * @param fc the file chooser. */ protected void installListeners(JFileChooser fc) @@ -1535,8 +1535,8 @@ public class MetalFileChooserUI fileList.addMouseListener(singleClickList); super.installListeners(fc); } - - protected void uninstallListeners(JFileChooser fc) + + protected void uninstallListeners(JFileChooser fc) { super.uninstallListeners(fc); fc.removePropertyChangeListener(filterModel); @@ -1544,21 +1544,21 @@ public class MetalFileChooserUI fileList.removeListSelectionListener(listSelList); fileList.removeMouseListener(doubleClickList); fileList.removeMouseListener(singleClickList); - + if (fileTable != null) fileTable.removeMouseListener(tableClickList); } - + protected ActionMap getActionMap() { if (actionMap == null) actionMap = createActionMap(); return actionMap; } - + /** * Creates and returns an action map. - * + * * @return The action map. */ protected ActionMap createActionMap() @@ -1572,9 +1572,9 @@ public class MetalFileChooserUI /** * Creates a panel containing a list of files. - * + * * @param fc the file chooser. - * + * * @return A panel. */ protected JPanel createList(JFileChooser fc) @@ -1600,41 +1600,41 @@ public class MetalFileChooserUI fileListPanel.setPreferredSize(new Dimension(405, 135)); return fileListPanel; } - + /** * Creates a panel containing a table within a scroll pane. - * + * * @param fc the file chooser. - * + * * @return The details view. */ protected JPanel createDetailsView(JFileChooser fc) { fileTablePanel = new JPanel(new BorderLayout()); - + Object[] cols = new Object[] {"Name", "Size", "Modified"}; Object[][] rows = new Object[fileList.getModel().getSize()][3]; - + fileTable = new JTable(new DefaultTableModel(rows, cols)); - + if (fc.isMultiSelectionEnabled()) fileTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); else fileTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - + fileTable.setShowGrid(false); fileTable.setColumnSelectionAllowed(false); fileTable.setDefaultRenderer(Object.class, new TableFileRenderer()); tableClickList = new TableClickListener(fileTable, fc); fileTable.addMouseListener(tableClickList); - - return updateTable(); + + return updateTable(); } - + /** * Sets the values in the table, and puts it in the panel. - * + * * @return the panel containing the table. */ JPanel updateTable() @@ -1671,10 +1671,10 @@ public class MetalFileChooserUI return fileTablePanel; } - + /** * Formats bytes into the appropriate size. - * + * * @param bytes the number of bytes to convert * @return a string representation of the size */ @@ -1686,7 +1686,7 @@ public class MetalFileChooserUI long gb = (long) Math.pow(2, 30); double size = 0; String id = ""; - + if ((bytes / gb) >= 1) { size = (double) bytes / (double) gb; @@ -1707,27 +1707,27 @@ public class MetalFileChooserUI size = bytes; id = "Bytes"; } - + return nf.format(size) + " " + id; } /** * Creates a listener that monitors selections in the directory/file list * and keeps the {@link JFileChooser} component up to date. - * + * * @param fc the file chooser. - * + * * @return The listener. - * + * * @see #installListeners(JFileChooser) */ public ListSelectionListener createListSelectionListener(JFileChooser fc) { return new MetalFileChooserSelectionListener(); } - + /** * Returns the preferred size for the file chooser component. - * + * * @return The preferred size. */ public Dimension getPreferredSize(JComponent c) @@ -1740,7 +1740,7 @@ public class MetalFileChooserUI /** * Returns the minimum size for the file chooser component. - * + * * @return The minimum size. */ public Dimension getMinimumSize(JComponent c) @@ -1750,25 +1750,25 @@ public class MetalFileChooserUI Dimension fl = fileListPanel.getMinimumSize(); return new Dimension(fl.width, tp.height + bp.height + fl.height); } - + /** * Returns the maximum size for the file chooser component. - * + * * @return The maximum size. */ public Dimension getMaximumSize(JComponent c) { return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE); } - + /** * Creates a property change listener that monitors the {@link JFileChooser} * for property change events and updates the component display accordingly. - * + * * @param fc the file chooser. - * + * * @return The property change listener. - * + * * @see #installListeners(JFileChooser) */ public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) @@ -1778,10 +1778,10 @@ public class MetalFileChooserUI /** * Creates and returns a new instance of {@link DirectoryComboBoxModel}. - * + * * @return A new instance of {@link DirectoryComboBoxModel}. */ - protected MetalFileChooserUI.DirectoryComboBoxModel + protected MetalFileChooserUI.DirectoryComboBoxModel createDirectoryComboBoxModel(JFileChooser fc) { return new DirectoryComboBoxModel(); @@ -1790,9 +1790,9 @@ public class MetalFileChooserUI /** * Creates a new instance of the renderer used in the directory * combo box. - * + * * @param fc the file chooser. - * + * * @return The renderer. */ protected DirectoryComboBoxRenderer createDirectoryComboBoxRenderer( @@ -1803,23 +1803,23 @@ public class MetalFileChooserUI /** * Creates and returns a new instance of {@link FilterComboBoxModel}. - * + * * @return A new instance of {@link FilterComboBoxModel}. */ protected FilterComboBoxModel createFilterComboBoxModel() { - return new FilterComboBoxModel(); + return new FilterComboBoxModel(); } /** * Creates and returns a new instance of {@link FilterComboBoxRenderer}. - * + * * @return A new instance of {@link FilterComboBoxRenderer}. */ - protected MetalFileChooserUI.FilterComboBoxRenderer + protected MetalFileChooserUI.FilterComboBoxRenderer createFilterComboBoxRenderer() { - return new FilterComboBoxRenderer(); + return new FilterComboBoxRenderer(); } /** @@ -1832,26 +1832,26 @@ public class MetalFileChooserUI upButton.setIcon(this.upFolderIcon); upButton.setMargin(new Insets(0, 0, 0, 0)); controls.add(upButton); - + JButton homeButton = new JButton(getGoHomeAction()); homeButton.setText(null); homeButton.setIcon(this.homeFolderIcon); homeButton.setMargin(new Insets(0, 0, 0, 0)); controls.add(homeButton); - + JButton newFolderButton = new JButton(getNewFolderAction()); newFolderButton.setText(null); newFolderButton.setIcon(this.newFolderIcon); newFolderButton.setMargin(new Insets(0, 0, 0, 0)); controls.add(newFolderButton); - + JToggleButton listButton = new JToggleButton(this.listViewIcon); listButton.setMargin(new Insets(0, 0, 0, 0)); listButton.addActionListener(new ListViewActionListener()); listButton.setSelected(true); - listView = true; + listView = true; controls.add(listButton); - + JToggleButton detailButton = new JToggleButton(this.detailsViewIcon); detailButton.setMargin(new Insets(0, 0, 0, 0)); detailButton.addActionListener(new DetailViewActionListener()); @@ -1862,7 +1862,7 @@ public class MetalFileChooserUI buttonGroup.add(listButton); buttonGroup.add(detailButton); } - + /** * Removes all the buttons from the control panel. */ @@ -1872,10 +1872,10 @@ public class MetalFileChooserUI controls.revalidate(); controls.repaint(); } - + /** * Updates the current directory. - * + * * @param fc the file chooser to update. */ public void rescanCurrentDirectory(JFileChooser fc) @@ -1887,43 +1887,43 @@ public class MetalFileChooserUI else createList(fc); } - + /** * Returns the file name in the text field. - * + * * @return The file name. */ public String getFileName() { String result = null; - if (fileTextField != null) + if (fileTextField != null) result = fileTextField.getText(); return result; } - + /** * Sets the file name in the text field. - * + * * @param filename the file name. */ public void setFileName(String filename) { fileTextField.setText(filename); } - + /** * DOCUMENT ME!! - * + * * @param e - DOCUMENT ME! */ public void valueChanged(ListSelectionEvent e) { // FIXME: Not sure what we should be doing here, if anything. } - + /** * Returns the approve button. - * + * * @return The approve button. */ protected JButton getApproveButton(JFileChooser fc) @@ -1939,10 +1939,10 @@ public class MetalFileChooserUI { /** * Performs the layout. - * + * * @param parent the container. */ - public void layoutContainer(Container parent) + public void layoutContainer(Container parent) { int count = parent.getComponentCount(); if (count > 0) @@ -1952,32 +1952,32 @@ public class MetalFileChooserUI Dimension prefSize = c.getPreferredSize(); int h = parent.getHeight() - insets.top - insets.bottom; int adj = Math.max(0, (h - prefSize.height) / 2); - c.setBounds(insets.left, insets.top + adj, parent.getWidth() - - insets.left - insets.right, + c.setBounds(insets.left, insets.top + adj, parent.getWidth() + - insets.left - insets.right, (int) Math.min(prefSize.getHeight(), h)); } } - + /** * Returns the minimum layout size. - * + * * @param parent the container. - * + * * @return The minimum layout size. */ - public Dimension minimumLayoutSize(Container parent) + public Dimension minimumLayoutSize(Container parent) { return preferredLayoutSize(parent); } - + /** * Returns the preferred layout size. - * + * * @param parent the container. - * + * * @return The preferred layout size. */ - public Dimension preferredLayoutSize(Container parent) + public Dimension preferredLayoutSize(Container parent) { if (parent.getComponentCount() > 0) { @@ -1985,26 +1985,26 @@ public class MetalFileChooserUI } else return null; } - + /** - * This layout manager does not need to track components, so this + * This layout manager does not need to track components, so this * method does nothing. - * + * * @param name the name the component is associated with. * @param component the component. */ - public void addLayoutComponent(String name, Component component) + public void addLayoutComponent(String name, Component component) { // do nothing } - + /** - * This layout manager does not need to track components, so this + * This layout manager does not need to track components, so this * method does nothing. - * + * * @param component the component. */ - public void removeLayoutComponent(Component component) + public void removeLayoutComponent(Component component) { // do nothing } @@ -2017,13 +2017,13 @@ public class MetalFileChooserUI class ButtonLayout implements LayoutManager { static final int GAP = 4; - + /** * Performs the layout. - * + * * @param parent the container. */ - public void layoutContainer(Container parent) + public void layoutContainer(Container parent) { int count = parent.getComponentCount(); if (count > 0) @@ -2036,7 +2036,7 @@ public class MetalFileChooserUI Dimension prefSize = c.getPreferredSize(); maxW = Math.max(prefSize.width, maxW); } - + // then position the buttons Insets insets = parent.getInsets(); int availableH = parent.getHeight() - insets.top - insets.bottom; @@ -2044,42 +2044,42 @@ public class MetalFileChooserUI for (int i = count - 1; i >= 0; i--) { Component c = parent.getComponent(i); - Dimension prefSize = c.getPreferredSize(); + Dimension prefSize = c.getPreferredSize(); int adj = Math.max(0, (availableH - prefSize.height) / 2); currentX = currentX - prefSize.width; - c.setBounds(currentX, insets.top + adj, prefSize.width, + c.setBounds(currentX, insets.top + adj, prefSize.width, (int) Math.min(prefSize.getHeight(), availableH)); currentX = currentX - GAP; } } } - + /** * Returns the minimum layout size. - * + * * @param parent the container. - * + * * @return The minimum layout size. */ - public Dimension minimumLayoutSize(Container parent) + public Dimension minimumLayoutSize(Container parent) { return preferredLayoutSize(parent); } - + /** * Returns the preferred layout size. - * + * * @param parent the container. - * + * * @return The preferred layout size. */ - public Dimension preferredLayoutSize(Container parent) + public Dimension preferredLayoutSize(Container parent) { Insets insets = parent.getInsets(); int maxW = 0; int maxH = 0; int count = parent.getComponentCount(); - if (count > 0) + if (count > 0) { for (int i = 0; i < count; i++) { @@ -2089,29 +2089,29 @@ public class MetalFileChooserUI maxH = Math.max(d.height, maxH); } } - return new Dimension(maxW * count + GAP * (count - 1) + insets.left + return new Dimension(maxW * count + GAP * (count - 1) + insets.left + insets.right, maxH + insets.top + insets.bottom); } - + /** - * This layout manager does not need to track components, so this + * This layout manager does not need to track components, so this * method does nothing. - * + * * @param name the name the component is associated with. * @param component the component. */ - public void addLayoutComponent(String name, Component component) + public void addLayoutComponent(String name, Component component) { // do nothing } - + /** - * This layout manager does not need to track components, so this + * This layout manager does not need to track components, so this * method does nothing. - * + * * @param component the component. */ - public void removeLayoutComponent(Component component) + public void removeLayoutComponent(Component component) { // do nothing } diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalIconFactory.java b/libjava/classpath/javax/swing/plaf/metal/MetalIconFactory.java index 2817336..5382577 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalIconFactory.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalIconFactory.java @@ -60,67 +60,67 @@ import javax.swing.plaf.UIResource; /** * Creates icons for the {@link MetalLookAndFeel}. */ -public class MetalIconFactory implements Serializable +public class MetalIconFactory implements Serializable { /** A constant representing "dark". */ public static final boolean DARK = false; - + /** A constant representing "light". */ public static final boolean LIGHT = true; - + /** A shared instance of the MenuArrowIcon. */ private static Icon menuArrow; - + /** A shared instance of the MenuItemArrowIcon. */ private static Icon menuItemArrow; - + /** * An icon displayed for {@link JCheckBoxMenuItem} components. */ - private static class CheckBoxMenuItemIcon - implements Icon, UIResource, Serializable + private static class CheckBoxMenuItemIcon + implements Icon, UIResource, Serializable { /** * Creates a new icon instance. */ - public CheckBoxMenuItemIcon() + public CheckBoxMenuItemIcon() { // Nothing to do here. } - + /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon (10 pixels). */ - public int getIconWidth() + public int getIconWidth() { return 10; } - + /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon (10 pixels). */ - public int getIconHeight() + public int getIconHeight() { return 10; } - + /** * Paints the icon. - * + * * @param c the component. * @param g the graphics device. * @param x the x-coordinate. * @param y the y-coordinate. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { JCheckBoxMenuItem item = (JCheckBoxMenuItem) c; - + if (item.isArmed()) g.setColor(MetalLookAndFeel.getBlack()); else @@ -129,7 +129,7 @@ public class MetalIconFactory implements Serializable g.drawLine(x, y + 1, x, y + 8); g.drawLine(x + 2, y + 8, x + 8, y + 8); g.drawLine(x + 8, y + 2, x + 8, y + 7); - + g.setColor(MetalLookAndFeel.getWhite()); g.drawLine(x + 1, y + 1, x + 7, y + 1); g.drawLine(x + 1, y + 2, x + 1, y + 7); @@ -145,56 +145,56 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 8 - i, y + i, x + 9 - i, y + i); } - } + } } /** * An icon used for the "detail view" button on a {@link JFileChooser} under * the {@link MetalLookAndFeel}. - * + * * @see MetalIconFactory#getFileChooserDetailViewIcon() */ - private static class FileChooserDetailViewIcon + private static class FileChooserDetailViewIcon implements Icon, UIResource, Serializable { /** * Creates a new icon. */ - public FileChooserDetailViewIcon() + public FileChooserDetailViewIcon() { // Nothing to do here. } - + /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return 18; } - + /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return 18; } - + /** * Paints the icon using colors from the {@link MetalLookAndFeel}. - * + * * @param c the component (ignored). * @param g the graphics device. * @param x the x-coordinate for the top-left of the icon. * @param y the y-coordinate for the top-left of the icon. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { Color savedColor = g.getColor(); g.setColor(MetalLookAndFeel.getBlack()); @@ -204,7 +204,7 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 6, y + 3, x + 6, y + 7); g.drawLine(x + 2, y + 7, x + 6, y + 7); g.drawLine(x + 2, y + 2, x + 2, y + 7); - + // file 2 outline g.drawLine(x + 2, y + 10, x + 5, y + 10); g.drawLine(x + 6, y + 11, x + 6, y + 15); @@ -214,157 +214,157 @@ public class MetalIconFactory implements Serializable // detail lines g.drawLine(x + 8, y + 5, x + 15, y + 5); g.drawLine(x + 8, y + 13, x + 15, y + 13); - + // fill files g.setColor(MetalLookAndFeel.getPrimaryControl()); g.fillRect(x + 3, y + 3, 3, 4); g.fillRect(x + 3, y + 11, 3, 4); - + // highlight files g.setColor(MetalLookAndFeel.getPrimaryControlHighlight()); g.drawLine(x + 4, y + 4, x + 4, y + 5); g.drawLine(x + 4, y + 12, x + 4, y + 13); - + g.setColor(savedColor); - } + } } /** * An icon used for the "home folder" button on a {@link JFileChooser} under * the {@link MetalLookAndFeel}. - * + * * @see MetalIconFactory#getFileChooserHomeFolderIcon() */ - private static class FileChooserHomeFolderIcon + private static class FileChooserHomeFolderIcon implements Icon, UIResource, Serializable { /** * Creates a new icon. */ - public FileChooserHomeFolderIcon() + public FileChooserHomeFolderIcon() { // Nothing to do here. } /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return 18; } - + /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return 18; } - + /** * Paints the icon using colors from the {@link MetalLookAndFeel}. - * + * * @param c the component (ignored). * @param g the graphics device. * @param x the x-coordinate for the top-left of the icon. * @param y the y-coordinate for the top-left of the icon. */ - public void paintIcon(Component c, Graphics g, int x, int y) - { + public void paintIcon(Component c, Graphics g, int x, int y) + { Color savedColor = g.getColor(); g.setColor(MetalLookAndFeel.getBlack()); - + // roof g.drawLine(x + 1, y + 8, x + 8, y + 1); g.drawLine(x + 8, y + 1, x + 15, y + 8); - + // base of house g.drawLine(x + 3, y + 6, x + 3, y + 15); g.drawLine(x + 3, y + 15, x + 13, y + 15); g.drawLine(x + 13, y + 6, x + 13, y + 15); - + // door frame g.drawLine(x + 6, y + 9, x + 6, y + 15); g.drawLine(x + 6, y + 9, x + 10, y + 9); g.drawLine(x + 10, y + 9, x + 10, y + 15); - + // chimney g.drawLine(x + 11, y + 2, x + 11, y + 4); g.drawLine(x + 12, y + 2, x + 12, y + 5); - + g.setColor(MetalLookAndFeel.getControlDarkShadow()); - + // roof paint int xx = x + 8; for (int i = 0; i < 4; i++) g.drawLine(xx - i, y + 2 + i, xx + i, y + 2 + i); g.fillRect(x + 4, y + 6, 9, 2); - + // door knob g.drawLine(x + 9, y + 12, x + 9, y + 12); - + // house paint g.setColor(MetalLookAndFeel.getPrimaryControl()); g.drawLine(x + 4, y + 8, x + 12, y + 8); g.fillRect(x + 4, y + 9, 2, 6); g.fillRect(x + 11, y + 9, 2, 6); - + g.setColor(savedColor); - } + } } - + /** * An icon used for the "list view" button on a {@link JFileChooser} under * the {@link MetalLookAndFeel}. - * + * * @see MetalIconFactory#getFileChooserListViewIcon() */ - private static class FileChooserListViewIcon - implements Icon, UIResource, Serializable + private static class FileChooserListViewIcon + implements Icon, UIResource, Serializable { /** * Creates a new icon. */ - public FileChooserListViewIcon() + public FileChooserListViewIcon() { // Nothing to do here. } - + /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return 18; } - + /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return 18; } - + /** * Paints the icon using colors from the {@link MetalLookAndFeel}. - * + * * @param c the component (ignored). * @param g the graphics device. * @param x the x-coordinate for the top-left of the icon. * @param y the y-coordinate for the top-left of the icon. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { Color savedColor = g.getColor(); g.setColor(MetalLookAndFeel.getBlack()); @@ -374,37 +374,37 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 6, y + 3, x + 6, y + 7); g.drawLine(x + 2, y + 7, x + 6, y + 7); g.drawLine(x + 2, y + 2, x + 2, y + 7); - + // file 2 outline g.drawLine(x + 2, y + 10, x + 5, y + 10); g.drawLine(x + 6, y + 11, x + 6, y + 15); g.drawLine(x + 2, y + 15, x + 6, y + 15); g.drawLine(x + 2, y + 10, x + 2, y + 15); - + // file 3 outline g.drawLine(x + 10, y + 2, x + 13, y + 2); g.drawLine(x + 14, y + 3, x + 14, y + 7); g.drawLine(x + 10, y + 7, x + 14, y + 7); g.drawLine(x + 10, y + 2, x + 10, y + 7); - + // file 4 outline g.drawLine(x + 10, y + 10, x + 13, y + 10); g.drawLine(x + 14, y + 11, x + 14, y + 15); g.drawLine(x + 10, y + 15, x + 14, y + 15); g.drawLine(x + 10, y + 10, x + 10, y + 15); - + g.drawLine(x + 8, y + 5, x + 8, y + 5); g.drawLine(x + 8, y + 13, x + 8, y + 13); g.drawLine(x + 16, y + 5, x + 16, y + 5); g.drawLine(x + 16, y + 13, x + 16, y + 13); - + // fill files g.setColor(MetalLookAndFeel.getPrimaryControl()); g.fillRect(x + 3, y + 3, 3, 4); g.fillRect(x + 3, y + 11, 3, 4); g.fillRect(x + 11, y + 3, 3, 4); g.fillRect(x + 11, y + 11, 3, 4); - + // highlight files g.setColor(MetalLookAndFeel.getPrimaryControlHighlight()); g.drawLine(x + 4, y + 4, x + 4, y + 5); @@ -413,113 +413,113 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 12, y + 12, x + 12, y + 13); g.setColor(savedColor); - } + } } - + /** * An icon used for the "new folder" button on a {@link JFileChooser} under * the {@link MetalLookAndFeel}. - * + * * @see MetalIconFactory#getFileChooserNewFolderIcon() */ - private static class FileChooserNewFolderIcon + private static class FileChooserNewFolderIcon implements Icon, UIResource, Serializable { - /** + /** * Creates a new icon. */ - public FileChooserNewFolderIcon() + public FileChooserNewFolderIcon() { // Nothing to do here. } - + /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return 18; } - + /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return 18; } - + /** * Paints the icon using colors from the {@link MetalLookAndFeel}. - * + * * @param c the component (ignored). * @param g the graphics device. * @param x the x-coordinate for the top-left of the icon. * @param y the y-coordinate for the top-left of the icon. */ - public void paintIcon(Component c, Graphics g, int x, int y) - { + public void paintIcon(Component c, Graphics g, int x, int y) + { Color savedColor = g.getColor(); g.setColor(MetalLookAndFeel.getBlack()); - + g.drawLine(x + 2, y + 5, x + 9, y + 5); g.drawLine(x + 10, y + 6, x + 15, y + 6); g.drawLine(x + 15, y + 5, x + 15, y + 14); g.drawLine(x + 2, y + 14, x + 15, y + 14); g.drawLine(x + 1, y + 6, x + 1, y + 14); - + g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); g.drawLine(x + 11, y + 3, x + 15, y + 3); g.drawLine(x + 10, y + 4, x + 15, y + 4); - + g.setColor(MetalLookAndFeel.getPrimaryControl()); g.fillRect(x + 3, y + 7, 7, 7); g.fillRect(x + 10, y + 8, 5, 6); g.drawLine(x + 10, y + 5, x + 14, y + 5); - + g.setColor(MetalLookAndFeel.getPrimaryControlHighlight()); g.drawLine(x + 10, y + 7, x + 14, y + 7); g.drawLine(x + 2, y + 6, x + 9, y + 6); g.drawLine(x + 2, y + 6, x + 2, y + 13); g.setColor(savedColor); - } + } } /** * An icon used for the "up folder" button on a {@link JFileChooser} under * the {@link MetalLookAndFeel}. - * + * * @see MetalIconFactory#getFileChooserNewFolderIcon() */ - private static class FileChooserUpFolderIcon extends FileChooserNewFolderIcon + private static class FileChooserUpFolderIcon extends FileChooserNewFolderIcon { /** * Creates a new icon. */ - public FileChooserUpFolderIcon() + public FileChooserUpFolderIcon() { // Nothing to do here. } - + /** * Paints the icon using colors from the {@link MetalLookAndFeel}. - * + * * @param c the component (ignored). * @param g the graphics device. * @param x the x-coordinate for the top-left of the icon. * @param y the y-coordinate for the top-left of the icon. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { Color savedColor = g.getColor(); // draw the folder super.paintIcon(c, g, x, y); - + // now draw the up arrow g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x + 8, y + 9, x + 8, y + 16); @@ -527,128 +527,128 @@ public class MetalIconFactory implements Serializable for (int i = 0; i < 4; i++) g.drawLine(xx - i, y + 9 + i, xx + i, y + 9 + i); g.setColor(savedColor); - } + } } /** * An icon representing a file (drawn as a piece of paper with the top-right * corner turned down). */ - public static class FileIcon16 implements Icon, Serializable + public static class FileIcon16 implements Icon, Serializable { /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return 16; } /** - * Returns the height of the icon, in pixels. The height returned is - * <code>16</code> plus the value returned by + * Returns the height of the icon, in pixels. The height returned is + * <code>16</code> plus the value returned by * {@link #getAdditionalHeight()}. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return 16 + getAdditionalHeight(); } - + /** * Paints the icon at the location (x, y). - * + * * @param c the component. * @param g the graphics context. * @param x the x coordinate. * @param y the y coordinate. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { y = y + getShift(); g.setColor(MetalLookAndFeel.getBlack()); - g.drawLine(x, y, x + 9, y); - g.drawLine(x, y + 1, x, y + 15); - g.drawLine(x, y + 15, x + 12, y + 15); - g.drawLine(x + 12, y + 15, x + 12, y + 6); - g.drawLine(x + 12, y + 6, x + 9, y); + g.drawLine(x, y, x + 9, y); + g.drawLine(x, y + 1, x, y + 15); + g.drawLine(x, y + 15, x + 12, y + 15); + g.drawLine(x + 12, y + 15, x + 12, y + 6); + g.drawLine(x + 12, y + 6, x + 9, y); g.drawLine(x + 7, y + 2, x + 11, y + 6); g.drawLine(x + 8, y + 1, x + 9, y + 1); g.setColor(MetalLookAndFeel.getPrimaryControl()); - g.drawLine(x + 1, y + 1, x + 7, y + 1); - g.drawLine(x + 1, y + 1, x + 1, y + 14); - g.drawLine(x + 1, y + 14, x + 11, y + 14); - g.drawLine(x + 11, y + 14, x + 11, y + 7); + g.drawLine(x + 1, y + 1, x + 7, y + 1); + g.drawLine(x + 1, y + 1, x + 1, y + 14); + g.drawLine(x + 1, y + 14, x + 11, y + 14); + g.drawLine(x + 11, y + 14, x + 11, y + 7); g.drawLine(x + 8, y + 2, x + 10, y + 4); } - + /** - * Returns the additional height for the icon. The + * Returns the additional height for the icon. The * {@link #getIconHeight()} method adds this value to the icon height it * returns. Subclasses can override this method to adjust the icon height. - * + * * @return The additional height (<code>0</code> unless overridden). */ - public int getAdditionalHeight() + public int getAdditionalHeight() { return 0; } - + /** - * Returns the vertical shift, in pixels, applied when painting the icon. - * The default value is zero, but subclasses may override this (for + * Returns the vertical shift, in pixels, applied when painting the icon. + * The default value is zero, but subclasses may override this (for * example, see {@link TreeLeafIcon}). - * + * * @return The shift. */ - public int getShift() + public int getShift() { return 0; } - + } - + /** * An icon representing a folder. */ - public static class FolderIcon16 implements Icon, Serializable + public static class FolderIcon16 implements Icon, Serializable { /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return 16; } - + /** - * Returns the height of the icon, in pixels. The height returned is - * <code>16</code> plus the value returned by + * Returns the height of the icon, in pixels. The height returned is + * <code>16</code> plus the value returned by * {@link #getAdditionalHeight()}. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return 16 + getAdditionalHeight(); } /** * Paints the icon at the location (x, y). - * + * * @param c the component. * @param g the graphics device. * @param x the x coordinate. * @param y the y coordinate. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { y = y + getShift(); g.setColor(MetalLookAndFeel.getBlack()); @@ -666,37 +666,37 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 9, y + 4, x + 15, y + 4); g.drawLine(x + 10, y + 3, x + 15, y + 3); } - + /** - * Returns the additional height for the icon. The + * Returns the additional height for the icon. The * {@link #getIconHeight()} method adds this value to the icon height it * returns. Subclasses can override this method to adjust the icon height. - * + * * @return The additional height (<code>0</code> unless overridden). */ - public int getAdditionalHeight() + public int getAdditionalHeight() { return 0; } - + /** - * Returns the vertical shift, in pixels, applied when painting the icon. - * The default value is zero, but subclasses may override this (for + * Returns the vertical shift, in pixels, applied when painting the icon. + * The default value is zero, but subclasses may override this (for * example, see {@link TreeFolderIcon}). - * + * * @return The shift. */ - public int getShift() + public int getShift() { return 0; } - + } /** * An icon used by the {@link MetalInternalFrameUI} class when the frame * is displayed as a palette. - * + * * @since 1.3 */ public static class PaletteCloseIcon @@ -704,33 +704,33 @@ public class MetalIconFactory implements Serializable { /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return 7; } - + /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return 7; } - + /** * Paints the icon using colors from the {@link MetalLookAndFeel}. - * + * * @param c the component (ignored). * @param g the graphics device. * @param x the x-coordinate for the top-left of the icon. * @param y the y-coordinate for the top-left of the icon. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { Color savedColor = g.getColor(); AbstractButton button = (AbstractButton) c; @@ -752,9 +752,9 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 5, y + 3, x + 6, y + 2); g.drawLine(x + 6, y + 6, x + 6, y + 6); g.setColor(savedColor); - } + } } - + /** * An {@link Icon} implementation for {@link JCheckBox}es in the * Metal Look & Feel. @@ -799,13 +799,13 @@ public class MetalIconFactory implements Serializable * Paints the icon, taking into account whether or not the component is * enabled, selected and/or armed. * - * @param c the Component to draw on (must be an instance of + * @param c the Component to draw on (must be an instance of * {@link JRadioButton}) * @param g the Graphics context to draw with * @param x the X position * @param y the Y position */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { if (UIManager.get("RadioButton.gradient") != null) MetalUtils.paintGradient(g, x + 2, y + 2, 8, 8, @@ -842,13 +842,13 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 10, y + 4, x + 10, y + 7); g.fillRect(x + 2, y + 2, 8, 8); } - else + else { // only draw inner highlight if not filled if (b.isEnabled()) { g.setColor(MetalLookAndFeel.getWhite()); - + g.drawLine(x + 2, y + 8, x + 2, y + 9); g.drawLine(x + 1, y + 4, x + 1, y + 7); g.drawLine(x + 2, y + 2, x + 2, y + 3); @@ -862,7 +862,7 @@ public class MetalIconFactory implements Serializable if (b.isEnabled()) { g.setColor(MetalLookAndFeel.getWhite()); - + // outer g.drawLine(x + 10, y + 1, x + 10, y + 1); g.drawLine(x + 11, y + 2, x + 11, y + 3); @@ -873,7 +873,7 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 4, y + 12, x + 7, y + 12); g.drawLine(x + 2, y + 11, x + 3, y + 11); } - + if (b.isSelected()) { if (b.isEnabled()) @@ -885,52 +885,52 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 4, y + 8, x + 7, y + 8); } g.setColor(savedColor); - } + } } /** * An icon displayed for {@link JRadioButtonMenuItem} components. */ - private static class RadioButtonMenuItemIcon - implements Icon, UIResource, Serializable + private static class RadioButtonMenuItemIcon + implements Icon, UIResource, Serializable { /** * Creates a new icon instance. */ - public RadioButtonMenuItemIcon() + public RadioButtonMenuItemIcon() { // Nothing to do here. } /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return 10; } /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return 10; } /** * Paints the icon. - * + * * @param c the component. * @param g the graphics device. * @param x the x-coordinate. * @param y the y-coordinate. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { Color savedColor = g.getColor(); JRadioButtonMenuItem item = (JRadioButtonMenuItem) c; @@ -943,7 +943,7 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 1, y + 7, x + 1, y + 7); g.drawLine(x, y + 2, x, y + 6); g.drawLine(x + 1, y + 1, x + 1, y + 1); - + if (item.isSelected()) { g.drawLine(x + 3, y + 2, x + 5, y + 2); @@ -962,14 +962,14 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 1, y + 3, x + 1, y + 6); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.setColor(savedColor); - } + } } /** * The icon used to display the thumb control on a horizontally oriented * {@link JSlider} component. */ - private static class HorizontalSliderThumbIcon + private static class HorizontalSliderThumbIcon implements Icon, UIResource, Serializable { @@ -984,52 +984,52 @@ public class MetalIconFactory implements Serializable /** * Creates a new instance. */ - public HorizontalSliderThumbIcon() + public HorizontalSliderThumbIcon() { // Nothing to do here. } - + /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return 15; } - + /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return 16; } - + /** - * Paints the icon, taking into account whether or not the component has + * Paints the icon, taking into account whether or not the component has * the focus. - * + * * @param c the component. * @param g the graphics device. * @param x the x-coordinate. * @param y the y-coordinate. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { boolean enabled = false; boolean focus = false; if (c != null) { enabled = c.isEnabled(); - focus = c.hasFocus(); + focus = c.hasFocus(); } - + // draw the outline - if (enabled) + if (enabled) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDarkShadow()); @@ -1038,8 +1038,8 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 14, y + 8, x + 7, y + 15); g.drawLine(x + 6, y + 14, x, y + 8); g.drawLine(x, y + 7, x, y + 1); - -// The following is commented out until the masking for the gradient painting + +// The following is commented out until the masking for the gradient painting // is working correctly // // Fill the icon. // if (MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme @@ -1098,7 +1098,7 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 6, y + 2, x + 6, y + 2); g.drawLine(x + 10, y + 2, x + 10, y + 2); - + g.drawLine(x + 4, y + 4, x + 4, y + 4); g.drawLine(x + 8, y + 4, x + 8, y + 4); @@ -1107,62 +1107,62 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 10, y + 6, x + 10, y + 6); } - } + } } - + /** - * An icon used for the 'close' button in the title frame of a + * An icon used for the 'close' button in the title frame of a * {@link JInternalFrame}. */ - private static class InternalFrameCloseIcon + private static class InternalFrameCloseIcon implements Icon, UIResource, Serializable { /** The icon size in pixels. */ private int size; - + /** * Creates a new icon. - * + * * @param size the icon size (width and height) in pixels. */ - public InternalFrameCloseIcon(int size) + public InternalFrameCloseIcon(int size) { this.size = size; } - + /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return size; } - + /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return size; } - + /** * Paints the icon. - * + * * @param c the component (an {@link JInternalFrame} is expected). * @param g the graphics device. * @param x the x-coordinate. * @param y the y-coordinate. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { Color savedColor = g.getColor(); AbstractButton b = (AbstractButton) c; - + // fill the interior if (b.getModel().isPressed()) // FIXME: also need to take into account whether the internal frame is @@ -1171,7 +1171,7 @@ public class MetalIconFactory implements Serializable else g.setColor(MetalLookAndFeel.getPrimaryControl()); g.fillRect(x + 2, y + 2, 10, 10); - + // draw the outline box and the cross if (b.getModel().isPressed()) g.setColor(MetalLookAndFeel.getBlack()); @@ -1191,7 +1191,7 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 13, y + 2, x + 13, y + 12); g.drawLine(x + 2, y + 12, x + 2, y + 12); g.drawLine(x + 12, y + 2, x + 12, y + 2); - + g.fillRect(x + 4, y + 4, 2, 2); g.fillRect(x + 5, y + 5, 4, 4); g.drawLine(x + 9, y + 4, x + 10, y + 4); @@ -1200,21 +1200,21 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 4, y + 9, x + 5, y + 9); g.drawLine(x + 9, y + 8, x + 9, y + 10); g.drawLine(x + 8, y + 9, x + 10, y + 9); - + g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x, y, x + 13, y); g.drawLine(x, y + 1, x, y + 13); g.drawLine(x + 3, y + 4, x + 4, y + 3); g.drawLine(x + 3, y + 9, x + 5, y + 7); g.drawLine(x + 7, y + 5, x + 9, y + 3); - + g.drawLine(x + 12, y + 3, x + 12, y + 11); g.drawLine(x + 3, y + 12, x + 12, y + 12); - + g.setColor(MetalLookAndFeel.getWhite()); g.drawLine(x + 1, y + 14, x + 14, y + 14); g.drawLine(x + 14, y + 1, x + 14, y + 14); - + if (!b.getModel().isPressed()) { g.drawLine(x + 5, y + 10, x + 5, y + 10); @@ -1225,53 +1225,53 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 10, y + 11, x + 10, y + 11); } g.setColor(savedColor); - } + } } /** * The icon displayed at the top-left corner of a {@link JInternalFrame}. */ private static class InternalFrameDefaultMenuIcon - implements Icon, UIResource, Serializable + implements Icon, UIResource, Serializable { - + /** * Creates a new instance. */ - public InternalFrameDefaultMenuIcon() + public InternalFrameDefaultMenuIcon() { // Nothing to do here. } - + /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return 16; } - + /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return 16; } - + /** * Paints the icon at the specified location. - * + * * @param c the component. * @param g the graphics device. * @param x the x coordinate. * @param y the y coordinate. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); g.fillRect(x + 1, y, 14, 2); @@ -1279,10 +1279,10 @@ public class MetalIconFactory implements Serializable g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); - + g.setColor(MetalLookAndFeel.getPrimaryControl()); g.fillRect(x + 2, y + 2, 12, 3); - + g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); @@ -1295,59 +1295,59 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); - } + } } /** - * An icon used in the title frame of a {@link JInternalFrame}. When you + * An icon used in the title frame of a {@link JInternalFrame}. When you * maximise an internal frame, this icon will replace the 'maximise' icon to * provide a 'restore' option. */ private static class InternalFrameAltMaximizeIcon - implements Icon, UIResource, Serializable + implements Icon, UIResource, Serializable { /** The icon size in pixels. */ private int size; - + /** * Creates a new icon. - * + * * @param size the icon size in pixels. */ - public InternalFrameAltMaximizeIcon(int size) + public InternalFrameAltMaximizeIcon(int size) { this.size = size; } - + /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return size; } - + /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return size; } - + /** * Paints the icon at the specified location. - * + * * @param c the component. * @param g the graphics device. * @param x the x coordinate. * @param y the y coordinate. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { Color savedColor = g.getColor(); @@ -1359,27 +1359,27 @@ public class MetalIconFactory implements Serializable else g.setColor(MetalLookAndFeel.getPrimaryControl()); g.fillRect(x + 2, y + 6, 7, 7); - - + + if (b.getModel().isPressed()) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); - + g.drawLine(x + 12, y + 1, x + 13, y + 1); g.drawLine(x + 11, y + 2, x + 12, y + 2); g.drawLine(x + 10, y + 3, x + 11, y + 3); g.drawLine(x + 8, y + 2, x + 8, y + 3); g.fillRect(x + 8, y + 4, 3, 3); g.drawLine(x + 11, y + 6, x + 12, y + 6); - + g.drawLine(x + 1, y + 5, x + 5, y + 5); g.drawLine(x + 1, y + 6, x + 1, y + 12); g.drawLine(x + 9, y + 9, x + 9, y + 12); g.drawLine(x + 1, y + 13, x + 9, y + 13); - + g.drawLine(x + 2, y + 12, x + 2, y + 12); - + g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x + 12, y, x + 9, y + 3); g.drawLine(x + 7, y + 1, x + 8, y + 1); @@ -1390,7 +1390,7 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 3, y + 12, x + 8, y + 12); g.drawLine(x + 8, y + 8, x + 8, y + 11); g.drawLine(x + 9, y + 8, x + 9, y + 8); - + g.setColor(MetalLookAndFeel.getWhite()); g.drawLine(x + 9, y + 2, x + 9, y + 2); g.drawLine(x + 11, y + 4, x + 13, y + 2); @@ -1399,67 +1399,67 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 6, y + 5, x + 6, y + 5); g.drawLine(x + 10, y + 8, x + 10, y + 13); g.drawLine(x + 1, y + 14, x + 10, y + 14); - + if (!b.getModel().isPressed()) { g.drawLine(x + 2, y + 6, x + 6, y + 6); g.drawLine(x + 2, y + 6, x + 2, y + 11); } - + g.setColor(savedColor); - } + } } - + /** - * An icon used for the 'maximize' button in the title frame of a + * An icon used for the 'maximize' button in the title frame of a * {@link JInternalFrame}. */ - private static class InternalFrameMaximizeIcon + private static class InternalFrameMaximizeIcon implements Icon, UIResource, Serializable { - + /** * Creates a new instance. */ - public InternalFrameMaximizeIcon() + public InternalFrameMaximizeIcon() { // Nothing to do here. } - + /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return 16; } - + /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return 16; } - + /** * Paints the icon at the specified location. - * + * * @param c the component. * @param g the graphics device. * @param x the x coordinate. * @param y the y coordinate. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { Color savedColor = g.getColor(); - + AbstractButton b = (AbstractButton) c; - + // fill the interior if (b.getModel().isPressed()) g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); @@ -1471,7 +1471,7 @@ public class MetalIconFactory implements Serializable g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); - + g.drawLine(x + 9, y + 1, x + 10, y + 1); g.fillRect(x + 11, y + 1, 3, 3); g.fillRect(x + 12, y + 4, 2, 2); @@ -1481,7 +1481,7 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 1, y + 6, x + 1, y + 12); g.drawLine(x + 9, y + 6, x + 9, y + 12); g.drawLine(x + 1, y + 13, x + 9, y + 13); - + // fill g.drawLine(x + 7, y + 6, x + 8, y + 6); g.drawLine(x + 6, y + 7, x + 8, y + 7); @@ -1491,7 +1491,7 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 2, y + 11, x + 3, y + 11); g.drawLine(x + 2, y + 12, x + 4, y + 12); g.drawLine(x + 8, y + 8, x + 8, y + 8); - + // draw black g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x + 8, y, x + 13, y); @@ -1499,11 +1499,11 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 10, y + 2, x + 9, y + 3); g.drawLine(x, y + 4, x + 8, y + 4); g.drawLine(x, y + 5, x, y + 13); - + g.drawLine(x + 2, y + 10, x + 6, y + 6); g.drawLine(x + 8, y + 9, x + 8, y + 11); g.drawLine(x + 5, y + 12, x + 8, y + 12); - + // draw white g.setColor(MetalLookAndFeel.getWhite()); if (!b.getModel().isPressed()) @@ -1512,89 +1512,89 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 2, y + 7, x + 2, y + 9); g.drawLine(x + 4, y + 11, x + 7, y + 8); } - + g.drawLine(x + 1, y + 14, x + 10, y + 14); g.drawLine(x + 10, y + 5, x + 10, y + 13); - + g.drawLine(x + 9, y + 2, x + 9, y + 2); g.drawLine(x + 11, y + 4, x + 11, y + 5); g.drawLine(x + 13, y + 6, x + 14, y + 6); g.drawLine(x + 14, y + 1, x + 14, y + 5); g.setColor(savedColor); - } + } } /** * An icon used in the title frame of a {@link JInternalFrame}. */ - private static class InternalFrameMinimizeIcon + private static class InternalFrameMinimizeIcon implements Icon, UIResource, Serializable { - + /** * Creates a new instance. */ - public InternalFrameMinimizeIcon() + public InternalFrameMinimizeIcon() { // Nothing to do here. } - + /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return 16; } - + /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return 16; } - + /** * Paints the icon at the specified location. - * + * * @param c the component. * @param g the graphics device. * @param x the x coordinate. * @param y the y coordinate. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { Color savedColor = g.getColor(); - + AbstractButton b = (AbstractButton) c; - + if (b.getModel().isPressed()) g.setColor(MetalLookAndFeel.getBlack()); else - // FIXME: here the color depends on whether or not the internal frame - // is selected + // FIXME: here the color depends on whether or not the internal frame + // is selected g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); - + g.drawLine(x + 12, y + 1, x + 13, y + 1); g.drawLine(x + 11, y + 2, x + 12, y + 2); g.drawLine(x + 10, y + 3, x + 11, y + 3); g.drawLine(x + 8, y + 2, x + 8, y + 3); g.fillRect(x + 8, y + 4, 3, 3); g.drawLine(x + 11, y + 6, x + 12, y + 6); - + g.drawLine(x + 1, y + 8, x + 6, y + 8); g.drawLine(x + 1, y + 9, x + 1, y + 12); g.drawLine(x + 6, y + 9, x + 6, y + 12); g.drawLine(x + 1, y + 13, x + 6, y + 13); - + g.drawLine(x + 5, y + 9, x + 5, y + 9); g.drawLine(x + 2, y + 12, x + 2, y + 12); - + g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x + 12, y, x + 9, y + 3); g.drawLine(x + 7, y + 1, x + 8, y + 1); @@ -1604,7 +1604,7 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 3, y + 12, x + 5, y + 12); g.drawLine(x + 5, y + 10, x + 5, y + 11); g.drawLine(x + 11, y + 5, x + 12, y + 5); - + g.setColor(MetalLookAndFeel.getWhite()); g.drawLine(x + 9, y + 2, x + 9, y + 2); g.drawLine(x + 11, y + 4, x + 13, y + 2); @@ -1625,14 +1625,14 @@ public class MetalIconFactory implements Serializable } g.setColor(savedColor); - } + } } /** * The icon used to display the thumb control on a horizontally oriented * {@link JSlider} component. */ - private static class VerticalSliderThumbIcon + private static class VerticalSliderThumbIcon implements Icon, UIResource, Serializable { /** @@ -1646,53 +1646,53 @@ public class MetalIconFactory implements Serializable /** * Creates a new instance. */ - public VerticalSliderThumbIcon() + public VerticalSliderThumbIcon() { // Nothing to do here. } - + /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return 16; } - + /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return 15; } - + /** * Paints the icon taking into account whether the slider control has the * focus or not. - * + * * @param c the slider (must be a non-<code>null</code> instance of * {@link JSlider}. * @param g the graphics device. * @param x the x-coordinate. * @param y the y-coordinate. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { boolean enabled = false; boolean focus = false; if (c != null) { enabled = c.isEnabled(); - focus = c.hasFocus(); + focus = c.hasFocus(); } - + // draw the outline - if (enabled) + if (enabled) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDarkShadow()); @@ -1701,8 +1701,8 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 14, y + 8, x + 8, y + 14); g.drawLine(x + 8, y + 14, x + 1, y + 14); g.drawLine(x, y + 13, x, y + 1); - -// The following is commented out until the masking for the gradient painting + +// The following is commented out until the masking for the gradient painting // is working correctly // // Fill the icon. // if (MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme @@ -1768,57 +1768,57 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 6, y + 2, x + 6, y + 2); g.drawLine(x + 6, y + 6, x + 6, y + 6); g.drawLine(x + 6, y + 10, x + 6, y + 10); - + } - } + } } - + /** * A tree control icon. This icon can be in one of two states: expanded and * collapsed. */ public static class TreeControlIcon implements Icon, Serializable { - + /** ???. */ protected boolean isLight; - + /** A flag that controls whether or not the icon is collapsed. */ private boolean collapsed; - + /** * Creates a new icon. - * + * * @param isCollapsed a flag that controls whether the icon is in the * collapsed state or the expanded state. */ - public TreeControlIcon(boolean isCollapsed) + public TreeControlIcon(boolean isCollapsed) { collapsed = isCollapsed; } - + /** * Returns the width of the icon, in pixels. - * + * * @return The width of the icon. */ - public int getIconWidth() + public int getIconWidth() { return 18; } /** * Returns the height of the icon, in pixels. - * + * * @return The height of the icon. */ - public int getIconHeight() + public int getIconHeight() { return 18; } - + /** * Paints the icon at the location (x, y). - * + * * @param c the component. * @param g the graphics device. * @param x the x coordinate. @@ -1840,31 +1840,31 @@ public class MetalIconFactory implements Serializable g.drawOval(x, y, w, w); g.setColor(dark); g.fillOval(x + 1, y + 1, w - 1, w - 1); - + if (collapsed) g.fillRect(x + w, y + wHalf + 1, w, 2); else g.fillRect(x + wHalf + 1, y + w, 2, w); - + g.setColor(white); g.fillRect(x + wHalf + 1, y + wHalf + 1, 2, 2); - } - + } + /** * Simply calls {@link #paintIcon(Component, Graphics, int, int)}. - * + * * @param c the component. * @param g the graphics device. * @param x the x coordinate. * @param y the y coordinate. */ - public void paintMe(Component c, Graphics g, int x, int y) + public void paintMe(Component c, Graphics g, int x, int y) { - paintIcon(c, g, x, y); + paintIcon(c, g, x, y); } } - + /** * A tree folder icon. */ @@ -1873,34 +1873,34 @@ public class MetalIconFactory implements Serializable /** * Creates a new instance. */ - public TreeFolderIcon() + public TreeFolderIcon() { // Nothing to do here. } - + /** * Returns the additional height for this icon, in this case <code>2</code> * pixels. - * + * * @return <code>2</code>. */ - public int getAdditionalHeight() + public int getAdditionalHeight() { return 2; } - + /** - * Returns the vertical shift, in pixels, applied when painting the icon. + * Returns the vertical shift, in pixels, applied when painting the icon. * This overridden method returns <code>-1</code>. - * + * * @return The shift. */ - public int getShift() + public int getShift() { return -1; } } - + /** * A tree leaf icon. */ @@ -1909,29 +1909,29 @@ public class MetalIconFactory implements Serializable /** * Creates a new instance. */ - public TreeLeafIcon() + public TreeLeafIcon() { // Nothing to do here. } - + /** * Returns the additional height for this icon, in this case <code>4</code> * pixels. - * + * * @return <code>4</code>. */ - public int getAdditionalHeight() + public int getAdditionalHeight() { return 4; } - + /** - * Returns the vertical shift, in pixels, applied when painting the icon. + * Returns the vertical shift, in pixels, applied when painting the icon. * This overridden method returns <code>2</code>. - * + * * @return The shift. */ - public int getShift() + public int getShift() { return 2; } @@ -1939,51 +1939,51 @@ public class MetalIconFactory implements Serializable /** * An icon representing a hard disk. - * + * * @see MetalIconFactory#getTreeHardDriveIcon() */ - private static class TreeHardDriveIcon + private static class TreeHardDriveIcon implements Icon, UIResource, Serializable { /** * Creates a new icon instance. */ - public TreeHardDriveIcon() + public TreeHardDriveIcon() { // Nothing to do here. } /** * Returns the width of the icon, in pixels. - * + * * @return <code>16</code>. */ - public int getIconWidth() - { + public int getIconWidth() + { return 16; } /** * Returns the height of the icon, in pixels. - * + * * @return <code>16</code>. */ - public int getIconHeight() + public int getIconHeight() { return 16; } /** - * Paints the icon at the specified location, using colors from the + * Paints the icon at the specified location, using colors from the * current theme. - * + * * @param c the component (ignored). * @param g the graphics device. * @param x the x-coordinate for the top-left of the icon. * @param y the y-coordinate for the top-left of the icon. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { Color saved = g.getColor(); g.setColor(MetalLookAndFeel.getBlack()); @@ -1993,7 +1993,7 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 14, y + 7, x + 14, y + 8); g.drawLine(x + 1, y + 10, x + 1, y + 11); g.drawLine(x + 14, y + 10, x + 14, y + 11); - + g.drawLine(x + 2, y + 3, x + 3, y + 3); g.drawLine(x + 12, y + 3, x + 13, y + 3); g.drawLine(x + 2, y + 6, x + 3, y + 6); @@ -2002,25 +2002,25 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 12, y + 9, x + 13, y + 9); g.drawLine(x + 2, y + 12, x + 3, y + 12); g.drawLine(x + 12, y + 12, x + 13, y + 12); - + g.drawLine(x + 4, y + 2, x + 11, y + 2); g.drawLine(x + 4, y + 7, x + 11, y + 7); g.drawLine(x + 4, y + 10, x + 11, y + 10); g.drawLine(x + 4, y + 13, x + 11, y + 13); - + g.setColor(MetalLookAndFeel.getWhite()); g.fillRect(x + 4, y + 3, 2, 2); g.drawLine(x + 6, y + 4, x + 6, y + 4); g.drawLine(x + 7, y + 3, x + 9, y + 3); g.drawLine(x + 8, y + 4, x + 8, y + 4); g.drawLine(x + 11, y + 3, x + 11, y + 3); - g.fillRect(x + 2, y + 4, 2, 2); - g.fillRect(x + 2, y + 7, 2, 2); - g.fillRect(x + 2, y + 10, 2, 2); + g.fillRect(x + 2, y + 4, 2, 2); + g.fillRect(x + 2, y + 7, 2, 2); + g.fillRect(x + 2, y + 10, 2, 2); g.drawLine(x + 4, y + 6, x + 4, y + 6); g.drawLine(x + 4, y + 9, x + 4, y + 9); g.drawLine(x + 4, y + 12, x + 4, y + 12); - + g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(x + 13, y + 4, x + 13, y + 4); g.drawLine(x + 12, y + 5, x + 13, y + 5); @@ -2028,7 +2028,7 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 12, y + 8, x + 13, y + 8); g.drawLine(x + 13, y + 10, x + 13, y + 10); g.drawLine(x + 12, y + 11, x + 13, y + 11); - + g.drawLine(x + 10, y + 5, x + 10, y + 5); g.drawLine(x + 7, y + 6, x + 7, y + 6); g.drawLine(x + 9, y + 6, x + 9, y + 6); @@ -2045,136 +2045,136 @@ public class MetalIconFactory implements Serializable g.drawLine(x + 11, y + 12, x + 11, y + 12); g.setColor(saved); - } - } - + } + } + /** * An icon representing a floppy disk. - * + * * @see MetalIconFactory#getTreeFloppyDriveIcon() */ - private static class TreeFloppyDriveIcon + private static class TreeFloppyDriveIcon implements Icon, UIResource, Serializable { /** * Creates a new icon instance. */ - public TreeFloppyDriveIcon() + public TreeFloppyDriveIcon() { // Nothing to do here. } /** * Returns the width of the icon, in pixels. - * + * * @return <code>16</code>. */ - public int getIconWidth() - { + public int getIconWidth() + { return 16; } /** * Returns the height of the icon, in pixels. - * + * * @return <code>16</code>. */ - public int getIconHeight() + public int getIconHeight() { return 16; } /** - * Paints the icon at the specified location, using colors from the + * Paints the icon at the specified location, using colors from the * current theme. - * + * * @param c the component (ignored). * @param g the graphics device. * @param x the x-coordinate for the top-left of the icon. * @param y the y-coordinate for the top-left of the icon. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { Color saved = g.getColor(); - + g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x + 1, y + 1, x + 13, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + 14); g.drawLine(x + 1, y + 14, x + 14, y + 14); g.drawLine(x + 14, y + 2, x + 14, y + 14); - + g.setColor(MetalLookAndFeel.getPrimaryControl()); g.fillRect(x + 2, y + 2, 12, 12); - + g.setColor(MetalLookAndFeel.getControlShadow()); g.fillRect(x + 5, y + 2, 6, 5); g.drawLine(x + 4, y + 8, x + 11, y + 8); g.drawLine(x + 3, y + 9, x + 3, y + 13); g.drawLine(x + 12, y + 9, x + 12, y + 13); - + g.setColor(MetalLookAndFeel.getWhite()); g.fillRect(x + 8, y + 3, 2, 3); g.fillRect(x + 4, y + 9, 8, 5); - + g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); g.drawLine(x + 5, y + 10, x + 9, y + 10); g.drawLine(x + 5, y + 12, x + 8, y + 12); g.setColor(saved); - } - } + } + } /** * An icon representing a computer. - * + * * @see MetalIconFactory#getTreeComputerIcon() */ - private static class TreeComputerIcon + private static class TreeComputerIcon implements Icon, UIResource, Serializable { /** * Creates a new icon instance. */ - public TreeComputerIcon() + public TreeComputerIcon() { // Nothing to do here. } /** * Returns the width of the icon, in pixels. - * + * * @return <code>16</code>. */ - public int getIconWidth() - { + public int getIconWidth() + { return 16; } /** * Returns the height of the icon, in pixels. - * + * * @return <code>16</code>. */ - public int getIconHeight() + public int getIconHeight() { return 16; } /** - * Paints the icon at the specified location, using colors from the + * Paints the icon at the specified location, using colors from the * current theme. - * + * * @param c the component (ignored). * @param g the graphics device. * @param x the x-coordinate for the top-left of the icon. * @param y the y-coordinate for the top-left of the icon. */ - public void paintIcon(Component c, Graphics g, int x, int y) + public void paintIcon(Component c, Graphics g, int x, int y) { Color saved = g.getColor(); - + g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x + 3, y + 1, x + 12, y + 1); g.drawLine(x + 2, y + 2, x + 2, y + 8); @@ -2189,20 +2189,20 @@ public class MetalIconFactory implements Serializable g.setColor(MetalLookAndFeel.getPrimaryControl()); g.fillRect(x + 5, y + 4, 6, 4); - + g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(x + 6, y + 12, x + 8, y + 12); g.drawLine(x + 10, y + 12, x + 12, y + 12); g.setColor(saved); - } - } - + } + } + /** The icon returned by {@link #getCheckBoxIcon()}. */ private static Icon checkBoxIcon; - + /** The icon returned by {@link #getCheckBoxMenuItemIcon()}. */ private static Icon checkBoxMenuItemIcon; - + /** The icon returned by {@link #getFileChooserDetailViewIcon()}. */ private static Icon fileChooserDetailViewIcon; @@ -2229,49 +2229,49 @@ public class MetalIconFactory implements Serializable /** The icon returned by {@link #getTreeComputerIcon()}. */ private static Icon treeComputerIcon; - + /** The icon instance returned by {@link #getTreeFloppyDriveIcon()}. */ private static Icon treeFloppyDriveIcon; - + /** The icon instance returned by {@link #getTreeHardDriveIcon()}. */ private static Icon treeHardDriveIcon; - + /** The icon instance returned by {@link #getHorizontalSliderThumbIcon()}. */ private static Icon horizontalSliderThumbIcon; /** The icon instance returned by {@link #getVerticalSliderThumbIcon()}. */ private static Icon verticalSliderThumbIcon; - + /** - * Creates a new instance. All the methods are static, so creating an + * Creates a new instance. All the methods are static, so creating an * instance isn't necessary. */ - public MetalIconFactory() + public MetalIconFactory() { // Nothing to do here. } /** * Returns an icon for use when rendering the {@link JCheckBox} component. - * + * * @return A check box icon. - * + * * @since 1.3 */ - public static Icon getCheckBoxIcon() + public static Icon getCheckBoxIcon() { if (checkBoxIcon == null) checkBoxIcon = new MetalCheckBoxIcon(); return checkBoxIcon; } - + /** - * Returns an icon for use when rendering the {@link JCheckBoxMenuItem} + * Returns an icon for use when rendering the {@link JCheckBoxMenuItem} * component. - * + * * @return An icon. */ - public static Icon getCheckBoxMenuItemIcon() + public static Icon getCheckBoxMenuItemIcon() { if (checkBoxMenuItemIcon == null) checkBoxMenuItemIcon = new CheckBoxMenuItemIcon(); @@ -2280,58 +2280,58 @@ public class MetalIconFactory implements Serializable /** * Returns an icon for use by the {@link JFileChooser} component. - * + * * @return An icon. */ - public static Icon getFileChooserDetailViewIcon() + public static Icon getFileChooserDetailViewIcon() { if (fileChooserDetailViewIcon == null) fileChooserDetailViewIcon = new FileChooserDetailViewIcon(); return fileChooserDetailViewIcon; } - + /** * Returns an icon for use by the {@link JFileChooser} component. - * + * * @return An icon. */ - public static Icon getFileChooserHomeFolderIcon() + public static Icon getFileChooserHomeFolderIcon() { if (fileChooserHomeFolderIcon == null) fileChooserHomeFolderIcon = new FileChooserHomeFolderIcon(); - return fileChooserHomeFolderIcon; + return fileChooserHomeFolderIcon; } - + /** * Returns an icon for use by the {@link JFileChooser} component. - * + * * @return An icon. */ - public static Icon getFileChooserListViewIcon() + public static Icon getFileChooserListViewIcon() { if (fileChooserListViewIcon == null) fileChooserListViewIcon = new FileChooserListViewIcon(); return fileChooserListViewIcon; } - + /** * Returns an icon for use by the {@link JFileChooser} component. - * + * * @return An icon. */ - public static Icon getFileChooserNewFolderIcon() + public static Icon getFileChooserNewFolderIcon() { if (fileChooserNewFolderIcon == null) fileChooserNewFolderIcon = new FileChooserNewFolderIcon(); return fileChooserNewFolderIcon; } - + /** * Returns an icon for use by the {@link JFileChooser} component. - * + * * @return An icon. */ - public static Icon getFileChooserUpFolderIcon() + public static Icon getFileChooserUpFolderIcon() { if (fileChooserUpFolderIcon == null) fileChooserUpFolderIcon = new FileChooserUpFolderIcon(); @@ -2352,10 +2352,10 @@ public class MetalIconFactory implements Serializable /** * Creates a new instance of the icon used in a {@link JRadioButtonMenuItem}. - * + * * @return A new icon instance. */ - public static Icon getRadioButtonMenuItemIcon() + public static Icon getRadioButtonMenuItemIcon() { if (radioButtonMenuItemIcon == null) radioButtonMenuItemIcon = new RadioButtonMenuItemIcon(); @@ -2365,25 +2365,25 @@ public class MetalIconFactory implements Serializable /** * Returns the icon used to display the thumb for a horizontally oriented * {@link JSlider}. - * + * * @return The icon. */ - public static Icon getHorizontalSliderThumbIcon() + public static Icon getHorizontalSliderThumbIcon() { if (horizontalSliderThumbIcon == null) horizontalSliderThumbIcon = new HorizontalSliderThumbIcon(); return horizontalSliderThumbIcon; } - + /** * Creates a new icon used to represent the 'close' button in the title * pane of a {@link JInternalFrame}. - * + * * @param size the icon size. - * + * * @return A close icon. */ - public static Icon getInternalFrameCloseIcon(int size) + public static Icon getInternalFrameCloseIcon(int size) { return new InternalFrameCloseIcon(size); } @@ -2391,39 +2391,39 @@ public class MetalIconFactory implements Serializable /** * Creates a new icon for the menu in a {@link JInternalFrame}. This is the * icon displayed at the top left of the frame. - * + * * @return A menu icon. */ - public static Icon getInternalFrameDefaultMenuIcon() + public static Icon getInternalFrameDefaultMenuIcon() { if (internalFrameDefaultMenuIcon == null) internalFrameDefaultMenuIcon = new InternalFrameDefaultMenuIcon(); return internalFrameDefaultMenuIcon; } - + /** * Creates a new icon for the 'maximize' button in a {@link JInternalFrame}. - * + * * @param size the icon size in pixels. - * + * * @return The icon. - * + * * @see #getInternalFrameAltMaximizeIcon(int) */ - public static Icon getInternalFrameMaximizeIcon(int size) + public static Icon getInternalFrameMaximizeIcon(int size) { return new InternalFrameMaximizeIcon(); } - + /** * Returns the icon used for the minimize button in the frame title for a * {@link JInternalFrame}. - * + * * @param size the icon size in pixels (ignored by this implementation). - * + * * @return The icon. */ - public static Icon getInternalFrameMinimizeIcon(int size) + public static Icon getInternalFrameMinimizeIcon(int size) { return new InternalFrameMinimizeIcon(); } @@ -2431,94 +2431,94 @@ public class MetalIconFactory implements Serializable /** * Creates a new icon for the 'restore' button in a {@link JInternalFrame} * that has been maximised. - * + * * @param size the icon size in pixels. - * + * * @return The icon. - * + * * @see #getInternalFrameMaximizeIcon(int) */ - public static Icon getInternalFrameAltMaximizeIcon(int size) + public static Icon getInternalFrameAltMaximizeIcon(int size) { return new InternalFrameAltMaximizeIcon(size); } - + /** * Returns the icon used to display the thumb for a vertically oriented * {@link JSlider}. - * + * * @return The icon. */ - public static Icon getVerticalSliderThumbIcon() + public static Icon getVerticalSliderThumbIcon() { if (verticalSliderThumbIcon == null) verticalSliderThumbIcon = new VerticalSliderThumbIcon(); return verticalSliderThumbIcon; } - + /** * Creates and returns a new tree folder icon. - * + * * @return A new tree folder icon. - */ - public static Icon getTreeFolderIcon() + */ + public static Icon getTreeFolderIcon() { return new TreeFolderIcon(); } - + /** * Creates and returns a new tree leaf icon. - * + * * @return A new tree leaf icon. */ - public static Icon getTreeLeafIcon() + public static Icon getTreeLeafIcon() { return new TreeLeafIcon(); } - + /** * Creates and returns a tree control icon. - * - * @param isCollapsed a flag that controls whether the icon is in the + * + * @param isCollapsed a flag that controls whether the icon is in the * collapsed or expanded state. - * + * * @return A tree control icon. */ - public static Icon getTreeControlIcon(boolean isCollapsed) + public static Icon getTreeControlIcon(boolean isCollapsed) { return new TreeControlIcon(isCollapsed); } /** * Returns a <code>16x16</code> icon representing a computer. - * + * * @return The icon. */ - public static Icon getTreeComputerIcon() + public static Icon getTreeComputerIcon() { if (treeComputerIcon == null) treeComputerIcon = new TreeComputerIcon(); - return treeComputerIcon; + return treeComputerIcon; } - + /** * Returns a <code>16x16</code> icon representing a floppy disk. - * + * * @return The icon. */ - public static Icon getTreeFloppyDriveIcon() + public static Icon getTreeFloppyDriveIcon() { if (treeFloppyDriveIcon == null) treeFloppyDriveIcon = new TreeFloppyDriveIcon(); return treeFloppyDriveIcon; } - + /** * Returns a <code>16x16</code> icon representing a hard disk. - * + * * @return The icon. */ - public static Icon getTreeHardDriveIcon() + public static Icon getTreeHardDriveIcon() { if (treeHardDriveIcon == null) treeHardDriveIcon = new TreeHardDriveIcon(); @@ -2527,9 +2527,9 @@ public class MetalIconFactory implements Serializable /** * Returns a new instance of a 4 x 8 icon showing a small black triangle that - * points to the right. This is displayed in menu items that have a + * points to the right. This is displayed in menu items that have a * sub menu. - * + * * @return The icon. */ public static Icon getMenuArrowIcon() @@ -2558,11 +2558,11 @@ public class MetalIconFactory implements Serializable }; return menuArrow; } - + /** * Returns a new instance of a 4 x 8 icon showing a small black triangle that * points to the right. This is displayed in menu items that have a sub menu. - * + * * @return The icon. */ public static Icon getMenuItemArrowIcon() @@ -2591,10 +2591,10 @@ public class MetalIconFactory implements Serializable }; return menuItemArrow; } - + /** * Returns a new instance of a 13 x 13 icon showing a small black check mark. - * + * * @return The icon. */ public static Icon getMenuItemCheckIcon() diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java b/libjava/classpath/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java index dd0c486..08de774 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java @@ -60,16 +60,16 @@ import javax.swing.plaf.basic.BasicInternalFrameTitlePane; /** - * The title pane for a {@link JInternalFrame} (see - * {@link MetalInternalFrameUI#createNorthPane(JInternalFrame)}). This can - * be displayed in two styles: one for regular internal frames, and the other + * The title pane for a {@link JInternalFrame} (see + * {@link MetalInternalFrameUI#createNorthPane(JInternalFrame)}). This can + * be displayed in two styles: one for regular internal frames, and the other * for "palette" style internal frames. */ -public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane +public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane { - + /** - * A property change handler that listens for changes to the + * A property change handler that listens for changes to the * <code>JInternalFrame.isPalette</code> property and updates the title * pane as appropriate. */ @@ -83,11 +83,11 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane { super(); } - + /** * Handles <code>JInternalFrame.isPalette</code> property changes, with all * other property changes being passed to the superclass. - * + * * @param e the event. */ public void propertyChange(PropertyChangeEvent e) @@ -111,7 +111,7 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane /** * A layout manager for the title pane. - * + * * @see #createLayout() */ private class MetalTitlePaneLayout implements LayoutManager @@ -176,8 +176,8 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane } Dimension titlePreferredSize = title.getPreferredSize(); - title.setBounds(insets.left + 5, insets.top, - Math.min(titlePreferredSize.width, loc - insets.left - 10), + title.setBounds(insets.left + 5, insets.top, + Math.min(titlePreferredSize.width, loc - insets.left - 10), height); } @@ -224,26 +224,26 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane /** A flag indicating whether the title pane uses the palette style. */ protected boolean isPalette; - - /** + + /** * The icon used for the close button - this is fetched from the look and - * feel defaults using the key <code>InternalFrame.paletteCloseIcon</code>. + * feel defaults using the key <code>InternalFrame.paletteCloseIcon</code>. */ protected Icon paletteCloseIcon; - + /** - * The height of the title pane when <code>isPalette</code> is - * <code>true</code>. This value is fetched from the look and feel defaults + * The height of the title pane when <code>isPalette</code> is + * <code>true</code>. This value is fetched from the look and feel defaults * using the key <code>InternalFrame.paletteTitleHeight</code>. */ protected int paletteTitleHeight; - + /** The label used to display the title for the internal frame. */ JLabel title; - + /** * Creates a new title pane for the specified frame. - * + * * @param f the internal frame. */ public MetalInternalFrameTitlePane(JInternalFrame f) @@ -251,7 +251,7 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane super(f); isPalette = false; } - + /** * Fetches the colors used in the title pane. */ @@ -262,21 +262,21 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane selectedTitleColor = MetalLookAndFeel.getWindowTitleBackground(); notSelectedTextColor = MetalLookAndFeel.getInactiveControlTextColor(); notSelectedTitleColor = MetalLookAndFeel.getWindowTitleInactiveBackground(); - + paletteTitleHeight = UIManager.getInt("InternalFrame.paletteTitleHeight"); paletteCloseIcon = UIManager.getIcon("InternalFrame.paletteCloseIcon"); minIcon = MetalIconFactory.getInternalFrameAltMaximizeIcon(16); - title = new JLabel(frame.getTitle(), - MetalIconFactory.getInternalFrameDefaultMenuIcon(), + title = new JLabel(frame.getTitle(), + MetalIconFactory.getInternalFrameDefaultMenuIcon(), SwingConstants.LEFT); } - + /** * Clears the colors used for the title pane. */ protected void uninstallDefaults() - { + { super.uninstallDefaults(); selectedTextColor = null; selectedTitleColor = null; @@ -286,14 +286,14 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane minIcon = null; title = null; } - + /** * Calls the super class to create the buttons, then calls - * <code>setBorderPainted(false)</code> and + * <code>setBorderPainted(false)</code> and * <code>setContentAreaFilled(false)</code> for each button. */ protected void createButtons() - { + { super.createButtons(); closeButton.setBorderPainted(false); closeButton.setContentAreaFilled(false); @@ -302,7 +302,7 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane maxButton.setBorderPainted(false); maxButton.setContentAreaFilled(false); } - + /** * Overridden to do nothing. */ @@ -310,21 +310,21 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane { // do nothing } - + /** * Overridden to do nothing. */ protected void showSystemMenu() { - // do nothing + // do nothing } - + /** * Adds the sub components of the title pane. */ protected void addSubComponents() { - // FIXME: this method is probably overridden to only add the required + // FIXME: this method is probably overridden to only add the required // buttons add(title); add(closeButton); @@ -335,19 +335,19 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane /** * Creates a new instance of <code>MetalTitlePaneLayout</code> (not part of * the public API). - * + * * @return A new instance of <code>MetalTitlePaneLayout</code>. */ protected LayoutManager createLayout() { return new MetalTitlePaneLayout(); } - + /** * Draws the title pane in the palette style. - * + * * @param g the graphics device. - * + * * @see #paintComponent(Graphics) */ public void paintPalette(Graphics g) @@ -362,22 +362,22 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane SwingConstants.VERTICAL, "InternalFrame.activeTitleGradient"); } - MetalUtils.fillMetalPattern(this, g, b.x + 4, b.y + 2, b.width + MetalUtils.fillMetalPattern(this, g, b.x + 4, b.y + 2, b.width - paletteCloseIcon.getIconWidth() - 13, b.height - 5, - MetalLookAndFeel.getPrimaryControlHighlight(), + MetalLookAndFeel.getPrimaryControlHighlight(), MetalLookAndFeel.getBlack()); - + // draw a line separating the title pane from the frame content Dimension d = getSize(); g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); g.drawLine(0, d.height - 1, d.width - 1, d.height - 1); - + g.setColor(savedColor); } /** * Paints a representation of the current state of the internal frame. - * + * * @param g the graphics device. */ public void paintComponent(Graphics g) @@ -394,13 +394,13 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); else g.setColor(MetalLookAndFeel.getControlDarkShadow()); - + // put a dot in each of the top corners g.drawLine(0, 0, 0, 0); g.drawLine(d.width - 1, 0, d.width - 1, 0); - + g.drawLine(0, d.height - 1, d.width - 1, d.height - 1); - + // draw the metal pattern if (UIManager.get("InternalFrame.activeTitleGradient") != null && frame.isSelected()) @@ -415,22 +415,22 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane int endX = startX; if (iconButton.isVisible()) endX = Math.max(iconButton.getX(), endX); - else if (maxButton.isVisible()) + else if (maxButton.isVisible()) endX = Math.max(maxButton.getX(), endX); else if (closeButton.isVisible()) endX = Math.max(closeButton.getX(), endX); endX -= 7; if (endX > startX) - MetalUtils.fillMetalPattern(this, g, startX, 3, endX - startX, + MetalUtils.fillMetalPattern(this, g, startX, 3, endX - startX, getHeight() - 6, Color.white, Color.gray); } g.setColor(savedColor); } - + /** - * Sets the flag that controls whether the title pane is drawn in the + * Sets the flag that controls whether the title pane is drawn in the * palette style or the regular style. - * + * * @param b the new value of the flag. */ public void setPalette(boolean b) @@ -444,15 +444,14 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane else closeButton.setIcon(closeIcon); } - + /** * Creates and returns a property change handler for the title pane. - * + * * @return The property change handler. */ protected PropertyChangeListener createPropertyChangeListener() { - return new MetalInternalFrameTitlePanePropertyChangeHandler(); + return new MetalInternalFrameTitlePanePropertyChangeHandler(); } } - diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalInternalFrameUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalInternalFrameUI.java index abe6a28..5eda2ff 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalInternalFrameUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalInternalFrameUI.java @@ -54,16 +54,16 @@ import javax.swing.plaf.basic.BasicInternalFrameUI; public class MetalInternalFrameUI extends BasicInternalFrameUI { - /** - * The key (<code>JInternalFrame.isPalette</code>) for the client property - * that controls whether the internal frame is displayed using the palette - * style. + /** + * The key (<code>JInternalFrame.isPalette</code>) for the client property + * that controls whether the internal frame is displayed using the palette + * style. */ protected static String IS_PALETTE = "JInternalFrame.isPalette"; /** * Constructs a new instance of <code>MetalInternalFrameUI</code>. - * + * * @param frame the frame. */ public MetalInternalFrameUI(JInternalFrame frame) @@ -82,10 +82,10 @@ public class MetalInternalFrameUI { return new MetalInternalFrameUI((JInternalFrame) component); } - + /** * Sets the fields and properties for the component. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -101,23 +101,23 @@ public class MetalInternalFrameUI /** * Creates and returns the component that will be used for the north pane - * of the {@link JInternalFrame}. - * + * of the {@link JInternalFrame}. + * * @param w the internal frame. - * + * * @return A new instance of {@link MetalInternalFrameTitlePane}. */ protected JComponent createNorthPane(JInternalFrame w) { titlePane = new MetalInternalFrameTitlePane(w); - return titlePane; + return titlePane; } - + /** * Sets the state of the {@link JInternalFrame} to reflect whether or not * it is using the palette style. When a frame is displayed as a palette, * it uses a different border and the title pane is drawn differently. - * + * * @param isPalette use the palette style? */ public void setPalette(boolean isPalette) @@ -129,17 +129,17 @@ public class MetalInternalFrameUI else frame.setBorder(new MetalBorders.InternalFrameBorder()); } - + /** A listener that is used to handle IS_PALETTE property changes. */ private PropertyChangeListener paletteListener; - + /** * Adds the required listeners. */ protected void installListeners() { - super.installListeners(); - paletteListener = new PropertyChangeListener() + super.installListeners(); + paletteListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { @@ -154,7 +154,7 @@ public class MetalInternalFrameUI }; frame.addPropertyChangeListener(paletteListener); } - + /** * Removes the listeners used. */ diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalLabelUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalLabelUI.java index 12b858e..915e501 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalLabelUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalLabelUI.java @@ -79,12 +79,12 @@ public class MetalLabelUI metalLabelUI = new MetalLabelUI(); return metalLabelUI; } - + /** - * Draws the text for a disabled label, using the color defined in the + * Draws the text for a disabled label, using the color defined in the * {@link UIManager} defaults with the key * <code>Label.disabledForeground</code>. - * + * * @param l the label. * @param g the graphics device. * @param s the label text. diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java b/libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java index 25c624b..acc3fed 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java @@ -56,7 +56,7 @@ import javax.swing.plaf.basic.BasicLookAndFeel; /** * A custom look and feel that is designed to look similar across different - * operating systems. To install this look and feel, add the following code + * operating systems. To install this look and feel, add the following code * (or something similar) near the start of your application:</p> * <pre> * try @@ -69,12 +69,12 @@ import javax.swing.plaf.basic.BasicLookAndFeel; * }</pre> */ public class MetalLookAndFeel extends BasicLookAndFeel -{ +{ private static final long serialVersionUID = 6680646159193457980L; - + /** The current theme. */ private static MetalTheme theme; - + /** * Creates a new instance of the Metal look and feel. */ @@ -95,7 +95,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel * Returns <code>false</code> to indicate that this look and feel does not * attempt to emulate the look and feel of native applications on the host * platform. - * + * * @return <code>false</code>. */ public boolean isNativeLookAndFeel() @@ -106,7 +106,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns <code>true</code> to indicate that this look and feel is supported * on all platforms. - * + * * @return <code>true</code>. */ public boolean isSupportedLookAndFeel() @@ -117,7 +117,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns a string describing the look and feel. In this case, the method * returns "Metal look and feel". - * + * * @return A string describing the look and feel. */ public String getDescription() @@ -127,7 +127,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the look and feel identifier. - * + * * @return "MetalLookAndFeel". */ public String getID() @@ -137,7 +137,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the look and feel name. - * + * * @return "MetalLookAndFeel". */ public String getName() @@ -156,7 +156,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the accelerator foreground color from the installed theme. - * + * * @return The accelerator foreground color. */ public static ColorUIResource getAcceleratorForeground() @@ -167,9 +167,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel } /** - * Returns the accelerator selected foreground color from the installed + * Returns the accelerator selected foreground color from the installed * theme. - * + * * @return The accelerator selected foreground color. */ public static ColorUIResource getAcceleratorSelectedForeground() @@ -181,7 +181,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the color black from the installed theme. - * + * * @return The color black. */ public static ColorUIResource getBlack() @@ -193,7 +193,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the control color from the installed theme. - * + * * @return The control color. */ public static ColorUIResource getControl() @@ -206,7 +206,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the color used for dark shadows on controls, from the installed * theme. - * + * * @return The color used for dark shadows on controls. */ public static ColorUIResource getControlDarkShadow() @@ -218,7 +218,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the color used for disabled controls, from the installed theme. - * + * * @return The color used for disabled controls. */ public static ColorUIResource getControlDisabled() @@ -231,7 +231,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the color used to draw highlights for controls, from the installed * theme. - * + * * @return The color used to draw highlights for controls. */ public static ColorUIResource getControlHighlight() @@ -242,9 +242,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel } /** - * Returns the color used to display control info, from the installed + * Returns the color used to display control info, from the installed * theme. - * + * * @return The color used to display control info. */ public static ColorUIResource getControlInfo() @@ -257,7 +257,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the color used to draw shadows for controls, from the installed * theme. - * + * * @return The color used to draw shadows for controls. */ public static ColorUIResource getControlShadow() @@ -269,7 +269,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the color used for text on controls, from the installed theme. - * + * * @return The color used for text on controls. */ public static ColorUIResource getControlTextColor() @@ -281,7 +281,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the font used for text on controls, from the installed theme. - * + * * @return The font used for text on controls. */ public static FontUIResource getControlTextFont() @@ -292,9 +292,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel } /** - * Returns the color used for the desktop background, from the installed + * Returns the color used for the desktop background, from the installed * theme. - * + * * @return The color used for the desktop background. */ public static ColorUIResource getDesktopColor() @@ -305,9 +305,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel } /** - * Returns the color used to draw focus highlights, from the installed + * Returns the color used to draw focus highlights, from the installed * theme. - * + * * @return The color used to draw focus highlights. */ public static ColorUIResource getFocusColor() @@ -320,7 +320,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the color used to draw highlighted text, from the installed * theme. - * + * * @return The color used to draw highlighted text. */ public static ColorUIResource getHighlightedTextColor() @@ -333,7 +333,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the color used to draw text on inactive controls, from the * installed theme. - * + * * @return The color used to draw text on inactive controls. */ public static ColorUIResource getInactiveControlTextColor() @@ -346,7 +346,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the color used to draw inactive system text, from the installed * theme. - * + * * @return The color used to draw inactive system text. */ public static ColorUIResource getInactiveSystemTextColor() @@ -358,9 +358,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the background color for menu items, from the installed theme. - * + * * @return The background color for menu items. - * + * * @see #getMenuSelectedBackground() */ public static ColorUIResource getMenuBackground() @@ -373,9 +373,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the foreground color for disabled menu items, from the installed * theme. - * + * * @return The foreground color for disabled menu items. - * + * * @see #getMenuForeground() */ public static ColorUIResource getMenuDisabledForeground() @@ -387,9 +387,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the foreground color for menu items, from the installed theme. - * + * * @return The foreground color for menu items. - * + * * @see #getMenuDisabledForeground() * @see #getMenuSelectedForeground() */ @@ -403,9 +403,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the background color for selected menu items, from the installed * theme. - * + * * @return The background color for selected menu items. - * + * * @see #getMenuBackground() */ public static ColorUIResource getMenuSelectedBackground() @@ -418,9 +418,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the foreground color for selected menu items, from the installed * theme. - * + * * @return The foreground color for selected menu items. - * + * * @see #getMenuForeground() */ public static ColorUIResource getMenuSelectedForeground() @@ -432,7 +432,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the font used for text in menus, from the installed theme. - * + * * @return The font used for text in menus. */ public static FontUIResource getMenuTextFont() @@ -444,7 +444,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the primary color for controls, from the installed theme. - * + * * @return The primary color for controls. */ public static ColorUIResource getPrimaryControl() @@ -455,9 +455,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel } /** - * Returns the primary color for the dark shadow on controls, from the + * Returns the primary color for the dark shadow on controls, from the * installed theme. - * + * * @return The primary color for the dark shadow on controls. */ public static ColorUIResource getPrimaryControlDarkShadow() @@ -468,9 +468,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel } /** - * Returns the primary color for the highlight on controls, from the + * Returns the primary color for the highlight on controls, from the * installed theme. - * + * * @return The primary color for the highlight on controls. */ public static ColorUIResource getPrimaryControlHighlight() @@ -481,9 +481,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel } /** - * Returns the primary color for the information on controls, from the + * Returns the primary color for the information on controls, from the * installed theme. - * + * * @return The primary color for the information on controls. */ public static ColorUIResource getPrimaryControlInfo() @@ -496,7 +496,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the primary color for the shadow on controls, from the installed * theme. - * + * * @return The primary color for the shadow on controls. */ public static ColorUIResource getPrimaryControlShadow() @@ -508,7 +508,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the background color for separators, from the installed theme. - * + * * @return The background color for separators. */ public static ColorUIResource getSeparatorBackground() @@ -520,7 +520,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the foreground color for separators, from the installed theme. - * + * * @return The foreground color for separators. */ public static ColorUIResource getSeparatorForeground() @@ -532,7 +532,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the font used for sub text, from the installed theme. - * + * * @return The font used for sub text. */ public static FontUIResource getSubTextFont() @@ -544,7 +544,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the color used for system text, from the installed theme. - * + * * @return The color used for system text. */ public static ColorUIResource getSystemTextColor() @@ -556,7 +556,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the font used for system text, from the installed theme. - * + * * @return The font used for system text. */ public static FontUIResource getSystemTextFont() @@ -568,7 +568,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the color used to highlight text, from the installed theme. - * + * * @return The color used to highlight text. */ public static ColorUIResource getTextHighlightColor() @@ -580,7 +580,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the color used to display user text, from the installed theme. - * + * * @return The color used to display user text. */ public static ColorUIResource getUserTextColor() @@ -592,7 +592,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the font used for user text, obtained from the current theme. - * + * * @return The font used for user text. */ public static FontUIResource getUserTextFont() @@ -604,7 +604,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the color used for white, from the installed theme. - * + * * @return The color used for white. */ public static ColorUIResource getWhite() @@ -616,7 +616,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the window background color, from the installed theme. - * + * * @return The window background color. */ public static ColorUIResource getWindowBackground() @@ -628,7 +628,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the window title background color, from the installed theme. - * + * * @return The window title background color. */ public static ColorUIResource getWindowTitleBackground() @@ -640,9 +640,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the window title font from the current theme. - * + * * @return The window title font. - * + * * @see MetalTheme */ public static FontUIResource getWindowTitleFont() @@ -654,7 +654,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel /** * Returns the window title foreground color, from the installed theme. - * + * * @return The window title foreground color. */ public static ColorUIResource getWindowTitleForeground() @@ -665,9 +665,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel } /** - * Returns the background color for an inactive window title, from the + * Returns the background color for an inactive window title, from the * installed theme. - * + * * @return The background color for an inactive window title. */ public static ColorUIResource getWindowTitleInactiveBackground() @@ -678,9 +678,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel } /** - * Returns the foreground color for an inactive window title, from the + * Returns the foreground color for an inactive window title, from the * installed theme. - * + * * @return The foreground color for an inactive window title. */ public static ColorUIResource getWindowTitleInactiveForeground() @@ -691,17 +691,17 @@ public class MetalLookAndFeel extends BasicLookAndFeel } /** - * Sets the current theme for the look and feel. Note that the theme must be - * set <em>before</em> the look and feel is installed. To change the theme - * for an already running application that is using the - * {@link MetalLookAndFeel}, first set the theme with this method, then - * create a new instance of {@link MetalLookAndFeel} and install it in the + * Sets the current theme for the look and feel. Note that the theme must be + * set <em>before</em> the look and feel is installed. To change the theme + * for an already running application that is using the + * {@link MetalLookAndFeel}, first set the theme with this method, then + * create a new instance of {@link MetalLookAndFeel} and install it in the * usual way (see {@link UIManager#setLookAndFeel(LookAndFeel)}). - * + * * @param theme the theme (<code>null</code> not permitted). - * + * * @throws NullPointerException if <code>theme</code> is <code>null</code>. - * + * * @see #getCurrentTheme() */ public static void setCurrentTheme(MetalTheme theme) @@ -934,7 +934,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel "EditorPane.inactiveForeground", getInactiveSystemTextColor(), "EditorPane.selectionBackground", getTextHighlightColor(), "EditorPane.selectionForeground", getHighlightedTextColor(), - + "FormattedTextField.background", getWindowBackground(), "FormattedTextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), @@ -946,15 +946,15 @@ public class MetalLookAndFeel extends BasicLookAndFeel "FormattedTextField.selectionBackground", getTextHighlightColor(), "FormattedTextField.selectionForeground", getHighlightedTextColor(), - "FileChooser.upFolderIcon", + "FileChooser.upFolderIcon", MetalIconFactory.getFileChooserUpFolderIcon(), - "FileChooser.listViewIcon", + "FileChooser.listViewIcon", MetalIconFactory.getFileChooserListViewIcon(), - "FileChooser.newFolderIcon", + "FileChooser.newFolderIcon", MetalIconFactory.getFileChooserNewFolderIcon(), - "FileChooser.homeFolderIcon", + "FileChooser.homeFolderIcon", MetalIconFactory.getFileChooserHomeFolderIcon(), - "FileChooser.detailsViewIcon", + "FileChooser.detailsViewIcon", MetalIconFactory.getFileChooserDetailViewIcon(), "FileChooser.fileNameLabelMnemonic", new Integer(78), "FileChooser.filesOfTypeLabelMnemonic", new Integer(84), @@ -974,15 +974,15 @@ public class MetalLookAndFeel extends BasicLookAndFeel "InternalFrame.borderLight", getControlHighlight(), "InternalFrame.borderShadow", getControlShadow(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), - "InternalFrame.closeIcon", + "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.closeSound", "sounds/FrameClose.wav", "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(), "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(), - "InternalFrame.maximizeIcon", + "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.maximizeSound", "sounds/FrameMaximize.wav", - "InternalFrame.iconifyIcon", + "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "InternalFrame.minimizeSound", "sounds/FrameMinimize.wav", "InternalFrame.paletteBorder", new MetalBorders.PaletteBorder(), @@ -1002,7 +1002,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel "List.foreground", getUserTextColor(), "List.selectionBackground", getTextHighlightColor(), "List.selectionForeground", getHighlightedTextColor(), - "List.focusCellHighlightBorder", + "List.focusCellHighlightBorder", new LineBorderUIResource(MetalLookAndFeel.getFocusColor()), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), @@ -1047,7 +1047,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel "OptionPane.informationSound", "sounds/OptionPaneInformation.wav", "OptionPane.questionSound", "sounds/OptionPaneQuestion.wav", "OptionPane.warningSound", "sounds/OptionPaneWarning.wav", - "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), + "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153), "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0), "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102), @@ -1114,16 +1114,16 @@ public class MetalLookAndFeel extends BasicLookAndFeel "RadioButtonMenuItem.background", getMenuBackground(), "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, - "RadioButtonMenuItem.checkIcon", + "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.commandSound", "sounds/MenuItemCommand.wav", "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(), "RadioButtonMenuItem.font", getMenuTextFont(), "RadioButtonMenuItem.foreground", getMenuForeground(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), - "RadioButtonMenuItem.selectionBackground", + "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), - "RadioButtonMenuItem.selectionForeground", + "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE, @@ -1154,12 +1154,12 @@ public class MetalLookAndFeel extends BasicLookAndFeel "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.foreground", getPrimaryControlShadow(), "Slider.highlight", getControlHighlight(), - "Slider.horizontalThumbIcon", + "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.majorTickLength", new Integer(6), "Slider.shadow", getControlShadow(), "Slider.trackWidth", new Integer(7), - "Slider.verticalThumbIcon", + "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Spinner.arrowButtonInsets", new InsetsUIResource(0, 0, 0, 0), @@ -1197,7 +1197,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel // new properties in OceanTheme: // TabbedPane.contentAreaColor // TabbedPane.unselectedBackground - + "Table.background", getWindowBackground(), "Table.focusCellBackground", getWindowBackground(), "Table.focusCellForeground", getControlTextColor(), @@ -1235,7 +1235,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel "TextField.selectionBackground", getTextHighlightColor(), "TextField.selectionForeground", getHighlightedTextColor(), "TextField.shadow", getControlShadow(), - + "TextPane.background", getWindowBackground(), "TextPane.caretForeground", getUserTextColor(), "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), @@ -1341,7 +1341,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel * an instance of {@link OceanTheme}. * * @return The current theme (never <code>null</code>). - * + * * @see #setCurrentTheme(MetalTheme) */ public static MetalTheme getCurrentTheme() diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalMenuBarUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalMenuBarUI.java index 2cc52ed..35f2b05 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalMenuBarUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalMenuBarUI.java @@ -49,7 +49,7 @@ import javax.swing.plaf.basic.BasicMenuBarUI; /** * A UI implementation for MenuBar in the Metal Look & Feel. - * + * * @author Roman Kennke (kennke@aicas.com) * * @since 1.5 @@ -84,7 +84,7 @@ public class MetalMenuBarUI extends BasicMenuBarUI { MetalUtils.paintGradient(g, 0, 0, c.getWidth(), height, SwingConstants.VERTICAL, "MenuBar.gradient"); - + paint(g, c); } else diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalProgressBarUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalProgressBarUI.java index 0f28818..005c5f0 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalProgressBarUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalProgressBarUI.java @@ -51,7 +51,7 @@ import javax.swing.plaf.basic.BasicProgressBarUI; * A UI delegate for the {@link JProgressBar} component. */ public class MetalProgressBarUI extends BasicProgressBarUI -{ +{ /** * Constructs a new instance of <code>MetalProgressBarUI</code>. */ @@ -88,7 +88,7 @@ public class MetalProgressBarUI extends BasicProgressBarUI int w = progressBar.getWidth(); int h = progressBar.getHeight(); int orientation = progressBar.getOrientation(); - + Color shadow = MetalLookAndFeel.getControlShadow(); g.setColor(shadow); diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalRadioButtonUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalRadioButtonUI.java index 57f5bbe..0f7f3b1 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalRadioButtonUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalRadioButtonUI.java @@ -60,13 +60,13 @@ public class MetalRadioButtonUI /** Used to draw the focus rectangle. */ protected Color focusColor; - + /** Used to fill the icon when the button is pressed. */ protected Color selectColor; - + /** Used to draw disabled text. */ protected Color disabledTextColor; - + /** * Constructs a new instance of <code>MetalRadioButtonUI</code>. */ @@ -86,10 +86,10 @@ public class MetalRadioButtonUI { return new MetalRadioButtonUI(); } - + /** * Sets the default values for the specified button. - * + * * @param b the button. */ public void installDefaults(AbstractButton b) @@ -100,10 +100,10 @@ public class MetalRadioButtonUI focusColor = UIManager.getColor(prefix + "focus"); selectColor = UIManager.getColor(prefix + "select"); } - + /** * Clears any defaults set in the installDefaults() method. - * + * * @param b the {@link JRadioButton}. */ protected void uninstallDefaults(AbstractButton b) @@ -113,50 +113,50 @@ public class MetalRadioButtonUI focusColor = null; selectColor = null; } - + /** * Returns the color used to fill the {@link JRadioButton}'s icon when the - * button is pressed. The default color is obtained from the - * {@link UIManager} defaults via an entry with the key + * button is pressed. The default color is obtained from the + * {@link UIManager} defaults via an entry with the key * <code>RadioButton.select</code>. - * + * * @return The select color. */ protected Color getSelectColor() { - return selectColor; + return selectColor; } - + /** * Returns the color for the {@link JRadioButton}'s text when the button is * disabled. The default color is obtained from the {@link UIManager} * defaults via an entry with the key <code>RadioButton.disabledText</code>. - * + * * @return The disabled text color. */ protected Color getDisabledTextColor() { return disabledTextColor; } - + /** - * Returns the color used to draw the focus rectangle when the - * {@link JRadioButton} has the focus. The default color is obtained from - * the {@link UIManager} defaults via an entry with the key + * Returns the color used to draw the focus rectangle when the + * {@link JRadioButton} has the focus. The default color is obtained from + * the {@link UIManager} defaults via an entry with the key * <code>RadioButton.focus</code>. - * + * * @return The color used to draw the focus rectangle. - * + * * @see #paintFocus(Graphics, Rectangle, Dimension) */ protected Color getFocusColor() { return focusColor; } - + /** * Paints the {@link JRadioButton}. - * + * * @param g the graphics device. * @param c the component (an instance of {@link JRadioButton}). */ @@ -166,10 +166,10 @@ public class MetalRadioButtonUI // FIXME: disabled text isn't being drawn correctly, it's possible that // it could be done here... } - + /** * Paints the focus rectangle for the {@link JRadioButton}. - * + * * @param g the graphics device. * @param t the bounding rectangle for the text. * @param d ??? @@ -179,5 +179,5 @@ public class MetalRadioButtonUI g.setColor(focusColor); g.drawRect(t.x - 1, t.y - 1, t.width + 1, t.height + 1); } - + } diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalRootPaneUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalRootPaneUI.java index eaee5bf..84f1303 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalRootPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalRootPaneUI.java @@ -76,8 +76,8 @@ import javax.swing.plaf.basic.BasicRootPaneUI; /** * A UI delegate for the {@link JRootPane} component. This implementation - * supports the JRootPane <code>windowDecorationStyle</code> property. - * + * supports the JRootPane <code>windowDecorationStyle</code> property. + * * @author Roman Kennke (kennke@aicas.com) * * @since 1.4 @@ -115,7 +115,7 @@ public class MetalRootPaneUI newInsets.bottom = 5; newInsets.right = 5; } - return newInsets; + return newInsets; } /** @@ -132,7 +132,7 @@ public class MetalRootPaneUI /** * Paints the border for the specified component. - * + * * @param c the component * @param g the graphics device * @param x the x-coordinate @@ -140,7 +140,7 @@ public class MetalRootPaneUI * @param w the width * @param h the height */ - public void paintBorder(Component c, Graphics g, int x, int y, int w, + public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { JRootPane f = (JRootPane) c; @@ -149,31 +149,31 @@ public class MetalRootPaneUI g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); else g.setColor(MetalLookAndFeel.getControlDarkShadow()); - + // Fill the border background. g.fillRect(x, y, w, 5); g.fillRect(x, y, 5, h); g.fillRect(x + w - 5, y, 5, h); g.fillRect(x, y + h - 5, w, 5); - + // Draw a dot in each corner. g.setColor(MetalLookAndFeel.getControl()); g.fillRect(x, y, 1, 1); g.fillRect(x + w - 1, y, 1, 1); g.fillRect(x + w - 1, y + h - 1, 1, 1); g.fillRect(x, y + h - 1, 1, 1); - + // Draw the lines. g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x + 14, y + 2, x + w - 15, y + 2); g.drawLine(x + 14, y + h - 3, x + w - 15, y + h - 3); g.drawLine(x + 2, y + 14, x + 2, y + h - 15); g.drawLine(x + w - 3, y + 14, x + w - 3, y + h - 15); - + // Draw the line highlights. if (frame.isActive()) g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); - else + else g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(x + 15, y + 3, x + w - 14, y + 3); g.drawLine(x + 15, y + h - 2, x + w - 14, y + h - 2); @@ -248,7 +248,7 @@ public class MetalRootPaneUI { super("Close"); } - + /** * This method is called when something closes the frame. * @@ -316,7 +316,7 @@ public class MetalRootPaneUI f.setExtendedState(Frame.ICONIFIED); } } - + } /** @@ -437,8 +437,8 @@ public class MetalRootPaneUI } Dimension titlePreferredSize = title.getPreferredSize(); - title.setBounds(insets.left + 5, insets.top, - Math.min(titlePreferredSize.width, loc - insets.left - 10), + title.setBounds(insets.left + 5, insets.top, + Math.min(titlePreferredSize.width, loc - insets.left - 10), height); } @@ -501,7 +501,7 @@ public class MetalRootPaneUI /** The icon displayed in the close button. */ Icon closeIcon; - + /** * The background color of the TitlePane when the JInternalFrame is not * selected. @@ -653,7 +653,7 @@ public class MetalRootPaneUI /** * Paints a representation of the current state of the internal frame. - * + * * @param g the graphics device. */ public void paintComponent(Graphics g) @@ -667,13 +667,13 @@ public class MetalRootPaneUI g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); else g.setColor(MetalLookAndFeel.getControlDarkShadow()); - + // put a dot in each of the top corners g.drawLine(0, 0, 0, 0); g.drawLine(d.width - 1, 0, d.width - 1, 0); - + g.drawLine(0, d.height - 1, d.width - 1, d.height - 1); - + // draw the metal pattern if (UIManager.get("InternalFrame.activeTitleGradient") != null && frame.isActive()) @@ -688,7 +688,7 @@ public class MetalRootPaneUI int endX = startX; if (iconButton.isVisible()) endX = Math.max(iconButton.getX(), endX); - else if (maxButton.isVisible()) + else if (maxButton.isVisible()) endX = Math.max(maxButton.getX(), endX); else if (closeButton.isVisible()) endX = Math.max(closeButton.getX(), endX); @@ -709,10 +709,10 @@ public class MetalRootPaneUI if (!isOpaque()) return; - + Color saved = g.getColor(); Dimension dims = getSize(); - + Color bg = getBackground(); if (frame.isActive()) bg = selectedTitleColor; @@ -736,8 +736,8 @@ public class MetalRootPaneUI maxIcon = UIManager.getIcon("InternalFrame.maximizeIcon"); minIcon = MetalIconFactory.getInternalFrameAltMaximizeIcon(16); Frame frame = (Frame) SwingUtilities.getWindowAncestor(rootPane); - title = new JLabel(frame.getTitle(), - MetalIconFactory.getInternalFrameDefaultMenuIcon(), + title = new JLabel(frame.getTitle(), + MetalIconFactory.getInternalFrameDefaultMenuIcon(), SwingConstants.LEFT); } } @@ -770,7 +770,7 @@ public class MetalRootPaneUI * The cached layout info for the title pane. */ private Rectangle titlePaneBounds; - + /** * The cached preferred size. */ @@ -832,7 +832,7 @@ public class MetalRootPaneUI public void removeLayoutComponent(Component component) { // TODO Auto-generated method stub - + } public Dimension preferredLayoutSize(Container parent) @@ -894,7 +894,7 @@ public class MetalRootPaneUI // 4. The menuBar is positioned at the upper edge of layeredPane. // 5. The contentPane fills viewable region minus menuBar minus // titlePane, if present. - + // +-------------------------------+ // | JLayeredPane | // | +--------------------------+ | @@ -952,7 +952,7 @@ public class MetalRootPaneUI contentPane.setBounds(contentPaneBounds); titlePane.setBounds(titlePaneBounds); } - + } /** diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalScrollBarUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalScrollBarUI.java index 4c75fcb..5f0cbe4 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalScrollBarUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalScrollBarUI.java @@ -59,30 +59,30 @@ import javax.swing.plaf.basic.BasicScrollBarUI; */ public class MetalScrollBarUI extends BasicScrollBarUI { - + /** * A property change handler for the UI delegate that monitors for * changes to the "JScrollBar.isFreeStanding" property, and updates * the buttons and track rendering as appropriate. */ - class MetalScrollBarPropertyChangeHandler + class MetalScrollBarPropertyChangeHandler extends BasicScrollBarUI.PropertyChangeHandler { /** * Creates a new handler. - * + * * @see #createPropertyChangeListener() */ public MetalScrollBarPropertyChangeHandler() { // Nothing to do here. } - + /** * Handles a property change event. If the event name is - * <code>JSlider.isFreeStanding</code>, this method updates the + * <code>JSlider.isFreeStanding</code>, this method updates the * delegate, otherwise the event is passed up to the super class. - * + * * @param e the property change event. */ public void propertyChange(PropertyChangeEvent e) @@ -100,7 +100,7 @@ public class MetalScrollBarUI extends BasicScrollBarUI super.propertyChange(e); } } - + /** The name for the 'free standing' property. */ public static final String FREE_STANDING_PROP = "JScrollBar.isFreeStanding"; @@ -108,34 +108,34 @@ public class MetalScrollBarUI extends BasicScrollBarUI private static final Dimension MIN_THUMB_SIZE = new Dimension(15, 15); /** The minimum thumb size for a scroll bar that is free standing. */ - private static final Dimension MIN_THUMB_SIZE_FREE_STANDING + private static final Dimension MIN_THUMB_SIZE_FREE_STANDING = new Dimension(17, 17); - + /** The button that increases the value in the scroll bar. */ protected MetalScrollButton increaseButton; - + /** The button that decreases the value in the scroll bar. */ protected MetalScrollButton decreaseButton; - - /** - * The scroll bar width. + + /** + * The scroll bar width. */ protected int scrollBarWidth; - - /** - * A flag that indicates whether the scroll bar is "free standing", which - * means it has complete borders and can be used anywhere in the UI. A + + /** + * A flag that indicates whether the scroll bar is "free standing", which + * means it has complete borders and can be used anywhere in the UI. A * scroll bar which is not free standing has borders missing from one * side, and relies on being part of another container with its own borders * to look right visually. */ protected boolean isFreeStanding = true; - - /** - * The color for the scroll bar shadow (this is read from the UIDefaults in + + /** + * The color for the scroll bar shadow (this is read from the UIDefaults in * the installDefaults() method). */ Color scrollBarShadowColor; - + /** * Constructs a new instance of <code>MetalScrollBarUI</code>, with no * specific initialisation. @@ -161,9 +161,9 @@ public class MetalScrollBarUI extends BasicScrollBarUI * Installs the defaults. */ protected void installDefaults() - { - // need to initialise isFreeStanding before calling the super class, - // so that the value is set when createIncreaseButton() and + { + // need to initialise isFreeStanding before calling the super class, + // so that the value is set when createIncreaseButton() and // createDecreaseButton() are called (unless there is somewhere earlier // that we can do this). Boolean prop = (Boolean) scrollbar.getClientProperty(FREE_STANDING_PROP); @@ -172,35 +172,35 @@ public class MetalScrollBarUI extends BasicScrollBarUI scrollBarWidth = UIManager.getInt("ScrollBar.width"); super.installDefaults(); } - + /** * Creates a property change listener for the delegate to use. This - * overrides the method to provide a custom listener for the - * {@link MetalLookAndFeel} that can handle the + * overrides the method to provide a custom listener for the + * {@link MetalLookAndFeel} that can handle the * <code>JScrollBar.isFreeStanding</code> property. - * + * * @return A property change listener. */ protected PropertyChangeListener createPropertyChangeListener() { return new MetalScrollBarPropertyChangeHandler(); } - + /** * Creates a new button to use as the control at the lower end of the * {@link JScrollBar}. This method assigns the new button (an instance of - * {@link MetalScrollButton} to the {@link #decreaseButton} field, and also - * returns the button. The button width is determined by the + * {@link MetalScrollButton} to the {@link #decreaseButton} field, and also + * returns the button. The button width is determined by the * <code>ScrollBar.width</code> setting in the UI defaults. - * + * * @param orientation the orientation of the button ({@link #NORTH}, * {@link #SOUTH}, {@link #EAST} or {@link #WEST}). - * + * * @return The button. */ protected JButton createDecreaseButton(int orientation) { - decreaseButton = new MetalScrollButton(orientation, scrollBarWidth, + decreaseButton = new MetalScrollButton(orientation, scrollBarWidth, isFreeStanding); return decreaseButton; } @@ -208,25 +208,25 @@ public class MetalScrollBarUI extends BasicScrollBarUI /** * Creates a new button to use as the control at the upper end of the * {@link JScrollBar}. This method assigns the new button (an instance of - * {@link MetalScrollButton} to the {@link #increaseButton} field, and also - * returns the button. The button width is determined by the + * {@link MetalScrollButton} to the {@link #increaseButton} field, and also + * returns the button. The button width is determined by the * <code>ScrollBar.width</code> setting in the UI defaults. - * + * * @param orientation the orientation of the button ({@link #NORTH}, * {@link #SOUTH}, {@link #EAST} or {@link #WEST}). - * + * * @return The button. */ protected JButton createIncreaseButton(int orientation) { - increaseButton = new MetalScrollButton(orientation, scrollBarWidth, + increaseButton = new MetalScrollButton(orientation, scrollBarWidth, isFreeStanding); return increaseButton; } - + /** * Paints the track for the scrollbar. - * + * * @param g the graphics device. * @param c the component. * @param trackBounds the track bounds. @@ -234,20 +234,20 @@ public class MetalScrollBarUI extends BasicScrollBarUI protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds) { g.setColor(MetalLookAndFeel.getControl()); - g.fillRect(trackBounds.x, trackBounds.y, trackBounds.width, + g.fillRect(trackBounds.x, trackBounds.y, trackBounds.width, trackBounds.height); - if (scrollbar.getOrientation() == HORIZONTAL) - paintTrackHorizontal(g, c, trackBounds.x, trackBounds.y, + if (scrollbar.getOrientation() == HORIZONTAL) + paintTrackHorizontal(g, c, trackBounds.x, trackBounds.y, trackBounds.width, trackBounds.height); - else - paintTrackVertical(g, c, trackBounds.x, trackBounds.y, + else + paintTrackVertical(g, c, trackBounds.x, trackBounds.y, trackBounds.width, trackBounds.height); - + } - + /** * Paints the track for a horizontal scrollbar. - * + * * @param g the graphics device. * @param c the component. * @param x the x-coordinate for the track bounds. @@ -255,7 +255,7 @@ public class MetalScrollBarUI extends BasicScrollBarUI * @param w the width for the track bounds. * @param h the height for the track bounds. */ - private void paintTrackHorizontal(Graphics g, JComponent c, + private void paintTrackHorizontal(Graphics g, JComponent c, int x, int y, int w, int h) { if (c.isEnabled()) @@ -264,12 +264,12 @@ public class MetalScrollBarUI extends BasicScrollBarUI g.drawLine(x, y, x, y + h - 1); g.drawLine(x, y, x + w - 1, y); g.drawLine(x + w - 1, y, x + w - 1, y + h - 1); - + g.setColor(scrollBarShadowColor); g.drawLine(x + 1, y + 1, x + 1, y + h - 1); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); - - if (isFreeStanding) + + if (isFreeStanding) { g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(x, y + h - 2, x + w - 1, y + h - 2); @@ -290,10 +290,10 @@ public class MetalScrollBarUI extends BasicScrollBarUI } } } - + /** * Paints the track for a vertical scrollbar. - * + * * @param g the graphics device. * @param c the component. * @param x the x-coordinate for the track bounds. @@ -301,7 +301,7 @@ public class MetalScrollBarUI extends BasicScrollBarUI * @param w the width for the track bounds. * @param h the height for the track bounds. */ - private void paintTrackVertical(Graphics g, JComponent c, + private void paintTrackVertical(Graphics g, JComponent c, int x, int y, int w, int h) { if (c.isEnabled()) @@ -310,12 +310,12 @@ public class MetalScrollBarUI extends BasicScrollBarUI g.drawLine(x, y, x, y + h - 1); g.drawLine(x, y, x + w - 1, y); g.drawLine(x, y + h - 1, x + w - 1, y + h - 1); - + g.setColor(scrollBarShadowColor); g.drawLine(x + 1, y + 1, x + w - 1, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); - - if (isFreeStanding) + + if (isFreeStanding) { g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(x + w - 2, y, x + w - 2, y + h - 1); @@ -351,7 +351,7 @@ public class MetalScrollBarUI extends BasicScrollBarUI return; if (scrollbar.getOrientation() == HORIZONTAL) paintThumbHorizontal(g, c, thumbBounds); - else + else paintThumbVertical(g, c, thumbBounds); // Draw the pattern when the theme is not Ocean. @@ -367,19 +367,19 @@ public class MetalScrollBarUI extends BasicScrollBarUI /** * Paints the thumb for a horizontal scroll bar. - * + * * @param g the graphics device. * @param c the scroll bar component. * @param thumbBounds the thumb bounds. */ - private void paintThumbHorizontal(Graphics g, JComponent c, - Rectangle thumbBounds) + private void paintThumbHorizontal(Graphics g, JComponent c, + Rectangle thumbBounds) { int x = thumbBounds.x; int y = thumbBounds.y; int w = thumbBounds.width; int h = thumbBounds.height; - + // First we fill the background. MetalTheme theme = MetalLookAndFeel.getCurrentTheme(); if (theme instanceof OceanTheme @@ -408,7 +408,7 @@ public class MetalScrollBarUI extends BasicScrollBarUI g.drawLine(x, y, x, y + h - 1); g.drawLine(x + w - 1, y, x + w - 1, y + h - 1); } - + // then the highlight g.setColor(thumbHighlightColor); if (isFreeStanding) @@ -421,7 +421,7 @@ public class MetalScrollBarUI extends BasicScrollBarUI g.drawLine(x + 1, y + 1, x + w - 3, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 1); } - + // draw the shadow line g.setColor(UIManager.getColor("ScrollBar.shadow")); g.drawLine(x + w, y + 1, x + w, y + h - 1); @@ -440,22 +440,22 @@ public class MetalScrollBarUI extends BasicScrollBarUI g.drawLine(middle + 3, y + 5, middle + 3, y + h - 4); } } - + /** * Paints the thumb for a vertical scroll bar. - * + * * @param g the graphics device. * @param c the scroll bar component. * @param thumbBounds the thumb bounds. */ - private void paintThumbVertical(Graphics g, JComponent c, + private void paintThumbVertical(Graphics g, JComponent c, Rectangle thumbBounds) { int x = thumbBounds.x; int y = thumbBounds.y; int w = thumbBounds.width; int h = thumbBounds.height; - + // First we fill the background. MetalTheme theme = MetalLookAndFeel.getCurrentTheme(); if (theme instanceof OceanTheme @@ -484,7 +484,7 @@ public class MetalScrollBarUI extends BasicScrollBarUI g.drawLine(x, y, x, y + h - 1); g.drawLine(x, y + h - 1, x + w - 1, y + h - 1); } - + // then the highlight g.setColor(thumbHighlightColor); if (isFreeStanding) @@ -497,7 +497,7 @@ public class MetalScrollBarUI extends BasicScrollBarUI g.drawLine(x + 1, y + 1, x + w - 1, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 3); } - + // draw the shadow line g.setColor(UIManager.getColor("ScrollBar.shadow")); g.drawLine(x + 1, y + h, x + w - 2, y + h); @@ -516,10 +516,10 @@ public class MetalScrollBarUI extends BasicScrollBarUI g.drawLine(x + 5, middle + 3, x + w - 4, middle + 3); } } - + /** - * Returns the minimum thumb size. For a free standing scroll bar the - * minimum size is <code>17 x 17</code> pixels, whereas for a non free + * Returns the minimum thumb size. For a free standing scroll bar the + * minimum size is <code>17 x 17</code> pixels, whereas for a non free * standing scroll bar the minimum size is <code>15 x 15</code> pixels. * * @return The minimum thumb size. @@ -580,6 +580,5 @@ public class MetalScrollBarUI extends BasicScrollBarUI width += insets.left + insets.right; return new Dimension(width, height); - } + } } - diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalScrollButton.java b/libjava/classpath/javax/swing/plaf/metal/MetalScrollButton.java index 8678f68..3273908 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalScrollButton.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalScrollButton.java @@ -47,32 +47,32 @@ import javax.swing.plaf.basic.BasicArrowButton; /** * A button used by the {@link MetalScrollBarUI}. The button appearance - * varies according to the button direction, whether or not it is part of a - * "free standing" scroll bar, and the current state of the button. + * varies according to the button direction, whether or not it is part of a + * "free standing" scroll bar, and the current state of the button. */ -public class MetalScrollButton extends BasicArrowButton +public class MetalScrollButton extends BasicArrowButton { - - /** + + /** * The maximum size for buttons. * @see #getMaximumSize() */ - private static Dimension maximumSize; - + private static Dimension maximumSize; + /** The width of the button. */ private int buttonWidth; - - /** - * A flag that indicates whether the button is part of a free standing + + /** + * A flag that indicates whether the button is part of a free standing * scroll bar. This affects how the border is drawn. */ private boolean freeStanding; - + /** * Creates a new button. - * - * @param direction the direction (this should be one of {@link #NORTH}, - * {@link #SOUTH}, {@link #EAST} and {@link #WEST}, but + * + * @param direction the direction (this should be one of {@link #NORTH}, + * {@link #SOUTH}, {@link #EAST} and {@link #WEST}, but * this is not enforced). * @param width the button width. * @param freeStanding a flag indicating whether the scroll button is free @@ -85,31 +85,31 @@ public class MetalScrollButton extends BasicArrowButton this.freeStanding = freeStanding; setFocusable(false); } - + /** * Returns the button width. - * + * * @return The button width. */ public int getButtonWidth() { - return buttonWidth; + return buttonWidth; } /** * Sets the free standing flag. This controls how the button border is * drawn. - * + * * @param freeStanding the new value of the flag. */ public void setFreeStanding(boolean freeStanding) { this.freeStanding = freeStanding; } - + /** * Paints the button. - * + * * @param g the graphics device. */ public void paint(Graphics g) @@ -122,16 +122,16 @@ public class MetalScrollButton extends BasicArrowButton else g.setColor(MetalLookAndFeel.getControl()); g.fillRect(0, 0, bounds.width, bounds.height); - + paintArrow(g, bounds.width, bounds.height); - + // paint a border manually - I tried using a real (custom) Border - // but couldn't get it to stay set for the button, something was + // but couldn't get it to stay set for the button, something was // overwriting it... - if (freeStanding) + if (freeStanding) { if (direction == WEST) - paintWestBorderFreeStanding(g, bounds.width, bounds.height); + paintWestBorderFreeStanding(g, bounds.width, bounds.height); else if (direction == EAST) paintEastBorderFreeStanding(g, bounds.width, bounds.height); else if (direction == SOUTH) @@ -142,7 +142,7 @@ public class MetalScrollButton extends BasicArrowButton else { if (direction == WEST) - paintWestBorder(g, bounds.width, bounds.height); + paintWestBorder(g, bounds.width, bounds.height); else if (direction == EAST) paintEastBorder(g, bounds.width, bounds.height); else if (direction == SOUTH) @@ -151,14 +151,14 @@ public class MetalScrollButton extends BasicArrowButton paintNorthBorder(g, bounds.width, bounds.height); } } - + private void paintArrow(Graphics g, int w, int h) { if (isEnabled()) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDisabled()); - + if (direction == SOUTH) { int x = w / 2; @@ -178,7 +178,7 @@ public class MetalScrollButton extends BasicArrowButton int x = w / 2 - 3; int y = h / 2; for (int i = 1; i < 5; i++) - g.drawLine(x + i, y - i, x + i, y + i - 1); + g.drawLine(x + i, y - i, x + i, y + i - 1); } else // assume NORTH { @@ -191,12 +191,12 @@ public class MetalScrollButton extends BasicArrowButton /** * Paints the border for a button with a {@link #NORTH} direction that * belongs to a free standing scroll bar. - * + * * @param g the graphics device. * @param w the button width. * @param h the button height. */ - private void paintNorthBorderFreeStanding(Graphics g, int w, int h) + private void paintNorthBorderFreeStanding(Graphics g, int w, int h) { if (isEnabled()) { @@ -205,12 +205,12 @@ public class MetalScrollButton extends BasicArrowButton g.drawLine(0, 0, 0, h - 1); g.drawLine(2, h - 1, w - 2, h - 1); g.drawLine(w - 2, 2, w - 2, h - 1); - + g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(1, 1, 1, h - 2); g.drawLine(1, 1, w - 3, 1); g.drawLine(w - 1, 1, w - 1, h - 1); - + g.setColor(MetalLookAndFeel.getControl()); g.drawLine(1, h - 1, 1, h - 1); g.drawLine(w - 2, 1, w - 2, 1); @@ -223,11 +223,11 @@ public class MetalScrollButton extends BasicArrowButton g.drawLine(0, 0, 0, h - 1); } } - + /** * Paints the border for a button with a {@link #SOUTH} direction that * belongs to a free standing scroll bar. - * + * * @param g the graphics device. * @param w the button width. * @param h the button height. @@ -241,12 +241,12 @@ public class MetalScrollButton extends BasicArrowButton g.drawLine(0, 0, 0, h - 1); g.drawLine(2, h - 1, w - 2, h - 1); g.drawLine(w - 2, 2, w - 2, h - 1); - + g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(1, 1, 1, h - 1); g.drawLine(1, 1, w - 1, 1); g.drawLine(w - 1, 1, w - 1, h - 1); - + g.setColor(MetalLookAndFeel.getControl()); g.drawLine(1, h - 1, 1, h - 1); g.drawLine(w - 1, 1, w - 1, 1); @@ -259,11 +259,11 @@ public class MetalScrollButton extends BasicArrowButton g.drawLine(0, 0, 0, h - 1); } } - + /** * Paints the border for a button with an {@link #EAST} direction that * belongs to a free standing scroll bar. - * + * * @param g the graphics device. * @param w the button width. * @param h the button height. @@ -276,12 +276,12 @@ public class MetalScrollButton extends BasicArrowButton g.drawLine(0, 0, w - 2, 0); g.drawLine(w - 2, 0, w - 2, h - 2); g.drawLine(0, h - 2, w - 2, h - 2); - + g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(0, 1, w - 1, 1); g.drawLine(w - 1, 1, w - 1, h - 1); g.drawLine(0, h - 1, w - 1, h - 1); - + g.setColor(MetalLookAndFeel.getControl()); g.drawLine(w - 2, 1, w - 2, 1); } @@ -293,11 +293,11 @@ public class MetalScrollButton extends BasicArrowButton g.drawLine(0, h - 1, w - 1, h - 1); } } - + /** * Paints the border for a button with a {@link #WEST} direction that * belongs to a free standing scroll bar. - * + * * @param g the graphics device. * @param w the button width. * @param h the button height. @@ -310,12 +310,12 @@ public class MetalScrollButton extends BasicArrowButton g.drawLine(0, 0, w - 1, 0); g.drawLine(0, 0, 0, h - 2); g.drawLine(0, h - 2, w - 1, h - 2); - + g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(1, 1, w - 1, 1); g.drawLine(1, 1, 1, h - 1); g.drawLine(1, h - 1, w - 1, h - 1); - + g.setColor(MetalLookAndFeel.getControl()); g.drawLine(1, h - 2, 1, h - 2); } @@ -327,22 +327,22 @@ public class MetalScrollButton extends BasicArrowButton g.drawLine(0, h - 1, w - 1, h - 1); } } - + /** * Paints the border for a button with a {@link #NORTH} direction that * belongs to a scroll bar that is not free standing. - * + * * @param g the graphics device. * @param w the button width. * @param h the button height. */ - private void paintNorthBorder(Graphics g, int w, int h) + private void paintNorthBorder(Graphics g, int w, int h) { if (isEnabled()) { g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(0, 0, 0, h - 1); - + g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(1, 0, 1, h - 1); g.drawLine(1, 0, w - 1, 0); @@ -353,11 +353,11 @@ public class MetalScrollButton extends BasicArrowButton g.drawLine(0, 0, 0, h - 1); } } - + /** * Paints the border for a button with a {@link #SOUTH} direction that * belongs to a scroll bar that is not free standing. - * + * * @param g the graphics device. * @param w the button width. * @param h the button height. @@ -369,11 +369,11 @@ public class MetalScrollButton extends BasicArrowButton g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(0, 0, 0, h - 1); g.drawLine(0, h - 1, w - 1, h - 1); - + g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(1, 0, 1, h - 1); g.drawLine(1, 0, w - 1, 0); - + g.setColor(MetalLookAndFeel.getControl()); g.drawLine(1, h - 1, 1, h - 1); } @@ -387,7 +387,7 @@ public class MetalScrollButton extends BasicArrowButton /** * Paints the border for a button with an {@link #EAST} direction that * belongs to a scroll bar that is not free standing. - * + * * @param g the graphics device. * @param w the button width. * @param h the button height. @@ -409,11 +409,11 @@ public class MetalScrollButton extends BasicArrowButton g.drawLine(0, 0, w - 1, 0); } } - + /** * Paints the border for a button with a {@link #WEST} direction that * belongs to a scroll bar that is not free standing. - * + * * @param g the graphics device. * @param w the button width. * @param h the button height. @@ -435,11 +435,11 @@ public class MetalScrollButton extends BasicArrowButton g.drawLine(0, 0, bounds.width - 1, 0); } } - + /** - * Returns the preferred size for the button, which varies depending on + * Returns the preferred size for the button, which varies depending on * the direction of the button and whether or not it is free standing. - * + * * @return The preferred size. */ public Dimension getPreferredSize() @@ -447,9 +447,9 @@ public class MetalScrollButton extends BasicArrowButton int adj = 1; if (!freeStanding) adj = 2; - + if (direction == EAST) - return new Dimension(buttonWidth - adj, buttonWidth); + return new Dimension(buttonWidth - adj, buttonWidth); else if (direction == WEST) return new Dimension(buttonWidth - 2, buttonWidth); else if (direction == SOUTH) @@ -457,27 +457,27 @@ public class MetalScrollButton extends BasicArrowButton else // assume NORTH return new Dimension(buttonWidth, buttonWidth - 2); } - + /** * Returns the minimum size for the button. - * + * * @return The minimum size for the button. */ public Dimension getMinimumSize() { return getPreferredSize(); } - + /** * Returns the maximum size for the button. - * + * * @return <code>Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE)</code>. */ public Dimension getMaximumSize() { if (maximumSize == null) maximumSize = new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE); - return maximumSize; + return maximumSize; } - + } diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalScrollPaneUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalScrollPaneUI.java index ae14af3..09a47c3 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalScrollPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalScrollPaneUI.java @@ -71,12 +71,12 @@ public class MetalScrollPaneUI { return new MetalScrollPaneUI(); } - + /** - * Configures the specified component appropriate for the look and feel. - * This method is invoked when the ComponentUI instance is being installed - * as the UI delegate on the specified component. This method should - * completely configure the component for the look and feel, + * Configures the specified component appropriate for the look and feel. + * This method is invoked when the ComponentUI instance is being installed + * as the UI delegate on the specified component. This method should + * completely configure the component for the look and feel, * including the following: * 1. Install any default property values for color, fonts, borders, * icons, opacity, etc. on the component. Whenever possible, property @@ -87,8 +87,8 @@ public class MetalScrollPaneUI * 5. Create/install a PropertyChangeListener on the component in order * to detect and respond to component property changes appropriately. * 6. Install keyboard UI (mnemonics, traversal, etc.) on the component. - * 7. Initialize any appropriate instance data. - * + * 7. Initialize any appropriate instance data. + * * @param c - the component to install the ui on */ public void installUI(JComponent c) @@ -101,11 +101,11 @@ public class MetalScrollPaneUI } /** - * Reverses configuration which was done on the specified component - * during installUI. This method is invoked when this UIComponent - * instance is being removed as the UI delegate for the specified - * component. This method should undo the configuration performed in - * installUI, being careful to leave the JComponent instance in a + * Reverses configuration which was done on the specified component + * during installUI. This method is invoked when this UIComponent + * instance is being removed as the UI delegate for the specified + * component. This method should undo the configuration performed in + * installUI, being careful to leave the JComponent instance in a * clean state (no extraneous listeners, look-and-feel-specific property * objects, etc.). This should include the following: * 1. Remove any UI-set borders from the component. @@ -113,8 +113,8 @@ public class MetalScrollPaneUI * 3. Remove any UI-added sub-components from the component. * 4. Remove any UI-added event/property listeners from the component. * 5. Remove any UI-installed keyboard UI from the component. - * 6. Nullify any allocated instance data objects to allow for GC. - * + * 6. Nullify any allocated instance data objects to allow for GC. + * * @param c - the component to uninstall the ui on */ public void uninstallUI(JComponent c) @@ -128,17 +128,17 @@ public class MetalScrollPaneUI /** * Installs listeners on scrollPane - * + * * @param scrollPane - the component to install the listeners on */ public void installListeners(JScrollPane scrollPane) { super.installListeners(scrollPane); } - + /** * Uninstalls listeners on scrollPane - * + * * @param scrollPane - the component to uninstall the listeners on */ public void uninstallListeners(JScrollPane scrollPane) @@ -148,7 +148,7 @@ public class MetalScrollPaneUI /** * TODO - * + * * @return TODO */ protected PropertyChangeListener createScrollBarSwapListener() diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalSeparatorUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalSeparatorUI.java index 6d7818f..8afa98c 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalSeparatorUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalSeparatorUI.java @@ -83,13 +83,13 @@ public class MetalSeparatorUI } /** - * The separator is made of two lines. The top line will be + * The separator is made of two lines. The top line will be * the Metal theme color separatorForeground (or left line if it's vertical). * The bottom or right line will be the Metal theme color * separatorBackground. - * The two lines will - * be centered inside the bounds box. If the separator is horizontal, - * then it will be vertically centered, or if it's vertical, it will + * The two lines will + * be centered inside the bounds box. If the separator is horizontal, + * then it will be vertically centered, or if it's vertical, it will * be horizontally centered. * * @param g The Graphics object to paint with @@ -107,9 +107,9 @@ public class MetalSeparatorUI s = (JSeparator) c; else return; - + if (s.getOrientation() == JSeparator.HORIZONTAL) - { + { int midAB = r.height / 2; g.setColor(c1); g.drawLine(r.x, r.y + midAB - 1, r.x + r.width, r.y + midAB - 1); diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalSliderUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalSliderUI.java index b3e8707..e85c324 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalSliderUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalSliderUI.java @@ -74,11 +74,11 @@ public class MetalSliderUI extends BasicSliderUI { // Nothing to do here. } - + /** * Handles property change events. Events with the name "JSlider.isFilled" * are handled here, and other events are passed to the superclass. - * + * * @param e the property change event. */ public void propertyChange(PropertyChangeEvent e) @@ -89,38 +89,38 @@ public class MetalSliderUI extends BasicSliderUI if (b == null) filledSlider = false; else - filledSlider = b.booleanValue(); + filledSlider = b.booleanValue(); } else super.propertyChange(e); } } - + /** The thumb color (unused, because an icon is used to draw the thumb). */ protected static Color thumbColor; - - /** + + /** * The highlight color used for drawing the track rect when the slider is * enabled. */ protected static Color highlightColor; - + /** * The shadow color used for drawing the track rect when the slider is * enabled. */ protected static Color darkShadowColor; - + /** The track width. */ protected static int trackWidth = UIManager.getInt("Slider.trackWidth"); - + /** The length of the major tick marks. */ protected static int tickLength = UIManager.getInt("Slider.majorTickLength"); - + /** The icon used for the thumb control of horizontally oriented sliders. */ protected static Icon horizThumbIcon = UIManager.getIcon( "Slider.horizontalThumbIcon"); - + /** The icon used for the thumb control of vertically oriented sliders. */ protected static Icon vertThumbIcon = UIManager.getIcon( "Slider.verticalThumbIcon"); @@ -130,8 +130,8 @@ public class MetalSliderUI extends BasicSliderUI /** A key to look up the filledSlider setting in the {@link UIManager}. */ protected final String SLIDER_FILL = "JSlider.isFilled"; - - /** + + /** * A flag that controls whether or not the track is filled up to the value * of the slider. */ @@ -159,38 +159,38 @@ public class MetalSliderUI extends BasicSliderUI { return new MetalSliderUI(); } - + /** * Installs the default for this UI delegate in the supplied component. - * + * * @param c the component. */ public void installUI(JComponent c) { super.installUI(c); Boolean b = (Boolean) c.getClientProperty(SLIDER_FILL); - if (b != null) + if (b != null) filledSlider = b.booleanValue(); } /** - * Creates a property change listener for the slider. - * + * Creates a property change listener for the slider. + * * @param slider the slider. - * + * * @return A new instance of {@link MetalPropertyListener}. */ protected PropertyChangeListener createPropertyChangeListener(JSlider slider) { - return new MetalPropertyListener(); + return new MetalPropertyListener(); } - + /** * Paints the thumb icon for the slider. - * + * * @param g the graphics device. */ - public void paintThumb(Graphics g) + public void paintThumb(Graphics g) { Color save = g.getColor(); g.setColor(thumbColor); @@ -200,10 +200,10 @@ public class MetalSliderUI extends BasicSliderUI vertThumbIcon.paintIcon(slider, g, thumbRect.x, thumbRect.y); g.setColor(save); } - + /** * Paints the track along which the thumb control moves. - * + * * @param g the graphics device. */ public void paintTrack(Graphics g) @@ -215,10 +215,10 @@ public class MetalSliderUI extends BasicSliderUI int trackY = trackRect.y + (trackRect.height - getTrackWidth()) / 2; int trackW = trackRect.width; int trackH = getTrackWidth(); - + // draw border if (slider.isEnabled()) - BasicGraphicsUtils.drawEtchedRect(g, trackX, trackY, trackW, trackH, + BasicGraphicsUtils.drawEtchedRect(g, trackX, trackY, trackW, trackH, darkShadowColor, shadowColor, darkShadowColor, highlightColor); else { @@ -233,7 +233,7 @@ public class MetalSliderUI extends BasicSliderUI { int xPos = xPositionForValue(slider.getValue()); int x = slider.getInverted() ? xPos : trackRect.x; - int w = slider.getInverted() ? trackX + trackW - xPos + int w = slider.getInverted() ? trackX + trackW - xPos : xPos - trackRect.x; g.setColor(MetalLookAndFeel.getWhite()); g.drawLine(x + 1, trackY + 1, x + w - 3, trackY + 1); @@ -245,11 +245,11 @@ public class MetalSliderUI extends BasicSliderUI g.drawLine(x + 1, trackY + 4, x + w - 3, trackY + 4); } } - else if (filledSlider) + else if (filledSlider) { int xPos = xPositionForValue(slider.getValue()); int x = slider.getInverted() ? xPos : trackRect.x; - int w = slider.getInverted() ? trackX + trackW - xPos + int w = slider.getInverted() ? trackX + trackW - xPos : xPos - trackRect.x; g.setColor(MetalLookAndFeel.getControlShadow()); g.fillRect(x + 1, trackY + 1, w - 3, getTrackWidth() - 3); @@ -257,7 +257,7 @@ public class MetalSliderUI extends BasicSliderUI { g.setColor(MetalLookAndFeel.getControl()); g.drawLine(x + 1, trackY + 1, x + w - 3, trackY + 1); - g.drawLine(x + 1, trackY + 1, x + 1, + g.drawLine(x + 1, trackY + 1, x + 1, trackY + getTrackWidth() - 3); } } @@ -269,7 +269,7 @@ public class MetalSliderUI extends BasicSliderUI int trackW = getTrackWidth(); int trackH = trackRect.height; if (slider.isEnabled()) - BasicGraphicsUtils.drawEtchedRect(g, trackX, trackY, trackW, trackH, + BasicGraphicsUtils.drawEtchedRect(g, trackX, trackY, trackW, trackH, darkShadowColor, shadowColor, darkShadowColor, highlightColor); else { @@ -284,9 +284,9 @@ public class MetalSliderUI extends BasicSliderUI { int yPos = yPositionForValue(slider.getValue()); int y = slider.getInverted() ? trackY : yPos; - int h = slider.getInverted() ? yPos - trackY + int h = slider.getInverted() ? yPos - trackY : trackY + trackH - yPos; - + g.setColor(MetalLookAndFeel.getWhite()); g.drawLine(trackX + 1, y + 1, trackX + 1, y + h - 3); g.setColor(UIManager.getColor("Slider.altTrackColor")); @@ -297,11 +297,11 @@ public class MetalSliderUI extends BasicSliderUI g.drawLine(trackX + 4, y + 1, trackX + 4, y + h - 3); } } - else if (filledSlider) + else if (filledSlider) { int yPos = yPositionForValue(slider.getValue()); int y = slider.getInverted() ? trackY : yPos; - int h = slider.getInverted() ? yPos - trackY + int h = slider.getInverted() ? yPos - trackY : trackY + trackH - yPos; g.setColor(MetalLookAndFeel.getControlShadow()); g.fillRect(trackX + 1, y + 1, getTrackWidth() - 3, h - 3); @@ -314,14 +314,14 @@ public class MetalSliderUI extends BasicSliderUI } } } - + /** - * Draws the focus rectangle for the slider. The Metal look and feel - * indicates that the {@link JSlider} has the focus by changing the color of - * the thumb control - this is handled elsewhere and so this method is empty + * Draws the focus rectangle for the slider. The Metal look and feel + * indicates that the {@link JSlider} has the focus by changing the color of + * the thumb control - this is handled elsewhere and so this method is empty * (it overrides the method in the {@link BasicSliderUI} class to prevent * a default focus highlight from being drawn). - * + * * @param g the graphics device. */ public void paintFocus(Graphics g) @@ -329,25 +329,25 @@ public class MetalSliderUI extends BasicSliderUI thumbColor = getFocusColor(); paintThumb(g); } - + /** * Returns the size of the thumb icon. - * + * * @return The size of the thumb icon. */ protected Dimension getThumbSize() { if (slider.getOrientation() == JSlider.HORIZONTAL) - return new Dimension(horizThumbIcon.getIconWidth(), + return new Dimension(horizThumbIcon.getIconWidth(), horizThumbIcon.getIconHeight()); else - return new Dimension(vertThumbIcon.getIconWidth(), + return new Dimension(vertThumbIcon.getIconWidth(), vertThumbIcon.getIconHeight()); } - + /** * Returns the length of the major tick marks. - * + * * @return The length of the major tick marks. */ public int getTickLength() @@ -357,31 +357,31 @@ public class MetalSliderUI extends BasicSliderUI len += 2; return len; } - + /** * Returns the track width. - * + * * @return The track width. */ protected int getTrackWidth() { return trackWidth; } - + /** * Returns the track length. - * + * * @return The track length. */ protected int getTrackLength() { - return slider.getOrientation() == JSlider.HORIZONTAL + return slider.getOrientation() == JSlider.HORIZONTAL ? tickRect.width : tickRect.height; } - + /** * Returns the thumb overhang. - * + * * @return The thumb overhang. */ protected int getThumbOverhang() @@ -389,16 +389,16 @@ public class MetalSliderUI extends BasicSliderUI // FIXME: for what might this method be used? return 0; } - + protected void scrollDueToClickInTrack(int dir) { // FIXME: for what might this method be overridden? super.scrollDueToClickInTrack(dir); } - + /** * Paints the minor ticks for a slider with a horizontal orientation. - * + * * @param g the graphics device. * @param tickBounds the tick bounds. * @param x the x value for the tick. @@ -406,7 +406,7 @@ public class MetalSliderUI extends BasicSliderUI protected void paintMinorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x) { - // Note the incoming 'g' has a translation in place to get us to the + // Note the incoming 'g' has a translation in place to get us to the // start of the tick rect already... if (slider.isEnabled()) g.setColor(slider.getForeground()); @@ -414,10 +414,10 @@ public class MetalSliderUI extends BasicSliderUI g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(x, TICK_BUFFER, x, TICK_BUFFER + tickLength / 2); } - + /** * Paints the major ticks for a slider with a horizontal orientation. - * + * * @param g the graphics device. * @param tickBounds the tick bounds. * @param x the x value for the tick. @@ -425,7 +425,7 @@ public class MetalSliderUI extends BasicSliderUI protected void paintMajorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x) { - // Note the incoming 'g' has a translation in place to get us to the + // Note the incoming 'g' has a translation in place to get us to the // start of the tick rect already... if (slider.isEnabled()) g.setColor(slider.getForeground()); @@ -433,10 +433,10 @@ public class MetalSliderUI extends BasicSliderUI g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(x, TICK_BUFFER, x, TICK_BUFFER + tickLength - 1); } - + /** * Paints the minor ticks for a slider with a vertical orientation. - * + * * @param g the graphics device. * @param tickBounds the tick bounds. * @param y the y value for the tick. @@ -444,7 +444,7 @@ public class MetalSliderUI extends BasicSliderUI protected void paintMinorTickForVertSlider(Graphics g, Rectangle tickBounds, int y) { - // Note the incoming 'g' has a translation in place to get us to the + // Note the incoming 'g' has a translation in place to get us to the // start of the tick rect already... if (slider.isEnabled()) g.setColor(slider.getForeground()); @@ -452,10 +452,10 @@ public class MetalSliderUI extends BasicSliderUI g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(TICK_BUFFER, y, TICK_BUFFER + tickLength / 2, y); } - + /** * Paints the major ticks for a slider with a vertical orientation. - * + * * @param g the graphics device. * @param tickBounds the tick bounds. * @param y the y value for the tick. @@ -463,7 +463,7 @@ public class MetalSliderUI extends BasicSliderUI protected void paintMajorTickForVertSlider(Graphics g, Rectangle tickBounds, int y) { - // Note the incoming 'g' has a translation in place to get us to the + // Note the incoming 'g' has a translation in place to get us to the // start of the tick rect already... if (slider.isEnabled()) g.setColor(slider.getForeground()); @@ -471,5 +471,5 @@ public class MetalSliderUI extends BasicSliderUI g.setColor(MetalLookAndFeel.getControlShadow()); g.drawLine(TICK_BUFFER, y, TICK_BUFFER + tickLength, y); } - + } diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalSplitPaneDivider.java b/libjava/classpath/javax/swing/plaf/metal/MetalSplitPaneDivider.java index a3069da..0514998 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalSplitPaneDivider.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalSplitPaneDivider.java @@ -197,13 +197,13 @@ class MetalSplitPaneDivider extends BasicSplitPaneDivider /** The light color in the pattern. */ Color light; - + /** The JSplitPane the divider is on. */ JSplitPane splitPane; /** The split pane orientation. */ int orientation; - + /** * Creates a new instance of <code>MetalSplitPaneDivider</code>. * @@ -232,7 +232,7 @@ class MetalSplitPaneDivider extends BasicSplitPaneDivider g.setColor(UIManager.getColor("SplitPane.dividerFocusColor")); g.fillRect(0, 0, s.width, s.height); } - + // Paint border if one exists. Border border = getBorder(); if (border != null) diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalSplitPaneUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalSplitPaneUI.java index dbcc091..5b8f2127 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalSplitPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalSplitPaneUI.java @@ -78,7 +78,7 @@ public class MetalSplitPaneUI extends BasicSplitPaneUI * The divider returned by this method is a {@link BasicSplitPaneDivider} * that is drawn using the Metal look. * - * @return the default divider to use for <code>JSplitPane</code>s. + * @return the default divider to use for <code>JSplitPane</code>s. */ public BasicSplitPaneDivider createDefaultDivider() { diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalTabbedPaneUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalTabbedPaneUI.java index 53eaa3c..77705ba 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalTabbedPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalTabbedPaneUI.java @@ -57,15 +57,15 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI { /** - * A {@link LayoutManager} responsible for placing all the tabs and the - * visible component inside the {@link JTabbedPane}. This class is only used + * A {@link LayoutManager} responsible for placing all the tabs and the + * visible component inside the {@link JTabbedPane}. This class is only used * for {@link JTabbedPane#WRAP_TAB_LAYOUT}. * * @specnote Apparently this class was intended to be protected, * but was made public by a compiler bug and is now * public for compatibility. */ - public class TabbedPaneLayout + public class TabbedPaneLayout extends BasicTabbedPaneUI.TabbedPaneLayout { /** @@ -75,12 +75,12 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI { // Nothing to do here. } - + /** - * Overridden to do nothing, because tab runs are not rotated in the + * Overridden to do nothing, because tab runs are not rotated in the * {@link MetalLookAndFeel}. - * - * @param tabPlacement the tab placement (one of {@link #TOP}, + * + * @param tabPlacement the tab placement (one of {@link #TOP}, * {@link #BOTTOM}, {@link #LEFT} or {@link #RIGHT}). * @param selectedRun the index of the selected run. */ @@ -88,18 +88,18 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI { // do nothing, because tab runs are not rotated in the MetalLookAndFeel } - + /** * Overridden to do nothing, because the selected tab does not have extra * padding in the {@link MetalLookAndFeel}. - * - * @param tabPlacement the tab placement (one of {@link #TOP}, + * + * @param tabPlacement the tab placement (one of {@link #TOP}, * {@link #BOTTOM}, {@link #LEFT} or {@link #RIGHT}). * @param selectedIndex the index of the selected tab. */ protected void padSelectedTab(int tabPlacement, int selectedIndex) { - // do nothing, because the selected tab does not have extra padding in + // do nothing, because the selected tab does not have extra padding in // the MetalLookAndFeel } @@ -162,10 +162,10 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI { return new MetalTabbedPaneUI(); } - + /** * Creates and returns an instance of {@link TabbedPaneLayout}. - * + * * @return A layout manager used by this UI delegate. */ protected LayoutManager createLayoutManager() @@ -174,12 +174,12 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI ? new MetalTabbedPaneUI.TabbedPaneLayout() : super.createLayoutManager(); } - + /** * Paints the border for a single tab. - * + * * @param g the graphics device. - * @param tabPlacement the tab placement ({@link #TOP}, {@link #LEFT}, + * @param tabPlacement the tab placement ({@link #TOP}, {@link #LEFT}, * {@link #BOTTOM} or {@link #RIGHT}). * @param tabIndex the index of the tab to draw the border for. * @param x the x-coordinate for the tab's bounding rectangle. @@ -188,15 +188,15 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI * @param h the height for the tab's bounding rectangle. * @param isSelected indicates whether or not the tab is selected. */ - protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, - int x, int y, int w, int h, boolean isSelected) + protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, + int x, int y, int w, int h, boolean isSelected) { int bottom = y + h - 1; int right = x + w - 1; switch (tabPlacement) { - case LEFT: + case LEFT: paintLeftTabBorder(tabIndex, g, x, y, w, h, bottom, right, isSelected); break; case BOTTOM: @@ -206,7 +206,7 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI paintRightTabBorder(tabIndex, g, x, y, w, h, bottom, right, isSelected); break; case TOP: - default: + default: paintTopTabBorder(tabIndex, g, x, y, w, h, bottom, right, isSelected); } } @@ -214,7 +214,7 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI /** * Paints the border for a tab assuming that the tab position is at the top * ({@link #TOP}). - * + * * @param tabIndex the tab index. * @param g the graphics device. * @param x the x-coordinate for the tab's bounding rectangle. @@ -306,11 +306,11 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI g.translate(-x, -y); } - + /** * Paints the border for a tab assuming that the tab position is at the left * ({@link #LEFT}). - * + * * @param tabIndex the tab index. * @param g the graphics device. * @param x the x-coordinate for the tab's bounding rectangle. @@ -436,11 +436,11 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI g.translate(-x, -y); } - + /** * Paints the border for a tab assuming that the tab position is at the right * ({@link #RIGHT}). - * + * * @param tabIndex the tab index. * @param g the graphics device. * @param x the x-coordinate for the tab's bounding rectangle. @@ -545,11 +545,11 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI } g.translate(-x, -y); } - + /** * Paints the border for a tab assuming that the tab position is at the bottom * ({@link #BOTTOM}). - * + * * @param tabIndex the tab index. * @param g the graphics device. * @param x the x-coordinate for the tab's bounding rectangle. @@ -606,7 +606,7 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI if (isOcean && isSelected) { g.drawLine(0, 0, 0, bottom - 5); - + // Paint a connecting line to the tab below for all // but the first tab in the last run. if (tabIndex != tabRuns[runCount-1]) @@ -657,9 +657,9 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI /** * Paints the background for a tab. - * + * * @param g the graphics device. - * @param tabPlacement the tab placement ({@link #TOP}, {@link #LEFT}, + * @param tabPlacement the tab placement ({@link #TOP}, {@link #LEFT}, * {@link #BOTTOM} or {@link #RIGHT}). * @param tabIndex the index of the tab to draw the border for. * @param x the x-coordinate for the tab's bounding rectangle. @@ -696,7 +696,7 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI g.fillRect(x + 2, y + 5, 2, h - 5); } } - + /** * This method paints the focus rectangle around the selected tab. * @@ -719,19 +719,19 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI g.setColor(focus); g.translate(rect.x, rect.y); - + switch (tabPlacement) { case LEFT: // Top line g.drawLine(7, 2, rect.width-2, 2); - + // Right line g.drawLine(rect.width-1, 2, rect.width-1, rect.height-3); - + // Bottom line g.drawLine(rect.width-2, rect.height-2, 3, rect.height-2); - + // Left line g.drawLine(2, rect.height-3, 2, 7); @@ -741,13 +741,13 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI case RIGHT: // Top line g.drawLine(1, 2, rect.width-8, 2); - + // Slant g.drawLine(rect.width-7, 2, rect.width-3, 6); - + // Right line g.drawLine(rect.width-3, 7, rect.width-3, rect.height-3); - + // Bottom line g.drawLine(rect.width-3, rect.height-2, 2, rect.height-2); @@ -757,51 +757,51 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI case BOTTOM: // Top line g.drawLine(2, 1, rect.width-2, 1); - + // Right line g.drawLine(rect.width-1, 2, rect.width-1, rect.height-3); - + // Bottom line g.drawLine(7, rect.height-3, rect.width-2, rect.height-3); - + // Slant g.drawLine(6, rect.height-3, 2, rect.height-7); - + // Left line g.drawLine(2, rect.height-8, 2, 2); - + break; case TOP: default: // Top line g.drawLine(6, 2, rect.width-2, 2); - + // Right line g.drawLine(rect.width-1, 2, rect.width-1, rect.height-3); - + // Bottom line g.drawLine(3, rect.height-3, rect.width-2, rect.height-3); - + // Left line g.drawLine(2, rect.height-3, 2, 7); - + // Slant g.drawLine(2, 6, 6, 2); - + } - + g.translate(-rect.x, -rect.y); } } - + /** - * Returns <code>true</code> if the tabs in the specified run should be + * Returns <code>true</code> if the tabs in the specified run should be * padded to make the run fill the width/height of the {@link JTabbedPane}. - * + * * @param tabPlacement the tab placement for the {@link JTabbedPane} (one of * {@link #TOP}, {@link #BOTTOM}, {@link #LEFT} and {@link #RIGHT}). * @param run the run index. - * + * * @return A boolean. */ protected boolean shouldPadTabRun(int tabPlacement, int run) @@ -824,14 +824,14 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque"); minTabWidth = 0; } - + /** * Returns the color for the gap. - * + * * @param currentRun - The current run to return the color for * @param x - The x position of the current run * @param y - The y position of the current run - * + * * @return the color for the gap in the current run. */ protected Color getColorForGap(int currentRun, int x, int y) @@ -842,23 +842,23 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI return selectColor; return tabAreaBackground; } - + /** * Returns true if the gap should be filled in. - * + * * @param currentRun - The current run * @param tabIndex - The current tab * @param x - The x position of the tab * @param y - The y position of the tab - * - * @return true if the gap at the current run should be filled + * + * @return true if the gap at the current run should be filled */ protected boolean shouldFillGap(int currentRun, int tabIndex, int x, int y) { // As far as I can tell, the gap is never filled in. return false; } - + /** * Paints the highlight below the tab, if there is one. */ @@ -867,14 +867,14 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI int selected = tabPane.getSelectedIndex(); int tabPlacement = tabPane.getTabPlacement(); Rectangle bounds = getTabBounds(tabPane, selected); - + hg.setColor(selectColor); int x = bounds.x; int y = bounds.y; int w = bounds.width; int h = bounds.height; - if (tabPlacement == TOP) + if (tabPlacement == TOP) hg.fillRect(x, y + h - 2, w, 30); else if (tabPlacement == LEFT) hg.fillRect(x + w - 1, y, 20, h); @@ -882,17 +882,17 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI hg.fillRect(x, y - h + 2, w, 30); else if (tabPlacement == RIGHT) hg.fillRect(x - 18, y, 20, h); - else + else throw new AssertionError("Unrecognised 'tabPlacement' argument."); hg = null; } - + /** - * Returns true if we should rotate the tab runs. - * + * Returns true if we should rotate the tab runs. + * * @param tabPlacement - The current tab placement. * @param selectedRun - The selected run. - * + * * @return true if the tab runs should be rotated. */ protected boolean shouldRotateTabRuns(int tabPlacement, @@ -1052,7 +1052,7 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI int w, int h) { g.setColor(darkShadow); - + // If tabs are not placed on BOTTOM, or if the selected tab is not in the // run directly below the content or the selected tab is not visible, // then we draw an unbroken line. @@ -1144,7 +1144,7 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI { g.setColor(MetalLookAndFeel.getWhite()); g.drawLine(x, y + 1, x, y + h - 2); - } + } } else { @@ -1163,7 +1163,7 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI } } } - + } /** @@ -1251,7 +1251,7 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI bg = unselectedBackground; return bg; } - + protected int getTabLabelShiftX(int tabPlacement, int index, boolean isSelected) @@ -1265,5 +1265,5 @@ public class MetalTabbedPaneUI extends BasicTabbedPaneUI { return 0; } - + } diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalTextFieldUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalTextFieldUI.java index 30738b3..f7b18db 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalTextFieldUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalTextFieldUI.java @@ -69,10 +69,10 @@ public class MetalTextFieldUI extends BasicTextFieldUI { return new MetalTextFieldUI(); } - + /** * This method gets called when a bound property is changed on the associated - * JTextComponent. This is a hook which UI implementations may change to + * JTextComponent. This is a hook which UI implementations may change to * reflect how the UI displays bound properties of JTextComponent subclasses. */ public void propertyChange(PropertyChangeEvent evt) diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalTheme.java b/libjava/classpath/javax/swing/plaf/metal/MetalTheme.java index d5131af..209cbbe 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalTheme.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalTheme.java @@ -49,7 +49,7 @@ import javax.swing.plaf.FontUIResource; * The base class for themes used by the {@link MetalLookAndFeel}. A default * theme ({@link DefaultMetalTheme}) is provided, or you can create and use * your own. - * + * * @see MetalLookAndFeel#setCurrentTheme(MetalTheme) */ public abstract class MetalTheme @@ -67,14 +67,14 @@ public abstract class MetalTheme /** * Returns the name of the theme. - * + * * @return The name of the theme. */ public abstract String getName(); /** * Adds custom entries to the UI defaults table. This method is empty. - * + * * @param table the table. */ public void addCustomEntriesToTable(UIDefaults table) @@ -87,7 +87,7 @@ public abstract class MetalTheme /** * Returns the accelerator foreground color. The default implementation * returns the color from {@link #getPrimary1()}. - * + * * @return The accelerator foreground color. */ public ColorUIResource getAcceleratorForeground() @@ -96,20 +96,20 @@ public abstract class MetalTheme } /** - * Returns the accelerator selected foreground color. The default + * Returns the accelerator selected foreground color. The default * implementation returns the color from {@link #getBlack()}. - * + * * @return The accelerator selected foreground color. */ public ColorUIResource getAcceleratorSelectedForeground() { return getBlack(); } - + /** - * Returns the control color. The default implementation returns the color + * Returns the control color. The default implementation returns the color * from {@link #getSecondary3()}. - * + * * @return The control color. */ public ColorUIResource getControl() @@ -118,9 +118,9 @@ public abstract class MetalTheme } /** - * Returns the color used for dark shadows on controls. The default + * Returns the color used for dark shadows on controls. The default * implementation returns the color from {@link #getSecondary1()}. - * + * * @return The color used for dark shadows on controls. */ public ColorUIResource getControlDarkShadow() @@ -131,7 +131,7 @@ public abstract class MetalTheme /** * Returns the color used for disabled controls. The default implementation * returns the color from {@link #getSecondary1()}. - * + * * @return The color used for disabled controls. */ public ColorUIResource getControlDisabled() @@ -140,9 +140,9 @@ public abstract class MetalTheme } /** - * Returns the color used to draw highlights for controls. The default + * Returns the color used to draw highlights for controls. The default * implementation returns the color from {@link #getWhite()}. - * + * * @return The color used to draw highlights for controls. */ public ColorUIResource getControlHighlight() @@ -151,9 +151,9 @@ public abstract class MetalTheme } /** - * Returns the color used to display control info. The default + * Returns the color used to display control info. The default * implementation returns the color from {@link #getBlack()}. - * + * * @return The color used to display control info. */ public ColorUIResource getControlInfo() @@ -162,9 +162,9 @@ public abstract class MetalTheme } /** - * Returns the color used to draw shadows for controls. The default + * Returns the color used to draw shadows for controls. The default * implementation returns the color from {@link #getSecondary2()}. - * + * * @return The color used to draw shadows for controls. */ public ColorUIResource getControlShadow() @@ -175,7 +175,7 @@ public abstract class MetalTheme /** * Returns the color used for text on controls. The default implementation * returns the color from {@link #getControlInfo()}. - * + * * @return The color used for text on controls. */ public ColorUIResource getControlTextColor() @@ -184,9 +184,9 @@ public abstract class MetalTheme } /** - * Returns the color used for the desktop background. The default + * Returns the color used for the desktop background. The default * implementation returns the color from {@link #getPrimary2()}. - * + * * @return The color used for the desktop background. */ public ColorUIResource getDesktopColor() @@ -195,9 +195,9 @@ public abstract class MetalTheme } /** - * Returns the color used to draw focus highlights. The default + * Returns the color used to draw focus highlights. The default * implementation returns the color from {@link #getPrimary2()}. - * + * * @return The color used to draw focus highlights. */ public ColorUIResource getFocusColor() @@ -208,7 +208,7 @@ public abstract class MetalTheme /** * Returns the color used to draw highlighted text. The default * implementation returns the color from {@link #getHighlightedTextColor()}. - * + * * @return The color used to draw highlighted text. */ public ColorUIResource getHighlightedTextColor() @@ -219,7 +219,7 @@ public abstract class MetalTheme /** * Returns the color used to draw text on inactive controls. The default * implementation returns the color from {@link #getControlDisabled()}. - * + * * @return The color used to draw text on inactive controls. */ public ColorUIResource getInactiveControlTextColor() @@ -230,7 +230,7 @@ public abstract class MetalTheme /** * Returns the color used to draw inactive system text. The default * implementation returns the color from {@link #getSecondary2()}. - * + * * @return The color used to draw inactive system text. */ public ColorUIResource getInactiveSystemTextColor() @@ -241,9 +241,9 @@ public abstract class MetalTheme /** * Returns the background color for menu items. The default implementation * returns the color from {@link #getSecondary3()}. - * + * * @return The background color for menu items. - * + * * @see #getMenuSelectedBackground() */ public ColorUIResource getMenuBackground() @@ -252,11 +252,11 @@ public abstract class MetalTheme } /** - * Returns the foreground color for disabled menu items. The default + * Returns the foreground color for disabled menu items. The default * implementation returns the color from {@link #getSecondary2()}. - * + * * @return The foreground color for disabled menu items. - * + * * @see #getMenuForeground() */ public ColorUIResource getMenuDisabledForeground() @@ -267,9 +267,9 @@ public abstract class MetalTheme /** * Returns the foreground color for menu items. The default implementation * returns the color from {@link #getBlack()}. - * + * * @return The foreground color for menu items. - * + * * @see #getMenuDisabledForeground() * @see #getMenuSelectedForeground() */ @@ -279,11 +279,11 @@ public abstract class MetalTheme } /** - * Returns the background color for selected menu items. The default + * Returns the background color for selected menu items. The default * implementation returns the color from {@link #getPrimary2()}. - * + * * @return The background color for selected menu items. - * + * * @see #getMenuBackground() */ public ColorUIResource getMenuSelectedBackground() @@ -292,11 +292,11 @@ public abstract class MetalTheme } /** - * Returns the foreground color for selected menu items. The default + * Returns the foreground color for selected menu items. The default * implementation returns the value from {@link #getBlack()}. - * + * * @return The foreground color for selected menu items. - * + * * @see #getMenuForeground() */ public ColorUIResource getMenuSelectedForeground() @@ -307,7 +307,7 @@ public abstract class MetalTheme /** * Returns the primary color for controls. The default implementation * returns the color from {@link #getPrimary3()}. - * + * * @return The primary color for controls. */ public ColorUIResource getPrimaryControl() @@ -316,9 +316,9 @@ public abstract class MetalTheme } /** - * Returns the primary color for the dark shadow on controls. The default + * Returns the primary color for the dark shadow on controls. The default * implementation returns the color from {@link #getPrimary1()}. - * + * * @return The primary color for the dark shadow on controls. */ public ColorUIResource getPrimaryControlDarkShadow() @@ -327,9 +327,9 @@ public abstract class MetalTheme } /** - * Returns the primary color for the highlight on controls. The default + * Returns the primary color for the highlight on controls. The default * implementation returns the color from {@link #getWhite()}. - * + * * @return The primary color for the highlight on controls. */ public ColorUIResource getPrimaryControlHighlight() @@ -338,9 +338,9 @@ public abstract class MetalTheme } /** - * Returns the primary color for the information on controls. The default + * Returns the primary color for the information on controls. The default * implementation returns the color from {@link #getBlack()}. - * + * * @return The primary color for the information on controls. */ public ColorUIResource getPrimaryControlInfo() @@ -349,9 +349,9 @@ public abstract class MetalTheme } /** - * Returns the primary color for the shadow on controls. The default + * Returns the primary color for the shadow on controls. The default * implementation returns the color from {@link #getPrimary2()}. - * + * * @return The primary color for the shadow on controls. */ public ColorUIResource getPrimaryControlShadow() @@ -362,7 +362,7 @@ public abstract class MetalTheme /** * Returns the background color for separators. The default implementation * returns the color from {@link #getWhite()}. - * + * * @return The background color for separators. */ public ColorUIResource getSeparatorBackground() @@ -373,7 +373,7 @@ public abstract class MetalTheme /** * Returns the foreground color for separators. The default implementation * returns the value from {@link #getPrimary1()}. - * + * * @return The foreground color for separators. */ public ColorUIResource getSeparatorForeground() @@ -382,9 +382,9 @@ public abstract class MetalTheme } /** - * Returns the color used for system text. The default implementation + * Returns the color used for system text. The default implementation * returns the color from {@link #getBlack()}. - * + * * @return The color used for system text. */ public ColorUIResource getSystemTextColor() @@ -395,7 +395,7 @@ public abstract class MetalTheme /** * Returns the color used to highlight text. The default implementation * returns the color from {@link #getPrimary3()}. - * + * * @return The color used to highlight text. */ public ColorUIResource getTextHighlightColor() @@ -406,18 +406,18 @@ public abstract class MetalTheme /** * Returns the color used to display user text. The default implementation * returns the color from {@link #getBlack()}. - * + * * @return The color used to display user text. */ public ColorUIResource getUserTextColor() { return getBlack(); } - + /** * Returns the window background color. The default implementation returns * the color from {@link #getWhite()}. - * + * * @return The window background color. */ public ColorUIResource getWindowBackground() @@ -428,7 +428,7 @@ public abstract class MetalTheme /** * Returns the window title background color. The default implementation * returns the color from {@link #getPrimary3()}. - * + * * @return The window title background color. */ public ColorUIResource getWindowTitleBackground() @@ -439,7 +439,7 @@ public abstract class MetalTheme /** * Returns the window title foreground color. The default implementation * returns the color from {@link #getBlack()}. - * + * * @return The window title foreground color. */ public ColorUIResource getWindowTitleForeground() @@ -450,7 +450,7 @@ public abstract class MetalTheme /** * Returns the background color for an inactive window title. The default * implementation returns the color from {@link #getSecondary3()}. - * + * * @return The background color for an inactive window title. */ public ColorUIResource getWindowTitleInactiveBackground() @@ -461,7 +461,7 @@ public abstract class MetalTheme /** * Returns the foreground color for an inactive window title. The default * implementation returns the color from {@link #getBlack()}. - * + * * @return The foreground color for an inactive window title. */ public ColorUIResource getWindowTitleInactiveForeground() @@ -471,7 +471,7 @@ public abstract class MetalTheme /** * Returns the color used for black. - * + * * @return The color used for black. */ protected ColorUIResource getBlack() @@ -481,7 +481,7 @@ public abstract class MetalTheme /** * Returns the color used for white. - * + * * @return The color used for white. */ protected ColorUIResource getWhite() @@ -491,86 +491,86 @@ public abstract class MetalTheme /** * Returns the first primary color for this theme. - * + * * @return The first primary color. */ protected abstract ColorUIResource getPrimary1(); - + /** * Returns the second primary color for this theme. - * + * * @return The second primary color. */ protected abstract ColorUIResource getPrimary2(); /** * Returns the third primary color for this theme. - * + * * @return The third primary color. */ protected abstract ColorUIResource getPrimary3(); - + /** * Returns the first secondary color for this theme. - * + * * @return The first secondary color. */ protected abstract ColorUIResource getSecondary1(); /** * Returns the second secondary color for this theme. - * + * * @return The second secondary color. */ protected abstract ColorUIResource getSecondary2(); /** * Returns the third secondary color for this theme. - * + * * @return The third secondary color. */ protected abstract ColorUIResource getSecondary3(); /** * Returns the font used for text on controls. - * + * * @return The font used for text on controls. */ public abstract FontUIResource getControlTextFont(); /** * Returns the font used for text in menus. - * + * * @return The font used for text in menus. */ public abstract FontUIResource getMenuTextFont(); /** * Returns the font used for sub text. - * + * * @return The font used for sub text. */ public abstract FontUIResource getSubTextFont(); - + /** * Returns the font used for system text. - * + * * @return The font used for system text. */ public abstract FontUIResource getSystemTextFont(); - + /** * Returns the font used for user text. - * + * * @return The font used for user text. */ public abstract FontUIResource getUserTextFont(); /** * Returns the font used for window titles. - * + * * @return The font used for window titles. */ public abstract FontUIResource getWindowTitleFont(); - + } diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java index 8c7a46e..2dacd7f 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java @@ -113,9 +113,9 @@ public class MetalToggleButtonUI } /** - * Returns the color for the text label of disabled buttons. The value + * Returns the color for the text label of disabled buttons. The value * is initialised in the {@link #installDefaults(AbstractButton)} method - * by reading the <code>ToggleButton.disabledText</code> item from the UI + * by reading the <code>ToggleButton.disabledText</code> item from the UI * defaults. * * @return The color for the text label of disabled buttons. @@ -127,7 +127,7 @@ public class MetalToggleButtonUI /** * Updates the button with the defaults for this look and feel. - * + * * @param b the button. */ public void installDefaults(AbstractButton b) @@ -137,10 +137,10 @@ public class MetalToggleButtonUI selectColor = UIManager.getColor(getPropertyPrefix() + "select"); disabledTextColor = UIManager.getColor(getPropertyPrefix() + "disabledText"); } - + /** - * Paints the button background when it is pressed/selected. - * + * Paints the button background when it is pressed/selected. + * * @param g the graphics device. * @param b the button. */ @@ -155,19 +155,19 @@ public class MetalToggleButtonUI g.setColor(saved); } } - + /** * Paints the text for the button. - * + * * As of JDK 1.4 this method is obsolete. - * Use {@link BasicButtonUI#paintText(java.awt.Graphics, + * Use {@link BasicButtonUI#paintText(java.awt.Graphics, * javax.swing.AbstractButton, java.awt.Rectangle, java.lang.String)}. * * @param g the graphics device. * @param c the component. * @param textRect the bounds for the text. * @param text the text. - * + * */ protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text) @@ -185,10 +185,10 @@ public class MetalToggleButtonUI g.setFont(savedFont); g.setColor(savedColor); } - + /** * Draws the focus highlight around the text and icon. - * + * * @param g the graphics device. * @param b the button. */ @@ -201,7 +201,7 @@ public class MetalToggleButtonUI g.setColor(focusColor); Rectangle fr = iconRect.union(textRect); g.drawRect(fr.x - 1, fr.y - 1, fr.width + 1, fr.height + 1); - g.setColor(saved); + g.setColor(saved); } /** @@ -226,5 +226,5 @@ public class MetalToggleButtonUI else super.update(g, c); } - + } diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalToolBarUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalToolBarUI.java index 1848c1f..64e679c 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalToolBarUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalToolBarUI.java @@ -59,12 +59,12 @@ import javax.swing.plaf.basic.BasicToolBarUI; */ public class MetalToolBarUI extends BasicToolBarUI { - + /** - * A listener (no longer used) that responds when components are added to or + * A listener (no longer used) that responds when components are added to or * removed from the {@link JToolBar}. The required behaviour is now - * handled in the super class. - * + * handled in the super class. + * * @see MetalToolBarUI#createContainerListener() */ protected class MetalContainerListener @@ -81,9 +81,9 @@ public class MetalToolBarUI extends BasicToolBarUI /** * A listener (no longer used) that responds to property change events in a - * {@link JToolBar} component. The required behaviour is now handled in the - * super class. - * + * {@link JToolBar} component. The required behaviour is now handled in the + * super class. + * * @see MetalToolBarUI#createRolloverListener() */ protected class MetalRolloverListener @@ -97,16 +97,16 @@ public class MetalToolBarUI extends BasicToolBarUI // Nothing to do here. } } - - /** + + /** * The container listener (an implementation specific field, according to the * spec, and not used in GNU Classpath). */ protected ContainerListener contListener; - - /** + + /** * The rollover listener (an implementation specific field, according to the - * spec, and not used in GNU Classpath). + * spec, and not used in GNU Classpath). */ protected PropertyChangeListener rolloverListener; @@ -129,43 +129,43 @@ public class MetalToolBarUI extends BasicToolBarUI { return new MetalToolBarUI(); } - + /** * Returns <code>null</code> as permitted by recent versions of the API - * specification. Originally it seems this method returned a new instance of + * specification. Originally it seems this method returned a new instance of * {@link MetalRolloverListener}, but this is now redundant. - * + * * @return <code>null</code>. */ protected PropertyChangeListener createRolloverListener() { return null; } - + /** * Returns <code>null</code> as permitted by recent versions of the API - * specification. Originally it seems this method returned a new instance of + * specification. Originally it seems this method returned a new instance of * {@link MetalContainerListener}, but this is now redundant. - * + * * @return <code>null</code>. */ protected ContainerListener createContainerListener() { return null; } - + /** * Returns a border with no rollover effect for buttons in the tool bar. - * + * * @return A border. - * + * * @see MetalBorders#getToolbarButtonBorder() */ protected Border createNonRolloverBorder() { - return MetalBorders.getToolbarButtonBorder(); + return MetalBorders.getToolbarButtonBorder(); } - + /** * Sets the offset for the window used for dragging the toolbar. * It is set as long as the window is not null (it has been installed). @@ -175,23 +175,23 @@ public class MetalToolBarUI extends BasicToolBarUI if (dragWindow != null) dragWindow.setOffset(p); } - - /** + + /** * Creates and returns an instance of MetalDockingListener. - * + * * @return an instance of MetalDockingListener. */ protected MouseInputListener createDockingListener() { return new MetalDockingListener(toolBar); } - + /** * This is the MouseHandler class that allows the user to drag the JToolBar * in and out of the parent and dock it if it can. */ protected class MetalDockingListener extends BasicToolBarUI.DockingListener - { + { /** * Creates a new DockingListener object. * @@ -201,7 +201,7 @@ public class MetalToolBarUI extends BasicToolBarUI { super(t); } - + /** * This method is called when the mouse is pressed in the JToolBar. If the * press doesn't occur in a place where it causes the JToolBar to be @@ -214,7 +214,7 @@ public class MetalToolBarUI extends BasicToolBarUI super.mousePressed(e); setDragOffset(new Point(e.getX(), e.getY())); } - + /** * This method is called when the mouse is dragged. It delegates the drag * painting to the dragTo method. @@ -223,7 +223,7 @@ public class MetalToolBarUI extends BasicToolBarUI */ public void mouseDragged(MouseEvent e) { - // Does not do anything differently than dragging + // Does not do anything differently than dragging // BasicToolBarUI.DockingListener super.mouseDragged(e); } diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalToolTipUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalToolTipUI.java index 6647cc0..742ff22 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalToolTipUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalToolTipUI.java @@ -63,38 +63,38 @@ import javax.swing.plaf.basic.BasicToolTipUI; public class MetalToolTipUI extends BasicToolTipUI { - /** - * The amount of space between the tool tip text and the accelerator - * description (if visible). + /** + * The amount of space between the tool tip text and the accelerator + * description (if visible). */ public static final int padSpaceBetweenStrings = 12; /** The shared UI instance. */ private static MetalToolTipUI instance; - + /** A flag controlling the visibility of the accelerator (if there is one). */ private boolean isAcceleratorHidden; - + /** A string representing the accelerator key for the component. */ private String acceleratorString; - - /** + + /** * The delimiter for the accelerator string. */ private String acceleratorDelimiter; - + /** The font for the accelerator string. */ private Font acceleratorFont; - + /** The color for the accelerator string. */ private Color acceleratorForeground; - + /** The active border. */ private Border activeBorder; - + /** The inactive border. */ private Border inactiveBorder; - + /** * Constructs a new instance of <code>MetalToolTipUI</code>. */ @@ -124,21 +124,21 @@ public class MetalToolTipUI instance = new MetalToolTipUI(); return instance; } - + /** - * Returns a string representing the accelerator key (if there is one) for + * Returns a string representing the accelerator key (if there is one) for * the component that the tool tip belongs to. - * + * * @return A string representing the accelerator key. */ public String getAcceleratorString() { - return acceleratorString; + return acceleratorString; } - + /** * Installs the UI for the specified component (a {@link JToolTip}). - * + * * @param c the {@link JToolTip} component. */ public void installUI(JComponent c) @@ -151,12 +151,12 @@ public class MetalToolTipUI c.setBorder(activeBorder); else c.setBorder(inactiveBorder); - } + } } - + /** * Clears the defaults set in {@link #installUI(JComponent)}. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -165,7 +165,7 @@ public class MetalToolTipUI if (c.getBorder() instanceof UIResource) c.setBorder(null); } - + /** * Returns <code>true</code> if the accelerator string is hidden, and * <code>false</code> otherwise. This setting is controlled by the @@ -177,12 +177,12 @@ public class MetalToolTipUI { return isAcceleratorHidden; } - + /** * Returns the preferred size for the {@link JToolTip} component. - * + * * @param c the component (a {@link JToolTip}). - * + * * @return The preferred size. */ public Dimension getPreferredSize(JComponent c) @@ -196,10 +196,10 @@ public class MetalToolTipUI } return d; } - + /** * Paints the tool tip. - * + * * @param g the graphics context. * @param c the {@link JToolTip} component. */ @@ -208,14 +208,14 @@ public class MetalToolTipUI super.paint(g, c); // Somehow paint accelerator. Keep care for possible HTML rendering. } - + /** - * Returns a string representing the accelerator for the component, or + * Returns a string representing the accelerator for the component, or * <code>null</code> if the component has no accelerator. - * + * * @param c the component. - * - * @return A string representing the accelerator (possibly + * + * @return A string representing the accelerator (possibly * <code>null</code>). */ private String fetchAcceleratorString(JComponent c) @@ -240,19 +240,19 @@ public class MetalToolTipUI mne = button.getMnemonic(); } if (mne > 0) - ks = KeyStroke.getKeyStroke(Character.toUpperCase((char) mne), + ks = KeyStroke.getKeyStroke(Character.toUpperCase((char) mne), InputEvent.ALT_MASK, false); if (ks != null) result = acceleratorToString(ks); } return result; } - + /** * Returns a string representing an accelerator. - * + * * @param accelerator the accelerator (<code>null</code> not permitted). - * + * * @return A string representing an accelerator. */ private String acceleratorToString(KeyStroke accelerator) @@ -262,9 +262,9 @@ public class MetalToolTipUI int modifiers = accelerator.getModifiers(); char keyChar = accelerator.getKeyChar(); int keyCode = accelerator.getKeyCode(); - + if (modifiers != 0) - modifiersText = KeyEvent.getKeyModifiersText(modifiers) + modifiersText = KeyEvent.getKeyModifiersText(modifiers) + acceleratorDelimiter; if (keyCode == KeyEvent.VK_UNDEFINED) diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalTreeUI.java b/libjava/classpath/javax/swing/plaf/metal/MetalTreeUI.java index ed1e5b4..bdfa2d4 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalTreeUI.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalTreeUI.java @@ -69,7 +69,7 @@ public class MetalTreeUI extends BasicTreeUI if (e.getPropertyName().equals(LINE_STYLE_PROPERTY)) decodeLineStyle(e.getNewValue()); } - + } /** @@ -137,7 +137,7 @@ public class MetalTreeUI extends BasicTreeUI { return new MetalTreeUI(); } - + /** * The horizontal element of legs between nodes starts at the right of the * left-hand side of the child node by default. This method makes the @@ -150,19 +150,19 @@ public class MetalTreeUI extends BasicTreeUI /** * Configures the specified component appropriate for the look and feel. - * This method is invoked when the ComponentUI instance is being installed - * as the UI delegate on the specified component. This method should completely + * This method is invoked when the ComponentUI instance is being installed + * as the UI delegate on the specified component. This method should completely * configure the component for the look and feel, including the following: - * 1. Install any default property values for color, fonts, borders, icons, + * 1. Install any default property values for color, fonts, borders, icons, * opacity, etc. on the component. Whenever possible, property values * initialized by the client program should not be overridden. * 2. Install a LayoutManager on the component if necessary. * 3. Create/add any required sub-components to the component. * 4. Create/install event listeners on the component. - * 5. Create/install a PropertyChangeListener on the component in order + * 5. Create/install a PropertyChangeListener on the component in order * to detect and respond to component property changes appropriately. * 6. Install keyboard UI (mnemonics, traversal, etc.) on the component. - * 7. Initialize any appropriate instance data. + * 7. Initialize any appropriate instance data. */ public void installUI(JComponent c) { @@ -174,21 +174,21 @@ public class MetalTreeUI extends BasicTreeUI lineStyleListener = new LineStyleListener(); c.addPropertyChangeListener(lineStyleListener); } - + /** - * Reverses configuration which was done on the specified component during - * installUI. This method is invoked when this UIComponent instance is being - * removed as the UI delegate for the specified component. This method should - * undo the configuration performed in installUI, being careful to leave the - * JComponent instance in a clean state (no extraneous listeners, - * look-and-feel-specific property objects, etc.). This should include + * Reverses configuration which was done on the specified component during + * installUI. This method is invoked when this UIComponent instance is being + * removed as the UI delegate for the specified component. This method should + * undo the configuration performed in installUI, being careful to leave the + * JComponent instance in a clean state (no extraneous listeners, + * look-and-feel-specific property objects, etc.). This should include * the following: * 1. Remove any UI-set borders from the component. * 2. Remove any UI-set layout managers on the component. * 3. Remove any UI-added sub-components from the component. * 4. Remove any UI-added event/property listeners from the component. * 5. Remove any UI-installed keyboard UI from the component. - * 6. Nullify any allocated instance data objects to allow for GC. + * 6. Nullify any allocated instance data objects to allow for GC. */ public void uninstallUI(JComponent c) { @@ -197,13 +197,13 @@ public class MetalTreeUI extends BasicTreeUI c.removePropertyChangeListener(lineStyleListener); lineStyleListener = null; } - + /** * This function converts between the string passed into the client * property and the internal representation (currently an int). - * + * * @param lineStyleFlag - String representation - */ + */ protected void decodeLineStyle(Object lineStyleFlag) { if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) @@ -218,7 +218,7 @@ public class MetalTreeUI extends BasicTreeUI /** * Checks if the location is in expand control. - * + * * @param row - current row * @param rowLevel - current level * @param mouseX - current x location of the mouse click @@ -227,33 +227,33 @@ public class MetalTreeUI extends BasicTreeUI protected boolean isLocationInExpandControl(int row, int rowLevel, int mouseX, int mouseY) { - return super.isLocationInExpandControl(tree.getPathForRow(row), + return super.isLocationInExpandControl(tree.getPathForRow(row), mouseX, mouseY); } - + /** - * Paints the specified component appropriate for the look and feel. - * This method is invoked from the ComponentUI.update method when the - * specified component is being painted. Subclasses should override this - * method and use the specified Graphics object to render the content of + * Paints the specified component appropriate for the look and feel. + * This method is invoked from the ComponentUI.update method when the + * specified component is being painted. Subclasses should override this + * method and use the specified Graphics object to render the content of * the component. - * + * * @param g - the current graphics configuration. * @param c - the current component to draw */ public void paint(Graphics g, JComponent c) { // Calls BasicTreeUI's paint since it takes care of painting all - // types of icons. + // types of icons. super.paint(g, c); if (lineStyle == LINE_STYLE_HORIZONTAL) paintHorizontalSeparators(g, c); } - + /** * Paints the horizontal separators. - * + * * @param g - the current graphics configuration. * @param c - the current component to draw */ @@ -282,14 +282,14 @@ public class MetalTreeUI extends BasicTreeUI } } - + /** - * Paints the vertical part of the leg. The receiver should NOT modify + * Paints the vertical part of the leg. The receiver should NOT modify * clipBounds, insets. - * + * * @param g - the current graphics configuration. * @param clipBounds - - * @param insets - + * @param insets - * @param path - the current path */ protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, @@ -311,7 +311,7 @@ public class MetalTreeUI extends BasicTreeUI boolean isLeaf) { if (lineStyle == LINE_STYLE_ANGLED) - super.paintHorizontalPartOfLeg(g, clipBounds, insets, bounds, path, row, + super.paintHorizontalPartOfLeg(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); } } diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalUtils.java b/libjava/classpath/javax/swing/plaf/metal/MetalUtils.java index 0c3a38d..247f922 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalUtils.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalUtils.java @@ -180,7 +180,7 @@ class MetalUtils { paintGradient(g, x, y, w, h, dir, uiProp, null); } - + /** * Paints the typical Metal gradient. See {@link #paintGradient(Graphics, * int, int, int, int, float, float, Color, Color, Color, int, int[][])} @@ -216,14 +216,14 @@ class MetalUtils /** * Paints the typical Metal gradient. The gradient is painted as follows: * <pre> - * + * * +-------+--------+--------+-----------------------------+ * | | | | | * +-------+--------+--------+-----------------------------+ * c1 -> c2 -- c2 -> c1 --------> c3 * < -g1- > < -g2- > < -g1- > * </pre> - * + * * There are 4 distinct areas in this gradient: * <ol> * <li>A gradient from color 1 to color 2 with the relative width specified @@ -306,7 +306,7 @@ class MetalUtils float g1, float g2, Color c1, Color c2, Color c3, int[][] mask) { - + if (g instanceof Graphics2D && SystemProperties.getProperty("gnu.javax.swing.noGraphics2D") == null) { diff --git a/libjava/classpath/javax/swing/plaf/metal/OceanTheme.java b/libjava/classpath/javax/swing/plaf/metal/OceanTheme.java index 1ea0bc2..6a6a3f5 100644 --- a/libjava/classpath/javax/swing/plaf/metal/OceanTheme.java +++ b/libjava/classpath/javax/swing/plaf/metal/OceanTheme.java @@ -130,19 +130,19 @@ public class OceanTheme extends DefaultMetalTheme /** * Returns the OceanTheme's color for disabled menu foreground, - * + * */ public ColorUIResource getMenuDisabledForeground() { return INACTIVE_CONTROL_TEXT; } - + /** * Returns the OceanTheme's color for black, the RGB value * (51, 51, 51). * - * @return Returns the OceanTheme's value for black + * @return Returns the OceanTheme's value for black */ protected ColorUIResource getBlack() { @@ -157,7 +157,7 @@ public class OceanTheme extends DefaultMetalTheme { return PRIMARY1; } - + /** * Return the OceanTheme's value for primary 2, the RGB value * (163, 184, 204). @@ -166,7 +166,7 @@ public class OceanTheme extends DefaultMetalTheme { return PRIMARY2; } - + /** * Return the OceanTheme's value for primary 1, the RGB value * (184, 207, 229). diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiButtonUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiButtonUI.java index ac2a5fa..044f651 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiButtonUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiButtonUI.java @@ -53,32 +53,32 @@ import javax.swing.plaf.ComponentUI; * A UI delegate that that coordinates multiple {@link ButtonUI} instances, one * from the primary look and feel, and one or more from the auxiliary look and * feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiButtonUI extends ButtonUI +public class MultiButtonUI extends ButtonUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiButtonUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiButtonUI() + public MultiButtonUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiButtonUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiButtonUI extends ButtonUI MultiButtonUI mui = new MultiButtonUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiButtonUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiButtonUI extends ButtonUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiButtonUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiButtonUI extends ButtonUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiButtonUI</code>. The first item in the array is always + * <code>MultiButtonUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiButtonUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiButtonUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiButtonUI extends ButtonUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiButtonUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiButtonUI extends ButtonUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiButtonUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiButtonUI extends ButtonUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiButtonUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiButtonUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiButtonUI extends ButtonUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiButtonUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiButtonUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiButtonUI extends ButtonUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiButtonUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiButtonUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiButtonUI extends ButtonUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiButtonUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiButtonUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiButtonUI extends ButtonUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiButtonUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiButtonUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiButtonUI extends ButtonUI } return result; } - -}
\ No newline at end of file + +} diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiColorChooserUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiColorChooserUI.java index 8adb950..1a96849 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiColorChooserUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiColorChooserUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ColorChooserUI; import javax.swing.plaf.ComponentUI; /** - * A UI delegate that that coordinates multiple {@link ColorChooserUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link ColorChooserUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiColorChooserUI extends ColorChooserUI +public class MultiColorChooserUI extends ColorChooserUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiColorChooserUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiColorChooserUI() + public MultiColorChooserUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary - * look and feels support this component, a <code>MultiColorChooserUI</code> + * Creates a delegate object for the specified component. If any auxiliary + * look and feels support this component, a <code>MultiColorChooserUI</code> * is returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiColorChooserUI extends ColorChooserUI MultiColorChooserUI mui = new MultiColorChooserUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiColorChooserUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiColorChooserUI extends ColorChooserUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiColorChooserUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiColorChooserUI extends ColorChooserUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiColorChooserUI</code>. The first item in the array is always + * <code>MultiColorChooserUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiColorChooserUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiColorChooserUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiColorChooserUI extends ColorChooserUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiColorChooserUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiColorChooserUI extends ColorChooserUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiColorChooserUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiColorChooserUI extends ColorChooserUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiColorChooserUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiColorChooserUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiColorChooserUI extends ColorChooserUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiColorChooserUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiColorChooserUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiColorChooserUI extends ColorChooserUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiColorChooserUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiColorChooserUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiColorChooserUI extends ColorChooserUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiColorChooserUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiColorChooserUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiColorChooserUI extends ColorChooserUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiColorChooserUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiColorChooserUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiColorChooserUI extends ColorChooserUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiComboBoxUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiComboBoxUI.java index 33b4321..f169873 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiComboBoxUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiComboBoxUI.java @@ -51,35 +51,35 @@ import javax.swing.plaf.ComboBoxUI; import javax.swing.plaf.ComponentUI; /** - * A UI delegate that that coordinates multiple {@link ComboBoxUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link ComboBoxUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiComboBoxUI extends ComboBoxUI +public class MultiComboBoxUI extends ComboBoxUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiComboBoxUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiComboBoxUI() + public MultiComboBoxUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary - * look and feels support this component, a <code>MultiComboBoxUI</code> + * Creates a delegate object for the specified component. If any auxiliary + * look and feels support this component, a <code>MultiComboBoxUI</code> * is returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -87,11 +87,11 @@ public class MultiComboBoxUI extends ComboBoxUI MultiComboBoxUI mui = new MultiComboBoxUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiComboBoxUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -105,9 +105,9 @@ public class MultiComboBoxUI extends ComboBoxUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiComboBoxUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -119,39 +119,39 @@ public class MultiComboBoxUI extends ComboBoxUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiComboBoxUI</code>. The first item in the array is always + * <code>MultiComboBoxUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiComboBoxUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiComboBoxUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -164,11 +164,11 @@ public class MultiComboBoxUI extends ComboBoxUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiComboBoxUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -183,9 +183,9 @@ public class MultiComboBoxUI extends ComboBoxUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiComboBoxUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -198,24 +198,24 @@ public class MultiComboBoxUI extends ComboBoxUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiComboBoxUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiComboBoxUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,25 +227,25 @@ public class MultiComboBoxUI extends ComboBoxUI /* Dimension ignored = */ ui.getPreferredSize(c); } return result; - } - + } + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiComboBoxUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiComboBoxUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -258,24 +258,24 @@ public class MultiComboBoxUI extends ComboBoxUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiComboBoxUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiComboBoxUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -288,24 +288,24 @@ public class MultiComboBoxUI extends ComboBoxUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiComboBoxUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiComboBoxUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -318,25 +318,25 @@ public class MultiComboBoxUI extends ComboBoxUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiComboBoxUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiComboBoxUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -349,15 +349,15 @@ public class MultiComboBoxUI extends ComboBoxUI } return result; } - + /** - * Calls the {@link ComboBoxUI#setPopupVisible(JComboBox, boolean)} method + * Calls the {@link ComboBoxUI#setPopupVisible(JComboBox, boolean)} method * for all the UI delegates managed by this <code>MultiComboBoxUI</code>. - * + * * @param c the component. * @param visible the visible state. */ - public void setPopupVisible(JComboBox c, boolean visible) + public void setPopupVisible(JComboBox c, boolean visible) { Iterator iterator = uis.iterator(); while (iterator.hasNext()) @@ -368,21 +368,21 @@ public class MultiComboBoxUI extends ComboBoxUI } /** - * Calls the {@link ComboBoxUI#isPopupVisible(JComboBox)} method for all - * the UI delegates managed by this <code>MultiComboBoxUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComboBoxUI#isPopupVisible(JComboBox)} method for all + * the UI delegates managed by this <code>MultiComboBoxUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The result for the UI delegate from the primary look and feel. + * + * @return The result for the UI delegate from the primary look and feel. */ - public boolean isPopupVisible(JComboBox c) + public boolean isPopupVisible(JComboBox c) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComboBoxUI ui = (ComboBoxUI) iterator.next(); result = ui.isPopupVisible(c); @@ -397,23 +397,23 @@ public class MultiComboBoxUI extends ComboBoxUI } /** - * Calls the {@link ComboBoxUI#isFocusTraversable(JComboBox)} method for all - * the UI delegates managed by this <code>MultiComboBoxUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComboBoxUI#isFocusTraversable(JComboBox)} method for all + * the UI delegates managed by this <code>MultiComboBoxUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. - * + * * @return <code>true</code> if the combo box is traversable according to the - * UI delegate in the primary look and feel, and <code>false</code> - * otherwise. + * UI delegate in the primary look and feel, and <code>false</code> + * otherwise. */ - public boolean isFocusTraversable(JComboBox c) + public boolean isFocusTraversable(JComboBox c) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComboBoxUI ui = (ComboBoxUI) iterator.next(); result = ui.isFocusTraversable(c); diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiDesktopIconUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiDesktopIconUI.java index 186ce32..091566e 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiDesktopIconUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiDesktopIconUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.DesktopIconUI; /** - * A UI delegate that that coordinates multiple {@link DesktopIconUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link DesktopIconUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiDesktopIconUI extends DesktopIconUI +public class MultiDesktopIconUI extends DesktopIconUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiDesktopIconUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiDesktopIconUI() + public MultiDesktopIconUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiDesktopIconUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiDesktopIconUI extends DesktopIconUI MultiDesktopIconUI mui = new MultiDesktopIconUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiDesktopIconUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiDesktopIconUI extends DesktopIconUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiDesktopIconUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiDesktopIconUI extends DesktopIconUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiDesktopIconUI</code>. The first item in the array is always + * <code>MultiDesktopIconUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiDesktopIconUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiDesktopIconUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiDesktopIconUI extends DesktopIconUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiDesktopIconUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiDesktopIconUI extends DesktopIconUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiDesktopIconUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiDesktopIconUI extends DesktopIconUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiDesktopIconUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiDesktopIconUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -226,25 +226,25 @@ public class MultiDesktopIconUI extends DesktopIconUI /* Dimension ignored = */ ui.getPreferredSize(c); } return result; - } - + } + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiDesktopIconUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiDesktopIconUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiDesktopIconUI extends DesktopIconUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiDesktopIconUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiDesktopIconUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiDesktopIconUI extends DesktopIconUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiDesktopIconUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiDesktopIconUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiDesktopIconUI extends DesktopIconUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiDesktopIconUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiDesktopIconUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiDesktopIconUI extends DesktopIconUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiDesktopPaneUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiDesktopPaneUI.java index d48fb2b..fb62257 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiDesktopPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiDesktopPaneUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.DesktopPaneUI; /** - * A UI delegate that that coordinates multiple {@link DesktopPaneUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link DesktopPaneUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiDesktopPaneUI extends DesktopPaneUI +public class MultiDesktopPaneUI extends DesktopPaneUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiDesktopPaneUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiDesktopPaneUI() + public MultiDesktopPaneUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiDesktopPaneUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiDesktopPaneUI extends DesktopPaneUI MultiDesktopPaneUI mui = new MultiDesktopPaneUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiDesktopPaneUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiDesktopPaneUI extends DesktopPaneUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiDesktopPaneUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiDesktopPaneUI extends DesktopPaneUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiDesktopPaneUI</code>. The first item in the array is always + * <code>MultiDesktopPaneUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiDesktopPaneUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiDesktopPaneUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiDesktopPaneUI extends DesktopPaneUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiDesktopPaneUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiDesktopPaneUI extends DesktopPaneUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiDesktopPaneUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiDesktopPaneUI extends DesktopPaneUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiDesktopPaneUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiDesktopPaneUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiDesktopPaneUI extends DesktopPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiDesktopPaneUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiDesktopPaneUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiDesktopPaneUI extends DesktopPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiDesktopPaneUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiDesktopPaneUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiDesktopPaneUI extends DesktopPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiDesktopPaneUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiDesktopPaneUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiDesktopPaneUI extends DesktopPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiDesktopPaneUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiDesktopPaneUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiDesktopPaneUI extends DesktopPaneUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiFileChooserUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiFileChooserUI.java index 719f043..2ab8841 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiFileChooserUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiFileChooserUI.java @@ -54,35 +54,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.FileChooserUI; /** - * A UI delegate that that coordinates multiple {@link FileChooserUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link FileChooserUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiFileChooserUI extends FileChooserUI +public class MultiFileChooserUI extends FileChooserUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiFileChooserUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiFileChooserUI() + public MultiFileChooserUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiFileChooserUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -90,11 +90,11 @@ public class MultiFileChooserUI extends FileChooserUI MultiFileChooserUI mui = new MultiFileChooserUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiFileChooserUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -108,9 +108,9 @@ public class MultiFileChooserUI extends FileChooserUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiFileChooserUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -122,39 +122,39 @@ public class MultiFileChooserUI extends FileChooserUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiFileChooserUI</code>. The first item in the array is always + * <code>MultiFileChooserUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiFileChooserUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiFileChooserUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -167,11 +167,11 @@ public class MultiFileChooserUI extends FileChooserUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiFileChooserUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -186,9 +186,9 @@ public class MultiFileChooserUI extends FileChooserUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiFileChooserUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -201,24 +201,24 @@ public class MultiFileChooserUI extends FileChooserUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiFileChooserUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiFileChooserUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -231,24 +231,24 @@ public class MultiFileChooserUI extends FileChooserUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiFileChooserUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiFileChooserUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -261,24 +261,24 @@ public class MultiFileChooserUI extends FileChooserUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiFileChooserUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiFileChooserUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -291,24 +291,24 @@ public class MultiFileChooserUI extends FileChooserUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiFileChooserUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiFileChooserUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -321,25 +321,25 @@ public class MultiFileChooserUI extends FileChooserUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiFileChooserUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiFileChooserUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -352,24 +352,24 @@ public class MultiFileChooserUI extends FileChooserUI } return result; } - + /** * Calls the {@link FileChooserUI#getAcceptAllFileFilter(JFileChooser)} method - * for all the UI delegates managed by this <code>MultiFileChooserUI</code>, - * returning the filter for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiFileChooserUI</code>, + * returning the filter for the UI delegate from the primary look and + * feel. + * * @param chooser the file chooser. - * - * @return The filter returned by the UI delegate from the primary - * look and feel. + * + * @return The filter returned by the UI delegate from the primary + * look and feel. */ - public FileFilter getAcceptAllFileFilter(JFileChooser chooser) + public FileFilter getAcceptAllFileFilter(JFileChooser chooser) { FileFilter result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { FileChooserUI ui = (FileChooserUI) iterator.next(); result = ui.getAcceptAllFileFilter(chooser); @@ -385,21 +385,21 @@ public class MultiFileChooserUI extends FileChooserUI /** * Calls the {@link FileChooserUI#getFileView(JFileChooser)} method - * for all the UI delegates managed by this <code>MultiFileChooserUI</code>, - * returning the view for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiFileChooserUI</code>, + * returning the view for the UI delegate from the primary look and + * feel. + * * @param chooser the file chooser. - * - * @return The view returned by the UI delegate from the primary - * look and feel. + * + * @return The view returned by the UI delegate from the primary + * look and feel. */ - public FileView getFileView(JFileChooser chooser) + public FileView getFileView(JFileChooser chooser) { FileView result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { FileChooserUI ui = (FileChooserUI) iterator.next(); result = ui.getFileView(chooser); @@ -415,21 +415,21 @@ public class MultiFileChooserUI extends FileChooserUI /** * Calls the {@link FileChooserUI#getApproveButtonText(JFileChooser)} method - * for all the UI delegates managed by this <code>MultiFileChooserUI</code>, - * returning the text for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiFileChooserUI</code>, + * returning the text for the UI delegate from the primary look and + * feel. + * * @param chooser the file chooser. - * - * @return The text returned by the UI delegate from the primary - * look and feel. + * + * @return The text returned by the UI delegate from the primary + * look and feel. */ - public String getApproveButtonText(JFileChooser chooser) + public String getApproveButtonText(JFileChooser chooser) { String result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { FileChooserUI ui = (FileChooserUI) iterator.next(); result = ui.getApproveButtonText(chooser); @@ -445,21 +445,21 @@ public class MultiFileChooserUI extends FileChooserUI /** * Calls the {@link FileChooserUI#getDialogTitle(JFileChooser)} method - * for all the UI delegates managed by this <code>MultiFileChooserUI</code>, - * returning the title for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiFileChooserUI</code>, + * returning the title for the UI delegate from the primary look and + * feel. + * * @param chooser the file chooser. - * - * @return The title returned by the UI delegate from the primary - * look and feel. + * + * @return The title returned by the UI delegate from the primary + * look and feel. */ - public String getDialogTitle(JFileChooser chooser) + public String getDialogTitle(JFileChooser chooser) { String result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { FileChooserUI ui = (FileChooserUI) iterator.next(); result = ui.getDialogTitle(chooser); @@ -474,13 +474,13 @@ public class MultiFileChooserUI extends FileChooserUI } /** - * Calls the {@link FileChooserUI#rescanCurrentDirectory(JFileChooser)} - * method for all the UI delegates managed by this + * Calls the {@link FileChooserUI#rescanCurrentDirectory(JFileChooser)} + * method for all the UI delegates managed by this * <code>MultiFileChooserUI</code>. - * + * * @param chooser the file chooser. */ - public void rescanCurrentDirectory(JFileChooser chooser) + public void rescanCurrentDirectory(JFileChooser chooser) { Iterator iterator = uis.iterator(); while (iterator.hasNext()) @@ -491,14 +491,14 @@ public class MultiFileChooserUI extends FileChooserUI } /** - * Calls the {@link FileChooserUI#ensureFileIsVisible(JFileChooser, File)} - * method for all the UI delegates managed by this + * Calls the {@link FileChooserUI#ensureFileIsVisible(JFileChooser, File)} + * method for all the UI delegates managed by this * <code>MultiFileChooserUI</code>. - * + * * @param chooser the file chooser. * @param file the file. */ - public void ensureFileIsVisible(JFileChooser chooser, File file) + public void ensureFileIsVisible(JFileChooser chooser, File file) { Iterator iterator = uis.iterator(); while (iterator.hasNext()) diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiInternalFrameUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiInternalFrameUI.java index 01d1df6..37b2ee3 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiInternalFrameUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiInternalFrameUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.InternalFrameUI; /** - * A UI delegate that that coordinates multiple {@link InternalFrameUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link InternalFrameUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiInternalFrameUI extends InternalFrameUI +public class MultiInternalFrameUI extends InternalFrameUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiInternalFrameUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiInternalFrameUI() + public MultiInternalFrameUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary - * look and feels support this component, a <code>MultiInternalFrameUI</code> + * Creates a delegate object for the specified component. If any auxiliary + * look and feels support this component, a <code>MultiInternalFrameUI</code> * is returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,12 +86,12 @@ public class MultiInternalFrameUI extends InternalFrameUI MultiInternalFrameUI mui = new MultiInternalFrameUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - - + + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiInternalFrameUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -105,9 +105,9 @@ public class MultiInternalFrameUI extends InternalFrameUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiInternalFrameUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -119,39 +119,39 @@ public class MultiInternalFrameUI extends InternalFrameUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiInternalFrameUI</code>. The first item in the array is always + * <code>MultiInternalFrameUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiInternalFrameUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiInternalFrameUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -164,11 +164,11 @@ public class MultiInternalFrameUI extends InternalFrameUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiInternalFrameUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -183,9 +183,9 @@ public class MultiInternalFrameUI extends InternalFrameUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiInternalFrameUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -198,24 +198,24 @@ public class MultiInternalFrameUI extends InternalFrameUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiInternalFrameUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiInternalFrameUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -228,24 +228,24 @@ public class MultiInternalFrameUI extends InternalFrameUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiInternalFrameUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiInternalFrameUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -258,24 +258,24 @@ public class MultiInternalFrameUI extends InternalFrameUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiInternalFrameUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiInternalFrameUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -288,24 +288,24 @@ public class MultiInternalFrameUI extends InternalFrameUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiInternalFrameUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiInternalFrameUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -318,25 +318,25 @@ public class MultiInternalFrameUI extends InternalFrameUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiInternalFrameUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiInternalFrameUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -349,5 +349,5 @@ public class MultiInternalFrameUI extends InternalFrameUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiLabelUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiLabelUI.java index ba5b9d4..2f0e7d0 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiLabelUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiLabelUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.LabelUI; /** - * A UI delegate that that coordinates multiple {@link LabelUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link LabelUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiLabelUI extends LabelUI +public class MultiLabelUI extends LabelUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiLabelUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiLabelUI() + public MultiLabelUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiLabelUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiLabelUI extends LabelUI MultiLabelUI mui = new MultiLabelUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiLabelUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiLabelUI extends LabelUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiLabelUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiLabelUI extends LabelUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiLabelUI</code>. The first item in the array is always + * <code>MultiLabelUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiLabelUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiLabelUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiLabelUI extends LabelUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiLabelUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiLabelUI extends LabelUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiLabelUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiLabelUI extends LabelUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiLabelUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiLabelUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiLabelUI extends LabelUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiLabelUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiLabelUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiLabelUI extends LabelUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiLabelUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiLabelUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiLabelUI extends LabelUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiLabelUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiLabelUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiLabelUI extends LabelUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiLabelUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiLabelUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiLabelUI extends LabelUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiListUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiListUI.java index 78c2241..d6b77f5 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiListUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiListUI.java @@ -53,35 +53,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ListUI; /** - * A UI delegate that that coordinates multiple {@link ListUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link ListUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiListUI extends ListUI +public class MultiListUI extends ListUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiListUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiListUI() + public MultiListUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiListUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -89,11 +89,11 @@ public class MultiListUI extends ListUI MultiListUI mui = new MultiListUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiListUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -107,9 +107,9 @@ public class MultiListUI extends ListUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiListUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -121,39 +121,39 @@ public class MultiListUI extends ListUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiListUI</code>. The first item in the array is always + * <code>MultiListUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiListUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiListUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -166,11 +166,11 @@ public class MultiListUI extends ListUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiListUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -185,9 +185,9 @@ public class MultiListUI extends ListUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiListUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -200,24 +200,24 @@ public class MultiListUI extends ListUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiListUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiListUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -230,24 +230,24 @@ public class MultiListUI extends ListUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiListUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiListUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -260,24 +260,24 @@ public class MultiListUI extends ListUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiListUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiListUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -290,24 +290,24 @@ public class MultiListUI extends ListUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiListUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiListUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -320,25 +320,25 @@ public class MultiListUI extends ListUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiListUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiListUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -351,25 +351,25 @@ public class MultiListUI extends ListUI } return result; } - + /** * Calls the {@link ListUI#locationToIndex(JList, Point)} method for all - * the UI delegates managed by this <code>MultiListUI</code>, - * returning the index for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiListUI</code>, + * returning the index for the UI delegate from the primary look and + * feel. + * * @param list the list. * @param location the location. - * - * @return The index returned by the UI delegate from the primary - * look and feel. + * + * @return The index returned by the UI delegate from the primary + * look and feel. */ - public int locationToIndex(JList list, Point location) + public int locationToIndex(JList list, Point location) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ListUI ui = (ListUI) iterator.next(); result = ui.locationToIndex(list, location); @@ -385,22 +385,22 @@ public class MultiListUI extends ListUI /** * Calls the {@link ListUI#indexToLocation(JList, int)} method for all - * the UI delegates managed by this <code>MultiListUI</code>, - * returning the location for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiListUI</code>, + * returning the location for the UI delegate from the primary look and + * feel. + * * @param list the list. * @param index the index. - * - * @return The location returned by the UI delegate from the primary - * look and feel. + * + * @return The location returned by the UI delegate from the primary + * look and feel. */ - public Point indexToLocation(JList list, int index) + public Point indexToLocation(JList list, int index) { Point result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ListUI ui = (ListUI) iterator.next(); result = ui.indexToLocation(list, index); @@ -416,23 +416,23 @@ public class MultiListUI extends ListUI /** * Calls the {@link ListUI#getCellBounds(JList, int, int)} method for all - * the UI delegates managed by this <code>MultiListUI</code>, - * returning the bounds for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiListUI</code>, + * returning the bounds for the UI delegate from the primary look and + * feel. + * * @param list the list. * @param index1 the first index. * @param index2 the second index. - * - * @return The bounds returned by the UI delegate from the primary - * look and feel. + * + * @return The bounds returned by the UI delegate from the primary + * look and feel. */ - public Rectangle getCellBounds(JList list, int index1, int index2) + public Rectangle getCellBounds(JList list, int index1, int index2) { Rectangle result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ListUI ui = (ListUI) iterator.next(); result = ui.getCellBounds(list, index1, index2); diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiLookAndFeel.java b/libjava/classpath/javax/swing/plaf/multi/MultiLookAndFeel.java index 1235165..4e81fd0 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiLookAndFeel.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiLookAndFeel.java @@ -49,7 +49,7 @@ import javax.swing.plaf.ComponentUI; * A look and feel that provides the ability to use auxiliary look and feels * in addition to the primary look and feel. */ -public class MultiLookAndFeel extends LookAndFeel +public class MultiLookAndFeel extends LookAndFeel { /** @@ -59,62 +59,62 @@ public class MultiLookAndFeel extends LookAndFeel { // Nothing to do here. } - + /** * Returns the name for the look and feel. - * + * * @return "Multiplexing Look and Feel". */ public String getName() { return "Multiplexing Look and Feel"; } - + /** * Returns an identifier for the look and feel. - * + * * @return "Multiplex". */ public String getID() { - return "Multiplex"; + return "Multiplex"; } - + /** * Returns a description of the look and feel. - * + * * @return A description of the look and feel. */ public String getDescription() { - return "Allows multiple UI instances per component instance"; + return "Allows multiple UI instances per component instance"; } - + /** - * Returns <code>false</code> to indicate that this look and feel is not + * Returns <code>false</code> to indicate that this look and feel is not * native to any platform. - * + * * @return <code>false</code>. */ public boolean isNativeLookAndFeel() { - return false; + return false; } /** * Returns <code>true</code> always, since this look and feel is supported on * all platforms. - * + * * @return <code>true</code>. */ public boolean isSupportedLookAndFeel() { return true; } - + /** * Creates and returns the UI defaults for this look and feel. - * + * * @return The UI defaults. */ public UIDefaults getDefaults() @@ -123,7 +123,7 @@ public class MultiLookAndFeel extends LookAndFeel defaults.put("ButtonUI", "javax.swing.plaf.multi.MultiButtonUI"); defaults.put("CheckBoxUI", "javax.swing.plaf.multi.MultiButtonUI"); defaults.put("CheckBoxMenuItemUI", "javax.swing.plaf.multi.MultiMenuItemUI"); - defaults.put("ColorChooserUI", + defaults.put("ColorChooserUI", "javax.swing.plaf.multi.MultiColorChooserUI"); defaults.put("ComboBoxUI", "javax.swing.plaf.multi.MultiComboBoxUI"); defaults.put("DesktopPaneUI", "javax.swing.plaf.multi.MultiDesktopPaneUI"); @@ -131,7 +131,7 @@ public class MultiLookAndFeel extends LookAndFeel defaults.put("EditorPaneUI", "javax.swing.plaf.multi.MultiTextUI"); defaults.put("FileChooserUI", "javax.swing.plaf.multi.MultiFileChooserUI"); defaults.put("FormattedTextFieldUI", "javax.swing.plaf.multi.MultiTextUI"); - defaults.put("InternalFrameUI", + defaults.put("InternalFrameUI", "javax.swing.plaf.multi.MultiInternalFrameUI"); defaults.put("LabelUI", "javax.swing.plaf.multi.MultiLabelUI"); defaults.put("ListUI", "javax.swing.plaf.multi.MultiListUI"); @@ -142,11 +142,11 @@ public class MultiLookAndFeel extends LookAndFeel defaults.put("PanelUI", "javax.swing.plaf.multi.MultiPanelUI"); defaults.put("PasswordFieldUI", "javax.swing.plaf.multi.MultiTextUI"); defaults.put("PopupMenuUI", "javax.swing.plaf.multi.MultiPopupMenuUI"); - defaults.put("PopupMenuSeparatorUI", + defaults.put("PopupMenuSeparatorUI", "javax.swing.plaf.multi.MultiSeparatorUI"); defaults.put("ProgressBarUI", "javax.swing.plaf.multi.MultiProgressBarUI"); defaults.put("RadioButtonUI", "javax.swing.plaf.multi.MultiButtonUI"); - defaults.put("RadioButtonMenuItemUI", + defaults.put("RadioButtonMenuItemUI", "javax.swing.plaf.multi.MultiMenuItemUI"); defaults.put("RootPaneUI", "javax.swing.plaf.multi.MultiRootPaneUI"); defaults.put("ScrollBarUI", "javax.swing.plaf.multi.MultiScrollBarUI"); @@ -162,43 +162,43 @@ public class MultiLookAndFeel extends LookAndFeel defaults.put("TextFieldUI", "javax.swing.plaf.multi.MultiTextUI"); defaults.put("TextPaneUI", "javax.swing.plaf.multi.MultiTextUI"); defaults.put("ToggleButtonUI", "javax.swing.plaf.multi.MultiButtonUI"); - defaults.put("ToolBarSeparatorUI", + defaults.put("ToolBarSeparatorUI", "javax.swing.plaf.multi.MultiSeparatorUI"); defaults.put("ToolBarUI", "javax.swing.plaf.multi.MultiToolBarUI"); defaults.put("ToolTipUI", "javax.swing.plaf.multi.MultiToolTipUI"); defaults.put("ViewportUI", "javax.swing.plaf.multi.MultiViewportUI"); return defaults; } - + /** * Creates the UI delegates for the <code>target</code> component and * returns a multiplexing UI delegate (<code>mui</code>) if there are * multiple delegates. - * + * * @param mui a multiplexing UI delegate appropriate for the component. * @param uis a vector into which the UI delegates will be added. * @param target the target component. - * + * * @return A UI delegate. */ - public static ComponentUI createUIs(ComponentUI mui, Vector uis, + public static ComponentUI createUIs(ComponentUI mui, Vector uis, JComponent target) { // get primary UI delegate for 'target', and add it to uis ComponentUI ui = null; LookAndFeel primary = UIManager.getLookAndFeel(); - if (primary != null) + if (primary != null) { ui = UIManager.getUI(target); uis.add(ui); } - // for any auxiliary look and feels in use, get the UI delegate and add + // for any auxiliary look and feels in use, get the UI delegate and add // it to uis LookAndFeel[] auxlafs = UIManager.getAuxiliaryLookAndFeels(); for (int i = 0; i < auxlafs.length; i++) { LookAndFeel auxlaf = auxlafs[i]; - // FIXME: here I call getDefaults() to get the UI delegate from the + // FIXME: here I call getDefaults() to get the UI delegate from the // auxiliary look and feel. But getDefaults() creates a new set of // defaults every time it is called, which is wasteful. Unfortunately // I cannot find another way to get the UI delegate, so I'm doing it @@ -208,36 +208,36 @@ public class MultiLookAndFeel extends LookAndFeel if (ui != null) uis.add(ui); } - // if uis contains more than 1 delegate, return mui, otherwise return + // if uis contains more than 1 delegate, return mui, otherwise return // the primary delegate if (uis.size() > 1) return mui; else - return ui; + return ui; } - + /** * Returns an array containing the same {@link ComponentUI} instances as * <code>uis</code>. If <code>uis</code> is <code>null</code>, a zero-length * array is returned. - * - * @param uis a list of {@link ComponentUI} references (<code>null</code> + * + * @param uis a list of {@link ComponentUI} references (<code>null</code> * permitted). - * + * * @return An array containing the same {@link ComponentUI} instances as * <code>uis</code>, or <code>null</code> if <code>uis</code> is - * empty. + * empty. */ protected static ComponentUI[] uisToArray(Vector uis) { - if (uis == null) + if (uis == null) return new ComponentUI[0]; int size = uis.size(); - if (size == 0) + if (size == 0) return null; ComponentUI[] result = new ComponentUI[size]; uis.copyInto(result); - return result; + return result; } } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiMenuBarUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiMenuBarUI.java index a8e805a..5b43f6b 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiMenuBarUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiMenuBarUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.MenuBarUI; /** - * A UI delegate that that coordinates multiple {@link MenuBarUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link MenuBarUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiMenuBarUI extends MenuBarUI +public class MultiMenuBarUI extends MenuBarUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiMenuBarUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiMenuBarUI() + public MultiMenuBarUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiMenuBarUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiMenuBarUI extends MenuBarUI MultiMenuBarUI mui = new MultiMenuBarUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiMenuBarUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiMenuBarUI extends MenuBarUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiMenuBarUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiMenuBarUI extends MenuBarUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiMenuBarUI</code>. The first item in the array is always + * <code>MultiMenuBarUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiMenuBarUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiMenuBarUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiMenuBarUI extends MenuBarUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiMenuBarUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiMenuBarUI extends MenuBarUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiMenuBarUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiMenuBarUI extends MenuBarUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiMenuBarUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiMenuBarUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiMenuBarUI extends MenuBarUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiMenuBarUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiMenuBarUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiMenuBarUI extends MenuBarUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiMenuBarUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiMenuBarUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiMenuBarUI extends MenuBarUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiMenuBarUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiMenuBarUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiMenuBarUI extends MenuBarUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiMenuBarUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiMenuBarUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiMenuBarUI extends MenuBarUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiMenuItemUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiMenuItemUI.java index ccab5fe..6d361b0 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiMenuItemUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiMenuItemUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.MenuItemUI; /** - * A UI delegate that that coordinates multiple {@link MenuItemUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link MenuItemUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiMenuItemUI extends MenuItemUI +public class MultiMenuItemUI extends MenuItemUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiMenuItemUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiMenuItemUI() + public MultiMenuItemUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiItemUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiMenuItemUI extends MenuItemUI MultiMenuItemUI mui = new MultiMenuItemUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiMenuItemUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiMenuItemUI extends MenuItemUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiMenuItemUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiMenuItemUI extends MenuItemUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiMenuItemUI</code>. The first item in the array is always + * <code>MultiMenuItemUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiMenuItemUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiMenuItemUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiMenuItemUI extends MenuItemUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiMenuItemUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiMenuItemUI extends MenuItemUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiMenuItemUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiMenuItemUI extends MenuItemUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiMenuItemUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiMenuItemUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiMenuItemUI extends MenuItemUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiMenuItemUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiMenuItemUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiMenuItemUI extends MenuItemUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiMenuItemUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiMenuItemUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiMenuItemUI extends MenuItemUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiMenuItemUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiMenuItemUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiMenuItemUI extends MenuItemUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiMenuItemUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiMenuItemUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiMenuItemUI extends MenuItemUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiOptionPaneUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiOptionPaneUI.java index 8d6f386..eaa4a42 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiOptionPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiOptionPaneUI.java @@ -51,35 +51,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.OptionPaneUI; /** - * A UI delegate that that coordinates multiple {@link OptionPaneUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link OptionPaneUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiOptionPaneUI extends OptionPaneUI +public class MultiOptionPaneUI extends OptionPaneUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiOptionPaneUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiOptionPaneUI() + public MultiOptionPaneUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiOptionPaneUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -87,11 +87,11 @@ public class MultiOptionPaneUI extends OptionPaneUI MultiOptionPaneUI mui = new MultiOptionPaneUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiOptionPaneUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -105,9 +105,9 @@ public class MultiOptionPaneUI extends OptionPaneUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiOptionPaneUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -119,39 +119,39 @@ public class MultiOptionPaneUI extends OptionPaneUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiOptionPaneUI</code>. The first item in the array is always + * <code>MultiOptionPaneUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiOptionPaneUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiOptionPaneUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -164,11 +164,11 @@ public class MultiOptionPaneUI extends OptionPaneUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiOptionPaneUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -183,9 +183,9 @@ public class MultiOptionPaneUI extends OptionPaneUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiOptionPaneUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -198,24 +198,24 @@ public class MultiOptionPaneUI extends OptionPaneUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiOptionPaneUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiOptionPaneUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -228,24 +228,24 @@ public class MultiOptionPaneUI extends OptionPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiOptionPaneUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiOptionPaneUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -258,24 +258,24 @@ public class MultiOptionPaneUI extends OptionPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiOptionPaneUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiOptionPaneUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -288,24 +288,24 @@ public class MultiOptionPaneUI extends OptionPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiOptionPaneUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiOptionPaneUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -318,25 +318,25 @@ public class MultiOptionPaneUI extends OptionPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiOptionPaneUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiOptionPaneUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -349,14 +349,14 @@ public class MultiOptionPaneUI extends OptionPaneUI } return result; } - + /** * Calls the {@link OptionPaneUI#selectInitialValue(JOptionPane)} method for * all the UI delegates managed by this <code>MultiOptionPaneUI</code>. - * + * * @param pane the option pane. */ - public void selectInitialValue(JOptionPane pane) + public void selectInitialValue(JOptionPane pane) { Iterator iterator = uis.iterator(); while (iterator.hasNext()) @@ -367,21 +367,21 @@ public class MultiOptionPaneUI extends OptionPaneUI } /** - * Calls the {@link OptionPaneUI#containsCustomComponents(JOptionPane)} - * method for all the UI delegates managed by this - * <code>MultiOptionPaneUI</code>, returning the result for the UI delegate - * from the primary look and feel. - * + * Calls the {@link OptionPaneUI#containsCustomComponents(JOptionPane)} + * method for all the UI delegates managed by this + * <code>MultiOptionPaneUI</code>, returning the result for the UI delegate + * from the primary look and feel. + * * @param pane the option pane. - * - * @return The result for the UI delegate from the primary look and feel. + * + * @return The result for the UI delegate from the primary look and feel. */ - public boolean containsCustomComponents(JOptionPane pane) + public boolean containsCustomComponents(JOptionPane pane) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { OptionPaneUI ui = (OptionPaneUI) iterator.next(); result = ui.containsCustomComponents(pane); diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiPanelUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiPanelUI.java index 67629b2..7b84599 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiPanelUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiPanelUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.PanelUI; /** - * A UI delegate that that coordinates multiple {@link PanelUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link PanelUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiPanelUI extends PanelUI +public class MultiPanelUI extends PanelUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiPanelUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiPanelUI() + public MultiPanelUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiPanelUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiPanelUI extends PanelUI MultiPanelUI mui = new MultiPanelUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiPanelUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiPanelUI extends PanelUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiPanelUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiPanelUI extends PanelUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiPanelUI</code>. The first item in the array is always + * <code>MultiPanelUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiPanelUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiPanelUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiPanelUI extends PanelUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiPanelUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiPanelUI extends PanelUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiPanelUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiPanelUI extends PanelUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiPanelUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiPanelUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiPanelUI extends PanelUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiPanelUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiPanelUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiPanelUI extends PanelUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiPanelUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiPanelUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiPanelUI extends PanelUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiPanelUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiPanelUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiPanelUI extends PanelUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiPanelUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiPanelUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiPanelUI extends PanelUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiPopupMenuUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiPopupMenuUI.java index 161429d..0afaaf7 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiPopupMenuUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiPopupMenuUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.PopupMenuUI; /** - * A UI delegate that that coordinates multiple {@link PopupMenuUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link PopupMenuUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiPopupMenuUI extends PopupMenuUI +public class MultiPopupMenuUI extends PopupMenuUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiPopupMenuUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiPopupMenuUI() + public MultiPopupMenuUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiPopupMenuUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiPopupMenuUI extends PopupMenuUI MultiPopupMenuUI mui = new MultiPopupMenuUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiPopupMenuUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiPopupMenuUI extends PopupMenuUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiPopupMenuUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiPopupMenuUI extends PopupMenuUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiPopupMenuUI</code>. The first item in the array is always + * <code>MultiPopupMenuUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiPopupMenuUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiPopupMenuUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiPopupMenuUI extends PopupMenuUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiPopupMenuUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiPopupMenuUI extends PopupMenuUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiPopupMenuUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiPopupMenuUI extends PopupMenuUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiPopupMenuUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiPopupMenuUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiPopupMenuUI extends PopupMenuUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiPopupMenuUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiPopupMenuUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiPopupMenuUI extends PopupMenuUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiPopupMenuUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiPopupMenuUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiPopupMenuUI extends PopupMenuUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiPopupMenuUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiPopupMenuUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiPopupMenuUI extends PopupMenuUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiPopupMenuUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiPopupMenuUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiPopupMenuUI extends PopupMenuUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiProgressBarUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiProgressBarUI.java index c5dbbe8..0395bdd 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiProgressBarUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiProgressBarUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ProgressBarUI; /** - * A UI delegate that that coordinates multiple {@link ProgressBarUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link ProgressBarUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiProgressBarUI extends ProgressBarUI +public class MultiProgressBarUI extends ProgressBarUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiProgressBarUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiProgressBarUI() + public MultiProgressBarUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiProgressBarUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiProgressBarUI extends ProgressBarUI MultiProgressBarUI mui = new MultiProgressBarUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiProgressBarUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiProgressBarUI extends ProgressBarUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiProgressBarUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiProgressBarUI extends ProgressBarUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiProgressBarUI</code>. The first item in the array is always + * <code>MultiProgressBarUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiProgressBarUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiProgressBarUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiProgressBarUI extends ProgressBarUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiProgressBarUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiProgressBarUI extends ProgressBarUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiProgressBarUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiProgressBarUI extends ProgressBarUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiProgressBarUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiProgressBarUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiProgressBarUI extends ProgressBarUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiProgressBarUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiProgressBarUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiProgressBarUI extends ProgressBarUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiProgressBarUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiProgressBarUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiProgressBarUI extends ProgressBarUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiProgressBarUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiProgressBarUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiProgressBarUI extends ProgressBarUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiProgressBarUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiProgressBarUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiProgressBarUI extends ProgressBarUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiRootPaneUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiRootPaneUI.java index bd0cb5c..69c7ffe 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiRootPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiRootPaneUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.RootPaneUI; /** - * A UI delegate that that coordinates multiple {@link RootPaneUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link RootPaneUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiRootPaneUI extends RootPaneUI +public class MultiRootPaneUI extends RootPaneUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiRootPanelUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiRootPaneUI() + public MultiRootPaneUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiRootPaneUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiRootPaneUI extends RootPaneUI MultiRootPaneUI mui = new MultiRootPaneUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiRootPaneUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiRootPaneUI extends RootPaneUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiRootPaneUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiRootPaneUI extends RootPaneUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiRootPaneUI</code>. The first item in the array is always + * <code>MultiRootPaneUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiRootPaneUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiRootPaneUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiRootPaneUI extends RootPaneUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiRootPaneUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiRootPaneUI extends RootPaneUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiRootPaneUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiRootPaneUI extends RootPaneUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiRootPaneUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiRootPaneUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiRootPaneUI extends RootPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiRootPaneUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiRootPaneUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiRootPaneUI extends RootPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiRootPaneUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiRootPaneUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiRootPaneUI extends RootPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiRootPaneUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiRootPaneUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiRootPaneUI extends RootPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiRootPaneUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiRootPaneUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiRootPaneUI extends RootPaneUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiScrollBarUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiScrollBarUI.java index 1a993b8..4ec8b3f 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiScrollBarUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiScrollBarUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ScrollBarUI; /** - * A UI delegate that that coordinates multiple {@link ScrollBarUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link ScrollBarUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiScrollBarUI extends ScrollBarUI +public class MultiScrollBarUI extends ScrollBarUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiScrollBarUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiScrollBarUI() + public MultiScrollBarUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiScrollBarUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiScrollBarUI extends ScrollBarUI MultiScrollBarUI mui = new MultiScrollBarUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiScrollBarUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiScrollBarUI extends ScrollBarUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiScrollBarUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiScrollBarUI extends ScrollBarUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiScrollBarUI</code>. The first item in the array is always + * <code>MultiScrollBarUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiScrollBarUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiScrollBarUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiScrollBarUI extends ScrollBarUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiScrollBarUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiScrollBarUI extends ScrollBarUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiScrollBarUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiScrollBarUI extends ScrollBarUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiScrollBarUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiScrollBarUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -230,21 +230,21 @@ public class MultiScrollBarUI extends ScrollBarUI /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiScrollBarUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiScrollBarUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiScrollBarUI extends ScrollBarUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiScrollBarUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiScrollBarUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiScrollBarUI extends ScrollBarUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiScrollBarUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiScrollBarUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiScrollBarUI extends ScrollBarUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiScrollBarUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiScrollBarUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiScrollBarUI extends ScrollBarUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiScrollPaneUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiScrollPaneUI.java index a50c3ba..5a0bc1e 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiScrollPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiScrollPaneUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ScrollPaneUI; /** - * A UI delegate that that coordinates multiple {@link ScrollPaneUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link ScrollPaneUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiScrollPaneUI extends ScrollPaneUI +public class MultiScrollPaneUI extends ScrollPaneUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiScrollPaneUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiScrollPaneUI() + public MultiScrollPaneUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiScrollPaneUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiScrollPaneUI extends ScrollPaneUI MultiScrollPaneUI mui = new MultiScrollPaneUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiScrollPaneUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiScrollPaneUI extends ScrollPaneUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiScrollPaneUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiScrollPaneUI extends ScrollPaneUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiScrollPaneUI</code>. The first item in the array is always + * <code>MultiScrollPaneUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiScrollPaneUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiScrollPaneUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiScrollPaneUI extends ScrollPaneUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiScrollPaneUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiScrollPaneUI extends ScrollPaneUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiScrollPaneUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiScrollPaneUI extends ScrollPaneUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiScrollPaneUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiScrollPaneUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiScrollPaneUI extends ScrollPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiScrollPaneUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiScrollPaneUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiScrollPaneUI extends ScrollPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiScrollPaneUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiScrollPaneUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiScrollPaneUI extends ScrollPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiScrollPaneUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiScrollPaneUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiScrollPaneUI extends ScrollPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiScrollPaneUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiScrollPaneUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiScrollPaneUI extends ScrollPaneUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiSeparatorUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiSeparatorUI.java index f8e4fea..fbd9712 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiSeparatorUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiSeparatorUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.SeparatorUI; /** - * A UI delegate that that coordinates multiple {@link MultiSeparatorUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link MultiSeparatorUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiSeparatorUI extends SeparatorUI +public class MultiSeparatorUI extends SeparatorUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiSeparatorUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiSeparatorUI() + public MultiSeparatorUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiSeparatorUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiSeparatorUI extends SeparatorUI MultiSeparatorUI mui = new MultiSeparatorUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiSeparatorUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiSeparatorUI extends SeparatorUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiSeparatorUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiSeparatorUI extends SeparatorUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiSeparatorUI</code>. The first item in the array is always + * <code>MultiSeparatorUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiSeparatorUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiSeparatorUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiSeparatorUI extends SeparatorUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiSeparatorUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiSeparatorUI extends SeparatorUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiSeparatorUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiSeparatorUI extends SeparatorUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiSeparatorUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiSeparatorUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiSeparatorUI extends SeparatorUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiSeparatorUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiSeparatorUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiSeparatorUI extends SeparatorUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiSeparatorUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiSeparatorUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiSeparatorUI extends SeparatorUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiSeparatorUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiSeparatorUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiSeparatorUI extends SeparatorUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiSeparatorUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiSeparatorUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiSeparatorUI extends SeparatorUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiSliderUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiSliderUI.java index 8a4aab6..cb896c5 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiSliderUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiSliderUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.SliderUI; /** - * A UI delegate that that coordinates multiple {@link SliderUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link SliderUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiSliderUI extends SliderUI +public class MultiSliderUI extends SliderUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiSliderUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiSliderUI() + public MultiSliderUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiSliderUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiSliderUI extends SliderUI MultiSliderUI mui = new MultiSliderUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiSliderUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiSliderUI extends SliderUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiSliderUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiSliderUI extends SliderUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiSliderUI</code>. The first item in the array is always + * <code>MultiSliderUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiSliderUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiSliderUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiSliderUI extends SliderUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiSliderUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiSliderUI extends SliderUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiSliderUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiSliderUI extends SliderUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiSliderUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiSliderUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiSliderUI extends SliderUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiSliderUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiSliderUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiSliderUI extends SliderUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiSliderUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiSliderUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiSliderUI extends SliderUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiSliderUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiSliderUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiSliderUI extends SliderUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiSliderUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiSliderUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiSliderUI extends SliderUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiSpinnerUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiSpinnerUI.java index 70068e8..fd805f9 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiSpinnerUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiSpinnerUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.SpinnerUI; /** - * A UI delegate that that coordinates multiple {@link SpinnerUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link SpinnerUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiSpinnerUI extends SpinnerUI +public class MultiSpinnerUI extends SpinnerUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiSpinnerUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiSpinnerUI() + public MultiSpinnerUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiSpinnerUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiSpinnerUI extends SpinnerUI MultiSpinnerUI mui = new MultiSpinnerUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiSpinnerUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiSpinnerUI extends SpinnerUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiSpinnerUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiSpinnerUI extends SpinnerUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiSpinnerUI</code>. The first item in the array is always + * <code>MultiSpinnerUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiSpinnerUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiSpinnerUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiSpinnerUI extends SpinnerUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiSpinnerUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiSpinnerUI extends SpinnerUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiSpinnerUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiSpinnerUI extends SpinnerUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiSpinnerUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiSpinnerUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiSpinnerUI extends SpinnerUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiSpinnerUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiSpinnerUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiSpinnerUI extends SpinnerUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiSpinnerUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiSpinnerUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiSpinnerUI extends SpinnerUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiSpinnerUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiSpinnerUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiSpinnerUI extends SpinnerUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiSpinnerUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiSpinnerUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiSpinnerUI extends SpinnerUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiSplitPaneUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiSplitPaneUI.java index 70ea4f1..1eb2e41 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiSplitPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiSplitPaneUI.java @@ -51,35 +51,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.SplitPaneUI; /** - * A UI delegate that that coordinates multiple {@link SplitPaneUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link SplitPaneUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiSplitPaneUI extends SplitPaneUI +public class MultiSplitPaneUI extends SplitPaneUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiSplitPaneUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiSplitPaneUI() + public MultiSplitPaneUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiSplitPaneUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -87,11 +87,11 @@ public class MultiSplitPaneUI extends SplitPaneUI MultiSplitPaneUI mui = new MultiSplitPaneUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiSplitPaneUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -105,9 +105,9 @@ public class MultiSplitPaneUI extends SplitPaneUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiSplitPaneUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -119,39 +119,39 @@ public class MultiSplitPaneUI extends SplitPaneUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiSplitPaneUI</code>. The first item in the array is always + * <code>MultiSplitPaneUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiSplitPaneUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiSplitPaneUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -164,11 +164,11 @@ public class MultiSplitPaneUI extends SplitPaneUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiSplitPaneUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -183,9 +183,9 @@ public class MultiSplitPaneUI extends SplitPaneUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiSplitPaneUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -198,24 +198,24 @@ public class MultiSplitPaneUI extends SplitPaneUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiSplitPaneUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiSplitPaneUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -231,21 +231,21 @@ public class MultiSplitPaneUI extends SplitPaneUI /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiSplitPaneUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiSplitPaneUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -258,24 +258,24 @@ public class MultiSplitPaneUI extends SplitPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiSplitPaneUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiSplitPaneUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -288,24 +288,24 @@ public class MultiSplitPaneUI extends SplitPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiSplitPaneUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiSplitPaneUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -318,25 +318,25 @@ public class MultiSplitPaneUI extends SplitPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiSplitPaneUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiSplitPaneUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -349,14 +349,14 @@ public class MultiSplitPaneUI extends SplitPaneUI } return result; } - + /** - * Calls the {@link SplitPaneUI#resetToPreferredSizes(JSplitPane)} method + * Calls the {@link SplitPaneUI#resetToPreferredSizes(JSplitPane)} method * for all the UI delegates managed by this <code>MultiSplitPaneUI</code>. - * + * * @param pane the component. */ - public void resetToPreferredSizes(JSplitPane pane) + public void resetToPreferredSizes(JSplitPane pane) { Iterator iterator = uis.iterator(); while (iterator.hasNext()) @@ -367,13 +367,13 @@ public class MultiSplitPaneUI extends SplitPaneUI } /** - * Calls the {@link SplitPaneUI#setDividerLocation(JSplitPane, int)} method + * Calls the {@link SplitPaneUI#setDividerLocation(JSplitPane, int)} method * for all the UI delegates managed by this <code>MultiSplitPaneUI</code>. - * + * * @param pane the component. * @param location the location. */ - public void setDividerLocation(JSplitPane pane, int location) + public void setDividerLocation(JSplitPane pane, int location) { Iterator iterator = uis.iterator(); while (iterator.hasNext()) @@ -385,21 +385,21 @@ public class MultiSplitPaneUI extends SplitPaneUI /** * Calls the {@link SplitPaneUI#getDividerLocation(JSplitPane)} method for all - * the UI delegates managed by this <code>MultiSplitPaneUI</code>, - * returning the location for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiSplitPaneUI</code>, + * returning the location for the UI delegate from the primary look and + * feel. + * * @param pane the component. - * - * @return The location returned by the UI delegate from the primary - * look and feel. + * + * @return The location returned by the UI delegate from the primary + * look and feel. */ - public int getDividerLocation(JSplitPane pane) + public int getDividerLocation(JSplitPane pane) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { SplitPaneUI ui = (SplitPaneUI) iterator.next(); result = ui.getDividerLocation(pane); @@ -414,22 +414,22 @@ public class MultiSplitPaneUI extends SplitPaneUI } /** - * Calls the {@link SplitPaneUI#getMinimumDividerLocation(JSplitPane)} method - * for all the UI delegates managed by this <code>MultiSplitPaneUI</code>, - * returning the location for the UI delegate from the primary look and - * feel. - * + * Calls the {@link SplitPaneUI#getMinimumDividerLocation(JSplitPane)} method + * for all the UI delegates managed by this <code>MultiSplitPaneUI</code>, + * returning the location for the UI delegate from the primary look and + * feel. + * * @param pane the component. - * - * @return The location returned by the UI delegate from the primary - * look and feel. + * + * @return The location returned by the UI delegate from the primary + * look and feel. */ - public int getMinimumDividerLocation(JSplitPane pane) + public int getMinimumDividerLocation(JSplitPane pane) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { SplitPaneUI ui = (SplitPaneUI) iterator.next(); result = ui.getMinimumDividerLocation(pane); @@ -444,22 +444,22 @@ public class MultiSplitPaneUI extends SplitPaneUI } /** - * Calls the {@link SplitPaneUI#getMaximumDividerLocation(JSplitPane)} method - * for all the UI delegates managed by this <code>MultiSplitPaneUI</code>, - * returning the location for the UI delegate from the primary look and - * feel. - * + * Calls the {@link SplitPaneUI#getMaximumDividerLocation(JSplitPane)} method + * for all the UI delegates managed by this <code>MultiSplitPaneUI</code>, + * returning the location for the UI delegate from the primary look and + * feel. + * * @param pane the component. - * - * @return The location returned by the UI delegate from the primary - * look and feel. + * + * @return The location returned by the UI delegate from the primary + * look and feel. */ - public int getMaximumDividerLocation(JSplitPane pane) + public int getMaximumDividerLocation(JSplitPane pane) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { SplitPaneUI ui = (SplitPaneUI) iterator.next(); result = ui.getMaximumDividerLocation(pane); @@ -474,14 +474,14 @@ public class MultiSplitPaneUI extends SplitPaneUI } /** - * Calls the {@link SplitPaneUI#finishedPaintingChildren(JSplitPane, - * Graphics)} method for all the UI delegates managed by this + * Calls the {@link SplitPaneUI#finishedPaintingChildren(JSplitPane, + * Graphics)} method for all the UI delegates managed by this * <code>MultiSplitPaneUI</code>. - * + * * @param pane the component. * @param g the graphics device. */ - public void finishedPaintingChildren(JSplitPane pane, Graphics g) + public void finishedPaintingChildren(JSplitPane pane, Graphics g) { Iterator iterator = uis.iterator(); while (iterator.hasNext()) diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiTabbedPaneUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiTabbedPaneUI.java index 2a2599b..3f9d22a 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiTabbedPaneUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiTabbedPaneUI.java @@ -52,35 +52,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.TabbedPaneUI; /** - * A UI delegate that that coordinates multiple {@link TabbedPaneUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link TabbedPaneUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiTabbedPaneUI extends TabbedPaneUI +public class MultiTabbedPaneUI extends TabbedPaneUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiTabbedPaneUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiTabbedPaneUI() + public MultiTabbedPaneUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiTabbedPaneUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -88,11 +88,11 @@ public class MultiTabbedPaneUI extends TabbedPaneUI MultiTabbedPaneUI mui = new MultiTabbedPaneUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiTabbedPaneUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -106,9 +106,9 @@ public class MultiTabbedPaneUI extends TabbedPaneUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiTabbedPaneUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -120,39 +120,39 @@ public class MultiTabbedPaneUI extends TabbedPaneUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiTabbedPaneUI</code>. The first item in the array is always + * <code>MultiTabbedPaneUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiTabbedPaneUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiTabbedPaneUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -165,11 +165,11 @@ public class MultiTabbedPaneUI extends TabbedPaneUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiTabbedPaneUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -184,9 +184,9 @@ public class MultiTabbedPaneUI extends TabbedPaneUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiTabbedPaneUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -199,24 +199,24 @@ public class MultiTabbedPaneUI extends TabbedPaneUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTabbedPaneUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTabbedPaneUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -232,21 +232,21 @@ public class MultiTabbedPaneUI extends TabbedPaneUI /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTabbedPaneUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTabbedPaneUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -259,24 +259,24 @@ public class MultiTabbedPaneUI extends TabbedPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTabbedPaneUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTabbedPaneUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -289,24 +289,24 @@ public class MultiTabbedPaneUI extends TabbedPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiTabbedPaneUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTabbedPaneUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -319,25 +319,25 @@ public class MultiTabbedPaneUI extends TabbedPaneUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiTabbedPaneUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTabbedPaneUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -350,26 +350,26 @@ public class MultiTabbedPaneUI extends TabbedPaneUI } return result; } - + /** - * Calls the {@link TabbedPaneUI#tabForCoordinate(JTabbedPane, int, int)} - * method for all the UI delegates managed by this - * <code>MultiTabbedPaneUI</code>, returning the tab index for the UI - * delegate from the primary look and feel. - * + * Calls the {@link TabbedPaneUI#tabForCoordinate(JTabbedPane, int, int)} + * method for all the UI delegates managed by this + * <code>MultiTabbedPaneUI</code>, returning the tab index for the UI + * delegate from the primary look and feel. + * * @param pane the tabbed pane. * @param x the x-coordinate. * @param y the y-coordinate. - * - * @return The tab index returned by the UI delegate from the primary - * look and feel. + * + * @return The tab index returned by the UI delegate from the primary + * look and feel. */ - public int tabForCoordinate(JTabbedPane pane, int x, int y) + public int tabForCoordinate(JTabbedPane pane, int x, int y) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TabbedPaneUI ui = (TabbedPaneUI) iterator.next(); result = ui.tabForCoordinate(pane, x, y); @@ -384,23 +384,23 @@ public class MultiTabbedPaneUI extends TabbedPaneUI } /** - * Calls the {@link TabbedPaneUI#getTabBounds(JTabbedPane, int)} - * method for all the UI delegates managed by this - * <code>MultiTabbedPaneUI</code>, returning the bounds for the UI - * delegate from the primary look and feel. - * + * Calls the {@link TabbedPaneUI#getTabBounds(JTabbedPane, int)} + * method for all the UI delegates managed by this + * <code>MultiTabbedPaneUI</code>, returning the bounds for the UI + * delegate from the primary look and feel. + * * @param pane the tabbed pane. * @param index the index. - * - * @return The bounds returned by the UI delegate from the primary - * look and feel. + * + * @return The bounds returned by the UI delegate from the primary + * look and feel. */ - public Rectangle getTabBounds(JTabbedPane pane, int index) + public Rectangle getTabBounds(JTabbedPane pane, int index) { Rectangle result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TabbedPaneUI ui = (TabbedPaneUI) iterator.next(); result = ui.getTabBounds(pane, index); @@ -415,22 +415,22 @@ public class MultiTabbedPaneUI extends TabbedPaneUI } /** - * Calls the {@link TabbedPaneUI#getTabRunCount(JTabbedPane)} - * method for all the UI delegates managed by this - * <code>MultiTabbedPaneUI</code>, returning the nt for the UI - * delegate from the primary look and feel. - * + * Calls the {@link TabbedPaneUI#getTabRunCount(JTabbedPane)} + * method for all the UI delegates managed by this + * <code>MultiTabbedPaneUI</code>, returning the nt for the UI + * delegate from the primary look and feel. + * * @param pane the tabbed pane. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ - public int getTabRunCount(JTabbedPane pane) + public int getTabRunCount(JTabbedPane pane) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TabbedPaneUI ui = (TabbedPaneUI) iterator.next(); result = ui.getTabRunCount(pane); diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiTableHeaderUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiTableHeaderUI.java index 6c59cef..972303b 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiTableHeaderUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiTableHeaderUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.TableHeaderUI; /** - * A UI delegate that that coordinates multiple {@link TableHeaderUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link TableHeaderUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiTableHeaderUI extends TableHeaderUI +public class MultiTableHeaderUI extends TableHeaderUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiTableHeaderUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiTableHeaderUI() + public MultiTableHeaderUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiTableHeaderUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiTableHeaderUI extends TableHeaderUI MultiTableHeaderUI mui = new MultiTableHeaderUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiTableHeaderUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiTableHeaderUI extends TableHeaderUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiTableHeaderUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiTableHeaderUI extends TableHeaderUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiTableHeaderUI</code>. The first item in the array is always + * <code>MultiTableHeaderUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiTableHeaderUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiTableHeaderUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiTableHeaderUI extends TableHeaderUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiTableHeaderUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiTableHeaderUI extends TableHeaderUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiTableHeaderUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiTableHeaderUI extends TableHeaderUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTableHeaderUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTableHeaderUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiTableHeaderUI extends TableHeaderUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTableHeaderUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTableHeaderUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiTableHeaderUI extends TableHeaderUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTableHeaderUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTableHeaderUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiTableHeaderUI extends TableHeaderUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiTableHeaderUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTableHeaderUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiTableHeaderUI extends TableHeaderUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiTableHeaderUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTableHeaderUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiTableHeaderUI extends TableHeaderUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiTableUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiTableUI.java index 2e5b5bc..1cd1a4c 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiTableUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiTableUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.TableUI; /** - * A UI delegate that that coordinates multiple {@link TableUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link TableUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiTableUI extends TableUI +public class MultiTableUI extends TableUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiTableUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiTableUI() + public MultiTableUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiTableUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiTableUI extends TableUI MultiTableUI mui = new MultiTableUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiTableUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiTableUI extends TableUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiTableUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiTableUI extends TableUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiTableUI</code>. The first item in the array is always + * <code>MultiTableUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiTableUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiTableUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiTableUI extends TableUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiTableUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiTableUI extends TableUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiTableUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiTableUI extends TableUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTableUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTableUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiTableUI extends TableUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTableUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTableUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiTableUI extends TableUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTableUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTableUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiTableUI extends TableUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiTableUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTableUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiTableUI extends TableUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiTableUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTableUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiTableUI extends TableUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiTextUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiTextUI.java index c5dee24..392fd98 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiTextUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiTextUI.java @@ -58,35 +58,35 @@ import javax.swing.text.View; import javax.swing.text.Position.Bias; /** - * A UI delegate that that coordinates multiple {@link TextUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link TextUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiTextUI extends TextUI +public class MultiTextUI extends TextUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiTextUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiTextUI() + public MultiTextUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiTextUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -94,11 +94,11 @@ public class MultiTextUI extends TextUI MultiTextUI mui = new MultiTextUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiTextUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -112,9 +112,9 @@ public class MultiTextUI extends TextUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiTextUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -126,39 +126,39 @@ public class MultiTextUI extends TextUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiTextUI</code>. The first item in the array is always + * <code>MultiTextUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiTextUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiTextUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -171,11 +171,11 @@ public class MultiTextUI extends TextUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiTextUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -190,9 +190,9 @@ public class MultiTextUI extends TextUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiTextUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -205,24 +205,24 @@ public class MultiTextUI extends TextUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTextUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTextUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -235,24 +235,24 @@ public class MultiTextUI extends TextUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTextUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTextUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -265,24 +265,24 @@ public class MultiTextUI extends TextUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTextUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTextUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -295,24 +295,24 @@ public class MultiTextUI extends TextUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiTextUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTextUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -325,25 +325,25 @@ public class MultiTextUI extends TextUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiTextUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTextUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -356,25 +356,25 @@ public class MultiTextUI extends TextUI } return result; } - + /** * Calls the {@link TextUI#modelToView(JTextComponent, int)} method for all - * the UI delegates managed by this <code>MultiTextUI</code>, - * returning the bounds for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTextUI</code>, + * returning the bounds for the UI delegate from the primary look and + * feel. + * * @param tc the text component. - * - * @return The bounds returned by the UI delegate from the primary - * look and feel. + * + * @return The bounds returned by the UI delegate from the primary + * look and feel. */ public Rectangle modelToView(JTextComponent tc, int pos) - throws BadLocationException + throws BadLocationException { Rectangle result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); result = ui.modelToView(tc, pos); @@ -389,23 +389,23 @@ public class MultiTextUI extends TextUI } /** - * Calls the {@link TextUI#modelToView(JTextComponent, int, Position.Bias)} - * method for all the UI delegates managed by this <code>MultiTextUI</code>, - * returning the bounds for the UI delegate from the primary look and - * feel. - * + * Calls the {@link TextUI#modelToView(JTextComponent, int, Position.Bias)} + * method for all the UI delegates managed by this <code>MultiTextUI</code>, + * returning the bounds for the UI delegate from the primary look and + * feel. + * * @param tc the text component. - * - * @return The bounds returned by the UI delegate from the primary - * look and feel. + * + * @return The bounds returned by the UI delegate from the primary + * look and feel. */ public Rectangle modelToView(JTextComponent tc, int pos, Bias bias) - throws BadLocationException + throws BadLocationException { Rectangle result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); result = ui.modelToView(tc, pos, bias); @@ -421,22 +421,22 @@ public class MultiTextUI extends TextUI /** * Calls the {@link TextUI#viewToModel(JTextComponent, Point)} method for all - * the UI delegates managed by this <code>MultiTextUI</code>, - * returning the position for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTextUI</code>, + * returning the position for the UI delegate from the primary look and + * feel. + * * @param t the text component. * @param pt the point. - * - * @return The position returned by the UI delegate from the primary - * look and feel. + * + * @return The position returned by the UI delegate from the primary + * look and feel. */ - public int viewToModel(JTextComponent t, Point pt) + public int viewToModel(JTextComponent t, Point pt) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); result = ui.viewToModel(t, pt); @@ -451,22 +451,22 @@ public class MultiTextUI extends TextUI } /** - * Calls the {@link TextUI#viewToModel(JTextComponent, Point, Bias[])} method - * for all the UI delegates managed by this <code>MultiTextUI</code>, - * returning the position for the UI delegate from the primary look and - * feel. - * + * Calls the {@link TextUI#viewToModel(JTextComponent, Point, Bias[])} method + * for all the UI delegates managed by this <code>MultiTextUI</code>, + * returning the position for the UI delegate from the primary look and + * feel. + * * @param tc the text component. - * - * @return The position returned by the UI delegate from the primary - * look and feel. + * + * @return The position returned by the UI delegate from the primary + * look and feel. */ - public int viewToModel(JTextComponent tc, Point loc, Bias[] outBias) + public int viewToModel(JTextComponent tc, Point loc, Bias[] outBias) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); result = ui.viewToModel(tc, loc, outBias); @@ -481,48 +481,48 @@ public class MultiTextUI extends TextUI } /** - * Calls the {@link TextUI#getNextVisualPositionFrom(JTextComponent, int, + * Calls the {@link TextUI#getNextVisualPositionFrom(JTextComponent, int, * Position.Bias, int, Position.Bias[])} method for all - * the UI delegates managed by this <code>MultiTextUI</code>, - * returning the position for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTextUI</code>, + * returning the position for the UI delegate from the primary look and + * feel. + * * @param tc the text component. - * - * @return The position returned by the UI delegate from the primary - * look and feel. + * + * @return The position returned by the UI delegate from the primary + * look and feel. */ public int getNextVisualPositionFrom(JTextComponent tc, int pos, Bias bias, - int direction, Bias[] outBias) throws BadLocationException + int direction, Bias[] outBias) throws BadLocationException { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); - result = ui.getNextVisualPositionFrom(tc, pos, bias, direction, + result = ui.getNextVisualPositionFrom(tc, pos, bias, direction, outBias); } // return values from auxiliary UI delegates are ignored while (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); - /* int ignored = */ ui.getNextVisualPositionFrom(tc, pos, bias, + /* int ignored = */ ui.getNextVisualPositionFrom(tc, pos, bias, direction, outBias); } return result; } /** - * Calls the {@link TextUI#damageRange(JTextComponent, int, int)} method for + * Calls the {@link TextUI#damageRange(JTextComponent, int, int)} method for * all the UI delegates managed by this <code>MultiTextUI</code>. - * + * * @param tc the component. * @param start the start position. * @param end the end position. */ - public void damageRange(JTextComponent tc, int start, int end) + public void damageRange(JTextComponent tc, int start, int end) { Iterator iterator = uis.iterator(); while (iterator.hasNext()) @@ -533,10 +533,10 @@ public class MultiTextUI extends TextUI } /** - * Calls the {@link TextUI#damageRange(JTextComponent, int, int, - * Position.Bias, Position.Bias)} method for all the UI delegates managed by + * Calls the {@link TextUI#damageRange(JTextComponent, int, int, + * Position.Bias, Position.Bias)} method for all the UI delegates managed by * this <code>MultiTextUI</code>. - * + * * @param tc the component. * @param start the start position. * @param end the end position. @@ -544,7 +544,7 @@ public class MultiTextUI extends TextUI * @param endBias the end bias. */ public void damageRange(JTextComponent tc, int start, int end, - Bias startBias, Bias endBias) + Bias startBias, Bias endBias) { Iterator iterator = uis.iterator(); while (iterator.hasNext()) @@ -556,21 +556,21 @@ public class MultiTextUI extends TextUI /** * Calls the {@link TextUI#getEditorKit(JTextComponent)} method for all - * the UI delegates managed by this <code>MultiTextUI</code>, - * returning the editor kit for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTextUI</code>, + * returning the editor kit for the UI delegate from the primary look and + * feel. + * * @param tc the text component. - * - * @return The editor kit returned by the UI delegate from the primary - * look and feel. + * + * @return The editor kit returned by the UI delegate from the primary + * look and feel. */ - public EditorKit getEditorKit(JTextComponent tc) + public EditorKit getEditorKit(JTextComponent tc) { EditorKit result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); result = ui.getEditorKit(tc); @@ -586,21 +586,21 @@ public class MultiTextUI extends TextUI /** * Calls the {@link TextUI#getRootView(JTextComponent)} method for all - * the UI delegates managed by this <code>MultiTextUI</code>, - * returning the view for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTextUI</code>, + * returning the view for the UI delegate from the primary look and + * feel. + * * @param tc the text component. - * - * @return The view returned by the UI delegate from the primary - * look and feel. + * + * @return The view returned by the UI delegate from the primary + * look and feel. */ - public View getRootView(JTextComponent tc) + public View getRootView(JTextComponent tc) { View result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TextUI ui = (TextUI) iterator.next(); result = ui.getRootView(tc); diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiToolBarUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiToolBarUI.java index afe63bf..5f308d9 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiToolBarUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiToolBarUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ToolBarUI; /** - * A UI delegate that that coordinates multiple {@link ToolBarUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link ToolBarUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiToolBarUI extends ToolBarUI +public class MultiToolBarUI extends ToolBarUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiToolBarUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiToolBarUI() + public MultiToolBarUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiToolBarUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiToolBarUI extends ToolBarUI MultiToolBarUI mui = new MultiToolBarUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiToolBarUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiToolBarUI extends ToolBarUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiToolBarUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiToolBarUI extends ToolBarUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiToolBarUI</code>. The first item in the array is always + * <code>MultiToolBarUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiToolBarUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiToolBarUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiToolBarUI extends ToolBarUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiToolBarUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiToolBarUI extends ToolBarUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiToolBarUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiToolBarUI extends ToolBarUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiToolBarUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiToolBarUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiToolBarUI extends ToolBarUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiToolBarUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiToolBarUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiToolBarUI extends ToolBarUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiToolBarUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiToolBarUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiToolBarUI extends ToolBarUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiToolBarUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiToolBarUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiToolBarUI extends ToolBarUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiToolBarUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiToolBarUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiToolBarUI extends ToolBarUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiToolTipUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiToolTipUI.java index fcd622d..9db9efb 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiToolTipUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiToolTipUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ToolTipUI; /** - * A UI delegate that that coordinates multiple {@link ToolTipUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link ToolTipUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiToolTipUI extends ToolTipUI +public class MultiToolTipUI extends ToolTipUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiToolTipUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiToolTipUI() + public MultiToolTipUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiToolTipUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiToolTipUI extends ToolTipUI MultiToolTipUI mui = new MultiToolTipUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiToolTipUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiToolTipUI extends ToolTipUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiToolTipUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiToolTipUI extends ToolTipUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiToolTipUI</code>. The first item in the array is always + * <code>MultiToolTipUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiToolTipUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiToolTipUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiToolTipUI extends ToolTipUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiToolTipUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiToolTipUI extends ToolTipUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiToolTipUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiToolTipUI extends ToolTipUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiToolTipUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiToolTipUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -230,21 +230,21 @@ public class MultiToolTipUI extends ToolTipUI /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiToolTipUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiToolTipUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiToolTipUI extends ToolTipUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiToolTipUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiToolTipUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiToolTipUI extends ToolTipUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiToolTipUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiToolTipUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiToolTipUI extends ToolTipUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiToolTipUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiToolTipUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiToolTipUI extends ToolTipUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiTreeUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiTreeUI.java index de1dc6c..f70decc 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiTreeUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiTreeUI.java @@ -53,35 +53,35 @@ import javax.swing.plaf.TreeUI; import javax.swing.tree.TreePath; /** - * A UI delegate that that coordinates multiple {@link TreeUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link TreeUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiTreeUI extends TreeUI +public class MultiTreeUI extends TreeUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiTreeUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiTreeUI() + public MultiTreeUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiTreeUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -89,11 +89,11 @@ public class MultiTreeUI extends TreeUI MultiTreeUI mui = new MultiTreeUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiTreeUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -107,9 +107,9 @@ public class MultiTreeUI extends TreeUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiTreeUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -121,39 +121,39 @@ public class MultiTreeUI extends TreeUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiTreeUI</code>. The first item in the array is always + * <code>MultiTreeUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiTreeUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiTreeUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -166,11 +166,11 @@ public class MultiTreeUI extends TreeUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiTreeUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -185,9 +185,9 @@ public class MultiTreeUI extends TreeUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiTreeUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -200,24 +200,24 @@ public class MultiTreeUI extends TreeUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTreeUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTreeUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -230,24 +230,24 @@ public class MultiTreeUI extends TreeUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTreeUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTreeUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -260,24 +260,24 @@ public class MultiTreeUI extends TreeUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiTreeUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTreeUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -290,24 +290,24 @@ public class MultiTreeUI extends TreeUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiTreeUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTreeUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -320,25 +320,25 @@ public class MultiTreeUI extends TreeUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiTreeUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTreeUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -351,24 +351,24 @@ public class MultiTreeUI extends TreeUI } return result; } - + /** * Calls the {@link TreeUI#getPathBounds(JTree, TreePath)} method - * for all the UI delegates managed by this <code>MultiTreeUI</code>, - * returning the bounds for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTreeUI</code>, + * returning the bounds for the UI delegate from the primary look and + * feel. + * * @param tree the tree component. - * - * @return The bounds returned by the UI delegate from the primary - * look and feel. + * + * @return The bounds returned by the UI delegate from the primary + * look and feel. */ - public Rectangle getPathBounds(JTree tree, TreePath path) + public Rectangle getPathBounds(JTree tree, TreePath path) { Rectangle result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TreeUI ui = (TreeUI) iterator.next(); result = ui.getPathBounds(tree, path); @@ -384,21 +384,21 @@ public class MultiTreeUI extends TreeUI /** * Calls the {@link TreeUI#getPathForRow(JTree, int)} method - * for all the UI delegates managed by this <code>MultiTreeUI</code>, - * returning the path for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTreeUI</code>, + * returning the path for the UI delegate from the primary look and + * feel. + * * @param tree the tree component. - * - * @return The path returned by the UI delegate from the primary - * look and feel. + * + * @return The path returned by the UI delegate from the primary + * look and feel. */ - public TreePath getPathForRow(JTree tree, int row) + public TreePath getPathForRow(JTree tree, int row) { TreePath result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TreeUI ui = (TreeUI) iterator.next(); result = ui.getPathForRow(tree, row); @@ -414,21 +414,21 @@ public class MultiTreeUI extends TreeUI /** * Calls the {@link TreeUI#getRowForPath(JTree, TreePath)} method - * for all the UI delegates managed by this <code>MultiTreeUI</code>, - * returning the row index for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTreeUI</code>, + * returning the row index for the UI delegate from the primary look and + * feel. + * * @param tree the tree component. - * - * @return The row index returned by the UI delegate from the primary - * look and feel. + * + * @return The row index returned by the UI delegate from the primary + * look and feel. */ - public int getRowForPath(JTree tree, TreePath path) + public int getRowForPath(JTree tree, TreePath path) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TreeUI ui = (TreeUI) iterator.next(); result = ui.getRowForPath(tree, path); @@ -439,26 +439,26 @@ public class MultiTreeUI extends TreeUI TreeUI ui = (TreeUI) iterator.next(); /* int ignored = */ ui.getRowForPath(tree, path); } - return result; + return result; } /** * Calls the {@link TreeUI#getRowCount(JTree)} method - * for all the UI delegates managed by this <code>MultiTreeUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTreeUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param tree the tree component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ - public int getRowCount(JTree tree) + public int getRowCount(JTree tree) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TreeUI ui = (TreeUI) iterator.next(); result = ui.getRowCount(tree); @@ -469,26 +469,26 @@ public class MultiTreeUI extends TreeUI TreeUI ui = (TreeUI) iterator.next(); /* int ignored = */ ui.getRowCount(tree); } - return result; + return result; } /** * Calls the {@link TreeUI#getClosestPathForLocation(JTree, int, int)} method - * for all the UI delegates managed by this <code>MultiTreeUI</code>, - * returning the path for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiTreeUI</code>, + * returning the path for the UI delegate from the primary look and + * feel. + * * @param tree the tree component. - * - * @return The path returned by the UI delegate from the primary - * look and feel. + * + * @return The path returned by the UI delegate from the primary + * look and feel. */ - public TreePath getClosestPathForLocation(JTree tree, int x, int y) + public TreePath getClosestPathForLocation(JTree tree, int x, int y) { TreePath result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TreeUI ui = (TreeUI) iterator.next(); result = ui.getClosestPathForLocation(tree, x, y); @@ -499,26 +499,26 @@ public class MultiTreeUI extends TreeUI TreeUI ui = (TreeUI) iterator.next(); /* TreePath ignored = */ ui.getClosestPathForLocation(tree, x, y); } - return result; + return result; } /** * Calls the {@link TreeUI#isEditing(JTree)} method for all - * the UI delegates managed by this <code>MultiTreeUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTreeUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param tree the tree component. - * - * @return The result returned by the UI delegate from the primary - * look and feel. + * + * @return The result returned by the UI delegate from the primary + * look and feel. */ - public boolean isEditing(JTree tree) + public boolean isEditing(JTree tree) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TreeUI ui = (TreeUI) iterator.next(); result = ui.isEditing(tree); @@ -534,21 +534,21 @@ public class MultiTreeUI extends TreeUI /** * Calls the {@link TreeUI#stopEditing(JTree)} method for all - * the UI delegates managed by this <code>MultiTreeUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTreeUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param tree the tree component. - * - * @return The result returned by the UI delegate from the primary - * look and feel. + * + * @return The result returned by the UI delegate from the primary + * look and feel. */ - public boolean stopEditing(JTree tree) + public boolean stopEditing(JTree tree) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TreeUI ui = (TreeUI) iterator.next(); result = ui.stopEditing(tree); @@ -563,12 +563,12 @@ public class MultiTreeUI extends TreeUI } /** - * Calls the {@link TreeUI#cancelEditing(JTree)} method for + * Calls the {@link TreeUI#cancelEditing(JTree)} method for * all the UI delegates managed by this <code>MultiTreeUI</code>. - * + * * @param tree the tree component. */ - public void cancelEditing(JTree tree) + public void cancelEditing(JTree tree) { Iterator iterator = uis.iterator(); while (iterator.hasNext()) @@ -579,13 +579,13 @@ public class MultiTreeUI extends TreeUI } /** - * Calls the {@link TreeUI#startEditingAtPath(JTree, TreePath)} method for + * Calls the {@link TreeUI#startEditingAtPath(JTree, TreePath)} method for * all the UI delegates managed by this <code>MultiTreeUI</code>. - * + * * @param tree the tree component. * @param path the path. */ - public void startEditingAtPath(JTree tree, TreePath path) + public void startEditingAtPath(JTree tree, TreePath path) { Iterator iterator = uis.iterator(); while (iterator.hasNext()) @@ -597,21 +597,21 @@ public class MultiTreeUI extends TreeUI /** * Calls the {@link TreeUI#getEditingPath(JTree)} method for all - * the UI delegates managed by this <code>MultiTreeUI</code>, - * returning the path for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiTreeUI</code>, + * returning the path for the UI delegate from the primary look and + * feel. + * * @param tree the tree component. - * - * @return The path returned by the UI delegate from the primary - * look and feel. + * + * @return The path returned by the UI delegate from the primary + * look and feel. */ - public TreePath getEditingPath(JTree tree) + public TreePath getEditingPath(JTree tree) { TreePath result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { TreeUI ui = (TreeUI) iterator.next(); result = ui.getEditingPath(tree); @@ -622,7 +622,7 @@ public class MultiTreeUI extends TreeUI TreeUI ui = (TreeUI) iterator.next(); /* TreePath ignored = */ ui.getEditingPath(tree); } - return result; + return result; } } diff --git a/libjava/classpath/javax/swing/plaf/multi/MultiViewportUI.java b/libjava/classpath/javax/swing/plaf/multi/MultiViewportUI.java index 33bbc3b..55f9cba 100644 --- a/libjava/classpath/javax/swing/plaf/multi/MultiViewportUI.java +++ b/libjava/classpath/javax/swing/plaf/multi/MultiViewportUI.java @@ -50,35 +50,35 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ViewportUI; /** - * A UI delegate that that coordinates multiple {@link ViewportUI} - * instances, one from the primary look and feel, and one or more from the + * A UI delegate that that coordinates multiple {@link ViewportUI} + * instances, one from the primary look and feel, and one or more from the * auxiliary look and feel(s). - * + * * @see UIManager#addAuxiliaryLookAndFeel(LookAndFeel) */ -public class MultiViewportUI extends ViewportUI +public class MultiViewportUI extends ViewportUI { /** A list of references to the actual component UIs. */ protected Vector uis; - + /** * Creates a new <code>MultiViewPortUI</code> instance. - * + * * @see #createUI(JComponent) */ - public MultiViewportUI() + public MultiViewportUI() { uis = new Vector(); } - + /** - * Creates a delegate object for the specified component. If any auxiliary + * Creates a delegate object for the specified component. If any auxiliary * look and feels support this component, a <code>MultiViewportUI</code> is * returned, otherwise the UI from the default look and feel is returned. - * + * * @param target the component. - * + * * @see MultiLookAndFeel#createUIs(ComponentUI, Vector, JComponent) */ public static ComponentUI createUI(JComponent target) @@ -86,11 +86,11 @@ public class MultiViewportUI extends ViewportUI MultiViewportUI mui = new MultiViewportUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, target); } - + /** - * Calls the {@link ComponentUI#installUI(JComponent)} method for all + * Calls the {@link ComponentUI#installUI(JComponent)} method for all * the UI delegates managed by this <code>MultiViewportUI</code>. - * + * * @param c the component. */ public void installUI(JComponent c) @@ -104,9 +104,9 @@ public class MultiViewportUI extends ViewportUI } /** - * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all + * Calls the {@link ComponentUI#uninstallUI(JComponent)} method for all * the UI delegates managed by this <code>MultiViewportUI</code>. - * + * * @param c the component. */ public void uninstallUI(JComponent c) @@ -118,39 +118,39 @@ public class MultiViewportUI extends ViewportUI ui.uninstallUI(c); } } - + /** * Returns an array containing the UI delegates managed by this - * <code>MultiViewportUI</code>. The first item in the array is always + * <code>MultiViewportUI</code>. The first item in the array is always * the UI delegate from the installed default look and feel. - * + * * @return An array of UI delegates. */ public ComponentUI[] getUIs() { return MultiLookAndFeel.uisToArray(uis); } - + /** - * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all - * the UI delegates managed by this <code>MultiViewportUI</code>, - * returning the result for the UI delegate from the primary look and - * feel. - * + * Calls the {@link ComponentUI#contains(JComponent, int, int)} method for all + * the UI delegates managed by this <code>MultiViewportUI</code>, + * returning the result for the UI delegate from the primary look and + * feel. + * * @param c the component. * @param x the x-coordinate. * @param y the y-coordinate. - * + * * @return <code>true</code> if the specified (x, y) coordinate falls within * the bounds of the component as rendered by the UI delegate in the - * primary look and feel, and <code>false</code> otherwise. + * primary look and feel, and <code>false</code> otherwise. */ - public boolean contains(JComponent c, int x, int y) + public boolean contains(JComponent c, int x, int y) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.contains(c, x, y); @@ -163,11 +163,11 @@ public class MultiViewportUI extends ViewportUI } return result; } - + /** - * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all + * Calls the {@link ComponentUI#update(Graphics, JComponent)} method for all * the UI delegates managed by this <code>MultiViewportUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -182,9 +182,9 @@ public class MultiViewportUI extends ViewportUI } /** - * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI + * Calls the <code>paint(Graphics, JComponent)</code> method for all the UI * delegates managed by this <code>MultiViewportUI</code>. - * + * * @param g the graphics device. * @param c the component. */ @@ -197,24 +197,24 @@ public class MultiViewportUI extends ViewportUI ui.paint(g, c); } } - + /** * Calls the {@link ComponentUI#getPreferredSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiViewportUI</code>, - * returning the preferred size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiViewportUI</code>, + * returning the preferred size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The preferred size returned by the UI delegate from the primary - * look and feel. + * + * @return The preferred size returned by the UI delegate from the primary + * look and feel. */ public Dimension getPreferredSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getPreferredSize(c); @@ -227,24 +227,24 @@ public class MultiViewportUI extends ViewportUI } return result; } - + /** * Calls the {@link ComponentUI#getMinimumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiViewportUI</code>, - * returning the minimum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiViewportUI</code>, + * returning the minimum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The minimum size returned by the UI delegate from the primary - * look and feel. + * + * @return The minimum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMinimumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMinimumSize(c); @@ -257,24 +257,24 @@ public class MultiViewportUI extends ViewportUI } return result; } - + /** * Calls the {@link ComponentUI#getMaximumSize(JComponent)} method for all - * the UI delegates managed by this <code>MultiViewportUI</code>, - * returning the maximum size for the UI delegate from the primary look and - * feel. - * + * the UI delegates managed by this <code>MultiViewportUI</code>, + * returning the maximum size for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The maximum size returned by the UI delegate from the primary - * look and feel. + * + * @return The maximum size returned by the UI delegate from the primary + * look and feel. */ public Dimension getMaximumSize(JComponent c) { Dimension result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getMaximumSize(c); @@ -287,24 +287,24 @@ public class MultiViewportUI extends ViewportUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChildrenCount(JComponent)} method - * for all the UI delegates managed by this <code>MultiViewportUI</code>, - * returning the count for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiViewportUI</code>, + * returning the count for the UI delegate from the primary look and + * feel. + * * @param c the component. - * - * @return The count returned by the UI delegate from the primary - * look and feel. + * + * @return The count returned by the UI delegate from the primary + * look and feel. */ public int getAccessibleChildrenCount(JComponent c) { int result = 0; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChildrenCount(c); @@ -317,25 +317,25 @@ public class MultiViewportUI extends ViewportUI } return result; } - + /** * Calls the {@link ComponentUI#getAccessibleChild(JComponent, int)} method - * for all the UI delegates managed by this <code>MultiViewportUI</code>, - * returning the child for the UI delegate from the primary look and - * feel. - * + * for all the UI delegates managed by this <code>MultiViewportUI</code>, + * returning the child for the UI delegate from the primary look and + * feel. + * * @param c the component * @param i the child index. - * - * @return The child returned by the UI delegate from the primary - * look and feel. + * + * @return The child returned by the UI delegate from the primary + * look and feel. */ public Accessible getAccessibleChild(JComponent c, int i) { Accessible result = null; Iterator iterator = uis.iterator(); // first UI delegate provides the return value - if (iterator.hasNext()) + if (iterator.hasNext()) { ComponentUI ui = (ComponentUI) iterator.next(); result = ui.getAccessibleChild(c, i); @@ -348,5 +348,5 @@ public class MultiViewportUI extends ViewportUI } return result; } - + } diff --git a/libjava/classpath/javax/swing/plaf/synth/SynthGraphicsUtils.java b/libjava/classpath/javax/swing/plaf/synth/SynthGraphicsUtils.java index 1907d75..76a46cb 100644 --- a/libjava/classpath/javax/swing/plaf/synth/SynthGraphicsUtils.java +++ b/libjava/classpath/javax/swing/plaf/synth/SynthGraphicsUtils.java @@ -91,10 +91,10 @@ public class SynthGraphicsUtils * Lays out a label and (if non-null) an icon. The calculated coordinates are * then stored in <code>viewR</code>, <code>iconR</code> and * <code>textR</code>. - * + * * The alignment and position parameters may be one of the alignment or * position constants defined in {@link javax.swing.SwingConstants}. - * + * * @param ctx the synth context, identifies the current region * @param fm the font metrics to use to fetch the text measures * @param text the text to lay out, may be <code>null</code> @@ -123,7 +123,7 @@ public class SynthGraphicsUtils /** * Returns the width of the string <code>text</code> for the specified font * and font metrics. - * + * * @param ctx identifies the current region * @param font the font * @param fm the font metrics to use diff --git a/libjava/classpath/javax/swing/plaf/synth/SynthLookAndFeel.java b/libjava/classpath/javax/swing/plaf/synth/SynthLookAndFeel.java index 46a95f0..ac24dd4 100644 --- a/libjava/classpath/javax/swing/plaf/synth/SynthLookAndFeel.java +++ b/libjava/classpath/javax/swing/plaf/synth/SynthLookAndFeel.java @@ -73,7 +73,7 @@ public class SynthLookAndFeel * Creates a new instance of <code>SynthLookAndFeel</code>. In order to use * the Synth look and feel you either need to call {@link #load} to load a * set of styles from an XML file, or you need to call - * {@link #setStyleFactory} to provide your own style factory. + * {@link #setStyleFactory} to provide your own style factory. */ public SynthLookAndFeel() { diff --git a/libjava/classpath/javax/swing/plaf/synth/SynthPainter.java b/libjava/classpath/javax/swing/plaf/synth/SynthPainter.java index fa1f6f5..6a57dad 100644 --- a/libjava/classpath/javax/swing/plaf/synth/SynthPainter.java +++ b/libjava/classpath/javax/swing/plaf/synth/SynthPainter.java @@ -68,7 +68,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint * @param dir the orientation of the arrow @@ -86,7 +86,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint * @param dir the orientation of the progress bar @@ -105,7 +105,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint * @param dir the orientation of the separator @@ -124,7 +124,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint * @param dir the orientation of the divider @@ -143,7 +143,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint * @param dir the orientation of the divider @@ -162,7 +162,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -179,7 +179,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -196,7 +196,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -213,7 +213,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -230,7 +230,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -247,7 +247,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -264,7 +264,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -281,7 +281,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -298,7 +298,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -315,7 +315,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -332,7 +332,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -349,7 +349,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -366,7 +366,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -383,7 +383,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -400,7 +400,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -417,7 +417,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -434,7 +434,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -451,7 +451,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -468,7 +468,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -485,7 +485,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -502,7 +502,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -519,7 +519,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -536,7 +536,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -553,7 +553,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -570,7 +570,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -587,7 +587,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -604,7 +604,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -621,7 +621,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -638,7 +638,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -655,7 +655,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -672,7 +672,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -689,7 +689,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -706,7 +706,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -723,7 +723,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -740,7 +740,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -757,7 +757,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -774,7 +774,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -791,7 +791,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -808,7 +808,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -825,7 +825,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -842,7 +842,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -859,7 +859,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -876,7 +876,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -893,7 +893,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -910,7 +910,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -927,7 +927,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -944,7 +944,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -961,7 +961,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -978,7 +978,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -995,7 +995,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1012,7 +1012,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1029,7 +1029,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1046,7 +1046,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1063,7 +1063,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1080,7 +1080,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1097,7 +1097,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint * @param orientation orientation of the scrollbar @@ -1115,7 +1115,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint * @param orientation orientation of the scrollbar @@ -1133,7 +1133,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1150,7 +1150,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1167,7 +1167,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1184,7 +1184,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1201,7 +1201,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1218,7 +1218,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1235,7 +1235,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1252,7 +1252,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1269,7 +1269,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint * @param orientation orientation of the slider @@ -1287,7 +1287,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint * @param orientation orientation of the slider @@ -1305,7 +1305,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1322,7 +1322,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1339,7 +1339,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1356,7 +1356,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1373,7 +1373,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1390,7 +1390,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1407,7 +1407,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1424,7 +1424,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1441,7 +1441,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1458,7 +1458,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1475,7 +1475,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1492,7 +1492,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1509,7 +1509,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1526,7 +1526,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint * @param index the index of the tab to paint @@ -1544,7 +1544,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint * @param index the index of the tab to paint @@ -1562,7 +1562,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1579,7 +1579,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1596,7 +1596,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1613,7 +1613,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1630,7 +1630,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1647,7 +1647,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1664,7 +1664,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1681,7 +1681,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1698,7 +1698,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1715,7 +1715,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1732,7 +1732,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1749,7 +1749,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1766,7 +1766,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1783,7 +1783,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1800,7 +1800,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1817,7 +1817,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1834,7 +1834,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1851,7 +1851,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1868,7 +1868,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1885,7 +1885,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1902,7 +1902,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1919,7 +1919,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1936,7 +1936,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1953,7 +1953,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1970,7 +1970,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ @@ -1987,7 +1987,7 @@ public abstract class SynthPainter * painting * @param g the graphics context to use for painting * @param x the X coordinate of the area to paint - * @param y the Y coordinate of the area to paint + * @param y the Y coordinate of the area to paint * @param w the width of the area to paint * @param h the height of the area to paint */ |