com.tensegrity.gui.document
Interface Document

All Superinterfaces:
Container, Observer
All Known Subinterfaces:
GraphDocument, TemplateDocument
All Known Implementing Classes:
AbstractDocument, SwingGraphDocument, SwingTemplateDocument, SwtGraphDocument

public interface Document
extends Observer, Container

A document is basically a window inside the application containing a single view of user data. In a tabbed mdi-container, the document could be shown on a single tab-pane.

The components that display multiple documents are subclasses of the MDIComponent base class. MDI stands for Multiple-Document-Interface. All these documents are derived from this base interface.

Version:
$Id: Document.java,v 1.20 2006/04/20 08:38:56 BurkhardWick Exp $
Author:
Stepan Rutz

Field Summary
static int GLUE_LEFTBOTTOM
          Some documents can be special, for example a toolbox document, a navigator document and such.
static int GLUE_LEFTCENTEREXTEND
          Some documents can be special, for example a toolbox document, a navigator document and such.
static int GLUE_LEFTTOP
          Some documents can be special, for example a toolbox document, a navigator document and such.
static int GLUE_RIGHTBOTTOM
          Some documents can be special, for example a toolbox document, a navigator document and such.
static int GLUE_RIGHTCENTEREXTEND
          Some documents can be special, for example a toolbox document, a navigator document and such.
static int GLUE_RIGHTTOP
          Some documents can be special, for example a toolbox document, a navigator document and such.
static int TYPE_FIXED_SIZE
          Some documents can be special, for example a toolbox document, a navigator document and such.
static int TYPE_PACK_IS_OK
          Some documents can be special, for example a toolbox document, a navigator document and such.
static int TYPE_TOOLDOCUMENT
          Some documents can be special, for example a toolbox document, a navigator document and such.
 
Method Summary
 void closeHandler()
          This method is a callback that is invoked before the document is closed.
 int getCopyCounter()
          Returns the copy counter and increments it by one afterwards.
 DocumentDataProvider getDocumentDataProvider(java.lang.String key)
          Returns the DocumentDataProvider that can provide the requested information described by the given key.
 java.lang.Object getDocumentSetting(java.lang.String key)
          Retrieves the value of an application defined document setting that has been previously stored in this instance.
 AttributeList getDocumentSettings()
          Returns all document settings serialized as AttributeList.
 java.io.File getFile()
          Gets the file of this document if it was saved or loaded before.
 int getFlags()
          Returns flags describing the nature of the document.
 boolean isModified()
          Returns a boolean flag which indicates if the document has been modified since the last save operation.
 void setDocumentSetting(java.lang.String key, java.lang.Object value)
          Stores the value for an application defined document setting.
 void setDocumentSettings(AttributeList settings)
          Sets document settings from an AttributeList structure that has usually been read from a file.
 void setFile(java.io.File file)
          Sets the file for this document instance.
 void setModified()
          Sets the modified flag to true.
 void setUnmodified()
          Sets the modified flag to false.
 
Methods inherited from interface com.tensegrity.generic.util.Observer
update
 
Methods inherited from interface com.tensegrity.gui.container.Container
getApplicationFrame, getName, setName, setSelected
 

Field Detail

TYPE_TOOLDOCUMENT

public static final int TYPE_TOOLDOCUMENT
Some documents can be special, for example a toolbox document, a navigator document and such. Flags exist to tag such documents. These flags are bitmasks!!!

See Also:
Constant Field Values

TYPE_PACK_IS_OK

public static final int TYPE_PACK_IS_OK
Some documents can be special, for example a toolbox document, a navigator document and such. Flags exist to tag such documents. These flags are bitmasks!!!

See Also:
Constant Field Values

TYPE_FIXED_SIZE

public static final int TYPE_FIXED_SIZE
Some documents can be special, for example a toolbox document, a navigator document and such. Flags exist to tag such documents. These flags are bitmasks!!!

See Also:
Constant Field Values

GLUE_LEFTTOP

public static final int GLUE_LEFTTOP
Some documents can be special, for example a toolbox document, a navigator document and such. Flags exist to tag such documents. These flags are bitmasks!!!

See Also:
Constant Field Values

GLUE_RIGHTTOP

public static final int GLUE_RIGHTTOP
Some documents can be special, for example a toolbox document, a navigator document and such. Flags exist to tag such documents. These flags are bitmasks!!!

See Also:
Constant Field Values

GLUE_LEFTBOTTOM

public static final int GLUE_LEFTBOTTOM
Some documents can be special, for example a toolbox document, a navigator document and such. Flags exist to tag such documents. These flags are bitmasks!!!

See Also:
Constant Field Values

GLUE_RIGHTBOTTOM

public static final int GLUE_RIGHTBOTTOM
Some documents can be special, for example a toolbox document, a navigator document and such. Flags exist to tag such documents. These flags are bitmasks!!!

See Also:
Constant Field Values

GLUE_LEFTCENTEREXTEND

public static final int GLUE_LEFTCENTEREXTEND
Some documents can be special, for example a toolbox document, a navigator document and such. Flags exist to tag such documents. These flags are bitmasks!!!

See Also:
Constant Field Values

GLUE_RIGHTCENTEREXTEND

public static final int GLUE_RIGHTCENTEREXTEND
Some documents can be special, for example a toolbox document, a navigator document and such. Flags exist to tag such documents. These flags are bitmasks!!!

See Also:
Constant Field Values
Method Detail

getFlags

public int getFlags()
Returns flags describing the nature of the document.

Returns:
flags describing the nature of the document.

getCopyCounter

public int getCopyCounter()
Returns the copy counter and increments it by one afterwards.

Returns:
the copy counter value.

getFile

public java.io.File getFile()
Gets the file of this document if it was saved or loaded before. Otherwise the file reference returned is null.

Returns:
the file of this document.

Find more information in the class documentation


setFile

public void setFile(java.io.File file)
Sets the file for this document instance. It should be set when the document is either loaded or saved.

Parameters:
file - the file of this document.

Find more information in the class documentation


closeHandler

public void closeHandler()
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.

Find more information in the class documentation


isModified

public boolean isModified()
Returns a boolean flag which indicates if the document has been modified since the last save operation. Saving is usually required if the document is in the modified state.

Returns:
flag that indicates whether saving is needed or not.

Find more information in the class documentation


setUnmodified

public void setUnmodified()
Sets the modified flag to false.

Find more information in the class documentation


setModified

public void setModified()
Sets the modified flag to true.

Find more information in the class documentation


setDocumentSetting

public void setDocumentSetting(java.lang.String key,
                               java.lang.Object value)
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.

Parameters:
key - The key to store the setting under
value - The new value for the setting or null to remove the setting

getDocumentSetting

public java.lang.Object getDocumentSetting(java.lang.String key)
Retrieves the value of an application defined document setting that has been previously stored in this instance.

Parameters:
key - The key of the setting
Returns:
The current value of the setting
See Also:
setDocumentSetting(String, Object)

getDocumentSettings

public AttributeList getDocumentSettings()
Returns all document settings serialized as AttributeList. This is used by the GraphDocumentWriter to serialize the document.

Returns:
all document settings as AttributeList

setDocumentSettings

public void setDocumentSettings(AttributeList settings)
Sets document settings from an AttributeList structure that has usually been read from a file. The document will parse the contents and will store the settings in an internal map. Afterwards each of the settings will be available through the method getDocumentSetting(String).

Parameters:
settings - all document settings as AttributeList

getDocumentDataProvider

public DocumentDataProvider getDocumentDataProvider(java.lang.String key)
Returns the DocumentDataProvider that can provide the requested information described by the given key. The method returns null, if there is no matching provider.

Parameters:
key - The key describing the requested information
Returns:
the DocumentDataProvider implementation
See Also:
DocumentDataProvider

Find more information in the class documentation



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