chart
Class Chart

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

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

A serializable representation of all relevant settings for a Chart which is displayed on a ChartFrame.

The data that was imported by the user can be displayed on a Chart. The Chart is built by as many vertical Axes as Parameters are present in the underlying the DataSheet and each Axis represents one of these Parameters.

The Designs (or, in other words, rows of the data table) are represented by lines that connect points on the Axes. Each Design's line crosses each Axis exactly at the ordinate that corresponds to the value for the respective Parameter in the Design. This allows to display the whole DataSheet in just one Chart, irrespective of how many dimensions it has.

The Chart also provides interactivity through a pair of draggable Filters that are present on each Axis. Depending on the positions of these filters, certain Designs are filtered from the display. This means that they are either displayed in a different color or hidden completely.

See Also:
ChartFrame, Axis, Filter, Parameter, DataSheet, Design, Serialized Form

Constructor Summary
Chart(DataSheet dataSheet, javax.swing.ProgressMonitor progressMonitor)
          Instantiates a new chart.
 
Method Summary
 void addAxis(Axis axis)
          Adds the axis.
 void addAxis(int index, Axis axis)
          Adds an Axis at the position index.
 void applyAllFilters()
          Apply all filters.
 void autofitAllAxes()
          Autofits all axes.
 void evaluateBoundsForAllDesigns()
          Evaluate Axis bounds for all designs.
 int getActiveAxisCount()
          Gets the active axis count.
 Axis getAxis(int index)
          Gets an Axis by its index.
 Axis getAxis(java.lang.String parameterName)
          Gets an Axis by its name.
 int getAxisCount()
          Gets the axis count.
 int getAxisLabelVerticalDistance()
          Gets the vertical distance between two axis labels that are vertically offset to prevent overlap.
 int getAxisMaxHeight()
          Gets the largest height of all Axis heights.
 int getAxisMaxWidth()
          Gets the largest width of all Axis widths.
 int getAxisTopPos()
          Gets the position in pixels of the top of the Axes of this Chart.
 java.awt.Color getBackGroundColor()
          Gets the back ground color.
 DataSheet getDataSheet()
          Gets the data sheet.
 java.awt.Color getDefaultDesignColor(boolean designActive)
          Gets the default design color.
 java.awt.Color getDesignColor(Design design, boolean designActive)
          Gets the design color.
 int getDesignLabelFontSize()
          Gets the design label font size.
 int getDesignLineThickness(Design design)
          Gets the design line thickness.
 java.awt.Color getFilterColor()
          Gets the filter color.
 int getFilterHeight()
          Gets the filter height.
 int getFilterWidth()
          Gets the filter width.
 int getHeight()
          Determines the height of this Chart.
 int getLineThickness()
          Gets the line thickness.
 java.awt.Point getLocation()
          Gets the location of this Chart on the Screen.
 int getMaxAxisLabelFontSize()
          Gets the largest Axis label font size on this Chart.
 java.awt.Dimension getSize()
          Gets the size of this Chart.
 int getTopMargin()
          Gets the top margin.
 int getWidth()
          Determines the width of this Chart.
 boolean isShowDesignIDs()
          Checks if design IDs should be shown.
 boolean isShowFilteredDesigns()
          Checks whether filtered designs should be shown.
 boolean isVerticallyOffsetAxisLabels()
          Checks, whether axis labels should be vertically offset.
 void moveAxis(int oldIndex, int newIndex)
          Function to reorder the axes in the chart
 void removeAxis(int index)
          Removes the axis with index index.
 void removeAxis(java.lang.String parameterName)
          Removes the axis with name name.
 void resetDisplaySettingsToDefault()
          Reset display settings to default.
 void setActiveDesignColor(java.awt.Color activeDesignColor)
          Sets the active design color.
 void setAxisColor(java.awt.Color color)
          Sets the axis color.
 void setAxisHeight(int height)
          Sets the height of this Chart by setting the heigh of all Axes.
 void setAxisLabelVerticalDistance(int axisLabelVerticalDistance)
          Sets the vertical distance between two axis labels that are vertically offset to prevent overlap.
 void setAxisWidth(int width)
          Sets the axis width.
 void setBackGroundColor(java.awt.Color backGroundColor)
          Sets the back ground color.
 void setDataSheet(DataSheet dataSheet)
          Sets the data sheet.
 void setDesignLabelFontSize(int designLabelFontSize)
          Sets the design label font size.
 void setFilterColor(java.awt.Color filterColor)
          Sets the filter color.
 void setFilteredDesignColor(java.awt.Color filteredDesignColor)
          Sets the filtered design color.
 void setFilterHeight(int filterHeight)
          Sets the filter height.
 void setFilterWidth(int filterWidth)
          Sets the filter width.
 void setLineThickness(int lineThickness)
          Sets the line thickness.
 void setLocation(java.awt.Point location)
          Sets the location of this Chart on the Screen..
 void setShowDesignIDs(boolean showDesignIDs)
          Specifies whether design IDs should be shown.
 void setShowFilteredDesigns(boolean showFilteredDesigns)
          Specifies whether filtered designs should be shown.
 void setSize(java.awt.Dimension size)
          Sets the size of this Chart..
 void setVerticallyOffsetAxisLabels(boolean verticallyOffsetAxisLabels)
          Sets whether axis labels should be vertically offset.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Chart

