cz.psika.numerist
Class Style

java.lang.Object
  extended by cz.psika.numerist.Style

public class Style
extends java.lang.Object

Numerology characteristics style settings.

Author:
Tomas Psika

Nested Class Summary
protected static class Style.ConfigColor
          Static class with static methods returning Color objects initialized from configuration strings.
 
Field Summary
protected static java.awt.Color defDiagonalLineColor
          Default color for diagonal lines.
protected static java.awt.Color defLineColor
          Default color for lines.
static java.awt.Color defNumberColor
          Default color for digits.
protected  java.util.Map<java.lang.String,java.lang.String> map
          Map of characters and their corresponding values and some other configuration values.
protected  cz.psika.numerist.Style.Mapping mapping
          Mapping of numbers.
protected  java.lang.String styleName
          Name of this style.
 
Constructor Summary
protected Style(java.io.File styleConfigFile)
          Protected constructor.
  Style(Style oldStyle)
          Copy constructor.
 
Method Summary
 java.lang.String get(java.lang.String key)
          Get parameter value of this style.
 java.awt.Color getColorForLine(int line)
          Returns color of concrete lines.
 java.awt.Color getColorForNumber(int number)
          Each numbers could have it's own color.
 cz.psika.numerist.Style.Mapping getMapping()
          Get mapping of numbers <-> numbers.
 java.lang.String getName()
          Get name of this style.
 int getNumberOnPos(int pos)
          Returns digit on given diagram position.
 int getPositionOfNumber(int number)
          Returns position of concrete number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

protected java.util.Map<java.lang.String,java.lang.String> map
Map of characters and their corresponding values and some other configuration values.


mapping

protected cz.psika.numerist.Style.Mapping mapping
Mapping of numbers.


defNumberColor

public static final java.awt.Color defNumberColor
Default color for digits.


defLineColor

protected static final java.awt.Color defLineColor
Default color for lines.


defDiagonalLineColor

protected static final java.awt.Color defDiagonalLineColor
Default color for diagonal lines.


styleName

protected java.lang.String styleName
Name of this style.

Constructor Detail

Style

protected Style(java.io.File styleConfigFile)
         throws java.io.IOException
Protected constructor.

Parameters:
styleConfigFile - file with style definition
Throws:
java.io.IOException - in case of problems reading configuration file
java.lang.IllegalArgumentException - if styleConfigFile is null

Style

public Style(Style oldStyle)
Copy constructor.

Parameters:
oldStyle - old Style object
Method Detail

get

public java.lang.String get(java.lang.String key)
Get parameter value of this style.

Parameters:
key - parameter definition
Returns:
value of this style's variable or null when not exists

getNumberOnPos

public int getNumberOnPos(int pos)
Returns digit on given diagram position.

Parameters:
pos - position start with zero, i.e place in top left corner
Returns:
number on specified position
See Also:
Style.Mapping.numbers

getPositionOfNumber

public int getPositionOfNumber(int number)
Returns position of concrete number.

Parameters:
number - or digit, we want to know it's position
Returns:
position of specified digit
See Also:
Style.Mapping.positions

getColorForNumber

public java.awt.Color getColorForNumber(int number)
Each numbers could have it's own color.

Parameters:
number - number in diagram for which we want to know it's color
Returns:
color specified by configuration or default number color

getColorForLine

public java.awt.Color getColorForLine(int line)
Returns color of concrete lines. Ordering from left to right and from top to bottom of diagram.

Parameters:
line -
1 .. 3
horizontal lines
4 .. 6
vertical lines
7 .. 8
inner diagonal lines
9
outer diagonal lines
Returns:
assigned line color

getName

public java.lang.String getName()
Get name of this style.

Returns:
this style's name

getMapping

public cz.psika.numerist.Style.Mapping getMapping()
Get mapping of numbers <-> numbers.

Returns:
internal object of class Mapping