com.tensegrity.composite.coordinate
Interface MutableCategoryScale

All Superinterfaces:
CategoryScale, MutableScale, Scale
All Known Implementing Classes:
DefaultMutableCategoryScale, DefaultMutableTableCellCategoryScale

public interface MutableCategoryScale
extends CategoryScale, MutableScale

The MutableCategoryScale is a specialization of the CategoryScale interface and the MutableScale interface. Therefore it is neccessary to read the documentation of the CategoryScale interface and the MutableScale interface in order to have an understanding of the basics for a CategoryScale and a MutableScale.

Since a CategoryScale is immutable but mutable category scales are also needed this class represents such a MutableCategoryScale.

In contrast to a CategoryScale for a MutableCategoryScale it is possible to modify the settings of each CategoryRange. The methods a MutableCategoryScale provides to do so are as follows:

Version:
$Id: MutableCategoryScale.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
 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 range)
          Adds the CategoryRange given by range to the CategoryRanges this MutableCategoryScale provides.
 
Methods inherited from interface com.tensegrity.composite.coordinate.CategoryScale
getCategories, getWidth, getWidth, getWidthSum
 
Methods inherited from interface com.tensegrity.composite.coordinate.Scale
deepCopy, descale, getDescaleFactor, getScaleFactor, getScaleMaximum, getScaleMinimum, getScaleRange, scale
 
Methods inherited from interface com.tensegrity.composite.coordinate.MutableScale
setScaleMaximum, setScaleMinimum, setScaleRange
 

Method Detail

setCategoryRange

public void setCategoryRange(CategoryRange range)
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.

Parameters:
range - the CategoryRange to add

setCategories

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

Parameters:
categories - the List of new CategoryRanges

getCategoryRangeAt

public CategoryRange getCategoryRangeAt(int index)
Returns the CategoryRange at the given index. The returned CategoryRange can start on the left of index and end on the right of index.

Parameters:
index - the index.
Returns:
the CategoryRange at the given index.

insertCategoryRangeAt

public void insertCategoryRangeAt(int index,
                                  int width)
Inserts a new CategoryRange with width width at location index. The new CategoryRange starts and ends at index.

Parameters:
index - the insert location.
width - the width of the inserted CategoryRange.

removeCategoryRangeAt

public boolean removeCategoryRangeAt(int index)
Removes the CategoryRange located at position index.

Parameters:
index - the insert location.
Returns:
true if the removal was successful.


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