uk.ac.kcl.cch.jb.pliny.commands
Class AddLOTypeCommand
java.lang.Object
org.eclipse.gef.commands.Command
uk.ac.kcl.cch.jb.pliny.commands.AddLOTypeCommand
- public class AddLOTypeCommand
- extends org.eclipse.gef.commands.Command
Creates a new LOType
.
This is used by the
EditTypeWizard
which first interacts with the user to get data upon which
the LOType should be created.
- Author:
- John Bradley
Constructor Summary |
AddLOTypeCommand(String name,
org.eclipse.swt.graphics.RGB titleFore,
org.eclipse.swt.graphics.RGB titleBack,
org.eclipse.swt.graphics.RGB bodyFore,
org.eclipse.swt.graphics.RGB bodyBack,
int sourceRoleKey,
String sourceRoleName,
int targetRoleKey,
String targetRoleName)
constructs a new LOType . |
Methods inherited from class org.eclipse.gef.commands.Command |
canExecute, canUndo, chain, dispose, getDebugLabel, getLabel, redo, setDebugLabel, setLabel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AddLOTypeCommand
public AddLOTypeCommand(String name,
org.eclipse.swt.graphics.RGB titleFore,
org.eclipse.swt.graphics.RGB titleBack,
org.eclipse.swt.graphics.RGB bodyFore,
org.eclipse.swt.graphics.RGB bodyBack,
int sourceRoleKey,
String sourceRoleName,
int targetRoleKey,
String targetRoleName)
- constructs a new
LOType
.
In all cases colours and a name must be provided. The Role
information however is slightly more complex:
- If the user has pointed to an existing Resource as the
role, give its key as the value for sourceRoleKey or
targetRoleKey.
- If the user has given a name and not a Resource
the system should create a new Resource with the given name.
In this case give the name and give the Key value as 0.
- Parameters:
name
- String name of new LOType.titleFore
- RGB of color for title Foreground.titleBack
- RGB of color for title Background.bodyFore
- RGB of color for body Foreground.bodyBack
- RGB of color for body Background.sourceRoleKey
- int key to Resource to act as source RolesourceRoleName
- String name of Resource to be created to act as source RoletargetRoleKey
- int key to Resource to act as target RoletargetRoleName
- String name of Resource to be created to act as target Role
execute
public void execute()
undo
public void undo()