net.sourceforge.mlf.metouia
Class MetouiaInternalFrameTitlePane

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.plaf.basic.BasicInternalFrameTitlePane
                  extended byjavax.swing.plaf.metal.MetalInternalFrameTitlePane
                      extended bynet.sourceforge.mlf.metouia.MetouiaInternalFrameTitlePane
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.LayoutManager, java.awt.MenuContainer, java.io.Serializable

public class MetouiaInternalFrameTitlePane
extends javax.swing.plaf.metal.MetalInternalFrameTitlePane
implements java.awt.LayoutManager

This class represents the title pane for the JInternalFrame components.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.plaf.basic.BasicInternalFrameTitlePane
javax.swing.plaf.basic.BasicInternalFrameTitlePane.CloseAction, javax.swing.plaf.basic.BasicInternalFrameTitlePane.IconifyAction, javax.swing.plaf.basic.BasicInternalFrameTitlePane.MaximizeAction, javax.swing.plaf.basic.BasicInternalFrameTitlePane.MoveAction, javax.swing.plaf.basic.BasicInternalFrameTitlePane.PropertyChangeHandler, javax.swing.plaf.basic.BasicInternalFrameTitlePane.RestoreAction, javax.swing.plaf.basic.BasicInternalFrameTitlePane.SizeAction, javax.swing.plaf.basic.BasicInternalFrameTitlePane.SystemMenuBar, javax.swing.plaf.basic.BasicInternalFrameTitlePane.TitlePaneLayout
 
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  MetouiaDots dots
          The shared instance of the Metouia dots.
protected  int frameTitleHeight
          The frame's title height, read from the UIDefaults table.
protected  MetouiaDots paletteDots
          The shared instance of the Metouia dots for palette, initialized when needed.
 
Fields inherited from class javax.swing.plaf.metal.MetalInternalFrameTitlePane
isPalette, paletteCloseIcon, paletteTitleHeight
 
Fields inherited from class javax.swing.plaf.basic.BasicInternalFrameTitlePane
CLOSE_CMD, closeAction, closeButton, closeIcon, frame, iconButton, iconIcon, ICONIFY_CMD, iconifyAction, maxButton, maxIcon, MAXIMIZE_CMD, maximizeAction, menuBar, minIcon, MOVE_CMD, moveAction, notSelectedTextColor, notSelectedTitleColor, propertyChangeListener, RESTORE_CMD, restoreAction, selectedTextColor, selectedTitleColor, SIZE_CMD, sizeAction, windowMenu
 
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
MetouiaInternalFrameTitlePane(javax.swing.JInternalFrame frame)
          This constructor creates a title pane for the given internal frame instance.
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component c)
          Adds the specified component with the specified name to the layout.
protected  void createButtons()
          Creates the buttons of the title pane and initilizes their actions.
protected  java.awt.LayoutManager createLayout()
          Creates the layout manager for the title pane.
 java.awt.Dimension getMinimumSize()
          The minimum size of the frame.
 java.awt.Dimension getPreferredSize(java.awt.Container c)
          Gets the preferred size of the given container.
protected  void installDefaults()
          Installs some default values.
 void layoutContainer(java.awt.Container c)
          Lays out the container in the specified panel.
 java.awt.Dimension minimumLayoutSize(java.awt.Container c)
          Calculates the minimum size dimensions for the specified panel given the components in the specified parent container.
 void paintComponent(java.awt.Graphics g)
          Paints this component.
 void paintPalette(java.awt.Graphics g)
          Paints the title pane for a palette.
 java.awt.Dimension preferredLayoutSize(java.awt.Container c)
          Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.
 void removeLayoutComponent(java.awt.Component c)
          Removes the specified component from the layout.
 
Methods inherited from class javax.swing.plaf.metal.MetalInternalFrameTitlePane
addNotify, addSubComponents, addSystemMenuItems, assembleSystemMenu, createPropertyChangeListener, setPalette, showSystemMenu, uninstallDefaults
 
Methods inherited from class javax.swing.plaf.basic.BasicInternalFrameTitlePane
createActions, createSystemMenu, createSystemMenuBar, enableActions, getTitle, installListeners, installTitlePane, paintTitleBackground, postClosingEvent, setButtonIcons, uninstallListeners
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, 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
 

Field Detail

frameTitleHeight

protected int frameTitleHeight
The frame's title height, read from the UIDefaults table.


dots

protected MetouiaDots dots
The shared instance of the Metouia dots.


paletteDots

protected MetouiaDots paletteDots
The shared instance of the Metouia dots for palette, initialized when needed.

Constructor Detail

MetouiaInternalFrameTitlePane

public MetouiaInternalFrameTitlePane(javax.swing.JInternalFrame frame)
This constructor creates a title pane for the given internal frame instance.

Parameters:
frame - The internal frame that needs a title pane.
Method Detail

installDefaults

protected void installDefaults()
Installs some default values. Reads the internalframe title height from the ui defaults table.


paintComponent

public void paintComponent(java.awt.Graphics g)
Paints this component.

Parameters:
g - The graphics context to use.

createLayout

protected java.awt.LayoutManager createLayout()
Creates the layout manager for the title pane.

Returns:
The layout manager for the title pane.

createButtons

protected void createButtons()
Creates the buttons of the title pane and initilizes their actions.


paintPalette

public void paintPalette(java.awt.Graphics g)
Paints the title pane for a palette.

Parameters:
g - The graphics context to use.

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component c)
Adds the specified component with the specified name to the layout.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Parameters:
name - the component name
c - the component to be added

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component c)
Removes the specified component from the layout.

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Parameters:
c - the component to be removed

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container c)
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Parameters:
c - the component to be laid out

getPreferredSize

public java.awt.Dimension getPreferredSize(java.awt.Container c)
Gets the preferred size of the given container.

Parameters:
c - The container to gets its preferred size.
Returns:
The preferred size of the given container.

getMinimumSize

public java.awt.Dimension getMinimumSize()
The minimum size of the frame. This is used, for example, during resizing to find the minimum allowable size. Providing at least some minimum size fixes a bug which breaks horizontal resizing. Note: the Motif plaf allows for a 0,0 min size, but we provide a reasonable minimum here. Future: calculate min size based upon contents.


minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container c)
Calculates the minimum size dimensions for the specified panel given the components in the specified parent container.

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Parameters:
c - the component to be laid out

layoutContainer

public void layoutContainer(java.awt.Container c)
Lays out the container in the specified panel.

Specified by:
layoutContainer in interface java.awt.LayoutManager
Parameters:
c - the component which needs to be laid out