com.tensegrity.gui.swt.document
Class SwtDocument

java.lang.Object
  extended bycom.tensegrity.gui.document.AbstractDocument
      extended bycom.tensegrity.gui.swt.document.SwtDocument
All Implemented Interfaces:
Container, Disposable, Document, Observer
Direct Known Subclasses:
SwtGraphDocument

public class SwtDocument
extends AbstractDocument
implements Disposable

This class represents a SWT-based Document.

The class SwtDocument holds a Control instance to ease the integration of Documents in a SWT context. As an observer, this class delegates each update invocation to a call to the redraw() method of the internal Control.

Note that the internal Control is not set by default. It is therefore the responsibility of the caller or subclass to set it.

Version:
$Id: SwtDocument.java,v 1.12 2005/07/29 14:13:00 SebastienGuyon Exp $
Author:
S�bastien Guyon

Field Summary
 
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
SwtDocument(java.lang.String name, ApplicationFrame appFrame)
          Constructor for a basic Document in the context of SWT applications.
 
Method Summary
 void dispose()
           Use this method in order to dispose the SWT resources held by instance of classes implementing the Disposable interface.
 ApplicationFrame getApplicationFrame()
          Returns the enclosing ApplicationFrame of this Container.
 org.eclipse.swt.widgets.Control getControl()
          Returns the reference to the internal Control.
 void setControl(org.eclipse.swt.widgets.Control control)
           Sets the internal Control.
 void update(Observable o, java.lang.Object arg)
          Triggers a repaint.
 
Methods inherited from class com.tensegrity.gui.document.AbstractDocument
closeHandler, getCopyCounter, getDocumentDataProvider, getDocumentSetting, getDocumentSettings, getFile, getFlags, getName, isModified, setDocumentSetting, setDocumentSettings, setFile, setModified, setName, setSelected, setUnmodified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwtDocument

public SwtDocument(java.lang.String name,
                   ApplicationFrame appFrame)
Constructor for a basic Document in the context of SWT applications.

Parameters:
name - The document name
appFrame - application context giving access to application specific information to instances of SwtDocument.
Method Detail

getControl

public org.eclipse.swt.widgets.Control getControl()
Returns the reference to the internal Control.

Returns:
the internal Control.

update

public void update(Observable o,
                   java.lang.Object arg)
Description copied from class: AbstractDocument
Triggers a repaint.

Specified by:
update in interface Observer
Specified by:
update in class AbstractDocument

dispose

public void dispose()
Description copied from interface: Disposable

Use this method in order to dispose the SWT resources held by instance of classes implementing the Disposable interface.

Specified by:
dispose in interface Disposable

getApplicationFrame

public ApplicationFrame getApplicationFrame()
Description copied from interface: Container
Returns the enclosing ApplicationFrame of this Container.

Specified by:
getApplicationFrame in interface Container
Returns:
the instance of the enclosing ApplicationFrame.

setControl

public void setControl(org.eclipse.swt.widgets.Control control)

Sets the internal Control.

Parameters:
control - the Control representing this Document.


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