Class TerraListViewSkin

    • Constructor Detail

      • TerraListViewSkin

        public TerraListViewSkin()
    • 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.
      • 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
        Parameters:
        graphics - The graphics context in which to paint the visual.
      • isFocusable

        public final boolean isFocusable()
        Description copied from class: ComponentSkin
        By default, skins are focusable.
        Specified by:
        isFocusable in interface Skin
        Overrides:
        isFocusable in class ComponentSkin
        Returns:
        true if this skin is focusable; false, otherwise.
      • isOpaque

        public final boolean isOpaque()
        Description copied from class: ComponentSkin
        By default, skins are assumed to be opaque.
        Specified by:
        isOpaque in interface Skin
        Overrides:
        isOpaque in class ComponentSkin
        Returns:
        true if this skin is opaque; false if any part of it is transparent or translucent.
      • getFont

        public final java.awt.Font getFont()
      • setFont

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

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

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

        public final java.awt.Color getColor()
      • setColor

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

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

        public final void setColor​(int color)
      • getDisabledColor

        public final java.awt.Color getDisabledColor()
      • setDisabledColor

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

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

        public final void setDisabledColor​(int disabledColor)
      • getBackgroundColor

        public final java.awt.Color getBackgroundColor()
      • setBackgroundColor

        public final void setBackgroundColor​(java.awt.Color backgroundColor)
      • setBackgroundColor

        public final void setBackgroundColor​(java.lang.String backgroundColor)
      • setBackgroundColor

        public final void setBackgroundColor​(int backgroundColor)
      • getSelectionColor

        public final java.awt.Color getSelectionColor()
      • setSelectionColor

        public final void setSelectionColor​(java.awt.Color selectionColor)
      • setSelectionColor

        public final void setSelectionColor​(java.lang.String selectionColor)
      • setSelectionColor

        public final void setSelectionColor​(int selectionColor)
      • getSelectionBackgroundColor

        public final java.awt.Color getSelectionBackgroundColor()
      • setSelectionBackgroundColor

        public final void setSelectionBackgroundColor​(java.awt.Color selectionBackgroundColor)
      • setSelectionBackgroundColor

        public final void setSelectionBackgroundColor​(java.lang.String selectionBackgroundColor)
      • setSelectionBackgroundColor

        public final void setSelectionBackgroundColor​(int selectionBackgroundColor)
      • getInactiveSelectionColor

        public final java.awt.Color getInactiveSelectionColor()
      • setInactiveSelectionColor

        public final void setInactiveSelectionColor​(java.awt.Color inactiveSelectionColor)
      • setInactiveSelectionColor

        public final void setInactiveSelectionColor​(java.lang.String inactiveSelectionColor)
      • setInactiveSelectionColor

        public final void setInactiveSelectionColor​(int inactiveSelectionColor)
      • getInactiveSelectionBackgroundColor

        public final java.awt.Color getInactiveSelectionBackgroundColor()
      • setInactiveSelectionBackgroundColor

        public final void setInactiveSelectionBackgroundColor​(java.awt.Color inactiveSelectionBackgroundColor)
      • setInactiveSelectionBackgroundColor

        public final void setInactiveSelectionBackgroundColor​(java.lang.String inactiveSelectionBackgroundColor)
      • setInactiveSelectionBackgroundColor

        public final void setInactiveSelectionBackgroundColor​(int inactiveSelectionBackgroundColor)
      • getHighlightBackgroundColor

        public final java.awt.Color getHighlightBackgroundColor()
      • setHighlightBackgroundColor

        public final void setHighlightBackgroundColor​(java.awt.Color highlightBackgroundColor)
      • setHighlightBackgroundColor

        public final void setHighlightBackgroundColor​(java.lang.String highlightBackgroundColor)
      • setHighlightBackgroundColor

        public final void setHighlightBackgroundColor​(int highlightBackgroundColor)
      • getAlternateItemBackgroundColor

        public final java.awt.Color getAlternateItemBackgroundColor()
      • setAlternateItemBackgroundColor

        public final void setAlternateItemBackgroundColor​(java.awt.Color alternateItemBackgroundColor)
      • setAlternateItemBackgroundColor

        public final void setAlternateItemBackgroundColor​(java.lang.String alternateItemBackgroundColor)
      • setAlternateItemColor

        public final void setAlternateItemColor​(int alternateItemBackgroundColor)
      • getShowHighlight

        public final boolean getShowHighlight()
      • setShowHighlight

        public final void setShowHighlight​(boolean showHighlight)
      • getWrapSelectNext

        public final boolean getWrapSelectNext()
      • setWrapSelectNext

        public final void setWrapSelectNext​(boolean wrapSelectNext)
      • getCheckboxPadding

        public final Insets getCheckboxPadding()
      • setCheckboxPadding

        public final void setCheckboxPadding​(Insets checkboxPadding)
      • setCheckboxPadding

        public final void setCheckboxPadding​(Dictionary<java.lang.String,​?> checkboxPadding)
      • setCheckboxPadding

        public final void setCheckboxPadding​(int checkboxPadding)
      • setCheckboxPadding

        public final void setCheckboxPadding​(java.lang.Number padding)
      • setCheckboxPadding

        public final void setCheckboxPadding​(java.lang.String checkboxPadding)
      • isVariableItemHeight

        public final boolean isVariableItemHeight()
      • setVariableItemHeight

        public final void setVariableItemHeight​(boolean variableItemHeight)
      • mouseMove

        public boolean mouseMove​(Component component,
                                 int x,
                                 int y)
        Description copied from interface: ComponentMouseListener
        Called when the mouse is moved over a component.
        Specified by:
        mouseMove in interface ComponentMouseListener
        Overrides:
        mouseMove in class ComponentSkin
        Parameters:
        component - Component that is under the mouse.
        x - X position of the mouse.
        y - Y position of the mouse.
        Returns:
        true to consume the event; false to allow it to propagate (default return).
      • mouseDown

        public boolean mouseDown​(Component component,
                                 Mouse.Button button,
                                 int x,
                                 int y)
        Description copied from interface: ComponentMouseButtonListener
        Called when a mouse button is pressed over a component.
        Specified by:
        mouseDown in interface ComponentMouseButtonListener
        Overrides:
        mouseDown in class ComponentSkin
        Parameters:
        component - Component that is under the mouse pointer.
        button - Which mouse button was pressed.
        x - X position of the mouse.
        y - Y position of the mouse.
        Returns:
        true to consume the event; false to allow it to propagate (default).
      • mouseUp

        public boolean mouseUp​(Component component,
                               Mouse.Button button,
                               int x,
                               int y)
        Description copied from interface: ComponentMouseButtonListener
        Called when a mouse button is released over a component.
        Specified by:
        mouseUp in interface ComponentMouseButtonListener
        Overrides:
        mouseUp in class ComponentSkin
        Parameters:
        component - Component user the mouse pointer.
        button - Which mouse button that was released.
        x - X position of the mouse.
        y - Y position of the mouse.
        Returns:
        true to consume the event; false to allow it to propagate (default).
      • 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).
      • mouseWheel

        public boolean mouseWheel​(Component component,
                                  Mouse.ScrollType scrollType,
                                  int scrollAmount,
                                  int wheelRotation,
                                  int x,
                                  int y)
        Description copied from interface: ComponentMouseWheelListener
        Called when the mouse wheel is scrolled over a component.
        Specified by:
        mouseWheel in interface ComponentMouseWheelListener
        Overrides:
        mouseWheel in class ComponentSkin
        Parameters:
        component - Component under the mouse pointer.
        scrollType - What type of scroll was requested on the mouse.
        scrollAmount - Amount of scrolling.
        wheelRotation - Rotation value.
        x - X position of the mouse.
        y - Y position of the mouse.
        Returns:
        true to consume the event; false to allow it to propagate.
      • keyTyped

        public boolean keyTyped​(Component component,
                                char character)
        Select the next enabled list item where the first character of the rendered text matches the typed key (case insensitive).
        Specified by:
        keyTyped in interface ComponentKeyListener
        Overrides:
        keyTyped in class ComponentSkin
        Parameters:
        component - Component that has the focus, that is receiving this key.
        character - The decoded character that was typed.
        Returns:
        true to consume the event; false to allow it to propagate.
      • 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.
      • focusedChanged

        public void focusedChanged​(Component component,
                                   Component obverseComponent)
        Description copied from interface: ComponentStateListener
        Called when a component's focused state has changed.

        This will be called both when a component gains focus and when it loses focus. The currently focused component has already been set when this method is called, so that the new state of the component can be determined by calling the Component.isFocused() method.

        Specified by:
        focusedChanged in interface ComponentStateListener
        Overrides:
        focusedChanged in class ComponentSkin
        Parameters:
        component - The component that is either gaining focus or the one that previously had focus and is now losing it.
        obverseComponent - If the component is gaining focus, this is the component that is losing focus. If the component is losing focus this is the component that is gaining the focus instead.
      • listDataChanged

        public void listDataChanged​(ListView listView,
                                    List<?> previousListData)
        Description copied from interface: ListViewListener
        Called when a list view's list data has changed.
        Specified by:
        listDataChanged in interface ListViewListener
        Parameters:
        listView - The source of the event.
        previousListData - The previous list data that was displayed.
      • itemRendererChanged

        public void itemRendererChanged​(ListView listView,
                                        ListView.ItemRenderer previousItemRenderer)
        Description copied from interface: ListViewListener
        Called when a list view's item renderer has changed.
        Specified by:
        itemRendererChanged in interface ListViewListener
        Parameters:
        listView - The source of the event.
        previousItemRenderer - The previous renderer used for each item.
      • itemEditorChanged

        public void itemEditorChanged​(ListView listView,
                                      ListView.ItemEditor previousItemEditor)
        Description copied from interface: ListViewListener
        Called when a list view's item editor has changed.
        Specified by:
        itemEditorChanged in interface ListViewListener
        Parameters:
        listView - The source of the event.
        previousItemEditor - The previous editor used for updating items.
      • selectModeChanged

        public void selectModeChanged​(ListView listView,
                                      ListView.SelectMode previousSelectMode)
        Description copied from interface: ListViewListener
        Called when a list view's select mode has changed.
        Specified by:
        selectModeChanged in interface ListViewListener
        Parameters:
        listView - The source of the event.
        previousSelectMode - The previous selection mode.
      • checkmarksEnabledChanged

        public void checkmarksEnabledChanged​(ListView listView)
        Description copied from interface: ListViewListener
        Called when a list view's checkmarks enabled flag has changed.
        Specified by:
        checkmarksEnabledChanged in interface ListViewListener
        Parameters:
        listView - The list view that has been changed.
      • checkmarksTriStateChanged

        public void checkmarksTriStateChanged​(ListView listView)
        Description copied from interface: ListViewListener
        Called when a list view's tri-state checkmarks flag has been changed.
        Specified by:
        checkmarksTriStateChanged in interface ListViewListener
        Parameters:
        listView - The list view that has been changed.
      • checkmarksMixedAsCheckedChanged

        public void checkmarksMixedAsCheckedChanged​(ListView listView)
        Description copied from interface: ListViewListener
        Called when a list view's flag to decide if mixed checkbox state should be treated as checked has been changed.
        Specified by:
        checkmarksMixedAsCheckedChanged in interface ListViewListener
        Parameters:
        listView - The list view that has been changed.
      • disabledItemFilterChanged

        public void disabledItemFilterChanged​(ListView listView,
                                              Filter<?> previousDisabledItemFilter)
        Description copied from interface: ListViewListener
        Called when a list view's disabled item filter has changed.
        Specified by:
        disabledItemFilterChanged in interface ListViewListener
        Parameters:
        listView - The source of the event.
        previousDisabledItemFilter - The previous filter function used to disable specific items.
      • disabledCheckmarkFilterChanged

        public void disabledCheckmarkFilterChanged​(ListView listView,
                                                   Filter<?> previousDisabledCheckmarkFilter)
        Description copied from interface: ListViewListener
        Called when a list view's disabled checkmark filter has changed.
        Specified by:
        disabledCheckmarkFilterChanged in interface ListViewListener
        Parameters:
        listView - The source of the event.
        previousDisabledCheckmarkFilter - The previous filter function used to disable checkmarks for certain items.
      • itemInserted

        public void itemInserted​(ListView listView,
                                 int index)
        Description copied from interface: ListViewItemListener
        Called when an item has been inserted into the list view.
        Specified by:
        itemInserted in interface ListViewItemListener
        Parameters:
        listView - The source of the event.
        index - The index of the item that was inserted.
      • itemsRemoved

        public void itemsRemoved​(ListView listView,
                                 int index,
                                 int count)
        Description copied from interface: ListViewItemListener
        Called when items have been removed from the list view.
        Specified by:
        itemsRemoved in interface ListViewItemListener
        Parameters:
        listView - The source of the event.
        index - The first index affected by the event.
        count - The number of items that were removed, or -1 if all items were removed.
      • itemUpdated

        public void itemUpdated​(ListView listView,
                                int index)
        Description copied from interface: ListViewItemListener
        Called when an item in the list view has been updated.
        Specified by:
        itemUpdated in interface ListViewItemListener
        Parameters:
        listView - The source of the event.
        index - The first index affected by the event.
      • itemCheckedChanged

        public void itemCheckedChanged​(ListView listView,
                                       int index)
        Description copied from interface: ListViewItemStateListener
        Called when an item's checked state has changed.
        Specified by:
        itemCheckedChanged in interface ListViewItemStateListener
        Parameters:
        listView - The list view whose state has changed.
        index - The index of the item whose checked state has changed.
      • selectedRangeAdded

        public void selectedRangeAdded​(ListView listView,
                                       int rangeStart,
                                       int rangeEnd)
        Description copied from interface: ListViewSelectionListener
        Called when a range has been added to a list view's selection.
        Specified by:
        selectedRangeAdded in interface ListViewSelectionListener
        Parameters:
        listView - The source of the event.
        rangeStart - The start index of the range that was added, inclusive.
        rangeEnd - The end index of the range that was added, inclusive.
      • selectedRangeRemoved

        public void selectedRangeRemoved​(ListView listView,
                                         int rangeStart,
                                         int rangeEnd)
        Description copied from interface: ListViewSelectionListener
        Called when a range has been removed from a list view's selection.
        Specified by:
        selectedRangeRemoved in interface ListViewSelectionListener
        Parameters:
        listView - The source of the event.
        rangeStart - The starting index of the range that was removed, inclusive.
        rangeEnd - The starting index of the range that was removed, inclusive.
      • selectedItemChanged

        public void selectedItemChanged​(ListView listView,
                                        java.lang.Object previousSelectedItem)
        Description copied from interface: ListViewSelectionListener
        Called when a list view's selected item has changed. Only called in single-select mode.
        Specified by:
        selectedItemChanged in interface ListViewSelectionListener
        Parameters:
        listView - The source of the event.
        previousSelectedItem - The item that was previously selected.