public Chart(DataSheet dataSheet,
             javax.swing.ProgressMonitor progressMonitor)
Instantiates a new chart.

Parameters:
dataSheet - the data sheet
Method Detail

getWidth

public int getWidth()
Determines the width of this Chart.

Returns:
the width of this Chart

getHeight

public int getHeight()
Determines the height of this Chart.

Returns:
the height of this Chart

getAxisMaxHeight

public int getAxisMaxHeight()
Gets the largest height of all Axis heights.

Returns:
the largest height of all Axis heights

setAxisHeight

public void setAxisHeight(int height)
Sets the height of this Chart by setting the heigh of all Axes.

Parameters:
height - the height of this Chart by setting the heigh of all Axes..

getAxisMaxWidth

public int getAxisMaxWidth()
Gets the largest width of all Axis widths.

Returns:
the largest width of all Axis widths.

setAxisWidth

public void setAxisWidth(int width)
Sets the axis width.

Parameters:
width - the new axis width

setAxisColor

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

Parameters:
color - the new axis color

getAxisTopPos

public int getAxisTopPos()
Gets the position in pixels of the top of the Axes of this Chart.

Returns:
the position in pixels of the top of the Axes of this Chart.

getAxis

public Axis getAxis(int index)
Gets an Axis by its index.

Parameters:
index - the index
Returns:
the Axis with index index

getAxis

public Axis getAxis(java.lang.String parameterName)
Gets an Axis by its name.

Parameters:
parameterName - the parameter name
Returns:
the Axis

getMaxAxisLabelFontSize

public int getMaxAxisLabelFontSize()
Gets the largest Axis label font size on this Chart.

Returns:
the largest axis label font size on this Chart

getActiveAxisCount

public int getActiveAxisCount()
Gets the active axis count.

Returns:
the active axis count

getAxisCount

public int getAxisCount()
Gets the axis count.

Returns:
the axis count

getAxisLabelVerticalDistance

public int getAxisLabelVerticalDistance()
Gets the vertical distance between two axis labels that are vertically offset to prevent overlap.

Returns:
the axis count

setAxisLabelVerticalDistance

public void setAxisLabelVerticalDistance(int axisLabelVerticalDistance)
Sets the vertical distance between two axis labels that are vertically offset to prevent overlap.

Parameters:
axisLabelVerticalDistance - the vertical axis label distance

isVerticallyOffsetAxisLabels

public boolean isVerticallyOffsetAxisLabels()
Checks, whether axis labels should be vertically offset.

Returns:
true, if axis labels should be vertically offset

setVerticallyOffsetAxisLabels

public void setVerticallyOffsetAxisLabels(boolean verticallyOffsetAxisLabels)
Sets whether axis labels should be vertically offset.

Parameters:
verticallyOffsetAxisLabels - specifies whether designs should be shown

addAxis

public void addAxis(Axis axis)
Adds the axis.

Parameters:
axis - the axis

addAxis

public void addAxis(int index,
                    Axis axis)
Adds an Axis at the position index.

Parameters:
index - the index where the Axis should be added
axis - the Axis to be added

removeAxis

public void removeAxis(int index)
Removes the axis with index index.

Parameters:
index - the index of the Axis to be removed

removeAxis

public void removeAxis(java.lang.String parameterName)
Removes the axis with name name.

Parameters:
parameterName - the name of the parameter for which the Axis should be removed

moveAxis

public void moveAxis(int oldIndex,
                     int newIndex)
Function to reorder the axes in the chart

Parameters:
oldIndex - the index of the axis to be moved
newIndex - the target index for the axis to be moved

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

getDesignLabelFontSize

public int getDesignLabelFontSize()
Gets the design label font size.

Returns:
the design label font size

setDesignLabelFontSize

public void setDesignLabelFontSize(int designLabelFontSize)
Sets the design label font size.

Parameters:
designLabelFontSize - the new design label font size

getLineThickness

public int getLineThickness()
Gets the line thickness.

Returns:
the line thickness

setLineThickness

public void setLineThickness(int lineThickness)
Sets the line thickness.

Parameters:
lineThickness - the new line thickness

getDesignColor

public java.awt.Color getDesignColor(Design design,
                                     boolean designActive)
Gets the design color.

Parameters:
design - the design
designActive - the design active
Returns:
the design color

getDesignLineThickness

public int getDesignLineThickness(Design design)
Gets the design line thickness.

Parameters:
design - the design
Returns:
the design color

getDefaultDesignColor

public java.awt.Color getDefaultDesignColor(boolean designActive)
Gets the default design color.

Parameters:
designActive - the design active
Returns:
the default design color

setActiveDesignColor

public void setActiveDesignColor(java.awt.Color activeDesignColor)
Sets the active design color.

Parameters:
activeDesignColor - the new active design color

setFilteredDesignColor

public void setFilteredDesignColor(java.awt.Color filteredDesignColor)
Sets the filtered design color.

Parameters:
filteredDesignColor - the new filtered design color

getBackGroundColor

public java.awt.Color getBackGroundColor()
Gets the back ground color.

Returns:
the back ground color

setBackGroundColor

public void setBackGroundColor(java.awt.Color backGroundColor)
Sets the back ground color.

Parameters:
backGroundColor - the new back ground color

isShowDesignIDs

public boolean isShowDesignIDs()
Checks if design IDs should be shown.

Returns:
true, if design IDs should be shown.

setShowDesignIDs

public void setShowDesignIDs(boolean showDesignIDs)
Specifies whether design IDs should be shown.

Parameters:
showDesignIDs - Specifies whether design IDs should be shown.

isShowFilteredDesigns

public boolean isShowFilteredDesigns()
Checks whether filtered designs should be shown.

Returns:
true, if filtered designs should be shown.

setShowFilteredDesigns

public void setShowFilteredDesigns(boolean showFilteredDesigns)
Specifies whether filtered designs should be shown.

Parameters:
showFilteredDesigns - specifies whether filtered designs should be shown.

getFilterColor

public java.awt.Color getFilterColor()
Gets the filter color.

Returns:
the filter color

setFilterColor

public void setFilterColor(java.awt.Color filterColor)
Sets the filter color.

Parameters:
filterColor - the new filter color

getTopMargin

public int getTopMargin()
Gets the top margin.

Returns:
the top margin

resetDisplaySettingsToDefault

public void resetDisplaySettingsToDefault()
Reset display settings to default.


getFilterHeight

public int getFilterHeight()
Gets the filter height.

Returns:
the filter height

setFilterHeight

public void setFilterHeight(int filterHeight)
Sets the filter height.

Parameters:
filterHeight - the new filter height

getFilterWidth

public int getFilterWidth()
Gets the filter width.

Returns:
the filter width

setFilterWidth

public void setFilterWidth(int filterWidth)
Sets the filter width.

Parameters:
filterWidth - the new filter width

applyAllFilters

public void applyAllFilters()
Apply all filters.


autofitAllAxes

public void autofitAllAxes()
Autofits all axes.


evaluateBoundsForAllDesigns

public void evaluateBoundsForAllDesigns()
Evaluate Axis bounds for all designs.

See Also:
DataSheet

getSize

public java.awt.Dimension getSize()
Gets the size of this Chart.

Returns:
the size of this Chart.

setSize

public void setSize(java.awt.Dimension size)
Sets the size of this Chart..

Parameters:
size - the new size of this Chart.

getLocation

public java.awt.Point getLocation()
Gets the location of this Chart on the Screen.

Returns:
the location of this Chart on the Screen.

setLocation

public void setLocation(java.awt.Point location)
Sets the location of this Chart on the Screen..

Parameters:
location - the new location of this Chart on the Screen.