Class PieChartPanel

All Implemented Interfaces:
Roundable, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible

public class PieChartPanel extends JPanel implements PropertyChangeListener, Roundable
Copyright (C) 2017 Hydrologic Engineering Center, United States Army Corps of Engineers, All Rights Reserved

HEC-Java NEXGEN

See Also:
  • Constructor Details

  • Method Details

    • getModel

      public final ChartModel getModel()
    • setTime

      public void setTime(Date date)
    • getChartView

      public PieChartView getChartView()
    • updateCurrentTime

      public void updateCurrentTime(Date trialTime)
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Specified by:
      propertyChange in interface PropertyChangeListener
    • getSlices

      public final List<PieSliceView> getSlices()
    • main

      public static void main(String[] args)
    • getTotalValue

      public double getTotalValue()
      Returns:
      the aggregate value of all visible items in the chart
    • getTotalRelativeValue

      public double getTotalRelativeValue()
      Returns:
      the aggregative value of all visible items in the chart, relative to the minimums
    • getSliceValue

      public double getSliceValue(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the value of the slice identified at the current time
    • getSliceRelativeValue

      public double getSliceRelativeValue(RmaDataId sliceId)
      Parameters:
      sliceId -
      Returns:
      the value of a slice relative to its minimum
    • getTotalMinValue

      public double getTotalMinValue()
      Returns:
      the aggregate minimum value of all visible items in the chart
    • getSliceMinValue

      public double getSliceMinValue(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the minimum value of the slice identified at the current time
    • getTotalMaxValue

      public double getTotalMaxValue()
      Returns:
      the aggregate maximum value of all visible items in the chart
    • getTotalRelativeMax

      public double getTotalRelativeMax()
      Returns:
      the aggregate maximum value of all visible items in the chart relative to their minimums
    • getSliceMaxValue

      public double getSliceMaxValue(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the maximum value of the slice identified at the current time
    • getSliceRelativeMax

      public double getSliceRelativeMax(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the maximum value of the given item relative to its minimum
    • getQuality

      public double getQuality()
      Returns:
      an aggregate average of the quality of all visible items in the chart
    • getSliceQuality

      public int getSliceQuality(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the quality rating of the data for the slice at the current time
    • getUnits

      public String getUnits()
      Returns:
      the units of the first item in the chart (taken as the units for the chart as a whole)
    • getSliceUnits

      public String getSliceUnits(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the units of the slice identified
    • getSliceIds

      public List<RmaDataId> getSliceIds()
      Returns:
      a list of all the item ids in this chart
    • getLegendSide

      public LegendSide getLegendSide()
      Returns:
      the side to display the legend on
    • getTitleFont

      public Font getTitleFont()
      Returns:
      the font style to display the title text with
    • getTitleFormat

      public String getTitleFormat()
      Returns:
      the format string (with replaced values) used as the title text
    • getTitleColor

      public Color getTitleColor()
      Returns:
      the color to display the title text with
    • getSubtitleFont

      public Font getSubtitleFont()
      Returns:
      the font style to display the subtitle with
    • getSubtitleFormat

      public String getSubtitleFormat()
      Returns:
      the subtitle format string (with replaced values)
    • getSubtitleColor

      public Color getSubtitleColor()
      Returns:
      the color to display the subtitle text with
    • getFooterFont

      public Font getFooterFont()
      Returns:
      the font style to display the footer text with
    • getFooterFormat

      public String getFooterFormat()
      Returns:
      the format string (with replaced values) used as the footer text
    • getFooterColor

      public Color getFooterColor()
      Returns:
      the color to display the footer text with
    • isShowRadialSum

      public boolean isShowRadialSum()
      Returns:
      whether or not to show the radial sum on the chart
    • isSingleColorSum

      public boolean isSingleColorSum()
      Returns:
      whether the sum is extrapolating a single color from its contour
    • getRadialSumContour

      public ColorContourRecord getRadialSumContour()
      Returns:
      the color to display for the radial sum
    • getRadialSumContourType

      public ColorContourType getRadialSumContourType()
      Returns:
      the type of color contour used in the display of the radial sum
    • getBandedContourMax

      public int getBandedContourMax(BandedColorContour contour)
      Parameters:
      contour - the banded contour to retrieve the maximum value bound from
      Returns:
      the maximum index used in the banded color contour
    • getBandedContourMin

      public int getBandedContourMin(BandedColorContour contour)
      Parameters:
      contour - the banded contour to retrieve the minimum value bound from
      Returns:
      the minimum index used in the banded color contour
    • isDrawClockwise

      public boolean isDrawClockwise()
      Returns:
      if the chart is drawing in the clockwise direction
    • getStartAngle

      public double getStartAngle()
      Returns:
      the unit circle starting angle, in degrees, for the first slice
    • getStartAngleMeasure

      public AngleOption getStartAngleMeasure()
      Returns:
      the measuring style for the start angle
    • isShowThresholds

      public boolean isShowThresholds()
      Returns:
      whether or not to show thresholds on the chart
    • isShowThresholdText

      public boolean isShowThresholdText()
      Returns:
      whether or not to show thresholds text on the chart.
    • getThresholds

      public List<Threshold> getThresholds()
      Returns:
      the thresholds linked to the chart as a whole
    • round

      public double round(double toRound)
      Specified by:
      round in interface Roundable
      Parameters:
      toRound - the double value to display in a rounded format
      Returns:
      the rounded value, as determined by the rounding style and precision settings
    • isSliceVisible

      public boolean isSliceVisible(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the visibility state of the slice
    • isSliceSingleColor

      public boolean isSliceSingleColor(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      whether the slice is extrapolating a single color from its contour
    • getSliceContour

      public ColorContourRecord getSliceContour(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the contour used for this slice
    • getSliceContourType

      public ColorContourType getSliceContourType(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the contour type used for this slice
    • isSliceShowLabel

      public boolean isSliceShowLabel(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the visibility state of the slice's label
    • getSliceLabelFont

      public Font getSliceLabelFont(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the font style used to display the slice's label
    • getSliceLabelFormat

      public String getSliceLabelFormat(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the format string of the slice label (with values replaced)
    • getSliceLabelColor

      public Color getSliceLabelColor(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the color of the slice's label text
    • isSliceShowValue

      public boolean isSliceShowValue(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the visibility state of the slice's exact value marker
    • isSliceShowThresholds

      public boolean isSliceShowThresholds(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the visibility state of the slice's thresholds
    • getSliceThresholds

      public List<Threshold> getSliceThresholds(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the list of the slice's thresholds
    • getArcAngle

      public double getArcAngle(RmaDataId sliceId)
      Parameters:
      sliceId - the id of the slice in question
      Returns:
      the angle of a pie that the slice would take up, given that it is visible automatically corrected for clockwise or counter-clockwise drawing directions
    • createMixture

      public Color createMixture(Color c1, Color c2, float p)
    • isTitleVisible

      public boolean isTitleVisible()
    • isFooterVisible

      public boolean isFooterVisible()
    • isSubtitleVisible

      public boolean isSubtitleVisible()
    • isRadialSumTextVisible

      public boolean isRadialSumTextVisible()