com.tensegrity.gui.swing.document
Class SwingGraphDocument

java.lang.Object
  extended bycom.tensegrity.gui.document.AbstractDocument
      extended bycom.tensegrity.gui.swing.document.SwingDocument
          extended bycom.tensegrity.gui.swing.document.SwingGraphDocument
All Implemented Interfaces:
Container, Document, GraphDocument, Observer
Direct Known Subclasses:
SwingTemplateDocument

public class SwingGraphDocument
extends SwingDocument
implements GraphDocument

This class represents the GraphDocument implementation for Swing-based applications.

An instance of this class is used together with an instance of class SwingGraphPanel. One instance of SwingGraphDocument is associated 1:1 with a dedicated instance of SwingGraphPanel.

Version:
$Id: SwingGraphDocument.java,v 1.38 2006/03/02 10:44:00 BurkhardWick Exp $
Author:
Stepan Rutz

Field Summary
 
Fields inherited from interface com.tensegrity.gui.graphdocument.GraphDocument
SETTING_ADJUSTVIEWAFTEROPEN, SETTING_ANTIALIAS, SETTING_COMPRESSIMAGES, SETTING_COMPRESSION, SETTING_DRAWINGORDER, SETTING_SAVEGEOMETRYDEFS, SETTING_SAVEGEOMETRYDEFSFILTER, SETTING_SAVEIMAGES, SETTING_SAVELAYOUT, SETTING_SAVELAYOUTDEFSFILTER, SETTING_SAVEPREVIEW, SETTING_SAVERULEDEFS, SETTING_SAVERULEDEFSFILTER, SETTING_SAVESTYLEDEFS, SETTING_SAVESTYLEDEFSFILTER, SETTING_SETDIRTYONVIEWCHANGES, SETTING_USEXMLENTITIES, SETTING_WARNWHENLOSINGINFOS_IMAGES, SETTING_WARNWHENLOSINGINFOS_LAYOUT, SETTING_WARNWHENLOSINGINFOS_RULES, SETTINGVALUE_COMPRESSION_GZIP, SETTINGVALUE_COMPRESSION_NONE, SETTINGVALUE_FILTER_ALL, SETTINGVALUE_FILTER_USED, SETTINGVALUE_WARNWHENLOSINGINFOS_CHANGED, SETTINGVALUE_WARNWHENLOSINGINFOS_NEVER, SETTINGVALUE_WARNWHENLOSINGINFOS_USED, SETTINGVALUE_WARNWHENLOSINGINFOS_USEDORCHANGED, SETTINGVALUE_WARNWHENLOSINGINFOS_USINGCHANGED
 
Fields inherited from interface com.tensegrity.gui.document.Document
GLUE_LEFTBOTTOM, GLUE_LEFTCENTEREXTEND, GLUE_LEFTTOP, GLUE_RIGHTBOTTOM, GLUE_RIGHTCENTEREXTEND, GLUE_RIGHTTOP, TYPE_FIXED_SIZE, TYPE_PACK_IS_OK, TYPE_TOOLDOCUMENT
 
Constructor Summary
SwingGraphDocument(java.lang.String name, ApplicationFrame appFrame, DragContext vgoDragSource)
          Constructor for GraphDocument.
SwingGraphDocument(java.lang.String name, ApplicationFrame appFrame, GraphController graphcontroller, VisualGraphView visualgraphview)
          Constructor for GraphDocument specifying a name, the GraphApplication and the graph controller and VisualGraphView to use.
SwingGraphDocument(java.lang.String name, ApplicationFrame appFrame, GraphController graphcontroller, VisualGraphView visualgraphview, DragContext vgoDragSource)
          Constructor for GraphDocument.
SwingGraphDocument(java.lang.String name, GraphApplication graphapplication, DragContext vgoDragSource)
          Deprecated. Use SwingGraphDocument(String, ApplicationFrame, DragContext) instead!
