ilog.views.appframe.swing.mdi
Class IlvInternalFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JInternalFrame
                  extended by ilog.views.appframe.swing.mdi.IlvInternalFrame
All Implemented Interfaces:
IlvMDIViewContainer, IlvViewContainer, ActionHandler, IlvPropertyManager, ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class IlvInternalFrame
extends JInternalFrame
implements IlvMDIViewContainer

Implementation of the IlvMDIViewContainer interface for Swing internal frames.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JInternalFrame
JInternalFrame.AccessibleJInternalFrame, JInternalFrame.JDesktopIcon
 
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
 
Fields inherited from class javax.swing.JInternalFrame
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY
 
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.docview.IlvMDIViewContainer
CLOSE_ALL_WINDOWS_CMD, CLOSE_WINDOW_CMD, NEXT_WINDOW_CMD, OWN_TITLE_PROPERTY, PREVIOUS_WINDOW_CMD, TITLE_PROPERTY
 
Fields inherited from interface ilog.views.appframe.docview.IlvViewContainer
ACTIVE_VIEW_PROPERTY, APPLICATION_PROPERTY, CONFIGURATION_NAME_PROPERTY, CONTAINER_TEMPLATE_PROPERTY, DOCUMENT_PROPERTY, DOCUMENT_TEMPLATE_PROPERTY, DOCUMENT_VIEWS_PROPERTY, VISIBILITY_PROPERTY
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
IlvInternalFrame()
          Constructs a default IlvInternalFrame.
IlvInternalFrame(JDesktopPane desktopPane)
          Constructs an internal frame for the specified desktop pane.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Invoked when an action occurs.
 void activate()
          Sets the internal frame active.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a listener that listens to the change of the properties of this application.
 boolean addViews(IlvDocumentView[] views)
          Adds the specified views to the container.
 boolean builtInViews()
          Determines whether this internal frame already contains views when it is created.
 boolean close()
          Closes the internal frame.
 IlvApplication getApplication()
          Returns the application of the view.
 IlvContainerTemplate getContainerTemplate()
          Returns the container template that has created this internal frame.
 String getContainerTitle()
          Returns the title of the container.
 IlvDocument getDocument()
          Returns the document associated with this view container.
 Object getProperty(String key)
          Returns the property of the internal frame with the specified key.
 IlvDocumentView[] getViews()
          Returns the document views of this container.
 boolean isContainerVisible()
          Determines whether this internal frame is visible.
 boolean isProcessingAction(String command)
          Determines whether the action handler is able to perform the action with the specified command key in its ActionListener.actionPerformed(java.awt.event.ActionEvent) method.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes the specified listener from the list of PropertyChange listeners managed by this application.
 void setApplication(IlvApplication application)
          Sets the application of the view.
 void setContainerTitle(String title)
          Sets a new title to the internal frame.
 void setContainerVisible(boolean visible)
          Shows or hides this internal frame depending on the value of the visible parameter.
 void setDocument(IlvDocument document)
          Sets the document associated with the view.
 Object setProperty(String key, Object value)
          Sets one of this internal frame's properties using the associated key.
 void setSelected(boolean selected)
          Selects and deselects the JInternalFrame.
 boolean updateAction(Action action)
          Invoked by the application for updating the state of the specified action.
 
Methods inherited from class javax.swing.JInternalFrame
addImpl, addInternalFrameListener, createRootPane, dispose, doDefaultCloseAction, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getFrameIcon, getGlassPane, getInternalFrameListeners, getJMenuBar, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getTitle, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setFrameIcon, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setTitle, setUI, show, toBack, toFront, updateUI
 
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, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, 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, 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, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvInternalFrame

public IlvInternalFrame(JDesktopPane desktopPane)
Constructs an internal frame for the specified desktop pane.

Parameters:
desktopPane - The desktop pane in which to add the internal frame.

IlvInternalFrame

public IlvInternalFrame()
Constructs a default IlvInternalFrame.

Method Detail

isContainerVisible

public boolean isContainerVisible()
Determines whether this internal frame is visible.

Specified by:
isContainerVisible in interface IlvViewContainer
Returns:
true if the internal frame is deiconified; false if the internal frame is iconified.
See Also:
IlvViewContainer.setContainerVisible(boolean)

setContainerVisible

public void setContainerVisible(boolean visible)
Shows or hides this internal frame depending on the value of the visible parameter.

Specified by:
setContainerVisible in interface IlvViewContainer
Parameters:
visible - If true the internal frame is deiconified; if false the internal frame is iconified.
See Also:
isContainerVisible()

close

public boolean close()
Closes the internal frame.

Specified by:
close in interface IlvMDIViewContainer
Returns:
true if the container could be closed; false otherwise.

activate

