com.tensegrity.skeleton.commands
Class TableCommand

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.EditGraphDocumentCommand
                      extended bycom.tensegrity.skeleton.commands.GraphDocumentSelectionCommand
                          extended bycom.tensegrity.skeleton.commands.TableCommand
All Implemented Interfaces:
Command

public class TableCommand
extends GraphDocumentSelectionCommand

This Command performs some CompositeTable specific actions. At the time of writing, this command is only available in a popup-menu of the GraphDemo-application.

Version:
$Id: TableCommand.java,v 1.13 2005/08/26 11:54:25 BurkhardWick Exp $
Author:
AndreasEbbert

Field Summary
static int COLUMN_ADD_BEFORE
          Constant specifying the add column before selected column command.
static int COLUMN_ADD_BEHIND
          Constant specifying the add column behind selected column command.
static int COLUMN_REMOVE
          Constant specifying the remove column command.
static int LABEL_CREATE
          Constant specifying the label create command.
static int LABEL_EDIT
          Constant specifying the label edit command.
static int LABEL_REMOVE
          Constant specifying the label remove command.
static int ROW_ADD_BEFORE
          Constant specifying the add row before selected column command.
static int ROW_ADD_BEHIND
          Constant specifying the add row behind selected column command.
static int ROW_REMOVE
          Constant specifying the remove row command.
 
Constructor Summary
TableCommand(ApplicationFrame applicationFrame, java.lang.String command)
          Constructor specifying the ApplicationFrame and a unique command string for this Command.
TableCommand(ApplicationFrame applicationFrame, java.lang.String command, int type)
          Constructor specifying the ApplicationFrame and a unique command string for this Command.
 
Method Summary
static CompositeLabel getCompositeLabel(VisualGraphView vgv, CompositeTable table, int x, int y)
          Returns the CompositeLabel located at the (x, y) in the CompositeTable of the given VisualGraphView.
static int[] getGridCoordinates(VisualGraphView vgv, CompositeTable table, int x, int y)
          Returns the corresponding coordinates for the given coordinate-pair in the grid of the CompositeTable.
 boolean isEnabled()
          Checks if there is something selected in the current document.
 void perform(java.lang.Object args)
          Updates the StatusBar with this commands title string.
 
Methods inherited from class com.tensegrity.skeleton.commands.GraphDocumentSelectionCommand
getSelection, hasSelection
 
Methods inherited from class com.tensegrity.skeleton.commands.GraphDocumentCommand
getGraphDocument, getVisualGraphView
 
Methods inherited from class com.tensegrity.skeleton.commands.DocumentCommand
getDocument, getGraphApplication, newGraphDocumentFromFactory
 
Methods inherited from class com.tensegrity.skeleton.commands.CommonBaseCommand
getApplicationFrame, getTitle
 
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

LABEL_CREATE

public static final int LABEL_CREATE
Constant specifying the label create command.

See Also:
Constant Field Values

LABEL_REMOVE

public static final int LABEL_REMOVE
Constant specifying the label remove command.

See Also:
Constant Field Values

LABEL_EDIT

public static final int LABEL_EDIT
Constant specifying the label edit command.

See Also:
Constant Field Values

ROW_ADD_BEHIND

public static final int ROW_ADD_BEHIND
Constant specifying the add row behind selected column command.

See Also:
Constant Field Values

ROW_ADD_BEFORE

public static final int ROW_ADD_BEFORE
Constant specifying the add row before selected column command.

See Also:
Constant Field Values

ROW_REMOVE

public static final int ROW_REMOVE
Constant specifying the remove row command.

See Also:
Constant Field Values

COLUMN_ADD_BEHIND

public static final int COLUMN_ADD_BEHIND
Constant specifying the add column behind selected column command.

See Also:
Constant Field Values

COLUMN_ADD_BEFORE

public static final int COLUMN_ADD_BEFORE
Constant specifying the add column before selected column command.

See Also:
Constant Field Values

COLUMN_REMOVE

public static final int COLUMN_REMOVE
Constant specifying the remove column command.

See Also:
Constant Field Values
Constructor Detail

TableCommand

public TableCommand(ApplicationFrame applicationFrame,
                    java.lang.String command)
Constructor specifying the ApplicationFrame and a unique command string for this Command.

Parameters:
applicationFrame - the ApplicationFrame to use.
command - a unique string for this command.

TableCommand

public TableCommand(ApplicationFrame applicationFrame,
                    java.lang.String command,
                    int type)
Constructor specifying the ApplicationFrame and a unique command string for this Command.

Parameters:
applicationFrame - the ApplicationFrame to use.
command - a unique string for this command.
type - the type, valid values are defined by the int constants of this class.
Method Detail

perform

public final void perform(java.lang.Object args)
Description copied from class: CommonBaseCommand
Updates the StatusBar with this commands title string. (non-Javadoc)

Specified by:
perform in interface Command
Overrides:
perform in class CommonBaseCommand
See Also:
Command.perform(java.lang.Object)

getGridCoordinates

public static final int[] getGridCoordinates(VisualGraphView vgv,
                                             CompositeTable table,
                                             int x,
                                             int y)
Returns the corresponding coordinates for the given coordinate-pair in the grid of the CompositeTable.

Parameters:
vgv - the VisualGraphView.
table - the CompositeTable.
x - the x-coordinate of the popup-menu.
y - the y-coordinate of the popup-menu.
Returns:
the corresponding coordinates for the given coordinate-pair.

getCompositeLabel

public static final CompositeLabel getCompositeLabel(VisualGraphView vgv,
                                                     CompositeTable table,
                                                     int x,
                                                     int y)
Returns the CompositeLabel located at the (x, y) in the CompositeTable of the given VisualGraphView.

Parameters:
vgv - the VisualGraphView to use.
table - the CompositeTable.
x - the x-coordinate of the location.
y - the y-coordinate of the location.
Returns:
the CompositeLabel located at (x, y).

isEnabled

public boolean isEnabled()
Description copied from class: GraphDocumentSelectionCommand
Checks if there is something selected in the current document.

Specified by:
isEnabled in interface Command
Overrides:
isEnabled in class GraphDocumentSelectionCommand
See Also:
EditGraphDocumentCommand.isEnabled()


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