Module org.jcommon

Class JThumbnail<T>

    • Field Detail

      • thumbnailPN

        protected JPanel thumbnailPN
        The panel dedicated to thumbnail content display.
      • nameLB

        protected JLabel nameLB
        The thumbnail name label
      • thumbnailMargin

        protected int thumbnailMargin
        The thumbnail margin
      • idFont

        protected Font idFont
        The thumbnail identifier font
      • idColor

        protected Color idColor
        The thumbnail identifier font color
      • standardBgColor

        protected Color standardBgColor
        The thumbnail standard background color
      • focusBgColor

        protected Color focusBgColor
        The thumbnail focused background color
      • selectedBgColor

        protected Color selectedBgColor
        The thumbnail activated background color
      • markedBgColor

        protected Color markedBgColor
        The thumbnail marked background color
      • focusedBorder

        protected Border focusedBorder
        The thumbnail focused border
      • currentBorder

        protected Border currentBorder
        The thumbnail current border
      • currentBgColor

        protected Color currentBgColor
        The thumbnail current background color
      • standard

        protected boolean standard
        Is the label is in standard state.
      • focused

        protected boolean focused
        Is the label is in focused state.
      • selected

        protected boolean selected
        Is the label is in selected state.
      • marked

        protected boolean marked
        Is the label is in marked state.
      • thumbnailID

        protected int thumbnailID
        The thumbnail numerical identifier.
      • name

        protected String name
        The thumbnail name.
      • content

        protected T content
        The thumbnail underlying content.
      • thumbnailComponent

        protected JComponent thumbnailComponent
        The thumbnail displayed component.
      • idListenerList

        protected EventListenerList idListenerList
        Liste des ecouteurs informes des evenements du label
      • nameVisible

        protected boolean nameVisible
        Is the name of the thumbnail have to be visible.
        By default this value is set to true.
      • idVisible

        protected boolean idVisible
        Is the numerical identifier of the thumbnail has to be visible.
        By default this value is set to true.
    • Constructor Detail

      • JThumbnail

        public JThumbnail​(String name,
                          int width,
                          int height,
                          int margin,
                          int ID)
        Create a new thumbnail.
        Parameters:
        name - the name of the thumbnail.
        width - the width of the thumbnail.
        height - the height of the thumbnail.
        margin - the margin size of the thumbnail.
        ID - the identifier of the thumbnail.
      • JThumbnail

        public JThumbnail​(String name,
                          T content,
                          JComponent component,
                          int width,
                          int height,
                          int margin,
                          int labelID)
        Create a new thumbnail that display the given component.
        Parameters:
        name - the name of the thumbnail.
        content - the content of the thumbnail.
        component - the component to use as display.
        width - the width of the thumbnail.
        height - the height of the thumbnail.
        margin - the margin size of the thumbnail.
        labelID - the identifier of the thumbnail.
    • Method Detail

      • setStandard

        public void setStandard​(boolean b)
        Set if the thumbnail is standard.
        Parameters:
        b - true if the thumbnail is standard and false otherwise.
        See Also:
        isStandard()
      • isStandard

        public boolean isStandard()
        Get if the thumbnail is standard.
        Returns:
        true if the thumbnail is standard and false otherwise.
        See Also:
        setStandard(boolean)
      • setMarked

        public void setMarked​(boolean b)
        Set if the thumbnail is marked.
        Parameters:
        b - true if the thumbnail is marked and false otherwise.
        See Also:
        isMarked()
      • isMarked

        public boolean isMarked()
        Get if the thumbnail is marked.
        Returns:
        true if the thumbnail is marked and false otherwise.
        See Also:
        setMarked(boolean)
      • setFocused

        public void setFocused​(boolean b)
        Get if the thumbnail is focused.
        Parameters:
        b - true if the thumbnail is focused and false otherwise.
        See Also:
        isFocused()
      • isFocused

        public boolean isFocused()
        Set if the thumbnail is focused.
        Returns:
        true if the thumbnail is focused and false otherwise.
        See Also:
        setFocused(boolean)
      • setContent

        public void setContent​(T content)
        Set the content that is displayed within this thumbnail.
        Parameters:
        content - the content that is displayed within this thumbnail.
        See Also:
        getContent()
      • getContent

        public T getContent()
        Get the content that is displayed within this thumbnail.
        Returns:
        the content that is displayed within this thumbnail.
        See Also:
        setContent(Object)
      • getID

        public int getID()
        Get the identifier of the thumbnail.
        Returns:
        the identifier of the thumbnail.
      • setSelected

        public void setSelected​(boolean b)
        Set if the thumbnail is selected.
        Parameters:
        b - true if the thumbnail is selected and false otherwise.
        See Also:
        isSelected()
      • isSelected

        public boolean isSelected()
        Get if the thumbnail is selected.
        Returns:
        true if the thumbnail is selected and false otherwise.
        See Also:
        setSelected(boolean)
      • setIdFont

        public void setIdFont​(Font f)
        Set the font to use for the thumbnail identifier display.
        Parameters:
        f - the font to use for the thumbnail identifier display.
      • setNameVisible

        public void setNameVisible​(boolean nameVisible)
        Set if the thumbnail name has to be visible.
        Parameters:
        nameVisible - true if the thumbnail name has to be visible and false otherwise.
        See Also:
        isNameVisible(), setNameOrientation(String)
      • isIdVisible

        public boolean isIdVisible()
        Get if the thumbnail numerical identifier is visible.
        Returns:
        true if the thumbnail numerical identifier is visible and false otherwise.
        See Also:
        setIdVisible(boolean)
      • setIdVisible

        public void setIdVisible​(boolean visible)
        Set if the thumbnail numerical identifier has to be visible.
        Parameters:
        visible - true if the thumbnail numerical identifier has to be visible and false otherwise.
        See Also:
        isIdVisible()
      • refresh

        public void refresh()
        Refresh the graphical components of the thumbnail.
      • fireThumbnailFocused

        protected void fireThumbnailFocused​(JThumbnail<T> thumbnail)
        Fire a thumbnail focused event.
        Parameters:
        thumbnail - the thumbnail that has raised the event.
      • fireThumbnailUnfocused

        protected void fireThumbnailUnfocused​(JThumbnail<T> thumbnail)
        Fire a thumbnail unfocused event.
        Parameters:
        thumbnail - the thumbnail that has raised the event.
      • fireThumbnailSelected

        protected void fireThumbnailSelected()
        Fire a thumbnail selected event.
      • fireThumbnailSelected

        protected void fireThumbnailSelected​(JThumbnail<T> thumbnail)
        Fire a thumbnail selected event.
        Parameters:
        thumbnail - the thumbnail that has raised the event.
      • fireThumbnailActivated

        protected void fireThumbnailActivated​(JThumbnail<T> thumbnail)
        Fire a thumbnail activated event.
        Parameters:
        thumbnail - the thumbnail that has raised the event.
      • labelActivated

        protected void labelActivated()
        Fire a label activated event.
      • addThumbnailListener

        public void addThumbnailListener​(JThumbnailListener<T> l)
        Add an Active Label Listener to this Active Label
        Parameters:
        l - ActiveLabelListener Listener added to the Active Label
      • removeThumbnailListener

        public void removeThumbnailListener​(JThumbnailListener<T> l)
        Remove an Active Label Listener from this Active Label
        Parameters:
        l - ActiveLabelListener Active Listener to remove
      • processLabelMouseEvent

        protected void processLabelMouseEvent​(MouseEvent e)
        Process a mouse event that occurred on the label.
        Parameters:
        e - the underlying mouse event
      • refreshGUI

        protected void refreshGUI()
        Refresh the Graphical User Interface (GUI) components.
      • processComponentMouseEvent

        protected void processComponentMouseEvent​(MouseEvent e)
        Processin embed component mouse event.
        Parameters:
        e - The mouse event fired by embed component