Enum SubstanceConstants.FocusKind

    • Method Detail

      • values

        public static SubstanceConstants.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 (SubstanceConstants.FocusKind c : SubstanceConstants.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 SubstanceConstants.FocusKind valueOf​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - 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 a JSpinner, while the focused component is a text field inside the the spinner editor.
        graphics - Graphics context.
        focusShape - Focus shape. May be null - in this case, the bounds of mainComp 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 whether this focus kind can be animated. For example, focus rings painted with solid lines are generally static.
        Returns:
        true if this focus kind can be animated, false otherwise.