com.tensegrity.skeleton.commands
Class AbstractInsertElementCommand

java.lang.Object
  extended bycom.tensegrity.generic.command.BaseCommand
      extended bycom.tensegrity.skeleton.commands.CommonBaseCommand
          extended bycom.tensegrity.skeleton.commands.DocumentCommand
              extended bycom.tensegrity.skeleton.commands.GraphDocumentCommand
                  extended bycom.tensegrity.skeleton.commands.AbstractInsertElementCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
InsertChartCommand, InsertImageCommand, InsertTableCommand, SwtInsertImageCommand

public abstract class AbstractInsertElementCommand
extends GraphDocumentCommand

This is the abstract Command base class used for inserting new visual elements to a VisualGraph that have been created programmatically.

Version:
$Id: AbstractInsertElementCommand.java,v 1.8 2005/04/13 14:02:50 KevinCVS Exp $
Author:
BurkhardWick

Field Summary
protected static java.lang.String ELEMENTNAME_CHART_NODE
          Name of the chart node element in the pool to use for insertion
protected static java.lang.String ELEMENTNAME_IMAGE
          Name of the image node element in the pool to use for creating image nodes
protected static java.lang.String ELEMENTNAME_TABLE_NODE
          Name of the table node element in the pool to use for insertion
 
Constructor Summary
AbstractInsertElementCommand(ApplicationFrame applicationFrame, java.lang.String command)
          Constructor.
 
Method Summary
protected  void addElement(VisualNode vNode, int width, int height)
          Adds the given visual node to the graph at the upper left corner of the viewport.
protected  void addElement(VisualNode vNode, int x, int y, int width, int height)
          Adds the given visual node to the graph.
protected  void toLog(double[] widthHeight)
          Converts a pixel size to logical units.
 
Methods inherited from class com.tensegrity.skeleton.commands.GraphDocumentCommand
getGraphDocument, getVisualGraphView, isEnabled
 
Methods inherited from class com.tensegrity.skeleton.commands.DocumentCommand
getDocument, getGraphApplication, newGraphDocumentFromFactory
 
Methods inherited from class com.tensegrity.skeleton.commands.CommonBaseCommand
getApplicationFrame, getTitle, perform
 
Methods inherited from class com.tensegrity.generic.command.BaseCommand
getDescription, getId, getPerformDescription, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENTNAME_IMAGE

protected static final java.lang.String ELEMENTNAME_IMAGE
Name of the image node element in the pool to use for creating image nodes

See Also:
Constant Field Values

ELEMENTNAME_CHART_NODE

protected static final java.lang.String ELEMENTNAME_CHART_NODE
Name of the chart node element in the pool to use for insertion

See Also:
Constant Field Values

ELEMENTNAME_TABLE_NODE

protected static final java.lang.String ELEMENTNAME_TABLE_NODE
Name of the table node element in the pool to use for insertion

See Also:
Constant Field Values
Constructor Detail

AbstractInsertElementCommand

public AbstractInsertElementCommand(ApplicationFrame applicationFrame,
                                    java.lang.String command)
Constructor.

Parameters:
applicationFrame - The application frame
command - The id to use for registering in the command registry
Method Detail

addElement

protected void addElement(VisualNode vNode,
                          int width,
                          int height)
                   throws java.lang.Exception
Adds the given visual node to the graph at the upper left corner of the viewport.

Parameters:
vNode - The visual node to add
width - The width of the node (will be set using the layout method of the node)
height - The width of the node (will be set using the layout method of the node)
Throws:
java.lang.Exception - Throws graph model exceptions from the framework

addElement

protected void addElement(VisualNode vNode,
                          int x,
                          int y,
                          int width,
                          int height)
                   throws java.lang.Exception
Adds the given visual node to the graph.

Parameters:
vNode - The visual node to add
x - The horizontal position for the node in units of the coordinate system of the view and relative to the position of the viewport
y - The vertical position for the node in units of the coordinate system of the view and relative to the position of the viewport
width - The width of the node (will be set using the layout method of the node)
height - The width of the node (will be set using the layout method of the node)
Throws:
java.lang.Exception - Throws graph model exceptions from the framework

toLog

protected void toLog(double[] widthHeight)
Converts a pixel size to logical units. The values of the given array are changed directly.

Parameters:
widthHeight - A double array with the length of 2 0: width 1: height


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