Package ucar.unidata.idv.control.chart
Class ChartManager
java.lang.Object
ucar.unidata.idv.control.chart.ChartManager
- All Implemented Interfaces:
ImageObserver
- Direct Known Subclasses:
XYChartManager
A time series chart
- Version:
- $Revision: 1.16 $
- Author:
- MetApps Development Team
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass FixedWidthLogarithmicAxis fixed width log axisstatic classClass FixedWidthNumberAxis fixed width axis -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intwidth of axis_protected List<ChartHolder> the chartsprotected JComponentgui_protected DisplayControlImplmy controlstatic final intchart layout typestatic final intchart layout typestatic final intchart layout typestatic final intchart layout typestatic final intchart layout typestatic final intchart layout typestatic final intchart layout typeprotected Objectfor synching_protected booleanok to draw chartsprotected booleancurrently setting data in chart_Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionctorChartManager(DisplayControlImpl control) ctorChartManager(DisplayControlImpl control, String chartName) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddChart(ChartHolder chartHolder) add chartprotected voidaddLineState(LineState lineState) add line stateprotected voidadd a rangevoidaddViewMenuItems(List items) add menu itemsprotected booleanapplyProperties(ChartHolder chartHolder) apply properties to chartprotected voidchartNameChanged(String oldName, String newName) The chart name has changedprotected voidclear all saved line statesprotected voidmake guiabstract org.jfree.chart.plot.Plotfactory method to make the plotprotected voidCall this after you are done loading data into the charts.voidchange layoutprotected ChartHolderfindChartHolder(String name) find chart with nameprotected ChartHoldergetChartHolder(String name) find chart with nameprotected ChartHoldergetChartHolder(LineState lineState) Get the chart holder that is displaying the given line state.Get the ChartHolders property.get guiGet the Control property.get the rangesprotected Stringget name to use for default chartintGet the GridLayoutDimension property.intGet the Layout property.protected ObjectgetMutex()for synching the chartsbooleanok to draw chartget list of chart namesprotected ListgetPlots()Get the plotsprotected voidgetPopupMenuItems(ChartHolder chartHolder, List items) get menu items for chartprotected DimensionGet the preferred chart sizeprotected voidgetPropertiesComponents(ChartHolder chartHolder, List comps) get properties widgetsbooleanAre we currently setting databooleanGet the ShowThumb property.getThumb()get thumb labelbooleanhasStuff()do we have anything to showbooleanimageUpdate(Image img, int flags, int x, int y, int width, int height) Handle the image updateprotected voidinitChart(ChartHolder chartHolder) init chartprotected voidinit all chartsprotected voidinitPlot(org.jfree.chart.plot.Plot plot) init plotprotected voidmake the chartvoidSave the imagevoidsetChartHolders(List value) Set the ChartHolders property.voidsetChartName(String newName) The chart name has changedvoidsetControl(DisplayControlImpl value) Set the Control property.voidsetGridLayoutDimension(int value) Set the GridLayoutDimension property.voidsetLayout(int value) Set the Layout property.voidset layoutvoidsetShowThumb(boolean value) Set the ShowThumb property.protected voidshowPropertiesDialog(ChartHolder chartHolder) show dialog for chartvoidTell the chart holds that something changedprotected voidCall this before you start loading data into the charts.voidStub for handling time change events.voidtimeChanged(Real value) Stub for handling time change events.protected voidupdate guiprotected voidupdateContents(boolean force) update guivoidupdate thumbnail legend imagevoidactually update the thumbnail image
-
Field Details
-
LAYOUT_HSTACK
public static final int LAYOUT_HSTACKchart layout type- See Also:
-
LAYOUT_VSTACK
public static final int LAYOUT_VSTACKchart layout type- See Also:
-
LAYOUT_2COLGRID
public static final int LAYOUT_2COLGRIDchart layout type- See Also:
-
LAYOUT_3COLGRID
public static final int LAYOUT_3COLGRIDchart layout type- See Also:
-
LAYOUT_GRAPH
public static final int LAYOUT_GRAPHchart layout type- See Also:
-
LAYOUT_TAB
public static final int LAYOUT_TABchart layout type- See Also:
-
LAYOUT_CARD
public static final int LAYOUT_CARDchart layout type- See Also:
-
AXIS_WIDTH
public static final int AXIS_WIDTHwidth of axis_- See Also:
-
MUTEX
for synching_ -
chartHolders
the charts -
control
my control -
contents
gui_ -
settingData
protected boolean settingDatacurrently setting data in chart_ -
okToDraw
protected boolean okToDrawok to draw charts
-
-
Constructor Details
-
ChartManager
public ChartManager()ctor -
ChartManager
ctor- Parameters:
control- the control
-
ChartManager
Default constructor.- Parameters:
control- the controlchartName- name of default chart
-
-
Method Details
-
addLineState
add line state- Parameters:
lineState- line state
-
saveImage
public void saveImage()Save the image -
clearLineStates
protected void clearLineStates()clear all saved line states -
chartNameChanged
The chart name has changed- Parameters:
oldName- old namenewName- new name
-
setChartName
The chart name has changed- Parameters:
newName- new name
-
initCharts
protected void initCharts()init all charts -
getCurrentRanges
get the ranges- Returns:
- ranges
-
addRange
add a range- Parameters:
min- minmax- maxname- name
-
getMutex
for synching the charts- Returns:
- mutex
-
initChart
init chart- Parameters:
chartHolder- The chart
-
initPlot
protected void initPlot(org.jfree.chart.plot.Plot plot) init plot- Parameters:
plot- plot
-
doMakePlot
public abstract org.jfree.chart.plot.Plot doMakePlot()factory method to make the plot- Returns:
- the new plot
-
getPlots
Get the plots- Returns:
- plots_
-
updateThumb
public void updateThumb()update thumbnail legend image -
updateThumbInner
public void updateThumbInner()actually update the thumbnail image -
signalChartChanged
public void signalChartChanged()Tell the chart holds that something changed -
doneLoadingData
protected void doneLoadingData()Call this after you are done loading data into the charts. It resets the flag to ignore any intermediate chart repaints and then it signals the chart to repaint -
startLoadingData
protected void startLoadingData()Call this before you start loading data into the charts. It sets a flag to ignore any intermediate chart repaints -
getPopupMenuItems
get menu items for chart- Parameters:
chartHolder- chart_items- items
-
showPropertiesDialog
show dialog for chart- Parameters:
chartHolder- chart
-
getPropertiesComponents
get properties widgets- Parameters:
chartHolder- the chartcomps- comps
-
applyProperties
apply properties to chart- Parameters:
chartHolder- the chart- Returns:
- OK
-
setLayoutType
set layout- Parameters:
i- layout type
-
editLayout
public void editLayout()change layout -
addViewMenuItems
add menu items- Parameters:
items- items
-
getOkToDraw
public boolean getOkToDraw()ok to draw chart- Returns:
- ok to draw
-
getSettingData
public boolean getSettingData()Are we currently setting data- Returns:
- is setting data
-
timeChanged
public void timeChanged()Stub for handling time change events. -
timeChanged
Stub for handling time change events. Signals a redraw.- Parameters:
value- the time value (may be null);
-
imageUpdate
Handle the image update- Specified by:
imageUpdatein interfaceImageObserver- Parameters:
img- imgflags- flagsx- xy- ywidth- widthheight- height- Returns:
- keep going
-
hasStuff
public boolean hasStuff()do we have anything to show- Returns:
- anything to show
-
getContents
get gui- Returns:
- gui
-
getPlotNames
get list of chart names- Returns:
- names
-
getChartHolder
Get the chart holder that is displaying the given line state.- Parameters:
lineState- The line state- Returns:
- The chart holder
-
findChartHolder
find chart with name- Parameters:
name- name- Returns:
- the chart or null if none found
-
getChartHolder
find chart with name- Parameters:
name- name- Returns:
- the chart or create one if needed
-
addChart
add chart- Parameters:
chartHolder- chart
-
getPreferredChartSize
Get the preferred chart size- Returns:
- The preferred chart size
-
doMakeContents
protected void doMakeContents()make gui -
makeInitialChart
protected void makeInitialChart()make the chart -
getDefaultChartName
get name to use for default chart- Returns:
- default chart name
-
updateContents
protected void updateContents()update gui -
updateContents
protected void updateContents(boolean force) update gui- Parameters:
force- always do it
-
getThumb
get thumb label- Returns:
- thumb
-
setLayout
public void setLayout(int value) Set the Layout property.- Parameters:
value- The new value for Layout
-
getLayout
public int getLayout()Get the Layout property.- Returns:
- The Layout
-
setGridLayoutDimension
public void setGridLayoutDimension(int value) Set the GridLayoutDimension property.- Parameters:
value- The new value for GridLayoutDimension
-
getGridLayoutDimension
public int getGridLayoutDimension()Get the GridLayoutDimension property.- Returns:
- The GridLayoutDimension
-
setChartHolders
Set the ChartHolders property.- Parameters:
value- The new value for ChartHolders
-
getChartHolders
Get the ChartHolders property.- Returns:
- The ChartHolders
-
setControl
Set the Control property.- Parameters:
value- The new value for Control
-
getControl
Get the Control property.- Returns:
- The Control
-
setShowThumb
public void setShowThumb(boolean value) Set the ShowThumb property.- Parameters:
value- The new value for ShowThumb
-
getShowThumb
public boolean getShowThumb()Get the ShowThumb property.- Returns:
- The ShowThumb
-