| 
||||||||||
| 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.JPanel
com.cosylab.gui.components.PanelTitleBar
public class PanelTitleBar
This is a JComponent, which is a combination of a label and a
 toolbar. It contains an Icon read-write property called
 icon,  which sets the icon to be displayed in the left part of
 the title bar. The String read-write property
 title, which is the text written to the right of the icon, and
 a set of JButton objects displayed on the right side of the
 title bar or below the label. 
 The default color of the title bar is retrieved from the ColorHelper class and can change with
 different virtual machines and L&Fs. Two different colors are used: focus
 color for the left start of the background gradient and textHighlight color
 for the right part. When the PanelTitleBar is not in active state, the
 whole bar is painted with the background color. The changes of state can be
 achieved by calling the setActive()  method.
TitledPanel, 
Serialized Form| Nested Class Summary | 
|---|
| 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 | |
|---|---|
static java.lang.String | 
ACTION_STICKY
DOCUMENT ME!  | 
static java.lang.String | 
ACTION_VISIBLE
DOCUMENT ME!  | 
| 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 | |
|---|---|
PanelTitleBar()
Constructs a default empty PanelTitleBar. | 
|
PanelTitleBar(java.lang.String title)
Constructs a PanelTitleBar with a title. | 
|
PanelTitleBar(java.lang.String title,
              javax.swing.Icon icon,
              int height)
Constructs a PanelTitleBar with a defined height, a title
 and an icon. | 
|
| Method Summary | |
|---|---|
 void | 
addActionButton(javax.swing.Action action)
Adds a button activating the specified action to the component.  | 
 void | 
addActionButton(int index,
                javax.swing.Action action)
Adds a button activating the specified action to the component at the index specified.  | 
 void | 
addButton(javax.swing.AbstractButton button)
Adds a button to this component.  | 
 void | 
addButton(int index,
          javax.swing.AbstractButton button)
Adds an AbstractButton to this title bar. | 
 boolean | 
containsAction(javax.swing.Action action)
Returns true if this title  button contains specified
 action. | 
 boolean | 
containsButton(javax.swing.AbstractButton button)
Returns true if this title  button contains specified
 button. | 
 java.awt.Color | 
getBackgroundStart()
Returns the color used for active background.  | 
protected  java.util.ArrayList | 
getButtonsList()
 | 
 javax.swing.Icon | 
getIcon()
Gets the icon property. | 
 javax.swing.border.Border | 
getOverBorder()
DOCUMENT ME!  | 
 javax.swing.border.Border | 
getPressedBorder()
DOCUMENT ME!  | 
 java.lang.String | 
getTitle()
Gets the title property. | 
 int | 
getTitleBarHeight()
Returns the higth of panel with the title bar.  | 
 GradientLabel | 
getTitleLabel()
DOCUMENT ME!  | 
 boolean | 
hasAction(javax.swing.Action act)
DOCUMENT ME!  | 
 void | 
removeActionButton(javax.swing.Action action)
Removes the button connected to the specified action from this title bar.  | 
 void | 
removeButton(javax.swing.AbstractButton button)
Removes the specified button from this title bar.  | 
 void | 
setActive(boolean active)
Sets the state of this title bar.  | 
 void | 
setBackground(java.awt.Color c)
Sets the background color of inactive title bar and the right color of an active title bar.  | 
 void | 
setBackground(java.awt.Color backgroundStart,
              java.awt.Color background)
Sets the background colors for the component.  | 
 void | 
setBackgroundStart(java.awt.Color c)
Returns the color used for active background.  | 
 void | 
setIcon(javax.swing.Icon icon)
Sets the icon property. | 
 void | 
setOverBorder(javax.swing.border.Border overBorder)
Sets the overBorder.  | 
 void | 
setPressedBorder(javax.swing.border.Border pressedBorder)
Sets the pressedBorder.  | 
 void | 
setTitle(java.lang.String title)
Sets the title property, which is displayed in the top-left area of this title bar.  | 
| Methods inherited from class javax.swing.JPanel | 
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI | 
| 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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, setFont, 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, transferFocusBackward, 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, transferFocusUpCycle | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static final java.lang.String ACTION_STICKY
public static final java.lang.String ACTION_VISIBLE
| Constructor Detail | 
|---|
public PanelTitleBar(java.lang.String title,
                     javax.swing.Icon icon,
                     int height)
PanelTitleBar with a defined height, a title
 and an icon.
title - The String that labels the title bar.icon - The Icon which will be displayed in the left.height - Height of the title bar and size of the buttons.public PanelTitleBar(java.lang.String title)
PanelTitleBar with a title. The height is set
 to 24 points and there is no icon shown.
title - The String that labels the title bar.public PanelTitleBar()
PanelTitleBar.  The title bar is
 24 points high, has no title or icon and contains no buttons.
| Method Detail | 
|---|
public java.lang.String getTitle()
title property.
String that labels this title bar.public void setTitle(java.lang.String title)
title - The text to be shown as the title.public javax.swing.Icon getIcon()
icon property.
Icon that is displayed by this title
         bar.public void setIcon(javax.swing.Icon icon)
icon property. The Icon passed as the
 parameter to this method is displayed in the top left corner of this
 panel.
icon - the icon to be set.setIcon(Icon)
public void addButton(int index,
                      javax.swing.AbstractButton button)
AbstractButton to this title bar. Note that all the
 user has to provide is the button's icon and an associated action. All
 the behaviour needed for the button to fit into the title bar will be
 added to the button by the PanelTitleBar.  The button will
 be resized to a square with the same size as the  height of the bar.
 Its background color will be changed  to that of the bar and the border
 will be removed.  Some mouse and keyboard sensitivity will be added to
 the button.
index - DOCUMENT ME!button - The button to be added to the title bar.removeButton(AbstractButton)public void addButton(javax.swing.AbstractButton button)
button - addActionButton(int, Action)
public void addActionButton(int index,
                            javax.swing.Action action)
index - action - addButton(int, AbstractButton)public void addActionButton(javax.swing.Action action)
action - addButton(int, AbstractButton)public void removeButton(javax.swing.AbstractButton button)
button - The button to be removed.public boolean containsButton(javax.swing.AbstractButton button)
true if this title  button contains specified
 button.
button - The button to be tested for containment
true if button is on this title panelpublic void removeActionButton(javax.swing.Action action)
action - The button to be removed.public boolean containsAction(javax.swing.Action action)
true if this title  button contains specified
 action.
action - The action to be tested for containment
true if action is on this title panelpublic void setActive(boolean active)
active parameter is
 true, the background will be changed to the Metal L&F's focus color,
 otherwise it will be changed to the window title background color.
active - The flag determining the state of the title bar.public GradientLabel getTitleLabel()
protected java.util.ArrayList getButtonsList()
public java.awt.Color getBackgroundStart()
public void setBackgroundStart(java.awt.Color c)
c - The color that should be used as the background for active
        PanelTitleBar
public void setBackground(java.awt.Color backgroundStart,
                          java.awt.Color background)
backgroundStart - The color used for left part of the component
        when activebackground - The color used for right part of active background and
        inactive background.public void setBackground(java.awt.Color c)
setBackground in class javax.swing.JComponentsetBackgroundStart(Color)public javax.swing.border.Border getOverBorder()
public javax.swing.border.Border getPressedBorder()
public void setOverBorder(javax.swing.border.Border overBorder)
overBorder - The overBorder to setpublic void setPressedBorder(javax.swing.border.Border pressedBorder)
pressedBorder - The pressedBorder to setpublic boolean hasAction(javax.swing.Action act)
act - 
public int getTitleBarHeight()
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||