com.tensegrity.gui.swing.document
Class FramedMDIComponent

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JLayeredPane
                  extended byjavax.swing.JDesktopPane
                      extended bycom.tensegrity.gui.swing.document.FramedMDIComponent
All Implemented Interfaces:
javax.accessibility.Accessible, Evaluable, java.util.EventListener, java.awt.image.ImageObserver, javax.swing.event.InternalFrameListener, MDIComponent, java.awt.MenuContainer, Observable, java.io.Serializable, SwingMDIComponent

public class FramedMDIComponent
extends javax.swing.JDesktopPane
implements SwingMDIComponent, javax.swing.event.InternalFrameListener, Evaluable

Internal frames MDI implementation (application owned sub-windows). This class implements a windowed MDI component by means of the JInternalFrames that are provided with swing. The component itself is derived from the JDesktopPane. The resulting GUI allows tiled/cascaded views of multiple documents. Multiple documents can be viewed concurrently. cascaded multiple window views of jcomponents. This mdi component has some additional service methods.

Version:
$Id: FramedMDIComponent.java,v 1.31 2006/03/02 11:41:40 BurkhardWick Exp $
Author:
Stepan Rutz
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JDesktopPane
javax.swing.JDesktopPane.AccessibleJDesktopPane
 
Nested classes inherited from class javax.swing.JLayeredPane
javax.swing.JLayeredPane.AccessibleJLayeredPane
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 UIItemEvaluationList uiItemEvList
          ItemList used to perform the language switch
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FramedMDIComponent(java.util.List initialdocuments, MenuTool windowmenu, UIManager uimanager, DocumentDropContext opener)
          Constructs a new framed mdi component.
 
Method Summary
 void addDocument(Document document)
          Adds the given Document to the container.
 void addDocumentListener(DocumentListener listener)
          Adds a document listener.
 void addObserver(Observer o)
          Adds an obserser to the internally managed list of observers of this observable.
 void applyEvList()
          Applies current UIItems to the installed elements of this frame.
 void clearChanged()
          Sets the state to unchanged.
 void deleteObserver(Observer o)
          Deletes an obserser from the internally managed list of observers of this observable.
 void deleteObservers()
          Deletes all of the observers registered with this observable.
 void destroy()
          Destroys this instance.
 void fireDocumentDataChanged(Document document)
          Fires a document-added event for the given Document.
 Document getActiveDocument()
          Returns the active document.
 int getDocumentCount()
          Returns the number of currently open documents.
 DocumentListener getDocumentListener()
          Returns the active DocumentListener.
 java.util.List getDocuments()
          Returns all active documents.
 javax.swing.JComponent getJComponent()
          Returns the actual embeddable JComponent.
 Observable getObservable()
          Returns the internally manages Observable instance.
 java.util.Collection getObservers()
          Returns a collection of the observers currently registered with this observable.
 void indicateModifiedDocument(Document document)
          The mdi component shall indicate visually that the given document was modified.
 void indicateUnmodifiedDocument(Document document)
          The mdi component shall indicate visually that the given document was not modified.
 void installEvList()
          Tells the component to setup its internal state.
 void internalFrameActivated(javax.swing.event.InternalFrameEvent e)
          delegates activated document to observers.
 void internalFrameClosed(javax.swing.event.InternalFrameEvent e)
          callback that is invoked if an internal frame is closed.
 void internalFrameClosing(javax.swing.event.InternalFrameEvent e)
          Callback before an internal frame is actually closed.
 void internalFrameDeactivated(javax.swing.event.InternalFrameEvent e)
          delegates inactivation to observers by sending null argument.
 void internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
          Invoked when an internal frame is de-iconified.
 void internalFrameIconified(javax.swing.event.InternalFrameEvent e)
          Invoked when an internal frame is iconified.
 void internalFrameOpened(javax.swing.event.InternalFrameEvent e)
          Invoked when a internal frame has been opened.
 void notifyObservers()
          Performs a notify on all registered observers, if the state has changed since the last notification.
 void notifyObservers(java.lang.Object arg)
          Performs a notify on all registered observers, if the state has changed since the last notification.
 void postValidate()
          Hook for internal adjustments after validation.
 void removeActiveDocument()
          Closes the active document.
 void removeDocument(Document document)
          Closes the given document and removes it from the mdi container.
 void removeDocumentListener(DocumentListener listener)
          Removes a document listener.
 void renameDocument(Document document, java.lang.String name)
          Renames a document.
 void setActiveDocument(Document document)
          Sets the active document.
 void setChanged()
          Sets the state to changed.
 void setDocumentListener(DocumentListener documentlistener)
          Sets a single document listener.
 void setObservable(Observable observable)
          Sets an observable.
 void setSelectedFrame(javax.swing.JInternalFrame jframe)
          Sets the selected internal frame.
 void updateUI()
           
 
Methods inherited from class javax.swing.JDesktopPane
getAccessibleContext, getAllFrames, getAllFramesInLayer, getDesktopManager, getDragMode, getSelectedFrame, getUI, getUIClassID, isOpaque, paramString, setDesktopManager, setDragMode, setUI
 
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, setLayer, setLayer, setPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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

uiItemEvList

public UIItemEvaluationList uiItemEvList
ItemList used to perform the language switch

Constructor Detail

FramedMDIComponent

public FramedMDIComponent(java.util.List initialdocuments,
                          MenuTool windowmenu,
                          UIManager uimanager,
                          DocumentDropContext opener)
Constructs a new framed mdi component.

Parameters:
initialdocuments - the list of initialdocuments for this mdi component.
windowmenu - the windowmenu reference to use for keeping a visual list of currently open documents.
uimanager - reference to an uimanager.
opener - a document opener reference for drag and drop opening of documents.
Method Detail

destroy

public void destroy()
Destroys this instance. Internal resources are free'd.


installEvList

public void installEvList()
Description copied from interface: Evaluable
Tells the component to setup its internal state.

Specified by:
installEvList in interface Evaluable

setDocumentListener

public void setDocumentListener(DocumentListener documentlistener)
Description copied from interface: MDIComponent
Sets a single document listener. Use with caution.

Specified by:
setDocumentListener in interface MDIComponent
Parameters:
documentlistener - the documentlistener to set.

getDocumentListener

public DocumentListener getDocumentListener()
Returns the active DocumentListener.

Returns:
the active DocumentListener.

setSelectedFrame

public void setSelectedFrame(javax.swing.JInternalFrame jframe)
Sets the selected internal frame.

Parameters:
jframe - the JInternalFrame to select.

addDocumentListener

public void addDocumentListener(DocumentListener listener)
Description copied from interface: MDIComponent
Adds a document listener.

Specified by:
addDocumentListener in interface MDIComponent
Parameters:
listener - the documentlistener to add.

removeDocumentListener

public void removeDocumentListener(DocumentListener listener)
Description copied from interface: MDIComponent
Removes a document listener.

Specified by:
removeDocumentListener in interface MDIComponent
Parameters:
listener - the documentlistener to remove.

applyEvList

public void applyEvList()
Applies current UIItems to the installed elements of this frame.

Specified by:
applyEvList in interface Evaluable

getJComponent

public javax.swing.JComponent getJComponent()
Returns the actual embeddable JComponent.

Specified by:
getJComponent in interface SwingMDIComponent
Returns:
the actual embeddable JComponent.

addDocument

public void addDocument(Document document)
Description copied from interface: MDIComponent
Adds the given Document to the container.

Specified by:
addDocument in interface MDIComponent
Parameters:
document - the document to add to the container.

postValidate

public void postValidate()
Hook for internal adjustments after validation.

Specified by:
postValidate in interface MDIComponent

removeDocument

public void removeDocument(Document document)
Description copied from interface: MDIComponent
Closes the given document and removes it from the mdi container.

Specified by:
removeDocument in interface MDIComponent
Parameters:
document - the document to close and remove.

indicateModifiedDocument

public void indicateModifiedDocument(Document document)
Description copied from interface: MDIComponent
The mdi component shall indicate visually that the given document was modified. This is needed by application that likes to visually point out that a document was modified and thus may require saving before the application is exited.

Specified by:
indicateModifiedDocument in interface MDIComponent
Parameters:
document - the modified document.

indicateUnmodifiedDocument

public void indicateUnmodifiedDocument(Document document)
Description copied from interface: MDIComponent
The mdi component shall indicate visually that the given document was not modified.

Specified by:
indicateUnmodifiedDocument in interface MDIComponent
Parameters:
document - the unmodified document.

setActiveDocument

public void setActiveDocument(Document document)
Description copied from interface: MDIComponent
Sets the active document. The given document must be in the container.

Specified by:
setActiveDocument in interface MDIComponent
Parameters:
document - the document to activate.

getActiveDocument

public Document getActiveDocument()
Description copied from interface: MDIComponent
Returns the active document.

Specified by:
getActiveDocument in interface MDIComponent
Returns:
the active document.

removeActiveDocument

public void removeActiveDocument()
Description copied from interface: MDIComponent
Closes the active document.

Specified by:
removeActiveDocument in interface MDIComponent

renameDocument

public void renameDocument(Document document,
                           java.lang.String name)
Description copied from interface: MDIComponent
Renames a document.

Specified by:
renameDocument in interface MDIComponent
Parameters:
document - the document to rename.
name - the new name for the document.

internalFrameActivated

public void internalFrameActivated(javax.swing.event.InternalFrameEvent e)
delegates activated document to observers.

Specified by:
internalFrameActivated in interface javax.swing.event.InternalFrameListener

internalFrameDeactivated

public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent e)
delegates inactivation to observers by sending null argument.

Specified by:
internalFrameDeactivated in interface javax.swing.event.InternalFrameListener

internalFrameClosed

public void internalFrameClosed(javax.swing.event.InternalFrameEvent e)
callback that is invoked if an internal frame is closed.

Specified by:
internalFrameClosed in interface javax.swing.event.InternalFrameListener

internalFrameClosing

public void internalFrameClosing(javax.swing.event.InternalFrameEvent e)
Callback before an internal frame is actually closed.

Specified by:
internalFrameClosing in interface javax.swing.event.InternalFrameListener

internalFrameDeiconified

public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
Invoked when an internal frame is de-iconified.

Specified by:
internalFrameDeiconified in interface javax.swing.event.InternalFrameListener
See Also:
JInternalFrame.setIcon(boolean)

internalFrameIconified

public void internalFrameIconified(javax.swing.event.InternalFrameEvent e)
Invoked when an internal frame is iconified.

Specified by:
internalFrameIconified in interface javax.swing.event.InternalFrameListener
See Also:
JInternalFrame.setIcon(boolean)

internalFrameOpened

public void internalFrameOpened(javax.swing.event.InternalFrameEvent e)
Invoked when a internal frame has been opened.

Specified by:
internalFrameOpened in interface javax.swing.event.InternalFrameListener
See Also:
JInternalFrame.show()

getDocuments

public java.util.List getDocuments()
Returns all active documents.

Specified by:
getDocuments in interface MDIComponent
Returns:
the list of currently active documents.

getDocumentCount

public int getDocumentCount()
Returns the number of currently open documents.

Specified by:
getDocumentCount in interface MDIComponent
Returns:
the number of currently open documents.

addObserver

public void addObserver(Observer o)
Adds an obserser to the internally managed list of observers of this observable.

Specified by:
addObserver in interface Observable
Parameters:
o - the observer to add to the internal list.
Throws:
throws - InvalidArgumentException if the observer is currently registered or if the argument is null.

deleteObserver

public void deleteObserver(Observer o)
Deletes an obserser from the internally managed list of observers of this observable.

Specified by:
deleteObserver in interface Observable
Parameters:
o - the observer to delete from the internal list.
Throws:
throws - InvalidArgumentException if the observer is not currently registered or if the argument is null.

deleteObservers

public void deleteObservers()
Deletes all of the observers registered with this observable.

Specified by:
deleteObservers in interface Observable

notifyObservers

public void notifyObservers()
Description copied from interface: Observable
Performs a notify on all registered observers, if the state has changed since the last notification.

Specified by:
notifyObservers in interface Observable
See Also:
Observable.setChanged()

getObservable

public Observable getObservable()
Returns the internally manages Observable instance.

Specified by:
getObservable in interface MDIComponent
Returns:
the internally manages Observable instance.

notifyObservers

public void notifyObservers(java.lang.Object arg)
Description copied from interface: Observable
Performs a notify on all registered observers, if the state has changed since the last notification.

Specified by:
notifyObservers in interface Observable
Parameters:
arg - additional argument to pass to the observers.
See Also:
Observable.setChanged()

setObservable

public void setObservable(Observable observable)
Description copied from interface: MDIComponent
Sets an observable. Useful during switch of MDIComponents.

Specified by:
setObservable in interface MDIComponent
Parameters:
observable - the observable to set for the mdi component.

setChanged

public void setChanged()
Sets the state to changed. Affects the next notification.

Specified by:
setChanged in interface Observable

clearChanged

public void clearChanged()
Sets the state to unchanged. Affects the next notification.

Specified by:
clearChanged in interface Observable

getObservers

public java.util.Collection getObservers()
Returns a collection of the observers currently registered with this observable.

Specified by:
getObservers in interface Observable
Returns:
collection of the observers.

fireDocumentDataChanged

public void fireDocumentDataChanged(Document document)
Fires a document-added event for the given Document.

Specified by:
fireDocumentDataChanged in interface MDIComponent
Parameters:
document - the added Document.

updateUI

public void updateUI()


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.