com.imagero.gui.flowin
Class TitleBar

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycom.imagero.gui.flowin.BasicTitleBar
                  extended bycom.imagero.gui.flowin.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.gui.flowin.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 checkPositions()
           
protected  void createTitleLabel()
           
protected  void definePositions()
           
 void doLayout()
          Causes this container to lay out its components.
 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()
          If the minimum size has been set to a non-null value just returns it.
 javax.swing.JPopupMenu getPopup()
           
 javax.swing.AbstractButton getRestoreButton()
           
 javax.swing.AbstractButton getSystemButton()
           
 TitleBarUI getUI()
           
 java.lang.String getUIClassID()
          Returns the UIDefaults key used to look up the name of the swing.plaf.ComponentUI class that defines the look and feel for this component.
 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()
          Resets the UI property to a value from the current look and feel.
 
Methods inherited from class com.imagero.gui.flowin.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, 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, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, 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, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, list, list, paintComponents, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, 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, getSize, getToolkit, getTreeLock, hasFocus, imageUpdate, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, list, list, list, paintAll, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, 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.gui.flowin.SortableContainer
getComponentsOrdered
 

Field Detail

active

protected boolean active

armed

protected boolean armed

closable

protected boolean closable

CLOSE

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

DOCK

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

dockable

protected boolean dockable

docked

protected boolean docked

GLUE

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

maximizable

protected boolean maximizable

MAXIMIZE

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

maximized

protected boolean maximized

minimizable

protected boolean minimizable

MINIMIZE

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

RESTORE

public static final java.lang.String RESTORE
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

UNDOCK

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

TitleBar

public TitleBar()
create horizontal TitleBar


TitleBar

public TitleBar(int axis)
Method Detail

addActionListener

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

checkPositions

protected void checkPositions()

createTitleLabel

protected void createTitleLabel()

definePositions

protected void definePositions()

doLayout

public void doLayout()
Description copied from class: java.awt.Container
Causes this container to lay out its components. Most programs should not call this method directly, but should invoke the validate method instead.

See Also:
LayoutManager.layoutContainer(java.awt.Container), Container.setLayout(java.awt.LayoutManager), Container.validate()

getCloseButton

public javax.swing.AbstractButton getCloseButton()

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

getDockButton

public javax.swing.AbstractButton getDockButton()

getGlueLabel

public javax.swing.JLabel getGlueLabel()

getMaximizeButton

public javax.swing.AbstractButton getMaximizeButton()

getMinimizeButton

public javax.swing.AbstractButton getMinimizeButton()

getMinimumSize

public java.awt.Dimension getMinimumSize()
Description copied from class: javax.swing.JComponent
If the minimum size has been set to a non-null value just returns it. If the UI delegate's getMinimumSize method returns a non-null value then return that; otherwise defer to the component's layout manager.

Returns:
the value of the minimumSize property
See Also:
JComponent.setMinimumSize(java.awt.Dimension), ComponentUI

getPopup

public javax.swing.JPopupMenu getPopup()

getRestoreButton

public javax.swing.AbstractButton getRestoreButton()

getSystemButton

public javax.swing.AbstractButton getSystemButton()

getUI

public TitleBarUI getUI()

getUIClassID

public java.lang.String getUIClassID()
Description copied from class: javax.swing.JComponent
Returns the UIDefaults key used to look up the name of the swing.plaf.ComponentUI class that defines the look and feel for this component. Most applications will never need to call this method. Subclasses of JComponent that support pluggable look and feel should override this method to return a UIDefaults key that maps to the ComponentUI subclass that defines their look and feel.

Returns:
the UIDefaults key for a ComponentUI subclass
See Also:
UIDefaults.getUI(javax.swing.JComponent)

getUndockButton

public javax.swing.AbstractButton getUndockButton()

isActive

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

Returns:

isArmed

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

Returns:
true if TitleBar is armed

isClockwise

public boolean isClockwise()

isClosable

public boolean isClosable()

isDockable

public boolean isDockable()

isMaximizable

public boolean isMaximizable()

isMaximized

public boolean isMaximized()

isMinimizable

public boolean isMinimizable()

isShowTitle

public boolean isShowTitle()

processEvent

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

removeActionListener

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

setActive

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

Parameters:
active -

setArmed

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

Parameters:
armed - boolean

setAxis

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

setClockwise

public void setClockwise(boolean clockwise)

setClosable

public void setClosable(boolean closable)

setCloseButton

public void setCloseButton(javax.swing.AbstractButton closeButton)

setDockable

public void setDockable(boolean b)

setDockButton

public void setDockButton(javax.swing.AbstractButton dockButton)

setDocked

public void setDocked(boolean b)

setGlueLabel

public void setGlueLabel(javax.swing.JLabel label)

setMaximizable

public void setMaximizable(boolean maximizable)

setMaximizeButton

public void setMaximizeButton(javax.swing.AbstractButton maximizeButton)

setMaximized

public void setMaximized(boolean b)

setMinimizable

public void setMinimizable(boolean minimizable)

setMinimizeButton

public void setMinimizeButton(javax.swing.AbstractButton minimizeButton)

setPalette

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

setPopup

public void setPopup(javax.swing.JPopupMenu popup)

setRestoreButton

public void setRestoreButton(javax.swing.AbstractButton restoreButton)

setShowTitle

public void setShowTitle(boolean showTitle)

setSystemButton

public void setSystemButton(javax.swing.AbstractButton systemButton)

setSystemIcon

public void setSystemIcon(javax.swing.Icon icon)

setTitle

public void setTitle(java.lang.String title)

setUndockButton

public void setUndockButton(javax.swing.AbstractButton undockButton)

updateUI

public void updateUI()
Description copied from class: javax.swing.JComponent
Resets the UI property to a value from the current look and feel. JComponent subclasses must override this method like this:
   public void updateUI() {
      setUI((SliderUI)UIManager.getUI(this);
   }
  

See Also:
JComponent.setUI(javax.swing.plaf.ComponentUI), UIManager.getLookAndFeel(), UIManager.getUI(javax.swing.JComponent)