|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.object.AbstractSPObject
ca.sqlpower.wabit.AbstractWabitObject
ca.sqlpower.wabit.report.chart.Chart
public class Chart
| Field Summary |
|---|
| Fields inherited from class ca.sqlpower.object.AbstractSPObject |
|---|
uuid |
| Constructor Summary | |
|---|---|
Chart()
Creates a new chart with a new unique ID. |
|
Chart(java.lang.String uuid)
Creates a new chart having the given unique ID (primarily meant for reading objects from storage). |
|
| Method Summary | |
|---|---|
void |
addChartColumn(ChartColumn newColumnIdentifier)
For internal use only (while reading a Workspace file or refreshing the column list when a new result set comes in). |
void |
addChartColumn(ChartColumn newColumnIdentifier,
int index)
For internal use only (while reading a Workspace file or refreshing the column list when a new result set comes in). |
void |
addChartDataListener(ChartDataListener l)
Registers the given listener to receive an event every time the dataset returned by createDataset() might be different. |
protected void |
addChildImpl(ca.sqlpower.object.SPObject child,
int index)
|
void |
addMissingIdentifier(ChartColumn ci)
Adds the given column identifier to the end of the missing identifiers list. |
boolean |
allowsChildren()
|
int |
childPositionOffset(java.lang.Class<? extends ca.sqlpower.object.SPObject> childType)
|
ca.sqlpower.object.CleanupExceptions |
cleanup()
Default cleanup method that does nothing. |
void |
clearMissingIdentifiers()
Resets the missing identifiers list. |
org.jfree.data.general.Dataset |
createDataset()
Creates an independent JFreeChart dataset based on the current data available in this chart's underlying query. |
java.util.List<ChartColumn> |
findRoleColumns(ColumnRole role)
Returns a list of the identifiers for all columns labeled as a given role in a bar chart. |
java.util.List<java.lang.Class<? extends ca.sqlpower.object.SPObject>> |
getAllowedChildTypes()
|
java.awt.Color |
getBackgroundColour()
|
java.util.List<? extends WabitObject> |
getChildren()
Alias for getColumns(). |
java.util.List<ChartColumn> |
getColumns()
Returns an unmodifiable view of the result set columns this chart knows about, along with information about their role in the chart. |
java.util.List<WabitObject> |
getDependencies()
|
LegendPosition |
getLegendPosition()
|
java.util.List<ChartColumn> |
getMissingIdentifiers()
Returns an unmodifiable view of the missing identifiers list. |
ResultSetProducer |
getQuery()
Returns the current query that this chart gets its datasets from. |
java.sql.ResultSet |
getResultSet()
Returns the current result set of the query that supplies data to this chart. |
ca.sqlpower.sql.RowFilter |
getResultSetFilter()
|
java.util.List<java.lang.String> |
getSeriesColours()
|
ChartType |
getType()
Returns the currently-selected chart type. |
ca.sqlpower.sql.CachedRowSet |
getUnfilteredResultSet()
Returns the current result set of the query that supplies data to this chart. |
double |
getXAxisLabelRotation()
Returns the desired rotation for the X-axis category/item labels. |
java.lang.String |
getXaxisName()
|
java.lang.String |
getYaxisName()
|
boolean |
isGratuitouslyAnimated()
|
void |
removeChartDataListener(ChartDataListener l)
Removes the given listener from the list of parties interested in data change events. |
protected boolean |
removeChildImpl(ca.sqlpower.object.SPObject child)
|
void |
removeDependency(ca.sqlpower.object.SPObject dependency)
|
void |
setBackgroundColour(java.awt.Color backgroundColour)
|
void |
setGratuitouslyAnimated(boolean gratuitouslyAnimated)
|
void |
setLegendPosition(LegendPosition selectedLegendPosition)
|
void |
setParent(ca.sqlpower.object.SPObject parent)
|
void |
setQuery(ResultSetProducer newQuery)
Replaces this chart's source of result sets with the given result set producer, firing a property change event. |
void |
setType(ChartType newType)
Selects a new chart type for this chart. |
void |
setXAxisLabelRotation(double xAxisLabelRotation)
Sets the desired rotation for the X-axis category/item labels. |
void |
setXaxisName(java.lang.String xaxisName)
|
void |
setYaxisName(java.lang.String yaxisName)
|
| Methods inherited from class ca.sqlpower.wabit.AbstractWabitObject |
|---|
commit, equals, generateNewUUID, getParent, getSession, isForegroundThread, removeChild, rollback, runInBackground, runInForeground, toString |
| Methods inherited from class ca.sqlpower.object.AbstractSPObject |
|---|
addChild, addSPListener, begin, fireChildAdded, fireChildRemoved, firePropertyChange, firePropertyChange, firePropertyChange, fireTransactionEnded, fireTransactionRollback, fireTransactionStarted, getChildren, getName, getUUID, removeSPListener, setName, setUUID |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ca.sqlpower.object.SPObject |
|---|
addChild, addSPListener, begin, getChildren, getName, getUUID, removeSPListener, setName, setUUID |
| Constructor Detail |
|---|
public Chart()
public Chart(java.lang.String uuid)
uuid - The uuid the new object should have.| Method Detail |
|---|
public void clearMissingIdentifiers()
public java.util.List<ChartColumn> getMissingIdentifiers()
public void addMissingIdentifier(@Nonnull
ChartColumn ci)
ci - The column identifier to add. Must not be null.public java.awt.Color getBackgroundColour()
public void setBackgroundColour(java.awt.Color backgroundColour)
public java.sql.ResultSet getResultSet()
throws java.sql.SQLException,
QueryInitializationException,
java.lang.InterruptedException
OlapUtil#toResultSet(CellSet).
No matter how the result set was obtained, it will be filtered through
the current resultSetFilter before being returned.
resultSetFilter. If #refreshData() has not been
called on this chart instance since its creation or since the
most recent call to #defineQuery(WabitObject), this
method returns null.
java.sql.SQLException
QueryInitializationException
java.lang.InterruptedExceptiongetUnfilteredResultSet()
public ca.sqlpower.sql.CachedRowSet getUnfilteredResultSet()
throws java.sql.SQLException
OlapUtil#toResultSet(CellSet).
The result set returned will contain all the rows supplied by the current
query. Specifically, it will not be subject to the
resultSetFilter. This is useful in user interfaces, which can
show all the rows and visually indicate which ones are being used in the
chart and which are not.
#refreshData() has not been called on this chart instance
since its creation or since the most recent call to
#defineQuery(WabitObject), this method returns null.
java.sql.SQLExceptiongetResultSet()public org.jfree.data.general.Dataset createDataset()
#setQuery(),
setType(ChartType)public void setParent(ca.sqlpower.object.SPObject parent)
setParent in interface ca.sqlpower.object.SPObjectsetParent in class ca.sqlpower.object.AbstractSPObjectpublic boolean allowsChildren()
public int childPositionOffset(java.lang.Class<? extends ca.sqlpower.object.SPObject> childType)
public java.util.List<? extends WabitObject> getChildren()
getColumns(). Provided to satisfy WabitObject interface.
public java.util.List<WabitObject> getDependencies()
public void removeDependency(ca.sqlpower.object.SPObject dependency)
public ChartType getType()
public void setType(ChartType newType)
public LegendPosition getLegendPosition()
public void setLegendPosition(LegendPosition selectedLegendPosition)
public void setYaxisName(java.lang.String yaxisName)
public java.lang.String getYaxisName()
public void setXaxisName(java.lang.String xaxisName)
public java.lang.String getXaxisName()
public java.util.List<java.lang.String> getSeriesColours()
public void setQuery(@Nullable
ResultSetProducer newQuery)
throws java.sql.SQLException
You'll probably want to call #refreshData() after defining a new query.
TODO nothing in here throws SQLException, remove it.
newQuery -
java.lang.IllegalArgumentException - if the query is not of a supported type.
java.sql.SQLExceptionpublic ca.sqlpower.sql.RowFilter getResultSetFilter()
public ResultSetProducer getQuery()
public java.util.List<ChartColumn> getColumns()
public void addChartColumn(@Nonnull
ChartColumn newColumnIdentifier)
newColumnIdentifier - The new column identifier to add. Must not be null.
public void addChartColumn(@Nonnull
ChartColumn newColumnIdentifier,
int index)
newColumnIdentifier - The new column identifier to add. Must not be null.index - The index to add the chart column at. Cannot be greater than
the current number of identifiers in the chart.public java.util.List<ChartColumn> findRoleColumns(ColumnRole role)
public double getXAxisLabelRotation()
public void setXAxisLabelRotation(double xAxisLabelRotation)
Fires a property change if the new value differs from the existing value.
xAxisLabelRotation - The desired rotation. Must be between -90 and 90 inclusive.public void setGratuitouslyAnimated(boolean gratuitouslyAnimated)
public boolean isGratuitouslyAnimated()
protected boolean removeChildImpl(ca.sqlpower.object.SPObject child)
removeChildImpl in class ca.sqlpower.object.AbstractSPObject
protected void addChildImpl(ca.sqlpower.object.SPObject child,
int index)
addChildImpl in class ca.sqlpower.object.AbstractSPObject
public void addChartDataListener(@Nonnull
ChartDataListener l)
createDataset() might be different. These events
typically happen whenever the chart's result set provider changes, as
well as when a streaming query delivers a new row of data.
l - the listener to add. Must not be null.
public void removeChartDataListener(@Nullable
ChartDataListener l)
l - the listener to remove. Null is silently ignored.public ca.sqlpower.object.CleanupExceptions cleanup()
AbstractWabitObject
cleanup in interface ca.sqlpower.object.SPObjectcleanup in class AbstractWabitObjectpublic java.util.List<java.lang.Class<? extends ca.sqlpower.object.SPObject>> getAllowedChildTypes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||