< prev index next >
src/java.desktop/share/classes/javax/swing/BorderFactory.java
Print this page
@@ -29,13 +29,13 @@
import java.awt.Font;
import java.awt.Paint;
import javax.swing.border.*;
/**
- * Factory class for vending standard <code>Border</code> objects. Wherever
+ * Factory class for vending standard {@code Border} objects. Wherever
* possible, this factory will hand out references to shared
- * <code>Border</code> instances.
+ * {@code Border} instances.
* For further information and examples see
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/border.html">How
to Use Borders</a>,
* a section in <em>The Java Tutorial</em>.
*
@@ -52,12 +52,12 @@
//// LineBorder ///////////////////////////////////////////////////////////////
/**
* Creates a line border withe the specified color.
*
- * @param color a <code>Color</code> to use for the line
- * @return the <code>Border</code> object
+ * @param color a {@code Color} to use for the line
+ * @return the {@code Border} object
*/
public static Border createLineBorder(Color color) {
return new LineBorder(color, 1);
}
@@ -66,13 +66,13 @@
* and width. The width applies to all four sides of the
* border. To specify widths individually for the top,
* bottom, left, and right, use
* {@link #createMatteBorder(int,int,int,int,Color)}.
*
- * @param color a <code>Color</code> to use for the line
+ * @param color a {@code Color} to use for the line
* @param thickness an integer specifying the width in pixels
- * @return the <code>Border</code> object
+ * @return the {@code Border} object
*/
public static Border createLineBorder(Color color, int thickness) {
return new LineBorder(color, thickness);
}
@@ -101,11 +101,11 @@
* brighter shades of the component's current background color
* for highlighting, and darker shading for shadows.
* (In a raised border, highlights are on top and shadows
* are underneath.)
*
- * @return the <code>Border</code> object
+ * @return the {@code Border} object
*/
public static Border createRaisedBevelBorder() {
return createSharedBevel(BevelBorder.RAISED);
}
@@ -114,11 +114,11 @@
* brighter shades of the component's current background color
* for highlighting, and darker shading for shadows.
* (In a lowered border, shadows are on top and highlights
* are underneath.)
*
- * @return the <code>Border</code> object
+ * @return the {@code Border} object
*/
public static Border createLoweredBevelBorder() {
return createSharedBevel(BevelBorder.LOWERED);
}
@@ -128,13 +128,13 @@
* for highlighting, and darker shading for shadows.
* (In a lowered border, shadows are on top and highlights
* are underneath.)
*
* @param type an integer specifying either
- * <code>BevelBorder.LOWERED</code> or
- * <code>BevelBorder.RAISED</code>
- * @return the <code>Border</code> object
+ * {@code BevelBorder.LOWERED} or
+ * {@code BevelBorder.RAISED}
+ * @return the {@code Border} object
*/
public static Border createBevelBorder(int type) {
return createSharedBevel(type);
}
@@ -144,15 +144,15 @@
* edge of the highlighted area uses a brighter shade of
* the highlight color. The inner edge of the shadow area
* uses a brighter shade of the shadow color.
*
* @param type an integer specifying either
- * <code>BevelBorder.LOWERED</code> or
- * <code>BevelBorder.RAISED</code>
- * @param highlight a <code>Color</code> object for highlights
- * @param shadow a <code>Color</code> object for shadows
- * @return the <code>Border</code> object
+ * {@code BevelBorder.LOWERED} or
+ * {@code BevelBorder.RAISED}
+ * @param highlight a {@code Color} object for highlights
+ * @param shadow a {@code Color} object for shadows
+ * @return the {@code Border} object
*/
public static Border createBevelBorder(int type, Color highlight, Color shadow) {
return new BevelBorder(type, highlight, shadow);
}
@@ -160,21 +160,21 @@
* Creates a beveled border of the specified type, using
* the specified colors for the inner and outer highlight
* and shadow areas.
*
* @param type an integer specifying either
- * <code>BevelBorder.LOWERED</code> or
- * <code>BevelBorder.RAISED</code>
- * @param highlightOuter a <code>Color</code> object for the
+ * {@code BevelBorder.LOWERED} or
+ * {@code BevelBorder.RAISED}
+ * @param highlightOuter a {@code Color} object for the
* outer edge of the highlight area
- * @param highlightInner a <code>Color</code> object for the
+ * @param highlightInner a {@code Color} object for the
* inner edge of the highlight area
- * @param shadowOuter a <code>Color</code> object for the
+ * @param shadowOuter a {@code Color} object for the
* outer edge of the shadow area
- * @param shadowInner a <code>Color</code> object for the
+ * @param shadowInner a {@code Color} object for the
* inner edge of the shadow area
- * @return the <code>Border</code> object
+ * @return the {@code Border} object
*/
public static Border createBevelBorder(int type,
Color highlightOuter, Color highlightInner,
Color shadowOuter, Color shadowInner) {
return new BevelBorder(type, highlightOuter, highlightInner,
@@ -304,39 +304,39 @@
/**
* Creates a border with an "etched" look using
* the component's current background color for
* highlighting and shading.
*
- * @return the <code>Border</code> object
+ * @return the {@code Border} object
*/
public static Border createEtchedBorder() {
return sharedEtchedBorder;
}
/**
* Creates a border with an "etched" look using
* the specified highlighting and shading colors.
*
- * @param highlight a <code>Color</code> object for the border highlights
- * @param shadow a <code>Color</code> object for the border shadows
- * @return the <code>Border</code> object
+ * @param highlight a {@code Color} object for the border highlights
+ * @param shadow a {@code Color} object for the border shadows
+ * @return the {@code Border} object
*/
public static Border createEtchedBorder(Color highlight, Color shadow) {
return new EtchedBorder(highlight, shadow);
}
/**
* Creates a border with an "etched" look using
* the component's current background color for
* highlighting and shading.
*
- * @param type one of <code>EtchedBorder.RAISED</code>, or
- * <code>EtchedBorder.LOWERED</code>
- * @return the <code>Border</code> object
+ * @param type one of {@code EtchedBorder.RAISED}, or
+ * {@code EtchedBorder.LOWERED}
+ * @return the {@code Border} object
* @exception IllegalArgumentException if type is not either
- * <code>EtchedBorder.RAISED</code> or
- * <code>EtchedBorder.LOWERED</code>
+ * {@code EtchedBorder.RAISED} or
+ * {@code EtchedBorder.LOWERED}
* @since 1.3
*/
public static Border createEtchedBorder(int type) {
switch (type) {
case EtchedBorder.RAISED:
@@ -354,15 +354,15 @@
/**
* Creates a border with an "etched" look using
* the specified highlighting and shading colors.
*
- * @param type one of <code>EtchedBorder.RAISED</code>, or
- * <code>EtchedBorder.LOWERED</code>
- * @param highlight a <code>Color</code> object for the border highlights
- * @param shadow a <code>Color</code> object for the border shadows
- * @return the <code>Border</code> object
+ * @param type one of {@code EtchedBorder.RAISED}, or
+ * {@code EtchedBorder.LOWERED}
+ * @param highlight a {@code Color} object for the border highlights
+ * @param shadow a {@code Color} object for the border shadows
+ * @return the {@code Border} object
* @since 1.3
*/
public static Border createEtchedBorder(int type, Color highlight,
Color shadow) {
return new EtchedBorder(type, highlight, shadow);
@@ -374,12 +374,12 @@
* the default border type (determined by the current look and feel),
* the default text position (determined by the current look and feel),
* the default justification (leading), and the default
* font and text color (determined by the current look and feel).
*
- * @param title a <code>String</code> containing the text of the title
- * @return the <code>TitledBorder</code> object
+ * @param title a {@code String} containing the text of the title
+ * @return the {@code TitledBorder} object
*/
public static TitledBorder createTitledBorder(String title) {
return new TitledBorder(title);
}
@@ -388,14 +388,14 @@
* the specified border object,
* the default text position (determined by the current look and feel),
* the default justification (leading), and the default
* font and text color (determined by the current look and feel).
*
- * @param border the <code>Border</code> object to add the title to; if
- * <code>null</code> the <code>Border</code> is determined
+ * @param border the {@code Border} object to add the title to; if
+ * {@code null} the {@code Border} is determined
* by the current look and feel.
- * @return the <code>TitledBorder</code> object
+ * @return the {@code TitledBorder} object
*/
public static TitledBorder createTitledBorder(Border border) {
return new TitledBorder(border);
}
@@ -403,13 +403,13 @@
* Adds a title to an existing border,
* with default positioning (determined by the current look and feel),
* default justification (leading) and the default
* font and text color (determined by the current look and feel).
*
- * @param border the <code>Border</code> object to add the title to
- * @param title a <code>String</code> containing the text of the title
- * @return the <code>TitledBorder</code> object
+ * @param border the {@code Border} object to add the title to
+ * @param title a {@code String} containing the text of the title
+ * @return the {@code TitledBorder} object
*/
public static TitledBorder createTitledBorder(Border border,
String title) {
return new TitledBorder(border, title);
}
@@ -417,35 +417,35 @@
/**
* Adds a title to an existing border, with the specified
* positioning and using the default
* font and text color (determined by the current look and feel).
*
- * @param border the <code>Border</code> object to add the title to
- * @param title a <code>String</code> containing the text of the title
+ * @param border the {@code Border} object to add the title to
+ * @param title a {@code String} containing the text of the title
* @param titleJustification an integer specifying the justification
* of the title -- one of the following:
*<ul>
- *<li><code>TitledBorder.LEFT</code>
- *<li><code>TitledBorder.CENTER</code>
- *<li><code>TitledBorder.RIGHT</code>
- *<li><code>TitledBorder.LEADING</code>
- *<li><code>TitledBorder.TRAILING</code>
- *<li><code>TitledBorder.DEFAULT_JUSTIFICATION</code> (leading)
+ *<li>{@code TitledBorder.LEFT}
+ *<li>{@code TitledBorder.CENTER}
+ *<li>{@code TitledBorder.RIGHT}
+ *<li>{@code TitledBorder.LEADING}
+ *<li>{@code TitledBorder.TRAILING}
+ *<li>{@code TitledBorder.DEFAULT_JUSTIFICATION} (leading)
*</ul>
* @param titlePosition an integer specifying the vertical position of
* the text in relation to the border -- one of the following:
*<ul>
- *<li><code> TitledBorder.ABOVE_TOP</code>
- *<li><code>TitledBorder.TOP</code> (sitting on the top line)
- *<li><code>TitledBorder.BELOW_TOP</code>
- *<li><code>TitledBorder.ABOVE_BOTTOM</code>
- *<li><code>TitledBorder.BOTTOM</code> (sitting on the bottom line)
- *<li><code>TitledBorder.BELOW_BOTTOM</code>
- *<li><code>TitledBorder.DEFAULT_POSITION</code> (the title position
+ *<li>{@code TitledBorder.ABOVE_TOP}
+ *<li>{@code TitledBorder.TOP} (sitting on the top line)
+ *<li>{@code TitledBorder.BELOW_TOP}
+ *<li>{@code TitledBorder.ABOVE_BOTTOM}
+ *<li>{@code TitledBorder.BOTTOM} (sitting on the bottom line)
+ *<li>{@code TitledBorder.BELOW_BOTTOM}
+ *<li>{@code TitledBorder.DEFAULT_POSITION} (the title position
* is determined by the current look and feel)
*</ul>
- * @return the <code>TitledBorder</code> object
+ * @return the {@code TitledBorder} object
*/
public static TitledBorder createTitledBorder(Border border,
String title,
int titleJustification,
int titlePosition) {
@@ -456,32 +456,32 @@
/**
* Adds a title to an existing border, with the specified
* positioning and font, and using the default text color
* (determined by the current look and feel).
*
- * @param border the <code>Border</code> object to add the title to
- * @param title a <code>String</code> containing the text of the title
+ * @param border the {@code Border} object to add the title to
+ * @param title a {@code String} containing the text of the title
* @param titleJustification an integer specifying the justification
* of the title -- one of the following:
*<ul>
- *<li><code>TitledBorder.LEFT</code>
- *<li><code>TitledBorder.CENTER</code>
- *<li><code>TitledBorder.RIGHT</code>
- *<li><code>TitledBorder.LEADING</code>
- *<li><code>TitledBorder.TRAILING</code>
- *<li><code>TitledBorder.DEFAULT_JUSTIFICATION</code> (leading)
+ *<li>{@code TitledBorder.LEFT}
+ *<li>{@code TitledBorder.CENTER}
+ *<li>{@code TitledBorder.RIGHT}
+ *<li>{@code TitledBorder.LEADING}
+ *<li>{@code TitledBorder.TRAILING}
+ *<li>{@code TitledBorder.DEFAULT_JUSTIFICATION} (leading)
*</ul>
* @param titlePosition an integer specifying the vertical position of
* the text in relation to the border -- one of the following:
*<ul>
- *<li><code> TitledBorder.ABOVE_TOP</code>
- *<li><code>TitledBorder.TOP</code> (sitting on the top line)
- *<li><code>TitledBorder.BELOW_TOP</code>
- *<li><code>TitledBorder.ABOVE_BOTTOM</code>
- *<li><code>TitledBorder.BOTTOM</code> (sitting on the bottom line)
- *<li><code>TitledBorder.BELOW_BOTTOM</code>
- *<li><code>TitledBorder.DEFAULT_POSITION</code> (the title position
+ *<li>{@code TitledBorder.ABOVE_TOP}
+ *<li>{@code TitledBorder.TOP} (sitting on the top line)
+ *<li>{@code TitledBorder.BELOW_TOP}
+ *<li>{@code TitledBorder.ABOVE_BOTTOM}
+ *<li>{@code TitledBorder.BOTTOM} (sitting on the bottom line)
+ *<li>{@code TitledBorder.BELOW_BOTTOM}
+ *<li>{@code TitledBorder.DEFAULT_POSITION} (the title position
* is determined by the current look and feel)
*</ul>
* @param titleFont a Font object specifying the title font
* @return the TitledBorder object
*/
@@ -496,37 +496,37 @@
/**
* Adds a title to an existing border, with the specified
* positioning, font and color.
*
- * @param border the <code>Border</code> object to add the title to
- * @param title a <code>String</code> containing the text of the title
+ * @param border the {@code Border} object to add the title to
+ * @param title a {@code String} containing the text of the title
* @param titleJustification an integer specifying the justification
* of the title -- one of the following:
*<ul>
- *<li><code>TitledBorder.LEFT</code>
- *<li><code>TitledBorder.CENTER</code>
- *<li><code>TitledBorder.RIGHT</code>
- *<li><code>TitledBorder.LEADING</code>
- *<li><code>TitledBorder.TRAILING</code>
- *<li><code>TitledBorder.DEFAULT_JUSTIFICATION</code> (leading)
+ *<li>{@code TitledBorder.LEFT}
+ *<li>{@code TitledBorder.CENTER}
+ *<li>{@code TitledBorder.RIGHT}
+ *<li>{@code TitledBorder.LEADING}
+ *<li>{@code TitledBorder.TRAILING}
+ *<li>{@code TitledBorder.DEFAULT_JUSTIFICATION} (leading)
*</ul>
* @param titlePosition an integer specifying the vertical position of
* the text in relation to the border -- one of the following:
*<ul>
- *<li><code> TitledBorder.ABOVE_TOP</code>
- *<li><code>TitledBorder.TOP</code> (sitting on the top line)
- *<li><code>TitledBorder.BELOW_TOP</code>
- *<li><code>TitledBorder.ABOVE_BOTTOM</code>
- *<li><code>TitledBorder.BOTTOM</code> (sitting on the bottom line)
- *<li><code>TitledBorder.BELOW_BOTTOM</code>
- *<li><code>TitledBorder.DEFAULT_POSITION</code> (the title position
+ *<li>{@code TitledBorder.ABOVE_TOP}
+ *<li>{@code TitledBorder.TOP} (sitting on the top line)
+ *<li>{@code TitledBorder.BELOW_TOP}
+ *<li>{@code TitledBorder.ABOVE_BOTTOM}
+ *<li>{@code TitledBorder.BOTTOM} (sitting on the bottom line)
+ *<li>{@code TitledBorder.BELOW_BOTTOM}
+ *<li>{@code TitledBorder.DEFAULT_POSITION} (the title position
* is determined by the current look and feel)
*</ul>
- * @param titleFont a <code>Font</code> object specifying the title font
- * @param titleColor a <code>Color</code> object specifying the title color
- * @return the <code>TitledBorder</code> object
+ * @param titleFont a {@code Font} object specifying the title font
+ * @param titleColor a {@code Color} object specifying the title color
+ * @return the {@code TitledBorder} object
*/
public static TitledBorder createTitledBorder(Border border,
String title,
int titleJustification,
int titlePosition,
@@ -540,11 +540,11 @@
/**
* Creates an empty border that takes up no space. (The width
* of the top, bottom, left, and right sides are all zero.)
*
- * @return the <code>Border</code> object
+ * @return the {@code Border} object
*/
public static Border createEmptyBorder() {
return emptyBorder;
}
@@ -559,37 +559,37 @@
* in pixels
* @param bottom an integer specifying the width of the bottom,
* in pixels
* @param right an integer specifying the width of the right side,
* in pixels
- * @return the <code>Border</code> object
+ * @return the {@code Border} object
*/
public static Border createEmptyBorder(int top, int left,
int bottom, int right) {
return new EmptyBorder(top, left, bottom, right);
}
//// CompoundBorder ////////////////////////////////////////////////////////
/**
- * Creates a compound border with a <code>null</code> inside edge and a
- * <code>null</code> outside edge.
+ * Creates a compound border with a {@code null} inside edge and a
+ * {@code null} outside edge.
*
- * @return the <code>CompoundBorder</code> object
+ * @return the {@code CompoundBorder} object
*/
public static CompoundBorder createCompoundBorder() {
return new CompoundBorder();
}
/**
* Creates a compound border specifying the border objects to use
* for the outside and inside edges.
*
- * @param outsideBorder a <code>Border</code> object for the outer
+ * @param outsideBorder a {@code Border} object for the outer
* edge of the compound border
- * @param insideBorder a <code>Border</code> object for the inner
+ * @param insideBorder a {@code Border} object for the inner
* edge of the compound border
- * @return the <code>CompoundBorder</code> object
+ * @return the {@code CompoundBorder} object
*/
public static CompoundBorder createCompoundBorder(Border outsideBorder,
Border insideBorder) {
return new CompoundBorder(outsideBorder, insideBorder);
}
@@ -606,12 +606,12 @@
* in pixels
* @param bottom an integer specifying the width of the right side,
* in pixels
* @param right an integer specifying the width of the bottom,
* in pixels
- * @param color a <code>Color</code> to use for the border
- * @return the <code>MatteBorder</code> object
+ * @param color a {@code Color} to use for the border
+ * @return the {@code MatteBorder} object
*/
public static MatteBorder createMatteBorder(int top, int left, int bottom, int right,
Color color) {
return new MatteBorder(top, left, bottom, right, color);
}
@@ -630,12 +630,12 @@
* in pixels
* @param bottom an integer specifying the width of the right side,
* in pixels
* @param right an integer specifying the width of the bottom,
* in pixels
- * @param tileIcon the <code>Icon</code> object used for the border tiles
- * @return the <code>MatteBorder</code> object
+ * @param tileIcon the {@code Icon} object used for the border tiles
+ * @return the {@code MatteBorder} object
*/
public static MatteBorder createMatteBorder(int top, int left, int bottom, int right,
Icon tileIcon) {
return new MatteBorder(top, left, bottom, right, tileIcon);
}
< prev index next >