summaryrefslogtreecommitdiffstats
path: root/libjava/javax/swing/border/TitledBorder.java
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-05 19:59:44 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-05 19:59:44 +0000
commit5107f34b0539ce8bd2a02cee0e68dc1c141e7bfa (patch)
tree7b433db98b58ac570e11c809d610aa3d39f30cba /libjava/javax/swing/border/TitledBorder.java
parentf11e97df9163b305f33e676b16ba2830261e9f2b (diff)
downloadppe42-gcc-5107f34b0539ce8bd2a02cee0e68dc1c141e7bfa.tar.gz
ppe42-gcc-5107f34b0539ce8bd2a02cee0e68dc1c141e7bfa.zip
2003-06-05 Michael Koch <konqueror@gmx.de>
* javax/swing/border/AbstractBorder.java, javax/swing/border/BevelBorder.java, javax/swing/border/CompoundBorder.java, javax/swing/border/EmptyBorder.java, javax/swing/border/EtchedBorder.java, javax/swing/border/LineBorder.java, javax/swing/border/MatteBorder.java, javax/swing/border/TitledBorder.java: New versions from Classpath. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67507 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/javax/swing/border/TitledBorder.java')
-rw-r--r--libjava/javax/swing/border/TitledBorder.java79
1 files changed, 78 insertions, 1 deletions
diff --git a/libjava/javax/swing/border/TitledBorder.java b/libjava/javax/swing/border/TitledBorder.java
index 5937aa4c0ad..8a16c1a0b79 100644
--- a/libjava/javax/swing/border/TitledBorder.java
+++ b/libjava/javax/swing/border/TitledBorder.java
@@ -35,12 +35,89 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.border;
-import java.awt.*;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Insets;
public class TitledBorder extends AbstractBorder
{
+ public static final int ABOVE_BOTTOM = 4;
+ public static final int ABOVE_TOP = 1;
+ public static final int BELOW_BOTTOM = 6;
+ public static final int BELOW_TOP = 3;
+ public static final int BOTTOM = 5;
+ public static final int CENTER = 2;
+ public static final int DEFAULT_JUSTIFICATION = 0;
+ public static final int DEFAULT_POSITION = 0;
+ public static final int LEADING = 4;
+ public static final int LEFT = 1;
+ public static final int RIGHT = 3;
+ public static final int TOP = 2;
+ public static final int TRAILING = 5;
+
+ protected static final int EDGE_SPACING = 2;
+ protected static final int TEXT_INSET_H = 5;
+ protected static final int TEXT_SPACING = 2;
+
+ protected Border border;
+ protected String title;
+ protected Color titleColor;
+ protected Font titleFont;
+ protected int titleJustification;
+ protected int titlePosition;
+
+ private static Border defaultBorder = new BorderUIRessource ();
+ private static Font defaultFont = new FontUIRessource ("Dialog", BOLD, 12);
+ private static Color defaultColor = new ColorUIRessource (Color.black);
+
+ public TitledBorder (String title)
+ {
+ this (defaultBorder, title, DEFAULT_JUSTIFICATION, DEFAULT_POSITION,
+ defaultFont, defaultColor);
+ }
+
+ public TitledBorder (Border border)
+ {
+ this (border, "", DEFAULT_JUSTIFICATION, DEFAULT_POSITION, defaultFont,
+ defaultColor);
+ }
+
+ public TitledBorder (Border border, String title)
+ {
+ this (border, title, DEFAULT_JUSTIFICATION, DEFAULT_POSITION, defaultFont,
+ defaultColor);
+ }
+
+ public TitledBorder (Border border, String title, int titleJustification,
+ int titlePosition)
+ {
+ this (border, title, titleJustification, titlePosition, defaultFont,
+ defaultColor);
+ }
+
+ public TitledBorder (Border border, String title, int titleJustification,
+ int titlePosition, Font titleFont)
+ {
+ this (border, title, titleJustification, titlePosition, titleFont,
+ defaultColor);
+ }
+
+ public TitledBorder (Border border, String title, int titleJustification,
+ int titlePosition, Font titleFont, Color titleColor)
+ {
+ this.border = border;
+ this.title = title;
+ this.titleJustification = titleJustification;
+ this.titlePosition = titlePosition;
+ this.titleFont = titleFont;
+ this.titleColor = titleColor;
+ }
public Insets getBorderInsets(Component c,
Insets s)
OpenPOWER on IntegriCloud