@Retention(RUNTIME)
@Target(FIELD)
public @interface Margin
In order to add custom borders to a component or to change the border of
a specific component this annotation is used.
Each attribute is used for a different border type. The different attributes and its context of use are described below. The implemented BorderTypes are the following:
EtchedBorderBevelBorderTitledBorderLineBorderCompoundBorderEmptyBorder
JLabel:
@Margin(value = TitledBorder.class, title = "some text") private JLabel label;
- Since:
- 1.0
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.Class<? extends javax.swing.border.Border>value -
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description intbevelTypejava.lang.Class<? extends javax.swing.border.Border>compoundInsideThis value specifies the border type which will be added to the component.java.lang.Class<? extends javax.swing.border.Border>compoundOutsideThis value specifies the border type which will be added to the component.intemptyBottomintemptyLeftintemptyRightintemptyTopintetchedTypeDeclared the used etched border type.java.lang.Stringhighlightjava.lang.StringlineColorRetrieves the color of the border to add.booleanlineRoundedintlineThicknessjava.lang.Stringshadowjava.lang.Stringtitle
-
Element Details
-
value
java.lang.Class<? extends javax.swing.border.Border> value- Returns:
- the actual border type
-
-
-
emptyTop
int emptyTop- Returns:
- The top inset of the border.
- Default:
- -1
-
emptyBottom
int emptyBottom- Returns:
- The bottom inset of the border.
- Default:
- -1
-
emptyLeft
int emptyLeft- Returns:
- The left inset of the border.
- Default:
- -1
-
emptyRight
int emptyRight- Returns:
- The right inset of the border.
- Default:
- -1
-
title
java.lang.String title- Returns:
- The title the border should display.
- Default:
- ""
-
bevelType
int bevelType- Returns:
- The bevel type.
- Default:
- -1
-
highlight
java.lang.String highlight- Returns:
- The color to use for the highlight.
- Default:
- ""
-
shadow
java.lang.String shadow- Returns:
- The color to use for the shadow.
- Default:
- ""
-
lineColor
java.lang.String lineColorRetrieves the color of the border to add. Yet, only color names are accepted. If no color is found to that name, no action will be taken.- Returns:
- Color of the border.
- Default:
- ""
-
lineThickness
int lineThickness- Returns:
- Thickness of the border.
- Default:
- -1
-
lineRounded
boolean lineRounded- Returns:
- Whether the border has rounded corners.
- Default:
- false
-
compoundInside
java.lang.Class<? extends javax.swing.border.Border> compoundInsideThis value specifies the border type which will be added to the component.- Returns:
- the inside compound border
- Default:
- javax.swing.border.Border.class
-
compoundOutside
java.lang.Class<? extends javax.swing.border.Border> compoundOutsideThis value specifies the border type which will be added to the component.- Returns:
- the outside compound border
- Default:
- javax.swing.border.Border.class
-
etchedType
int etchedTypeDeclared the used etched border type.- Returns:
- the
EtchedBorder.getEtchType()value
- Default:
- -1
-