Package org.pushingpixels.substance.api
Enum SubstanceSlices.FocusKind
- java.lang.Object
-
- java.lang.Enum<SubstanceSlices.FocusKind>
-
- org.pushingpixels.substance.api.SubstanceSlices.FocusKind
-
- Enclosing class:
- SubstanceSlices
public static enum SubstanceSlices.FocusKind extends java.lang.Enum<SubstanceSlices.FocusKind>
Enumerates focus indication kinds.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALLFocus indication around the whole component.ALL_INNERFocus indication around the whole component, but moved 1 pixel inside the component.ALL_STRONG_INNERFocus indication around the whole component, but moved 1 pixel inside the component.NONENo focus indication.STRONG_UNDERLINEStrong focus indication under the component text.TEXTFocus indication around the text.UNDERLINEFocus indication under the component text.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected floatgetDashGap(int fontSize)Returns DPI-aware dash gap for dash-based focus painting.protected floatgetDashLength(int fontSize)Returns DPI-aware dash length for dash-based focus painting.booleanisAnimated()Returns indication whetherthisfocus kind can be animated.abstract voidpaintFocus(java.awt.Component mainComp, java.awt.Component focusedComp, org.pushingpixels.substance.internal.animation.TransitionAwareUI transitionAwareUI, java.awt.Graphics2D graphics, java.awt.Shape focusShape, java.awt.Rectangle textRect, float extraPadding)Paints the focus ring on the specified component.static SubstanceSlices.FocusKindvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static SubstanceSlices.FocusKind[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final SubstanceSlices.FocusKind NONE
No focus indication.
-
TEXT
public static final SubstanceSlices.FocusKind TEXT
Focus indication around the text.
-
ALL
public static final SubstanceSlices.FocusKind ALL
Focus indication around the whole component.
-
ALL_INNER
public static final SubstanceSlices.FocusKind ALL_INNER
Focus indication around the whole component, but moved 1 pixel inside the component.
-
ALL_STRONG_INNER
public static final SubstanceSlices.FocusKind ALL_STRONG_INNER
Focus indication around the whole component, but moved 1 pixel inside the component.
-
UNDERLINE
public static final SubstanceSlices.FocusKind UNDERLINE
Focus indication under the component text.
-
STRONG_UNDERLINE
public static final SubstanceSlices.FocusKind STRONG_UNDERLINE
Strong focus indication under the component text.
-
-
Method Detail
-
values
public static SubstanceSlices.FocusKind[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SubstanceSlices.FocusKind c : SubstanceSlices.FocusKind.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SubstanceSlices.FocusKind valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
paintFocus
public abstract void paintFocus(java.awt.Component mainComp, java.awt.Component focusedComp, org.pushingpixels.substance.internal.animation.TransitionAwareUI transitionAwareUI, java.awt.Graphics2D graphics, java.awt.Shape focusShape, java.awt.Rectangle textRect, float extraPadding)Paints the focus ring on the specified component.- Parameters:
mainComp- The main component for the focus painting.focusedComp- The actual component that has the focus. For example, the main component can be aJSpinner, while the focused component is a text field inside the the spinner editor.transitionAwareUI- Transition-aware UI implementation.graphics- Graphics context.focusShape- Focus shape. May benull- in this case, the bounds ofmainCompwill be used.textRect- Text rectangle (if relevant).extraPadding- Extra padding between the component bounds and the focus ring painting.
-
getDashLength
protected final float getDashLength(int fontSize)
Returns DPI-aware dash length for dash-based focus painting.- Parameters:
fontSize- The font size of the component for focus painting.- Returns:
- DPI-aware dash length for dash-based focus painting.
-
getDashGap
protected final float getDashGap(int fontSize)
Returns DPI-aware dash gap for dash-based focus painting.- Parameters:
fontSize- The font size of the component for focus painting.- Returns:
- DPI-aware dash gap for dash-based focus painting.
-
isAnimated
public boolean isAnimated()
Returns indication whetherthisfocus kind can be animated. For example, focus rings painted with solid lines are generally static.- Returns:
trueifthisfocus kind can be animated,falseotherwise.
-
-