Class SeparatorSkin

    • Constructor Detail

      • SeparatorSkin

        public SeparatorSkin()
        Construct and set defaults.
    • Method Detail

      • install

        public void install​(Component component)
        Description copied from class: ComponentSkin
        Must be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.
        Specified by:
        install in interface Skin
        Overrides:
        install in class ComponentSkin
        Parameters:
        component - The component to which the skin is being attached.
      • getPreferredWidth

        public int getPreferredWidth​(int height)
        Description copied from interface: ConstrainedVisual
        Returns the visual's preferred width given the provided height constraint.
        Specified by:
        getPreferredWidth in interface ConstrainedVisual
        Parameters:
        height - The height by which to constrain the preferred width, or -1 for no constraint.
        Returns:
        The preferred width given the height constraint.
      • getPreferredHeight

        public int getPreferredHeight​(int width)
        Description copied from interface: ConstrainedVisual
        Returns the visual's preferred height given the provided width constraint.
        Specified by:
        getPreferredHeight in interface ConstrainedVisual
        Parameters:
        width - The width by which to constrain the preferred height, or -1 for no constraint.
        Returns:
        The preferred height given the width constraint.
      • layout

        public void layout()
        Description copied from interface: Skin
        If the component on which the skin is installed is a container, lays out the container's children.
        Specified by:
        layout in interface Skin
      • paint

        public void paint​(java.awt.Graphics2D graphics)
        Description copied from interface: Visual
        Paints the visual.
        Specified by:
        paint in interface Visual
        Parameters:
        graphics - The graphics context in which to paint the visual.
      • isFocusable

        public boolean isFocusable()
        Description copied from class: ComponentSkin
        By default, skins are focusable.
        Specified by:
        isFocusable in interface Skin
        Overrides:
        isFocusable in class ComponentSkin
        Returns:
        false; spacers are not focusable.
      • getFont

        public java.awt.Font getFont()
        Returns:
        The font used in rendering the Separator's heading.
      • setFont

        public void setFont​(java.awt.Font newFont)
        Sets the font used in rendering the Separator's heading.
        Parameters:
        newFont - The new font for the heading.
      • setFont

        public final void setFont​(java.lang.String fontString)
        Sets the font used in rendering the Separator's heading.
        Parameters:
        fontString - A font specification.
      • setFont

        public final void setFont​(Dictionary<java.lang.String,​?> fontDictionary)
        Sets the font used in rendering the Separator's heading.
        Parameters:
        fontDictionary - A dictionary describing a font.
      • getColor

        public java.awt.Color getColor()
        Returns:
        The color of the Separator's horizontal rule.
      • setColor

        public void setColor​(java.awt.Color newColor)
        Sets the color of the Separator's horizontal rule.
        Parameters:
        newColor - The new color for the horizontal rule.
      • setColor

        public final void setColor​(java.lang.String colorString)
        Sets the color of the Separator's horizontal rule.
        Parameters:
        colorString - Any of the color values recognized by Pivot.
      • getHeadingColor

        public java.awt.Color getHeadingColor()
        Returns:
        The color of the text in the heading.
      • setHeadingColor

        public void setHeadingColor​(java.awt.Color newHeadingColor)
        Sets the color of the text in the heading.
        Parameters:
        newHeadingColor - The new color for the heading text.
      • setHeadingColor

        public final void setHeadingColor​(java.lang.String headingColorString)
        Sets the color of the text in the heading.
        Parameters:
        headingColorString - Any of the color values recognized by Pivot.
      • getThickness

        public int getThickness()
        Returns:
        The thickness of the Separator's horizontal rule.
      • setThickness

        public void setThickness​(int newThickness)
        Sets the thickness of the Separator's horizontal rule.
        Parameters:
        newThickness - The new rule thickness (in pixels).
      • setThickness

        public final void setThickness​(java.lang.Number newThickness)
        Sets the thickness of the Separator's horizontal rule.
        Parameters:
        newThickness - The new integer value for the rule thickness (in pixels).
      • getPadding

        public Insets getPadding()
        Returns:
        The amount of space surrounding (left/right) the Separator's heading, and above and below the entire component.
      • setPadding

        public void setPadding​(Insets paddingInsets)
        Sets the amount of space to leave around the Separator's heading, and above and below the entire component.
        Parameters:
        paddingInsets - The new padding values.
      • setPadding

        public final void setPadding​(Dictionary<java.lang.String,​?> paddingDictionary)
        Sets the amount of space to leave around the Separator's heading, and above and below the entire component.
        Parameters:
        paddingDictionary - A dictionary with keys in the set {left, top, bottom, right}.
      • setPadding

        public final void setPadding​(Sequence<?> paddingSequence)
        Sets the amount of space to leave around the Separator's heading, and above and below the entire component.
        Parameters:
        paddingSequence - A sequence of values in the order of [top, left, bottom, right].
      • setPadding

        public final void setPadding​(int paddingValue)
        Sets the amount of space to leave around the Separator's heading, and above and below the entire component.
        Parameters:
        paddingValue - The new single padding value for all areas.
      • setPadding

        public final void setPadding​(java.lang.Number paddingValue)
        Sets the amount of space to leave around the Separator's heading, and above and below the entire component.
        Parameters:
        paddingValue - The new integer value to use for padding in all areas.
      • setPadding

        public final void setPadding​(java.lang.String paddingString)
        Sets the amount of space to leave around the Separator's heading, and above and below the entire component.
        Parameters:
        paddingString - A string containing an integer or a JSON dictionary with keys left, top, bottom, and/or right.
      • headingChanged

        public void headingChanged​(Separator separator,
                                   java.lang.String previousHeading)
        Description copied from interface: SeparatorListener
        Called when a separator's heading has changed.
        Specified by:
        headingChanged in interface SeparatorListener
        Parameters:
        separator - The separator that changed.
        previousHeading - What the heading used to be.