com.imagero.swing.titlebar
Class TitleBar

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycom.imagero.swing.titlebar.BasicTitleBar
                  extended bycom.imagero.swing.titlebar.TitleBar
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, SortableContainer

public class TitleBar
extends BasicTitleBar
implements SortableContainer

TitleBar for FloatingWindow

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean active
           
protected  boolean armed
           
protected  boolean closable
           
static java.lang.String CLOSE
           
static java.lang.String DOCK
           
protected  boolean dockable
           
protected  boolean docked
           
static java.lang.String GLUE
           
protected  boolean maximizable
           
static java.lang.String MAXIMIZE
           
protected  boolean maximized
           
protected  boolean minimizable
           
static java.lang.String MINIMIZE
           
static java.lang.String RESTORE
           
static java.lang.String SYSTEM
           
static java.lang.String TITLE
           
static java.lang.String UNDOCK
           
 
Fields inherited from class com.imagero.swing.titlebar.BasicTitleBar
comparator, LEFT_GLUE, palette, RIGHT_GLUE, STRETCH_FLEX, STRETCH_GROW, STRETCH_NONE, STRETCH_SHRINK
 
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
TitleBar()
          create horizontal TitleBar
TitleBar(int axis)
           
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
           
protected  void checkButtons()
           
protected  void checkPositions()
           
protected  void createTitleLabel()
           
protected  void definePositions()
           
 void doLayout()
           
 javax.swing.AbstractButton getCloseButton()
           
 java.util.Comparator getComparator()
          Get Comparator used to sort Components.
 javax.swing.AbstractButton getDockButton()
           
 javax.swing.JLabel getGlueLabel()
           
 javax.swing.AbstractButton getMaximizeButton()
           
 javax.swing.AbstractButton getMinimizeButton()
           
 java.awt.Dimension getMinimumSize()
           
 javax.swing.JPopupMenu getPopup()
           
 javax.swing.AbstractButton getRestoreButton()
           
 javax.swing.AbstractButton getSystemButton()
           
 TitleBarUI getUI()
           
 java.lang.String getUIClassID()
           
 javax.swing.AbstractButton getUndockButton()
           
 boolean isActive()
          Determine if this tool bar is currently active.
 boolean isArmed()
          true if TitleBar is armed (e.g. if FloatingWindow can be docked)
 boolean isClockwise()
           
 boolean isClosable()
           
 boolean isDockable()
           
 boolean isMaximizable()
           
 boolean isMaximized()
           
 boolean isMinimizable()
           
 boolean isShowTitle()
           
 void processEvent(java.awt.event.ActionEvent e)
           
 void removeActionListener(java.awt.event.ActionListener l)
           
 void setActive(boolean active)
          Sets active state of this title bar.
 void setArmed(boolean armed)
          set or clear armed state for TitleBar
 void setAxis(int axis)
           
 void setClockwise(boolean clockwise)
           
 void setClosable(boolean closable)
           
 void setCloseButton(javax.swing.AbstractButton closeButton)
           
 void setDockable(boolean b)
           
 void setDockButton(javax.swing.AbstractButton dockButton)
           
 void setDocked(boolean b)
           
 void setGlueLabel(javax.swing.JLabel label)
           
 void setMaximizable(boolean maximizable)
           
 void setMaximizeButton(javax.swing.AbstractButton maximizeButton)
           
 void setMaximized(boolean b)
           
 void setMinimizable(boolean minimizable)
           
 void setMinimizeButton(javax.swing.AbstractButton minimizeButton)
           
 void setPalette(boolean palette)
           
 void setPopup(javax.swing.JPopupMenu popup)
           
 void setRestoreButton(javax.swing.AbstractButton restoreButton)
           
 void setShowTitle(boolean showTitle)
           
 void setSystemButton(javax.swing.AbstractButton systemButton)
           
 void setSystemIcon(javax.swing.Icon icon)
           
 void setTitle(java.lang.String title)
           
 void setUndockButton(javax.swing.AbstractButton undockButton)
           
 void updateUI()
           
 
Methods inherited from class com.imagero.swing.titlebar.BasicTitleBar
add, add, add, add, addImpl, checkComponentPosition, defineComponentPosition, getAxis, getButton, getComponent, getComponentsOrdered, isPalette, remove, setLayout
 
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, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, 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, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, 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, imageUpdate, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.imagero.swing.layout.SortableContainer
getComponentsOrdered
 

Field Detail

MAXIMIZE

public static final java.lang.String MAXIMIZE
See Also:
Constant Field Values

MINIMIZE

public static final java.lang.String MINIMIZE
See Also:
Constant Field Values

CLOSE

public static final java.lang.String CLOSE
See Also:
Constant Field Values

