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, initequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdraw, hasDomainAxis, hasRangeAxisgetManagerpublic 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 ChartServicepublic boolean isVisible()
ChartServiceisVisible in interface ChartServicepublic void setVisible(boolean isVisible)
ChartServicesetVisible in interface ChartServicepublic List<ChartAxis> getDomainAxis()
ChartServicegetDomainAxis in interface ChartServiceChartAxis) that compounds the chartprotected boolean getNullGroupIgnored()
protected void setNullGroupIgnored(boolean ignored)
public List<ValueAxis> getRangeAxis()
ChartServiceValueAxis of a ChartServicegetRangeAxis in interface ChartServiceValueAxis) that compounds the chartpublic ChartDataSet getChartDataSet()
ChartServicegetChartDataSet in interface ChartServiceChartDataSetpublic void setChartDataSet(ChartDataSet dataSet)
ChartServicesetChartDataSet in interface ChartServicepublic ChartEditor getChartEditor()
getChartEditor in interface ChartServicepublic ChartRenderingInfo getChartRenderingInfo()
getChartRenderingInfo in interface ChartServicepublic ChartProperties getChartProperties()
ChartServiceChartProperties object.getChartProperties in interface ChartServiceChartPropertiespublic void setChartProperties(ChartProperties chartProperties)
public String getChartType()
ChartServicegetChartType in interface ChartServicepublic String getChartName()
ChartServicegetChartName in interface ChartServicepublic Object toSerieValue(int idSerie, int pixelX)
toSerieValue in interface ChartServicepublic int toXPixelValue(int idSerie,
Object value)
toXPixelValue in interface ChartServicepublic Object toCategoryValue(int idSerie, int pixelY)
toCategoryValue in interface ChartServicepublic int toYPixelValue(int idSerie,
Object value)
toYPixelValue in interface ChartServicepublic Object getInnerChart()
ChartServicegetInnerChart in interface ChartServiceprotected JFreeChart getInternalChart()
public void update()
ChartServiceupdate in interface ChartServicepublic void refreshChart()
refreshChart in interface ChartServiceprotected abstract void updateChartService()
public abstract ChartRenderer getRenderer()
ChartServicegetRenderer in interface ChartServicepublic void setBackgroundPaint(Paint p)
ChartServicePaint to the chart's backgroundsetBackgroundPaint in interface ChartServicepublic void setBackgroundPaint(float f)
ChartServicesetBackgroundPaint in interface ChartServicef - alpha valuepublic void setRangeAxis(ValueAxis axis)
ChartServiceValueAxis in a ChartServicesetRangeAxis in interface ChartServicepublic void setDomainAxis(ChartAxis axis)
ChartServiceChartAxis in a ChartServicesetDomainAxis in interface ChartServicepublic void setRangeAxis(List<ValueAxis> rangeAxis)
ChartServiceValueAxis in a ChartServicesetRangeAxis in interface ChartServicepublic void setDomainAxis(List<ChartAxis> domainAxis)
ChartServiceChartAxis in a ChartServicesetDomainAxis in interface ChartServicepublic void scaleFonts(double ratio)
ChartServicescaleFonts in interface ChartServicepublic Map<String,ChartRenderer> getChartRenderers()
ChartServicegetChartRenderers in interface ChartServicepublic ChartRenderer getChartRenderer()
ChartServicegetChartRenderer in interface ChartServicepublic void addChartRenderer(ChartRenderer renderer)
public void addDefaultChartRenderer(ChartRenderer renderer)
protected ChartRenderer getDefaultChartRenderer()
public ChartLegendItem getChartLegend()
getChartLegend in interface ChartServicepublic List<ChartSerieEntity> getChartLegendItems()
getChartLegendItems in interface ChartServicepublic void createChartLegendItems()
createChartLegendItems in interface ChartServicepublic void loadSavedChartLegendItems()
loadSavedChartLegendItems in interface ChartServicepublic abstract LegendItemCollection getLegendItemCollection()
public void addObserver(Observer o)
addObserver in interface Observablepublic void deleteObserver(Observer o)
deleteObserver in interface Observablepublic void deleteObservers()
deleteObservers in interface Observablepublic void notifyObservers(Observable observable)
public void setAxisVisibles(boolean b)
setAxisVisibles in interface ChartServicepublic LegendTitle createLegend(Graphics2D g, Rectangle r, org.jfree.chart.ChartRenderingInfo info)
public boolean canBeOverlayed()
ChartServicecanBeOverlayed in interface ChartServicepublic void saveToState(PersistentState state) throws PersistenceException
PersistentsaveToState in interface PersistentPersistenceExceptionpublic void loadFromState(PersistentState state) throws PersistenceException
PersistentloadFromState in interface PersistentPersistenceExceptionprotected void setChartRenderingInfo(ChartRenderingInfo clone)
protected void setInnerChart(JFreeChart clone)
public ChartService clone()
clone in interface ChartServiceclone in class Objectpublic void setIsAChartSymbol(boolean isASymbol)
setIsAChartSymbol in interface ChartServiceprotected boolean isAChartSymbol()
public void setCategoriesPaint(List<Color> colors)
setCategoriesPaint in interface ChartServicepublic ChartSerieEntity createNewChartSerieEntity(Object item)
createNewChartSerieEntity in interface ChartServicepublic void setDirty(boolean dirty)
setDirty in interface ChartServicepublic void setFontScaled(Font myScale)
setFontScaled in interface ChartService