org.jvnet.substance.utils
Class SubstanceTitlePane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by org.jvnet.substance.utils.SubstanceTitlePane
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class SubstanceTitlePane
extends javax.swing.JComponent

Title pane for Substance look and feel.

Author:
Kirill Grouchnikov
See Also:
Serialized Form

Nested Class Summary
protected static class SubstanceTitlePane.AnimationChanger
           
protected static class SubstanceTitlePane.FocusKindChanger
           
static class SubstanceTitlePane.HeapStatusPanel
          Panel that shows heap status and allows running the garbage collector.
static class SubstanceTitlePane.HeapStatusThread
          Thread for heap status panel.
 class SubstanceTitlePane.SubstanceMenuBar
          Class responsible for drawing the system menu.
protected static class SubstanceTitlePane.ThemeChanger
           
 
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
protected  BorderPainterChangeListener borderPainterChangeListener
           
protected  TraitMenuHandler borderPainterMenuHandler
           
protected  ButtonShaperChangeListener buttonShaperChangeListener
           
protected  TraitMenuHandler buttonShaperMenuHandler
           
protected static boolean canHaveHeapStatusPanel
          Indication whether any title pane can have heap status panel.
protected  GradientPainterChangeListener gradientPainterChangeListener
           
protected  TraitMenuHandler gradientPainterMenuHandler
           
static java.lang.String HAS_BEEN_UNINSTALLED
           
static java.lang.String HEAP_STATUS_PANEL_PERMANENT
          Name for the client property that is set on a root pane to specify that the heap status panel should be displayed permanently.
protected static java.lang.String heapStatusLogfileName
          The logfile name for the heap status panel.
protected  javax.swing.JCheckBoxMenuItem heapStatusMenuItem
          The heap status toggle menu item of this title pane.
protected  SubstanceTitlePane.HeapStatusPanel heapStatusPanel
          The heap status panel of this title pane.
protected  java.beans.PropertyChangeListener propertyListener
          Listens on changes to componentOrientation and SubstanceLookAndFeel.WINDOW_MODIFIED properties.
protected  java.awt.event.MouseListener substanceDebugUiListener
           
protected  ThemeChangeListener themeChangeListener
           
protected  TraitMenuHandler themeMenuHandler
           
protected  TitlePainterChangeListener titlePainterChangeListener
           
protected  TraitMenuHandler titlePainterMenuHandler
           
protected  WatermarkChangeListener watermarkChangeListener
           
protected  TraitMenuHandler watermarkMenuHandler
           
 
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
SubstanceTitlePane(javax.swing.JRootPane root, SubstanceRootPaneUI ui)
          Creates a new title pane.
 
Method Summary
 void addNotify()
           
protected  javax.swing.JMenuBar createMenuBar()
          Returns the JMenuBar displaying the appropriate system menu items.
static void dump(java.awt.Component comp, int level)
           
static boolean getCanHaveHeapStatusPanel()
          Returns indication whether frame title panes can show the heap status panel.
 javax.swing.JRootPane getRootPane()
          Returns the JRootPane this was created for.
 void paintComponent(java.awt.Graphics g)
           
 void removeNotify()
           
static void setCanHaveHeapStatusPanel(boolean canHaveHeapStatusPanel)
          Sets indication whether frame title panes can show the heap status panel.
static void setHeapStatusLogfileName(java.lang.String heapStatusLogfileName)
          Sets location for heap status logfile.
 void setHeapStatusPanePermanentVisibility(boolean isVisible)
          Makes the heap status panel appear / disappear permanently on the associated title pane and removes the corresponding check box menu items from the system menu.
protected  void syncCloseButtonTooltip()
          Synchronizes the tooltip of the close button.
 void uninstall()
          Uninstalls the necessary state.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, 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, updateUI
 
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

HEAP_STATUS_PANEL_PERMANENT

public static final java.lang.String HEAP_STATUS_PANEL_PERMANENT
Name for the client property that is set on a root pane to specify that the heap status panel should be displayed permanently.

See Also:
Constant Field Values

canHaveHeapStatusPanel

protected static boolean canHaveHeapStatusPanel
Indication whether any title pane can have heap status panel.


heapStatusLogfileName

protected static java.lang.String heapStatusLogfileName
The logfile name for the heap status panel. Can be null - in this case the SubstanceTitlePane.HeapStatusThread will not write heap information.


heapStatusPanel

protected SubstanceTitlePane.HeapStatusPanel heapStatusPanel
The heap status panel of this title pane.


heapStatusMenuItem

protected javax.swing.JCheckBoxMenuItem heapStatusMenuItem
The heap status toggle menu item of this title pane.


propertyListener

protected java.beans.PropertyChangeListener propertyListener
Listens on changes to componentOrientation and SubstanceLookAndFeel.WINDOW_MODIFIED properties.


themeMenuHandler

protected TraitMenuHandler themeMenuHandler

themeChangeListener

protected ThemeChangeListener themeChangeListener

watermarkMenuHandler

protected TraitMenuHandler watermarkMenuHandler

watermarkChangeListener

protected WatermarkChangeListener watermarkChangeListener

buttonShaperMenuHandler

protected TraitMenuHandler buttonShaperMenuHandler

buttonShaperChangeListener

protected ButtonShaperChangeListener buttonShaperChangeListener

gradientPainterMenuHandler

protected TraitMenuHandler gradientPainterMenuHandler

gradientPainterChangeListener

protected GradientPainterChangeListener gradientPainterChangeListener

titlePainterMenuHandler

protected TraitMenuHandler titlePainterMenuHandler

titlePainterChangeListener

protected TitlePainterChangeListener titlePainterChangeListener

borderPainterMenuHandler

protected TraitMenuHandler borderPainterMenuHandler

borderPainterChangeListener

protected BorderPainterChangeListener borderPainterChangeListener

substanceDebugUiListener

protected java.awt.event.MouseListener substanceDebugUiListener

HAS_BEEN_UNINSTALLED

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

SubstanceTitlePane

public SubstanceTitlePane(javax.swing.JRootPane root,
                          SubstanceRootPaneUI ui)
Creates a new title pane.

Parameters:
root - Root pane.
ui - Root pane UI.
Method Detail

uninstall

public void uninstall()
Uninstalls the necessary state.


getRootPane

public javax.swing.JRootPane getRootPane()
Returns the JRootPane this was created for.

Overrides:
getRootPane in class javax.swing.JComponent

addNotify

public void addNotify()
Overrides:
addNotify in class javax.swing.JComponent

removeNotify

public void removeNotify()
Overrides:
removeNotify in class javax.swing.JComponent

createMenuBar

protected javax.swing.JMenuBar createMenuBar()
Returns the JMenuBar displaying the appropriate system menu items.

Returns:
JMenuBar displaying the appropriate system menu items.

paintComponent

public void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

setCanHaveHeapStatusPanel

public static void setCanHaveHeapStatusPanel(boolean canHaveHeapStatusPanel)
Sets indication whether frame title panes can show the heap status panel.

Parameters:
canHaveHeapStatusPanel - if true, title panes can show the heap status panel.

getCanHaveHeapStatusPanel

public static boolean getCanHaveHeapStatusPanel()
Returns indication whether frame title panes can show the heap status panel.

Returns:
true if the frame title panes can show the heap status panel, false otherwise.

setHeapStatusLogfileName

public static void setHeapStatusLogfileName(java.lang.String heapStatusLogfileName)
Sets location for heap status logfile. Relevant if setCanHaveHeapStatusPanel(boolean) was called with true.

Parameters:
heapStatusLogfileName - Logfile for the heap status panel.

setHeapStatusPanePermanentVisibility

public void setHeapStatusPanePermanentVisibility(boolean isVisible)
Makes the heap status panel appear / disappear permanently on the associated title pane and removes the corresponding check box menu items from the system menu.

Parameters:
isVisible - if true, the heap status panel will be permanently shown, if false, the heap status panel will be permanently hidden.

syncCloseButtonTooltip

protected void syncCloseButtonTooltip()
Synchronizes the tooltip of the close button.


dump

public static void dump(java.awt.Component comp,
                        int level)