|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface GraphicsCanvas
This interface is the basis of the Decorator design pattern used by all classes in this package that can add features and capabilities to a data plot.
On April 03, 2001 we added an explicit dependency with the
Units class. This was necessary since most implementor
classes were having to include an explicit dependency anyway, which
led to excessive downcasting by user classes. This approach makes for
leaner user code, at the expense of some dependency on a foreign class.
| Field Summary |
|---|
| Fields inherited from interface java.awt.print.Printable |
|---|
NO_SUCH_PAGE, PAGE_EXISTS |
| Method Summary | |
|---|---|
void |
addToChart(javax.swing.JComponent component)
Add yourself to the chart. |
void |
attachDataSet(DataSet ds)
Associates a DataSet instance with the canvas. |
void |
attachRange(DataSet ds)
Associates a DataSet instance with the canvas. |
void |
clearInternalReferences()
|
void |
disableIntegrator()
Disables the measurement gizmo. |
void |
enableIntegrator()
Enables the integrator gizmo. |
void |
eraseMarkers()
Erases all markers. |
void |
eraseMarkers(GraphicsMarker[] markers)
Erases selected markers. |
java.util.Map |
getAnnotations()
Gets a map of annotation objects. |
java.util.List |
getAnnotationSets()
Gets the list of annotation sets. |
AxisType |
getAxisType()
Gets the axis types. |
int |
getBottomBorder()
Gets the bottom border. |
Viewport |
getCanvasViewport()
Gets the canvas' current viewport. |
java.util.Vector |
getDataSets()
Gets the instances of DataSet associated with
this canvas. |
java.awt.Graphics2D |
getGraphics2D()
Gets the current Graphics2D context where data
is being plotted. |
IntegrationRegionSet |
getIntegrationRegions()
Gets the integration regions. |
javax.swing.JComponent |
getJComponent()
Gets the Swing JComponent where the plot lives. |
int |
getLeftBorder()
Gets the left border. |
Logarithm |
getLogarithm()
Gets the Logarithm object associated with this
graphics canvas. |
java.lang.Object |
getOriginalObject()
Gets the original object that gave rise to the plot. |
java.lang.String |
getOriginalObjectID()
Gets the ID of the original object that gave rise to the plot. |
java.lang.Object |
getPlottableObject()
Gets the plottable original object that gave rise to the plot. |
int |
getRightBorder()
Gets the right border. |
java.awt.Cursor |
getSystemCursor()
Gets the cursor. |
int |
getTopBorder()
Gets the top border. |
WCSTransform |
getTransform()
Gets the coordinate transform. |
Viewport |
getWCSViewport()
Gets the current WCS viewport. |
Units |
getXUnits()
Gets the X units. |
Units |
getYUnits()
Gets the Y units. |
boolean |
ignoreCursorEvent()
This is used to synchronize behavior in between canvases that use the same cursor event for different purposes. |
boolean |
isMeasurementEnabled()
Checks if measurements are enabled. |
boolean |
isMouseClickEnabled()
This is used to syncronize the actions between canvases that process mouse clicks. |
void |
plot()
Re-computes everything necessary to plot. |
void |
print(java.awt.Graphics g)
Prints the canvas. |
void |
removeAnnotation(Annotation annotation)
Removes annotation instance from canvas. |
void |
reset()
Resets the canvas to default WCS viewport. |
void |
reset2()
Resets the canvas to WCS viewport adjusted to the central part of the data set. |
void |
setAnnotations(java.util.Map list)
Sets a list of annotation objects. |
void |
setAnnotationSets(java.util.List sets)
Sets a list of annotation sets. |
void |
setAxisType(AxisType at)
Sets the axis types. |
void |
setBorders(int left,
int right,
int top,
int bottom)
Sets the borders around the canvas viewport. |
void |
setCursorDashPattern(java.lang.String dash)
Sets cursor dash pattern. |
void |
setDecorator(GraphicsCanvas decorator)
Stores the next level decorator of this canvas. |
void |
setIntegrationRegions(IntegrationRegionSet regions)
Sets the integration regions to values specified in a list. |
void |
setLogarithm(Logarithm log)
Sets a Logarithm object into this canvas. |
void |
setMarkers(GraphicsMarker[] markers,
java.awt.Color color)
Sets an array of GraphicsMarker objects. |
void |
setMinimumSizes(java.awt.Dimension size)
Sets the canvas minimum size. |
void |
setOriginalObject(java.lang.Object origin)
Sets the original object that gave rise to the plot. |
void |
setOriginalObjectGraphicsID(java.lang.String origin_gid)
Sets the graphics ID of the original object that gave rise to the plot. |
void |
setOriginalObjectID(java.lang.String origin_id)
Sets the ID of the original object that gave rise to the plot. |
void |
setPlottableObject(java.lang.Object plottable)
Sets the original plottable object that gave rise to the plot. |
void |
setSizes(java.awt.Dimension size)
Sets the canvas size. |
void |
setSystemCursor(java.awt.Cursor cursor)
Sets the cursor. |
void |
setTitles(java.lang.String xtitle,
java.lang.String ytitle)
Sets the axis titles. |
void |
setWCSViewport(Viewport wcs)
Sets the WCS viewport. |
void |
setXAutoLog(boolean auto_log)
Sets the auto X log mode. |
void |
setXUnits(Units xunits)
Sets the X units. |
void |
setYAutoLog(boolean auto_log)
Sets the auto Y log mode. |
void |
setYUnits(Units yunits)
Sets the Y units. |
void |
stopCursorObservation()
Stops listening to the global cursor. |
void |
undoWCSViewport()
Goes back to the previous WCS viewport. |
| Methods inherited from interface java.awt.print.Printable |
|---|
print |
| Method Detail |
|---|
void plot()
void print(java.awt.Graphics g)
Graphics context.
g - the Graphics context where to printvoid setOriginalObject(java.lang.Object origin)
origin - the object that gave rise to the plotvoid setPlottableObject(java.lang.Object plottable)
plottable - the plottable object that gave rise to the plotvoid setOriginalObjectID(java.lang.String origin_id)
origin_id - the ID of the object that gave rise to the plotvoid setOriginalObjectGraphicsID(java.lang.String origin_gid)
origin_gid - the graphics ID of the object that gave rise
to the plotjava.lang.Object getOriginalObject()
java.lang.Object getPlottableObject()
java.lang.String getOriginalObjectID()
void setDecorator(GraphicsCanvas decorator)
decorator - the decoratorvoid attachDataSet(DataSet ds)
DataSet instance with the canvas.
Data sets are plotted by attaching them to the plot canvas.
ds - the data set to be attachedjava.util.Vector getDataSets()
DataSet associated with
this canvas.
DataSet associated with
this canvasvoid attachRange(DataSet ds)
DataSet instance with the canvas.
The data sets associated with the canvas by this method get
plotted using a different model. They are meant to depict
data ranges in the independent variable.
ds - the data set to be attachedLogarithm getLogarithm()
Logarithm object associated with this
graphics canvas.
Logarithm object associated with this
graphics canvasvoid setLogarithm(Logarithm log)
Logarithm object into this canvas. The logarithm
object is used to perform conversions between log and linear WCS
spaces.
log - a Logarithm objectvoid setSizes(java.awt.Dimension size)
size - the canvas sizevoid setMinimumSizes(java.awt.Dimension size)
size - the canvas minimum sizevoid reset()
void reset2()
boolean isMouseClickEnabled()
false if other canvases can't be
allowed to process mouse clicksvoid stopCursorObservation()
boolean ignoreCursorEvent()
true if other canvases should ignore
cursor eventsjava.awt.Graphics2D getGraphics2D()
Graphics2D context where data
is being plotted.
Graphics2D context, or
null if the component wasn't painted yet.void addToChart(javax.swing.JComponent component)
component - the chart to be added tojavax.swing.JComponent getJComponent()
JComponent where the plot lives.
java.awt.Cursor getSystemCursor()
void setSystemCursor(java.awt.Cursor cursor)
cursor - the cursorvoid setCursorDashPattern(java.lang.String dash)
dash - the dash patternvoid setWCSViewport(Viewport wcs)
wcs - the WCS viewportvoid undoWCSViewport()
Viewport getWCSViewport()
null if no
data is attached to this canvas.void setXAutoLog(boolean auto_log)
auto_log - the auto log modevoid setYAutoLog(boolean auto_log)
auto_log - the auto log modevoid setAxisType(AxisType at)
at - the axis typeAxisType getAxisType()
Viewport getCanvasViewport()
null if
the canvas size is not defined yet.WCSTransform getTransform()
null if
the canvas size is not defined.java.util.Map getAnnotations()
void setAnnotations(java.util.Map list)
list - the list of annotation objectsvoid removeAnnotation(Annotation annotation)
annotation - the instance to be removedjava.util.List getAnnotationSets()
void setAnnotationSets(java.util.List sets)
sets - the list of annotation sets
void setBorders(int left,
int right,
int top,
int bottom)
left - the left borderright - the right bordertop - the top borderbottom - the bottom border
void setTitles(java.lang.String xtitle,
java.lang.String ytitle)
xtitle - the tite for the X axisytitle - the tite for the Y axisint getLeftBorder()
int getRightBorder()
int getTopBorder()
int getBottomBorder()
Units getXUnits()
Units getYUnits()
void setXUnits(Units xunits)
xunits - the X unitsvoid setYUnits(Units yunits)
yunits - the Y unitsvoid enableIntegrator()
void disableIntegrator()
boolean isMeasurementEnabled()
true if measurements are enabledvoid setIntegrationRegions(IntegrationRegionSet regions)
regions - the region parametersIntegrationRegionSet getIntegrationRegions()
void setMarkers(GraphicsMarker[] markers,
java.awt.Color color)
GraphicsMarker objects.
markers - the array of GraphicsMarker objectscolor - the color to paint the markersvoid eraseMarkers()
void eraseMarkers(GraphicsMarker[] markers)
markers - the markers to be erasedvoid clearInternalReferences()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||