|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.Coloring
public class Coloring
This class keeps coloring information for items which can be colored when values
are displayed in a client application. Color values are calculated by a
ColorGenerator
based on this coloring information and the colors
specified by user settings.
ColorGenerator
Field Summary | |
---|---|
private ColoringData |
data
|
private AccessControlled |
item
|
Constructor Summary | |
---|---|
Coloring()
Create a new independent coloring object. |
|
Coloring(ColoringData data,
AccessControlled item)
Create Coloring object which links to an existing item. |
Method Summary | |
---|---|
void |
checkPermission(Permission permission)
Check if the logged in user has the desired permission on the item, otherwise throw an exception. |
Float |
getMaxValue()
Get the value that represents the maximum value. |
Float |
getMidValue()
Get the value that represents the midpoint value. |
Float |
getMinValue()
Get the value that represents the minimum value. |
Set<Permission> |
getPermissions()
Get the logged in user's permissions on the item. |
boolean |
hasPermission(Permission permission)
Check if the logged in user has the desired permission on the item. |
boolean |
isLogarithmic()
If we should take the logarithm of values before the color is generated or not. |
boolean |
isUsingColors()
If this item should be colored or not. |
void |
setLogarithmic(boolean logarithmic)
Specify if we should take the logarithm of values before the color is generated or not. |
void |
setMaxValue(Float maxValue)
Set the value that represents the maximum value. |
void |
setMidValue(Float midValue)
Set the value that represents the midpoint value. |
void |
setMinValue(Float minValue)
Set the value that represents the minimum value. |
void |
setUsingColors(boolean useColors)
Specifiy if colors should be used when displaying values for this item or not. |
(package private) void |
validate()
Check that all values has been specified and that minValue <= midValue >= maxValue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final ColoringData data
private final AccessControlled item
Constructor Detail |
---|
Coloring(ColoringData data, AccessControlled item)
data
- The coloring dataitem
- The access controlled itempublic Coloring()
Method Detail |
---|
public void checkPermission(Permission permission) throws PermissionDeniedException
AccessControlled
checkPermission
in interface AccessControlled
permission
- Permission the user should have.
PermissionDeniedException
- If the user doesn't have the
requested permissionpublic Set<Permission> getPermissions()
AccessControlled
getPermissions
in interface AccessControlled
public boolean hasPermission(Permission permission)
AccessControlled
hasPermission
in interface AccessControlled
permission
- The permission to check if the user has.
void validate() throws InvalidDataException
InvalidDataException
public boolean isUsingColors()
public void setUsingColors(boolean useColors)
useColors
- TRUE to use colors, FALSE otherwisepublic boolean isLogarithmic()
public void setLogarithmic(boolean logarithmic)
logarithmic
- TRUE to calculate the logarithm, FALSE to leave the value as ispublic Float getMinValue()
public void setMinValue(Float minValue)
minValue
- Value to set.public Float getMidValue()
public void setMidValue(Float midValue)
midValue
- The midpoint valuepublic Float getMaxValue()
public void setMaxValue(Float maxValue)
maxValue
- The value to set.
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |