Class TerraSpinnerSkin

    • Constructor Detail

      • TerraSpinnerSkin

        public TerraSpinnerSkin()
    • Method Detail

      • setSize

        public void setSize​(int width,
                            int height)
        Description copied from class: ComponentSkin
        Set the final size of the component after layout has finished.

        All subclasses must call this superclass method in order to set the ComponentSkin.width and ComponentSkin.height values, but may need to do additional calculations before doing so.

        Specified by:
        setSize in interface ConstrainedVisual
        Overrides:
        setSize in class ComponentSkin
        Parameters:
        width - The new (final) width of the component after layout.
        height - The new (final) height of the component after layout.
      • 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 width,
                               int height)
        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:
        width - Constrained width to compute the baseline for.
        height - 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.
      • enabledChanged

        public void enabledChanged​(Component component)
        Description copied from interface: ComponentStateListener
        Called when a component's enabled state has changed.

        Called both when the component is enabled and when it is disabled. The component's enabled flag has already been set when this method is called so the new state can be determined by calling the Component.isEnabled() method.

        Specified by:
        enabledChanged in interface ComponentStateListener
        Overrides:
        enabledChanged in class ComponentSkin
        Parameters:
        component - The component whose enabled state is changing.
      • mouseClick

        public boolean mouseClick​(Component component,
                                  Mouse.Button button,
                                  int x,
                                  int y,
                                  int count)
        Description copied from interface: ComponentMouseButtonListener
        Called when a mouse button is clicked over a component.
        Specified by:
        mouseClick in interface ComponentMouseButtonListener
        Overrides:
        mouseClick in class ComponentSkin
        Parameters:
        component - Component user the mouse pointer.
        button - Which mouse button was clicked.
        x - X position of the mouse.
        y - Y position of the mouse.
        count - Number of clicks (1 = single click, 2 = double click, etc.).
        Returns:
        true to consume the event; false to allow it to propagate (default).
      • invalidateContent

        protected void invalidateContent()
      • getColor

        public java.awt.Color getColor()
      • setColor

        public void setColor​(java.awt.Color color)
      • setColor

        public final void setColor​(java.lang.String color)
      • setColor

        public final void setColor​(int color)
      • getDisabledColor

        public java.awt.Color getDisabledColor()
      • setDisabledColor

        public void setDisabledColor​(java.awt.Color disabledColor)
      • setDisabledColor

        public final void setDisabledColor​(java.lang.String disabledColorString)
      • setDisabledColor

        public final void setDisabledColor​(int disabledColorIndex)
      • getBorderColor

        public java.awt.Color getBorderColor()
      • setBorderColor

        public void setBorderColor​(java.awt.Color borderColor)
      • setBorderColor

        public final void setBorderColor​(java.lang.String borderColorString)
      • setBorderColor

        public final void setBorderColor​(int borderColorIndex)
      • getButtonColor

        public java.awt.Color getButtonColor()
      • setButtonColor

        public void setButtonColor​(java.awt.Color buttonColor)
      • setButtonColor

        public final void setButtonColor​(java.lang.String buttonColorString)
      • setButtonColor

        public final void setButtonColor​(int buttonColorIndex)
      • getButtonBackgroundColor

        public java.awt.Color getButtonBackgroundColor()
      • setButtonBackgroundColor

        public void setButtonBackgroundColor​(java.awt.Color buttonBackgroundColor)
      • setButtonBackgroundColor

        public final void setButtonBackgroundColor​(java.lang.String buttonBackgroundColorString)
      • setButtonBackgroundColor

        public final void setButtonBackgroundColor​(int buttonBackgroundColorIndex)
      • getFont

        public java.awt.Font getFont()
      • setFont

        public void setFont​(java.awt.Font font)
      • setFont

        public final void setFont​(java.lang.String fontString)
      • setFont

        public final void setFont​(Dictionary<java.lang.String,​?> fontDictionary)
      • isSizeToContent

        public boolean isSizeToContent()
      • setSizeToContent

        public void setSizeToContent​(boolean sizeToContent)
      • spinnerDataChanged

        public void spinnerDataChanged​(Spinner spinner,
                                       List<?> previousSpinnerData)
        Description copied from interface: SpinnerListener
        Called when a spinner's data has changed.
        Specified by:
        spinnerDataChanged in interface SpinnerListener
        Parameters:
        spinner - The source of this event.
        previousSpinnerData - What the spinner data used to be.
      • itemRendererChanged

        public void itemRendererChanged​(Spinner spinner,
                                        Spinner.ItemRenderer previousItemRenderer)
        Description copied from interface: SpinnerListener
        Called when a spinner's item renderer has changed.
        Specified by:
        itemRendererChanged in interface SpinnerListener
        Parameters:
        spinner - The source of this event.
        previousItemRenderer - What the item renderer used to be.
      • circularChanged

        public void circularChanged​(Spinner spinner)
        Description copied from interface: SpinnerListener
        Called when a spinner's circular property has changed.
        Specified by:
        circularChanged in interface SpinnerListener
        Parameters:
        spinner - The source of this event.
      • selectedIndexChanged

        public void selectedIndexChanged​(Spinner spinner,
                                         int previousSelectedIndex)
        Description copied from interface: SpinnerSelectionListener
        Called when a spinner's selected index has changed.
        Specified by:
        selectedIndexChanged in interface SpinnerSelectionListener
        Parameters:
        spinner - The source of the event.
        previousSelectedIndex - If the selection changed directly, contains the index that was previously selected. Otherwise, contains the current selection.
      • selectedItemChanged

        public void selectedItemChanged​(Spinner spinner,
                                        java.lang.Object previousSelectedItem)
        Description copied from interface: SpinnerSelectionListener
        Called when a spinners's selected item has changed.
        Specified by:
        selectedItemChanged in interface SpinnerSelectionListener
        Parameters:
        spinner - The source of the event.
        previousSelectedItem - The item that was previously selected, or null if the previous selection cannot be determined.