|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
net.sf.colossus.gui.Chit
class Chit
Class Chit implements the GUI for a Titan chit representing either a character or a legion. TODO offer constructors using the Legion instead of strings TODO consider splitting into LegionChit and CreatureChit TODO Important: All creature (and marker) related Chits should get an option argument in order to be able to ask for options like "marker in players original color or now-owning-player's-color and "angel in traditionl blue or in actual players color".
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private boolean |
border
Flag to paint a border around the chit. |
private java.awt.Color |
borderColor
|
private java.awt.Image |
bufferedImage
|
private java.awt.Image |
bufferedInvertedImage
|
(package private) Client |
client
|
private boolean |
dead
Flag to mark chit as dead and paint it with an "X" through it. |
private java.lang.String |
id
|
protected boolean |
inverted
Flag to paint the chit upside-down. |
private static java.util.logging.Logger |
LOGGER
|
(package private) static java.awt.BasicStroke |
oneWide
|
(package private) IOptions |
options
|
private boolean |
playerColoredAngel
|
(package private) java.awt.Rectangle |
rect
|
private static java.awt.BasicStroke |
threeWide
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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 | |
---|---|
(package private) |
Chit(int scale,
CreatureType creatureType)
|
(package private) |
Chit(int scale,
java.lang.String id)
P l a i n C o n s t r u c t o r s |
(package private) |
Chit(int scale,
java.lang.String id,
boolean inverted,
boolean dubious)
|
(package private) |
Chit(int scale,
java.lang.String id,
boolean inverted,
boolean dubious,
boolean dubiousAsBlank,
Client client)
|
private |
Chit(int scale,
java.lang.String idPerhapsWithColor,
boolean inverted,
boolean dubious,
boolean dubiousAsBlank,
java.lang.String[] overlays,
Client client,
IOptions options)
|
(package private) |
Chit(int scale,
java.lang.String id,
boolean inverted,
Client client)
|
(package private) |
Chit(int scale,
java.lang.String id,
java.lang.String[] overlays)
|
Method Summary | |
---|---|
java.awt.Rectangle |
getBounds()
|
java.awt.Point |
getCenter()
|
java.lang.String |
getId()
|
private static java.awt.Image |
getImage(java.lang.String[] imageFilenames,
int scale)
|
private static java.awt.Image |
getImage(java.lang.String imageFilename,
int scale)
|
java.awt.Dimension |
getMaximumSize()
|
java.awt.Dimension |
getMinimumSize()
|
java.awt.Dimension |
getPreferredSize()
|
int |
getTitanPower()
|
(package private) boolean |
isDead()
|
static boolean |
isMarkerId(java.lang.String id)
|
static Chit |
newCreatureChit(int scale,
CreatureType type)
Factory method for creatures, based on CreatureType |
static Chit |
newCreatureChit(int scale,
java.lang.String id)
Factory method for creatures, based on image names TODO try to get rid of the string bases Creature chits |
static Chit |
newDiceChit(int scale,
java.lang.String markerId)
|
static Chit |
newSymbolChit(int scale,
java.lang.String id)
Factory method for icons representing e.g. |
void |
paintComponent(java.awt.Graphics g)
|
(package private) void |
rescale(int scale)
|
(package private) void |
setBorder(boolean border)
|
(package private) void |
setBorderColor(java.awt.Color borderColor)
|
(package private) void |
setDead(boolean dead)
|
void |
setLocation(java.awt.Point point)
|
(package private) void |
toggleDead()
|
java.lang.String |
toString()
|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, 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, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final java.util.logging.Logger LOGGER
private final java.awt.Image bufferedImage
private java.awt.Image bufferedInvertedImage
java.awt.Rectangle rect
final Client client
final IOptions options
private boolean dead
private boolean border
private java.awt.Color borderColor
private final boolean playerColoredAngel
protected final boolean inverted
private final java.lang.String id
static final java.awt.BasicStroke oneWide
private static final java.awt.BasicStroke threeWide
Constructor Detail |
---|
Chit(int scale, java.lang.String id)
Chit(int scale, CreatureType creatureType)
Chit(int scale, java.lang.String id, java.lang.String[] overlays)
Chit(int scale, java.lang.String id, boolean inverted, Client client)
Chit(int scale, java.lang.String id, boolean inverted, boolean dubious)
Chit(int scale, java.lang.String id, boolean inverted, boolean dubious, boolean dubiousAsBlank, Client client)
private Chit(int scale, java.lang.String idPerhapsWithColor, boolean inverted, boolean dubious, boolean dubiousAsBlank, java.lang.String[] overlays, Client client, IOptions options)
idPerhapsWithColor
- CreatureType id, markerId, or filename of
some picture denoting some symbol (for HazardEffects).
For Markers, Titans and Angels could be of form options
- TODOMethod Detail |
---|
public static Chit newCreatureChit(int scale, java.lang.String id)
scale
- id
-
public static Chit newCreatureChit(int scale, CreatureType type)
scale
- type
-
public static Chit newDiceChit(int scale, java.lang.String markerId)
public static Chit newSymbolChit(int scale, java.lang.String id)
scale
- id
-
public static boolean isMarkerId(java.lang.String id)
public int getTitanPower()
private static java.awt.Image getImage(java.lang.String imageFilename, int scale)
private static java.awt.Image getImage(java.lang.String[] imageFilenames, int scale)
public java.lang.String getId()
public java.lang.String toString()
toString
in class java.awt.Component
void rescale(int scale)
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public void setLocation(java.awt.Point point)
setLocation
in class java.awt.Component
public java.awt.Rectangle getBounds()
getBounds
in class java.awt.Component
public java.awt.Point getCenter()
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public java.awt.Dimension getMaximumSize()
getMaximumSize
in class javax.swing.JComponent
boolean isDead()
void setDead(boolean dead)
void toggleDead()
void setBorder(boolean border)
void setBorderColor(java.awt.Color borderColor)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |