[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] FYI: Reindent javax/swing/plaf/basic
From: |
Mark Wielaard |
Subject: |
[cp-patches] FYI: Reindent javax/swing/plaf/basic |
Date: |
Sun, 01 Aug 2004 00:58:43 +0200 |
To make merging with the libgcj gui branch easier I reindented all
javax/swing/plaf/basic source files as on the branch. No code was
changed.
2004-07-31 Mark Wielaard <address@hidden>
* javax/swing/plaf/basic/BasicArrowButton.java: Reindent.
* javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java: Reindent.
* javax/swing/plaf/basic/BasicInternalFrameUI.java: Reindent.
* javax/swing/plaf/basic/BasicLabelUI.java: Reindent.
* javax/swing/plaf/basic/BasicListUI.java: Reindent.
* javax/swing/plaf/basic/BasicMenuItemUI.java: Reindent.
* javax/swing/plaf/basic/BasicMenuUI.java: Reindent.
* javax/swing/plaf/basic/BasicOptionPaneUI.java: Reindent.
* javax/swing/plaf/basic/BasicPopupMenuUI.java: Reindent.
* javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java: Reindent.
* javax/swing/plaf/basic/BasicRootPaneUI.java: Reindent.
* javax/swing/plaf/basic/BasicScrollBarUI.java: Reindent.
* javax/swing/plaf/basic/BasicScrollPaneUI.java: Reindent.
* javax/swing/plaf/basic/BasicSliderUI.java: Reindent.
* javax/swing/plaf/basic/BasicSplitPaneDivider.java: Reindent.
* javax/swing/plaf/basic/BasicTabbedPaneUI.java: Reindent.
* javax/swing/plaf/basic/BasicTextUI.java: Reindent.
* javax/swing/plaf/basic/BasicToolBarUI.java: Reindent.
Committed.
Index: javax/swing/plaf/basic/BasicArrowButton.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicArrowButton.java,v
retrieving revision 1.3
diff -u -r1.3 BasicArrowButton.java
--- javax/swing/plaf/basic/BasicArrowButton.java 22 Jul 2004 19:45:39
-0000 1.3
+++ javax/swing/plaf/basic/BasicArrowButton.java 31 Jul 2004 22:55:58
-0000
@@ -171,7 +171,7 @@
/** The top and left edges of the button. */
private transient Color highlight = Color.BLACK;
-
+
/** The border around the ArrowButton. */
private transient Border tmpBorder = new Border()
{
Index: javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java,v
retrieving revision 1.5
diff -u -r1.5 BasicCheckBoxMenuItemUI.java
--- javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java 22 Jul 2004 19:45:39
-0000 1.5
+++ javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java 31 Jul 2004 22:55:58
-0000
@@ -97,7 +97,7 @@
*/
public void processMouseEvent(JMenuItem item, MouseEvent e,
MenuElement[] path,
- MenuSelectionManager manager)
+ MenuSelectionManager manager)
{
}
}
Index: javax/swing/plaf/basic/BasicInternalFrameUI.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java,v
retrieving revision 1.3
diff -u -r1.3 BasicInternalFrameUI.java
--- javax/swing/plaf/basic/BasicInternalFrameUI.java 31 Jul 2004 16:39:15
-0000 1.3
+++ javax/swing/plaf/basic/BasicInternalFrameUI.java 31 Jul 2004 22:55:59
-0000
@@ -828,7 +828,7 @@
if (e instanceof MouseEvent)
{
MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane()
-
.getGlassPane(),
+ .getGlassPane(),
(MouseEvent) e,
frame.getRootPane()
.getGlassPane());
@@ -1109,7 +1109,7 @@
installDefaults();
installListeners();
- installComponents();
+ installComponents();
installKeyboardActions();
frame.setOpaque(true);
@@ -1126,7 +1126,7 @@
public void uninstallUI(JComponent c)
{
uninstallKeyboardActions();
- uninstallComponents();
+ uninstallComponents();
uninstallListeners();
uninstallDefaults();
Index: javax/swing/plaf/basic/BasicLabelUI.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicLabelUI.java,v
retrieving revision 1.9
diff -u -r1.9 BasicLabelUI.java
--- javax/swing/plaf/basic/BasicLabelUI.java 8 Jul 2004 19:26:26 -0000
1.9
+++ javax/swing/plaf/basic/BasicLabelUI.java 31 Jul 2004 22:55:59 -0000
@@ -176,12 +176,12 @@
if (icon != null)
icon.paintIcon(b, g, ir.x, ir.y);
if (text != null && ! text.equals(""))
- {
- if (b.isEnabled())
- paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent());
- else
- paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent());
- }
+ {
+ if (b.isEnabled())
+ paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent());
+ else
+ paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent());
+ }
g.setFont(saved_font);
}
Index: javax/swing/plaf/basic/BasicListUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicListUI.java,v
retrieving revision 1.8
diff -u -r1.8 BasicListUI.java
--- javax/swing/plaf/basic/BasicListUI.java 22 Jul 2004 19:45:39 -0000
1.8
+++ javax/swing/plaf/basic/BasicListUI.java 31 Jul 2004 22:55:59 -0000
@@ -685,7 +685,7 @@
{
Rectangle bounds = getCellBounds(list, row, row);
if (bounds.intersects(clip))
- paintCell(g, row, bounds, render, model, sel, lead);
+ paintCell(g, row, bounds, render, model, sel, lead);
}
}
Index: javax/swing/plaf/basic/BasicMenuItemUI.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicMenuItemUI.java,v
retrieving revision 1.6
diff -u -r1.6 BasicMenuItemUI.java
--- javax/swing/plaf/basic/BasicMenuItemUI.java 22 Jul 2004 19:45:39 -0000
1.6
+++ javax/swing/plaf/basic/BasicMenuItemUI.java 31 Jul 2004 22:55:59 -0000
@@ -630,9 +630,9 @@
textRect.y
+ fm.getAscent());
else
- BasicGraphicsUtils.drawString(g, text, 0, textRect.x,
- textRect.y + fm.getAscent());
- }
+ BasicGraphicsUtils.drawString(g, text, 0, textRect.x,
+ textRect.y + fm.getAscent());
+ }
}
/**
@@ -771,7 +771,7 @@
FontMetrics fm = g.getFontMetrics(acceleratorFont);
if (menuItem.isEnabled())
- g.setColor(acceleratorForeground);
+ g.setColor(acceleratorForeground);
else
// FIXME: should fix this to use 'disabledForeground', but its
// default value in BasicLookAndFeel is null.
Index: javax/swing/plaf/basic/BasicMenuUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicMenuUI.java,v
retrieving revision 1.4
diff -u -r1.4 BasicMenuUI.java
--- javax/swing/plaf/basic/BasicMenuUI.java 22 Jul 2004 19:45:39 -0000
1.4
+++ javax/swing/plaf/basic/BasicMenuUI.java 31 Jul 2004 22:55:59 -0000
@@ -309,7 +309,7 @@
if (i) if this menu is a submenu in some other menu
(ii) or if this menu is in a menu bar and some other menu in a menu
bar was just
selected. (If nothing was selected, menu should be pressed
before
- it will be selected)
+ it will be selected)
*/
JMenu menu = (JMenu) menuItem;
if (! menu.isTopLevelMenu()
@@ -338,15 +338,15 @@
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
JMenu menu = (JMenu) menuItem;
manager.processMouseEvent(e);
-
+
// Menu should be displayed when the menu is pressed only if
// it is top-level menu
if (menu.isTopLevelMenu())
{
if (menu.getPopupMenu().isVisible())
- // If menu is visible and menu button was pressed..
- // then need to cancel the menu
- manager.clearSelectedPath();
+ // If menu is visible and menu button was pressed..
+ // then need to cancel the menu
+ manager.clearSelectedPath();
else
{
// Display the menu
Index: javax/swing/plaf/basic/BasicOptionPaneUI.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicOptionPaneUI.java,v
retrieving revision 1.9
diff -u -r1.9 BasicOptionPaneUI.java
--- javax/swing/plaf/basic/BasicOptionPaneUI.java 22 Jul 2004 19:45:39
-0000 1.9
+++ javax/swing/plaf/basic/BasicOptionPaneUI.java 31 Jul 2004 22:55:59
-0000
@@ -850,17 +850,17 @@
addIcon(messageArea);
JPanel rightSide = new JPanel()
- {
- public Dimension getPreferredSize()
- {
+ {
+ public Dimension getPreferredSize()
+ {
int w = Math.max(optionPane.getSize().width, minimumWidth);
- Insets i = optionPane.getInsets();
- Dimension orig = super.getPreferredSize();
- Dimension value = new Dimension(w - i.left - i.right - iconSize,
- orig.height);
- return value;
- }
- };
+ Insets i = optionPane.getInsets();
+ Dimension orig = super.getPreferredSize();
+ Dimension value = new Dimension(w - i.left - i.right - iconSize,
+ orig.height);
+ return value;
+ }
+ };
rightSide.setLayout(new GridBagLayout());
GridBagConstraints con = createConstraints();
Index: javax/swing/plaf/basic/BasicPopupMenuUI.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicPopupMenuUI.java,v
retrieving revision 1.3
diff -u -r1.3 BasicPopupMenuUI.java
--- javax/swing/plaf/basic/BasicPopupMenuUI.java 22 Jul 2004 19:45:39
-0000 1.3
+++ javax/swing/plaf/basic/BasicPopupMenuUI.java 31 Jul 2004 22:55:59
-0000
@@ -229,11 +229,11 @@
/**
* This method returns the minimum size of the JPopupMenu.
- *
+ *
* @param c The JComponent to find a size for.
- *
+ *
* @return The minimum size.
- */
+ */
public Dimension getMinimumSize(JComponent c)
{
return null;
Index: javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java,v
retrieving revision 1.5
diff -u -r1.5 BasicRadioButtonMenuItemUI.java
--- javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java 22 Jul 2004
19:45:39 -0000 1.5
+++ javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java 31 Jul 2004
22:55:59 -0000
@@ -65,11 +65,11 @@
/**
* Factory method to create a BasicRadioButtonMenuItemUI for the given
address@hidden
* JComponent}, which should be a JRadioButtonMenuItem.
- *
+ *
* @param b The address@hidden JComponent} a UI is being created for.
- *
+ *
* @return A BasicRadioButtonMenuItemUI for the address@hidden JComponent}.
- */
+ */
public static ComponentUI createUI(JComponent b)
{
return new BasicRadioButtonMenuItemUI();
@@ -95,7 +95,7 @@
*/
public void processMouseEvent(JMenuItem item, MouseEvent e,
MenuElement[] path,
- MenuSelectionManager manager)
+ MenuSelectionManager manager)
{
}
}
Index: javax/swing/plaf/basic/BasicRootPaneUI.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicRootPaneUI.java,v
retrieving revision 1.4
diff -u -r1.4 BasicRootPaneUI.java
--- javax/swing/plaf/basic/BasicRootPaneUI.java 22 Jul 2004 19:45:39 -0000
1.4
+++ javax/swing/plaf/basic/BasicRootPaneUI.java 31 Jul 2004 22:55:59 -0000
@@ -49,17 +49,17 @@
public class BasicRootPaneUI extends RootPaneUI
implements PropertyChangeListener
{
- public static ComponentUI createUI(JComponent x)
- {
- return new BasicRootPaneUI();
- }
+ public static ComponentUI createUI(JComponent x)
+ {
+ return new BasicRootPaneUI();
+ }
- public void installUI(JComponent c)
- {
- c.setOpaque(true);
+ public void installUI(JComponent c)
+ {
+ c.setOpaque(true);
c.setBackground(UIManager.getColor("control"));
- super.installUI(c);
- }
+ super.installUI(c);
+ }
public void propertyChange(PropertyChangeEvent event)
{
Index: javax/swing/plaf/basic/BasicScrollBarUI.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java,v
retrieving revision 1.6
diff -u -r1.6 BasicScrollBarUI.java
--- javax/swing/plaf/basic/BasicScrollBarUI.java 22 Jul 2004 19:45:39
-0000 1.6
+++ javax/swing/plaf/basic/BasicScrollBarUI.java 31 Jul 2004 22:55:59
-0000
@@ -534,18 +534,18 @@
/** The Icon that points up. */
private static Icon upIcon = new arrowIcon(new Polygon(new int[] { 2, 5, 8 },
- new int[] { 7, 3,
7 },
- 3));
+ new int[] { 7, 3, 7 },
+ 3));
/** The Icon that points down. */
private static Icon downIcon = new arrowIcon(new Polygon(new int[] { 2, 5, 8
},
- new int[] { 3,
7, 3 },
- 3));
+ new int[] { 3, 7, 3
},
+ 3));
/** The Icon that points left. */
private static Icon leftIcon = new arrowIcon(new Polygon(new int[] { 7, 3, 7
},
- new int[] { 2,
5, 8 },
- 3));
+ new int[] { 2, 5, 8
},
+ 3));
/** The Icon that points right. */
private static Icon rightIcon = new arrowIcon(new Polygon(new int[] { 3, 7,
3},
@@ -602,7 +602,7 @@
{
if (incrButton == null)
{
- incrButton = new JButton();
+ incrButton = new JButton();
incrButton.setMargin(new Insets(0,0,0,0));
incrButton.setHorizontalAlignment(SwingConstants.CENTER);
incrButton.setHorizontalTextPosition(SwingConstants.CENTER);
@@ -630,7 +630,7 @@
{
if (decrButton == null)
{
- decrButton = new JButton();
+ decrButton = new JButton();
decrButton.setMargin(new Insets(0,0,0,0));
decrButton.setHorizontalAlignment(SwingConstants.CENTER);
decrButton.setHorizontalTextPosition(SwingConstants.CENTER);
Index: javax/swing/plaf/basic/BasicScrollPaneUI.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java,v
retrieving revision 1.7
diff -u -r1.7 BasicScrollPaneUI.java
--- javax/swing/plaf/basic/BasicScrollPaneUI.java 22 Jul 2004 19:45:39
-0000 1.7
+++ javax/swing/plaf/basic/BasicScrollPaneUI.java 31 Jul 2004 22:55:59
-0000
@@ -53,11 +53,11 @@
public class BasicScrollPaneUI extends ScrollPaneUI
implements ScrollPaneConstants
{
-
- public static ComponentUI createUI(final JComponent c)
- {
- return new BasicScrollPaneUI();
- }
+
+ public static ComponentUI createUI(final JComponent c)
+ {
+ return new BasicScrollPaneUI();
+ }
protected void installDefaults(JScrollPane p)
{
@@ -77,9 +77,9 @@
p.setBorder(null);
}
- public void installUI(final JComponent c)
- {
- super.installUI(c);
+ public void installUI(final JComponent c)
+ {
+ super.installUI(c);
this.installDefaults((JScrollPane)c);
}
@@ -87,29 +87,29 @@
{
super.uninstallUI(c);
this.uninstallDefaults((JScrollPane)c);
- }
-
+ }
+
- public Dimension getMinimumSize(JComponent c)
- {
- JScrollPane p = (JScrollPane ) c;
- ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
- return sl.minimumLayoutSize(c);
- }
-
- public Dimension getPreferredSize(JComponent c)
- {
- JScrollPane p = (JScrollPane ) c;
- ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
- return sl.preferredLayoutSize(c);
- }
-
-
- public void paint(Graphics g, JComponent c)
- {
- // do nothing; the normal painting-of-children algorithm, along with
- // ScrollPaneLayout, does all the relevant work.
- }
+ public Dimension getMinimumSize(JComponent c)
+ {
+ JScrollPane p = (JScrollPane ) c;
+ ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
+ return sl.minimumLayoutSize(c);
+ }
+
+ public Dimension getPreferredSize(JComponent c)
+ {
+ JScrollPane p = (JScrollPane ) c;
+ ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
+ return sl.preferredLayoutSize(c);
+ }
+
+
+ public void paint(Graphics g, JComponent c)
+ {
+ // do nothing; the normal painting-of-children algorithm, along with
+ // ScrollPaneLayout, does all the relevant work.
+ }
}
Index: javax/swing/plaf/basic/BasicSliderUI.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicSliderUI.java,v
retrieving revision 1.5
diff -u -r1.5 BasicSliderUI.java
--- javax/swing/plaf/basic/BasicSliderUI.java 22 Jul 2004 19:45:39 -0000
1.5
+++ javax/swing/plaf/basic/BasicSliderUI.java 31 Jul 2004 22:55:59 -0000
@@ -224,12 +224,12 @@
if (e.getPropertyName().equals(JSlider.ORIENTATION_CHANGED_PROPERTY))
recalculateIfOrientationChanged();
else if (e.getPropertyName().equals(JSlider.MODEL_CHANGED_PROPERTY))
- {
- BoundedRangeModel oldModel = (BoundedRangeModel) e.getOldValue();
- oldModel.removeChangeListener(changeListener);
- slider.getModel().addChangeListener(changeListener);
- calculateThumbLocation();
- }
+ {
+ BoundedRangeModel oldModel = (BoundedRangeModel) e.getOldValue();
+ oldModel.removeChangeListener(changeListener);
+ slider.getModel().addChangeListener(changeListener);
+ calculateThumbLocation();
+ }
// elif the componentOrientation changes (this is a bound property,
// just undocumented) we change leftToRightCache. In Sun's
@@ -345,15 +345,15 @@
currentMouseX = e.getX();
currentMouseY = e.getY();
if (slider.getValueIsAdjusting())
- {
- int value;
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- value = valueForXPosition(currentMouseX) - offset;
- else
- value = valueForYPosition(currentMouseY) - offset;
-
- slider.setValue(value);
- }
+ {
+ int value;
+ if (slider.getOrientation() == JSlider.HORIZONTAL)
+ value = valueForXPosition(currentMouseX) - offset;
+ else
+ value = valueForYPosition(currentMouseY) - offset;
+
+ slider.setValue(value);
+ }
}
/**
@@ -390,7 +390,7 @@
value = findClosestTick(value);
// If the thumb is hit, then we don't need to set the timers to move it.
- if (!thumbRect.contains(e.getPoint()))
+ if (! thumbRect.contains(e.getPoint()))
{
// The mouse has hit some other part of the slider.
// The value moves no matter where in the slider you hit.
@@ -402,8 +402,8 @@
else
{
slider.setValueIsAdjusting(true);
- offset = value - slider.getValue();
- }
+ offset = value - slider.getValue();
+ }
}
/**
@@ -418,11 +418,11 @@
currentMouseY = e.getY();
if (slider.getValueIsAdjusting())
- {
- slider.setValueIsAdjusting(false);
- if (slider.getSnapToTicks())
- slider.setValue(findClosestTick(slider.getValue()));
- }
+ {
+ slider.setValueIsAdjusting(false);
+ if (slider.getSnapToTicks())
+ slider.setValue(findClosestTick(slider.getValue()));
+ }
if (scrollTimer != null)
scrollTimer.stop();
}
@@ -861,22 +861,22 @@
public Dimension getPreferredHorizontalSize()
{
Insets insets = slider.getInsets();
-
+
// The width should cover all the labels (which are usually the
// deciding factor of the width)
int width = getWidthOfWidestLabel() * (slider.getLabelTable() == null ? 0
:
slider.getLabelTable()
.size());
-
+
// If there are not enough labels.
// This number is pretty much arbitrary, but it looks nice.
if (width < 200)
width = 200;
-
+
// We can only draw inside of the focusRectangle, so we have to
// pad it with insets.
width += insets.left + insets.right + focusInsets.left + focusInsets.right;
-
+
// Height is determined by the thumb, the ticks and the labels.
int height = thumbHeight;
@@ -886,10 +886,10 @@
if (slider.getPaintLabels())
height += getHeightOfTallestLabel();
-
+
height += insets.top + insets.bottom + focusInsets.top
+ focusInsets.bottom;
-
+
return new Dimension(width, height);
}
@@ -902,19 +902,19 @@
public Dimension getPreferredVerticalSize()
{
Insets insets = slider.getInsets();
-
+
int height = getHeightOfTallestLabel() * (slider.getLabelTable() == null
? 0 : slider.getLabelTable()
.size());
-
+
if (height < 200)
height = 200;
-
+
height += insets.top + insets.bottom + focusInsets.top
+ focusInsets.bottom;
int width = thumbHeight;
-
+
if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0
|| slider.getMinorTickSpacing() > 0)
width += tickHeight;
@@ -923,7 +923,7 @@
width += getWidthOfWidestLabel();
width += insets.left + insets.right + focusInsets.left + focusInsets.right;
-
+
return new Dimension(width, height);
}
@@ -959,7 +959,7 @@
* @return The dimensions of the preferred size.
*/
public Dimension getPreferredSize(JComponent c)
- {
+ {
if (slider.getOrientation() == JSlider.HORIZONTAL)
return getPreferredHorizontalSize();
else
@@ -999,22 +999,22 @@
else
return getPreferredVerticalSize();
}
-
+
/**
* This method calculates all the sizes of the rectangles by delegating to
* the helper methods calculateXXXRect.
*/
- protected void calculateGeometry()
- {
- calculateFocusRect();
- calculateContentRect();
- calculateThumbSize();
- calculateTrackBuffer();
- calculateTrackRect();
- calculateTickRect();
- calculateLabelRect();
- calculateThumbLocation();
- }
+ protected void calculateGeometry()
+ {
+ calculateFocusRect();
+ calculateContentRect();
+ calculateThumbSize();
+ calculateTrackBuffer();
+ calculateTrackRect();
+ calculateTickRect();
+ calculateLabelRect();
+ calculateThumbLocation();
+ }
/**
* This method calculates the size and position of the focusRect. This
@@ -1408,7 +1408,7 @@
leftToRightCache = slider.getComponentOrientation() !=
ComponentOrientation.RIGHT_TO_LEFT;
// FIXME: This next line is only here because the above line is here.
calculateThumbLocation();
-
+
if (slider.getPaintTrack())
paintTrack(g);
if (slider.getPaintTicks())
@@ -1569,8 +1569,8 @@
{
double loc = tickRect.x;
double increment = (max == min) ? 0
- : majorSpace * (double) tickRect.width
/ (max
- - min);
+ : majorSpace * (double)
tickRect.width / (max
+ - min);
if (drawInverted())
{
loc += tickRect.width;
@@ -1586,8 +1586,8 @@
{
double loc = tickRect.height + tickRect.y;
double increment = (max == min) ? 0
- : -majorSpace * (double)
tickRect.height / (max
- - min);
+ : -majorSpace * (double)
tickRect.height / (max
+ - min);
if (drawInverted())
{
loc = tickRect.y;
@@ -1606,8 +1606,8 @@
{
double loc = tickRect.x;
double increment = (max == min) ? 0
- : minorSpace * (double) tickRect.width
/ (max
- - min);
+ : minorSpace * (double)
tickRect.width / (max
+ - min);
if (drawInverted())
{
loc += tickRect.width;
@@ -1623,8 +1623,8 @@
{
double loc = tickRect.height + tickRect.y;
double increment = (max == min) ? 0
- : -minorSpace * (double)
tickRect.height / (max
- - min);
+ : -minorSpace * (double)
tickRect.height / (max
+ - min);
if (drawInverted())
{
loc = tickRect.y;
@@ -1796,13 +1796,13 @@
Dimension dim = label.getPreferredSize();
int w = (int) dim.getWidth();
int h = (int) dim.getHeight();
-
+
int max = slider.getMaximum();
int min = slider.getMinimum();
if (value > max || value < min)
return;
-
+
// value
// |
// ------------
@@ -2023,7 +2023,7 @@
protected void scrollDueToClickInTrack(int dir)
{
scrollTimer.stop();
-
+
scrollListener.setDirection(dir);
scrollListener.setScrollByBlock(true);
Index: javax/swing/plaf/basic/BasicSplitPaneDivider.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicSplitPaneDivider.java,v
retrieving revision 1.3
diff -u -r1.3 BasicSplitPaneDivider.java
--- javax/swing/plaf/basic/BasicSplitPaneDivider.java 22 Jul 2004 19:45:39
-0000 1.3
+++ javax/swing/plaf/basic/BasicSplitPaneDivider.java 31 Jul 2004 22:55:59
-0000
@@ -156,7 +156,7 @@
/** Keeps track of where the divider should be placed when using one touch
expand
* buttons. */
private transient int currentDividerLocation = 1;
-
+
private transient Border tmpBorder = new Border()
{
public Insets getBorderInsets(Component c)
Index: javax/swing/plaf/basic/BasicTabbedPaneUI.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java,v
retrieving revision 1.9
diff -u -r1.9 BasicTabbedPaneUI.java
--- javax/swing/plaf/basic/BasicTabbedPaneUI.java 22 Jul 2004 19:45:39
-0000 1.9
+++ javax/swing/plaf/basic/BasicTabbedPaneUI.java 31 Jul 2004 22:56:00
-0000
@@ -1162,8 +1162,7 @@
* This is a helper class that implements UIResource so it is not added as a
* tab when an object of this class is added to the JTabbedPane.
*/
- private static class ScrollingButton extends BasicArrowButton
- implements UIResource
+ private class ScrollingButton extends BasicArrowButton implements UIResource
{
/**
* Creates a ScrollingButton given the direction.
Index: javax/swing/plaf/basic/BasicTextUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTextUI.java,v
retrieving revision 1.9
diff -u -r1.9 BasicTextUI.java
--- javax/swing/plaf/basic/BasicTextUI.java 22 Jul 2004 19:45:39 -0000
1.9
+++ javax/swing/plaf/basic/BasicTextUI.java 31 Jul 2004 22:56:00 -0000
@@ -85,21 +85,21 @@
{
}
}
-
+
private class RootView extends View
{
private JTextComponent textComponent;
private View view;
public RootView(JTextComponent parent)
- {
- super(null);
+ {
+ super(null);
textComponent = parent;
- }
+ }
public void setView(View v)
- {
- if (view != null)
+ {
+ if (view != null)
view.setParent(null);
if (v != null)
@@ -109,17 +109,17 @@
}
public Container getContainer()
- {
+ {
return textComponent;
}
-
+
public float getPreferredSpan(int axis)
{
if (view != null)
return view.getPreferredSpan(axis);
return Integer.MAX_VALUE;
- }
+ }
public void paint(Graphics g, Shape s)
{
@@ -127,7 +127,7 @@
if (view != null)
view.paint(g, s);
- }
+ }
}
RootView rootView;
@@ -153,7 +153,7 @@
{
return textComponent;
}
-
+
public void installUI(final JComponent c)
{
super.installUI(c);
@@ -166,8 +166,8 @@
{
doc = new PlainDocument();
textComponent.setDocument(doc);
- }
-
+ }
+
rootView = new RootView(textComponent);
setView(create(doc.getDefaultRootElement()));
@@ -221,7 +221,7 @@
return new Dimension((int) w, (int) h);
}
-
+
public final void paint(Graphics g, JComponent c)
{
paintSafely(g);
Index: javax/swing/plaf/basic/BasicToolBarUI.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicToolBarUI.java,v
retrieving revision 1.2
diff -u -r1.2 BasicToolBarUI.java
--- javax/swing/plaf/basic/BasicToolBarUI.java 22 Jul 2004 19:45:39 -0000
1.2
+++ javax/swing/plaf/basic/BasicToolBarUI.java 31 Jul 2004 22:56:00 -0000
@@ -96,40 +96,40 @@
private static Border rolloverBorder;
/** The last known BorderLayout constraint before floating. */
- protected String constraintBeforeFloating;
+ protected String constraintBeforeFloating;
/** The last known orientation of the JToolBar before floating. */
private int lastGoodOrientation;
/** The color of the border when it is dockable. */
- protected Color dockingBorderColor;
+ protected Color dockingBorderColor;
/** The background color of the JToolBar when it is dockable. */
- protected Color dockingColor;
+ protected Color dockingColor;
/** The docking listener responsible for mouse events on the JToolBar. */
- protected MouseInputListener dockingListener;
+ protected MouseInputListener dockingListener;
/** The window used for dragging the JToolBar. */
- protected BasicToolBarUI.DragWindow dragWindow;
+ protected BasicToolBarUI.DragWindow dragWindow;
/** The color of the border when it is not dockable. */
- protected Color floatingBorderColor;
+ protected Color floatingBorderColor;
/** The background color of the JToolBar when it is not dockable. */
- protected Color floatingColor;
+ protected Color floatingColor;
/** The index of the focused component. */
- protected int focusedCompIndex;
+ protected int focusedCompIndex;
/** The PropertyChangeListener for the JToolBar. */
- protected PropertyChangeListener propertyListener;
+ protected PropertyChangeListener propertyListener;
/** The JToolBar this UI delegate is responsible for. */
- protected JToolBar toolBar;
+ protected JToolBar toolBar;
/** The Container listener for the JToolBar. */
- protected ContainerListener toolBarContListener;
+ protected ContainerListener toolBarContListener;
/** The Focus listener for the JToolBar. */
protected FocusListener toolBarFocusListener;
@@ -161,9 +161,9 @@
* @param b The JToolBar to represent with this UI.
*/
public BasicToolBarUI(JToolBar b)
- {
- super();
- }
+ {
+ super();
+ }
/**
* This method returns whether the JToolBar can dock at the given position.
@@ -175,12 +175,12 @@
* @return Whether the JToolBar can dock.
*/
protected boolean canDock(Component c, Point p)
- {
+ {
if (areaOfClick(c, p) != -1)
return true;
- return false;
- }
+ return false;
+ }
/**
* This helper method returns the position of the JToolBar if it can dock.
@@ -225,10 +225,10 @@
*
* @return A new DockingListener for the JToolBar.
*/
- protected MouseInputListener createDockingListener()
- {
+ protected MouseInputListener createDockingListener()
+ {
return new DockingListener(toolBar);
- }
+ }
/**
* This method creates a new DragWindow for the given JToolBar.
@@ -237,10 +237,10 @@
*
* @return A new DragWindow.
*/
- protected BasicToolBarUI.DragWindow createDragWindow(JToolBar toolbar)
- {
+ protected BasicToolBarUI.DragWindow createDragWindow(JToolBar toolbar)
+ {
return new DragWindow();
- }
+ }
/**
* This method creates a new floating frame for the JToolBar. By default,
@@ -251,11 +251,11 @@
*
* @return A new floating frame.
*/
- protected JFrame createFloatingFrame(JToolBar toolbar)
- {
+ protected JFrame createFloatingFrame(JToolBar toolbar)
+ {
// FIXME: Though deprecated, this should still work.
- return null;
- }
+ return null;
+ }
/**
* This method creates a new floating window for the JToolBar. This is the
@@ -265,21 +265,21 @@
*
* @return A new floating window.
*/
- protected RootPaneContainer createFloatingWindow(JToolBar toolbar)
- {
+ protected RootPaneContainer createFloatingWindow(JToolBar toolbar)
+ {
// This one is used by default though.
return new ToolBarDialog();
- }
+ }
/**
* This method creates a new WindowListener for the JToolBar.
*
* @return A new WindowListener.
*/
- protected WindowListener createFrameListener()
- {
+ protected WindowListener createFrameListener()
+ {
return new FrameListener();
- }
+ }
/**
* This method creates a new nonRolloverBorder for JButtons when the
@@ -287,20 +287,20 @@
*
* @return A new NonRolloverBorder.
*/
- protected Border createNonRolloverBorder()
- {
+ protected Border createNonRolloverBorder()
+ {
return new EtchedBorderUIResource();
- }
+ }
/**
* This method creates a new PropertyChangeListener for the JToolBar.
*
* @return A new PropertyChangeListener.
*/
- protected PropertyChangeListener createPropertyListener()
- {
+ protected PropertyChangeListener createPropertyListener()
+ {
return new PropertyListener();
- }
+ }
/**
* This method creates a new rollover border for JButtons when the
@@ -308,8 +308,8 @@
*
* @return A new rollover border.
*/
- protected Border createRolloverBorder()
- {
+ protected Border createRolloverBorder()
+ {
return new EtchedBorderUIResource()
{
public void paintBorder(Component c, Graphics g, int x, int y,
@@ -322,27 +322,27 @@
}
}
};
- }
+ }
/**
* This method creates a new Container listener for the JToolBar.
*
* @return A new Container listener.
*/
- protected ContainerListener createToolBarContListener()
- {
+ protected ContainerListener createToolBarContListener()
+ {
return new ToolBarContListener();
- }
+ }
/**
* This method creates a new FocusListener for the JToolBar.
*
* @return A new FocusListener for the JToolBar.
*/
- protected FocusListener createToolBarFocusListener()
- {
+ protected FocusListener createToolBarFocusListener()
+ {
return new ToolBarFocusListener();
- }
+ }
/**
* This method creates a new UI delegate for the given JComponent.
@@ -351,10 +351,10 @@
*
* @return A new UI delegate.
*/
- public static ComponentUI createUI(JComponent c)
- {
- return new BasicToolBarUI((JToolBar) c);
- }
+ public static ComponentUI createUI(JComponent c)
+ {
+ return new BasicToolBarUI((JToolBar) c);
+ }
/**
* This method is called to drag the DragWindow around when the JToolBar is
@@ -363,8 +363,8 @@
* @param position The mouse cursor coordinates relative to the JToolBar.
* @param origin The screen position of the JToolBar.
*/
- protected void dragTo(Point position, Point origin)
- {
+ protected void dragTo(Point position, Point origin)
+ {
int loc = areaOfClick(origParent,
SwingUtilities.convertPoint(toolBar, position,
origParent));
@@ -396,7 +396,7 @@
{
w = cachedBounds.height;
h = cachedBounds.width;
- }
+ }
Point p = dragWindow.getOffset();
Insets insets = toolBar.getInsets();
@@ -420,8 +420,8 @@
* @param origin The screen position of the JToolBar before the drag session
* started.
*/
- protected void floatAt(Point position, Point origin)
- {
+ protected void floatAt(Point position, Point origin)
+ {
Point p = new Point(position);
int aoc = areaOfClick(origParent,
SwingUtilities.convertPoint(toolBar, p, origParent));
@@ -440,7 +440,7 @@
{
floatFrame.hide();
newParent = origParent;
- }
+ }
String constraint;
switch (aoc)
@@ -505,9 +505,9 @@
* @return The docking color.
*/
public Color getDockingColor()
- {
- return dockingColor;
- }
+ {
+ return dockingColor;
+ }
/**
* This method returns the Color which is displayed when over a floating
@@ -516,9 +516,9 @@
* @return The color which is displayed when over a floating area.
*/
public Color getFloatingColor()
- {
- return floatingColor;
- }
+ {
+ return floatingColor;
+ }
/**
* This method returns the maximum size of the given JComponent for this UI.
@@ -528,9 +528,9 @@
* @return The maximum size for this UI.
*/
public Dimension getMaximumSize(JComponent c)
- {
+ {
return getPreferredSize(c);
- }
+ }
/**
* This method returns the minimum size of the given JComponent for this UI.
@@ -540,9 +540,9 @@
* @return The minimum size for this UI.
*/
public Dimension getMinimumSize(JComponent c)
- {
+ {
return getPreferredSize(c);
- }
+ }
/**
* This method returns the preferred size of the given JComponent for this
@@ -553,15 +553,15 @@
* @return The preferred size for this UI.
*/
public Dimension getPreferredSize(JComponent c)
- {
+ {
return toolBar.getLayout().preferredLayoutSize(c);
- }
+ }
/**
* This method installs the needed components for the JToolBar.
*/
- protected void installComponents()
- {
+ protected void installComponents()
+ {
floatFrame = (Window) createFloatingWindow(toolBar);
dragWindow = createDragWindow(toolBar);
@@ -575,13 +575,13 @@
borders = new Hashtable();
fillHashtable();
- }
+ }
/**
* This method installs the defaults as specified by the look and feel.
*/
- protected void installDefaults()
- {
+ protected void installDefaults()
+ {
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
toolBar.setBorder(new ToolBarBorder());
@@ -594,24 +594,24 @@
floatingBorderColor = defaults.getColor("ToolBar.floatingForeground");
floatingColor = defaults.getColor("ToolBar.floatingBackground");
- }
+ }
/**
* This method installs the keyboard actions for the JToolBar as specified
* by the look and feel.
*/
- protected void installKeyboardActions()
- {
+ protected void installKeyboardActions()
+ {
// FIXME: implement.
- }
+ }
/**
* This method installs listeners for the JToolBar.
*
* @param toolbar The JToolBar to register listeners for.
*/
- protected void installListeners(JToolBar toolbar)
- {
+ protected void installListeners(JToolBar toolbar)
+ {
dockingListener = createDockingListener();
toolBar.addMouseListener(dockingListener);
toolBar.addMouseMotionListener(dockingListener);
@@ -636,13 +636,13 @@
* @param c The JComponent whose children need to have non rollover borders
* installed.
*/
- protected void installNonRolloverBorders(JComponent c)
- {
+ protected void installNonRolloverBorders(JComponent c)
+ {
Component[] components = toolBar.getComponents();
for (int i = 0; i < components.length; i++)
setBorderToNonRollover(components[i]);
- }
+ }
/**
* This method installs normal (or their original) borders for each
@@ -651,13 +651,13 @@
* @param c The JComponent whose children need to have their original
* borders installed.
*/
- protected void installNormalBorders(JComponent c)
- {
+ protected void installNormalBorders(JComponent c)
+ {
Component[] components = toolBar.getComponents();
for (int i = 0; i < components.length; i++)
setBorderToNormal(components[i]);
- }
+ }
/**
* This method install rollover borders for each component inside the given
@@ -666,13 +666,13 @@
* @param c The JComponent whose children need to have rollover borders
* installed.
*/
- protected void installRolloverBorders(JComponent c)
- {
+ protected void installRolloverBorders(JComponent c)
+ {
Component[] components = toolBar.getComponents();
for (int i = 0; i < components.length; i++)
setBorderToRollover(components[i]);
- }
+ }
/**
* This method fills the borders hashtable with a list of components that
@@ -700,20 +700,20 @@
*
* @param c The JComponent to install a UI for.
*/
- public void installUI(JComponent c)
- {
- super.installUI(c);
+ public void installUI(JComponent c)
+ {
+ super.installUI(c);
- if (c instanceof JToolBar)
- {
- toolBar = (JToolBar) c;
- toolBar.setOpaque(true);
+ if (c instanceof JToolBar)
+ {
+ toolBar = (JToolBar) c;
+ toolBar.setOpaque(true);
installDefaults();
installComponents();
- installListeners(toolBar);
+ installListeners(toolBar);
installKeyboardActions();
- }
- }
+ }
+ }
/**
* This method returns whether the JToolBar is floating.
@@ -721,9 +721,9 @@
* @return Whether the JToolBar is floating.
*/
public boolean isFloating()
- {
+ {
return floatFrame.isVisible();
- }
+ }
/**
* This method returns whether rollover borders have been set.
@@ -731,9 +731,9 @@
* @return Whether rollover borders have been set.
*/
public boolean isRolloverBorders()
- {
+ {
return toolBar.isRollover();
- }
+ }
/**
* This method navigates in the given direction giving focus to the next
@@ -741,10 +741,10 @@
*
* @param direction The direction to give focus to.
*/
- protected void navigateFocusedComp(int direction)
- {
+ protected void navigateFocusedComp(int direction)
+ {
// FIXME: Implement.
- }
+ }
/**
* This method sets the border of the given component to a non rollover
@@ -752,45 +752,45 @@
*
* @param c The Component whose border needs to be set.
*/
- protected void setBorderToNonRollover(Component c)
- {
+ protected void setBorderToNonRollover(Component c)
+ {
if (c instanceof JButton)
{
JButton b = (JButton) c;
b.setRolloverEnabled(false);
b.setBorder(nonRolloverBorder);
}
- }
+ }
/**
* This method sets the border of the given component to its original value.
*
* @param c The Component whose border needs to be set.
*/
- protected void setBorderToNormal(Component c)
- {
+ protected void setBorderToNormal(Component c)
+ {
if (c instanceof JButton)
{
JButton b = (JButton) c;
Border border = (Border) borders.get(b);
b.setBorder(border);
}
- }
+ }
/**
* This method sets the border of the given component to a rollover border.
*
* @param c The Component whose border needs to be set.
*/
- protected void setBorderToRollover(Component c)
- {
+ protected void setBorderToRollover(Component c)
+ {
if (c instanceof JButton)
{
JButton b = (JButton) c;
b.setRolloverEnabled(true);
b.setBorder(rolloverBorder);
}
- }
+ }
/**
* This method sets the docking color.
@@ -798,9 +798,9 @@
* @param c The docking color.
*/
public void setDockingColor(Color c)
- {
- dockingColor = c;
- }
+ {
+ dockingColor = c;
+ }
/**
* This method sets the floating property for the JToolBar.
@@ -822,9 +822,9 @@
* @param c The floating color.
*/
public void setFloatingColor(Color c)
- {
+ {
floatingColor = c;
- }
+ }
/**
* This method sets the floating location of the JToolBar.
@@ -872,7 +872,7 @@
* This method uninstall UI installed components from the JToolBar.
*/
protected void uninstallComponents()
- {
+ {
installNormalBorders(toolBar);
borders = null;
rolloverBorder = null;
@@ -896,21 +896,21 @@
dockingColor = null;
floatingBorderColor = null;
floatingColor = null;
- }
+ }
/**
* This method uninstalls keyboard actions installed by the UI.
*/
protected void uninstallKeyboardActions()
- {
+ {
// FIXME: implement.
- }
+ }
/**
* This method uninstalls listeners installed by the UI.
*/
protected void uninstallListeners()
- {
+ {
toolBar.removeFocusListener(toolBarFocusListener);
toolBarFocusListener = null;
@@ -923,7 +923,7 @@
toolBar.removeMouseMotionListener(dockingListener);
toolBar.removeMouseListener(dockingListener);
dockingListener = null;
- }
+ }
/**
* This method uninstalls the UI.
@@ -931,7 +931,7 @@
* @param c The JComponent that is having this UI removed.
*/
public void uninstallUI(JComponent c)
- {
+ {
uninstallKeyboardActions();
uninstallListeners();
uninstallComponents();
@@ -1038,7 +1038,7 @@
{
if (e.getX() > insets.left)
return;
- }
+ }
else
{
if (e.getY() > insets.top)
signature.asc
Description: This is a digitally signed message part
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] FYI: Reindent javax/swing/plaf/basic,
Mark Wielaard <=