Class BorderSkin

    • Constructor Detail

      • BorderSkin

        public BorderSkin()
        Default constructor.
    • 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 ContainerSkin
        Parameters:
        component - The component to which the skin is being attached.
      • getPreferredWidth

        public int getPreferredWidth​(int trialHeight)
        Description copied from interface: ConstrainedVisual
        Returns the visual's preferred width given the provided height constraint.
        Specified by:
        getPreferredWidth in interface ConstrainedVisual
        Overrides:
        getPreferredWidth in class ContainerSkin
        Parameters:
        trialHeight - 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 trialWidth)
        Description copied from interface: ConstrainedVisual
        Returns the visual's preferred height given the provided width constraint.
        Specified by:
        getPreferredHeight in interface ConstrainedVisual
        Overrides:
        getPreferredHeight in class ContainerSkin
        Parameters:
        trialWidth - The width by which to constrain the preferred height, or -1 for no constraint.
        Returns:
        The preferred height given the width constraint.
      • getBaseline

        public int getBaseline​(int trialWidth,
                               int trialHeight)
        Description copied from class: ComponentSkin
        Should be implemented in every subclass.

        The default implementation here simply returns -1 (no baseline).

        Specified by:
        getBaseline in interface ConstrainedVisual
        Overrides:
        getBaseline in class ComponentSkin
        Parameters:
        trialWidth - Constrained width to compute the baseline for.
        trialHeight - Constrained height to compute the baseline for.
        Returns:
        The baseline relative to the origin of this visual, or -1 if this visual does not have a baseline.
      • 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
        Overrides:
        paint in class ContainerSkin
        Parameters:
        graphics - The graphics context in which to paint the visual.
      • getFont

        public java.awt.Font getFont()
        Returns:
        The font used in rendering the title.
      • setFont

        public void setFont​(java.lang.Object fontValue)
        Sets the font used in rendering the title.
        Parameters:
        fontValue - The new font to use for the border title of a type supported by ComponentSkin.fontFromObject(java.lang.Object).
      • getColor

        public java.awt.Color getColor()
        Returns:
        The color of the border.
      • setColor

        public void setColor​(java.lang.Object colorValue)
        Sets the color of the border.
        Parameters:
        colorValue - The new color for the border.
      • getTitleColor

        public java.awt.Color getTitleColor()
        Returns:
        The color for the title on the border.
      • setTitleColor

        public void setTitleColor​(java.lang.Object colorValue)
        Sets the color for the border title.
        Parameters:
        colorValue - The new color for the title.
      • getThickness

        public int getThickness()
        Returns:
        The thickness of the border.
      • setThickness

        public void setThickness​(int thicknessValue)
        Sets the thickness of the border.
        Parameters:
        thicknessValue - The border thickness (in pixels).
      • setThickness

        public void setThickness​(java.lang.Number thicknessValue)
        Sets the thickness of the border.
        Parameters:
        thicknessValue - The border thickness (integer value in pixels).
      • getPadding

        public Insets getPadding()
        Returns:
        The amount of space between the edge of the Border and its content.
      • setPadding

        public void setPadding​(java.lang.Object paddingValues)
        Sets the amount of space to leave between the edge of the Border and its content.
        Parameters:
        paddingValues - The set of padding values of any type supported by Insets.fromObject(java.lang.Object).
      • getCornerRadii

        public CornerRadii getCornerRadii()
        Returns:
        A CornerRadii, describing the radius of each of the Border's corners.
      • setCornerRadii

        public void setCornerRadii​(java.lang.Object cornerRadiiValues)
        Sets the radii of the Border's corners.
        Parameters:
        cornerRadiiValues - The radii for each of the corners of any type supported by CornerRadii.fromObject(java.lang.Object).
      • titleChanged

        public void titleChanged​(Border border,
                                 java.lang.String previousTitle)
        Description copied from interface: BorderListener
        Called when a border's title has changed.
        Specified by:
        titleChanged in interface BorderListener
        Parameters:
        border - The border component that has changed.
        previousTitle - The previous title for the border.
      • contentChanged

        public void contentChanged​(Border border,
                                   Component previousContent)
        Description copied from interface: BorderListener
        Called when a border's content component has changed.
        Specified by:
        contentChanged in interface BorderListener
        Parameters:
        border - The border that has changed.
        previousContent - The previous content of the border.