com.tensegrity.composite.coordinate
Class DefaultMutableTableCellCategoryScale

java.lang.Object
  extended bycom.tensegrity.composite.coordinate.DefaultCategoryScale
      extended bycom.tensegrity.composite.coordinate.DefaultMutableTableCellCategoryScale
All Implemented Interfaces:
CategoryScale, MutableCategoryScale, MutableScale, Scale

public class DefaultMutableTableCellCategoryScale
extends DefaultCategoryScale
implements MutableCategoryScale

Mutable version of class DefaultCategoryScale. For detailed information have a look at interface MutableCategoryScale.

Version:
$Id: DefaultMutableTableCellCategoryScale.java,v 1.1 2005/08/22 12:32:20 BurkhardWick Exp $
Author:
MichaelRaue

Field Summary
 
Fields inherited from class com.tensegrity.composite.coordinate.DefaultCategoryScale
categories
 
Fields inherited from interface com.tensegrity.composite.coordinate.Scale
TYPE_LINEAR
 
Constructor Summary
DefaultMutableTableCellCategoryScale(CategoryScale scaleCategory)
          Constructor to alter the given CategoryScale to a mutable one.
DefaultMutableTableCellCategoryScale(double scaleMinimum, double scaleMaximum)
          Constructor specifying the minimum / maximum value for the scale and the number of items to be lay out on it.
 
Method Summary
 Scale deepCopy()
          Method to deep copy this scale instance.
 CategoryRange getCategoryRangeAt(int index)
          Returns the CategoryRange at the given index.
 void insertCategoryRangeAt(int index, int width)
          Inserts a new CategoryRange with width width at location index.
 boolean removeCategoryRangeAt(int index)
          Removes the CategoryRange located at position index.
 void setCategories(java.util.List categories)
          Sets the List of CategoryRanges given by categories as the new CategoryRanges this MutableCategoryScale provides.
 void setCategoryRange(CategoryRange rangeNew)
          Adds the CategoryRange given by range to the CategoryRanges this MutableCategoryScale provides.
 void setScaleMaximum(double maximumScale)
          Sets the maximum value for this scale.
 void setScaleMinimum(double minimumScale)
          Sets the minimum value for this scale.
 void setScaleRange(double minimumScale, double maximumScale)
          Sets the range of this scale by specifying a minumum and a maximum value.
 
Methods inherited from class com.tensegrity.composite.coordinate.DefaultCategoryScale
descale, equals, getCategories, getDescaleFactor, getScaleFactor, getScaleMaximum, getScaleMinimum, getScaleRange, getWidth, getWidth, getWidthSum, hashCode, scale, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.tensegrity.composite.coordinate.CategoryScale
getCategories, getWidth, getWidth, getWidthSum
 
Methods inherited from interface com.tensegrity.composite.coordinate.Scale
descale, getDescaleFactor, getScaleFactor, getScaleMaximum, getScaleMinimum, getScaleRange, scale
 

Constructor Detail

DefaultMutableTableCellCategoryScale

public DefaultMutableTableCellCategoryScale(double scaleMinimum,
                                            double scaleMaximum)
Constructor specifying the minimum / maximum value for the scale and the number of items to be lay out on it.

Parameters:
scaleMinimum - the minimum value for the scale.
scaleMaximum - the maximum value for the scale.

DefaultMutableTableCellCategoryScale

public DefaultMutableTableCellCategoryScale(CategoryScale scaleCategory)
Constructor to alter the given CategoryScale to a mutable one.

Parameters:
scaleCategory - the immutable source scale-category.
Method Detail

setCategoryRange

public void setCategoryRange(CategoryRange rangeNew)
Description copied from interface: MutableCategoryScale
Adds the CategoryRange given by range to the CategoryRanges this MutableCategoryScale provides. If the new CategoryRange overlaps or lies within other CategoryRanges these will be adjusted so that that no overlapping occurs.

Specified by:
setCategoryRange in interface MutableCategoryScale
Parameters:
rangeNew - the CategoryRange to add

setCategories

public void setCategories(java.util.List categories)
Description copied from interface: MutableCategoryScale
Sets the List of CategoryRanges given by categories as the new CategoryRanges this MutableCategoryScale provides.

Specified by:
setCategories in interface MutableCategoryScale
Parameters:
categories - the List of new CategoryRanges

removeCategoryRangeAt

public boolean removeCategoryRangeAt(int index)
Description copied from interface: MutableCategoryScale
Removes the CategoryRange located at position index.

Specified by:
removeCategoryRangeAt in interface MutableCategoryScale
Parameters:
index - the insert location.
Returns:
true if the removal was successful.

insertCategoryRangeAt

public void insertCategoryRangeAt(int index,
                                  int width)
Description copied from interface: MutableCategoryScale
Inserts a new CategoryRange with width width at location index. The new CategoryRange starts and ends at index.

Specified by:
insertCategoryRangeAt in interface MutableCategoryScale
Parameters:
index - the insert location.
width - the width of the inserted CategoryRange.

getCategoryRangeAt

public CategoryRange getCategoryRangeAt(int index)
Description copied from interface: MutableCategoryScale
Returns the CategoryRange at the given index. The returned CategoryRange can start on the left of index and end on the right of index.

Specified by:
getCategoryRangeAt in interface MutableCategoryScale
Parameters:
index - the index.
Returns:
the CategoryRange at the given index.

setScaleMinimum

public void setScaleMinimum(double minimumScale)
Description copied from interface: MutableScale
Sets the minimum value for this scale.

Specified by:
setScaleMinimum in interface MutableScale
Parameters:
minimumScale - the value ti set as a minimum.

setScaleMaximum

public void setScaleMaximum(double maximumScale)
Description copied from interface: MutableScale
Sets the maximum value for this scale.

Specified by:
setScaleMaximum in interface MutableScale
Parameters:
maximumScale - the value ti set as a maximum.

setScaleRange

public void setScaleRange(double minimumScale,
                          double maximumScale)
Description copied from interface: MutableScale
Sets the range of this scale by specifying a minumum and a maximum value.

Specified by:
setScaleRange in interface MutableScale
Parameters:
minimumScale - the minimum value for this scale.
maximumScale - the maximum value for this scale.

deepCopy

public Scale deepCopy()
Description copied from interface: Scale
Method to deep copy this scale instance.

Specified by:
deepCopy in interface Scale
Overrides:
deepCopy in class DefaultCategoryScale


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