ChartCat 1.2

li.netcat.chart.data
Class DefaultStackModel

java.lang.Object
  extended byli.netcat.chart.data.AbstractChartModelAdapter
      extended byli.netcat.chart.data.DefaultStackModel
All Implemented Interfaces:
ChartModelAdapter, StackModel

public class DefaultStackModel
extends AbstractChartModelAdapter
implements StackModel

Default implementation of the StackModel interface.

Author:
Arthur Marxer

Field Summary
static int STACK_STRATEGY_APPEND
          Equal to ChartConstants.STACK_STRATEGY_APPEND
static int STACK_STRATEGY_GROUP
          Equal to ChartConstants.STACK_STRATEGY_GROUP
static int STACK_TYPE_NOT_STACKED
          Equal to ChartConstants.STACK_TYPE_NOT_STACKED
static int STACK_TYPE_STACKED
          Equal to ChartConstants.STACK_TYPE_STACKED
static int STACK_TYPE_STACKED_PERCENT
          Equal to ChartConstants.STACK_TYPE_STACKED_PERCENT
 
Constructor Summary
DefaultStackModel(int stackType, int stackStrategy)
          Constructs a new instance of a DefaultStackModel using the given stack type and stack strategy.
 
Method Summary
 void addStackModelListener(StackModelListener listener)
          Adds a stack model listener to the list of listeners.
 int getColumnCount()
          Returns the number of data columns.
 boolean getIncludeZero()
          Returns true if the zero value gets included.
 double getLead(int rowIndex, int columnIndex)
          Returns the lead value of a given data cell.
 double getMaxValue()
          Returns the maximum value of all leads and trails.
 double getMinValue()
          Returns the minimum value of all leads and trails.
 int getRowCount()
          Returns the number of data rows.
 int getStackStrategy()
          Returns the strategy of this stack model.
 int getStackType()
          Returns the type of the stack.
 double getTrail(int rowIndex, int columnIndex)
          Returns the trail value of a given data cell.
 void invalidate()
          Invoked when the underlying model changes.
 boolean isRelative()
          Returns true if the values in this model are in percent.
 boolean isStacked()
          Returns true if the values in this model are stacked.
 void removeStackModelListener(StackModelListener listener)
          Removes a stack model listener from the list of listeners.
 void setIncludeZero(boolean include)
          Specifies, whether to include the zero value or not.
 void setStackStrategy(int stackStrategy)
          Sets the strategy of the stack to the given value.
 void setStackType(int stackType)
          Sets the type of the stack to the given value.
 
Methods inherited from class li.netcat.chart.data.AbstractChartModelAdapter
getChartModel, setChartModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface li.netcat.chart.data.ChartModelAdapter
getChartModel, setChartModel
 

Field Detail

STACK_TYPE_NOT_STACKED

public static final int STACK_TYPE_NOT_STACKED
Equal to ChartConstants.STACK_TYPE_NOT_STACKED

See Also:
Constant Field Values

STACK_TYPE_STACKED

public static final int STACK_TYPE_STACKED
Equal to ChartConstants.STACK_TYPE_STACKED

See Also:
Constant Field Values

STACK_TYPE_STACKED_PERCENT

public static final int STACK_TYPE_STACKED_PERCENT
Equal to ChartConstants.STACK_TYPE_STACKED_PERCENT

See Also:
Constant Field Values

STACK_STRATEGY_APPEND

public static final int STACK_STRATEGY_APPEND
Equal to ChartConstants.STACK_STRATEGY_APPEND

See Also:
Constant Field Values

STACK_STRATEGY_GROUP

public static final int STACK_STRATEGY_GROUP
Equal to ChartConstants.STACK_STRATEGY_GROUP

See Also:
Constant Field Values
Constructor Detail

DefaultStackModel

public DefaultStackModel(int stackType,
                         int stackStrategy)
Constructs a new instance of a DefaultStackModel using the given stack type and stack strategy.

Parameters:
stackType - The type of the stack, specify one of STACK_TYPE_NOT_STACKED, STACK_TYPE_STACKED or STACK_TYPE_STACKED_PERCENT.
stackStrategy - The strategy of the stack, specify one of STACK_STRATEGY_APPEND or STACK_STRATEGY_GROUP.
Method Detail

