|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.gui.document.AbstractDocument
com.tensegrity.gui.swing.document.SwingDocument
com.tensegrity.gui.swing.document.SwingGraphDocument
com.tensegrity.gui.swing.document.SwingTemplateDocument
The SwingTemplateDocument implements the document to be
used when creating Templates. A template is a single element from a
templatelist. Basically this implementation is based on the
SwingGraphDocument, but
provides additional functionality to handle Template elements, such as adding
primitives, toggling a grid- and snap-to-grid-mode and updating an associated
AttributableOnSet.
| 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 | |
SwingTemplateDocument(java.lang.String name,
GraphApplication graphapplication,
GraphController graphcontroller,
VisualGraphView visualgraphview,
DragContext vgoDragSource)
Creates the SwingTemplateDocument based on the given
name. |
|
| Method Summary | |
void |
addElements(BaseComposite baseComposite,
java.util.Map elementsMap)
This method recursively creates a map which either maps primtives to composites, or container to maps, which again contain primitve/composites or container/list elements. |
void |
addNodeForPrimitive(BaseComposite bcomposite,
Primitive primitive)
Adds a VisualNode, which wraps the given primitive, to this document. |
void |
addNodeForPrimitive(Primitive primitive)
Adds a VisualNode, which wraps the given primitive, to this document. |
void |
addVisualGraphObject(VisualGraphObject vgo,
int x,
int y)
Adds a VisualGraphObject to this document. |
void |
attributesChanged(AttributableOnSetEvent attributableOnSetEvent)
Invoked when an attribute in an AttributableOnSet object
has changed. |
void |
closeHandler()
This method is a callback that is invoked before the document is closed. |
void |
deselect()
Method deselect delesects all currently selected elements of this document. |
java.util.Map |
getElementsMap()
This method should create map, where either primitives of the document are mapped towards their enclosing composites, or container elements are mapped to a list composite-primitive tuple. |
int |
getFlags()
Returns flags describing the nature of the document. |
GraphPanel |
getGraphPanel()
Returns the graphpanel inside this graphdocument. |
java.util.List |
getSelection()
Method getSelection returns a list with all currently selected elements. |
AttributableOnSet |
getTemplateAttributable()
Method getTemplateAttributable returns an AttributableOnSet
describing all the properties of this document. |
void |
init(TemplateAttributableOnSet attributable)
Method init adds a MouseListener to the internal JComponent instance to keep track about the current position (Required for the polygon editing). |
boolean |
isInPointMode()
Should return true, when the user activates the point mode, otherwise false. |
boolean |
isShowGrid()
Method isShowGrid returns true, if a grid is shown, otherwise false. |
boolean |
isSnapToGrid()
Method isSnapToGrid returns true, if the all elements within the document should snap to the nearest grid point or not. |
void |
removeAllPrimitives()
Method removeAllPrimitives removes all Primitives from this document. |
void |
removePrimitive(Primitive primitive)
Method removePrimitive removes a specific primitive from this document. |
void |
repaint()
Method repaint triggers a repaint of the document. |
void |
selectAll()
Method selectAll selects all Elements of this document. |
void |
setName(java.lang.String name)
Sets the name of this container. |
void |
setPopupMenuSource(JPopupMenuSourceWithUpdateUI popup)
Allows users of this class to set an SwingPopupMenu for this document instance. |
void |
setShowGrid(boolean b)
Method setShowGrid toggles whether a grid is shown or not. |
void |
setSnapToGrid(boolean b)
Method setSnapToGrid toggles the snap-to-grid mode. |
void |
togglePointMode()
Method togglePolygonMode toggles the edit-polygon mode. |
| Methods inherited from class com.tensegrity.gui.swing.document.SwingGraphDocument |
getJComponent, getPageFormat, getViewBuilderFilter, getViewSerializerFilter, registerViewBuilderFilter, registerViewSerializerFilter, setDocumentSetting, setModified, setPageFormat, setUnmodified, setVisualGraphView, update |
| 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, getName, isModified, setDocumentSettings, setFile, 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, isModified, setDocumentSetting, setDocumentSettings, setFile, setModified, setUnmodified |
| Methods inherited from interface com.tensegrity.generic.util.Observer |
update |
| Methods inherited from interface com.tensegrity.gui.container.Container |
getApplicationFrame, getName, setSelected |
| Constructor Detail |
public SwingTemplateDocument(java.lang.String name,
GraphApplication graphapplication,
GraphController graphcontroller,
VisualGraphView visualgraphview,
DragContext vgoDragSource)
SwingTemplateDocument based on the given
name. All other parameters are directly passed to the super class.
name - the name of the document.graphapplication - the enclosing GraphApplication.graphcontroller - the GraphController.visualgraphview - the wrapped VisualGraphViewvgoDragSource - a DragContext instance.| Method Detail |
public void init(TemplateAttributableOnSet attributable)
init in interface TemplateDocumentattributable - the TemplateAttributableOnSet containing
the document related information.public void closeHandler()
Document
closeHandler in interface DocumentcloseHandler in class SwingGraphDocument
public void addVisualGraphObject(VisualGraphObject vgo,
int x,
int y)
TemplateDocument
addVisualGraphObject in interface TemplateDocumentvgo - object to add.x - x positiony - y positionpublic void addNodeForPrimitive(Primitive primitive)
TemplateDocument
addNodeForPrimitive in interface TemplateDocumentprimitive - the new primitive to add.
public void addNodeForPrimitive(BaseComposite bcomposite,
Primitive primitive)
TemplateDocument
addNodeForPrimitive in interface TemplateDocumentbcomposite - the composite to use to obtain sizes and positions.primitive - the primitive to add.public void deselect()
TemplateDocument
deselect in interface TemplateDocument
public void addElements(BaseComposite baseComposite,
java.util.Map elementsMap)
baseComposite - The composite to analyze.elementsMap - the Map to add the elements to.public java.util.Map getElementsMap()
TemplateDocument
getElementsMap in interface TemplateDocumentPrimitive's are mapped to their
enclosing Composite's.public java.util.List getSelection()
TemplateDocument
getSelection in interface TemplateDocumentpublic AttributableOnSet getTemplateAttributable()
TemplateDocumentAttributableOnSet
describing all the properties of this document. This
AttributableOnSet should structured in Categories which
contain the category specific attributes.
getTemplateAttributable in interface TemplateDocumentAttributeTablepublic boolean isShowGrid()
TemplateDocument
isShowGrid in interface TemplateDocumentpublic boolean isSnapToGrid()
TemplateDocument
isSnapToGrid in interface TemplateDocumentpublic void removeAllPrimitives()
TemplateDocument
removeAllPrimitives in interface TemplateDocumentpublic void removePrimitive(Primitive primitive)
TemplateDocument
removePrimitive in interface TemplateDocumentprimitive - the instance of Primitive to remove.public void repaint()
TemplateDocument
repaint in interface TemplateDocumentpublic void setPopupMenuSource(JPopupMenuSourceWithUpdateUI popup)
TemplateDocument
setPopupMenuSource in interface TemplateDocumentpopup - the new SwingPopupMenu for this document.public void selectAll()
TemplateDocument
selectAll in interface TemplateDocumentpublic void setName(java.lang.String name)
Container
setName in interface ContainersetName in class AbstractDocumentname - the document's name.public void setShowGrid(boolean b)
TemplateDocument
setShowGrid in interface TemplateDocumentb - if true, a grid is shown, otherwise false.public void setSnapToGrid(boolean b)
TemplateDocument
setSnapToGrid in interface TemplateDocumentb - if true, all objects are snapping to a grid when added or moved.public void togglePointMode()
TemplateDocument
togglePointMode in interface TemplateDocumentpublic boolean isInPointMode()
TemplateDocument
isInPointMode in interface TemplateDocumenttrue if the point mode is active on this document.public GraphPanel getGraphPanel()
TemplateDocument
getGraphPanel in interface TemplateDocumentgetGraphPanel in class SwingGraphDocumentpublic void attributesChanged(AttributableOnSetEvent attributableOnSetEvent)
AttributableOnSetListenerAttributableOnSet object
has changed.
attributesChanged in interface AttributableOnSetListenerattributableOnSetEvent - the event carrying information.public int getFlags()
Document
getFlags in interface DocumentgetFlags in class AbstractDocument
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||