SwingGraphDocument(java.lang.String name, GraphApplication graphapplication, GraphController graphcontroller, VisualGraphView visualgraphview)
          Deprecated. Use SwingGraphDocument(String, ApplicationFrame, GraphController, VisualGraphView) instead!
SwingGraphDocument(java.lang.String name, GraphApplication graphapplication, GraphController graphcontroller, VisualGraphView visualgraphview, DragContext vgoDragSource)
          Deprecated. Use SwingGraphDocument(String, ApplicationFrame, GraphController, VisualGraphView, DragContext) instead!
SwingGraphDocument(java.lang.String name, GraphController graphcontroller, VisualGraphView visualgraphview)
          Constructor for GraphDocument.
SwingGraphDocument(java.lang.String name, GraphController graphcontroller, VisualGraphView visualgraphview, DragContext vgoDragSource)
          Constructor for GraphDocument.
 
Method Summary
 void closeHandler()
          This method is a callback that is invoked before the document is closed.
 GraphPanel getGraphPanel()
          Returns the reference to the internally embedded GraphPanel instance.
 javax.swing.JComponent getJComponent()
          Returns the reference to the internal panel.
 BasePageFormat getPageFormat()
          Returns the this documents PageFormat instance.
 ViewBuilderFilter getViewBuilderFilter()
          Returns the active ViewBuilderFilter of this GraphDocument instance.
 ViewSerializerFilter getViewSerializerFilter()
          Returns the active ViewSerializerFilter of this GraphDocument instance.
 void registerViewBuilderFilter(ViewBuilderFilter filterBuildView)
          Registers a ViewBuilderFilter for later use in this GraphDocument.
 void registerViewSerializerFilter(ViewSerializerFilter filterSerializeView)
          Registers a ViewSerializerFilter for later use in this GraphDocument.
 void setDocumentSetting(java.lang.String key, java.lang.Object value)
          Stores the value for an application defined document setting.
 void setModified()
          Sets the modified flag to true.
 void setPageFormat(BasePageFormat format)
          Sets a PageFormat for this document.
 void setUnmodified()
          Sets the modified flag to false.
 void setVisualGraphView(VisualGraphView visualgraphview, GraphController graphcontroller)
          Sets the VisualGraphView to be shown in the this GraphDocument.
 void update(Observable o, java.lang.Object arg)
          The callback method of an observer that is invoked by the Observable each time the state has changed.
 
Methods inherited from class com.tensegrity.gui.swing.document.SwingDocument
getApplicationFrame
 
Methods inherited from class com.tensegrity.gui.document.AbstractDocument
getCopyCounter, getDocumentDataProvider, getDocumentSetting, getDocumentSettings, getFile, getFlags, getName, isModified, setDocumentSettings, setFile, setName, setSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.tensegrity.gui.document.Document
getCopyCounter, getDocumentDataProvider, getDocumentSetting, getDocumentSettings, getFile, getFlags, isModified, setDocumentSettings, setFile
 
Methods inherited from interface com.tensegrity.gui.container.Container
getApplicationFrame, getName, setName, setSelected
 

Constructor Detail

SwingGraphDocument

public SwingGraphDocument(java.lang.String name,
                          GraphApplication graphapplication,
                          GraphController graphcontroller,
                          VisualGraphView visualgraphview)
Deprecated. Use SwingGraphDocument(String, ApplicationFrame, GraphController, VisualGraphView) instead!

Constructor for GraphDocument specifying a name, the GraphApplication and the graph controller and VisualGraphView to use. Internally a SwingGraphPanel instance is managed.

Parameters:
name - the document name
graphapplication - reference to a GraphApplication.
graphcontroller - the graph-controller that manages the document.
visualgraphview - the VisualGraphView to display. to display AttributeSets for editing.

Find more information in the class documentation


SwingGraphDocument

public SwingGraphDocument(java.lang.String name,
                          GraphApplication graphapplication,
                          GraphController graphcontroller,
                          VisualGraphView visualgraphview,
                          DragContext vgoDragSource)
