public class Coloring extends java.lang.Object implements AccessControlled
ColorGenerator
based on this coloring information and the colors
specified by user settings.ColorGenerator
Modifier and Type | Field and Description |
---|---|
private ColoringData |
data |
private AccessControlled |
item |
Constructor and Description |
---|
Coloring()
Create a new independent coloring object.
|
Coloring(ColoringData data,
AccessControlled item)
Create Coloring object which links to an existing item.
|
Modifier and Type | Method and Description |
---|---|
void |
checkPermission(Permission permission)
Check if the logged in user has the desired permission on
the item, otherwise throw an exception.
|
java.lang.Float |
getMaxValue()
Get the value that represents the maximum value.
|
java.lang.Float |
getMidValue()
Get the value that represents the midpoint value.
|
java.lang.Float |
getMinValue()
Get the value that represents the minimum value.
|
java.util.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(java.lang.Float maxValue)
Set the value that represents the maximum value.
|
void |
setMidValue(java.lang.Float midValue)
Set the value that represents the midpoint value.
|
void |
setMinValue(java.lang.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.
|
private final ColoringData data
private final AccessControlled item
Coloring(ColoringData data, AccessControlled item)
data
- The coloring dataitem
- The access controlled itempublic Coloring()
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 java.util.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 java.lang.Float getMinValue()
public void setMinValue(java.lang.Float minValue)
minValue
- Value to set.public java.lang.Float getMidValue()
public void setMidValue(java.lang.Float midValue)
midValue
- The midpoint valuepublic java.lang.Float getMaxValue()
public void setMaxValue(java.lang.Float maxValue)
maxValue
- The value to set.