soc.client
Class ColorSquare

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by soc.client.ColorSquare
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible
Direct Known Subclasses:
ColorSquareLarger

public class ColorSquare
extends java.awt.Canvas
implements java.awt.event.MouseListener

This is a square box with a background color and possibly a number, checkmark, or text in it. This box can be interactive, or non-interactive. The possible colors of the box correspond to resources in SoC.

Default size is WIDTH by HEIGHT pixels. Most colorsquares in JSettlers are actually ColorSquareLarger instances. This was easier than changing the values of WIDTH and HEIGHT, which are used for setting the size of many GUI elements.

Author:
Robert S Thomas
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
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
(package private)  boolean boolValue
           
private  java.awt.Color borderColor
          Border color, BLACK by default
static int BOUNDED_DEC
           
static int BOUNDED_INC
           
static int CHECKBOX
           
static java.awt.Color CLAY
          The color constants are used by ColorSquare, and also used for the robber's "ghost" when moving the robber, and fallback for missing hex graphics.
static java.awt.Color DESERT
           
static java.awt.Color FOG
          Fog hex color.
static java.awt.Color GOLD
          Gold hex color.
static java.awt.Color GREY
           
protected  boolean hasWarnHigh
          Low-level or high-level warning level has been set (intValue).
protected  boolean hasWarnLow
          Low-level or high-level warning level has been set (intValue).
static int HEIGHT
           
(package private)  boolean interactive
           
(package private)  int intValue
           
protected  boolean isWarnHigh
          At high-level warning.
protected  boolean isWarnLow
          At low-level warning, or at zero if ttip_text_zero was set.
(package private)  int kind
           
(package private)  int lowerBound
           
static int NUMBER
           
static java.awt.Color ORE
           
static java.awt.Color[] RESOURCE_COLORS
          Array of resource colors.
static java.awt.Color SHEEP
           
protected  ColorSquareListener sqListener
           
protected  int squareH
          Size per instance, for ColorSquareLarger
protected  java.awt.Dimension squareSize
           
protected  int squareW
          Size per instance, for ColorSquareLarger
private static SOCStringManager strings
          i18n text strings
static int TEXT
          Colorsquare type TEXT displays a short message.
private  java.lang.String textValue
           
protected  AWTToolTip ttip
           
protected  java.lang.String ttip_text
          Text for normal vs low-warning-level.
protected  java.lang.String ttip_text_warnHigh
          Optional text for low-warning-level and high-warning-level (intValue).
protected  java.lang.String ttip_text_warnLow
          Optional text for low-warning-level and high-warning-level (intValue).
protected  java.lang.String ttip_text_zero
          Optional text for zero level (intValue).
(package private)  int upperBound
           
(package private)  boolean valueVis
           
protected  boolean warn_bg_grey
          Normal background color is GREY (when not high or low "warning" color).
static java.awt.Color WARN_LEVEL_COLOR
          The warning-level text color (high, low, or zero)
static java.awt.Color WARN_LEVEL_COLOR_BG_FROMGREY
          Background color for warning-level, if grey normally
protected  int warnHighBound
           
protected  int warnLowBound
           
static java.awt.Color WATER
          Water hex color, for fallback if graphic is missing.
static java.awt.Color WHEAT
           
static int WIDTH
           
static java.awt.Color WOOD
           
static int YES_NO
           
 
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, PROPERTIES, SOMEBITS
 
Constructor Summary
ColorSquare()
          Creates a new grey ColorSquare object without a visible value.
ColorSquare(java.awt.Color c)
          Creates a new ColorSquare object with specified background color.
ColorSquare(java.awt.Color c, int v)
          Creates a new ColorSquare object with specified background color and initial value.
ColorSquare(java.awt.Color c, java.lang.String v)
          Creates a new ColorSquare object with specified background color and initial value.
ColorSquare(int k, boolean in, java.awt.Color c)
          Creates a new ColorSquare of the specified kind and background color.
ColorSquare(int k, boolean in, java.awt.Color c, int upper, int lower)
          Creates a new ColorSquare of the specified kind and background color.
 
Method Summary
 void addValue(int v)
          DOCUMENT ME!
 void clearHighWarningLevel()
          If a tooltip high-warning has been set, it is also cleared TODO docu
 void clearLowWarningLevel()
          If a tooltip low-warning has been set, it is also cleared TODO docu
 boolean getBoolValue()
          DOCUMENT ME!
 int getIntValue()
          DOCUMENT ME!
 java.awt.Dimension getMinimumSize()
          DOCUMENT ME!
 java.awt.Dimension getPreferredSize()
          DOCUMENT ME!
 ColorSquareListener getSquareListener()
          Optionally, a square listener can be called when the value changes.
 java.lang.String getTooltipText()
          If we have a tooltip, return its text.
 void mouseClicked(java.awt.event.MouseEvent e)
          DOCUMENT ME!
 void mouseEntered(java.awt.event.MouseEvent e)
          DOCUMENT ME!
 void mouseExited(java.awt.event.MouseEvent e)
          DOCUMENT ME!
 void mousePressed(java.awt.event.MouseEvent evt)
          DOCUMENT ME! If a ColorSquareListener is attached, and value changes, the listener will be called.
 void mouseReleased(java.awt.event.MouseEvent e)
          DOCUMENT ME!
 void paint(java.awt.Graphics g)
          DOCUMENT ME!
 void setBackground(java.awt.Color c)
          Overrides standard to allow special warning behavior for GREY.
 void setBoolValue(boolean v)
          DOCUMENT ME! If a ColorSquareListener is attached, and value changes, the listener will be called.
 void setBorderColor(java.awt.Color c)
          Set this square's border color.
 void setBounds(int x, int y, int w, int h)
          Set bounds (position and size).
 void setColor(java.awt.Color c)
          Set this square's background color.
 void setHighWarningLevel(int warnLevel)
          Set high-level warning (TODO docu text)
 void setIntValue(int v)
          DOCUMENT ME! If a ColorSquareListener is attached, and value changes, the listener will be called.
 void setLowWarningLevel(int warnLevel)
          Set low-level warning (TODO docu text)
 void setSize(int w, int h)
          Set the width and height of this ColorSquare.
 void setSquareListener(ColorSquareListener sp)
          Optionally, a square listener can be called when the value changes.
 void setTooltipHighWarningLevel(java.lang.String warnTip, int warnLevel)
          Set high-level warning, and set or clear its tooltip text.
 void setTooltipLowWarningLevel(java.lang.String warnTip, int warnLevel)
          Set low-level warning, and set or clear its tooltip text.
 void setTooltipText(java.lang.String tip)
          Change tooltip text or show or hide tooltip.
 void setTooltipZeroText(java.lang.String zeroTip)
          Set or clear zero-level tooltip text.
 void setVisible(boolean newVis)
          Show or hide the colorsquare.
 void subtractValue(int v)
          DOCUMENT ME!
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, 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, 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, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, 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, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLAY

public static final java.awt.Color CLAY
The color constants are used by ColorSquare, and also used for the robber's "ghost" when moving the robber, and fallback for missing hex graphics.

See Also:
SOCBoardPanel.drawRobber(Graphics, int, boolean, boolean), SOCBoardPanel.drawHex(Graphics, int)

ORE

public static final java.awt.Color ORE

SHEEP

public static final java.awt.Color SHEEP

WHEAT

public static final java.awt.Color WHEAT

WOOD

public static final java.awt.Color WOOD

GREY

public static final java.awt.Color GREY

DESERT

public static final java.awt.Color DESERT

GOLD

public static final java.awt.Color GOLD
Gold hex color.

Since:
2.0.00

FOG

public static final java.awt.Color FOG
Fog hex color.

Since:
2.0.00

WATER

public static final java.awt.Color WATER
Water hex color, for fallback if graphic is missing. @since 1.1.07


RESOURCE_COLORS

public static final java.awt.Color[] RESOURCE_COLORS
Array of resource colors. 0 is CLAY, 1 is ORE, SHEEP, WHEAT, 4 is ORE.

Because this array has the resource types a player can hold or trade, it does not contain GOLD.

Since:
1.1.08

NUMBER

public static final int NUMBER
See Also:
Constant Field Values

YES_NO

public static final int YES_NO
See Also:
Constant Field Values

CHECKBOX

public static final int CHECKBOX
See Also:
Constant Field Values

BOUNDED_INC

public static final int BOUNDED_INC
See Also:
Constant Field Values

BOUNDED_DEC

public static final int BOUNDED_DEC
See Also:
Constant Field Values

TEXT

public static final int TEXT
Colorsquare type TEXT displays a short message. You will have to change the colorsquare's size yourself.

