public class ColorBar extends TextComponentBase
TextComponentBase.HorizontalAlignment, TextComponentBase.VerticalAlignmentModelComponent.FilePathSaveType, ModelComponent.NavpanelVisibility| Modifier and Type | Field and Description |
|---|---|
static int |
defaultBarDivisions |
static ColorMapBase |
defaultColorMap |
static TextComponentBase.HorizontalAlignment |
defaultHAlignment |
static boolean |
defaultHorizontal |
static DoubleInterval |
defaultInterval |
static Rectangle2d |
defaultLoc |
static java.lang.String |
defaultNumberFormat |
static Vector2d |
defaultTextOffset |
static double |
defaultTextSize |
static Vector2d |
defaultTickFraction |
static TextComponentBase.VerticalAlignment |
defaultVAlignment |
static PropertyList |
myProps |
static AxisAngle |
ROT_Z_270 |
defaultFont, defaultFontName, defaultFontSizeenforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNamesTRANSPARENT, TWO_DIMENSIONAL| Constructor and Description |
|---|
ColorBar() |
ColorBar(ColorMapBase cmap) |
| Modifier and Type | Method and Description |
|---|---|
RenderObject |
buildRenderObject(int divisions,
ColorMap cmap,
VectorNd labelPos,
Vector2d tickWidths) |
RenderProps |
createRenderProps()
Factory method to create render properties appropriate to this object.
|
static RenderProps |
defaultRenderProps(HasProperties host) |
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
void |
getColor(double value,
double[] rgb) |
ColorMapBase |
getColorMap() |
PropertyMode |
getColorMapMode() |
VectorNd |
getLabelPositions() |
java.util.ArrayList<java.lang.String> |
getLabels() |
java.lang.String |
getLabelSet() |
Rectangle2d |
getLocation()
Rectangular location (x,y,width,height) of color bar.
|
NumberFormat |
getNumberFormat() |
java.lang.String |
getNumberFormatString() |
int |
getRenderHints()
Returns a bit code giving rendering hints about this renderable.
|
Vector2d |
getTextOffset() |
Vector2d |
getTickFraction() |
DoubleInterval |
getValueRange() |
boolean |
isHorizontal() |
void |
parseLabelSet(java.lang.String str) |
int |
parseNext(char[] carray,
int idx,
java.util.ArrayList<java.lang.String> parsed) |
void |
populateLabels(double minVal,
double maxVal,
int nSections) |
void |
populateLabels(double minVal,
double maxVal,
int nSections,
NumberFormat fmt) |
void |
prerender(RenderList list)
Called prior to rendering to allow this object to update the internal
state required for rendering (such as by caching rendering coordinates).
|
void |
render(Renderer renderer,
int flags)
Render this object using the functionality of the supplied
Renderer. |
void |
setColorMap(ColorMapBase colorMap) |
void |
setColorMapMode(PropertyMode mode) |
void |
setHorizontal(boolean set) |
void |
setHorizontalAlignment(TextComponentBase.HorizontalAlignment hAlignment)
Sets the horizontal alignment, one of
LEFT, CENTRE, RIGHT |
void |
setLabel(int idx,
java.lang.String text) |
void |
setLabelPositions(VectorNd pos) |
void |
setLabels(java.util.ArrayList<java.lang.String> text) |
void |
setLabels(VectorNd tickLocs,
java.util.ArrayList<java.lang.String> labels) |
void |
setLocation(double x,
double y,
double w,
double h)
Rectangular location (x,y,width,height) of color bar.
|
void |
setLocation(Rectangle2d pos)
Rectangular location (x,y,width,height) of color bar.
|
void |
setNumberFormat(NumberFormat fmt) |
void |
setNumberFormat(java.lang.String fmtStr) |
void |
setNumberFormatString(java.lang.String fmt) |
void |
setTextOffset(Vector2d offset) |
void |
setTickFraction(Vector2d frac) |
void |
setValueRange(double min,
double max) |
void |
setValueRange(DoubleInterval range) |
void |
setVerticalAlignment(TextComponentBase.VerticalAlignment vAlignment)
If bar is horizontal, then places text at supplied alignment location.
|
void |
updateLabels() |
void |
updateLabels(double minVal,
double maxVal) |
void |
updateLabels(double minVal,
double maxVal,
NumberFormat fmt) |
void |
updateLabels(NumberFormat fmt) |
getFont, getHorizontalAlignment, getTextSize, getVerticalAlignment, isSelectable, numSelectionQueriesNeeded, setFont, setTextColor, setTextSizecopy, defaultRenderPropsAreNull, getRenderProps, getSelection, isVisible, setRenderProps, setVisible, updateBounds, updateRenderPropscheckFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferencesgetPropertygetChildren, hasChildrenpostscanisWritable, writepublic static final AxisAngle ROT_Z_270
public static Rectangle2d defaultLoc
public static Vector2d defaultTickFraction
public static double defaultTextSize
public static Vector2d defaultTextOffset
public static java.lang.String defaultNumberFormat
public static TextComponentBase.VerticalAlignment defaultVAlignment
public static TextComponentBase.HorizontalAlignment defaultHAlignment
public static DoubleInterval defaultInterval
public static ColorMapBase defaultColorMap
public static int defaultBarDivisions
public static boolean defaultHorizontal
public static PropertyList myProps
public ColorBar()
public ColorBar(ColorMapBase cmap)
public PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class TextComponentBasepublic static RenderProps defaultRenderProps(HasProperties host)
public RenderProps createRenderProps()
HasRenderPropscreateRenderProps in interface HasRenderPropscreateRenderProps in class TextComponentBasepublic RenderObject buildRenderObject(int divisions, ColorMap cmap, VectorNd labelPos, Vector2d tickWidths)
public void prerender(RenderList list)
IsRenderablelist.addIfVisible (obj);
for each of the objects in question.prerender in interface IsRenderableprerender in class RenderableComponentBaselist - list of objects to be renderedpublic void render(Renderer renderer, int flags)
IsRenderableRenderer.render in interface IsRenderablerender in class RenderableComponentBaserenderer - provides the functionality used to perform the rendering.flags - flags that may be used to control different
aspects of the rendering. Flags are defined in Renderer
and currently include
Renderer.HIGHLIGHT and
Renderer.SORT_FACES.public int getRenderHints()
IsRenderableTRANSPARENT and
TWO_DIMENSIONAL.getRenderHints in interface IsRenderablegetRenderHints in class RenderableComponentBasepublic Rectangle2d getLocation()
public void setLocation(double x,
double y,
double w,
double h)
x - lefty - bottomw - widthh - heightpublic void setLocation(Rectangle2d pos)
pos - locationpublic boolean isHorizontal()
public void setHorizontal(boolean set)
public ColorMapBase getColorMap()
public void setColorMap(ColorMapBase colorMap)
public PropertyMode getColorMapMode()
public void setColorMapMode(PropertyMode mode)
public VectorNd getLabelPositions()
public void setLabelPositions(VectorNd pos)
public void setLabels(java.util.ArrayList<java.lang.String> text)
public java.util.ArrayList<java.lang.String> getLabels()
public void setLabel(int idx,
java.lang.String text)
public void parseLabelSet(java.lang.String str)
public int parseNext(char[] carray,
int idx,
java.util.ArrayList<java.lang.String> parsed)
public java.lang.String getLabelSet()
public void setTickFraction(Vector2d frac)
public Vector2d getTickFraction()
public Vector2d getTextOffset()
public void setTextOffset(Vector2d offset)
public void setLabels(VectorNd tickLocs, java.util.ArrayList<java.lang.String> labels)
public void populateLabels(double minVal,
double maxVal,
int nSections,
NumberFormat fmt)
public void updateLabels(NumberFormat fmt)
public void updateLabels()
public void getColor(double value,
double[] rgb)
public void updateLabels(double minVal,
double maxVal,
NumberFormat fmt)
public void updateLabels(double minVal,
double maxVal)
public void populateLabels(double minVal,
double maxVal,
int nSections)
public void setValueRange(DoubleInterval range)
public void setValueRange(double min,
double max)
public DoubleInterval getValueRange()
public void setHorizontalAlignment(TextComponentBase.HorizontalAlignment hAlignment)
TextComponentBaseLEFT, CENTRE, RIGHTsetHorizontalAlignment in class TextComponentBasepublic void setVerticalAlignment(TextComponentBase.VerticalAlignment vAlignment)
setVerticalAlignment in class TextComponentBasepublic void setNumberFormatString(java.lang.String fmt)
public java.lang.String getNumberFormatString()
public void setNumberFormat(NumberFormat fmt)
public void setNumberFormat(java.lang.String fmtStr)
public NumberFormat getNumberFormat()