ilog.views.appframe.swing.mdi
Class IlvMDIMainFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by ilog.views.appframe.swing.mdi.IlvMDIMainFrame
All Implemented Interfaces:
IlvMainWindow, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class IlvMDIMainFrame
extends JFrame
implements IlvMainWindow

Standard main frame window for MDI applications.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
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
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface ilog.views.appframe.docview.IlvMainWindow
DEFAULT_CONTAINER_TEMPLATE_NAME
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
IlvMDIMainFrame()
          Creates a new IlvMDIMainFrame.
IlvMDIMainFrame(boolean dockingBars, boolean dockingPanes)
          Creates a new IlvMDIMainFrame.
IlvMDIMainFrame(Container contentPane)
          Creates a new IlvMDIMainFrame with the specified container as the content pane.
 
Method Summary
 void addContainerTemplate(String name, IlvContainerTemplate containerTemplate)
          Adds the specified container template to the list of container templates managed by the main window.
 void close()
          Closes the application associated with this window.
 void containerActivated(IlvViewContainer viewContainer)
          Invoked when a view container owned by this main window has been activated.
 IlvViewContainer getActiveViewContainer()
          Returns the active view container.
 IlvApplication getApplication()
          Returns the application of the main frame.
 IlvContainerTemplate getContainerTemplate(String name)
          Returns the container template stored by the main window with the specified name.
 IlvContainerTemplate[] getContainerTemplates()
          Returns the container templates managed by this main window.
 IlvDockingArea getDockingArea()
          Returns the docking area associated with this main window.
 IlvDockingBarArea getDockingBarArea()
          Returns the docking bar area associated with this main window.
 Object[] getMainBars()
          Gets the menu and toolbars of the main window that do not depend on a specific document type.
 IlvMDIClient getMDIClient()
          Gets the MDI client of the frame.
 IlvSettings getSettings()
          Returns the settings that initialize the main frame.
 IlvSettingsElement getSettingsElement()
          Returns the settings element that provides the settings for this MDI main frame.
 String getSettingsName()
          Returns the name that identifies the main window within the settings.
 IlvSettingsQuery getSettingsQuery()
          Returns the query that selects the settings element that provides the settings of this main frame.
 String getSettingsType()
          Returns the type of the settings element that provides the settings for this MDI main frame.
protected  void readSettings(IlvSettingsElement settingsElement)
          Reads the settings of the main frame.
 void registerActionMethod(String command, String methodName)
          Registers a method to be called when performing the specified action.
 void registerActionStateMethod(String command, String methodName)
          Registers a method to be called when updating the specified action.
 void registerStaticContainer(String name, IlvViewContainer container)
          Registers the specified view container as a static container within the main window.
 void registerStaticView(String name, IlvDocumentView view)
          Registers the specified document view as a static view within the main window.
 void setApplication(IlvApplication application)
          Sets the application of the main frame.
 void setMDIClient(IlvMDIClient mdiClient)
          Sets the MDI client of the frame.
 void setSettings(IlvSettings settings)
          Sets the settings that initialize the main frame.
 void setSettingsElement(IlvSettingsElement element)
          Forces the settings of the MDI main frame to be read and written from the specified settings element.
 void setSettingsName(String settingsName)
          Sets the name that identifies the main frame within the settings.
 void setSettingsQuery(IlvSettingsQuery query)
          Sets the query that selects the settings element that provides the settings for this main frame.
 void setSettingsType(String settingsType)
          Sets the type of the settings elements that provides the settings for this MDI main frame.
 boolean unregisterStaticContainer(IlvViewContainer container)
          Unregisters the specified view container from the main window.
 void unregisterStaticView(IlvDocumentView view)
          Unregisters the specified document view from the main window.
protected  void writeSettings(IlvSettingsElement settingsElement)
          Writes the settings of the main frame.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Constructor Detail

IlvMDIMainFrame

public IlvMDIMainFrame()
Creates a new IlvMDIMainFrame. It is equivalent to the IlvMDIMainFrame(boolean, boolean) constructor method with false given as the parameters.

See Also:
IlvMDIMainFrame(boolean, boolean)

IlvMDIMainFrame

public IlvMDIMainFrame(boolean dockingBars,
                       boolean dockingPanes)
Creates a new IlvMDIMainFrame.

Parameters:
dockingBars - If true, a bar docking area is created and added to the frame so that it fits all the area of the content pane of the frame. If false, no docking bar area is created.
dockingPanes - If true, a docking panes area is created and added to the frame so that it fits:
  • The content pane of the docking bars area if dockingBars is true.
  • The content pane of the main frame if dockingBars is false.
If false, no docking pane area is created.
See Also:
IlvMDIMainFrame()

IlvMDIMainFrame

public IlvMDIMainFrame(Container contentPane)
Creates a new IlvMDIMainFrame with the specified container as the content pane.

Parameters:
contentPane - The container in which the main frame will create components, such as the MDI container pane.
Method Detail

setMDIClient

public void setMDIClient(IlvMDIClient mdiClient)
Sets the MDI client of the frame.


getMDIClient

public IlvMDIClient getMDIClient()
Gets the MDI client of the frame.


getContainerTemplate

public IlvContainerTemplate getContainerTemplate(String name)
Returns the container template stored by the main window with the specified name.

Specified by:
getContainerTemplate in interface IlvMainWindow
Parameters:
name - The name of the container template to retrieve.
Returns:
The container template with the specified name.
See Also:
IlvAbstractMainWindow.addContainerTemplate(java.lang.String, ilog.views.appframe.docview.IlvContainerTemplate)

