public class PuColorBar extends PsObject
Optional (if controls are enabled), some textfields appear below the color bar, where the user can change the min/max values for the color range.
There are three representations of values:
<0 or >1
are allowed and lie outside the view of the color bar.Modifier and Type | Field and Description |
---|---|
int |
COLOR_MAP_3COLS
Use PuTripleColorTable as color table.
|
int |
COLOR_MAP_BOOLEAN
Use PuBooleanColorTable as color table.
|
int |
COLOR_MAP_JAVAVIEW
Use PuJvColorTable as color table.
|
int |
INTERP_CONSTANT_LEFT
Interpolation rule.
|
int |
INTERP_CONSTANT_RIGHT
Interpolation rule.
|
int |
INTERP_LINEAR
Interpolation rule.
|
HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS
Constructor and Description |
---|
PuColorBar()
Construct a new ColorBar without controls.
|
PuColorBar(boolean controls)
Construct a new ColorBar.
|
PuColorBar(boolean controls,
boolean allowMark,
boolean allowContextMenu)
Construct a new ColorBar.
|
Modifier and Type | Method and Description |
---|---|
void |
allowContextMenu(boolean allow)
Set whether the context menu is enabled.
|
void |
allowMark(boolean allow)
Set whether the user is allowed to mark regions in the color bar.
|
java.awt.Color |
getBackColor()
Set background color for excluded elements.
|
PuColorBarCanvas |
getCanvas()
Get canvas of color bar.
|
java.awt.Color |
getColor(double value)
Get color of an absolute value.
|
java.awt.Color |
getMarkColor()
Set color for marked elements.
|
void |
init()
If instance has missing name then assign default name 'Object_NUMBER' where
number is the total number of already created instances.
|
boolean |
isContextMenuAllowed()
Whether the context menu is enabled.
|
boolean |
isMarkAllowed()
Whether the user is allowed to mark regions in the color bar.
|
boolean |
isMarked(double value)
Whether an absolute value is marked.
|
void |
setBackColor(java.awt.Color bc)
Set background color for excluded elements.
|
void |
setBounds(double minValue,
double maxValue)
Set minimum and maximum bound for color map.
|
void |
setColorTable(int ind)
Set color map to one of the predefined color maps.
|
void |
setColorTable(PuColorMapIf colorTable)
Set the color table.
|
void |
setEnabled(boolean state) |
void |
setMarkColor(java.awt.Color mc)
Set color for marked elements.
|
void |
setMaxMark(double maxMark)
Set right boundary of marked region in [0, 1].
|
void |
setMaxValue(double maxValue)
Set maximum bound for color map as absolute value.
|
void |
setMinMark(double minMark)
Set left boundary of marked region in [0, 1].
|
void |
setMinValue(double minValue)
Set minimum bound for color map as absolute value.
|
void |
setTransformMax(double transformMax)
Set maximum bound for color map in [0, 1].
|
void |
setTransformMin(double transformMin)
Set minimum bound for color map in [0, 1].
|
double |
transformAbsoluteValueToColorIndex(double value)
Transforms an absolute value to the corresponding position in [0, 1] of the
color in the color map.
|
boolean |
update(java.lang.Object event)
Update all inspector panels, send update to all registered update listeners
and finally update parent.
|
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels
public final int COLOR_MAP_JAVAVIEW
public final int COLOR_MAP_3COLS
public final int COLOR_MAP_BOOLEAN
public final int INTERP_CONSTANT_LEFT
public final int INTERP_CONSTANT_RIGHT
public final int INTERP_LINEAR
public PuColorBar()
public PuColorBar(boolean controls)
controls
- Show controls below the bar.public PuColorBar(boolean controls, boolean allowMark, boolean allowContextMenu)
controls
- Show controls below the bar.allowMark
- Allow marked regions.allowContextMenu
- Allow the context menu.public void init()
public boolean update(java.lang.Object event)
Central update method of this object. Must be overwritten if this class receives unknown events, say, from new children. Any subclass must class invoke super.update(event) on all events it does handle itself.
update
in interface PsUpdateIf
update
in class PsObject
event
- carries a lot of informationPsObject.setParent(jv.object.PsUpdateIf)
,
PsObject.getFather()
,
PsObject.addUpdateListener(jv.object.PsUpdateIf)
public PuColorBarCanvas getCanvas()
public void setTransformMin(double transformMin)
public void setTransformMax(double transformMax)
public void setMinValue(double minValue)
public void setMaxValue(double maxValue)
public void setBounds(double minValue, double maxValue)
public void setMinMark(double minMark)
public void setMaxMark(double maxMark)
public void setColorTable(PuColorMapIf colorTable)
public void setColorTable(int ind)
public void setBackColor(java.awt.Color bc)
public java.awt.Color getBackColor()
public void setMarkColor(java.awt.Color mc)
public java.awt.Color getMarkColor()
public void allowMark(boolean allow)
public boolean isMarkAllowed()
public void allowContextMenu(boolean allow)
public boolean isContextMenuAllowed()
public double transformAbsoluteValueToColorIndex(double value)
public java.awt.Color getColor(double value)
public boolean isMarked(double value)
public void setEnabled(boolean state)
"