public class ColorBar extends TextComponentBase
TextComponentBase.HorizontalAlignment, TextComponentBase.VerticalAlignment
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, defaultFontSize
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TRANSPARENT, 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, setTextSize
copy, defaultRenderPropsAreNull, getRenderProps, getSelection, isVisible, setRenderProps, setVisible, updateBounds, updateRenderProps
checkFlag, 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, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
getChildren, hasChildren
postscan
isWritable, write
public 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()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class TextComponentBase
public static RenderProps defaultRenderProps(HasProperties host)
public RenderProps createRenderProps()
HasRenderProps
createRenderProps
in interface HasRenderProps
createRenderProps
in class TextComponentBase
public RenderObject buildRenderObject(int divisions, ColorMap cmap, VectorNd labelPos, Vector2d tickWidths)
public void prerender(RenderList list)
IsRenderable
list.addIfVisible (obj);
for each of the objects in question.prerender
in interface IsRenderable
prerender
in class RenderableComponentBase
list
- list of objects to be renderedpublic void render(Renderer renderer, int flags)
IsRenderable
Renderer
.render
in interface IsRenderable
render
in class RenderableComponentBase
renderer
- 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()
IsRenderable
TRANSPARENT
and
TWO_DIMENSIONAL
.getRenderHints
in interface IsRenderable
getRenderHints
in class RenderableComponentBase
public 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)
TextComponentBase
LEFT, CENTRE, RIGHT
setHorizontalAlignment
in class TextComponentBase
public void setVerticalAlignment(TextComponentBase.VerticalAlignment vAlignment)
setVerticalAlignment
in class TextComponentBase
public 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()