Class LineState

java.lang.Object
ucar.unidata.idv.control.chart.LineState

public class LineState extends Object
Holds graphics state
Version:
$Revision: 1.23 $
Author:
IDV Development Team
  • Field Details

    • VPOS_TOP

      public static final int VPOS_TOP
      vertical position value
      See Also:
    • VPOS_MIDDLE

      public static final int VPOS_MIDDLE
      vertical position value
      See Also:
    • VPOS_BOTTOM

      public static final int VPOS_BOTTOM
      vertical position value
      See Also:
    • VPOS_NONE

      public static final int VPOS_NONE
      vertical position value
      See Also:
    • HPOS_LEFT

      public static final int HPOS_LEFT
      horizontal position value
      See Also:
    • HPOS_MIDDLE

      public static final int HPOS_MIDDLE
      horizontal position value
      See Also:
    • HPOS_RIGHT

      public static final int HPOS_RIGHT
      horizontal position value
      See Also:
    • HPOS_NONE

      public static final int HPOS_NONE
      horizontal position value
      See Also:
    • VPOS_VALUES

      public static int[] VPOS_VALUES
      vertical positions
    • VPOS_LABELS

      public static String[] VPOS_LABELS
      horizontal position labels
    • HPOS_VALUES

      public static int[] HPOS_VALUES
      horizontal positions
    • HPOS_LABELS

      public static String[] HPOS_LABELS
      vertical position labels
    • LINETYPE_SHAPES

      public static final int LINETYPE_SHAPES
      line type
      See Also:
    • LINETYPE_LINES

      public static final int LINETYPE_LINES
      Useful constant for specifying the type of rendering (lines only).
      See Also:
    • LINETYPE_SHAPES_AND_LINES

      public static final int LINETYPE_SHAPES_AND_LINES
      Useful constant for specifying the type of rendering (shapes and lines).
      See Also:
    • LINETYPE_AREA

      public static final int LINETYPE_AREA
      Useful constant for specifying the type of rendering (area only).
      See Also:
    • LINETYPE_AREA_AND_SHAPES

      public static final int LINETYPE_AREA_AND_SHAPES
      Useful constant for specifying the type of rendering (area and shapes).
      See Also:
    • LINETYPE_BAR

      public static final int LINETYPE_BAR
      line type
      See Also:
    • LINETYPE_IDS

      public static final int[] LINETYPE_IDS
      line types
    • LINETYPE_LABELS

      public static final String[] LINETYPE_LABELS
      line type labels
    • SIDE_UNDEFINED

      public static final int SIDE_UNDEFINED
      which side in legend
      See Also:
    • SIDE_LEFT

      public static final int SIDE_LEFT
      which side in legend
      See Also:
    • SIDE_RIGHT

      public static final int SIDE_RIGHT
      which side in legend
      See Also:
    • SIDES

      public static final int[] SIDES
      which side in legend
    • SIDELABELS

      public static final String[] SIDELABELS
      which side in legend
    • STROKE_SOLID

      public static final int STROKE_SOLID
      Stroke type
      See Also:
    • STROKE_DOT

      public static final int STROKE_DOT
      Stroke type
      See Also:
    • STROKE_DASH

      public static final int STROKE_DASH
      Stroke type
      See Also:
    • STROKE_DOTDASH

      public static final int STROKE_DOTDASH
      Stroke type
      See Also:
    • STROKE_IDS

      public static final int[] STROKE_IDS
      Stroke types
    • STROKE_LABELS

      public static final String[] STROKE_LABELS
      Stroke type labels
    • SHAPE_PLUS

      public static final int SHAPE_PLUS
      shape type
      See Also:
    • SHAPE_X

      public static final int SHAPE_X
      shape type
      See Also:
    • SHAPE_RECTANGLE

      public static final int SHAPE_RECTANGLE
      shape type
      See Also:
    • SHAPE_POINT

      public static final int SHAPE_POINT
      shape type
      See Also:
    • SHAPE_LARGEPOINT

      public static final int SHAPE_LARGEPOINT
      shape type
      See Also:
    • SHAPE_VLINE

      public static final int SHAPE_VLINE
      shape type
      See Also:
    • SHAPE_HLINE

      public static final int SHAPE_HLINE
      shape type
      See Also:
    • SHAPES

      public static int[] SHAPES
      shape types
    • SHAPE_NAMES

      public static String[] SHAPE_NAMES
      shape names
    • COLORS

      public static Color[] COLORS
      The array of colors we cycle through
    • index

      protected int index
      index
    • unit

      protected Unit unit
      display unit
  • Constructor Details

    • LineState

      public LineState()
      Default ctor
    • LineState

      public LineState(Color color, float width, int strokeType)
      Constructor
      Parameters:
      color - color
      width - line width
      strokeType - stroke
    • LineState

      public LineState(Color color, float width, int strokeType, int lineType, int shapeType)
      Constructor
      Parameters:
      color - color
      width - line width
      strokeType - stroke
      lineType - line type
      shapeType - shape type
  • Method Details

    • getPropertyContents

      protected JComponent getPropertyContents()
      Create the properties contents
      Returns:
      Contents for properties dialog
    • showPropertiesDialog

      public boolean showPropertiesDialog(PropertyChangeListener listener, List chartNames, List ranges)
      show dialog
      Parameters:
      listener - listens for changes
      chartNames - all chart names. We use this to show a combo box of charts
      ranges - 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 changes
      doVisible - show visible cbx
      doRange - show ranges
      chartNames - all chart names. We use this to show a combo box of charts
      sampleRanges - All ranges. Some candy for the user so they can set the range values to use on multiple line states
      Returns:
      ok
    • getTimes

      public List<DateTime> getTimes()
      Get the list of times
      Returns:
      the list of times
    • getValues

      public List<Real> getValues()
      Get the list of values
      Returns:
      the list of values
    • setTrack

      public void setTrack(List<DateTime> times, List<Real> values)
      Set the track with a list of times and values
      Parameters:
      times - the times
      values - the values
    • getPropertyContents

      protected JComponent getPropertyContents(boolean full, List chartNames, List sampleRanges)
      Create the properties contents
      Parameters:
      full - show fill dialog
      chartNames - chart names
      sampleRanges - ranges
      Returns:
      Contents for properties dialog
    • showRangePopup

      public void showRangePopup(List ranges)
      popup range menu
      Parameters:
      ranges - ranges
    • setRangeInProperties

      public void setRangeInProperties(Range r)
      apply range to gui
      Parameters:
      r - range
    • applyProperties

      protected boolean applyProperties()
      Apply properties
      Returns:
      Was successful
    • getFixedColor

      public static Color getFixedColor(int index)
      Utility to get a color in the static list of colors
      Parameters:
      index - which color
      Returns:
      the color
    • getStroke

      public BasicStroke getStroke()
      Create a stroke
      Returns:
      a stroke
    • makeStroke

      public static BasicStroke makeStroke(float width, int type)
      create a stroke
      Parameters:
      width - line width
      type - stroke type
      Returns:
      a stroke
    • getPaintShape

      public Shape 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

      public void setColor(Color value)
      Set the Color property.
      Parameters:
      value - The new value for Color
    • getColor

      public Color getColor()
      Get the Color property.
      Returns:
      The Color
    • getColor

      public Color getColor(int index)
      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

      public void setStrokeType(Integer value)
      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

      public void setRange(Range value)
      Set the Range property.
      Parameters:
      value - The new value for Range
    • getRange

      public 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

      public void setChartName(String value)
      Set the chart name property.
      Parameters:
      value - The new value for chart name
    • getChartName

      public String getChartName()
      Get the ChartName property.
      Returns:
      The ChartName
    • setNameIfNeeded

      public void setNameIfNeeded(String value)
      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

      public void setName(String value)
      Set the Name property.
      Parameters:
      value - The new value for Name
    • getName

      public String getName()
      Get the Name property.
      Returns:
      The Name
    • setNameMacro

      public void setNameMacro(String value)
      Set the NameMacro property.
      Parameters:
      value - The new value for NameMacro
    • getNameMacro

      public String 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

      public void setAxisLabel(String value)
      Set the AxisLabel property.
      Parameters:
      value - The new value for AxisLabel
    • getAxisLabel

      public String 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

      public Unit getUnit()
      Get the unit.
      Returns:
      The unit