public abstract class MultiViewWindow extends javax.swing.JPanel implements DockingWindow, ActionDelegate, ConfigurableUnit
MultiViewOptionsWindow
are subclasses since
the functionality is very multipurpose. The overall layout can be switched programmatically to
enable multi view windows for all available positions within the docking manager (left, right,
top, bottom, center). This window type is called polymorphic since it changes its content
dynamically (here: if the master docking window is activated). The CardLayout
allows developers to add multiple components being placed at the same position. One component
is declared to be the active one and will be displayed automatically.
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.util.Hashtable<java.lang.String,WindowView> |
cacheViewByID
Remembers the view IDs.
|
protected int |
counter
Counter for unique IDs.
|
protected java.lang.String |
helpID
Help system ID from the application (must be delegated).
|
protected int |
orientation
The orientation of the components (use
SwingConstants.HORIZONTAL (default) or SwingConstants.VERTICAL ). |
protected WindowParamDef |
windowParams
Data holder for the docking window parameters.
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
MultiViewWindow()
Constructor for the GUI component.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addView(WindowView view)
Adds a new view for the multi view pane.
|
void |
configureUnit(java.lang.String id,
Configuration config)
Restores values from persistent data stores.
|
protected void |
finalize()
Clean-up method to help the gc.
|
WindowView |
findView(java.lang.Class type)
Provides the first-best parental view for a certain view class.
|
WindowView |
findView(java.awt.Component comp)
Provides the parental view for a component.
|
WindowView |
findView(java.lang.String id)
Provides the parental view for a certain view identifier.
|
ActionDelegate |
getActionDelegate()
Provides the optional action delegate responsible for shared buttons and menu items.
|
java.awt.Component |
getComponent()
Provides the component to be displayed in the center of the docking manager.
|
DockingManager |
getDockingManager()
Provides the docking manager specified when
windowAdded() was called. |
javax.swing.ImageIcon |
getIcon()
Provides the graphical icon of the window used for display.
|
java.lang.String |
getID()
Provides the identifier for the window.
|
int |
getMode()
Provides the mode the the window is presented.
|
int |
getPreferredHeight()
Provides the preferred height of the component for TOP and BOTTOM locations.
|
int |
getPreferredWidth()
Provides the preferred width of the component for LEFT and RIGHT locations.
|
boolean |
getShowButtons()
Provides the visibility of the buttons on the left side of the component.
|
java.lang.String[] |
getSupportedActions()
Provides the supported shared actions for this delegate.
|
java.lang.String |
getTitle()
Provides the title of the window used for display.
|
java.lang.String |
getToolTip()
Provides the tooltip of the window used for display.
|
WindowView |
getVisibleView()
Provides the multi view pane selection (view).
|
java.lang.String |
getVisibleViewID()
Provides the multi view pane selection (view ID).
|
int |
getWindowHeight()
Provides the height when in window mode.
|
int |
getWindowLocation()
Provides the last location of the window passed to the
windowxxx() methods. |
int |
getWindowLocationX()
Provides the location on the x-axis when in window mode.
|
int |
getWindowLocationY()
Provides the location on the y-axis when in window mode.
|
int |
getWindowState()
Provides the state (iconified etc.) when in window mode.
|
int |
getWindowWidth()
Provides the width when in window mode.
|
boolean |
isAutomatic()
Provides if the window may be controlled externally.
|
boolean |
isButtonPressed()
Provides the info whether the window is showing or not (hidden).
|
boolean |
isButtonVisible()
Provides the info whether the control button is visible or not.
|
boolean |
isGrowing()
Provides if the window fills the location completely.
|
boolean |
isWindowMode()
Provides the info whether the window is being displayed as separate window.
|
boolean |
isWindowVisible()
Provides if the window is currently being shown.
|
void |
processAction(SharedAction action)
Indicates that the given action was initiated and must be processed.
|
void |
refresh()
Updates the contents of the docking window.
|
WindowView |
removeView(java.lang.String id)
Removes a view from the multi view pane.
|
WindowView |
removeView(WindowView view)
Removes a view from the multi view pane.
|
void |
setAutomatic(boolean enable)
Sets if the window may be controlled externally.
|
void |
setButtonPressed(boolean pressed)
Sets the info whether the window is showing or not (hidden).
|
void |
setButtonVisible(boolean visible)
Sets the info whether the control button is visible or not.
|
void |
setGrowing(boolean enable)
Sets if the window fills the location completely.
|
void |
setHelpID(java.lang.String helpid)
Sets the identifier for the context sensitive help (must be delegated).
|
void |
setID(java.lang.String id)
Sets the identifier for the window.
|
void |
setMode(int mode)
Sets the mode the the window is presented.
|
void |
setOrientation(int layout)
Sets the window layout to either horizontal or vertical.
|
void |
setPreferredHeight(int height)
Sets the preferred height of the component for TOP and BOTTOM locations.
|
void |
setPreferredWidth(int width)
Sets the preferred width of the component for LEFT and RIGHT locations.
|
void |
setShowButtons(boolean show)
Sets the visibility of the buttons on the left side of the component.
|
void |
setVisibleView(java.awt.Component comp)
Provides the multi view pane selection (view).
|
void |
setVisibleView(java.lang.String id)
Provides the multi view pane selection (view).
|
void |
setWindowHeight(int height)
Sets the height when in window mode.
|
void |
setWindowLocationX(int locx)
Sets the location on the x-axis when in window mode.
|
void |
setWindowLocationY(int locy)
Sets the location on the y-axis when in window mode.
|
void |
setWindowMode(boolean enable)
Sets the info whether the window is being displayed as separate window.
|
void |
setWindowState(int state)
Sets the state (iconified etc.) when in window mode.
|
void |
setWindowVisible(boolean visible)
Sets the state if the window is currently being shown.
|
void |
setWindowWidth(int width)
Sets the width when in window mode.
|
void |
startControl(SharedAction[] actions)
Provides the info that the given shared actions must now be controlled.
|
void |
stopControl()
Provides the info that the control of the given shared actions must be stopped.
|
void |
storeUnit(java.lang.String id,
Configuration config)
Stores the current configuration values persistently.
|
void |
unitRegistered(ApplicationModel model,
java.lang.String id)
Informs the configurable unit that it was registered with a model.
|
void |
unitUnregistered(ApplicationModel model,
java.lang.String id)
Informs the configurable unit that it was unregistered with a model.
|
void |
windowAdded(DockingManager manager,
int location)
Informs the docking window that it was added by the manager.
|
void |
windowBecomesHidden(int location)
Informs the docking window that it will be made invisible by the manager.
|
void |
windowBecomesShown(int location)
Informs the docking window that it will be made visible by the manager.
|
void |
windowIsActive(int location)
Informs the docking window that it is now the active window.
|
void |
windowIsHiding(int location)
Informs the docking window that it was made invisible by the manager.
|
void |
windowIsInactive(int location)
Informs the docking window that it is not the active window any longer.
|
void |
windowIsShowing(int location)
Informs the docking window that it was made visible by the manager.
|
void |
windowRemoved(DockingManager manager,
int location)
Informs the docking window that it was removed by the manager.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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
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, transferFocusDownCycle, validate, validateTree
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, transferFocusBackward, transferFocusUpCycle
protected WindowParamDef windowParams
protected int counter
protected java.util.Hashtable<java.lang.String,WindowView> cacheViewByID
protected java.lang.String helpID
protected int orientation
SwingConstants.HORIZONTAL
(default) or SwingConstants.VERTICAL
).public MultiViewWindow()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public java.lang.String getID()
getID
in interface DockingWindow
public void setID(java.lang.String id)
id
- The window identifierpublic java.lang.String getTitle()
getTitle
in interface DockingWindow
public java.lang.String getToolTip()
getToolTip
in interface DockingWindow
public javax.swing.ImageIcon getIcon()
getIcon
in interface DockingWindow
public java.awt.Component getComponent()
getComponent
in interface DockingWindow
public int getPreferredWidth()
getPreferredWidth
in interface DockingWindow
public void setPreferredWidth(int width)
setPreferredWidth
in interface DockingWindow
width
- The preferred widthpublic int getPreferredHeight()
getPreferredHeight
in interface DockingWindow
public void setPreferredHeight(int height)
setPreferredHeight
in interface DockingWindow
height
- The preferred heightpublic int getMode()
getMode
in interface DockingWindow
public void setMode(int mode)
setMode
in interface DockingWindow
mode
- The mode (MODE_DOCKING_PINNED, MODE_DOCKING_UNPINNED, ...)public boolean isAutomatic()
isAutomatic
in interface DockingWindow
public void setAutomatic(boolean enable)
setAutomatic
in interface DockingWindow
enable
- The automatic modepublic boolean isGrowing()
isGrowing
in interface DockingWindow
public void setGrowing(boolean enable)
setGrowing
in interface DockingWindow
enable
- The growing modepublic boolean isButtonVisible()
isVisible()
.
isButtonVisible
in interface DockingWindow
public void setButtonVisible(boolean visible)
isVisible()
.
setButtonVisible
in interface DockingWindow
visible
- The visibility flagpublic boolean isButtonPressed()
isButtonPressed
in interface DockingWindow
public void setButtonPressed(boolean pressed)
setButtonPressed
in interface DockingWindow
pressed
- The pressed flagpublic boolean isWindowMode()
isWindowMode
in interface DockingWindow
public void setWindowMode(boolean enable)
setWindowMode
in interface DockingWindow
enable
- The flagpublic boolean isWindowVisible()
isWindowVisible
in interface DockingWindow
public void setWindowVisible(boolean visible)
setWindowVisible
in interface DockingWindow
visible
- The statepublic int getWindowLocationX()
getWindowLocationX
in interface DockingWindow
public void setWindowLocationX(int locx)
setWindowLocationX
in interface DockingWindow
locx
- The x-axis locationpublic int getWindowLocationY()
getWindowLocationY
in interface DockingWindow
public void setWindowLocationY(int locy)
setWindowLocationY
in interface DockingWindow
locy
- The y-axis locationpublic int getWindowWidth()
getWindowWidth
in interface DockingWindow
public void setWindowWidth(int width)
setWindowWidth
in interface DockingWindow
width
- The widthpublic int getWindowHeight()
getWindowHeight
in interface DockingWindow
public void setWindowHeight(int height)
setWindowHeight
in interface DockingWindow
height
- The heightpublic int getWindowState()
getWindowState
in interface DockingWindow
public void setWindowState(int state)
setWindowState
in interface DockingWindow
state
- The statepublic void windowAdded(DockingManager manager, int location)
windowRemoved()
are called.
windowAdded
in interface DockingWindow
manager
- The docking managerlocation
- The location (TOP, BOTTOM, LEFT, RIGHT
)public void windowRemoved(DockingManager manager, int location)
windowAdded()
are called.
windowRemoved
in interface DockingWindow
manager
- The docking managerlocation
- The location (TOP, BOTTOM, LEFT, RIGHT
)public void windowBecomesShown(int location)
windowBecomesShown
in interface DockingWindow
location
- The location (TOP, BOTTOM, LEFT, RIGHT
)public void windowBecomesHidden(int location)
windowBecomesHidden
in interface DockingWindow
location
- The location (TOP, BOTTOM, LEFT, RIGHT
)public void windowIsShowing(int location)
windowIsShowing
in interface DockingWindow
location
- The location (TOP, BOTTOM, LEFT, RIGHT
)public void windowIsHiding(int location)
windowIsHiding
in interface DockingWindow
location
- The location (TOP, BOTTOM, LEFT, RIGHT
)public void windowIsActive(int location)
windowIsActive
in interface DockingWindow
location
- The location (TOP, BOTTOM, LEFT, RIGHT
)public void windowIsInactive(int location)
windowIsInactive
in interface DockingWindow
location
- The location (TOP, BOTTOM, LEFT, RIGHT
)public DockingManager getDockingManager()
windowAdded()
was called.
getDockingManager
in interface DockingWindow
null
if not availablepublic void refresh()
refresh
in interface DockingWindow
public ActionDelegate getActionDelegate()
getActionDelegate
in interface DockingWindow
null
if not availablepublic int getWindowLocation()
windowxxx()
methods.
getWindowLocation
in interface DockingWindow
TOP, BOTTOM, LEFT, RIGHT
) or -1public java.lang.String[] getSupportedActions()
getSupportedActions
in interface ActionDelegate
public void startControl(SharedAction[] actions)
startControl
in interface ActionDelegate
actions
- The actions to care forpublic void stopControl()
stopControl
in interface ActionDelegate
public void processAction(SharedAction action)
processAction
in interface ActionDelegate
action
- The action to be processedpublic java.lang.String addView(WindowView view)
view
- The new view to be addedjava.lang.NullPointerException
- If parameter is null
public WindowView removeView(java.lang.String id)
id
- The view IDnull
if not removedjava.lang.NullPointerException
- If parameter is null
public WindowView removeView(WindowView view)
view
- The viewnull
if not removedjava.lang.NullPointerException
- If parameter is null
public java.lang.String getVisibleViewID()
null
if not availablepublic WindowView getVisibleView()
null
if not availablepublic void setVisibleView(java.lang.String id)
id
- The view identifier to be selectedpublic void setVisibleView(java.awt.Component comp)
comp
- The desired componentpublic WindowView findView(java.awt.Component comp)
comp
- The desired componentnull
if not availablepublic WindowView findView(java.lang.String id)
id
- The desired identifiernull
if not availablepublic WindowView findView(java.lang.Class type)
type
- The desired class typenull
if not availablepublic void configureUnit(java.lang.String id, Configuration config)
configureUnit
in interface ConfigurableUnit
id
- The unique identifier for the instanceconfig
- The configurationpublic void storeUnit(java.lang.String id, Configuration config)
storeUnit
in interface ConfigurableUnit
id
- The unique identifier for the instanceconfig
- The configurationpublic void unitRegistered(ApplicationModel model, java.lang.String id)
unitRegistered
in interface ConfigurableUnit
model
- The application modelid
- The unique identifier for the instancepublic void unitUnregistered(ApplicationModel model, java.lang.String id)
unitUnregistered
in interface ConfigurableUnit
model
- The application modelid
- The unique identifier for the instancepublic void setHelpID(java.lang.String helpid)
helpid
- The help system linkpublic void setShowButtons(boolean show)
show
- Buttons enabled?public boolean getShowButtons()
public void setOrientation(int layout)
layout
- Use SwingConstants.HORIZONTAL
or SwingConstants.VERTICAL
java.lang.IllegalArgumentException
- If the parameters are not OKCopyright © 2005-2013 Leisenfels UG (haftungsbeschränkt). All rights reserved.