Since:
1.1.06
See Also:
Constant Field Values

WIDTH

public static final int WIDTH
See Also:
Constant Field Values

HEIGHT

public static final int HEIGHT
See Also:
Constant Field Values

WARN_LEVEL_COLOR

public static java.awt.Color WARN_LEVEL_COLOR
The warning-level text color (high, low, or zero)

See Also:
setHighWarningLevel(int), setLowWarningLevel(int), setTooltipZeroText(String), WARN_LEVEL_COLOR_BG_FROMGREY

WARN_LEVEL_COLOR_BG_FROMGREY

public static java.awt.Color WARN_LEVEL_COLOR_BG_FROMGREY
Background color for warning-level, if grey normally

See Also:
WARN_LEVEL_COLOR

intValue

int intValue

boolValue

boolean boolValue

textValue

private java.lang.String textValue

valueVis

boolean valueVis

kind

int kind

upperBound

int upperBound

lowerBound

int lowerBound

interactive

boolean interactive

borderColor

private java.awt.Color borderColor
Border color, BLACK by default

Since:
1.1.13

sqListener

protected ColorSquareListener sqListener

ttip

protected AWTToolTip ttip

warn_bg_grey

protected boolean warn_bg_grey
Normal background color is GREY (when not high or low "warning" color). Background does not change for warning, unless this is true.

See Also:
WARN_LEVEL_COLOR_BG_FROMGREY

ttip_text

protected java.lang.String ttip_text
Text for normal vs low-warning-level. Unused unless a low-bound or high-bound or zero-level-text is set.


ttip_text_warnLow

protected java.lang.String ttip_text_warnLow
Optional text for low-warning-level and high-warning-level (intValue).


ttip_text_warnHigh

protected java.lang.String ttip_text_warnHigh
Optional text for low-warning-level and high-warning-level (intValue).


ttip_text_zero

protected java.lang.String ttip_text_zero
Optional text for zero level (intValue).


hasWarnLow

protected boolean hasWarnLow
Low-level or high-level warning level has been set (intValue).


hasWarnHigh

protected boolean hasWarnHigh
Low-level or high-level warning level has been set (intValue).


isWarnLow

protected boolean isWarnLow
At low-level warning, or at zero if ttip_text_zero was set.


isWarnHigh

protected boolean isWarnHigh
At high-level warning.


warnLowBound

protected int warnLowBound

warnHighBound

protected int warnHighBound

squareW

protected int squareW
Size per instance, for ColorSquareLarger


squareH

protected int squareH
Size per instance, for ColorSquareLarger


squareSize

protected java.awt.Dimension squareSize

strings

private static final SOCStringManager strings
i18n text strings

Constructor Detail

ColorSquare

public ColorSquare()
Creates a new grey ColorSquare object without a visible value.

See Also:
ColorSquare(int, boolean, Color, int, int)

ColorSquare

public ColorSquare(java.awt.Color c)
Creates a new ColorSquare object with specified background color. Type NUMBER, non-interactive, upper=99, lower=0.

A tooltip with the resource name is created if c is one of the resource colors defined in ColorSquare (CLAY, WHEAT, etc).

Parameters:
c - background color
See Also:
ColorSquare(int, boolean, Color, int, int)

ColorSquare

public ColorSquare(java.awt.Color c,
                   int v)
Creates a new ColorSquare object with specified background color and initial value. Type NUMBER, non-interactive, upper=99, lower=0.

A tooltip with the resource name is created if c is one of the resource colors defined in ColorSquare (CLAY, WHEAT, etc).

Parameters:
c - background color
v - initial int value
See Also:
ColorSquare(int, boolean, Color, int, int)

ColorSquare

public ColorSquare(java.awt.Color c,
                   java.lang.String v)
Creates a new ColorSquare object with specified background color and initial value. Type TEXT, non-interactive.

The colorsquare's size is small by default and not changed here, so be sure to call setSize or setBounds to make the square large enough to display your text.

A tooltip with the resource name is created if c is one of the resource colors defined in ColorSquare (CLAY, WHEAT, etc).

Parameters:
c - background color
v - initial string value
Since:
1.1.06

ColorSquare

public ColorSquare(int k,
                   boolean in,
                   java.awt.Color c)
Creates a new ColorSquare of the specified kind and background color. Possibly interactive. For kind = NUMBER, upper=99, lower=0.