getStackType

public int getStackType()
Returns the type of the stack.

Returns:
The type of the stack, one of STACK_TYPE_NOT_STACKED, STACK_TYPE_STACKED or STACK_TYPE_STACKED_PERCENT.

setStackType

public void setStackType(int stackType)
Sets the type of the stack to the given value.

Parameters:
stackType - The type of the stack, specify one of STACK_TYPE_NOT_STACKED, STACK_TYPE_STACKED or STACK_TYPE_STACKED_PERCENT.

getStackStrategy

public int getStackStrategy()
Returns the strategy of this stack model.

Returns:
One of STACK_STRATEGY_APPEND, STACK_STRATEGY_GROUP or another custom strategy.

setStackStrategy

public void setStackStrategy(int stackStrategy)
Sets the strategy of the stack to the given value.

Parameters:
stackStrategy - The strategy of the stack, specify one of STACK_STRATEGY_APPEND or STACK_STRATEGY_GROUP.

getIncludeZero

public boolean getIncludeZero()
Returns true if the zero value gets included.

Returns:
true, if the zero value gets included.

setIncludeZero

public void setIncludeZero(boolean include)
Specifies, whether to include the zero value or not.

Parameters:
include - Specify true to include the zero value.

isStacked

public boolean isStacked()
Description copied from interface: StackModel
Returns true if the values in this model are stacked.

Specified by:
isStacked in interface StackModel
Returns:
true if the values in this model are stacked..

isRelative

public boolean isRelative()
Description copied from interface: StackModel
Returns true if the values in this model are in percent.

Specified by:
isRelative in interface StackModel
Returns:
true if the values in this model are in percent.

getMinValue

public double getMinValue()
Description copied from interface: StackModel
Returns the minimum value of all leads and trails.

Specified by:
getMinValue in interface StackModel
Returns:
The minimum value of all leads and trails.

getMaxValue

public double getMaxValue()
Description copied from interface: StackModel
Returns the maximum value of all leads and trails.

Specified by:
getMaxValue in interface StackModel
Returns:
The maximum value of all leads and trails.

getRowCount

public int getRowCount()
Description copied from interface: StackModel
Returns the number of data rows. This value must not necessarily be equal to the number of data rows of the underlying model.

Specified by:
getRowCount in interface StackModel
Returns:
The number of rows.

getColumnCount

public int getColumnCount()
Description copied from interface: StackModel
Returns the number of data columns. This value must not necessarily be equal to the number of data columns of the underlying model.

Specified by:
getColumnCount in interface StackModel
Returns:
The number of rows.

getLead

public double getLead(int rowIndex,
                      int columnIndex)
Description copied from interface: StackModel
Returns the lead value of a given data cell.

Specified by:
getLead in interface StackModel
Parameters:
rowIndex - The index of the row of the underlying cell.
columnIndex - The index of the column of the underlying cell.
Returns:
The lead value or NaN if the underlying cell does not contain a numeric value.

getTrail

public double getTrail(int rowIndex,
                       int columnIndex)
Description copied from interface: StackModel
Returns the trail value of a given data cell.

Specified by:
getTrail in interface StackModel
Parameters:
rowIndex - The index of the row of the underlying cell.
columnIndex - The index of the column of the underlying cell.
Returns:
The lead value or NaN if the underlying cell does not contain a numeric value.

addStackModelListener

public void addStackModelListener(StackModelListener listener)
Description copied from interface: StackModel
Adds a stack model listener to the list of listeners. The listeners are notified whenever a value in this model changes.

Specified by:
addStackModelListener in interface StackModel

removeStackModelListener

public void removeStackModelListener(StackModelListener listener)
Description copied from interface: StackModel
Removes a stack model listener from the list of listeners.

Specified by:
removeStackModelListener in interface StackModel
Parameters:
listener - A listener that has been added.

invalidate

public void invalidate()
Description copied from class: AbstractChartModelAdapter
Invoked when the underlying model changes. Subclasses may override this method and discard all buffered data.

Overrides:
invalidate in class AbstractChartModelAdapter

ChartCat 1.2

Copyright © 2003 - 2005 NetCat Inc.. All rights reserved. Feedback

Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print, Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print, Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print