ilog.views.appframe.swing.mdi
Class IlvDesktopPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JLayeredPane
                  extended by javax.swing.JDesktopPane
                      extended by ilog.views.appframe.swing.mdi.IlvDesktopPane
All Implemented Interfaces:
IlvContainerTemplate, IlvMDIContainerTemplate, IlvMDIClient, ImageObserver, MenuContainer, Serializable, Accessible

public class IlvDesktopPane
extends JDesktopPane
implements IlvMDIClient, IlvMDIContainerTemplate

Swing desktop pane that implements Application Framework interfaces for creating document view containers.

See Also:
IlvInternalFrame, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JDesktopPane
JDesktopPane.AccessibleJDesktopPane
 
Nested classes/interfaces inherited from class javax.swing.JLayeredPane
JLayeredPane.AccessibleJLayeredPane
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String CASCADE_CMD
          Action command key for the action that cascades the internal frames contained by the desktop pane.
static String DEFAULT_SETTINGS_NAME
          Default name for desktop panes within the settings.
static String DESKTOP_PANE_SETTINGS_TYPE
          Type of the settings element providing the settings for desktop panes.
static String TILE_HORIZONTALLY_CMD
          Action command key for the action that horizontally tiles the internal frames contained by the desktop pane.
static String TILE_VERTICALLY_CMD
          Action command key for the action that vertically tiles the internal frames contained by the desktop pane.
 
Fields inherited from class javax.swing.JDesktopPane
LIVE_DRAG_MODE, OUTLINE_DRAG_MODE
 
Fields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
 
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 ilog.views.appframe.swing.mdi.IlvMDIClient
DEFAULT_WINDOW_LIST_COMMAND
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
IlvDesktopPane()
          Constructs an IlvDesktopPane.
 
Method Summary
 void addMDICLientListener(MDIClientListener listener)
          Adds the specified MDI client listener to receive events from this MDI client.
 void addViewContainer(IlvMDIViewContainer viewContainer)
          Adds a newly created internal frame to the desktop pane.
 void cascadeFrames()
          Cascades the frame of this desktop pane.
 void close(IlvInternalFrame frame)
          Closes the specified internal frame.
 IlvMDIViewContainer createViewContainer(IlvDocument document)
          Creates a new internal frame for the specified document.
 IlvMDIViewContainer getActiveViewContainer()
          Returns the IlvInternalFrame currently active in the desktop pane.
 IlvApplication getApplication()
          Returns the application associated with desktop pane.
 Container getClientContainer()
          Returns the container that owns all the internal frames.
 String getDocumentListActionCommand()
          Returns the command name of the action list that is used for displaying the list of opened documents in this MDI client.
 IlvSettings getSettings()
          Returns the settings that initialize the desktop pane.
 IlvSettingsElement getSettingsElement()
          Returns the settings element that provides the settings for this desktop pane.
 String getSettingsName()
          Returns the name that identifies the MDI tab pane within the settings.
 IlvSettingsQuery getSettingsQuery()
          Returns the query that selects the settings element that provides the settings of this MDI tabbed pane.
 String getSettingsType()
          Returns the type of the settings elements that provides the settings for MDI tab panes.
protected  void readSettings(IlvSettingsElement settingsElement)
          Initializes the desktop pane with the specified settings element.
 void removeMDIClientListener(MDIClientListener listener)
          Removes the specified MDI client listener, so that it no longer receives MDI client events from this MDI client.
 void setApplication(IlvApplication application)
          Sets the application of this desktop pane.
 void setDocumentListActionCommand(String command)
          Sets the command name of the action list that is used for displaying the list of opened documents in this MDI client.
 void setSettings(IlvSettings settings)
          Sets the settings that initialize the desktop pane.
 void setSettingsElement(IlvSettingsElement element)
          Forces the settings of the desktop pane to be read and written from the specified settings element.
 void setSettingsName(String settingsName)
          Sets the name that identifies the MDI tab pane within the settings.
 void setSettingsQuery(IlvSettingsQuery query)
          Sets the query that selects the settings element that provides the settings for this MDI tabbed pane.
 void setSettingsType(String settingsType)
          Sets the type of the settings elements that provides the settings for MDI tabbed panes.
 void setTitleFrame(JFrame frame)
          Sets the frame that has the title that will be completed with the title of the active internal frame.
 void tileFrames(boolean horizontally)
          Tiles the frames of this desktop pane horizontally or vertically.
protected  void writeSettings(IlvSettingsElement settingsElement)
          Writes the settings of the desktop pane.
 
Methods inherited from class javax.swing.JDesktopPane
getAccessibleContext, getAllFrames, getAllFramesInLayer, getDesktopManager, getDragMode, getSelectedFrame, getUI, getUIClassID, isOpaque, paramString, setDesktopManager, setDragMode, setSelectedFrame, setUI, updateUI
 
Methods inherited from class javax.swing.JLayeredPane
addImpl, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, putLayer, remove, removeAll, setLayer, setLayer, setPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, 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
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, 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

DESKTOP_PANE_SETTINGS_TYPE

public static String DESKTOP_PANE_SETTINGS_TYPE
Type of the settings element providing the settings for desktop panes.


DEFAULT_SETTINGS_NAME

public static String DEFAULT_SETTINGS_NAME
Default name for desktop panes within the settings.


TILE_VERTICALLY_CMD

public static String TILE_VERTICALLY_CMD
Action command key for the action that vertically tiles the internal frames contained by the desktop pane.


TILE_HORIZONTALLY_CMD

public static String TILE_HORIZONTALLY_CMD
Action command key for the action that horizontally tiles the internal frames contained by the desktop pane.


CASCADE_CMD

public static String CASCADE_CMD
Action command key for the action that cascades the internal frames contained by the desktop pane.

Constructor Detail

IlvDesktopPane

public IlvDesktopPane()
Constructs an IlvDesktopPane.

Method Detail

getActiveViewContainer

public IlvMDIViewContainer getActiveViewContainer()
Returns the IlvInternalFrame currently active in the desktop pane.

Specified by:
getActiveViewContainer in interface IlvMDIClient
Returns:
The active view container. It returns null if the desktop pane does not contain internal frames.

addMDICLientListener

public void addMDICLientListener(MDIClientListener listener)
Adds the specified MDI client listener to receive events from this MDI client. If it is null, no exception is thrown and no action is performed.

Specified by:
addMDICLientListener in interface IlvMDIClient
Parameters:
listener - The MDI client listener to add.

removeMDIClientListener

public void removeMDIClientListener(MDIClientListener listener)
Removes the specified MDI client listener, so that it no longer receives MDI client events from this MDI client. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If listener is null, no exception is thrown and no action is performed.

Specified by:
removeMDIClientListener in interface IlvMDIClient
Parameters:
listener - The MDI client listener to remove.

getApplication

public IlvApplication getApplication()
Returns the application associated with desktop pane.

Specified by:
getApplication in interface IlvMDIClient
Returns:
The application of this desktop pane.
See Also:
setApplication(ilog.views.appframe.IlvApplication)

setApplication

public void setApplication(IlvApplication application)
Sets the application of this desktop pane.

Specified by:
setApplication in interface IlvMDIClient
Parameters:
application - The new application of this desktop pane.
See Also:
getApplication()

tileFrames

public void tileFrames(boolean horizontally)
Tiles the frames of this desktop pane horizontally or vertically.

Parameters:
horizontally - If true, the frames of the desktop pane are tiled horizontally. If false, the frames are tiled vertically.

cascadeFrames

public void cascadeFrames()
Cascades the frame of this desktop pane.


getClientContainer

public Container getClientContainer()
Returns the container that owns all the internal frames.

Specified by:
getClientContainer in interface IlvMDIClient
Returns:
this instance.

createViewContainer

public IlvMDIViewContainer createViewContainer(IlvDocument document)
Creates a new internal frame for the specified document.

Specified by:
createViewContainer in interface IlvMDIContainerTemplate
Returns:
The newly created internal frame, an instance of the IlvInternalFrame class.
See Also:
IlvMDIContainerTemplate.addViewContainer(ilog.views.appframe.docview.IlvMDIViewContainer)

addViewContainer

public void addViewContainer(IlvMDIViewContainer viewContainer)
Adds a newly created internal frame to the desktop pane.

Specified by:
addViewContainer in interface IlvMDIContainerTemplate
Parameters:
viewContainer - The newly created internal frame to add.
See Also:
IlvInternalFrame

