spv.graphics
Class GraphicsCanvasDecorator

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by spv.graphics.GraphicsCanvasDecorator
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable, GraphicsCanvas, PlottableGraphics
Direct Known Subclasses:
AbstractSensitiveCanvas, CursorCanvas, FrameCanvas, GridCanvas, LegendCanvas, PanCanvas, RangeCanvas, VelocityCanvas, WCSBoxCanvas

public abstract class GraphicsCanvasDecorator
extends javax.swing.JComponent
implements GraphicsCanvas, PlottableGraphics, java.awt.print.Printable

Abstract superclass of all classes that implement plot decorators. Subclasses must basically provide a custom implementation of draw( Graphics g ) to perform the specific decorator plotting.

Ex.: to add a cross-hair cursor to a plot, use code such as this:

     GraphicsCanvas canvas = new CursorCanvas( new DataCanvas());
  

A decorated object, or even a bare-bones DataCanvas plot, must be added to a Container object in order to be displayable on screen. This must be done by the way of the getComponent() or getJComponent() methods, that return a Component or JComponent version, respectively, of the GraphicsCanvas plot object.

Ex.:

   JPanel panel = new JPanel();
   panel.setLayout ( new BorderLayout());
   panel.add ( canvas.getComponent(), BorderLayout.CENTER);
  

The use of BorderLayout with "Center" positioning is recommended to allow automatic and transparent plot resizing.

Version:
1.2 - 07Feb01, 1.1 - 20Jan99, 1.0 - 2Dec98
Author:
Ivo Busko (Space Telescope Science Institute)
See Also:
DataCanvas, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  javax.swing.JComponent component
           
 GraphicsCanvas decorated_canvas
           
protected  GraphicsCanvas decorator
           
protected  boolean ignore_cursor
           
protected  boolean printing
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GraphicsCanvasDecorator(GraphicsCanvas decorated_canvas)
          Constructor.
 
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.
private  void dispatchMouseEvent(java.awt.event.MouseEvent e)
          Dispatches mouse events to underlying component.
abstract  void draw(java.awt.Graphics g)
          Performs the drawing operations.
 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 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 paintComponent(java.awt.Graphics g)
          Overrides paintComponent in the superclass.
 void plot()
          Calls the plot() method in the next decorator.
 void print(java.awt.Graphics g)
          Prints this decorator into the given Graphics context, and calls print( Graphics g ) in the decorator above this.
 int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pi)
          Prints this component into the given graphics context, at the specified index and with the specified format.
 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 attached data sets.
 void setAnnotations(java.util.Map list)
          Sets 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 X auto log mode.
 void setXUnits(Units xunits)
          Sets the X units.
 void setYAutoLog(boolean auto_log)
          Sets the Y auto 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 class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

decorated_canvas

public GraphicsCanvas decorated_canvas

decorator

protected GraphicsCanvas decorator

printing

protected boolean printing

ignore_cursor

protected boolean ignore_cursor

component

private javax.swing.JComponent component
Constructor Detail

GraphicsCanvasDecorator

public GraphicsCanvasDecorator(GraphicsCanvas decorated_canvas)
Constructor.

Parameters:
decorated_canvas - the GraphicsCanvas object to be decorated
Method Detail

dispatchMouseEvent

private void dispatchMouseEvent(java.awt.event.MouseEvent e)
Dispatches mouse events to underlying component.

Parameters:
e - the MouseEvent object to be dispatched

paintComponent

public void paintComponent(java.awt.Graphics g)
Overrides paintComponent in the superclass. Just calls the draw() method, which should be implemented in each decorator to perform the drawing operations specific to that decorator.

This method shouldn't normally be called by users; it exists solely to allow an entry point for the underlying windowing system.

Overrides:
paintComponent in class javax.swing.JComponent
Parameters:
g - the graphics context

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pf,
                 int pi)
          throws java.awt.print.PrinterException
Prints this component into the given graphics context, at the specified index and with the specified format. This method just calls print() in the decorated object. The bottommost decorated object (an instance of DataCanvas This method shouldn't normally be called by users; it exists solely to allow an entry point for the underlying system.

Specified by:
print in interface java.awt.print.Printable
Parameters:
g - the graphics context
pf - the page format
pi - the page index
Throws:
java.awt.print.PrinterException

plot

public void plot()
Calls the plot() method in the next decorator.

Specified by:
plot in interface GraphicsCanvas
Specified by:
plot in interface PlottableGraphics

print

public void print(java.awt.Graphics g)
Prints this decorator into the given Graphics context, and calls print( Graphics g ) in the decorator above this. This method is used to consolidate all drawing operations into a single Graphics context.

Specified by:
print in interface GraphicsCanvas
Overrides:
print in class javax.swing.JComponent
Parameters:
g - the graphics context

draw

public abstract void draw(java.awt.Graphics g)
Performs the drawing operations. This method is called by both paintComponent() and print() from the Printable interface.

Specified by:
draw in interface PlottableGraphics
Parameters:
g - the Graphics context where to draw

clearInternalReferences

public void clearInternalReferences()
Specified by:
clearInternalReferences in interface GraphicsCanvas

setOriginalObject

public void setOriginalObject(java.lang.Object origin)
Sets the original object that gave rise to the plot. This is used to provide callback services based on graphics cursor requests.

Specified by:
setOriginalObject in interface GraphicsCanvas
Parameters:
origin - the object that gave rise to the plot

setPlottableObject

public void setPlottableObject(java.lang.Object plottable)
Sets the original plottable object that gave rise to the plot.

Specified by:
setPlottableObject in interface GraphicsCanvas
Parameters:
plottable - the plottable object that gave rise to the plot

setOriginalObjectID

public void setOriginalObjectID(java.lang.String origin_id)
Sets the ID of the original object that gave rise to the plot. This is used to provide more fine grained object identification.

Specified by:
setOriginalObjectID in interface GraphicsCanvas
Parameters:
origin_id - the ID of the object that gave rise to the plot

setOriginalObjectGraphicsID

public void setOriginalObjectGraphicsID(java.lang.String origin_gid)
Sets the graphics ID of the original object that gave rise to the plot. The is used to provide a string that ultimately is going to be drawn on screen for human identification purposes.

Specified by:
setOriginalObjectGraphicsID in interface GraphicsCanvas
Parameters:
origin_gid - the graphics ID of the object that gave rise to the plot

isMouseClickEnabled

public boolean isMouseClickEnabled()
This is used to syncronize the actions between canvases that process mouse clicks.

Specified by:
isMouseClickEnabled in interface GraphicsCanvas
Returns:
false if other canvases can't be allowed to process mouse clicks

getOriginalObject

public java.lang.Object getOriginalObject()
Gets the original object that gave rise to the plot.

Specified by:
getOriginalObject in interface GraphicsCanvas
Returns:
the object that gave rise to the plot

getPlottableObject

public java.lang.Object getPlottableObject()
Gets the plottable object that gave rise to the plot.

Specified by:
getPlottableObject in interface GraphicsCanvas
Returns:
the plottable object that gave rise to the plot

getOriginalObjectID

public java.lang.String getOriginalObjectID()
Gets the ID of the original object that gave rise to the plot.

Specified by:
getOriginalObjectID in interface GraphicsCanvas
Returns:
the ID of the object that gave rise to the plot

setDecorator

public void setDecorator(GraphicsCanvas decorator)
Stores the next level decorator of this canvas.

Specified by:
setDecorator in interface GraphicsCanvas
Parameters:
decorator - the decorator

attachDataSet

public void attachDataSet(DataSet ds)
Associates a DataSet instance with the canvas. Data sets are plotted by attaching them to the plot canvas.

Specified by:
attachDataSet in interface GraphicsCanvas
Parameters:
ds - the data set to be attached

getDataSets

public java.util.Vector getDataSets()
Gets the instances of DataSet associated with this canvas.

Specified by:
getDataSets in interface GraphicsCanvas
Returns:
the instances of DataSet associated with this canvas

attachRange

public void attachRange(DataSet ds)
Associates a 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.

Specified by:
attachRange in interface GraphicsCanvas
Parameters:
ds - the data set to be attached

getLogarithm

public Logarithm getLogarithm()
Gets the Logarithm object associated with this graphics canvas.

Specified by:
getLogarithm in interface GraphicsCanvas
Returns:
the Logarithm object associated with this graphics canvas

setLogarithm

public void setLogarithm(Logarithm log)
Sets a Logarithm object into this canvas. The logarithm object is used to perform conversions between log and linear WCS spaces.

Specified by:
setLogarithm in interface GraphicsCanvas
Parameters:
log - a Logarithm object

reset

public void reset()
Resets the canvas to default WCS viewport. The default WCS viewport is such that all attached data sets are displayed.

Specified by:
reset in interface GraphicsCanvas

reset2

public void reset2()
Resets the canvas to WCS viewport adjusted to the central part of the attached data sets.

Specified by:
reset2 in interface GraphicsCanvas

stopCursorObservation

public void stopCursorObservation()
Stops listening to the global cursor.

Specified by:
stopCursorObservation in interface GraphicsCanvas

ignoreCursorEvent

public boolean ignoreCursorEvent()
This is used to synchronize behavior in between canvases that use the same cursor event for different purposes.

Specified by:
ignoreCursorEvent in interface GraphicsCanvas
Returns:
true if other canvases should ignore cursor events

getJComponent

public javax.swing.JComponent getJComponent()
Gets the Swing JComponent where the plot lives.

Specified by:
getJComponent in interface GraphicsCanvas
Returns:
the Swing component where the plot lives

getSystemCursor

public java.awt.Cursor getSystemCursor()
Gets the cursor.

Specified by:
getSystemCursor in interface GraphicsCanvas
Returns:
the cursor

setSystemCursor

public void setSystemCursor(java.awt.Cursor cursor)
Sets the cursor.

Specified by:
setSystemCursor in interface GraphicsCanvas
Parameters:
cursor - the cursor

setCursorDashPattern

public void setCursorDashPattern(java.lang.String dash)
Sets cursor dash pattern.

Specified by:
setCursorDashPattern in interface GraphicsCanvas
Parameters:
dash - the dash pattern

getGraphics2D

public java.awt.Graphics2D getGraphics2D()
Gets the current Graphics2D context where data is being plotted.

Specified by:
getGraphics2D in interface GraphicsCanvas
Returns:
the current Graphics2D context, or null if no plot took place yet.

addToChart

public void addToChart(javax.swing.JComponent component)
Add yourself to the chart.

Specified by:
addToChart in interface GraphicsCanvas
Parameters:
component - the chart to be added to

setWCSViewport

public void setWCSViewport(Viewport wcs)
Sets the WCS viewport.

Specified by:
setWCSViewport in interface GraphicsCanvas
Parameters:
wcs - the WCS viewport

undoWCSViewport

public void undoWCSViewport()
Goes back to the previous WCS viewport.

Specified by:
undoWCSViewport in interface GraphicsCanvas

getWCSViewport

public Viewport getWCSViewport()
Gets the current WCS viewport.

Specified by:
getWCSViewport in interface GraphicsCanvas
Returns:
the current WCS viewport, or null if no data is attached to this canvas.

setXAutoLog

public void setXAutoLog(boolean auto_log)
Sets the X auto log mode.

Specified by:
setXAutoLog in interface GraphicsCanvas
Parameters:
auto_log - the auto log mode

setYAutoLog

public void setYAutoLog(boolean auto_log)
Sets the Y auto log mode.

Specified by:
setYAutoLog in interface GraphicsCanvas
Parameters:
auto_log - the auto log mode

setAxisType

public void setAxisType(AxisType at)
Sets the axis types.

Specified by:
setAxisType in interface GraphicsCanvas
Parameters:
at - the axis type

getAxisType

public AxisType getAxisType()
Gets the axis types.

Specified by:
getAxisType in interface GraphicsCanvas
Returns:
the axis type

getCanvasViewport

public Viewport getCanvasViewport()
Gets the canvas' current viewport.

Specified by:
getCanvasViewport in interface GraphicsCanvas
Returns:
the canvas' current viewport, or null if the canvas size is not defined yet.

getTransform

public WCSTransform getTransform()
Gets the coordinate transform.

Specified by:
getTransform in interface GraphicsCanvas
Returns:
the coordinate transform, or null if the canvas size is not defined.

getAnnotations

public java.util.Map getAnnotations()
Gets a map of annotation objects.

Specified by:
getAnnotations in interface GraphicsCanvas
Returns:
the map of annotation objects

setAnnotations

public void setAnnotations(java.util.Map list)
Sets annotation objects

Specified by:
setAnnotations in interface GraphicsCanvas
Parameters:
list - the list of annotation objects

removeAnnotation

public void removeAnnotation(Annotation annotation)
Removes annotation instance from canvas.

Specified by:
removeAnnotation in interface GraphicsCanvas
Parameters:
annotation - the instance to be removed

getAnnotationSets

public java.util.List getAnnotationSets()
Gets the list of annotation sets.

Specified by:
getAnnotationSets in interface GraphicsCanvas
Returns:
the list of annotation sets

setAnnotationSets

public void setAnnotationSets(java.util.List sets)
Sets a list of annotation sets.

Specified by:
setAnnotationSets in interface GraphicsCanvas
Parameters:
sets - the list of annotation sets

setBorders

public void setBorders(int left,
                       int right,
                       int top,
                       int bottom)
Sets the borders around the canvas viewport. The new values are immediately used on the next canvas repaint operation.

Specified by:
setBorders in interface GraphicsCanvas
Parameters:
left - the left border
right - the right border
top - the top border
bottom - the bottom border

setTitles

public void setTitles(java.lang.String xtitle,
                      java.lang.String ytitle)
Sets the axis titles.

Specified by:
setTitles in interface GraphicsCanvas
Parameters:
xtitle - the tite for the X axis
ytitle - the tite for the Y axis

getLeftBorder

public int getLeftBorder()
Gets the left border.

Specified by:
getLeftBorder in interface GraphicsCanvas
Returns:
the left border

getRightBorder

public int getRightBorder()
Gets the right border.

Specified by:
getRightBorder in interface GraphicsCanvas
Returns:
the left border

getBottomBorder

public int getBottomBorder()
Gets the bottom border.

Specified by:
getBottomBorder in interface GraphicsCanvas
Returns:
the bottom border

getTopBorder

public int getTopBorder()
Gets the top border.

Specified by:
getTopBorder in interface GraphicsCanvas
Returns:
the bottom border

setSizes

public void setSizes(java.awt.Dimension size)
Sets the canvas size.

Specified by:
setSizes in interface GraphicsCanvas
Parameters:
size - the canvas size

setMinimumSizes

public void setMinimumSizes(java.awt.Dimension size)
Sets the canvas minimum size.

Specified by:
setMinimumSizes in interface GraphicsCanvas
Parameters:
size - the canvas minimum size

getXUnits

public Units getXUnits()
Gets the X units.

Specified by:
getXUnits in interface GraphicsCanvas
Returns:
the X units

getYUnits

public Units getYUnits()
Gets the Y units.

Specified by:
getYUnits in interface GraphicsCanvas
Returns:
the Y units

setXUnits

public void setXUnits(Units xunits)
Sets the X units.

Specified by:
setXUnits in interface GraphicsCanvas
Parameters:
xunits - the X units

setYUnits

public void setYUnits(Units yunits)
Sets the Y units.

Specified by:
setYUnits in interface GraphicsCanvas
Parameters:
yunits - the Y units

enableIntegrator

public void enableIntegrator()
Enables the integrator gizmo.

Specified by:
enableIntegrator in interface GraphicsCanvas

disableIntegrator

public void disableIntegrator()
Disables the measurement gizmo.

Specified by:
disableIntegrator in interface GraphicsCanvas

isMeasurementEnabled

public boolean isMeasurementEnabled()
Checks if measurements are enabled.

Specified by:
isMeasurementEnabled in interface GraphicsCanvas
Returns:
true if measurements are enabled

setIntegrationRegions

public void setIntegrationRegions(IntegrationRegionSet regions)
Sets the integration regions to values specified in a list.

Specified by:
setIntegrationRegions in interface GraphicsCanvas
Parameters:
regions - the region parameters

getIntegrationRegions

public IntegrationRegionSet getIntegrationRegions()
Gets the integration regions.

Specified by:
getIntegrationRegions in interface GraphicsCanvas
Returns:
the integration regions.

setMarkers

public void setMarkers(GraphicsMarker[] markers,
                       java.awt.Color color)
Sets an array of GraphicsMarker objects.

Specified by:
setMarkers in interface GraphicsCanvas
Parameters:
markers - the array of GraphicsMarker objects
color - the color to paint the markers

eraseMarkers

public void eraseMarkers()
Erases all markers.

Specified by:
eraseMarkers in interface GraphicsCanvas

eraseMarkers

public void eraseMarkers(GraphicsMarker[] markers)
Erases selected markers.

Specified by:
eraseMarkers in interface GraphicsCanvas
Parameters:
markers - the markers to be erased