Inheritance diagram for CanvasViewer::
Public Methods | |
CanvasViewer () | |
Constructor. More... | |
int | getViewerID () |
Get the ID of this viewer. More... | |
int | getMode () |
Get the viewer mode (see class ViewerMode). More... | |
int | getSubMode () |
Get the viewer sub-mode (see class ViewerMode). More... | |
void | setMode (int mode, int subMode) |
Set the viewer mode (see class ViewerMode). More... | |
boolean | isEnabledMode (int mode) |
Check whether the given viewer mode (see class ViewerMode) is enabled. More... | |
void | setEnableMode (int mode, boolean b) |
Set whether the given viewer mode (see class ViewerMode) is enabled. More... | |
Color | getDefaultDrawColor () |
Get the default drawing color of this viewer. More... | |
void | setDefaultDrawColor (Color c) |
Set the default drawing color of this viewer. More... | |
Color | getBackgroundColor () |
Get the background color of this viewer. More... | |
void | setBackgroundColor (Color c) |
Set the background color of this viewer. More... | |
void | addViewerInspectionListener (ViewerInspectionListener l) |
Add a viewer inspection listener. More... | |
void | removeViewerInspectionListener (ViewerInspectionListener l) |
Remove a viewer inspection listener. More... | |
void | addViewerEditListener (ViewerEditListener l) |
Add a viewer edit listener. More... | |
void | removeViewerEditListener (ViewerEditListener l) |
Remove a viewer edit listener. More... | |
void | doRefresh () |
Repaint the viewer by repainting its canvas. More... | |
void | doClear () |
Clear the canvas. More... | |
void | doPan (double relX, double relY) |
Pan to the given position, coordinates between 0 and 1. More... | |
void | doZoom (double zoomVal) |
Zoom to the given factor. More... | |
double | getZoomFactor () |
Get zoom factor. More... | |
BufferedImage | toImage () |
Render the canvas of the viewer in an image. More... | |
BufferedImage | toImage (int width, int height) |
Render the canvas of the viewer in an image. More... | |
int | addObject (CanvasObject obj) |
Add a CanvasObject to the viewer. More... | |
CanvasObject | getObject (int objID) |
Get the CanvasObject with the given ID from the editor. More... | |
CanvasObject | getObjectCopy (int objID, boolean ics) |
Get a copy of the CanvasObject with the given ID from the editor. More... | |
CanvasObject | getObject (String objName) |
Get the CanvasObject with the given name from the visualizer. More... | |
void | removeObject (int objID) |
Remove given object from the editor. More... | |
void | removeObject (String objName) |
Remove given object from the visualizer. More... | |
void | removeAllObjects () |
Remove all objects. More... | |
void | canvasEntered (Object canvas, double x, double y) |
Implementation of CanvasInspectionUser. More... | |
void | canvasExited (Object canvas) |
Implementation of CanvasInspectionUser. More... | |
void | canvasSelected (Object canvas, double x, double y) |
Implementation of CanvasInspectionUser. More... | |
void | objectEntered (Object canvas, CanvasObject cObj, int objID, double x, double y) |
Implementation of CanvasInspectionUser. More... | |
void | objectProbed (Object canvas, CanvasObject cObj, int objID, double x, double y) |
Implementation of CanvasInspectionUser. More... | |
void | objectSelected (Object canvas, CanvasObject cObj, int objID, double x, double y) |
Implementation of CanvasInspectionUser. More... | |
void | objectCreated (Object canvas, CanvasObject cObj, int objID) |
Implementation of CanvasEditUser. More... | |
void | objectDeleted (Object canvas, CanvasObject cObj, int objID) |
Implementation of CanvasEditUser. More... | |
void | objectMoved (Object canvas, CanvasObject cObj, int objID) |
Implementation of CanvasEditUser. More... | |
void | objectResized (Object canvas, CanvasObject cObj, int objID) |
Implementation of CanvasEditUser. More... | |
void | objectReshaped (Object canvas, CanvasObject cObj, int objID, int point) |
Implementation of CanvasEditUser. More... | |
void | objectChangedVisually (Object canvas, CanvasObject cObj, int objID, String prop) |
Implementation of CanvasEditUser. More... | |
Static Public Attributes | |
final Color | STD_BCOLOR = IcsCanvas.STD_BCOLOR |
The standard background color. More... | |
final Color | STD_DCOLOR = IcsCanvas.STD_DCOLOR |
The standard drawing color. More... | |
final int | SCROLL_NEVER = 0 |
Never use scrollbars. More... | |
final int | SCROLL_ALWAYS = 1 |
Always use scrollbars. More... | |
final int | SCROLL_AS_NEEDED = 2 |
Use scrollbars when needed. More... | |
Protected Methods | |
void | initScrollPane (int scrollers) |
Will initialize the ScrollPane with a single canvas (\_editor) or a LayeredCanvasPane with \_editor, etc. More... | |
Protected Attributes | |
int | _viewerID = 0 |
JScrollPane | _scrollPane = null |
boolean | _singleCanvas = false |
ActiveCanvas | _editor = null |
VisCanvas | _visualizer = null |
Vector | _inspListeners = new Vector() |
Vector | _editListeners = new Vector() |
The basic CanvasViewer contains two IcsCanvas's put on top of eachother. The upper canvas is called the editor and allows the user to "scribble" in the viewer. The lower canvas is called the visualizer and allows for visualization of C++ objects that are known to the mediator, i.e. they are StringAddressable. These object are not editable. Each canvas puts instances of CanvasFigure on top of instances of CanvasImage as they would otherwise not be visisble. This results in the following layered structure (with the highest number on top): 4) CanvasFigure (s) : getInputSource() == INP\_USER 3) CanvasImage (s) : getInputSource() == INP\_USER 2) CanvasFigure (s) : getInputSource() == INP\_SASYSTEM 1) CanvasImage (s) : getInputSource() == INP\_SASYSTEM
|
Constructor.
|
|
Get the ID of this viewer.
|
|
Get the viewer mode (see class ViewerMode). Not all viewers actually respond to this. |
|
Get the viewer sub-mode (see class ViewerMode). Not all viewers actually respond to this. |
|
Set the viewer mode (see class ViewerMode). Not all viewers actually respond to this. Reimplemented in ScribbleViewer. |
|
Check whether the given viewer mode (see class ViewerMode) is enabled. Not all viewers actually respond to this. Reimplemented in ScribbleViewer. |
|
Set whether the given viewer mode (see class ViewerMode) is enabled. Not all viewers actually respond to this. Reimplemented in ScribbleViewer. |
|
Get the default drawing color of this viewer.
|
|
Set the default drawing color of this viewer.
|
|
Get the background color of this viewer.
|
|
Set the background color of this viewer. Will also repaint the viewer. |
|
Add a viewer inspection listener.
|
|
Remove a viewer inspection listener.
|
|
Add a viewer edit listener.
|
|
Remove a viewer edit listener.
|
|
Repaint the viewer by repainting its canvas.
|
|
Clear the canvas. Sets the zoom factor to 1.0 and removes all objects from the canvas, Clearing will fit the canvas to the size of the viewport. Reimplemented in ScribbleViewer. |
|
Pan to the given position, coordinates between 0 and 1.
|
|
Zoom to the given factor.
Reimplemented in ScribbleViewer. |
|
Get zoom factor.
|
|
Render the canvas of the viewer in an image. The size of the image will match the extent of the ICS. The rendering is done at the current zoom. |
|
Render the canvas of the viewer in an image. The size of the image will be width x height. The rendering is done at the current zoom. |
|
Add a CanvasObject to the viewer. If the input source of the object equals INP\_SASYSTEM the object will be put on the visualizer. Otherwise, it will be put on the editor. Returns the id of the object. The id is the preferred way to access objects in an editor as direct references to objects may become invalid due to internal activities of the editor. As the visualizer does not change the CanvasObject it is save to keep references to objects in a visualizer. Reimplemented in Histogram3dViewer, and ThumbnailViewer. |
|
Get the CanvasObject with the given ID from the editor.
|
|
Get a copy of the CanvasObject with the given ID from the editor.
|
|
Get the CanvasObject with the given name from the visualizer.
|
|
Remove given object from the editor.
|
|
Remove given object from the visualizer.
|
|
Remove all objects.
|
|
Implementation of CanvasInspectionUser.
Reimplemented from CanvasInspectionUser. |
|
Implementation of CanvasInspectionUser.
Reimplemented from CanvasInspectionUser. |
|
Implementation of CanvasInspectionUser.
Reimplemented from CanvasInspectionUser. |
|
Implementation of CanvasInspectionUser.
Reimplemented from CanvasInspectionUser. |
|
Implementation of CanvasInspectionUser.
Reimplemented from CanvasInspectionUser. |
|
Implementation of CanvasInspectionUser.
Reimplemented from CanvasInspectionUser. |
|
Implementation of CanvasEditUser.
Reimplemented from CanvasEditUser. |
|
Implementation of CanvasEditUser.
Reimplemented from CanvasEditUser. |
|
Implementation of CanvasEditUser.
Reimplemented from CanvasEditUser. |
|
Implementation of CanvasEditUser.
Reimplemented from CanvasEditUser. |
|
Implementation of CanvasEditUser.
Reimplemented from CanvasEditUser. |
|
Implementation of CanvasEditUser.
Reimplemented from CanvasEditUser. |
|
Will initialize the ScrollPane with a single canvas (\_editor) or a LayeredCanvasPane with \_editor, etc.
|
|
The standard background color.
|
|
The standard drawing color.
|
|
Never use scrollbars.
|
|
Always use scrollbars.
|
|
Use scrollbars when needed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|