Class PositionView
java.lang.Object
java.awt.Component
chesspresso.position.view.PositionView
- All Implemented Interfaces:
PositionListener, MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener
public class PositionView
extends Component
implements PositionListener, MouseListener, MouseMotionListener
Position view.
- Version:
- $Revision: 1.2 $
- Author:
- Bernhard Seybold
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionPositionView(AbstractMutablePosition position) Create a new position view.PositionView(AbstractMutablePosition position, int bottomPlayer) Create a new position view. -
Method Summary
Modifier and TypeMethodDescriptionvoidcastlesChanged(int castles) voidflip()Flip the sides.intvoidgetProperties(Properties properties) voidhalfMoveClockChanged(int halfMoveClock) voidvoidvoidvoidvoidvoidvoidvoidvoidplyNumberChanged(int plyNumber) voidsetBlackColor(Color color) voidsetBlackSquareColor(Color color) voidsetBottomPlayer(int player) voidsetEnPassantColor(Color color) Sets the color to mark the en passant square (if exists).voidvoidsetPieceChars(String pieceChars) voidvoidvoidsetProperties(Properties properties) voidsetWhiteColor(Color color) voidsetWhiteSquareColor(Color color) voidsqiEPChanged(int sqiEP) voidsquareChanged(int sqi, int stone) voidtoPlayChanged(int toPlay) Methods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
-
Constructor Details
-
PositionView
Create a new position view.- Parameters:
position- the position to display
-
PositionView
Create a new position view.- Parameters:
position- the position to displaybottomPlayer- the player at the lower edge
-
-
Method Details
-
setPositionMotionListener
-
getBottomPlayer
public int getBottomPlayer() -
setBottomPlayer
public void setBottomPlayer(int player) -
getWhiteSquareColor
-
getBlackSquareColor
-
getWhiteColor
-
getBlackColor
-
getPieceChars
-
setWhiteSquareColor
-
setBlackSquareColor
-
setWhiteColor
-
setBlackColor
-
setProperties
-
setProperties
-
getProperties
-
setFont
-
setPieceChars
-
flip
public void flip()Flip the sides. -
setEnPassantColor
Sets the color to mark the en passant square (if exists). Set to null to not mark.- Parameters:
color- the color to mark the en passant square
-
getPosition
-
getPreferredSize
- Overrides:
getPreferredSizein classComponent
-
getMinimumSize
- Overrides:
getMinimumSizein classComponent
-
getMaximumSize
- Overrides:
getMaximumSizein classComponent
-
squareChanged
public void squareChanged(int sqi, int stone) - Specified by:
squareChangedin interfacePositionListener
-
toPlayChanged
public void toPlayChanged(int toPlay) - Specified by:
toPlayChangedin interfacePositionListener
-
castlesChanged
public void castlesChanged(int castles) - Specified by:
castlesChangedin interfacePositionListener
-
sqiEPChanged
public void sqiEPChanged(int sqiEP) - Specified by:
sqiEPChangedin interfacePositionListener
-
plyNumberChanged
public void plyNumberChanged(int plyNumber) - Specified by:
plyNumberChangedin interfacePositionListener
-
halfMoveClockChanged
public void halfMoveClockChanged(int halfMoveClock) - Specified by:
halfMoveClockChangedin interfacePositionListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
paint
-