getSettings

public IlvSettings getSettings()
Returns the settings that initialize the desktop pane.

Returns:
The settings of the desktop pane.
See Also:
setSettings(ilog.views.appframe.settings.IlvSettings)

setSettings

public void setSettings(IlvSettings settings)
Sets the settings that initialize the desktop pane.

Parameters:
settings - The new settings of the desktop pane.
See Also:
getSettings()

getSettingsName

public String getSettingsName()
Returns the name that identifies the MDI tab pane within the settings. It corresponds to the value of the name attribute of the settings element that provides the settings for the associated object. If no name has been specified using the method setSettingsName(java.lang.String), null is returned.

Returns:
The settings name.
See Also:
setSettingsName(java.lang.String), getSettingsElement(), getSettingsQuery()

setSettingsName

public void setSettingsName(String settingsName)
Sets the name that identifies the MDI tab pane within the settings.

Parameters:
settingsName - The new settings name.

getSettingsType

public String getSettingsType()
Returns the type of the settings elements that provides the settings for MDI tab panes.

Returns:
The TABBED_PANE_SETTINGS_TYPE string if no settings type has been specified with the method setSettingsType(java.lang.String).
See Also:
readSettings(ilog.views.appframe.settings.IlvSettingsElement), setSettingsType(java.lang.String)

setSettingsType

public void setSettingsType(String settingsType)
Sets the type of the settings elements that provides the settings for MDI tabbed panes.

Parameters:
settingsType - The new settings type.
See Also:
readSettings(ilog.views.appframe.settings.IlvSettingsElement), getSettingsType()

setSettingsQuery

public void setSettingsQuery(IlvSettingsQuery query)
Sets the query that selects the settings element that provides the settings for this MDI tabbed pane.

Parameters:
query - The new settings query.
See Also:
getSettingsQuery()

getSettingsQuery

public IlvSettingsQuery getSettingsQuery()
Returns the query that selects the settings element that provides the settings of this MDI tabbed pane.

If a query has been specified with the method setSettingsQuery(ilog.views.appframe.settings.IlvSettingsQuery), it is returned. Otherwise, a query is built for selecting a settings root element with the type returned by getSettingsType() and the value of the name attribute equal to the name returned by getSettingsName(). If getSettingsName() returns null, the query selects the first encountered root element with the settings type given by the method getSettingsType().

Returns:
The settings query.
See Also:
setSettingsQuery(ilog.views.appframe.settings.IlvSettingsQuery), #see #getSettingsType

setSettingsElement

public void setSettingsElement(IlvSettingsElement element)
Forces the settings of the desktop pane to be read and written from the specified settings element. This method overrides the settings element that is selected by default within the settings given by the method getSettings() with the query getSettingsQuery().

Parameters:
element - The settings element that provides the settings for the desktop pane.
See Also:
getSettingsElement()

getSettingsElement

public IlvSettingsElement getSettingsElement()
Returns the settings element that provides the settings for this desktop pane. If a settings element has been specified with the setSettingsElement(ilog.views.appframe.settings.IlvSettingsElement) method, it is returned. Otherwise, the settings element is selected from the settings given by the getSettings() method, with the query returned by getSettingsQuery().

Returns:
The settings element or null if no settings element could be found.
See Also:
setSettingsElement(ilog.views.appframe.settings.IlvSettingsElement), getSettingsQuery()

readSettings

protected void readSettings(IlvSettingsElement settingsElement)
Initializes the desktop pane with the specified settings element.

Parameters:
settingsElement - The settings element from which to initialize the desktop pane.

writeSettings

protected void writeSettings(IlvSettingsElement settingsElement)
Writes the settings of the desktop pane.

Parameters:
settingsElement - The root settings element to write the settings to.

setTitleFrame

public void setTitleFrame(JFrame frame)
Sets the frame that has the title that will be completed with the title of the active internal frame.

Specified by:
setTitleFrame in interface IlvMDIClient
Parameters:
frame - The frame that has title to be completed with the active internal frame.

getDocumentListActionCommand

public String getDocumentListActionCommand()
Returns the command name of the action list that is used for displaying the list of opened documents in this MDI client.

Specified by:
getDocumentListActionCommand in interface IlvMDIClient
Returns