RESTORE

public static final java.lang.String RESTORE
See Also:
Constant Field Values

UNDOCK

public static final java.lang.String UNDOCK
See Also:
Constant Field Values

DOCK

public static final java.lang.String DOCK
See Also:
Constant Field Values

SYSTEM

public static final java.lang.String SYSTEM
See Also:
Constant Field Values

TITLE

public static final java.lang.String TITLE
See Also:
Constant Field Values

GLUE

public static final java.lang.String GLUE
See Also:
Constant Field Values

armed

protected boolean armed

active

protected boolean active

maximized

protected boolean maximized

docked

protected boolean docked

closable

protected boolean closable

maximizable

protected boolean maximizable

minimizable

protected boolean minimizable

dockable

protected boolean dockable
Constructor Detail

TitleBar

public TitleBar()
create horizontal TitleBar


TitleBar

public TitleBar(int axis)
Method Detail

getComparator

public java.util.Comparator getComparator()
Description copied from interface: SortableContainer
Get Comparator used to sort Components. If this method returns null, then Components should be in their natural order.

Specified by:
getComparator in interface SortableContainer
Overrides:
getComparator in class BasicTitleBar

getSystemButton

public javax.swing.AbstractButton getSystemButton()

isClockwise

public boolean isClockwise()

setClockwise

public void setClockwise(boolean clockwise)

setAxis

public void setAxis(int axis)
Overrides:
setAxis in class BasicTitleBar

setSystemButton

public void setSystemButton(javax.swing.AbstractButton systemButton)

getMinimizeButton

public javax.swing.AbstractButton getMinimizeButton()

setMinimizeButton

public void setMinimizeButton(javax.swing.AbstractButton minimizeButton)

getMaximizeButton

public javax.swing.AbstractButton getMaximizeButton()

setMaximizeButton

public void setMaximizeButton(javax.swing.AbstractButton maximizeButton)

getCloseButton

public javax.swing.AbstractButton getCloseButton()

setCloseButton

public void setCloseButton(javax.swing.AbstractButton closeButton)

getDockButton

public javax.swing.AbstractButton getDockButton()

setDockButton

public void setDockButton(javax.swing.AbstractButton dockButton)

getUndockButton

public javax.swing.AbstractButton getUndockButton()

setUndockButton

public void setUndockButton(javax.swing.AbstractButton undockButton)

setGlueLabel

public void setGlueLabel(javax.swing.JLabel label)

getGlueLabel

public javax.swing.JLabel getGlueLabel()

getRestoreButton

public javax.swing.AbstractButton getRestoreButton()

setRestoreButton

public void setRestoreButton(javax.swing.AbstractButton restoreButton)

isArmed

public boolean isArmed()
true if TitleBar is armed (e.g. if FloatingWindow can be docked)

Returns:
true if TitleBar is armed

setArmed

public void setArmed(boolean armed)
set or clear armed state for TitleBar

Parameters:
armed - boolean

setTitle

public void setTitle(java.lang.String title)

setSystemIcon

public void setSystemIcon(javax.swing.Icon icon)

setMaximized

public void setMaximized(boolean b)

isMaximized

public boolean isMaximized()

setDocked

public void setDocked(boolean b)

isDockable

public boolean isDockable()

setDockable

public void setDockable(boolean b)

isShowTitle

public boolean isShowTitle()

setShowTitle

public void setShowTitle(boolean showTitle)

addActionListener

public void addActionListener(java.awt.event.ActionListener l)

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)

processEvent

public void processEvent(java.awt.event.ActionEvent e)

checkPositions

protected void checkPositions()

definePositions

protected void definePositions()

createTitleLabel

protected void createTitleLabel()

getUI

public TitleBarUI getUI()

updateUI

public void updateUI()

getUIClassID

public java.lang.String getUIClassID()

setPalette

public void setPalette(boolean palette)
Overrides:
setPalette in class BasicTitleBar

doLayout

public void doLayout()

getMinimumSize

public java.awt.Dimension getMinimumSize()

checkButtons

protected void checkButtons()

isMaximizable

public boolean isMaximizable()

setMaximizable

public void setMaximizable(boolean maximizable)

isMinimizable

public boolean isMinimizable()

setMinimizable

public void setMinimizable(boolean minimizable)

isClosable

public boolean isClosable()

setClosable

public void setClosable(boolean closable)

isActive

public boolean isActive()
Determine if this tool bar is currently active. (Active tool bar is usually highlighted).

Returns:

setActive

public void setActive(boolean active)
Sets active state of this title bar. Ignored if isPalette() returns true.

Parameters:
active -

getPopup

public javax.swing.JPopupMenu getPopup()

setPopup

public void setPopup(javax.swing.JPopupMenu popup)