diff options
Diffstat (limited to 'libjava/classpath/javax/swing/JToolBar.java')
-rw-r--r-- | libjava/classpath/javax/swing/JToolBar.java | 168 |
1 files changed, 84 insertions, 84 deletions
diff --git a/libjava/classpath/javax/swing/JToolBar.java b/libjava/classpath/javax/swing/JToolBar.java index 33ebcfcaf89..5f4816f04ae 100644 --- a/libjava/classpath/javax/swing/JToolBar.java +++ b/libjava/classpath/javax/swing/JToolBar.java @@ -83,7 +83,7 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible } /** - * Returns a set containing the current state of the {@link JToolBar} + * Returns a set containing the current state of the {@link JToolBar} * component. The current implementation simply calls the superclass. * * @return The accessible state set. @@ -134,16 +134,16 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible public void layoutContainer(Container c) { if (! (c instanceof JToolBar)) - throw new Error("DefaultToolBarLayout can only be used on JToolBars."); + throw new Error("DefaultToolBarLayout can only be used on JToolBars."); Insets insets = getInsets(); Insets margin = getMargin(); int middle; if (margin != null) { - insets.left += margin.left; - insets.top += margin.top; - insets.bottom += margin.bottom; - insets.right += margin.right; + insets.left += margin.left; + insets.top += margin.top; + insets.bottom += margin.bottom; + insets.right += margin.right; } Component[] components = c.getComponents(); Dimension tdims = c.getSize(); @@ -152,39 +152,39 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible if (getOrientation() == SwingUtilities.HORIZONTAL) { - start += insets.left; - for (int i = 0; i < components.length; i++) - { - if (components[i] != null && components[i].isVisible()) - { - pref = components[i].getPreferredSize(); - if (pref != null) - { - middle = (tdims.height - pref.height) / 2; - components[i].setBounds(start, middle, pref.width, - pref.height); - start += pref.width; - } - } - } + start += insets.left; + for (int i = 0; i < components.length; i++) + { + if (components[i] != null && components[i].isVisible()) + { + pref = components[i].getPreferredSize(); + if (pref != null) + { + middle = (tdims.height - pref.height) / 2; + components[i].setBounds(start, middle, pref.width, + pref.height); + start += pref.width; + } + } + } } else { - start += insets.top; - for (int i = 0; i < components.length; i++) - { - if (components[i] != null && components[i].isVisible()) - { - pref = components[i].getPreferredSize(); - if (pref != null) - { - middle = (tdims.width - pref.width) / 2; - components[i].setBounds(middle, start, pref.width, - pref.height); - start += pref.height; - } - } - } + start += insets.top; + for (int i = 0; i < components.length; i++) + { + if (components[i] != null && components[i].isVisible()) + { + pref = components[i].getPreferredSize(); + if (pref != null) + { + middle = (tdims.width - pref.width) / 2; + components[i].setBounds(middle, start, pref.width, + pref.height); + start += pref.height; + } + } + } } } @@ -223,33 +223,33 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible if (orientation == SwingConstants.HORIZONTAL) { - for (int i = 0; i < components.length; i++) - { - dims = components[i].getPreferredSize(); - if (dims != null) - { - if (dims.height > limit) - limit = dims.height; - total += dims.width; - } - } - w = total; - h = limit; + for (int i = 0; i < components.length; i++) + { + dims = components[i].getPreferredSize(); + if (dims != null) + { + if (dims.height > limit) + limit = dims.height; + total += dims.width; + } + } + w = total; + h = limit; } else { - for (int i = 0; i < components.length; i++) - { - dims = components[i].getPreferredSize(); - if (dims != null) - { - if (dims.width > limit) - limit = dims.width; - total += dims.height; - } - } - w = limit; - h = total; + for (int i = 0; i < components.length; i++) + { + dims = components[i].getPreferredSize(); + if (dims != null) + { + if (dims.width > limit) + limit = dims.width; + total += dims.height; + } + } + w = limit; + h = total; } Insets insets = getInsets(); @@ -259,8 +259,8 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible Insets margin = getMargin(); if (margin != null) { - w += margin.left + margin.right; - h += margin.top + margin.bottom; + w += margin.left + margin.right; + h += margin.top + margin.bottom; } return new Dimension(w, h); @@ -509,10 +509,10 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible { if (b != rollover) { - rollover = b; - firePropertyChange("rollover", ! rollover, rollover); - revalidate(); - repaint(); + rollover = b; + firePropertyChange("rollover", ! rollover, rollover); + revalidate(); + repaint(); } } @@ -541,7 +541,7 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible for (int i = 0; i < components.length; i++) if (components[i] == component) - return i; + return i; return -1; } // getComponentIndex() @@ -584,11 +584,11 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible || margin.right != this.margin.right || margin.top != this.margin.top || margin.bottom != this.margin.bottom))) { - Insets oldMargin = this.margin; - this.margin = margin; - firePropertyChange("margin", oldMargin, this.margin); - revalidate(); - repaint(); + Insets oldMargin = this.margin; + this.margin = margin; + firePropertyChange("margin", oldMargin, this.margin); + revalidate(); + repaint(); } } // setMargin() @@ -612,10 +612,10 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible { if (painted != paintBorder) { - paintBorder = painted; - firePropertyChange("borderPainted", ! paintBorder, - paintBorder); - repaint(); + paintBorder = painted; + firePropertyChange("borderPainted", ! paintBorder, + paintBorder); + repaint(); } } // setBorderPainted() @@ -639,8 +639,8 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible { if (floatable != this.floatable) { - this.floatable = floatable; - firePropertyChange("floatable", ! floatable, floatable); + this.floatable = floatable; + firePropertyChange("floatable", ! floatable, floatable); } } // setFloatable() @@ -681,11 +681,11 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible + " is not a legal orientation"); if (orientation != this.orientation) { - int oldOrientation = this.orientation; - this.orientation = orientation; - firePropertyChange("orientation", oldOrientation, this.orientation); - revalidate(); - repaint(); + int oldOrientation = this.orientation; + this.orientation = orientation; + firePropertyChange("orientation", oldOrientation, this.orientation); + revalidate(); + repaint(); } } // setOrientation() @@ -760,7 +760,7 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible /** * Returns a string describing the attributes for the <code>JToolBar</code> - * component, for use in debugging. The return value is guaranteed to be + * component, for use in debugging. The return value is guaranteed to be * non-<code>null</code>, but the format of the string may vary between * implementations. * |