wyvern.lib.commands
Class MouseCommandEvent
java.lang.Object
wyvern.kernel.properties.PList
wyvern.kernel.commands.EventImpl
wyvern.lib.commands.MouseCommandEvent
- All Implemented Interfaces:
- Broadcaster, CommandEvent, PropertyList
- public class MouseCommandEvent
- extends EventImpl
Class encapsulating a game mouse event. Currently only
single-clicks are supported.
- Version:
- 1.0, Nov 06, 1997
- Author:
- Steve Yegge
Field Summary |
protected Point |
mapCoords_
|
protected int |
modifiers_
These modifiers are passed in from the awt MouseEvent. |
protected int |
x_
|
protected int |
y_
|
Fields inherited from class wyvern.kernel.commands.EventImpl |
agent_, appendToFile_, argString_, argStringParsed_, argv_, argvParsed_, delay_, failureMessage_, filterObjects_, filters_, handler_, map_, modified_, originalText_, playerOriginated_, redirectFile_, redirecting_, sendToAgent_, successMessage_, verb_, vetoed_, wizParsed_ |
Method Summary |
void |
consume()
Consumes the event, so no other MouseInterest objects
will receive it. |
java.lang.String |
getButton()
Returns "left", "right" or "middle". |
Point |
getMapCoords()
Returns the Point (in absolute map coordinates) where the
agent clicked the mouse. |
int |
getModifiers()
|
int |
getX()
Returns the X-coord relative to the agent's viewport
where the mouse was clicked. |
int |
getY()
Returns the Y-coord relative to the agent's viewport
where the mouse was clicked. |
boolean |
isConsumed()
Returns true if the event has been consumed. |
void |
setMapCoords(Point coords)
Sets the point (in the map) where the agent clicked. |
void |
setModifiers(int mods)
|
void |
setX(int x)
Sets the X-coordinate relative to the agent's viewport. |
void |
setY(int y)
Sets the Y-coordinate relative to the agent's viewport. |
Methods inherited from class wyvern.kernel.commands.EventImpl |
broadcast, broadcast, broadcast, broadcast, broadcast, checkVeto, fail, filterMessage, findAllMatches, findByHashcode, findInMap, findNeighbor, findObject, findTarget, getAgent, getArgs, getArgString, getDelay, getFailureMessage, getFilterObjects, getFilters, getHandler, getMap, getOriginalText, getRedirectFile, getSuccessMessage, getVerb, hasArgs, isAppending, isModified, isMonster, isPlayer, isPlayerOriginated, isRedirecting, isSendingToAgent, isVetoed, isWizard, main, message, message, noArgs, parseArgString, parseARGV, parseVerb, profileParsing, redirectMessage, runPostHooks, runPreHooks, searchInv, searchInvAndMapNearby, searchInvAndMapUnder, searchInvByHashcode, searchMapNearby, searchMapUnder, searchMapUnderByHashcode, setAgent, setArgs, setDelay, setFailureMessage, setHandler, setMap, setModified, setOriginalText, setPlayerOriginated, setSuccessMessage, setVerb, setVeto, toString, veto |
Methods inherited from class wyvern.kernel.properties.PList |
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, debugProperties, dismantlePropertyList, getDoubleProperty, getInheritedProperty, getInteger, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProfilingInfo, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface wyvern.lib.PropertyList |
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, getDoubleProperty, getInheritedProperty, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty |
x_
protected int x_
y_
protected int y_
modifiers_
protected int modifiers_
- These modifiers are passed in from the awt MouseEvent.
mapCoords_
protected Point mapCoords_
MouseCommandEvent
public MouseCommandEvent(java.lang.String originalText,
Commandable agent)
- Constructs a new MouseCommandEvent
consume
public void consume()
- Consumes the event, so no other MouseInterest objects
will receive it.
isConsumed
public boolean isConsumed()
- Returns true if the event has been consumed.
getMapCoords
public Point getMapCoords()
- Returns the Point (in absolute map coordinates) where the
agent clicked the mouse.
setMapCoords
public void setMapCoords(Point coords)
- Sets the point (in the map) where the agent clicked.
setX
public void setX(int x)
- Sets the X-coordinate relative to the agent's viewport.
getX
public int getX()
- Returns the X-coord relative to the agent's viewport
where the mouse was clicked.
setY
public void setY(int y)
- Sets the Y-coordinate relative to the agent's viewport.
getY
public int getY()
- Returns the Y-coord relative to the agent's viewport
where the mouse was clicked.
setModifiers
public void setModifiers(int mods)
getModifiers
public int getModifiers()
getButton
public java.lang.String getButton()
- Returns "left", "right" or "middle".