smithers.logicpuzzles
Class MosaicGraphics
java.lang.Object
smithers.logicpuzzles.MosaicGraphics
- All Implemented Interfaces:
- java.awt.event.MouseListener, java.util.EventListener, PuzzleGraphics
public class MosaicGraphics
- extends java.lang.Object
- implements PuzzleGraphics
Method Summary |
java.awt.Rectangle |
draw(java.awt.Graphics g,
java.awt.Rectangle r)
Draws the puzzle onto a graphics object. |
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)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COLOUR_UNKNOWN
public static final java.awt.Color COLOUR_UNKNOWN
COLOUR_BORDERS
public static final java.awt.Color COLOUR_BORDERS
COLOUR_CLEAR
public static final java.awt.Color COLOUR_CLEAR
COLOUR_FILLED
public static final java.awt.Color COLOUR_FILLED
MosaicGraphics
public MosaicGraphics(MosaicState state)
MosaicGraphics
public MosaicGraphics(MosaicSolver solver)
draw
public java.awt.Rectangle draw(java.awt.Graphics g,
java.awt.Rectangle r)
- Description copied from interface:
PuzzleGraphics
- Draws the puzzle onto a graphics object. This method should attempt to
fit the puzzle into the given rectangle. The puzzle should be drawn as
large as possible and centered in the region.
- Specified by:
draw
in interface PuzzleGraphics
- Parameters:
g
- the graphics object to draw ontor
- the region to fit the puzzle into
- Returns:
- the actual bounding rectangle for the puzzle
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Specified by:
mouseClicked
in interface java.awt.event.MouseListener
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
- Specified by:
mouseEntered
in interface java.awt.event.MouseListener
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
- Specified by:
mouseExited
in interface java.awt.event.MouseListener
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressed
in interface java.awt.event.MouseListener
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleased
in interface java.awt.event.MouseListener