com.tensegrity.gui.swing.document
Class MDIToolkit

java.lang.Object
  extended bycom.tensegrity.gui.swing.document.MDIToolkit

public final class MDIToolkit
extends java.lang.Object

This class has utility functions for the mdi functionality. It has methods to switch to a certain mdi-container given some initial parameters. Also certain types of documents can be found by means of appropriate convenience methods.

Version:
$Id: MDIToolkit.java,v 1.47 2005/12/16 09:02:54 BurkhardWick Exp $
Author:
StepanRutz

Method Summary
static javax.swing.JMenu createDocumentsMenu(MDIComponent mdi)
          Creates a documents-menu containing an entry for each mdi component.
static AttributeTableDocument findFirstAttributeDocument(java.util.List documents)
          Finds a document of the wanted type or null if none is found.
static LayoutToolDocument findFirstLayoutToolsDocument(java.util.List documents)
          Finds a document of the wanted type or null if none is found.
static NavigatorDocument findFirstNavigatorDocument(java.util.List documents)
          Finds a document of the wanted type or null if none is found.
static ObjectTreeDocument findFirstObjectTreeDocument(java.util.List documents)
          Finds a document of the wanted type or null if none is found.
static RepositoryDocument findFirstRepositoryDocument(java.util.List documents)
          Finds a document of the wanted type or null if none is found.
static MDIComponent getSDIComponent(ApplicationFrame applicationFrame, java.awt.Container targetContainer, MenuTool toolMenu, Command closeDocumentCommand)
          Returns a SDI mdi component.
static MDIComponent getTabbedMDIComponent(ApplicationFrame applicationFrame, java.awt.Container targetContainer, MenuTool toolMenu, Command closeDocumentCommand)
          Deprecated. Use initTabbedMDIComponent instead!
static MDIComponent initSDIComponent(PanelMDIComponent mdi, ApplicationFrame applicationFrame, java.awt.Container targetContainer, MenuTool toolMenu)
          Creates an instance of MDIComponent by creating a SingleDocumentInterface based control.
static void initTabbedMDIComponent(ApplicationFrame applicationFrame, java.awt.Container targetContainer, MenuTool toolMenu, SwingMDIComponent mdi)
          Returns an instance of MDIComponent based on the given ApplicationFrame.
static MDIComponent setFramedMDIStyle(java.util.List documents, java.awt.Container panel, Observable observable, MenuTool windowmenu, javax.swing.JToolBar toolbar, DocumentListener documentlistener, UIManager uimanager, DocumentDropContext opener)
          This method takes a list of mdi-documents and builds a new Framed MDI styled container and adds all the documents that mdi-container.
static MDIComponent setTabbedMDIStyle(java.util.List documents, java.awt.Container panel, Observable observable, MenuTool windowmenu, javax.swing.JToolBar toolbar, DocumentListener documentlistener, Command closeDocumentCommand, UIManager uimanager, DocumentDropContext opener)
          This method takes a list of mdi-documents and builds a new Framed MDI styled container and adds all the documents that mdi-container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setFramedMDIStyle

public static final MDIComponent setFramedMDIStyle(java.util.List documents,
                                                   java.awt.Container panel,
                                                   Observable observable,
                                                   MenuTool windowmenu,
                                                   javax.swing.JToolBar toolbar,
                                                   DocumentListener documentlistener,
                                                   UIManager uimanager,
                                                   DocumentDropContext opener)
This method takes a list of mdi-documents and builds a new Framed MDI styled container and adds all the documents that mdi-container. Afterwards the mdi-container itself is placed inside the awt container that holds it. It is placed with an add method that specifies Borderlayout's center constraint.

Parameters:
documents - the initial list of document to display in the mdi-container.
panel - the awt container that holds the mdi component in its center.
observable - the observable that updates the mdi-components upon document change.
windowmenu - a reference to a windowmenu class, which is kept up to date concerning the list of active windows.
toolbar - toolbar reference.
documentlistener - document listener to set.
uimanager - ui-manager reference.
opener - the document opener reference, may be null.
Returns:
the framed MDIComponent.

setTabbedMDIStyle

public static final MDIComponent setTabbedMDIStyle(java.util.List documents,
                                                   java.awt.Container panel,
                                                   Observable observable,
                                                   MenuTool windowmenu,
                                                   javax.swing.JToolBar toolbar,
                                                   DocumentListener documentlistener,
                                                   Command closeDocumentCommand,
                                                   UIManager uimanager,
                                                   DocumentDropContext opener)
This method takes a list of mdi-documents and builds a new Framed MDI styled container and adds all the documents that mdi-container. Afterwards the mdi-container itself is placed inside the awt container that holds it. It is placed with an add method that specifies Borderlayout's center constraint.

Parameters:
documents - the initial list of document to display in the mdi-container.
panel - the awt container that holds the mdi component in its center.
observable - the observable that updates the mdi-components upon document change.
windowmenu - a reference to a windowmenu class, which is kept up to date concerning the list of active windows.
toolbar - the toolbar reference
documentlistener - a documentlistener to use.
closeDocumentCommand - command that closes documents.
uimanager - ui-manager reference.
opener - reference to a document opener (optional).
Returns:
the new mdi component.

getTabbedMDIComponent

public static final MDIComponent getTabbedMDIComponent(ApplicationFrame applicationFrame,
                                                       java.awt.Container targetContainer,
                                                       MenuTool toolMenu,
                                                       Command closeDocumentCommand)
Deprecated. Use initTabbedMDIComponent instead!

Returns an instance of MDIComponent based on the given ApplicationFrame. This method layouts the targetContainer parameter according to the valid ToolContainers of the given Application frame and their constraints. The TabbedMDIComponent, used for the documents, is always placed in the center of the targetContainer.

Parameters:
applicationFrame - The ApplicationFrame for which you want to receive the MDIComponent.
targetContainer - The target container to put all components into.
toolMenu - the ToolMenu to add the ToolContainers too.
closeDocumentCommand - the command to be used to enable closing of documents.
Returns:
MDIComponent reflecting the state of the ApplicationFrame.

initTabbedMDIComponent

public static final void initTabbedMDIComponent(ApplicationFrame applicationFrame,
                                                java.awt.Container targetContainer,
                                                MenuTool toolMenu,
                                                SwingMDIComponent mdi)
Returns an instance of MDIComponent based on the given ApplicationFrame. This method layouts the targetContainer parameter according to the valid ToolContainers of the given Application frame and their constraints. The TabbedMDIComponent, used for the documents, is always placed in the center of the targetContainer.

Parameters:
applicationFrame - The ApplicationFrame for which you want to receive the MDIComponent.
targetContainer - The target container to put all components into.
toolMenu - the ToolMenu to add the ToolContainers too.
mdi - The TabbedMDIComponent to initialize

getSDIComponent

public static final MDIComponent getSDIComponent(ApplicationFrame applicationFrame,
                                                 java.awt.Container targetContainer,
                                                 MenuTool toolMenu,
                                                 Command closeDocumentCommand)
Returns a SDI mdi component.

Parameters:
applicationFrame - the active ApplicationFrame.
targetContainer - the target Container.
toolMenu - the tool menu reference.
closeDocumentCommand - the close document Command.SwingGraphPanel
Returns:
the mdi component

initSDIComponent

public static final MDIComponent initSDIComponent(PanelMDIComponent mdi,
                                                  ApplicationFrame applicationFrame,
                                                  java.awt.Container targetContainer,
                                                  MenuTool toolMenu)
Creates an instance of MDIComponent by creating a SingleDocumentInterface based control.

Parameters:
mdi - the target MDI instance to configure.
applicationFrame - the enclosing application.
targetContainer - the AWT container to add all the components to.
toolMenu - a ToolMenu to initialize while creating the component.
Returns:
the fully intialized and ready to use SDI component.

createDocumentsMenu

public static javax.swing.JMenu createDocumentsMenu(MDIComponent mdi)
Creates a documents-menu containing an entry for each mdi component.

Parameters:
mdi - the mdicomponent to create a documents-menu for.
Returns:
the returned JMenu.

findFirstNavigatorDocument

public static NavigatorDocument findFirstNavigatorDocument(java.util.List documents)
Finds a document of the wanted type or null if none is found.

Parameters:
documents - the list of documents to search.
Returns:
the document of the wanted type or null if none is found.

findFirstAttributeDocument

public static AttributeTableDocument findFirstAttributeDocument(java.util.List documents)
Finds a document of the wanted type or null if none is found.

Parameters:
documents - the list of documents to search.
Returns:
the document of the wanted type or null if none is found.

findFirstRepositoryDocument

public static RepositoryDocument findFirstRepositoryDocument(java.util.List documents)
Finds a document of the wanted type or null if none is found.

Parameters:
documents - the list of documents to search.
Returns:
the document of the wanted type or null if none is found.

findFirstLayoutToolsDocument

public static LayoutToolDocument findFirstLayoutToolsDocument(java.util.List documents)
Finds a document of the wanted type or null if none is found.

Parameters:
documents - the list of documents to search.
Returns:
the document of the wanted type or null if none is found.

findFirstObjectTreeDocument

public static ObjectTreeDocument findFirstObjectTreeDocument(java.util.List documents)
Finds a document of the wanted type or null if none is found.

Parameters:
documents - the list of documents to search.
Returns:
the document of the wanted type or null if none is found.


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