Class TLspIndexColorModelStyle
- All Implemented Interfaces:
ILspStyler
Builder
design pattern mechanism.
- Since:
- 2012.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder for index color model styles. -
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a new style with the properties that are set on the builder -
Method Summary
Modifier and TypeMethodDescriptionCreates a new builder initialized with all the properties of this style.boolean
Gets the index color model.float
Returns the scale factor with which values are multiplied prior to looking them up in the color model.int
hashCode()
boolean
Determines whether this style is transparent.static TLspIndexColorModelStyle.Builder
<?> Creates a new builder with the default values.Methods inherited from class com.luciad.view.lightspeed.style.ALspStyle
addStyleChangeListener, getZOrder, isCompatible, removeStyleChangeListener, style
-
Constructor Details
-
TLspIndexColorModelStyle
Creates a new style with the properties that are set on the builder- Parameters:
aBuilder
- a builder which will be used to initialize this style.
-
-
Method Details
-
newBuilder
Creates a new builder with the default values.- Returns:
- the new builder.
-
asBuilder
Creates a new builder initialized with all the properties of this style. -
isTransparent
public boolean isTransparent()Description copied from class:ALspStyle
Determines whether this style is transparent. Shapes that are transparent can be painted in a different paint phase than shapes that are not transparent.- Specified by:
isTransparent
in classALspStyle
- Returns:
- whether or not this style is transparent
-
getIndexColorModel
Gets the index color model. Should never benull
. This indexed color model should never be modified. To change the indexed color model you should create a new style with a different indexed color model instance.- Returns:
- the index color model
-
getScaleFactor
public float getScaleFactor()Returns the scale factor with which values are multiplied prior to looking them up in the color model.Example use-case:
Assume you want to visualize a density plot for a layer containing cities, each represented by a point. The density should be based on the population of the city: cities with a large population should have a larger contribution to the density plot compared to cities with a small population.
This can be done by associating a weight to each city, based on the population. However, the weight should be a factor between 0 and 1. We could for example use as weight:
city population / max population in the dataset
.If you want to use a color model which maps population values onto colors (and not the weighted values), you can use this method to rescale the weights back to populations. In this example, the scale factor would be
max population in the dataset
.- Returns:
- the scale factor
- Since:
- 2017.1
- See Also:
-
equals
-
hashCode
public int hashCode()
-