|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
be.ugent.caagt.swirl.subwindows.Subwindow
public class Subwindow
Wraps a child component into a small `window' with a title bar. Clicking on this title bar collapses the component: the child component is hidden and only the title bar is still visible. Clicking again, resets the subwindow to its full size.
For best effect, subwindows of this kind should be stacked in a container which uses a vertical box layout, as in the folllowing example
Subwindow subwindow1 = new Subwindow(component1, true); Subwindow subwindow2 = new Subwindow(component2, false); JPanel container = new JPanel (); container.setLayout(new BoxLayout (container, BoxLayout.Y_AXIS)); container.add (subwindow1); container.add (subwindow2); container.add (Box.createVerticalGlue()); container.setBackground(Color.WHITE);
Nested Class Summary |
---|
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 |
---|
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 | |
---|---|
Subwindow(javax.swing.JComponent child,
boolean collapsed)
Create a new subwindow which displays the given child component.The name of the child conmoponent is used as the caption of the title bar of this window. |
Method Summary | |
---|---|
void |
addSubwindowListener(SubwindowListener listener)
Register a listener which will be notified of all changes in the collapsed state of the subwindow. |
void |
doLayout()
|
javax.swing.JComponent |
getChildComponent()
Return the child component which is managed by this subwindow. |
int |
getHorizontalWindowPadding()
Horizontal padding for this subwindow. |
java.awt.Dimension |
getMaximumSize()
The maximum size is derived from the maximum size of the child unless it has been explicitely set. |
java.awt.Dimension |
getMinimumSize()
The minimum size is derived from the minimum size of the child unless it has been explicitely set. |
java.awt.Dimension |
getPreferredSize()
The preferred size is derived from the preferred size of the child unless it has been explicitely set. |
java.awt.Color |
getTitleBarBorderColor()
The color of the subwindow border, as set by the user. |
java.awt.Color |
getTitleBarColor()
The color of the title bar. |
java.awt.Color |
getTitleBarColorNoFocus()
The color of the title bar when the subwindow does not own the focus, as set by the user. |
int |
getTitleBarHeight()
The height of the title bar in pixels. |
java.awt.Color |
getTitleBarTextColor()
Return the color for the text of the title bar. |
java.awt.Color |
getTitleBarTextColorNoFocus()
The color of the text in the title bar when the subwindow does not own the focus, as set by the user. |
int |
getVerticalWindowPadding()
Vertical padding for this subwindow. |
boolean |
isCollapsed()
Is this window collapsed? |
void |
paintComponent(java.awt.Graphics g)
|
void |
removeSubwindowListener(SubwindowListener listener)
Undo the registration of the given listener as a subwindow listener. |
void |
setCollapsed(boolean collapsed)
Change the 'collapsed' state of this window. |
void |
setHorizontalWindowPadding(int horizontalWindowPadding)
Sets the horizontal for this subwindow. |
void |
setTitleBarBorderColor(java.awt.Color titleBarBorderColor)
Set the color to be used for the subwindow border. |
void |
setTitleBarColor(java.awt.Color titleBarColor)
Set the color to be used for the title bar. |
void |
setTitleBarColorNoFocus(java.awt.Color titleBarColorNoFocus)
Set the color to be used for the title bar when the subwindow does not own the focus. |
void |
setTitleBarHeight(int titleBarHeight)
Set the height of the title bar. |
void |
setTitleBarTextColor(java.awt.Color titleBarTextColor)
Set the color to be used for the text in the title bar. |
void |
setTitleBarTextColorNoFocus(java.awt.Color titleBarTextColorNoFocus)
Set the color to be used for the text in the title bar when the subwindow does not own the focus. |
void |
setVerticalWindowPadding(int verticalWindowPadding)
Sets the vertical for this subwindow. |
void |
toggleCollapsed()
Toggle the 'collapsed' state of this window. |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, 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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, 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, removeNotify, 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, 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 |
Constructor Detail |
---|
public Subwindow(javax.swing.JComponent child, boolean collapsed)
Method Detail |
---|
public javax.swing.JComponent getChildComponent()
public boolean isCollapsed()
public void setCollapsed(boolean collapsed)
public void toggleCollapsed()
public java.awt.Color getTitleBarColor()
public java.awt.Color getTitleBarColorNoFocus()
public void setTitleBarColor(java.awt.Color titleBarColor)
public void setTitleBarColorNoFocus(java.awt.Color titleBarColorNoFocus)
public java.awt.Color getTitleBarTextColor()
public void setTitleBarTextColor(java.awt.Color titleBarTextColor)
public void setTitleBarTextColorNoFocus(java.awt.Color titleBarTextColorNoFocus)
public java.awt.Color getTitleBarTextColorNoFocus()
public void setTitleBarBorderColor(java.awt.Color titleBarBorderColor)
public java.awt.Color getTitleBarBorderColor()
public int getTitleBarHeight()
public void setTitleBarHeight(int titleBarHeight)
public int getHorizontalWindowPadding()
public void setHorizontalWindowPadding(int horizontalWindowPadding)
public int getVerticalWindowPadding()
public void setVerticalWindowPadding(int verticalWindowPadding)
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public java.awt.Dimension getMaximumSize()
getMaximumSize
in class javax.swing.JComponent
public void doLayout()
doLayout
in class java.awt.Container
public void addSubwindowListener(SubwindowListener listener)
public void removeSubwindowListener(SubwindowListener listener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |