ilog.views.appframe.swing.mdi
Class IlvMDIApplet

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by javax.swing.JApplet
                      extended by ilog.views.appframe.swing.mdi.IlvMDIApplet
All Implemented Interfaces:
IlvMainWindow, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer

public class IlvMDIApplet
extends JApplet
implements IlvMainWindow

Defines applets as main windows of Java Application Framework applications.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JApplet
JApplet.AccessibleJApplet
 
Nested classes/interfaces inherited from class java.applet.Applet
Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
 
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 HTML_CHOICES_TABLE_NAME
          Name of the HTML table whose content is replaced by the HTML code generated for the specified URL choices.
static String MDI_APPLET_SETTINGS_TYPE
          Type of the settings elements that provide settings for MDI applets
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
IlvMDIApplet()
          Creates a new IlvMDIApplet.
IlvMDIApplet(boolean dockingBars, boolean dockingPanes)
          Creates a new IlvMDIApplet.
 
Method Summary
 void addContainerTemplate(String name, IlvContainerTemplate containerTemplate)
          Adds the specified container template to the list of container templates managed by the applet.
 void containerActivated(IlvViewContainer viewContainer)
          Invoked when a view container owned by this main window has been activated.
 IlvViewContainer getActiveViewContainer()
          Returns the active document view container.
 IlvApplication getApplication()
          Returns the application of the applet.
 IlvContainerTemplate getContainerTemplate(String name)
          Returns the container template of the applet with the specified name.
 IlvContainerTemplate[] getContainerTemplates()
          Returns the container templates managed by this applet.
 IlvDockingArea getDockingArea()
          Returns the docking area associated with this applet.
 IlvDockingBarArea getDockingBarArea()
          Returns the docking bar area associated with this applet.
 URL[] getFileChooserChoices()
          Returns the array of URLs that can be selectable from the applet file chooser.
 URL getFileChooserHTMLPage()
          Returns the URL to the HTML page that is displayed by the main file chooser of the application.
 Object[] getMainBars()
          Gets the menu and toolbars of the main window that do not depend on a specific document type.
 IlvMDIClient getMDIClient()
          Returns the MDI client of the applet.
 IlvSettings getSettings()
          Returns the settings that initialize the applet.
 IlvSettingsElement getSettingsElement()
          Returns the settings element that provides the settings for this MDI applet.
 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.
 void init()
          Called by the browser or applet viewer to inform this applet that it has been loaded into the system.
protected  void readSettings(IlvSettingsElement settingsElement)
          Reads the settings of the main frame.
 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 applet.
 void setApplication(IlvApplication application)
          Sets the application of this applet.
 void setFileChooserChoices(URL[] urls)
          Specifies an array of URLs that can be selected from the applet file chooser.
 void setFileChooserHTMLPage(URL url)
          Specifies a URL to an HTML page that is displayed by the main file chooser of the application for selecting a document file.
 void setMDIClient(IlvMDIClient mdiClient)
          Sets the MDI client of the applet.
 void setSettings(IlvSettings settings)
          Sets the settings that initialize the applet.
 void setSettingsElement(IlvSettingsElement element)
          Forces the settings of the MDI applet 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.
 void start()
          Called by the browser or applet viewer to inform this applet that it should start its execution.
 void stop()
          Called by the browser or applet viewer to inform this applet that it should stop its execution.
 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.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, 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, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, 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

MDI_APPLET_SETTINGS_TYPE

public static final String MDI_APPLET_SETTINGS_TYPE
Type of the settings elements that provide settings for MDI applets

See Also:
Constant Field Values

HTML_CHOICES_TABLE_NAME

public static final String HTML_CHOICES_TABLE_NAME
Name of the HTML table whose content is replaced by the HTML code generated for the specified URL choices.
The value equals "ChoiceTable".

See Also:
Constant Field Values
Constructor Detail

IlvMDIApplet

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

See Also:
IlvMDIApplet(boolean, boolean)

IlvMDIApplet

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

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

init

public void init()
Called by the browser or applet viewer to inform this applet that it has been loaded into the system. It is always called before the first time that the start method is called.

A subclass of Applet should override this method if it has an initialization to perform. For example, an applet with threads would use the init method to create the threads and the destroy method to kill them.

Overrides:
init in class Applet
See Also:
Applet.destroy(), Applet.start(), Applet.stop()

start

public void start()
Called by the browser or applet viewer to inform this applet that it should start its execution. It is called after the init method and each time the applet is revisited in a Web page.

A subclass of Applet should override this method if it has any operation that it wants to perform each time the Web page containing it is visited. For example, an applet with animation might want to use the start method to resume animation and the stop method to suspend the animation.

Overrides:
start in class Applet
See Also:
Applet.destroy(), Applet.init(), Applet.stop()

stop

public void stop()
Called by the browser or applet viewer to inform this applet that it should stop its execution.

Overrides:
stop in class Applet

setMDIClient

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


getMDIClient

public IlvMDIClient getMDIClient()
Returns the MDI client of the applet.


getContainerTemplate

public IlvContainerTemplate getContainerTemplate(String name)
Returns the container template of the applet 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 applet.


addContainerTemplate

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

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 document view container.

Specified by:
getActiveViewContainer in interface IlvMainWindow
Returns:
The active document view container.

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 it 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 applet.

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

setApplication

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

Specified by:
setApplication in interface IlvMainWindow
Parameters:
application - The application of the applet.
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.

registerStaticView

public void registerStaticView(String name,
                               IlvDocumentView view)
Registers the specified document view as a static view within the applet. 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 template 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 templates 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 views 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 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 templates added to this main window.
container - The static container to register.
See Also:
unregisterStaticContainer(ilog.views.appframe.docview.IlvViewContainer)

unregisterStaticContainer

public boolean unregisterStaticContainer(IlvViewContainer container)
Unregisters the specified view container from the main window.

Specified by:
unregisterStaticContainer in interface IlvMainWindow
Parameters:
container - The static container to unregister.
Returns:
true if the specified container was previously registered to this main window; false otherwise.
See Also:
registerStaticContainer(java.lang.String, ilog.views.appframe.docview.IlvViewContainer)

getSettings

public IlvSettings getSettings()
Returns the settings that initialize the applet.

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

setSettings

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

Parameters:
settings - The new settings of the applet.
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.

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), #see #getSettingsType

setSettingsElement

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

getSettingsElement

public IlvSettingsElement getSettingsElement()
Returns the settings element that provides the settings for this MDI applet. 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 contains 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.

getDockingArea

public IlvDockingArea getDockingArea()
Returns the docking area associated with this applet.

Returns:
The docking area. It is null if the docking capabilities were disabled when creating the applet.
See Also:
IlvMDIApplet(boolean, boolean)

getDockingBarArea

public IlvDockingBarArea getDockingBarArea()
Returns the docking bar area associated with this applet.

Returns:
The docking area. It is null if the docking capabilities were been disabled when creating the applet.
See Also:
IlvMDIApplet(boolean, boolean)

setFileChooserHTMLPage

public void setFileChooserHTMLPage(URL url)
Specifies a URL to an HTML page that is displayed by the main file chooser of the application for selecting a document file.
There are two ways for the specified HTML page to have selectable document files:

Parameters:
url - The URL to the HTML page.
See Also:
getFileChooserHTMLPage()

getFileChooserHTMLPage

public URL getFileChooserHTMLPage()
Returns the URL to the HTML page that is displayed by the main file chooser of the application.

Returns:
The URL of the HTML page.
See Also:
setFileChooserHTMLPage(java.net.URL)