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 class
Class FixedWidthLogarithmicAxis fixed width log axisstatic class
Class FixedWidthNumberAxis fixed width axis -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
width of axis_protected List
<ChartHolder> the chartsprotected JComponent
gui_protected DisplayControlImpl
my controlstatic final int
chart layout typestatic final int
chart layout typestatic final int
chart layout typestatic final int
chart layout typestatic final int
chart layout typestatic final int
chart layout typestatic final int
chart layout typeprotected Object
for synching_protected boolean
ok to draw chartsprotected boolean
currently 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 void
addChart
(ChartHolder chartHolder) add chartprotected void
addLineState
(LineState lineState) add line stateprotected void
add a rangevoid
addViewMenuItems
(List items) add menu itemsprotected boolean
applyProperties
(ChartHolder chartHolder) apply properties to chartprotected void
chartNameChanged
(String oldName, String newName) The chart name has changedprotected void
clear all saved line statesprotected void
make guiabstract org.jfree.chart.plot.Plot
factory method to make the plotprotected void
Call this after you are done loading data into the charts.void
change layoutprotected ChartHolder
findChartHolder
(String name) find chart with nameprotected ChartHolder
getChartHolder
(String name) find chart with nameprotected ChartHolder
getChartHolder
(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 String
get name to use for default chartint
Get the GridLayoutDimension property.int
Get the Layout property.protected Object
getMutex()
for synching the chartsboolean
ok to draw chartget list of chart namesprotected List
getPlots()
Get the plotsprotected void
getPopupMenuItems
(ChartHolder chartHolder, List items) get menu items for chartprotected Dimension
Get the preferred chart sizeprotected void
getPropertiesComponents
(ChartHolder chartHolder, List comps) get properties widgetsboolean
Are we currently setting databoolean
Get the ShowThumb property.getThumb()
get thumb labelboolean
hasStuff()
do we have anything to showboolean
imageUpdate
(Image img, int flags, int x, int y, int width, int height) Handle the image updateprotected void
initChart
(ChartHolder chartHolder) init chartprotected void
init all chartsprotected void
initPlot
(org.jfree.chart.plot.Plot plot) init plotprotected void
make the chartvoid
Save the imagevoid
setChartHolders
(List value) Set the ChartHolders property.void
setChartName
(String newName) The chart name has changedvoid
setControl
(DisplayControlImpl value) Set the Control property.void
setGridLayoutDimension
(int value) Set the GridLayoutDimension property.void
setLayout
(int value) Set the Layout property.void
set layoutvoid
setShowThumb
(boolean value) Set the ShowThumb property.protected void
showPropertiesDialog
(ChartHolder chartHolder) show dialog for chartvoid
Tell the chart holds that something changedprotected void
Call this before you start loading data into the charts.void
Stub for handling time change events.void
timeChanged
(Real value) Stub for handling time change events.protected void
update guiprotected void
updateContents
(boolean force) update guivoid
update thumbnail legend imagevoid
actually 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:
imageUpdate
in 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
-