public interface IPlot
When implemented in tandem with an IVizService, the class that realizes this interface should encapsulate all details related to the internal workings of the IVizService and refrain from exposing them to the client. For example, service ids, credentials, window ids and other information should be stored as private variables and not exposed in the properties map unless absolutely necessary.
A proper implementation of IPlot is one that can be used in standalone tools, workbench-based tools, and embedded in composites in larger, existing tools. Implementations should not be restricted to one usage scenario.
Modifier and Type | Method and Description |
---|---|
org.eclipse.swt.widgets.Composite |
draw(java.lang.String category,
java.lang.String plotType,
org.eclipse.swt.widgets.Composite parent)
This operation directs the IPlot to draw itself in its parent as the
specified plot type.
|
java.net.URI |
getDataSource()
This operation returns the data source that is plotted/drawn by this
IPlot.
|
int |
getNumberOfAxes()
This operation returns the number of axes of the plot.
|
java.util.Map<java.lang.String,java.lang.String[]> |
getPlotTypes()
This operation returns a simple map of plot types that can be created by
the IPlot using its data source.
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
This operation returns properties of this IPlot that can be safely
modified and/or tuned by the client.
|
java.lang.String |
getSourceHost()
This operation retrieves the hostname for this IPlot's data source.
|
boolean |
isSourceRemote()
This operation signifies whether or not the IPlot's host is local or
remote.
|
void |
setProperties(java.util.Map<java.lang.String,java.lang.String> props)
This operation updates the properties of the plot based on client-side
modifications.
|
java.util.Map<java.lang.String,java.lang.String[]> getPlotTypes() throws java.lang.Exception
key | value
line | "x vs y1", "x vs y2", "x vs y3"
scatter | "x vs y1", "x vs y2", "x vs y3"
contour | "x vs y1", "x vs y2", "x vs y3"
java.lang.Exception
- This exception indicates that the IPlot was not able to
retrieve the list of plot types and explains why.org.eclipse.swt.widgets.Composite draw(java.lang.String category, java.lang.String plotType, org.eclipse.swt.widgets.Composite parent) throws java.lang.Exception
This operation may be called multiple types to change its type. It is expected that the implementation will know how to clear the parent, if necessary, or to otherwise manage its own drawing service. There is no guarantee that the caller will clear the parent.
category
- The category of the plot to create. That is, the key in the
map; something "line" or "scatter" using the example from
getPlotTypes();plotType
- The type of plot that this IPlot should showparent
- The composite in which the plot should be drawn.java.lang.Exception
- This exception indicates that they IPlot could not be drawn
with either the given type or parent and explains why.int getNumberOfAxes()
java.util.Map<java.lang.String,java.lang.String> getProperties()
void setProperties(java.util.Map<java.lang.String,java.lang.String> props) throws java.lang.Exception
props
- The updated propertiesjava.lang.Exception
- This exception indicates that the IPlot could not update its
properties or redraw itself.java.net.URI getDataSource()
java.lang.String getSourceHost()
boolean isSourceRemote()