A tooltip with the resource name is created if c is one of the resource colors defined in ColorSquare (CLAY, WHEAT, etc).

Parameters:
k - Kind: NUMBER, YES_NO, CHECKBOX, BOUNDED_INC, BOUNDED_DEC
in - interactive flag allowing user interaction
c - background color
See Also:
ColorSquare(int, boolean, Color, int, int)

ColorSquare

public ColorSquare(int k,
                   boolean in,
                   java.awt.Color c,
                   int upper,
                   int lower)
Creates a new ColorSquare of the specified kind and background color. Possibly interactive, with upper and lower bounds specified for NUMBER kinds.

A tooltip with the resource name is created if c is one of the resource colors defined in ColorSquare (CLAY, WHEAT, etc).

Parameters:
k - Kind: NUMBER, YES_NO, CHECKBOX, BOUNDED_INC, BOUNDED_DEC
in - interactive flag allowing user interaction
c - background color
upper - upper bound if k == NUMBER
lower - lower bound if k == NUMBER
Method Detail

setBackground

public void setBackground(java.awt.Color c)
Overrides standard to allow special warning behavior for GREY. Only grey squares change background color when a warning-level threshold is reached (setHighWarningLevel(int) or setLowWarningLevel(int)). TODO DOCU - what do other squares do?

Overrides:
setBackground in class java.awt.Component
Parameters:
c - New background color

setColor

public void setColor(java.awt.Color c)
Set this square's background color. The text color cannot be changed. See setBackground(Color) for special behavior with warning-level. thresholds.

Parameters:
c - New background color

setBorderColor

public void setBorderColor(java.awt.Color c)
                    throws java.lang.IllegalArgumentException
Set this square's border color.

Parameters:
c - New color; the default is Color.BLACK
Throws:
java.lang.IllegalArgumentException - if c is null
Since:
1.1.13

setSize

public void setSize(int w,
                    int h)
Set the width and height of this ColorSquare. Does not need to be a square (w != h is OK).

Overrides:
setSize in class java.awt.Component
Parameters:
w - width in pixels
h - height in pixels

getTooltipText

public java.lang.String getTooltipText()
If we have a tooltip, return its text.

Returns:
tooltip text, or null if none

setTooltipText

public void setTooltipText(java.lang.String tip)
Change tooltip text or show or hide tooltip. (Set tip text to null to hide it.)

Parameters:
tip - New tip text; will create tooltip if needed. If tip is null, tooltip is removed, and any warning-level tip text or zero-level text is also set to null.
See Also:
setTooltipHighWarningLevel(String, int), setTooltipLowWarningLevel(String, int), setTooltipZeroText(String)

setLowWarningLevel

public void setLowWarningLevel(int warnLevel)
                        throws java.lang.IllegalArgumentException
Set low-level warning (TODO docu text)

Parameters:
warnLevel - If the colorsquare value is at warnLevel or lower, indicate with the warning color.
Throws:
java.lang.IllegalArgumentException - if warnLevel is above high level, or is zero. To set text for value 0, use setTooltipZeroText(String) instead. To clear the warning level, use clearLowWarningLevel() instead.
See Also:
clearLowWarningLevel(), setTooltipZeroText(String)

clearLowWarningLevel

public void clearLowWarningLevel()
If a tooltip low-warning has been set, it is also cleared TODO docu


setTooltipLowWarningLevel

public void setTooltipLowWarningLevel(java.lang.String warnTip,
                                      int warnLevel)
                               throws java.lang.IllegalStateException,
                                      java.lang.IllegalArgumentException
Set low-level warning, and set or clear its tooltip text. If warnTip not null, we must already have a standard tooltip text. Does not affect zero-level or high-level tooltip text.

Parameters:
warnTip - TODO docu - or null to clear tip text
warnLevel - TODO docu - at or below
Throws:
java.lang.IllegalStateException - if setTooltipText has not yet been called, and warnTip is not null
java.lang.IllegalArgumentException - if warnLevel is above high level, or is zero. To set text for value 0, use setTooltipZeroText(String) instead. To clear the warning level, use clearLowWarningLevel() instead.
See Also:
setHighWarningLevel(int), setLowWarningLevel(int), setTooltipText(String), setTooltipZeroText(String)

setHighWarningLevel

public void setHighWarningLevel(int warnLevel)
                         throws java.lang.IllegalArgumentException
Set high-level warning (TODO docu text)

Parameters:
warnLevel - If the colorsquare value is at warnLevel or higher, indicate with the warning color.
Throws:
java.lang.IllegalArgumentException - if warnLevel is below low-warning level.
See Also:
clearHighWarningLevel()

clearHighWarningLevel

public void clearHighWarningLevel()
If a tooltip high-warning has been set, it is also cleared TODO docu


setTooltipHighWarningLevel

public void setTooltipHighWarningLevel(java.lang.String warnTip,
                                       int warnLevel)
                                throws java.lang.IllegalStateException,
                                       java.lang.IllegalArgumentException
Set high-level warning, and set or clear its tooltip text. If warnTip not null, we must already have a standard tooltip text. Does not affect zero-level or low-level tooltip text.

Parameters:
warnTip - TODO docu - or null to clear tip text
warnLevel - TODO docu - at or above
Throws:
java.lang.IllegalStateException - if setTooltipText has not yet been called, and warnTip is not null
java.lang.IllegalArgumentException - if warnLevel is below low-warning level.
See Also:
setHighWarningLevel(int), setLowWarningLevel(int), setTooltipText(String)

setTooltipZeroText

public void setTooltipZeroText(java.lang.String zeroTip)
                        throws java.lang.IllegalStateException
Set or clear zero-level tooltip text. Setting this text will also make the tooltip color the warning color when at value 0.

Parameters:
zeroTip - TODO docu - or null to clear tip text
Throws:
java.lang.IllegalStateException - if setTooltipText has not yet been called, and zeroTip is not null
See Also:
setTooltipText(String), setTooltipHighWarningLevel(String, int), setTooltipLowWarningLevel(String, int), setTooltipZeroText(String)

setVisible

public void setVisible(boolean newVis)
Show or hide the colorsquare. If we have a tooltip, will also show/hide that tooltip.

Overrides:
setVisible in class java.awt.Component

getPreferredSize

public java.awt.Dimension getPreferredSize()
DOCUMENT ME!

Overrides:
getPreferredSize in class java.awt.Component
Returns:
DOCUMENT ME!

getMinimumSize

public java.awt.Dimension getMinimumSize()
DOCUMENT ME!

Overrides:
getMinimumSize in class java.awt.Component
Returns:
DOCUMENT ME!

setBounds

public void setBounds(int x,
                      int y,
                      int w,
                      int h)
Set bounds (position and size). Does not need to be a square (w != h is OK).

Overrides:
setBounds in class java.awt.Component
Parameters:
x - x-position
y - y-position
w - width in pixels
h - height in pixels
Since:
1.1.06
See Also:
Component.setBounds(int, int, int, int)

paint

public void paint(java.awt.Graphics g)
DOCUMENT ME!

Overrides:
paint in class java.awt.Canvas
Parameters:
g - DOCUMENT ME!

addValue

public void addValue(int v)
DOCUMENT ME!

Parameters:
v - DOCUMENT ME!

subtractValue

public void subtractValue(int v)
DOCUMENT ME!

Parameters:
v - DOCUMENT ME!

setIntValue

public void setIntValue(int v)
DOCUMENT ME! If a ColorSquareListener is attached, and value changes, the listener will be called.

Parameters:
v - DOCUMENT ME!

getIntValue

public int getIntValue()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setBoolValue

public void setBoolValue(boolean v)
DOCUMENT ME! If a ColorSquareListener is attached, and value changes, the listener will be called.

Parameters:
v - DOCUMENT ME!

getBoolValue

public boolean getBoolValue()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getSquareListener

public ColorSquareListener getSquareListener()
Optionally, a square listener can be called when the value changes. If this square is part of a SquaresPanel, that panel is the listener.

Returns:
square listener, or null.

setSquareListener

public void setSquareListener(ColorSquareListener sp)
Optionally, a square listener can be called when the value changes.

Parameters:
sp - Square listener, or null to clear

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
DOCUMENT ME!

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
e - DOCUMENT ME!

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
DOCUMENT ME!

Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
e - DOCUMENT ME!

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
DOCUMENT ME!

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
e - DOCUMENT ME!

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
DOCUMENT ME!

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
e - DOCUMENT ME!

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
DOCUMENT ME! If a ColorSquareListener is attached, and value changes, the listener will be called.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
evt - DOCUMENT ME!