Deprecated. Use SwingGraphDocument(String, ApplicationFrame, GraphController, VisualGraphView, DragContext) instead!

Constructor for GraphDocument. Internally a SwingGraphPanel instance is managed.

Parameters:
name - the document name
graphapplication - reference to the application.
graphcontroller - the graph controller that manages the document.
visualgraphview - the graphview to display to display attributesets for editing.
vgoDragSource - the compositedrag source, which provides information about the recently dragged composite.

SwingGraphDocument

public SwingGraphDocument(java.lang.String name,
                          GraphApplication graphapplication,
                          DragContext vgoDragSource)
Deprecated. Use SwingGraphDocument(String, ApplicationFrame, DragContext) instead!

Constructor for GraphDocument. Internally a SwingGraphPanel instance is managed.

Parameters:
name - the document name
graphapplication - reference to the application.
vgoDragSource - the DragContext.

SwingGraphDocument

public SwingGraphDocument(java.lang.String name,
                          GraphController graphcontroller,
                          VisualGraphView visualgraphview)
Constructor for GraphDocument. Internally a SwingGraphPanel instance is managed.

Parameters:
name - the document name
graphcontroller - the graph controller that manages the document.
visualgraphview - the graphview to display to display attributesets for editing.

SwingGraphDocument

public SwingGraphDocument(java.lang.String name,
                          GraphController graphcontroller,
                          VisualGraphView visualgraphview,
                          DragContext vgoDragSource)
Constructor for GraphDocument. Internally a SwingGraphPanel instance is managed.

Parameters:
name - the document name
graphcontroller - the graph controller that manages the document.
visualgraphview - the graphview to display to display attributesets for editing.
vgoDragSource - the compositedrag source, which provides information about the recently dragged composite.

SwingGraphDocument

public SwingGraphDocument(java.lang.String name,
                          ApplicationFrame appFrame,
                          GraphController graphcontroller,
                          VisualGraphView visualgraphview)
Constructor for GraphDocument specifying a name, the GraphApplication and the graph controller and VisualGraphView to use. Internally a SwingGraphPanel instance is managed.

Parameters:
name - the document name
appFrame - reference to the application frame.
graphcontroller - the graph-controller that manages the document.
visualgraphview - the VisualGraphView to display. to display AttributeSets for editing.

Find more information in the class documentation


SwingGraphDocument

public SwingGraphDocument(java.lang.String name,
                          ApplicationFrame appFrame,
                          GraphController graphcontroller,
                          VisualGraphView visualgraphview,
                          DragContext vgoDragSource)
Constructor for GraphDocument. Internally a SwingGraphPanel instance is managed.

Parameters:
name - the document name
appFrame - reference to the application frame.
graphcontroller - the graph controller that manages the document.
visualgraphview - the graphview to display to display attributesets for editing.
vgoDragSource - the compositedrag source, which provides information about the recently dragged composite.

SwingGraphDocument

public SwingGraphDocument(java.lang.String name,
                          ApplicationFrame appFrame,
                          DragContext vgoDragSource)
Constructor for GraphDocument. Internally a SwingGraphPanel instance is managed.

Parameters:
name - the document name
appFrame - reference to the application frame.
vgoDragSource - the DragContext.
Method Detail

getGraphPanel

public GraphPanel getGraphPanel()
Description copied from interface: GraphDocument
Returns the reference to the internally embedded GraphPanel instance.

Specified by:
getGraphPanel in interface GraphDocument
Returns:
the underlying GraphPanel instance.

setVisualGraphView

public void setVisualGraphView(VisualGraphView visualgraphview,
                               GraphController graphcontroller)
Description copied from interface: GraphDocument
Sets the VisualGraphView to be shown in the this GraphDocument.

Specified by:
setVisualGraphView in interface GraphDocument
Parameters:
visualgraphview - the VisualGraphView to show in this GraphDocument.
graphcontroller - the GraphController to use in this GraphDocument.

registerViewSerializerFilter

public void registerViewSerializerFilter(ViewSerializerFilter filterSerializeView)
Description copied from interface: GraphDocument
Registers a ViewSerializerFilter for later use in this GraphDocument.

Specified by:
registerViewSerializerFilter in interface GraphDocument
Parameters:
filterSerializeView - ViewSerializerFilter for later use in this GraphDocument

getViewSerializerFilter

public ViewSerializerFilter getViewSerializerFilter()
Description copied from interface: GraphDocument
Returns the active ViewSerializerFilter of this GraphDocument instance.

Specified by:
getViewSerializerFilter in interface GraphDocument
Returns:
the active ViewSerializerFilter of this GraphDocument instance.

registerViewBuilderFilter

public void registerViewBuilderFilter(ViewBuilderFilter filterBuildView)
Description copied from interface: GraphDocument
Registers a ViewBuilderFilter for later use in this GraphDocument.

Specified by:
registerViewBuilderFilter in interface GraphDocument
Parameters:
filterBuildView - ViewBuilderFilter for later use in this GraphDocument

getViewBuilderFilter

public ViewBuilderFilter getViewBuilderFilter()
Description copied from interface: GraphDocument
Returns the active ViewBuilderFilter of this GraphDocument instance.

Specified by:
getViewBuilderFilter in interface GraphDocument
Returns:
the active ViewBuilderFilter of this GraphDocument instance.

update

public void update(Observable o,
                   java.lang.Object arg)
Description copied from interface: Observer
The callback method of an observer that is invoked by the Observable each time the state has changed.

Specified by:
update in interface Observer
Overrides:
update in class SwingDocument

getJComponent

public javax.swing.JComponent getJComponent()
Description copied from class: SwingDocument
Returns the reference to the internal panel.

Overrides:
getJComponent in class SwingDocument
Returns:
reference to the internal panel.

closeHandler

public void closeHandler()
Description copied from interface: Document
This method is a callback that is invoked before the document is closed. It allows the document to clean up and properly dispose of any resources it had acquired and/or allocated.

Specified by:
closeHandler in interface Document
Overrides:
closeHandler in class AbstractDocument

setModified

public void setModified()
Description copied from interface: Document
Sets the modified flag to true.

Specified by:
setModified in interface Document
Overrides:
setModified in class AbstractDocument

setUnmodified

public void setUnmodified()
Description copied from interface: Document
Sets the modified flag to false.

Specified by:
setUnmodified in interface Document
Overrides:
setUnmodified in class AbstractDocument

getPageFormat

public BasePageFormat getPageFormat()
Description copied from interface: GraphDocument
Returns the this documents PageFormat instance. Providing such a Format instance is optional. If this method returns null a default format is used instead.

Specified by:
getPageFormat in interface GraphDocument
Returns:
either an instance of CustomPageFormat or null if a default format is used.
See Also:
CustomPageFormat, PrintUtil.getPageFormat(String, int)

setPageFormat

public void setPageFormat(BasePageFormat format)
Description copied from interface: GraphDocument
Sets a PageFormat for this document. If no such Format will be set, the default format will be used.

Specified by:
setPageFormat in interface GraphDocument
Parameters:
format - an instance of class BasePageFormat.

setDocumentSetting

public void setDocumentSetting(java.lang.String key,
                               java.lang.Object value)
Description copied from interface: Document
Stores the value for an application defined document setting. Depending on the type of the document and its implementation this can be an information like a creation date or a visualization option for the document contents. The key has to be a valid name for an attribute and the value has to be a valid value that can be serialized and built by the framework persistence (GraphDocumentReader and GraphDocumentWriter). You may pass null as value to remove the setting from the document.

Specified by:
setDocumentSetting in interface Document
Overrides:
setDocumentSetting in class AbstractDocument


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