com.tensegrity.skeleton.swt.commands
Class SwtInsertImageCommand
java.lang.Object
com.tensegrity.generic.command.BaseCommand
com.tensegrity.skeleton.commands.CommonBaseCommand
com.tensegrity.skeleton.commands.DocumentCommand
com.tensegrity.skeleton.commands.GraphDocumentCommand
com.tensegrity.skeleton.commands.AbstractInsertElementCommand
com.tensegrity.skeleton.swt.commands.SwtInsertImageCommand
- All Implemented Interfaces:
- Command
- public class SwtInsertImageCommand
- extends AbstractInsertElementCommand
This command, to be used within applications in a SWT context, is used in order
to insert a VisualNode containing an image on the active
GraphDocument. The inserted image is choosen by the application user
when presented a FileDialog dialog.
- Version:
- $Id: SwtInsertImageCommand.java,v 1.4 2005/08/02 08:18:44 SebastienGuyon Exp $
- Author:
- Arnd Houben
|
Method Summary |
void |
addImage(java.io.File imgFile)
Adds a visual node representing the given image file to
the current graph document at the given coordinates.
|
boolean |
isEnabled()
Overridden to restrict the availability of this command to the case
that the "ImageNode" element is in the pool. |
void |
perform(java.lang.Object args)
Updates the StatusBar with this commands title string.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SwtInsertImageCommand
public SwtInsertImageCommand(ApplicationFrame applicationFrame,
java.lang.String command)
- Creates the
SwtInsertImageCommand which is used in order
to insert a VisualNode containing an image on the active
GraphDocument.
- Parameters:
applicationFrame - Application context of this command.command - the ID of this command.
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)
addImage
public void addImage(java.io.File imgFile)
- Adds a visual node representing the given image file to
the current graph document at the given coordinates.
A raster is created for each file and is pooled in the ImagePool
of the framework, so it's only loaded once.
- Parameters:
imgFile - The image file to load
isEnabled
public boolean isEnabled()
- Overridden to restrict the availability of this command to the case
that the "ImageNode" element is in the pool.
- Specified by:
isEnabled in interface Command- Overrides:
isEnabled in class GraphDocumentCommand
- Returns:
- True, if the command is currently available
Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.