|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.wabit.AbstractWabitObject
ca.sqlpower.wabit.report.chart.Chart
public class Chart
| 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(WabitObject child,
int index)
This is the object specific implementation of #addChild(WabitObject). |
void |
addMissingIdentifier(ChartColumn ci)
Adds the given column identifier to the end of the missing identifiers list. |
boolean |
allowsChildren()
Returns true if this object may contain children. |
int |
childPositionOffset(java.lang.Class<? extends WabitObject> childType)
Returns the position in the list that would be returned by getChildren() that the first object of type childClass is, or where it would be if there were any children of that type. |
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.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()
Returns a list of all WabitObjects that this Wabit object is
dependent on. |
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(WabitObject child)
This is the object specific implementation of removeChild. |
void |
removeDependency(WabitObject dependency)
Removes the given object as a dependency of this object. |
void |
setBackgroundColour(java.awt.Color backgroundColour)
|
void |
setGratuitouslyAnimated(boolean gratuitouslyAnimated)
|
void |
setLegendPosition(LegendPosition selectedLegendPosition)
|
void |
setParent(WabitObject parent)
Sets the parent of this object to the given object. |
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 |
|---|
addChild, addWabitListener, begin, beginTransaction, commit, commitTransaction, equals, fireChildAdded, fireChildRemoved, firePropertyChange, firePropertyChange, firePropertyChange, fireTransactionEnded, fireTransactionRollback, fireTransactionStarted, generateNewUUID, getChildren, getName, getParent, getSession, getUUID, isForegroundThread, removeChild, removeWabitListener, rollback, rollbackTransaction, runInBackground, runInForeground, setName, setUUID, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 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(WabitObject parent)
WabitObject
setParent in interface WabitObjectsetParent in class AbstractWabitObjectparent - The new parent of this object.public boolean allowsChildren()
WabitObject
WabitObject.childPositionOffset(Class)public int childPositionOffset(java.lang.Class<? extends WabitObject> childType)
WabitObject
public java.util.List<? extends WabitObject> getChildren()
getColumns(). Provided to satisfy WabitObject interface.
public java.util.List<WabitObject> getDependencies()
WabitObjectWabitObjects that this Wabit object is
dependent on. Children of a WabitObject are not dependencies and will not
be returned in this list. If there are no objects this Wabit object is
dependent on an empty list should be returned. These are only the
immediate dependencies of this object. If you want to find the
dependencies of this object's dependencies as well it may be useful to
look at WorkspaceGraphModel to make a full graph of all of the
dependencies.
public void removeDependency(WabitObject dependency)
WabitObject
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(WabitObject child)
AbstractWabitObject
removeChildImpl in class AbstractWabitObjectAbstractWabitObject.removeChild(WabitObject)
protected void addChildImpl(WabitObject child,
int index)
AbstractWabitObject#addChild(WabitObject). There are checks in the
#addChild(WabitObject) method to ensure that the object given
here is a valid child type of this object.
This method should be overwritten if children are allowed.
addChildImpl in class AbstractWabitObjectchild - The child to add to this object.index - The index to add the child at.
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 CleanupExceptions cleanup()
AbstractWabitObject
cleanup in interface WabitObjectcleanup in class AbstractWabitObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||