Package org.pushingpixels.substance.api
Enum Class SubstanceConstants.FocusKind
java.lang.Object
java.lang.Enum<SubstanceConstants.FocusKind>
org.pushingpixels.substance.api.SubstanceConstants.FocusKind
- All Implemented Interfaces:
Serializable
,Comparable<SubstanceConstants.FocusKind>
,Constable
- Enclosing class:
- SubstanceConstants
Enumerates focus indication kinds.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionFocus indication around the whole component.Focus indication around the whole component, but moved 1 pixel inside the component.Focus indication around the whole component, but moved 1 pixel inside the component.No focus indication.Strong focus indication under the component text.Focus indication around the text.Focus indication under the component text. -
Method Summary
Modifier and TypeMethodDescriptionprotected static float
getDashGap
(int fontSize) Returns DPI-aware dash gap for dash-based focus painting.protected static float
getDashLength
(int fontSize) Returns DPI-aware dash length for dash-based focus painting.boolean
Returns indication whetherthis
focus kind can be animated.abstract void
paintFocus
(Component mainComp, Component focusedComp, TransitionAwareUI transitionAwareUI, Graphics2D graphics, Shape focusShape, Rectangle textRect, int extraPadding) Paints the focus ring on the specified component.static SubstanceConstants.FocusKind
Returns the enum constant of this class with the specified name.static SubstanceConstants.FocusKind[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No focus indication. -
TEXT
Focus indication around the text. -
ALL
Focus indication around the whole component. -
ALL_INNER
Focus indication around the whole component, but moved 1 pixel inside the component. -
ALL_STRONG_INNER
Focus indication around the whole component, but moved 1 pixel inside the component. -
UNDERLINE
Focus indication under the component text. -
STRONG_UNDERLINE
Strong focus indication under the component text.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
paintFocus
public abstract void paintFocus(Component mainComp, Component focusedComp, TransitionAwareUI transitionAwareUI, Graphics2D graphics, Shape focusShape, Rectangle textRect, int 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.graphics
- Graphics context.focusShape
- Focus shape. May benull
- in this case, the bounds ofmainComp
will be used.textRect
- Text rectangle (if relevant).extraPadding
- Extra padding between the component bounds and the focus ring painting.
-
getDashLength
protected static 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 static 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 whetherthis
focus kind can be animated. For example, focus rings painted with solid lines are generally static.- Returns:
true
ifthis
focus kind can be animated,false
otherwise.
-