Class TerraTabPaneSkin

    • Constructor Detail

      • TerraTabPaneSkin

        public TerraTabPaneSkin()
    • 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 height)
        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:
        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
        Overrides:
        getPreferredHeight in class ContainerSkin
        Parameters:
        width - 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.
      • getActiveTabColor

        public java.awt.Color getActiveTabColor()
      • setActiveTabColor

        public void setActiveTabColor​(java.lang.Object colorValue)
      • getInactiveTabColor

        public java.awt.Color getInactiveTabColor()
      • setInactiveTabColor

        public void setInactiveTabColor​(java.lang.Object colorValue)
      • getBorderColor

        public java.awt.Color getBorderColor()
      • setBorderColor

        public void setBorderColor​(java.lang.Object colorValue)
      • getInactiveBorderColor

        public java.awt.Color getInactiveBorderColor()
      • setInactiveBorderColor

        public void setInactiveBorderColor​(java.lang.Object colorValue)
      • getPadding

        public Insets getPadding()
      • setPadding

        public void setPadding​(java.lang.Object paddingValue)
      • getButtonFont

        public java.awt.Font getButtonFont()
      • setButtonFont

        public void setButtonFont​(java.lang.Object fontValue)
      • getButtonColor

        public java.awt.Color getButtonColor()
      • setButtonColor

        public void setButtonColor​(java.lang.Object colorValue)
      • getButtonPadding

        public Insets getButtonPadding()
      • setButtonPadding

        public void setButtonPadding​(java.lang.Object buttonPaddingValue)
      • getButtonSpacing

        public int getButtonSpacing()
      • setButtonSpacing

        public void setButtonSpacing​(int spacingValue)
      • setButtonCornerRadius

        public final void setButtonCornerRadius​(int radiusValue)
      • setButtonCornerRadius

        public final void setButtonCornerRadius​(java.lang.Number radiusValue)
      • setButtonCornerRadius

        public final void setButtonCornerRadius​(java.lang.String radiusString)
      • getTabOrientation

        public Orientation getTabOrientation()
      • setTabOrientation

        public void setTabOrientation​(Orientation orientationValue)
      • getSelectionChangeDuration

        public int getSelectionChangeDuration()
      • setSelectionChangeDuration

        public void setSelectionChangeDuration​(int durationValue)
      • getSelectionChangeRate

        public int getSelectionChangeRate()
      • setSelectionChangeRate

        public void setSelectionChangeRate​(int rateValue)
      • keyPressed

        public boolean keyPressed​(Component component,
                                  int keyCode,
                                  Keyboard.KeyLocation keyLocation)
        Key presses have no effect if the event has already been consumed.

        CommandModifier + KEYPAD_1 to KEYPAD_9
        or CommandModifier + 1 to 9 Select the (enabled) tab at index 0 to 8 respectively.

        CommandModifier + Tab to cycle forward through the tabs, CommandModifier + Shift + Tab to cycle backward.

        Specified by:
        keyPressed in interface ComponentKeyListener
        Overrides:
        keyPressed in class ComponentSkin
        Parameters:
        component - Component that has the focus.
        keyCode - The key code for the key that was pressed.
        keyLocation - Location value for the key (left or right for shift keys, etc.).
        Returns:
        true to consume the event; false to allow it to propagate.
        See Also:
        Platform.getCommandModifier()
      • tabInserted

        public void tabInserted​(TabPane tabPane,
                                int index)
        Description copied from interface: TabPaneListener
        Called when a tab has been inserted into a tab pane's tab sequence.
        Specified by:
        tabInserted in interface TabPaneListener
        Parameters:
        tabPane - The source of this event.
        index - Where the newly inserted tab was placed.
      • previewRemoveTabs

        public Vote previewRemoveTabs​(TabPane tabPane,
                                      int index,
                                      int count)
        Description copied from interface: TabPaneListener
        Called to preview a tab removal.
        Specified by:
        previewRemoveTabs in interface TabPaneListener
        Parameters:
        tabPane - The component that wants to change.
        index - The proposed starting index of the tab or tabs to be removed.
        count - The count of tabs to remove.
        Returns:
        Whether or not to accept this tab removal (or defer it).
      • removeTabsVetoed

        public void removeTabsVetoed​(TabPane tabPane,
                                     Vote vote)
        Description copied from interface: TabPaneListener
        Called when a tab removal has been vetoed.
        Specified by:
        removeTabsVetoed in interface TabPaneListener
        Parameters:
        tabPane - The source of this event.
        vote - The vote result that vetoed the tab removal.
      • tabsRemoved

        public void tabsRemoved​(TabPane tabPane,
                                int index,
                                Sequence<Component> removed)
        Description copied from interface: TabPaneListener
        Called when a tab has been removed from a tab pane's tab sequence.
        Specified by:
        tabsRemoved in interface TabPaneListener
        Parameters:
        tabPane - The source of this event.
        index - The starting location of the tabs that were removed.
        removed - The actual sequence of tab components that were removed.
      • cornerChanged

        public void cornerChanged​(TabPane tabPane,
                                  Component previousCorner)
        Description copied from interface: TabPaneListener
        Called when a tab pane's corner component has changed.
        Specified by:
        cornerChanged in interface TabPaneListener
        Parameters:
        tabPane - The component that changed.
        previousCorner - What the corner component used to be.
      • tabDataRendererChanged

        public void tabDataRendererChanged​(TabPane tabPane,
                                           Button.DataRenderer previousRenderer)
        Description copied from interface: TabPaneListener
        Called when a tab pane's tab data renderer has changed.
        Specified by:
        tabDataRendererChanged in interface TabPaneListener
        Parameters:
        tabPane - The source of this event.
        previousRenderer - The previous renderer for the tab data.
      • closeableChanged

        public void closeableChanged​(TabPane tabPane)
        Description copied from interface: TabPaneListener
        Called when a tab pane's closeable property has changed.
        Specified by:
        closeableChanged in interface TabPaneListener
        Parameters:
        tabPane - The component that changed.
      • collapsibleChanged

        public void collapsibleChanged​(TabPane tabPane)
        Description copied from interface: TabPaneListener
        Called when a tab pane's collapsible property has changed.
        Specified by:
        collapsibleChanged in interface TabPaneListener
        Parameters:
        tabPane - The source of this event.
      • previewSelectedIndexChange

        public Vote previewSelectedIndexChange​(TabPane tabPane,
                                               int selectedIndex)
        Description copied from interface: TabPaneSelectionListener
        Called to preview a selected index change.
        Specified by:
        previewSelectedIndexChange in interface TabPaneSelectionListener
        Parameters:
        tabPane - The source of the event.
        selectedIndex - The index that will be selected.
        Returns:
        The vote result as to whether to accept this selected index change.
      • selectedIndexChanged

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

        public void tabDataChanged​(TabPane tabPane,
                                   Component component,
                                   java.lang.Object previousTabData)
        Description copied from interface: TabPaneAttributeListener
        Called when a tab's tab data attribute has changed.
        Specified by:
        tabDataChanged in interface TabPaneAttributeListener
        Parameters:
        tabPane - The source of this event.
        component - The component whose tab pane data has changed.
        previousTabData - What the tab data attribute used to be.
      • tooltipTextChanged

        public void tooltipTextChanged​(TabPane tabPane,
                                       Component component,
                                       java.lang.String previousTooltipText)
        Description copied from interface: TabPaneAttributeListener
        Called when a tab's tooltipText attribute has changed.
        Specified by:
        tooltipTextChanged in interface TabPaneAttributeListener
        Parameters:
        tabPane - The source of this event.
        component - The actual tab component whose tooltip was changed.
        previousTooltipText - What the text used to be.