public abstract class EditImageMapBase extends CommandBase
config_prefix.editImageMap
commands.Modifier and Type | Field and Description |
---|---|
protected Element |
imageMapElement |
recordable, repeatable
Modifier | Constructor and Description |
---|---|
protected |
EditImageMapBase() |
Modifier and Type | Method and Description |
---|---|
protected ImageMapEditor |
createImageMapEditor(Component parentComponent,
String title) |
protected com.xmlmind.xmleditapp.cmd.imagemap.LinkTargetChooser |
createLinkTargetChooser(Element imageMapElem) |
CommandResult |
doExecute(DocumentView docView,
String parameter,
int x,
int y)
Actually executes this command with specified parameter and in
specified context.
|
protected abstract boolean |
editImageMap(ImageMap imageMap,
Element imageMapElement) |
protected Attribute |
findLinkAttribute(Element tree,
Name[][] linkNames) |
protected abstract Name[] |
getImageMapNames(Element selected) |
protected abstract Name[][] |
getLinkNames(Element imageMapElement) |
protected static String |
getNonEmptyAttribute(Element element,
Name attrName) |
protected static String |
getNonEmptyText(Element element) |
protected static Image |
loadImage(URL url,
String widthName,
String widthValue,
String heightName,
String heightValue,
String scaleName,
String scaleValue,
String fitName,
String fitValue) |
protected abstract ImageMap |
parseImageMap(Element imageMapElement) |
boolean |
prepare(DocumentView docView,
String parameter,
int x,
int y)
Tests whether this command can be executed with specified parameter
and in specified context.
|
protected static void |
setAttributes(Element element,
PropertySet propertySet) |
protected static void |
setProperties(PropertySet propertySet,
Element element,
Name[] skippedAttributes) |
doExecuteByName, execute, executeCommand, isRecordable, isRepeatable, prepareCommand
protected Element imageMapElement
public boolean prepare(DocumentView docView, String parameter, int x, int y)
CommandBase
If the command can be executed, this method returns
true
after having configured its internal state for
consumption by method CommandBase.execute(com.xmlmind.xmledit.view.DocumentView, java.lang.String, int, int)
which should be invoked
immediately after this one.
Returns false
if this command cannot be executed with
specified parameter and in specified context.
prepare
in class CommandBase
docView
- the target of this commandparameter
- parameterizes the command (that is, modifies the
behavior of the command in a command specific way)x
- X position relative to docView of the mouse event
having triggered this command; -1 if this command was triggered by a
keyboard inputy
- Y position relative to docView of the mouse event
having triggered this command; -1 if this command was triggered by a
keyboard inputpublic CommandResult doExecute(DocumentView docView, String parameter, int x, int y)
CommandBase
This method assumes that CommandBase.prepare(com.xmlmind.xmledit.view.DocumentView, java.lang.String, int, int)
has been
successfully invoked immediately before its own invocation.
IMPORTANT: application code which executes a command
must always use CommandBase.execute(com.xmlmind.xmledit.view.DocumentView, java.lang.String, int, int)
or CommandBase.executeCommand(com.xmlmind.xmledit.gadget.Gadget, java.lang.String, int, int)
to do so,
NOT CommandBase.doExecute(com.xmlmind.xmledit.view.DocumentView, java.lang.String, int, int)
. CommandBase.doExecute(com.xmlmind.xmledit.view.DocumentView, java.lang.String, int, int)
is intended to be used
only by commands which invoke helper "sub-commands".
doExecute
in class CommandBase
docView
- the target of this commandparameter
- parameterizes the command (that is, modifies the
behavior of the command in a command specific way)x
- X position relative to docView of the mouse event
having triggered this command; -1 if this command was triggered by a
keyboard inputy
- Y position relative to docView of the mouse event
having triggered this command; -1 if this command was triggered by a
keyboard inputnull
.
If the command execution is successful and
the command is repeatable and/or recordable then
CommandResult.details
field of the result is expected
to be one of:
null
Object
String
s
protected ImageMapEditor createImageMapEditor(Component parentComponent, String title)
protected com.xmlmind.xmleditapp.cmd.imagemap.LinkTargetChooser createLinkTargetChooser(Element imageMapElem)
protected abstract ImageMap parseImageMap(Element imageMapElement) throws Exception
Exception
protected abstract boolean editImageMap(ImageMap imageMap, Element imageMapElement) throws Exception
Exception
protected static void setProperties(PropertySet propertySet, Element element, Name[] skippedAttributes)
protected static void setAttributes(Element element, PropertySet propertySet)