public void activate()
Sets the internal frame active.

Specified by:
activate in interface IlvViewContainer

getContainerTitle

public String getContainerTitle()
Returns the title of the container.

Specified by:
getContainerTitle in interface IlvMDIViewContainer
Returns:
The title of the container.
See Also:
setContainerTitle(java.lang.String), JInternalFrame.TITLE_PROPERTY

setContainerTitle

public void setContainerTitle(String title)
Sets a new title to the internal frame. The TITLE_PROPERTY is updated with the new specified title.

Specified by:
setContainerTitle in interface IlvMDIViewContainer
Parameters:
title - The new title of the container.
See Also:
getContainerTitle(), JInternalFrame.TITLE_PROPERTY

builtInViews

public boolean builtInViews()
Determines whether this internal frame already contains views when it is created.

If it already contains views, it is asked for providing the built-in views with the getViews() method. Otherwise, the document template associated with this container provides the document views to the container with the method addViews(ilog.views.appframe.docview.IlvDocumentView[]).

Specified by:
builtInViews in interface IlvMDIViewContainer
Returns:
false for receiving views from the document template; true if it already contains document views.
See Also:
getViews(), addViews(ilog.views.appframe.docview.IlvDocumentView[])

addViews

public boolean addViews(IlvDocumentView[] views)
Adds the specified views to the container.

Specified by:
addViews in interface IlvMDIViewContainer
Parameters:
views - The views to add.
Returns:
true if the views could be added to the container; false otherwise.

getViews

public IlvDocumentView[] getViews()
Returns the document views of this container.

Specified by:
getViews in interface IlvViewContainer
Returns:
The array of views of this view container.

getContainerTemplate

public IlvContainerTemplate getContainerTemplate()
Returns the container template that has created this internal frame.

Returns:
The container template of this internal frame. An instance of the IlvDesktopPane class is returned.

getDocument

public IlvDocument getDocument()
Returns the document associated with this view container.

Returns:
The document.
See Also:
setDocument(ilog.views.appframe.docview.IlvDocument), IlvViewContainer.DOCUMENT_PROPERTY

setDocument

public void setDocument(IlvDocument document)
Sets the document associated with the view.

Parameters:
document - The document of the view.
See Also:
getDocument(), IlvViewContainer.DOCUMENT_PROPERTY

getApplication

public IlvApplication getApplication()
Returns the application of the view.

Returns:
The application of the view.
See Also:
setApplication(ilog.views.appframe.IlvApplication), IlvDocumentView.APPLICATION_PROPERTY

setApplication

public void setApplication(IlvApplication application)
Sets the application of the view.

Parameters:
application - The application of the view.
See Also:
getApplication(), IlvDocumentView.APPLICATION_PROPERTY

isProcessingAction

public boolean isProcessingAction(String command)
Determines whether the action handler is able to perform the action with the specified command key in its ActionListener.actionPerformed(java.awt.event.ActionEvent) method.

Specified by:
isProcessingAction in interface ActionHandler
Parameters:
command - The command key of the action.
Returns:
false by default.

updateAction

public boolean updateAction(Action action)
Invoked by the application for updating the state of the specified action. For example, the implementation of this method can enable or disable the action.

Specified by:
updateAction in interface ActionHandler
Parameters:
action - The action to update.
Returns:
false by default.

actionPerformed

public void actionPerformed(ActionEvent e)
Invoked when an action occurs. The implementation of the method is empty.

Specified by:
actionPerformed in interface ActionListener

setSelected

public void setSelected(boolean selected)
                 throws PropertyVetoException
Selects and deselects the JInternalFrame. Overrides the JInternalFrame implementation to not notify the application when the previously selected frame is deactivated. This avoids performing useless initializations at the application level.

Overrides:
setSelected in class JInternalFrame
Parameters:
selected - a boolean, where true means the frame is selected (currently active) and false means it is not
Throws:
PropertyVetoException - when the attempt to set the property is vetoed by the receiver.

setProperty

public Object setProperty(String key,
                          Object value)
Sets one of this internal frame's properties using the associated key. If the value has changed, a PropertyChangeEvent is sent to property change listeners.

Specified by:
setProperty in interface IlvPropertyManager
Parameters:
key - The non-null property key
value - An Object value. If it equals null, the property with the specified key is removed.
Returns:
The previous value of the property.
See Also:
getProperty(java.lang.String)

getProperty

public Object getProperty(String key)
Returns the property of the internal frame with the specified key.

Specified by:
getProperty in interface IlvPropertyManager
Parameters:
key - The non-null property key.
Returns:
The value of the specified property. It returns null if the specified property was not found.
See Also:
setProperty(java.lang.String, java.lang.Object)

addPropertyChangeListener

public void addPropertyChangeListener(