getContainerTemplates

public IlvContainerTemplate[] getContainerTemplates()
Returns the container templates managed by this main window.


addContainerTemplate

public void addContainerTemplate(String name,
                                 IlvContainerTemplate containerTemplate)
Adds the specified container template to the list of container templates managed by the main window.

Parameters:
name - The name to associate with the container template. This name can be used to retrieve the container template with the method getContainerTemplate(java.lang.String).
containerTemplate - The new container template.

getActiveViewContainer

public IlvViewContainer getActiveViewContainer()
Returns the active view container.

Specified by:
getActiveViewContainer in interface IlvMainWindow

getMainBars

public Object[] getMainBars()
Gets the menu and toolbars of the main window that do not depend on a specific document type. The implementation of this method returns the menu bar of the window (accessed with the getJMenuBar and SetJMenuBar methods) if exists, plus all the toolbars that are docked or floating on this frame.

Specified by:
getMainBars in interface IlvMainWindow
Returns:
An array of components, each component being either a JToolBar instance or a JMenuBar instance.

getApplication

public IlvApplication getApplication()
Returns the application of the main frame.

Specified by:
getApplication in interface IlvMainWindow
Returns:
The application of the main frame.
See Also:
IlvMainWindow.setApplication(ilog.views.appframe.IlvApplication)

setApplication

public void setApplication(IlvApplication application)
Sets the application of the main frame.

Specified by:
setApplication in interface IlvMainWindow
Parameters:
application - The application of the main frame.
See Also:
IlvMainWindow.getApplication()

containerActivated

public void containerActivated(IlvViewContainer viewContainer)
Invoked when a view container owned by this main window has been activated.

Specified by:
containerActivated in interface IlvMainWindow
Parameters:
viewContainer - The view container that has been activated.

getSettings

public IlvSettings getSettings()
Returns the settings that initialize the main frame.

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

setSettings

public void setSettings(IlvSettings settings)
Sets the settings that initialize the main frame.

Parameters:
settings - The new settings of the main frame.
See Also:
getSettings()

getSettingsType

public String getSettingsType()
Returns the type of the settings element that provides the settings for this MDI main frame.

Returns:
The IlvSwingMainWindow.SWING_MAIN_WINDOW_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 this MDI main frame.

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

getSettingsName

public String getSettingsName()
Returns the name that identifies the main window 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 main frame within the settings.

Parameters:
settingsName - The new settings name.
See Also:
getSettingsName()

setSettingsQuery

public void setSettingsQuery(IlvSettingsQuery query)
Sets the query that selects the settings element that provides the settings for this main frame.

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 main frame.

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), getSettingsName(), getSettingsType()

setSettingsElement

public void setSettingsElement(IlvSettingsElement element)
Forces the settings of the MDI main frame 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 main frame.
See Also:
getSettingsElement()

getSettingsElement

public IlvSettingsElement getSettingsElement()
Returns the settings element that provides the settings for this MDI main frame. 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)
Reads the settings of the main frame.

Parameters:
settingsElement - The root settings element that contain the settings for this main frame.

writeSettings

protected void writeSettings(IlvSettingsElement settingsElement)
Writes the settings of the main frame. Preferences for the associated frame are written.

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

close

public void close()
Closes the application associated with this window. The user is first asked to save the modified opened documents before the window is closed.


registerStaticView

public void registerStaticView(String name,
                               IlvDocumentView view)
Registers the specified document view as a static view within the main window. This view is not created when a document is created but rather with the main window itself. Typically, it can be defined at design time in an IDE when designing the main frame by inserting an instance of a document view class such as IlvPanelView within the main frame.

The view does not depend on a specific document but is associated with the active document of the application, if the document template of this document has been declared to use this view (one of the container templates of the document templates has the same name as the name used to register this view).

When a document becomes active, for example if a container containing one of its views becomes active, the ilog.views.appframe.docview.IlvDocumentView#DOCUMENT_PROPERTY} of the view is set to this document, and its method IlvDocumentView.initializeView(ilog.views.appframe.docview.IlvDocument) is called with the new active document as the parameter.

Specified by:
registerStaticView in interface IlvMainWindow
Parameters:
name - The name that identifies this view and that must be used if calling the method unregisterStaticView(ilog.views.appframe.docview.IlvDocumentView). This name also identifies a single container template created for this view and must then be unique among all the container template added to this main window.
view - The static view to register.
See Also:
unregisterStaticView(ilog.views.appframe.docview.IlvDocumentView)

unregisterStaticView

public void unregisterStaticView(IlvDocumentView view)
Unregisters the specified document view from the main window.

Specified by:
unregisterStaticView in interface IlvMainWindow
Parameters:
view - The static view to unregister.
See Also:
registerStaticView(java.lang.String, ilog.views.appframe.docview.IlvDocumentView)

registerStaticContainer

public void registerStaticContainer(String name,
                                    IlvViewContainer container)
Registers the specified view container as a static container within the main window.

This view container is not created when a document is created but rather with the main window itself. Typically, it can be defined at design time in an IDE when designing the main frame by inserting an instance of a view container within the main frame.

When a document becomes active, for example if a container containing one of its view(s) becomes active, the views of the specified container are set to the new active document by setting the ilog.views.appframe.docview.IlvDocumentView#DOCUMENT_PROPERTY} of the view to this document, and its method IlvDocumentView.initializeView(ilog.views.appframe.docview.IlvDocument) is called with the new active document as the parameter.

Specified by:
registerStaticContainer in interface IlvMainWindow
Parameters:
name - The name that identifies this view and that must be used if calling the method