Package ucar.unidata.idv.control.chart
Class LineState
java.lang.Object
ucar.unidata.idv.control.chart.LineState
Holds graphics state
- Version:
- $Revision: 1.23 $
- Author:
- IDV Development Team
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Color[]The array of colors we cycle throughstatic String[]vertical position labelsstatic final inthorizontal position valuestatic final inthorizontal position valuestatic final inthorizontal position valuestatic final inthorizontal position valuestatic int[]horizontal positionsprotected intindexstatic final intUseful constant for specifying the type of rendering (area only).static final intUseful constant for specifying the type of rendering (area and shapes).static final intline typestatic final int[]line typesstatic final String[]line type labelsstatic final intUseful constant for specifying the type of rendering (lines only).static final intline typestatic final intUseful constant for specifying the type of rendering (shapes and lines).static final intshape typestatic final intshape typestatic String[]shape namesstatic final intshape typestatic final intshape typestatic final intshape typestatic final intshape typestatic final intshape typestatic int[]shape typesstatic final intwhich side in legendstatic final intwhich side in legendstatic final intwhich side in legendstatic final String[]which side in legendstatic final int[]which side in legendstatic final intStroke typestatic final intStroke typestatic final intStroke typestatic final int[]Stroke typesstatic final String[]Stroke type labelsstatic final intStroke typeprotected Unitdisplay unitstatic final intvertical position valuestatic String[]horizontal position labelsstatic final intvertical position valuestatic final intvertical position valuestatic final intvertical position valuestatic int[]vertical positions -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanApply propertiesGet the AxisLabel property.booleanGet the AxisVisible property.Get the ChartName property.getColor()Get the Color property.getColor(int index) if we have a color then return it.static ColorgetFixedColor(int index) Utility to get a color in the static list of colorsintGet the HorizontalPosition property.intGet the LineType property.getName()Get the Name property.Get the NameMacro property.get the shape we use to paintprotected JComponentCreate the properties contentsprotected JComponentgetPropertyContents(boolean full, List chartNames, List sampleRanges) Create the properties contentsgetRange()Get the Range property.booleanGet the RangeIncludesZero property.intgetShape()Get the Shape property.intgetSide()Get the Side property.Create a strokeintGet the StrokeType property.getTimes()Get the list of timesgetUnit()Get the unit.booleanGet the UseLogarithmicRange property.booleanGet the UseVertical property.booleangetValid()Get the Valid property.Get the list of valuesintGet the VerticalPosition property.booleanGet the Visible property.booleanGet the VisibleInLegend property.floatgetWidth()Get the Width property.booleanhasName()Does this linestate have a name definedstatic BasicStrokemakeStroke(float width, int type) create a strokevoidsetAxisLabel(String value) Set the AxisLabel property.voidsetAxisVisible(boolean value) Set the AxisVisible property.voidsetChartName(String value) Set the chart name property.voidSet the Color property.voidsetHorizontalPosition(int value) Set the HorizontalPosition property.voidsetLineType(int value) Set the LineType property.voidSet the Name property.voidsetNameIfNeeded(String value) Set the name if neededvoidsetNameMacro(String value) Set the NameMacro property.voidSet the Range property.voidsetRangeIncludesZero(boolean value) Set the RangeIncludesZero property.voidapply range to guivoidsetShape(int value) Set the Shape property.voidsetSide(int value) Set the Side property.voidsetStrokeType(int value) Set the StrokeType property.voidsetStrokeType(Integer value) set strokevoidSet the track with a list of times and valuesvoidsetUseLogarithmicRange(boolean value) Set the UseLogarithmicRange property.voidsetUseVerticalPosition(boolean value) Set the UseVertical property.voidsetValid(boolean value) Set the Valid property.voidsetVerticalPosition(int value) Set the VerticalPosition property.voidsetVisible(boolean value) Set the Visible property.voidsetVisibleInLegend(boolean value) Set the VisibleInLegend property.voidsetWidth(float value) Set the Width property.booleanshowPropertiesDialog(PropertyChangeListener propListener, boolean doVisible, boolean doRange, List chartNames, List sampleRanges) show dialogbooleanshowPropertiesDialog(PropertyChangeListener listener, List chartNames, List ranges) show dialogvoidshowRangePopup(List ranges) popup range menu
-
Field Details
-
VPOS_TOP
public static final int VPOS_TOPvertical position value- See Also:
-
VPOS_MIDDLE
public static final int VPOS_MIDDLEvertical position value- See Also:
-
VPOS_BOTTOM
public static final int VPOS_BOTTOMvertical position value- See Also:
-
VPOS_NONE
public static final int VPOS_NONEvertical position value- See Also:
-
HPOS_LEFT
public static final int HPOS_LEFThorizontal position value- See Also:
-
HPOS_MIDDLE
public static final int HPOS_MIDDLEhorizontal position value- See Also:
-
HPOS_RIGHT
public static final int HPOS_RIGHThorizontal position value- See Also:
-
HPOS_NONE
public static final int HPOS_NONEhorizontal position value- See Also:
-
VPOS_VALUES
public static int[] VPOS_VALUESvertical positions -
VPOS_LABELS
horizontal position labels -
HPOS_VALUES
public static int[] HPOS_VALUEShorizontal positions -
HPOS_LABELS
vertical position labels -
LINETYPE_SHAPES
public static final int LINETYPE_SHAPESline type- See Also:
-
LINETYPE_LINES
public static final int LINETYPE_LINESUseful constant for specifying the type of rendering (lines only).- See Also:
-
LINETYPE_SHAPES_AND_LINES
public static final int LINETYPE_SHAPES_AND_LINESUseful constant for specifying the type of rendering (shapes and lines).- See Also:
-
LINETYPE_AREA
public static final int LINETYPE_AREAUseful constant for specifying the type of rendering (area only).- See Also:
-
LINETYPE_AREA_AND_SHAPES
public static final int LINETYPE_AREA_AND_SHAPESUseful constant for specifying the type of rendering (area and shapes).- See Also:
-
LINETYPE_BAR
public static final int LINETYPE_BARline type- See Also:
-
LINETYPE_IDS
public static final int[] LINETYPE_IDSline types -
LINETYPE_LABELS
line type labels -
SIDE_UNDEFINED
public static final int SIDE_UNDEFINEDwhich side in legend- See Also:
-
SIDE_LEFT
public static final int SIDE_LEFTwhich side in legend- See Also:
-
SIDE_RIGHT
public static final int SIDE_RIGHTwhich side in legend- See Also:
-
SIDES
public static final int[] SIDESwhich side in legend -
SIDELABELS
which side in legend -
STROKE_SOLID
public static final int STROKE_SOLIDStroke type- See Also:
-
STROKE_DOT
public static final int STROKE_DOTStroke type- See Also:
-
STROKE_DASH
public static final int STROKE_DASHStroke type- See Also:
-
STROKE_DOTDASH
public static final int STROKE_DOTDASHStroke type- See Also:
-
STROKE_IDS
public static final int[] STROKE_IDSStroke types -
STROKE_LABELS
Stroke type labels -
SHAPE_PLUS
public static final int SHAPE_PLUSshape type- See Also:
-
SHAPE_X
public static final int SHAPE_Xshape type- See Also:
-
SHAPE_RECTANGLE
public static final int SHAPE_RECTANGLEshape type- See Also:
-
SHAPE_POINT
public static final int SHAPE_POINTshape type- See Also:
-
SHAPE_LARGEPOINT
public static final int SHAPE_LARGEPOINTshape type- See Also:
-
SHAPE_VLINE
public static final int SHAPE_VLINEshape type- See Also:
-
SHAPE_HLINE
public static final int SHAPE_HLINEshape type- See Also:
-
SHAPES
public static int[] SHAPESshape types -
SHAPE_NAMES
shape names -
COLORS
The array of colors we cycle through -
index
protected int indexindex -
unit
display unit
-
-
Constructor Details
-
LineState
public LineState()Default ctor -
LineState
Constructor- Parameters:
color- colorwidth- line widthstrokeType- stroke
-
LineState
Constructor- Parameters:
color- colorwidth- line widthstrokeType- strokelineType- line typeshapeType- shape type
-
-
Method Details
-
getPropertyContents
Create the properties contents- Returns:
- Contents for properties dialog
-
showPropertiesDialog
show dialog- Parameters:
listener- listens for changeschartNames- all chart names. We use this to show a combo box of chartsranges- All ranges. Some candy for the user so they can set the range values to use on multiple line states- Returns:
- ok
-
showPropertiesDialog
public boolean showPropertiesDialog(PropertyChangeListener propListener, boolean doVisible, boolean doRange, List chartNames, List sampleRanges) show dialog- Parameters:
propListener- listens for changesdoVisible- show visible cbxdoRange- show rangeschartNames- all chart names. We use this to show a combo box of chartssampleRanges- All ranges. Some candy for the user so they can set the range values to use on multiple line states- Returns:
- ok
-
getTimes
Get the list of times- Returns:
- the list of times
-
getValues
Get the list of values- Returns:
- the list of values
-
setTrack
Set the track with a list of times and values- Parameters:
times- the timesvalues- the values
-
getPropertyContents
Create the properties contents- Parameters:
full- show fill dialogchartNames- chart namessampleRanges- ranges- Returns:
- Contents for properties dialog
-
showRangePopup
popup range menu- Parameters:
ranges- ranges
-
setRangeInProperties
apply range to gui- Parameters:
r- range
-
applyProperties
protected boolean applyProperties()Apply properties- Returns:
- Was successful
-
getFixedColor
Utility to get a color in the static list of colors- Parameters:
index- which color- Returns:
- the color
-
getStroke
Create a stroke- Returns:
- a stroke
-
makeStroke
create a stroke- Parameters:
width- line widthtype- stroke type- Returns:
- a stroke
-
getPaintShape
get the shape we use to paint- Returns:
- paint shape
-
setVisible
public void setVisible(boolean value) Set the Visible property.- Parameters:
value- The new value for Visible
-
getVisible
public boolean getVisible()Get the Visible property.- Returns:
- The Visible
-
setColor
Set the Color property.- Parameters:
value- The new value for Color
-
getColor
Get the Color property.- Returns:
- The Color
-
getColor
if we have a color then return it. Else get index'th color- Parameters:
index- index- Returns:
- color
-
setWidth
public void setWidth(float value) Set the Width property.- Parameters:
value- The new value for Width
-
getWidth
public float getWidth()Get the Width property.- Returns:
- The Width
-
setStrokeType
set stroke- Parameters:
value- value
-
setStrokeType
public void setStrokeType(int value) Set the StrokeType property.- Parameters:
value- The new value for StrokeType
-
getStrokeType
public int getStrokeType()Get the StrokeType property.- Returns:
- The StrokeType
-
setShape
public void setShape(int value) Set the Shape property.- Parameters:
value- The new value for Shape
-
getShape
public int getShape()Get the Shape property.- Returns:
- The Shape
-
setRangeIncludesZero
public void setRangeIncludesZero(boolean value) Set the RangeIncludesZero property.- Parameters:
value- The new value for RangeIncludesZero
-
getRangeIncludesZero
public boolean getRangeIncludesZero()Get the RangeIncludesZero property.- Returns:
- The RangeIncludesZero
-
setRange
Set the Range property.- Parameters:
value- The new value for Range
-
getRange
Get the Range property.- Returns:
- The Range
-
setUseLogarithmicRange
public void setUseLogarithmicRange(boolean value) Set the UseLogarithmicRange property.- Parameters:
value- The new value for UseLogarithmicRange
-
getUseLogarithmicRange
public boolean getUseLogarithmicRange()Get the UseLogarithmicRange property.- Returns:
- The UseLogarithmicRange
-
setLineType
public void setLineType(int value) Set the LineType property.- Parameters:
value- The new value for LineType
-
getLineType
public int getLineType()Get the LineType property.- Returns:
- The LineType
-
setChartName
Set the chart name property.- Parameters:
value- The new value for chart name
-
getChartName
Get the ChartName property.- Returns:
- The ChartName
-
setNameIfNeeded
Set the name if needed- Parameters:
value- true to set the name
-
hasName
public boolean hasName()Does this linestate have a name defined- Returns:
- has a name
-
setName
Set the Name property.- Parameters:
value- The new value for Name
-
getName
Get the Name property.- Returns:
- The Name
-
setNameMacro
Set the NameMacro property.- Parameters:
value- The new value for NameMacro
-
getNameMacro
Get the NameMacro property.- Returns:
- The NameMacro
-
setVerticalPosition
public void setVerticalPosition(int value) Set the VerticalPosition property.- Parameters:
value- The new value for VerticalPosition
-
getVerticalPosition
public int getVerticalPosition()Get the VerticalPosition property.- Returns:
- The VerticalPosition
-
setHorizontalPosition
public void setHorizontalPosition(int value) Set the HorizontalPosition property.- Parameters:
value- The new value for HorizontalPosition
-
getHorizontalPosition
public int getHorizontalPosition()Get the HorizontalPosition property.- Returns:
- The HorizontalPosition
-
setSide
public void setSide(int value) Set the Side property.- Parameters:
value- The new value for Side
-
getSide
public int getSide()Get the Side property.- Returns:
- The Side
-
setAxisVisible
public void setAxisVisible(boolean value) Set the AxisVisible property.- Parameters:
value- The new value for AxisVisible
-
getAxisVisible
public boolean getAxisVisible()Get the AxisVisible property.- Returns:
- The AxisVisible
-
setValid
public void setValid(boolean value) Set the Valid property.- Parameters:
value- The new value for Valid
-
getValid
public boolean getValid()Get the Valid property.- Returns:
- The Valid
-
setAxisLabel
Set the AxisLabel property.- Parameters:
value- The new value for AxisLabel
-
getAxisLabel
Get the AxisLabel property.- Returns:
- The AxisLabel
-
setVisibleInLegend
public void setVisibleInLegend(boolean value) Set the VisibleInLegend property.- Parameters:
value- The new value for VisibleInLegend
-
getVisibleInLegend
public boolean getVisibleInLegend()Get the VisibleInLegend property.- Returns:
- The VisibleInLegend
-
setUseVerticalPosition
public void setUseVerticalPosition(boolean value) Set the UseVertical property.- Parameters:
value- The new value for UseVertical
-
getUseVerticalPosition
public boolean getUseVerticalPosition()Get the UseVertical property.- Returns:
- The UseVertical
-
getUnit
Get the unit.- Returns:
- The unit
-