de.caff.maze
Class MazePaintProperties

java.lang.Object
  extended by de.caff.maze.MazePropertyOwner
      extended by de.caff.maze.MazePaintProperties
All Implemented Interfaces:
MazePaintPropertiesProvider
Direct Known Subclasses:
MazePrintProperties, MazeSaveImageProperties

public class MazePaintProperties
extends MazePropertyOwner
implements MazePaintPropertiesProvider

Properties describing how a maze is painted.

 

Nested Class Summary
 
Nested classes/interfaces inherited from class de.caff.maze.MazePropertyOwner
MazePropertyOwner.BooleanPropertyInformation, MazePropertyOwner.EnumPropertyInformation, MazePropertyOwner.InfoPropertyDisplay, MazePropertyOwner.IntegerPropertyInformation, MazePropertyOwner.PaintPropertyInformation
 
Field Summary
protected  java.lang.String myKey
          Key of this property.
static java.lang.String PROPERTY_BACKGROUND_PAINT
          Property key of Paint property of the background.
static java.lang.String PROPERTY_CELL_BORDER_PAINT
          Property key of Paint property of cell borders.
static java.lang.String PROPERTY_INNER_BORDER_PAINT
          Property key of Paint property of inner borders.
static java.lang.String PROPERTY_OUTER_BORDER_PAINT
          Property key of Paint property of outer border.
static java.lang.String PROPERTY_SHOWING_CELL_BORDERS
          Property key of boolean property describing whether cell borders are shown.
static java.lang.String PROPERTY_SHOWING_SOLUTION
          Property key of boolean property describing whether the solution is shown.
static java.lang.String PROPERTY_SOLUTION_PAINT
          Property key of Paint property of solution cells.
static java.lang.String PROPERTY_WAY_END_PAINT
          Property key of Paint property of the way end point.
static java.lang.String PROPERTY_WAY_START_PAINT
          Property key of Paint property of the way start point.
 
Constructor Summary
protected MazePaintProperties(java.lang.String myKey)
          Constructor.
 
Method Summary
 java.awt.Paint getBackgroundPaint()
          Get the background paint.
 java.awt.Paint getCellBorderPaint()
          Get the paint of cell borders.
static MazePaintProperties getDrawMazePaintProperties(DataStorage systemAccess)
          Get paint properties.
 java.awt.Paint getInnerWallsPaint()
          Get the paint of the inner borders.
 java.awt.Paint getOuterWallPaint()
          Get the paint of the outer border.
 java.util.Collection<PropertyInformation> getPropertyInformations()
          Get the property informations.
static MazePaintProperties getSaveMazePaintProperties(DataStorage systemAccess)
          Get paint properties for saving the maze as an image.
 java.awt.Paint getSolutionPaint()
          Get the paint of solution cells.
 java.awt.Paint getWayEndPaint()
          Get the paint for the end cell.
 java.awt.Paint getWayStartPaint()
          Get the paint for the start cell.
 boolean isShowingCellBorders()
          Are cell borders displayed?
 boolean isShowingSolution()
          Is the solution displayed?
(package private)  void overwriteFromPersistentData(DataStorage dataStorage)
          Overwrite the properties from the given data storage.
 void setBackgroundPaint(java.awt.Paint backgroundPaint)
          Set the background paint.
 void setCellBorderPaint(java.awt.Paint cellBorderPaint)
          Set the paint of cell borders.
 void setInnerBorderPaint(java.awt.Paint innerBorderPaint)
          Set the paint of the inner borders.
 void setOuterBorderPaint(java.awt.Paint outerBorderPaint)
          Set the paint of the outer border.
 void setShowingCellBorders(boolean showingCellBorders)
          Set whether cell borders are displayed.
 void setShowingSolution(boolean show)
          Set whether the solution is displayed.
 void setSolutionPaint(java.awt.Paint solutionPaint)
          Set the paint of solution cells.
 void setWayEndPaint(java.awt.Paint wayEndPaint)
          Set the paint for the end cell.
 void setWayStartPaint(java.awt.Paint wayStartPaint)
          Set the paint for the start cell.
(package private)  void storePersistentData(DataStorage dataStorage)
          Store the settings in a data storage.
 
Methods inherited from class de.caff.maze.MazePropertyOwner
addPropertyChangeListener, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_SHOWING_SOLUTION

public static final java.lang.String PROPERTY_SHOWING_SOLUTION
Property key of boolean property describing whether the solution is shown.

See Also:
Constant Field Values

PROPERTY_SHOWING_CELL_BORDERS

public static final java.lang.String PROPERTY_SHOWING_CELL_BORDERS
Property key of boolean property describing whether cell borders are shown.

See Also:
Constant Field Values

PROPERTY_OUTER_BORDER_PAINT

public static final java.lang.String PROPERTY_OUTER_BORDER_PAINT
Property key of Paint property of outer border.

See Also:
Constant Field Values

PROPERTY_INNER_BORDER_PAINT

public static final java.lang.String PROPERTY_INNER_BORDER_PAINT
Property key of Paint property of inner borders.

See Also:
Constant Field Values

PROPERTY_CELL_BORDER_PAINT

public static final java.lang.String PROPERTY_CELL_BORDER_PAINT
Property key of Paint property of cell borders.

See Also:
Constant Field Values

PROPERTY_SOLUTION_PAINT

public static final java.lang.String PROPERTY_SOLUTION_PAINT
Property key of Paint property of solution cells.

See Also:
Constant Field Values

PROPERTY_WAY_START_PAINT

public static final java.lang.String PROPERTY_WAY_START_PAINT
Property key of Paint property of the way start point.

See Also:
Constant Field Values

PROPERTY_WAY_END_PAINT

public static final java.lang.String PROPERTY_WAY_END_PAINT
Property key of Paint property of the way end point.

See Also:
Constant Field Values

PROPERTY_BACKGROUND_PAINT

public static final java.lang.String PROPERTY_BACKGROUND_PAINT
Property key of Paint property of the background.

See Also:
Constant Field Values

myKey

protected final java.lang.String myKey
Key of this property.

Constructor Detail

MazePaintProperties

protected MazePaintProperties(java.lang.String myKey)
Constructor.

Parameters:
myKey - resource key
Method Detail

getDrawMazePaintProperties

public static MazePaintProperties getDrawMazePaintProperties(DataStorage systemAccess)
Get paint properties.

Parameters:
systemAccess - system access used to overwrite default settings
Returns:
paint properties

getSaveMazePaintProperties

public static MazePaintProperties getSaveMazePaintProperties(DataStorage systemAccess)
Get paint properties for saving the maze as an image.

Parameters:
systemAccess - system access used to overwrite default settings
Returns:
paint properties

setShowingSolution

public void setShowingSolution(boolean show)
Set whether the solution is displayed.

Parameters:
show - show the solution?

isShowingSolution

public boolean isShowingSolution()
Is the solution displayed?

Specified by:
isShowingSolution in interface MazePaintPropertiesProvider
Returns:
the answer

isShowingCellBorders

public boolean isShowingCellBorders()
Are cell borders displayed? Cell borders are drawn between connected cells.

Specified by:
isShowingCellBorders in interface MazePaintPropertiesProvider
Returns:
the answer

setShowingCellBorders

public void setShowingCellBorders(boolean showingCellBorders)
Set whether cell borders are displayed. Cell borders are drawn between connected cells.

Parameters:
showingCellBorders - display cell borders?

getOuterWallPaint

public java.awt.Paint getOuterWallPaint()
Get the paint of the outer border.

Specified by:
getOuterWallPaint in interface MazePaintPropertiesProvider
Returns:
outer border paint

setOuterBorderPaint

public void setOuterBorderPaint(java.awt.Paint outerBorderPaint)
Set the paint of the outer border.

Parameters:
outerBorderPaint - new outer border paint

getInnerWallsPaint

public java.awt.Paint getInnerWallsPaint()
Get the paint of the inner borders. Inner borders are drawn between unconnected cells.

Specified by:
getInnerWallsPaint in interface MazePaintPropertiesProvider
Returns:
inner border paint

setInnerBorderPaint

public void setInnerBorderPaint(java.awt.Paint innerBorderPaint)
Set the paint of the inner borders. Inner borders are drawn between unconnected cells.

Parameters:
innerBorderPaint - inner border paint

getCellBorderPaint

public java.awt.Paint getCellBorderPaint()
Get the paint of cell borders. Cell borders are drawn between connected cells if they are drawn at all.

Specified by:
getCellBorderPaint in interface MazePaintPropertiesProvider
Returns:
cell border paint
See Also:
MazePaintProperties.isShowingCellBorders()

setCellBorderPaint

public void setCellBorderPaint(java.awt.Paint cellBorderPaint)
Set the paint of cell borders. Cell borders are drawn between connected cells if they are drawn at all.

Parameters:
cellBorderPaint - cell border paint
See Also:
MazePaintProperties.isShowingCellBorders()

getSolutionPaint

public java.awt.Paint getSolutionPaint()
Get the paint of solution cells.

Specified by:
getSolutionPaint in interface MazePaintPropertiesProvider
Returns:
solution cell paint
See Also:
MazePaintProperties.isShowingSolution()

setSolutionPaint

public void setSolutionPaint(java.awt.Paint solutionPaint)
Set the paint of solution cells.

Parameters:
solutionPaint - solution cell paint
See Also:
MazePaintProperties.isShowingSolution()

getBackgroundPaint

public java.awt.Paint getBackgroundPaint()
Get the background paint.

Specified by:
getBackgroundPaint in interface MazePaintPropertiesProvider
Returns:
background paint

setBackgroundPaint

public void setBackgroundPaint(java.awt.Paint backgroundPaint)
Set the background paint.

Parameters:
backgroundPaint - background paint

getWayStartPaint

public java.awt.Paint getWayStartPaint()
Get the paint for the start cell.

Specified by:
getWayStartPaint in interface MazePaintPropertiesProvider
Returns:
start cell paint

setWayStartPaint

public void setWayStartPaint(java.awt.Paint wayStartPaint)
Set the paint for the start cell.

Parameters:
wayStartPaint - start cell paint

getWayEndPaint

public java.awt.Paint getWayEndPaint()
Get the paint for the end cell.

Specified by:
getWayEndPaint in interface MazePaintPropertiesProvider
Returns:
end cell paint

setWayEndPaint

public void setWayEndPaint(java.awt.Paint wayEndPaint)
Set the paint for the end cell.

Parameters:
wayEndPaint - end cell paint

getPropertyInformations

public java.util.Collection<PropertyInformation> getPropertyInformations()
Get the property informations.

Specified by:
getPropertyInformations in class MazePropertyOwner
Returns:
collection of property informations

overwriteFromPersistentData

void overwriteFromPersistentData(DataStorage dataStorage)
Overwrite the properties from the given data storage.

Parameters:
dataStorage - data storage to use for access to stored settings

storePersistentData

void storePersistentData(DataStorage dataStorage)
Store the settings in a data storage.

Parameters:
dataStorage - storage to store to