public abstract class AbstractChart extends AbstractService implements ChartService, Observable
Modifier and Type | Class and Description |
---|---|
static class |
AbstractChart.RegisterPersistence |
Modifier and Type | Field and Description |
---|---|
protected JFreeChart |
chart |
protected ChartEditorWrapper |
chartEditorWrapper |
protected ChartManager |
chartManager |
protected ChartProperties |
chartProperties |
protected ChartRenderer |
chartRenderer |
protected ChartRenderingInfo |
chartRenderingInfo |
protected ChartDataSet |
dataSet |
boolean |
dataSetEmpty |
protected List<ChartAxis> |
domainAxis |
protected boolean |
isAChartSymbol |
protected boolean |
isDirty |
protected boolean |
isVisible |
protected ChartLegendItem |
legend |
String |
NO_DATA_MESSAGE |
protected List<Observer> |
observers |
protected List<ValueAxis> |
rangeAxis |
Constructor and Description |
---|
AbstractChart() |
Modifier and Type | Method and Description |
---|---|
void |
addChartRenderer(ChartRenderer renderer) |
void |
addDefaultChartRenderer(ChartRenderer renderer) |
void |
addObserver(Observer o) |
boolean |
canBeOverlayed()
Determine if a Chart can share it plot area with others
|
ChartService |
clone() |
void |
createChartLegendItems() |
LegendTitle |
createLegend(Graphics2D g,
Rectangle r,
org.jfree.chart.ChartRenderingInfo info) |
ChartSerieEntity |
createNewChartSerieEntity(Object item) |
void |
deleteObserver(Observer o) |
void |
deleteObservers() |
protected List<Color> |
getCategoriesPaint() |
ChartDataSet |
getChartDataSet()
Obtains the ChartService's data that is used on the chart
|
ChartEditor |
getChartEditor() |
ChartLegendItem |
getChartLegend() |
List<ChartSerieEntity> |
getChartLegendItems() |
String |
getChartName()
Get the name of the service
|
ChartProperties |
getChartProperties()
Get the ChartService's definition using a
ChartProperties object. |
ChartRenderer |
getChartRenderer()
Returns a ChartRenderer using its ID
|
Map<String,ChartRenderer> |
getChartRenderers()
With this method, you can get all the available renderers to this
type of ChartService.
|
ChartRenderingInfo |
getChartRenderingInfo() |
String |
getChartType()
Get the ChartService's type.
|
protected ChartRenderer |
getDefaultChartRenderer() |
List<ChartAxis> |
getDomainAxis()
Useful to get the DomainAxis of a ChartService
|
Object |
getInnerChart()
Useful to swing part.
|
protected JFreeChart |
getInternalChart() |
abstract LegendItemCollection |
getLegendItemCollection() |
protected boolean |
getNullGroupIgnored() |
protected Number |
getNumber(Object obj) |
List<ValueAxis> |
getRangeAxis()
Get the
ValueAxis of a ChartService |
abstract ChartRenderer |
getRenderer()
It gets the renderer used to drawn the chart.
|
protected String |
getRequiredFieldValue(String name) |
protected void |
initializeRenderers() |
protected boolean |
isAChartSymbol() |
boolean |
isVisible()
Check if it's visible or not
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
loadSavedChartLegendItems() |
void |
notifyObservers(Observable observable) |
void |
refreshChart() |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
scaleFonts(double ratio)
Method used to scale the fonts to be readable when the chart is resized
|
void |
setAxisVisibles(boolean b) |
void |
setBackgroundPaint(float f)
Defines the alpha value of the background (from 0.0 to 1.0)
|
void |
setBackgroundPaint(Paint p)
Defines an specific
Paint to the chart's background |
void |
setCategoriesPaint(List<Color> colors) |
void |
setChartDataSet(ChartDataSet dataSet)
Insert a ChartDataSet to the service
|
void |
setChartLegend(ChartLegendItem legend) |
void |
setChartProperties(ChartProperties chartProperties) |
protected void |
setChartRenderingInfo(ChartRenderingInfo clone) |
void |
setDirty(boolean dirty) |
void |
setDomainAxis(ChartAxis axis)
Assign a
ChartAxis in a ChartService |
void |
setDomainAxis(List<ChartAxis> domainAxis)
Assign a set of
ChartAxis in a ChartService |
void |
setFontScaled(Font myScale) |
protected void |
setInnerChart(JFreeChart clone) |
void |
setIsAChartSymbol(boolean isASymbol) |
protected void |
setNullGroupIgnored(boolean ignored) |
void |
setRangeAxis(List<ValueAxis> rangeAxis)
Assign a set of
ValueAxis in a ChartService |
void |
setRangeAxis(ValueAxis axis)
Assign a
ValueAxis in a ChartService |
void |
setVisible(boolean isVisible)
Set a flag to the ChartService to be visible or not
|
Object |
toCategoryValue(int idSerie,
int pixelY) |
Object |
toSerieValue(int idSerie,
int pixelX) |
int |
toXPixelValue(int idSerie,
Object value) |
int |
toYPixelValue(int idSerie,
Object value) |
void |
update()
Refresh chart information
|
protected abstract void |
updateChartService() |
getProvider, getProviderManager, getProviderServices, getServiceParameters, init
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
draw, hasDomainAxis, hasRangeAxis
getManager
public String NO_DATA_MESSAGE
protected ChartManager chartManager
public boolean dataSetEmpty
protected boolean isAChartSymbol
protected ChartProperties chartProperties
protected JFreeChart chart
protected ChartRenderingInfo chartRenderingInfo
protected ChartDataSet dataSet
protected ChartRenderer chartRenderer
protected ChartLegendItem legend
protected boolean isVisible
protected ChartEditorWrapper chartEditorWrapper
protected boolean isDirty
protected void initializeRenderers()
public void setChartLegend(ChartLegendItem legend)
setChartLegend
in interface ChartService
public boolean isVisible()
ChartService
isVisible
in interface ChartService
public void setVisible(boolean isVisible)
ChartService
setVisible
in interface ChartService
public List<ChartAxis> getDomainAxis()
ChartService
getDomainAxis
in interface ChartService
ChartAxis
) that compounds the chartprotected boolean getNullGroupIgnored()
protected void setNullGroupIgnored(boolean ignored)
public List<ValueAxis> getRangeAxis()
ChartService
ValueAxis
of a ChartServicegetRangeAxis
in interface ChartService
ValueAxis
) that compounds the chartpublic ChartDataSet getChartDataSet()
ChartService
getChartDataSet
in interface ChartService
ChartDataSet
public void setChartDataSet(ChartDataSet dataSet)
ChartService
setChartDataSet
in interface ChartService
public ChartEditor getChartEditor()
getChartEditor
in interface ChartService
public ChartRenderingInfo getChartRenderingInfo()
getChartRenderingInfo
in interface ChartService
public ChartProperties getChartProperties()
ChartService
ChartProperties
object.getChartProperties
in interface ChartService
ChartProperties
public void setChartProperties(ChartProperties chartProperties)
public String getChartType()
ChartService
getChartType
in interface ChartService
public String getChartName()
ChartService
getChartName
in interface ChartService
public Object toSerieValue(int idSerie, int pixelX)
toSerieValue
in interface ChartService
public int toXPixelValue(int idSerie, Object value)
toXPixelValue
in interface ChartService
public Object toCategoryValue(int idSerie, int pixelY)
toCategoryValue
in interface ChartService
public int toYPixelValue(int idSerie, Object value)
toYPixelValue
in interface ChartService
public Object getInnerChart()
ChartService
getInnerChart
in interface ChartService
protected JFreeChart getInternalChart()
public void update()
ChartService
update
in interface ChartService
public void refreshChart()
refreshChart
in interface ChartService
protected abstract void updateChartService()
public abstract ChartRenderer getRenderer()
ChartService
getRenderer
in interface ChartService
public void setBackgroundPaint(Paint p)
ChartService
Paint
to the chart's backgroundsetBackgroundPaint
in interface ChartService
public void setBackgroundPaint(float f)
ChartService
setBackgroundPaint
in interface ChartService
f
- alpha valuepublic void setRangeAxis(ValueAxis axis)
ChartService
ValueAxis
in a ChartServicesetRangeAxis
in interface ChartService
public void setDomainAxis(ChartAxis axis)
ChartService
ChartAxis
in a ChartServicesetDomainAxis
in interface ChartService
public void setRangeAxis(List<ValueAxis> rangeAxis)
ChartService
ValueAxis
in a ChartServicesetRangeAxis
in interface ChartService
public void setDomainAxis(List<ChartAxis> domainAxis)
ChartService
ChartAxis
in a ChartServicesetDomainAxis
in interface ChartService
public void scaleFonts(double ratio)
ChartService
scaleFonts
in interface ChartService
public Map<String,ChartRenderer> getChartRenderers()
ChartService
getChartRenderers
in interface ChartService
public ChartRenderer getChartRenderer()
ChartService
getChartRenderer
in interface ChartService
public void addChartRenderer(ChartRenderer renderer)
public void addDefaultChartRenderer(ChartRenderer renderer)
protected ChartRenderer getDefaultChartRenderer()
public ChartLegendItem getChartLegend()
getChartLegend
in interface ChartService
public List<ChartSerieEntity> getChartLegendItems()
getChartLegendItems
in interface ChartService
public void createChartLegendItems()
createChartLegendItems
in interface ChartService
public void loadSavedChartLegendItems()
loadSavedChartLegendItems
in interface ChartService
public abstract LegendItemCollection getLegendItemCollection()
public void addObserver(Observer o)
addObserver
in interface Observable
public void deleteObserver(Observer o)
deleteObserver
in interface Observable
public void deleteObservers()
deleteObservers
in interface Observable
public void notifyObservers(Observable observable)
public void setAxisVisibles(boolean b)
setAxisVisibles
in interface ChartService
public LegendTitle createLegend(Graphics2D g, Rectangle r, org.jfree.chart.ChartRenderingInfo info)
public boolean canBeOverlayed()
ChartService
canBeOverlayed
in interface ChartService
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
protected void setChartRenderingInfo(ChartRenderingInfo clone)
protected void setInnerChart(JFreeChart clone)
public ChartService clone()
clone
in interface ChartService
clone
in class Object
public void setIsAChartSymbol(boolean isASymbol)
setIsAChartSymbol
in interface ChartService
protected boolean isAChartSymbol()
public void setCategoriesPaint(List<Color> colors)
setCategoriesPaint
in interface ChartService
public ChartSerieEntity createNewChartSerieEntity(Object item)
createNewChartSerieEntity
in interface ChartService
public void setDirty(boolean dirty)
setDirty
in interface ChartService
public void setFontScaled(Font myScale)
setFontScaled
in interface ChartService