Package org.meteoinfo.chart
Class Chart
- java.lang.Object
-
- org.meteoinfo.chart.Chart
-
public class Chart extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Chart()ConstructorChart(java.lang.String title, Plot plot)ConstructorChart(java.lang.String title, Plot plot, ChartPanel parent)ConstructorChart(ChartPanel parent)ConstructorChart(Plot plot)ConstructorChart(Plot plot, ChartPanel parent)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPlot(Plot plot)Add a plotvoidaddText(ChartText text)Add textvoidclearPlots()Clear plotsvoidclearTexts()Clear textsvoiddraw(java.awt.Graphics2D g, java.awt.geom.Rectangle2D area)Draw plotPlotfindPlot(int x, int y)Find a plot by pointjava.awt.ColorgetBackground()Get backgroundintgetColumnNum()Get column number of sub plotsPlotgetCurrentPlot()Get current plotjava.awt.geom.Rectangle2DgetGraphArea()Get graph areaChartLegendgetLegend()Get chart legendPlotgetPlot()Get the first plotPlotgetPlot(int plotIdx)Get plot by plot indexjava.awt.geom.Rectangle2DgetPlotArea()Get plot areaintgetPlotIndex(Plot plot)Get plot indexjava.util.List<Plot>getPlots()Get plotintgetRowNum()Get row number of sub plotsChartTextgetSubTitle()Get sub titleChartTextgetTitle()Get titlebooleanhasWebMap()Check if has web map layerbooleanisAntiAlias()Get if is anti-aliasbooleanisDrawLegend()Get if draw legendbooleanisSymbolAntialias()Get symbol antialiasvoidremovePlot(Plot plot)Remove a plotvoidsetAntiAlias(boolean value)Set if is anti-aliasvoidsetBackground(java.awt.Color value)Set backgroundvoidsetColumnNum(int value)Set column number of sub plotsvoidsetCurrentPlot(int value)Set current plot indexvoidsetCurrentPlot(Plot value)Set current plotvoidsetDrawLegend(boolean value)Set if draw legendvoidsetParent(ChartPanel value)Set ChartPanel parentvoidsetPlot(Plot plot)Set plotvoidsetRowNum(int value)Set row number of sub plotsvoidsetSubTitle(ChartText value)Set sub titlevoidsetSymbolAntialias(boolean value)Set symbol antialiasvoidsetTitle(ChartText value)Set title
-
-
-
Constructor Detail
-
Chart
public Chart()
Constructor
-
Chart
public Chart(ChartPanel parent)
Constructor- Parameters:
parent- ChartPanel parent
-
Chart
public Chart(Plot plot, ChartPanel parent)
Constructor- Parameters:
plot- Plotparent- ChartPanel
-
Chart
public Chart(Plot plot)
Constructor- Parameters:
plot- Plot
-
Chart
public Chart(java.lang.String title, Plot plot, ChartPanel parent)Constructor- Parameters:
title- Titleplot- Plotparent- ChartPanel
-
Chart
public Chart(java.lang.String title, Plot plot)Constructor- Parameters:
title- Titleplot- Plot
-
-
Method Detail
-
setParent
public void setParent(ChartPanel value)
Set ChartPanel parent- Parameters:
value- ChartPanel
-
getPlots
public java.util.List<Plot> getPlots()
Get plot- Returns:
- Plot
-
getCurrentPlot
public Plot getCurrentPlot()
Get current plot- Returns:
- Current plot
-
setCurrentPlot
public void setCurrentPlot(Plot value)
Set current plot- Parameters:
value- Current plot
-
setCurrentPlot
public void setCurrentPlot(int value)
Set current plot index- Parameters:
value- Current plot index
-
getPlot
public Plot getPlot()
Get the first plot- Returns:
- Plot
-
getRowNum
public int getRowNum()
Get row number of sub plots- Returns:
- Row number of sub plots
-
setRowNum
public void setRowNum(int value)
Set row number of sub plots- Parameters:
value- Row number of sub plots
-
getColumnNum
public int getColumnNum()
Get column number of sub plots- Returns:
- Column number of sub plots
-
setColumnNum
public void setColumnNum(int value)
Set column number of sub plots- Parameters:
value- Column number of sub plots
-
getTitle
public ChartText getTitle()
Get title- Returns:
- Title
-
setTitle
public void setTitle(ChartText value)
Set title- Parameters:
value- Title
-
getSubTitle
public ChartText getSubTitle()
Get sub title- Returns:
- Sub title
-
setSubTitle
public void setSubTitle(ChartText value)
Set sub title- Parameters:
value- Sub title
-
getBackground
public java.awt.Color getBackground()
Get background- Returns:
- Background
-
setBackground
public void setBackground(java.awt.Color value)
Set background- Parameters:
value- Background
-
getLegend
public ChartLegend getLegend()
Get chart legend- Returns:
- Chart legend
-
isDrawLegend
public boolean isDrawLegend()
Get if draw legend- Returns:
- If draw legend
-
setDrawLegend
public void setDrawLegend(boolean value)
Set if draw legend- Parameters:
value- Boolean
-
getPlotArea
public java.awt.geom.Rectangle2D getPlotArea()
Get plot area- Returns:
- Plot area
-
isAntiAlias
public boolean isAntiAlias()
Get if is anti-alias- Returns:
- Boolean
-
setAntiAlias
public void setAntiAlias(boolean value)
Set if is anti-alias- Parameters:
value- Boolean
-
isSymbolAntialias
public boolean isSymbolAntialias()
Get symbol antialias- Returns:
- Boolean
-
setSymbolAntialias
public void setSymbolAntialias(boolean value)
Set symbol antialias- Parameters:
value- Boolean
-
draw
public void draw(java.awt.Graphics2D g, java.awt.geom.Rectangle2D area)Draw plot- Parameters:
g- Graphics2Darea- Drawing area
-
getGraphArea
public java.awt.geom.Rectangle2D getGraphArea()
Get graph area- Returns:
- Get graph area
-
findPlot
public Plot findPlot(int x, int y)
Find a plot by point- Parameters:
x- Xy- Y- Returns:
- Plot
-
clearPlots
public void clearPlots()
Clear plots
-
clearTexts
public void clearTexts()
Clear texts
-
removePlot
public void removePlot(Plot plot)
Remove a plot- Parameters:
plot- The plot
-
addPlot
public void addPlot(Plot plot)
Add a plot- Parameters:
plot- Plot
-
setPlot
public void setPlot(Plot plot)
Set plot- Parameters:
plot- Plot
-
getPlot
public Plot getPlot(int plotIdx)
Get plot by plot index- Parameters:
plotIdx- Plot index - begin with 1- Returns:
- Plot index
-
getPlotIndex
public int getPlotIndex(Plot plot)
Get plot index- Parameters:
plot- The plot- Returns:
- Plot index
-
hasWebMap
public boolean hasWebMap()
Check if has web map layer- Returns:
- Boolean
-
addText
public void addText(ChartText text)
Add text- Parameters:
text- Text
-
-