com.tensegrity.composite.coordinate
Interface CategoryScale

All Superinterfaces:
Scale
All Known Subinterfaces:
MutableCategoryScale
All Known Implementing Classes:
DefaultCategoryScale, DefaultMutableCategoryScale, DefaultMutableTableCellCategoryScale

public interface CategoryScale
extends Scale

A CategoryScale is a specialization of the Scale interface. Therefore it is necessary to read the documentation of the Scale interface to have an understanding of the basics for a Scale.

A CategoryScale represents a non linear Scale. Non linear scale means that a value is not translated in a linear way into or out of the range of the CategoryScale.

The ScaleCateogry is separated into category ranges. Each category range can have its settings. The settings for the category range are accessible through a call to getCategories().
For more informations on a CategoryRange please have a look at the documentation of the CategoryRange interface.

Version:
$Id: CategoryScale.java,v 1.5 2005/04/01 15:45:16 MichaelKegel Exp $
Author:
MichaelRaue

Field Summary
 
Fields inherited from interface com.tensegrity.composite.coordinate.Scale
TYPE_LINEAR
 
Method Summary
 java.util.List getCategories()
          Returns a List with the CategoryRanges the CategoryScale provides.
 int getWidth(int cat)
          Returns the width of the category at index cat.
 int getWidth(int from, int to)
          Returns the single width of the category range at the given index.
 int getWidthSum(int to)
          Returns the sum of all category ranges from the left side of the given index to.
 
Methods inherited from interface com.tensegrity.composite.coordinate.Scale
deepCopy, descale, getDescaleFactor, getScaleFactor, getScaleMaximum, getScaleMinimum, getScaleRange, scale
 

Method Detail

getCategories

public java.util.List getCategories()
Returns a List with the CategoryRanges the CategoryScale provides.

Returns:
List of the CategoryRanges

getWidth

public int getWidth(int cat)
Returns the width of the category at index cat.

Parameters:
cat - the index of the CategoryRange to query.
Returns:
the width of the CategoryRange at the given index.

getWidth

public int getWidth(int from,
                    int to)
Returns the single width of the category range at the given index.

Parameters:
from - the start index.
to - the stop index.
Returns:
the single width of the category range at the given index.

getWidthSum

public int getWidthSum(int to)
Returns the sum of all category ranges from the left side of the given index to.

Parameters:
to - the index up to set the sum should be builded.
Returns:
the sum of all category ranges from the left side of to.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.