|
||||||||||
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 net.sf.magicproject.clickable.targetable.card.AbstractCard net.sf.magicproject.clickable.targetable.card.TriggeredCard
public class TriggeredCard
Nested 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 | |
---|---|
long |
abilityID
Is the ability making this triggered ability to be created. |
static int |
cardHeight
Height of original card to display |
static int |
cardWidth
Width of original card to display |
static java.awt.Color |
STACKABLE_COLOR
The color used to color the stackable component |
Ability |
triggeredAbility
Triggered ability |
Fields inherited from class net.sf.magicproject.clickable.targetable.card.AbstractCard |
---|
controller, reversed, visibility |
Fields inherited from class net.sf.magicproject.clickable.targetable.Targetable |
---|
cachedAbilities, controllerModifier, indirections, registerModifiers, registers |
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 | |
---|---|
TriggeredCard(Ability triggeredAbility,
ContextEventListener context,
long abilityID)
|
Method Summary | |
---|---|
void |
abortion(AbstractCard card,
Ability source)
Remove the specified card from the stack. |
void |
addTimestampReference()
Add a reference to this targetable. |
void |
checkAllCardsOf(Test test,
java.util.List<Targetable> list,
Ability ability)
Checks all cards corresponding to this constraints |
static void |
clickOn(java.io.InputStream input)
This method is invoked when opponent has clicked on this object. this call should be done from the net.sf.magicproject.network listener |
int |
countAllCardsOf(Test test,
Ability ability,
boolean canBePreempted)
Checks all cards corresponding to the specified constraints |
void |
decrementTimestampReference(int timestamp)
Decrement the reference counter for the current timestamp of this card. |
ContextEventListener |
getAbilityContext()
Return the current context. |
Ability |
getAbortingAbility()
Return the ability causing the abortion of this ability. |
ActionManager |
getActionManager()
Return the action manager of this context. |
DelayedCard |
getDelayedCard()
Return the delayed card attached to this ability. |
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. |
MCard |
getSourceCard()
Return the card source of the current capcity/spell in the stack |
TargetedList |
getTargetedList()
Return the target option of the current spell. this target option is owned by the current spell. |
int |
getTimestamp()
Return the timstamp value of this targetable. |
java.lang.String |
getTooltipString()
Return HTML tooltip string of this card. |
static TriggeredCard |
getTriggeredCard(java.io.InputStream input)
Return the component from information read throw net.sf.magicproject.network |
int |
getValue(int index)
Return the value corresponding to the true register index. |
void |
highlightStackable()
The border will be highligthed to a color identifying it easily as a token component. |
java.awt.Image |
image()
Return the card's picture |
boolean |
isAbility()
Is this targetable is an abilty or a spell |
boolean |
isACopy()
Indicates if the current card in the stack is a copy or not |
boolean |
isSpell()
Is this targetable is an abilty or a spell |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
is called when mouse is on this card, will disp a preview |
void |
moveCard(int newIdPlace,
Player newController,
boolean newIsTapped,
int idPosition)
Move this card to a new place tapped or not under the control of a player |
boolean |
newSpell()
Play this card as a spell. |
void |
paint(java.awt.Graphics g)
|
void |
removeModifier(RegisterIndirection indirection,
int index)
Remove a register-indirection modifier from this component. |
void |
removeModifier(RegisterModifier modifier,
int index)
Remove a register modifier from this component. |
void |
sendClickToOpponent()
send to opponent the message indicating that we've clicked on this component |
java.lang.String |
toString()
return the card's name |
Methods inherited from class net.sf.magicproject.clickable.targetable.card.AbstractCard |
---|
getCardName, getController, getDatabase, getMUI, getPreviewImage, isCard, mouseExited, needReverse, notifyChange, reverse, reverseAsNeeded, scaledImage |
Methods inherited from class net.sf.magicproject.clickable.targetable.Targetable |
---|
actionPerformed, addModifier, addModifier, addPrivateNamedObject, clearDamages, clearPrivateNamedObject, getCreator, getId, getPrivateNamedObject, getPrivateNamedObjects, getValueIndirection, isPlayer, removePrivateNamedObject, setCreator, targetize, targetize, tokenize |
Methods inherited from class net.sf.magicproject.clickable.Clickable |
---|
disHighLight, disHighlight, highLight, mousePressed, mouseReleased |
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, 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 |
Methods inherited from interface java.awt.event.MouseListener |
---|
mouseExited, mousePressed, mouseReleased |
Field Detail |
---|
public Ability triggeredAbility
public long abilityID
public static int cardHeight
public static int cardWidth
public static final java.awt.Color STACKABLE_COLOR
Constructor Detail |
---|
public TriggeredCard(Ability triggeredAbility, ContextEventListener context, long abilityID)
triggeredAbility
- the triggered ability associated to this cardcontext
- the context of the associated triggered abilityabilityID
- is the ability's Id making this triggered ability to be created.Method Detail |
---|
public TargetedList getTargetedList()
getTargetedList
in interface StackContext
public ContextEventListener getAbilityContext()
getAbilityContext
in interface StackContext
public ActionManager getActionManager()
getActionManager
in interface StackContext
public MCard getSourceCard()
getSourceCard
in interface StackContext
public boolean newSpell()
public boolean isACopy()
AbstractCard
isACopy
in class AbstractCard
public int countAllCardsOf(Test test, Ability ability, boolean canBePreempted)
AbstractCard
countAllCardsOf
in class AbstractCard
test
- applied to count valid cardsability
- is the ability owning this test. The card component of this
ability should correspond to the card owning this test too.canBePreempted
- true
if the valid targets can be derterminated
before runtime.
public void checkAllCardsOf(Test test, java.util.List<Targetable> list, Ability ability)
AbstractCard
checkAllCardsOf
in class AbstractCard
test
- applied to count valid cardslist
- the list containing the founded cardsability
- is the ability owning this test. The card component of this
ability should correspond to the card owning this test too.public final boolean isAbility()
Targetable
isAbility
in class Targetable
public final boolean isSpell()
Targetable
isSpell
in class Targetable
public void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
public java.awt.Image image()
AbstractCard
image
in class AbstractCard
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class Clickable
public void sendClickToOpponent()
Clickable
sendClickToOpponent
in class Clickable
public static void clickOn(java.io.InputStream input) throws java.io.IOException
input
- input stream of our net.sf.magicproject.network connection
java.io.IOException
- if error occurred when reading the messagepublic static TriggeredCard getTriggeredCard(java.io.InputStream input) throws java.io.IOException
input
- input stream of our net.sf.magicproject.network connection
java.io.IOException
- if error occurred when reading the messagepublic void moveCard(int newIdPlace, Player newController, boolean newIsTapped, int idPosition)
AbstractCard
moveCard
in class AbstractCard
newIdPlace
- the new place for this cardnewController
- new controler of this card. If null, the controler is the owner.newIsTapped
- dertermines if this card will come tapped or notidPosition
- from IdPositionspublic java.lang.String getTooltipString()
AbstractCard
getTooltipString
in class AbstractCard
public final void mouseEntered(java.awt.event.MouseEvent e)
AbstractCard
mouseEntered
in interface java.awt.event.MouseListener
mouseEntered
in class AbstractCard
e
- is the mouse eventpublic java.lang.String toString()
AbstractCard
toString
in class AbstractCard
public int getValue(int index)
Targetable
getValue
in class Targetable
index
- the register index
public void removeModifier(RegisterModifier modifier, int index)
Targetable
removeModifier
in class Targetable
modifier
- the register modifier to remove.index
- index of register to remove.public void removeModifier(RegisterIndirection indirection, int index)
Targetable
removeModifier
in class Targetable
indirection
- the register-indirection modifier to remove.index
- index of register indirection to remove.public void highlightStackable()
STACKABLE_COLOR
public Targetable getLastKnownTargetable(int timeStamp)
Targetable
getLastKnownTargetable
in class Targetable
timeStamp
- the timestamp number.
public Targetable getOriginalTargetable()
Targetable
getOriginalTargetable
in class Targetable
public void addTimestampReference()
Targetable
addTimestampReference
in class Targetable
public int getTimestamp()
Targetable
getTimestamp
in class Targetable
public void decrementTimestampReference(int timestamp)
Targetable
decrementTimestampReference
in class Targetable
timestamp
- is the reference to decrement.public void abortion(AbstractCard card, Ability source)
StackContext
abortion
in interface StackContext
card
- the card to make abort.source
- the ability source.public Ability getAbortingAbility()
StackContext
getAbortingAbility
in interface StackContext
public DelayedCard getDelayedCard()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |