|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent net.sf.magicproject.clickable.Clickable net.sf.magicproject.clickable.targetable.Targetable
public abstract class Targetable
Represents a target : player or card.
Card
,
Player
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Field Summary | |
---|---|
java.util.List<Ability> |
cachedAbilities
The cached abilities of this component. |
ControllerModifier |
controllerModifier
The ControllerModifier on this object |
RegisterIndirection[] |
indirections
The registerModifiers on this object |
RegisterModifier[] |
registerModifiers
The registerModifiers on this object |
int[] |
registers
Current regiters of this targetable |
Fields inherited from class net.sf.magicproject.clickable.Clickable |
---|
highLightColor, isHighLighted |
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
Targetable()
Creates a new instance of MTargetable |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
An ActionListener that listens to the ability choice |
void |
addModifier(RegisterIndirection modifier,
int index)
Add a modifier to this object |
void |
addModifier(RegisterModifier modifier,
int index)
Add a modifier to this object |
void |
addPrivateNamedObject(java.lang.String objectName,
Targetable targetable)
Add an object to this targetable. |
abstract void |
addTimestampReference()
Add a reference to this targetable. |
void |
clearDamages()
remove all damages on this card |
void |
clearPrivateNamedObject()
Remove all stored objects. |
abstract void |
decrementTimestampReference(int timestamp)
Decrement the reference counter for the current timestamp of this card. |
MCard |
getCreator()
Return the creator of this targetable component. |
int |
getId()
Return the id of this component. |
abstract Targetable |
getLastKnownTargetable(int timeStamp)
Return this targetable as it was at the given timestamp. |
Targetable |
getOriginalTargetable()
Return the original targetable without looking for the timestamp number. |
Targetable |
getPrivateNamedObject(java.lang.String objectName)
Return the named object. |
java.util.Map<java.lang.String,Targetable> |
getPrivateNamedObjects()
Return a cloned instance of map of objects of this targetable. |
abstract int |
getTimestamp()
Return the timstamp value of this targetable. |
abstract int |
getValue(int index)
Return the value corresponding to the true register index. |
int |
getValueIndirection(int index)
Return the value corresponding to the true register index. |
abstract boolean |
isAbility()
Is this targetable is an abilty or a spell |
abstract boolean |
isCard()
indicates if this target is a card |
boolean |
isPlayer()
return true if this targetable is a player |
abstract boolean |
isSpell()
Is this targetable is an abilty or a spell |
abstract void |
removeModifier(RegisterIndirection indirection,
int index)
Remove a register-indirection modifier from this component. |
abstract void |
removeModifier(RegisterModifier modifier,
int index)
Remove a register modifier from this component. |
void |
removePrivateNamedObject(java.lang.String objectName)
Remove the named object. |
void |
setCreator(MCard creator)
Set the creator of this targetable component. |
void |
targetize(boolean... highlightedZones)
The border will be highligthed to a color identifying it easily as a targetable component. |
static void |
targetize(java.util.List<Targetable> list,
boolean[] highlightedZones)
Highlight as "targetable" the list of targetable |
void |
tokenize()
The border will be highligthed to a color identifying it easily as a token component. |
abstract java.lang.String |
toString()
|
Methods inherited from class net.sf.magicproject.clickable.Clickable |
---|
disHighLight, disHighlight, highLight, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, sendClickToOpponent |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int[] registers
public RegisterModifier[] registerModifiers
public ControllerModifier controllerModifier
public RegisterIndirection[] indirections
public java.util.List<Ability> cachedAbilities
Constructor Detail |
---|
public Targetable()
Method Detail |
---|
public void clearDamages()
public abstract java.lang.String toString()
toString
in class java.awt.Component
public final boolean isPlayer()
public abstract boolean isCard()
public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
evt
- the eventpublic final void tokenize()
public void targetize(boolean... highlightedZones)
highlightedZones
- the set of highlighted zone.public static void targetize(java.util.List<Targetable> list, boolean[] highlightedZones)
list
- the list of targetable to highlight.highlightedZones
- the list of highlighted zonespublic abstract int getValue(int index)
index
- the register index
public int getValueIndirection(int index)
index
- the register index
public void addModifier(RegisterModifier modifier, int index)
modifier
- the modifier to add to this objectindex
- is the modifier register indexpublic void addModifier(RegisterIndirection modifier, int index)
modifier
- the indirection modifier to add to this objectindex
- is the modifier register indexpublic abstract boolean isAbility()
public abstract boolean isSpell()
public abstract void removeModifier(RegisterModifier modifier, int index)
modifier
- the register modifier to remove.index
- index of register to remove.public abstract void removeModifier(RegisterIndirection indirection, int index)
indirection
- the register-indirection modifier to remove.index
- index of register indirection to remove.public abstract Targetable getLastKnownTargetable(int timeStamp)
timeStamp
- the timestamp number.
public Targetable getOriginalTargetable()
public Targetable getPrivateNamedObject(java.lang.String objectName)
null
value is returned.
objectName
- the searched object's name
public MCard getCreator()
public void setCreator(MCard creator)
creator
- the card creating this card. May be null.public void removePrivateNamedObject(java.lang.String objectName)
objectName
- the searched object's namepublic void addPrivateNamedObject(java.lang.String objectName, Targetable targetable)
objectName
- the object's name to save.targetable
- the targetable to save.public void clearPrivateNamedObject()
public java.util.Map<java.lang.String,Targetable> getPrivateNamedObjects()
public int getId()
public abstract int getTimestamp()
public abstract void addTimestampReference()
public abstract void decrementTimestampReference(int timestamp)
timestamp
- is the reference to decrement.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |