|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
com.sygem.swing.joutlooknavbar.NavBarItem
Class representing a single category item.
The appearance of the item is controlled using the State class. Each item has three states:
Title: JOutlookNavBar
Description: A Swing component simulating Outlook's Nav Bar
Copyright: Copyright (c) 2004
Company: SyGem Software
Nested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary |
Fields inherited from class javax.swing.JComponent |
TOOL_TIP_TEXT_KEY, 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 javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
NavBarItem(java.lang.String title)
Creates a new NavBarItem with the specified title. |
Method Summary | |
void |
addActionListener(java.awt.event.ActionListener listener)
Adds an ActionListener to this item. |
BackgroundRenderer |
getBackgroundRenderer()
Returns the renderer currently being used for this item. |
State |
getItemSelectedState()
Returns the State representing the item's appearance when selected. |
State |
getMouseNotOverState()
Returns the State representing the item's appearance when tje mouse is not over it, and it is not selected. |
State |
getMouseOverState()
Returns the State representing the item's appearance when the mouse is over it, and it is not selected. |
boolean |
isSelected()
Returns TRUE if this NavBarItem is currently selected. |
void |
removeActionListener(java.awt.event.ActionListener listener)
Removes an ActionListener from this item. |
void |
setBackgroundRenderer(BackgroundRenderer backgroundRenderer)
Registers a new background renderer for this item. |
void |
setHorizontalAlignment(int alignment)
Sets the horizontal text alignment for each of the three states. |
void |
setHorizontalTextPosition(int textPosition)
Sets the horizontal text position for each of the three states. |
void |
setIcon(javax.swing.ImageIcon imageIcon)
Sets the icon to display for this item. |
void |
setItemColor(java.awt.Color c)
Sets the color of the item text across all three states. |
void |
setItemFont(java.awt.Font font)
Sets the Font used to display the text of this item. |
void |
setItemSelectedState(State itemSelectedState)
Sets the State used to represent the item when it is selected. |
void |
setMouseNotOverState(State mouseNotOverState)
Sets the State used to represent the item when the mouse is not over it, and it is not selected. |
void |
setMouseOverState(State mouseOverState)
Sets the State used to represent the item when the mouse is over it, and it is not selected. |
void |
setSelected(boolean selected)
Sets whether or not the NavBarItem is selected. |
void |
setText(java.lang.String title)
Sets the text of this item. |
void |
setVerticalAlignment(int alignment)
Sets the default vertical text alignment for each of the three states. |
void |
setVerticalTextPosition(int textPosition)
Sets the vertical text position for each of the three states. |
Methods inherited from class javax.swing.JLabel |
getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setIcon, setIconTextGap, setLabelFor, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NavBarItem(java.lang.String title)
title
- The title of this item.Method Detail |
public void addActionListener(java.awt.event.ActionListener listener)
listener
- The ActionListener to be addedpublic BackgroundRenderer getBackgroundRenderer()
null
.
null
public State getItemSelectedState()
State
public State getMouseNotOverState()
State
public State getMouseOverState()
State
public boolean isSelected()
public void removeActionListener(java.awt.event.ActionListener listener)
listener
- The ActionListener to be removedpublic void setBackgroundRenderer(BackgroundRenderer backgroundRenderer)
backgroundRenderer
- The BackgroundRenderer to use as the renderer for this category.public void setHorizontalAlignment(int alignment)
Sets the horizontal text alignment for each of the three states.
NOTE: These changes will be overriden if the changes are made before the item is added to a category.
alignment
- One of the following constants defined in SwingConstants: LEFT, CENTER (the default), RIGHT, LEADING or TRAILING.JLabel.setHorizontalAlignment(int)
,
NavBarCategory.setHorizontalAlignment(int)
,
State.setHorizontalAlignment(int)
public void setHorizontalTextPosition(int textPosition)
Sets the horizontal text position for each of the three states.
NOTE: These changes will be overriden if the changes are made before the item is added to a category.
textPosition
- One of the following constants defined in SwingConstants: LEFT, CENTER (default), RIGHT, LEADING, or TRAILING.JLabel.setHorizontalTextPosition(int)
,
NavBarCategory.setHorizontalTextPosition(int)
,
State.setHorizontalTextPosition(int)
public void setIcon(javax.swing.ImageIcon imageIcon)
imageIcon
- The icon to display for this item.public void setItemColor(java.awt.Color c)
c
- The new Color to use for the text of this itempublic void setItemFont(java.awt.Font font)
font
- The new Font for this itempublic void setItemSelectedState(State itemSelectedState)
itemSelectedState
- The new item-selected StateState
public void setMouseNotOverState(State mouseNotOverState)
mouseNotOverState
- The new mouse-not-over StateState
public void setMouseOverState(State mouseOverState)
mouseOverState
- The new mouse-over StateState
public void setSelected(boolean selected)
selected
- TRUE if the NavBarItem should appear selected.public void setText(java.lang.String title)
title
- The updated text for this itempublic void setVerticalAlignment(int alignment)
Sets the default vertical text alignment for each of the three states.
NOTE: These changes will be overriden if the changes are made before the item is added to a category.
alignment
- One of the following constants defined in SwingConstants: TOP, CENTER (the default), or BOTTOM.JLabel.setVerticalAlignment(int)
,
setVerticalAlignment(int)
,
State.setVerticalAlignment(int)
public void setVerticalTextPosition(int textPosition)
Sets the vertical text position for each of the three states.
NOTE: These changes will be overriden if the changes are made before the item is added to a category.
textPosition
- One of the following constants defined in SwingConstants: TOP, CENTER, or BOTTOM (the default).JLabel.setVerticalTextPosition(int)
,
NavBarCategory.setVerticalTextPosition(int)
,
State.setVerticalTextPosition(int)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |