|
||||||||||
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 javax.swing.JPanel net.sf.magicproject.zone.MZone
public abstract class MZone
A zone is a cards container.
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 | |
---|---|
MCard |
dragAndDropComponent
The d&d component. |
java.awt.Point |
mousePoint
The d&d starting point |
javax.swing.JScrollPane |
superPanel
the parent scrollpane |
Visibility |
visibility
Indicates all cards of this zone are returned or not. |
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 |
Method Summary | |
---|---|
void |
add(MCard card,
int position)
Add a card to this panel. |
void |
addBottom(MCard card)
Add a card at the bottom of this panel. |
void |
addTop(MCard card)
Add a card at the top of this panel. |
void |
checkAllCardsOf(Test test,
java.util.List<Targetable> list,
Ability ability)
Checks all cards corresponding to this constraints |
int |
countAllCardsOf(Test test,
Ability ability)
Checks all cards corresponding to the specified constraints including attached cards. |
int |
countAllCardsOf(Test test,
Ability ability,
int limit,
boolean canBePreempted)
Checks all cards corresponding to the specified constraints including attached cards. |
void |
disHighLight()
Dishighlight only this component, not the components of this zone. |
void |
disHighLightAll()
Dishighlight all cards of this zone manager |
MCard |
getBottom()
return the first card (bottom) |
MCard |
getCard(int index)
return the card at index |
int |
getCardCount()
return the number of cards in this panel |
int |
getControllerIdPlayer()
Return idplayer of controller of this zone. |
Pair<java.lang.Integer,java.lang.Integer> |
getRealIndexOf(MCard card)
Return the index of the specified card within this zone |
MCard |
getTop()
return the last card (top) |
int |
getZoneId()
Returnn the zone identifiant |
java.lang.String |
getZoneName()
This function returns the result of Component#getName() This will return the untranslated name of this zone. |
void |
highLight(java.awt.Color color)
Highlight only this component, not the components of this zone. |
boolean |
isMustBePainted(MCard card)
Return true if the given card should be painted entirely. |
boolean |
isMustBePaintedReversed(MCard card)
Return true if the given card should be painted as reversed
card. |
boolean |
isSamePosition(MCard card,
int position)
Indicates wether this card suits to the specified position code. |
boolean |
isShared()
Is this zone is shared with all players. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
is called when you click on me |
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
paintComponent(java.awt.Graphics g)
|
void |
readWallPaperConfiguration(java.io.InputStream inputStream)
Set the new wallpaper for the current game. |
void |
remove(AbstractCard card)
Add a card to this panel. |
void |
removeAll()
|
void |
reset()
Remove all cards of this zone |
void |
setVisibility(Visibility visibility)
Set the visibility of this zone. |
void |
shuffle()
Shuffle the zone |
boolean |
startDragAndDrop(MCard card,
java.awt.Point mousePoint)
Start the drag and drop managment for the given card. |
java.lang.String |
toString()
return the translated name of this zone |
void |
updatePanel()
update this panel in fonction of it's components |
void |
updateReversed()
Update the "reversed" state of this component. |
void |
writeWallPaperConfiguration(java.io.OutputStream out)
Send the wallpaper configuration over the given output stream. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, 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, 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 |
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, 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 Visibility visibility
public final javax.swing.JScrollPane superPanel
public java.awt.Point mousePoint
public MCard dragAndDropComponent
Method Detail |
---|
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public final MCard getCard(int index)
index
- is the index where is the element
public MCard getTop()
public MCard getBottom()
public final boolean isSamePosition(MCard card, int position)
card
- is the card to locate.position
- the matching position code
IdPositions.ON_THE_BOTTOM
,
IdPositions.ON_THE_TOP
public Pair<java.lang.Integer,java.lang.Integer> getRealIndexOf(MCard card)
card
- the card to search
public java.lang.String toString()
toString
in class java.awt.Component
public java.lang.String getZoneName()
toString()
public void readWallPaperConfiguration(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- the input Stream containing the wallpaper configuration.
java.io.IOException
- If some other I/O error occurspublic void writeWallPaperConfiguration(java.io.OutputStream out) throws java.io.IOException
out
- the output Stream containing the wallpaper configuration.
java.io.IOException
- If some other I/O error occurspublic void removeAll()
removeAll
in class java.awt.Container
public void updatePanel()
public void shuffle()
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void updateReversed()
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- is the mouse eventpublic void remove(AbstractCard card)
card
- the card to add to this zone.public int getCardCount()
public int countAllCardsOf(Test test, Ability ability)
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.
public int countAllCardsOf(Test test, Ability ability, int limit, boolean canBePreempted)
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.limit
- is the desired count.canBePreempted
- true
if the valid targets can be derterminated
before runtime.
limit
.public void checkAllCardsOf(Test test, java.util.List<Targetable> list, Ability ability)
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 void disHighLightAll()
public void disHighLight()
public void highLight(java.awt.Color color)
color
- the color of highlight.public void reset()
public void setVisibility(Visibility visibility)
visibility
- the new visibility for this zone.public void addBottom(MCard card)
card
- the card to add to this zone.public void addTop(MCard card)
card
- the card to add to this zone.public void add(MCard card, int position)
card
- the card to add to this zone.position
- the position index of insertion.public int getControllerIdPlayer()
public final int getZoneId()
public boolean startDragAndDrop(MCard card, java.awt.Point mousePoint)
card
- The d&d component.mousePoint
- The d&d starting point.
true
if the drag and drop is managed by this zone.public boolean isMustBePaintedReversed(MCard card)
true
if the given card should be painted as reversed
card.
card
- the card to draw.
true
if the given card should be painted as reversed
card.public boolean isMustBePainted(MCard card)
true
if the given card should be painted entirely.
card
- the card to draw.
true
if the given card should be painted entirely.public boolean isShared()
true
if this zone is shared with all players.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |