chart
Class Axis

java.lang.Object
  extended by chart.Axis
All Implemented Interfaces:
java.io.Serializable

public class Axis
extends java.lang.Object
implements java.io.Serializable

A serializable representation of all relevant settings for an Axis on a Chart.

An Axis is used to represent a Parameter. Each Axis has an upper Filter and a lower Filter, which are represented by triangles and can be dragged by the user. The positions of the Filters determine which Designs are displayed, and which are not.

See Also:
Chart, Filter, Parameter, Design, Serialized Form

Field Summary
private  boolean active
          Specifies whether the Axis is displayed on the Chart.
private  boolean autoFit
          Specifies whether this Axis is autofitted.
private  java.awt.Color axisColor
          The axis color.
private  boolean axisInverted
          Specifies whether the Axis should be displayed upside down.
private  java.awt.Color axisLabelFontColor
          The axis label font color.
private  int axisLabelFontSize
          The axis label font size.
private  Chart chart
          The Chart to which this Axis belongs.
private  DataSheet dataSheet
          The data sheet that is displayed with the Chart to which this Axis belongs.
private  boolean filterInverted
          Specifies whether the Filters should be inverted.
private  int height
          The height of this Axis on the Chart.
private  Filter lowerFilter
          The lower Filter on the Axis.
private  double max
          The maximum value of this Axis.
private  double min
          The minimum value of this Axis.
private  Parameter parameter
          The parameter that is represented by this Axis.
(package private) static boolean printLog
          Flag to enable debug message printing for this class.
(package private) static long serialVersionUID
          The version tracking unique identifier for Serialization.
private  int ticCount
          The number of tics on this Axis.
private  java.awt.Color ticLabelFontColor
          The tic label font color.
private  int ticLabelFontSize
          The tic label font size.
private  java.lang.String ticLabelFormat
          The tic label number format.
private  int ticLength
          The tic length in pixels.
private  Filter upperFilter
          The upper Filter on the Axis.
private  int width
          Determines the distance to the adjacent Axes in pixels.
 
Constructor Summary
Axis(DataSheet dataSheet, Chart chart, Parameter parameter)
          Instantiates a new Axis.
 
Method Summary
 void addFilters()
          Adds the Filters.
 void applyFilters()
          Apply filters to designs
 void autofit()
          Sets the Axis display range such that all Designs lie within the upper and the lower bound of this Axis.
 java.awt.Color getAxisColor()
          Gets the axis color.
 java.awt.Color getAxisLabelFontColor()
          Gets the axis label font color.
 int getAxisLabelFontSize()
          Gets the axis label font size.
 java.awt.Color getAxisTicLabelFontColor()
          Gets the axis tic label font color.
 Chart getChart()
          Gets the chart to which this Axis belongs.
 DataSheet getDataSheet()
          Gets the data sheet.
 int getHeight()
          Gets the Axis height in pixels.
 Filter getLowerFilter()
          Gets the lower filter.
 double getMax()
          Gets the maximum value of this Axis.
 double getMin()
          Gets the minimum value of this Axis.
 java.lang.String getName()
          Gets the name of the Parameter represented by this Axis.
 Parameter getParameter()
          Gets the parameter represented by this Axis.
 double getRange()
          Gets the range of this Axis.
 int getTicCount()
          Gets the tic count.
 int getTicLabelFontSize()
          Gets the tic label font size.
 java.lang.String getTicLabelFormat()
          Gets the tic label format.
 int getTicLength()
          Gets the tic length in pixels.
 Filter getUpperFilter()
          Gets the upper filter.
 int getWidth()
          Gets the Axis width in pixels.
 void initialiseSettings()
          Initialise display settings.
 boolean isActive()
          Checks if this Axis is active.
 boolean isAutoFit()
          Checks if this axis is autofitted.
 boolean isAxisInverted()
          Checks if this Axis is inverted.
 boolean isFilterInverted()
          Checks if the Filters are inverted.
private  void log(java.lang.String message)
          Prints debug information to stdout when printLog is set to true.
 void resetFilters()
          Resets both filters to the Axis min and max values..
 void resetSettingsToDefault()
          Reset display settings to default.
 void setActive(boolean active)
          Specifies whether this Axis is active.
 void setAutoFit(boolean autoFit)
          Specifies whether this Axis should be autofitted.
 void setAxisColor(java.awt.Color axisColor)
          Sets the axis color.
 void setAxisInverted(boolean axisInverted)
          Specifies whether this axis is inverted.
 void setAxisLabelFontColor(java.awt.Color axisLabelFontColor)
          Sets the axis label font color.
 void setAxisLabelFontSize(int axisLabelFontSize)
          Sets the axis label font size.
 void setDataSheet(DataSheet dataSheet)
          Sets the data sheet.
 void setFilterInverted(boolean filterInverted)
          Specifies whether the filter should be inverted.
 void setHeight(int height)
          Sets the Axis height in pixels.
 void setMax(double max)
          Sets the maximum value of this Axis.
 void setMin(double min)
          Sets the minimum value of this Axis.
 void setParameter(Parameter parameter)
          Sets the parameter represented by this Axis.
 void setTicCount(int ticCount)
          Sets the tic count.
 void setTicLabelFontColor(java.awt.Color ticLabelFontColor)
          Sets the tic label font color.
 void setTicLabelFontSize(int ticLabelFontSize)
          Sets the tic label font size.
 void setTicLabelFormat(java.lang.String ticLabelFormat)
          Sets the tic label number format.
 void setTicLength(int ticLength)
          Sets the tic length in pixels.
 void setWidth(int width)
          Sets the Axis width in pixels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
The version tracking unique identifier for Serialization.

See Also:
Constant Field Values

printLog

static final boolean printLog
Flag to enable debug message printing for this class.

See Also:
Constant Field Values

chart

private Chart chart
The Chart to which this Axis belongs.


autoFit

private boolean autoFit
Specifies whether this Axis is autofitted.

If true, the autoFit method is called before painting the Axis on the Chart.


max

private double max
The maximum value of this Axis.


min

private double min
The minimum value of this Axis.


dataSheet

private DataSheet dataSheet
The data sheet that is displayed with the Chart to which this Axis belongs.


parameter

private Parameter parameter
The parameter that is represented by this Axis.


width

private int width
Determines the distance to the adjacent Axes in pixels.

The distance to an adjacent Axis is determined by half the sum of both axes widths.


height

private int height
The height of this Axis on the Chart.


ticCount

private int ticCount
The number of tics on this Axis.


axisColor

private java.awt.Color axisColor
The axis color.

The Color in which the Axis is displayed on the Chart.


axisLabelFontColor

private java.awt.Color axisLabelFontColor
The axis label font color.

Each Axis is labeled with the Parameter name on top of the Axis. This field specifies which Color should be used for this label.


ticLabelFontColor

private java.awt.Color ticLabelFontColor
The tic label font color.

Each tic has a label showing the value to which the tic corresponds. This field specifies which Color should be used for this label.


axisLabelFontSize

private int axisLabelFontSize
The axis label font size.

Each Axis is labeled with the Parameter name on top of the Axis. This field specifies which font size should be used for this label.


ticLabelFontSize

private int ticLabelFontSize
The tic label font size.

Each tic has a label showing the value to which the tic corresponds. This field specifies which font size should be used for this label.


ticLabelFormat

private java.lang.String ticLabelFormat
The tic label number format.

Each tic has a label showing the value to which the tic corresponds. This field specifies which number format should be used for this label.


ticLength

private int ticLength
The tic length in pixels.


active

private boolean active
Specifies whether the Axis is displayed on the Chart.


upperFilter

private Filter upperFilter
The upper Filter on the Axis.

See Also:
Filter

lowerFilter

private Filter lowerFilter
The lower Filter on the Axis.

See Also:
Filter

filterInverted

private boolean filterInverted
Specifies whether the Filters should be inverted.

If true, designs become inactive if they have values between the upper and lower Filter and vice versa otherwise.

See Also:
Filter

axisInverted

private boolean axisInverted
Specifies whether the Axis should be displayed upside down.

If true, values are ascending from top to bottom. If false, values are ascending from bottom to top.

Constructor Detail

Axis

public Axis(DataSheet dataSheet,
            Chart chart,
            Parameter parameter)
Instantiates a new Axis.

Parameters:
dataSheet - the data sheet
chart - the Chart to which this Axis belongs
parameter - the Parameter represented by this Axis
Method Detail

initialiseSettings

public void initialiseSettings()
Initialise display settings.


resetSettingsToDefault

public void resetSettingsToDefault()
Reset display settings to default.


addFilters

public void addFilters()
Adds the Filters.


autofit

public void autofit()
Sets the Axis display range such that all Designs lie within the upper and the lower bound of this Axis.


getAxisLabelFontColor

public java.awt.Color getAxisLabelFontColor()
Gets the axis label font color.

Returns:
the axis label font color

setAxisLabelFontColor

public void setAxisLabelFontColor(java.awt.Color axisLabelFontColor)
Sets the axis label font color.

Parameters:
axisLabelFontColor - the new axis label font color

getAxisLabelFontSize

public int getAxisLabelFontSize()
Gets the axis label font size.

Returns:
the axis label font size

setAxisLabelFontSize

public void setAxisLabelFontSize(int axisLabelFontSize)
Sets the axis label font size.

Parameters:
axisLabelFontSize - the new axis label font size

getHeight

public int getHeight()
Gets the Axis height in pixels.

Returns:
the height

setHeight

public void setHeight(int height)
Sets the Axis height in pixels.

