diff options
| author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-10 21:46:48 +0000 |
|---|---|---|
| committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-10 21:46:48 +0000 |
| commit | ce57ab760f69de6db452def7ffbf5b114a2d8694 (patch) | |
| tree | ea38c56431c5d4528fb54254c3f8e50f517bede3 /libjava/classpath/javax/swing/plaf/metal/MetalBorders.java | |
| parent | 50996fe55769882de3f410896032c887f0ff0d04 (diff) | |
| download | ppe42-gcc-ce57ab760f69de6db452def7ffbf5b114a2d8694.tar.gz ppe42-gcc-ce57ab760f69de6db452def7ffbf5b114a2d8694.zip | |
Imported GNU Classpath 0.90
* scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore.
* gnu/classpath/jdwp/VMFrame.java (SIZE): New constant.
* java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5.
* java/lang/Math.java: New override file.
* java/lang/Character.java: Merged from Classpath.
(start, end): Now 'int's.
(canonicalName): New field.
(CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants.
(UnicodeBlock): Added argument.
(of): New overload.
(forName): New method.
Updated unicode blocks.
(sets): Updated.
* sources.am: Regenerated.
* Makefile.in: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111942 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/javax/swing/plaf/metal/MetalBorders.java')
| -rw-r--r-- | libjava/classpath/javax/swing/plaf/metal/MetalBorders.java | 93 |
1 files changed, 45 insertions, 48 deletions
diff --git a/libjava/classpath/javax/swing/plaf/metal/MetalBorders.java b/libjava/classpath/javax/swing/plaf/metal/MetalBorders.java index 28143d51ecd..99c90acdbee 100644 --- a/libjava/classpath/javax/swing/plaf/metal/MetalBorders.java +++ b/libjava/classpath/javax/swing/plaf/metal/MetalBorders.java @@ -1,5 +1,5 @@ /* MetalBorders.java - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -249,30 +249,27 @@ public class MetalBorders /** * Returns the insets of the <code>ButtonBorder</code>. * - * @param c the component for which the border is used + * @param c the component for which the border is used (ignored). * - * @return The insets of the ButtonBorder + * @return The insets of the <code>ButtonBorder</code>. */ public Insets getBorderInsets(Component c) { - return getBorderInsets(c, null); + return borderInsets; } /** * 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 - * @param newInsets the insets object where to put the values (if - * <code>null</code>, a new instance is created). + * @param c the component for which the border is used (ignored). + * @param newInsets the insets object where to put the values ( + * <code>null</code> not permitted). * - * @return The insets. + * @return The <code>newInsets</code> reference. */ public Insets getBorderInsets(Component c, Insets newInsets) { - if (newInsets == null) - newInsets = new Insets(0, 0, 0, 0); - newInsets.bottom = borderInsets.bottom; newInsets.left = borderInsets.left; newInsets.right = borderInsets.right; @@ -352,6 +349,8 @@ public class MetalBorders public static class Flush3DBorder extends AbstractBorder implements UIResource { + private static final Insets borderInsets = new Insets(2, 2, 2, 2); + /** * Creates a new border instance. */ @@ -369,26 +368,25 @@ public class MetalBorders */ public Insets getBorderInsets(Component c) { - return getBorderInsets(c, null); + return borderInsets; } /** * Returns the border insets. * * @param c the component (ignored). - * @return The border insets. + * @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) { - if (newInsets == null) - newInsets = new Insets(2, 2, 2, 2); - else - { - newInsets.top = 2; - newInsets.left = 2; - newInsets.bottom = 2; - newInsets.right = 2; - } + newInsets.top = borderInsets.top; + newInsets.left = borderInsets.left; + newInsets.bottom = borderInsets.bottom; + newInsets.right = borderInsets.right; return newInsets; } @@ -427,6 +425,8 @@ public class MetalBorders public static class PaletteBorder extends AbstractBorder implements UIResource { + private static final Insets borderInsets = new Insets(1, 1, 1, 1); + /** * Creates a new <code>PaletteBorder</code>. */ @@ -444,29 +444,25 @@ public class MetalBorders */ public Insets getBorderInsets(Component c) { - return getBorderInsets(c, null); + return borderInsets; } /** * Returns the border insets. * * @param c the component (ignored). - * @param newInsets the insets object that, if non-<code>null</code>, will - * be populated with the result from this method. - * - * @return The border insets. + * @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) { - if (newInsets == null) - newInsets = new Insets(1, 1, 1, 1); - else - { - newInsets.top = 1; - newInsets.left = 1; - newInsets.bottom = 1; - newInsets.right = 1; - } + newInsets.top = borderInsets.top; + newInsets.left = borderInsets.left; + newInsets.bottom = borderInsets.bottom; + newInsets.right = borderInsets.right; return newInsets; } @@ -555,6 +551,8 @@ public class MetalBorders public static class InternalFrameBorder extends AbstractBorder implements UIResource { + private static final Insets borderInsets = new Insets(5, 5, 5, 5); + /** * Creates a new border instance. */ @@ -572,26 +570,25 @@ public class MetalBorders */ public Insets getBorderInsets(Component c) { - return getBorderInsets(c, null); + return borderInsets; } /** * Returns the border insets. * * @param c the component (ignored). - * @return The border insets. + * @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) { - if (newInsets == null) - newInsets = new Insets(5, 5, 5, 5); - else - { - newInsets.top = 5; - newInsets.left = 5; - newInsets.bottom = 5; - newInsets.right = 5; - } + newInsets.top = borderInsets.top; + newInsets.left = borderInsets.left; + newInsets.bottom = borderInsets.bottom; + newInsets.right = borderInsets.right; return newInsets; } @@ -763,7 +760,7 @@ public class MetalBorders implements UIResource { /** The border insets. */ - protected static Insets borderInsets = new Insets(1, 1, 1, 1); + protected static Insets borderInsets = new Insets(2, 2, 2, 2); /** * Creates a new border instance. |

