org.jdesktop.swingx

Class JXHeader

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  JXHeader.IconPosition
      Specifies desired location of the icon relative to the title/description text.
      • Nested classes/interfaces inherited from class javax.swing.JPanel

        javax.swing.JPanel.AccessibleJPanel
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String uiClassID
      JXHeader pluggable UI key HeaderUI
      • Fields inherited from class javax.swing.JComponent

        accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
      • Fields inherited from class java.awt.Component

        BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
    • Constructor Summary

      Constructors 
      Constructor and Description
      JXHeader()
      Creates a new instance of JXHeader
      JXHeader(java.lang.String title, java.lang.String description)
      Creates a new instance of JXHeader.
      JXHeader(java.lang.String title, java.lang.String description, javax.swing.Icon icon)
      Creates a new instance of JXHeader.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.String getDescription()
      Gets the description.
      java.awt.Font getDescriptionFont()
      Gets description font.
      java.awt.Color getDescriptionForeground()
      Gets current description foreground color.
      javax.swing.Icon getIcon()
      Gets the icon.
      JXHeader.IconPosition getIconPosition()
      Gets current icon position.
      java.awt.Dimension getPreferredSize() 
      java.lang.String getTitle()
      Gets the title.
      java.awt.Font getTitleFont()
      Gets title font.
      java.awt.Color getTitleForeground()
      Gets current title foreground color.
      HeaderUI getUI()
      java.lang.String getUIClassID()
      Returns the name of the L&F class that renders this component.
      void setDescription(java.lang.String description)
      Sets the description for this header.
      void setDescriptionFont(java.awt.Font font)
      Sets font for the description line of header.
      void setDescriptionForeground(java.awt.Color descriptionForeground)
      Sets description foreground color.
      void setFont(java.awt.Font font)
      Sets new font for both, title and description line of the header.
      void setIcon(javax.swing.Icon icon)
      Sets the icon to use for the header.
      void setIconPosition(JXHeader.IconPosition iconPosition)
      Sets new Icon position.
      void setTitle(java.lang.String title)
      Sets the title to use.
      void setTitleFont(java.awt.Font font)
      Sets new font for title.
      void setTitleForeground(java.awt.Color titleForeground)
      Sets title foreground color.
      void setUI(HeaderUI ui)
      Sets the look and feel (L&F) object that renders this component.
      void updateUI()
      Notification from the UIManager that the L&F has changed.
      • Methods inherited from class javax.swing.JPanel

        getAccessibleContext, paramString, setUI
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • uiClassID

        public static final java.lang.String uiClassID
        JXHeader pluggable UI key HeaderUI
        See Also:
        Constant Field Values
    • Constructor Detail

      • JXHeader

        public JXHeader()
        Creates a new instance of JXHeader
      • JXHeader

        public JXHeader(java.lang.String title,
                java.lang.String description)
        Creates a new instance of JXHeader. PropertyChangeEvents are fired when the title and description properties are set.
        Parameters:
        title - specifies the title property for this JXHeader
        description - specifies the description property for this JXHeader
      • JXHeader

        public JXHeader(java.lang.String title,
                java.lang.String description,
                javax.swing.Icon icon)
        Creates a new instance of JXHeader. PropertyChangeEvents are fired when the title and description properties are set.
        Parameters:
        title - specifies the title property for this JXHeader
        description - specifies the description property for this JXHeader
        icon - specifies the icon property for this JXHeader
    • Method Detail

      • getUI

        public HeaderUI getUI()
        Overrides:
        getUI in class javax.swing.JPanel
      • setUI

        public void setUI(HeaderUI ui)
        Sets the look and feel (L&F) object that renders this component.
        Parameters:
        ui - the HeaderUI L&F object
        See Also:
        UIDefaults.getUI(javax.swing.JComponent)
      • getUIClassID

        public java.lang.String getUIClassID()
        Returns the name of the L&F class that renders this component.
        Overrides:
        getUIClassID in class javax.swing.JPanel
        Returns:
        the string uiClassID
        See Also:
        JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)
      • updateUI

        public void updateUI()
        Notification from the UIManager that the L&F has changed. Replaces the current UI object with the latest version from the UIManager.
        Overrides:
        updateUI in class javax.swing.JPanel
        See Also:
        JComponent.updateUI()
      • setTitle

        public void setTitle(java.lang.String title)
        Sets the title to use. This may be either plain text, or a simplified version of HTML, as JLabel would use.
        Parameters:
        title - the Title. May be null.
      • getTitle

        public java.lang.String getTitle()
        Gets the title. This may use HTML, such as that supported by JLabel (version 3.2 of the HTML spec).
        Returns:
        the title. May be null.
      • setDescription

        public void setDescription(java.lang.String description)
        Sets the description for this header. This may use HTML, such as that supported by JLabel (version 3.2 of the HTML spec).
        Parameters:
        description - the description. May be null, may be HTML or plain text.
      • getDescription

        public java.lang.String getDescription()
        Gets the description.
        Returns:
        description
      • setIcon

        public void setIcon(javax.swing.Icon icon)
        Sets the icon to use for the header. It is generally recommended that this be an image 64x64 pixels in size, and that the icon have no gaps at the top.
        Parameters:
        icon - may be null
      • getIcon

        public javax.swing.Icon getIcon()
        Gets the icon.
        Returns:
        the Icon being used. May be null.
      • setFont

        public void setFont(java.awt.Font font)
        Sets new font for both, title and description line of the header.
        Overrides:
        setFont in class javax.swing.JComponent
        See Also:
        JComponent.setFont(java.awt.Font)
      • setTitleFont

        public void setTitleFont(java.awt.Font font)
        Sets new font for title.
        Parameters:
        font - New title font.
      • getTitleFont

        public java.awt.Font getTitleFont()
        Gets title font.
        Returns:
        the Font being used. May be null.
      • setDescriptionFont

        public void setDescriptionFont(java.awt.Font font)
        Sets font for the description line of header.
        Parameters:
        font - New description font.
      • getDescriptionFont

        public java.awt.Font getDescriptionFont()
        Gets description font.
        Returns:
        the Font being used. May be null.
      • getTitleForeground

        public java.awt.Color getTitleForeground()
        Gets current title foreground color.
        Returns:
        the Color used to paint title. May be null.
      • setTitleForeground

        public void setTitleForeground(java.awt.Color titleForeground)
        Sets title foreground color.
        Parameters:
        titleForeground - the Color to be used to paint title.
      • getDescriptionForeground

        public java.awt.Color getDescriptionForeground()
        Gets current description foreground color.
        Returns:
        the Color used to paint description. May be null.
      • setDescriptionForeground

        public void setDescriptionForeground(java.awt.Color descriptionForeground)
        Sets description foreground color.
        Parameters:
        descriptionForeground - the Color to be used to paint description.
      • getIconPosition

        public JXHeader.IconPosition getIconPosition()
        Gets current icon position. Default is RIGHT.
        Returns:
        Current Icon position.
      • setIconPosition

        public void setIconPosition(JXHeader.IconPosition iconPosition)
        Sets new Icon position. Position is relative to the text. Default value is RIGHT.
        Parameters:
        iconPosition - new desired icon position
        See Also:
        getIconPosition()
      • getPreferredSize

        public java.awt.Dimension getPreferredSize()
        Overrides:
        getPreferredSize in class javax.swing.JComponent