Parameters:
height - the new height

getMax

public double getMax()
Gets the maximum value of this Axis.

Returns:
the maximum value of this Axis

setMax

public void setMax(double max)
Sets the maximum value of this Axis.

Parameters:
max - the new maximum value of this Axis

getMin

public double getMin()
Gets the minimum value of this Axis.

Returns:
the minimum value of this Axis

setMin

public void setMin(double min)
Sets the minimum value of this Axis.

Parameters:
min - the new minimum value of this Axis

getRange

public double getRange()
Gets the range of this Axis.

Returns:
the range of this Axis

getTicCount

public int getTicCount()
Gets the tic count.

Returns:
the tic count

setTicCount

public void setTicCount(int ticCount)
Sets the tic count.

Parameters:
ticCount - the new tic count

getTicLabelFontSize

public int getTicLabelFontSize()
Gets the tic label font size.

Returns:
the tic label font size

setTicLabelFontSize

public void setTicLabelFontSize(int ticLabelFontSize)
Sets the tic label font size.

Parameters:
ticLabelFontSize - the new tic label font size

getTicLabelFormat

public java.lang.String getTicLabelFormat()
Gets the tic label format.

Returns:
the tic label format

setTicLabelFormat

public void setTicLabelFormat(java.lang.String ticLabelFormat)
Sets the tic label number format.

Parameters:
ticLabelFormat - the new tic label number format

getTicLength

public int getTicLength()
Gets the tic length in pixels.

Returns:
the tic length

setTicLength

public void setTicLength(int ticLength)
Sets the tic length in pixels.

Parameters:
ticLength - the new tic length

getWidth

public int getWidth()
Gets the Axis width in pixels.

Returns:
the Axis width

setWidth

public void setWidth(int width)
Sets the Axis width in pixels.

Parameters:
width - the new Axis width

isActive

public boolean isActive()
Checks if this Axis is active.

Returns:
true, if this Axis is active

setActive

public void setActive(boolean active)
Specifies whether this Axis is active.

Parameters:
active - the new active

getDataSheet

public DataSheet getDataSheet()
Gets the data sheet.

Returns:
the data sheet

setDataSheet

public void setDataSheet(DataSheet dataSheet)
Sets the data sheet.

Parameters:
dataSheet - the new data sheet

getParameter

public Parameter getParameter()
Gets the parameter represented by this Axis.

Returns:
the parameter represented by this Axis

setParameter

public void setParameter(Parameter parameter)
Sets the parameter represented by this Axis.

Parameters:
parameter - the new parameter represented by this Axis

getAxisColor

public java.awt.Color getAxisColor()
Gets the axis color.

Returns:
the axis color

setAxisColor

public void setAxisColor(java.awt.Color axisColor)
Sets the axis color.

Parameters:
axisColor - the new axis color

getAxisTicLabelFontColor

public java.awt.Color getAxisTicLabelFontColor()
Gets the axis tic label font color.

Returns:
the axis tic label font color

setTicLabelFontColor

public void setTicLabelFontColor(java.awt.Color ticLabelFontColor)
Sets the tic label font color.

Parameters:
ticLabelFontColor - the new tic label font color

getName

public java.lang.String getName()
Gets the name of the Parameter represented by this Axis.

Returns:
the name of the Parameter represented by this Axis.

getLowerFilter

public Filter getLowerFilter()
Gets the lower filter.

Returns:
the lower filter

getUpperFilter

public Filter getUpperFilter()
Gets the upper filter.

Returns:
the upper filter

getChart

public Chart getChart()
Gets the chart to which this Axis belongs.

Returns:
the chart to which this Axis belongs

log

private void log(java.lang.String message)
Prints debug information to stdout when printLog is set to true.

Parameters:
message - the message

isFilterInverted

public boolean isFilterInverted()
Checks if the Filters are inverted.

Returns:
true, if is filter inverted

setFilterInverted

public void setFilterInverted(boolean filterInverted)
Specifies whether the filter should be inverted.

Parameters:
filterInverted - specifies whether the filter should be inverted

isAxisInverted

public boolean isAxisInverted()
Checks if this Axis is inverted.

Returns:
true, if this Axis is inverted

setAxisInverted

public void setAxisInverted(boolean axisInverted)
Specifies whether this axis is inverted.

Parameters:
axisInverted - Specifies whether this axis is inverted.

isAutoFit

public boolean isAutoFit()
Checks if this axis is autofitted.

Returns:
true, if this axis is autofitted.

setAutoFit

public void setAutoFit(boolean autoFit)
Specifies whether this Axis should be autofitted.

Parameters:
autoFit - specifies whether this Axis should be autofitted

applyFilters

public void applyFilters()
Apply filters to designs

See Also:
Filter

resetFilters

public void resetFilters()
Resets both filters to the Axis min and max values..

See Also:
Filter