Inheritance diagram for CanvasObject::
Public Methods | |
CanvasObject (double x1, double y1, double x2, double y2) | |
Create CanvasObject with top-left corner of bounding box at position (x1, y1), and bottom-right corner at position (x2, y2). More... | |
CanvasObject (double x1, double y1, double x2, double y2, int mode) | |
Create CanvasObject with top-left corner of bounding box at position (x1, y1), and bottom-right corner at position (x2, y2). More... | |
CanvasObject (double x1, double y1, double x2, double y2, int mode, double zoomFactor) | |
Create CanvasObject with top-left corner of bounding box at position (x1, y1), and bottom-right corner at position (x2, y2). More... | |
abstract void | draw (Graphics g) |
Draw CanvasObject on 'g', using internal CCS values. More... | |
abstract Object | clone () |
Return an identical copy of this CanvasObject. More... | |
boolean | inBoundingBox (double x, double y) |
Check if given position is inside CanvasObject's bounding box. More... | |
double | getX1 () |
Return x-value of upper left corner of CanvasObject's bounding box. More... | |
double | getY1 () |
Return y-value of upper left corner of CanvasObject's bounding box. More... | |
double | getX2 () |
Return x-value of lower right corner of CanvasObject's bounding box. More... | |
double | getY2 () |
Return y-value of lower right corner of CanvasObject's bounding box. More... | |
double | getWidth () |
Return width of CanvasObject's bounding box, i.e. More... | |
double | getHeight () |
Return height of CanvasObject's bounding box, i.e. More... | |
int | getX1Pcs () |
Return x-value of upper left corner of CanvasObject's bounding box. More... | |
int | getY1Pcs () |
Return y-value of upper left corner of CanvasObject's bounding box. More... | |
int | getX2Pcs () |
Return x-value of lower right corner of CanvasObject's bounding box. More... | |
int | getY2Pcs () |
Return y-value of lower right corner of CanvasObject's bounding box. More... | |
int | getDrawMode () |
Return current draw-mode. More... | |
void | setDrawMode (int mode) |
Set current draw-mode. More... | |
double | getZoomFactor () |
Return current ICS to CCS zoom-factor. More... | |
void | setZoomFactor (double zoomFactor) |
Scale CanvasObject according to 'zoomFactor'. More... | |
int | getInputSource () |
Return input source, i.e. More... | |
void | setInputSource (int source) |
Set input source. More... | |
String | getSaName () |
Return name of the string addressable object (if valid). More... | |
boolean | getEditable () |
Return whether the object is editable at this moment, i.e. More... | |
void | setEditable (boolean edit) |
Set whether the object is editable at this moment, i.e. More... | |
Vector | getVisualChangeMethods () |
Builds up a list of functions that are to fill a menu for changing the visualization aspects of an object. More... | |
CanvasObject (int x1, int y1, int x2, int y2, int mode, double zoomFactor) | |
To be removed. More... | |
boolean | isInsideCcs (int x, int y) |
To be removed. More... | |
boolean | isNearCcs (int x, int y) |
To be removed. More... | |
boolean | isHitCcs (int x, int y) |
Checks whether this object is selected (hit) based on the bounding box. More... | |
boolean | isHitCcs (int x, int y, Graphics2D g) |
Interface for a more specialized version of isHitCcs for CanvasFigures. More... | |
boolean | inBoundingBoxCcs (int x, int y) |
int | getX1Ccs () |
int | getY1Ccs () |
int | getX2Ccs () |
int | getY2Ccs () |
int | getWidthCcs () |
int | getHeightCcs () |
int | getStartXCcs () |
int | getStartYCcs () |
Dimension | getDimensionCcs () |
void | dump () |
Static Public Attributes | |
final int | INP_USER = 0 |
The user created the object. More... | |
final int | INP_SASYSTEM = 1 |
Some other source created the object. More... | |
final int | INP_CORBA = 1 |
final int | COPY_MODE = 0 |
Copy draw mode. More... | |
final int | XOR_MODE = 1 |
Xor draw mode. More... | |
final Color | XOR_COLOR = Color.cyan |
Xor draw color. More... | |
final int | SPHERE = 3 |
Influence region for isHit. More... | |
final double | DEF_SCALE = 1.0f |
Default scale factor. More... | |
boolean | DEBUG_OBJECTS = false |
Protected Methods | |
void | doInit (double x1, double y1, double x2, double y2, int mode, double zoomFactor) |
Initialize CanvasObject. More... | |
void | setX1 (double x) |
void | setY1 (double y) |
void | setX2 (double x) |
void | setY2 (double y) |
void | setWidth (double w) |
void | setHeight (double h) |
double | getStartX () |
void | setStartX (double x) |
double | getStartY () |
void | setStartY (double y) |
void | setX1Ccs (int x) |
void | setY1Ccs (int y) |
void | setX2Ccs (int x) |
void | setY2Ccs (int y) |
void | setWidthCcs (int w) |
void | setHeightCcs (int h) |
void | setStartXCcs (int x) |
void | setStartYCcs (int y) |
void | setupDrawMode (Graphics g) |
Setup drawmode for 'g'. More... | |
boolean | getTransformOK () |
void | setTransformOK (boolean ok) |
void | transformICStoCCS () |
Perform a full ICS to CCS coordinate transformation. More... | |
void | transformCCStoICS () |
Perform a full CCS to ICS coordinate transformation. More... | |
void | setAdditionalPoints (double[] xCoords, double[] yCoords) |
Set additional points in ICS that will be sync-ed with coordinate transformations. More... | |
int[] | getAddXCcs () |
This function returns a reference (!) to the array of x-coordinates in CCS of the additional points specified by extensions of this class. More... | |
int[] | getAddYCcs () |
This function returns a reference (!) to the array of y-coordinates in CCS of the additional points specified by extensions of this class. More... |
There are two subclasses of objects that can be visualized: bitmap (or raster) images (specializations of CanvasImage) and vector (or line) graphics (specialization of CanvasFigure). The two types of objects differ in the way their internal data is stored, and how it is interpreted to visually represent it on screen. The common behaviour of the objects is combined in this class.
CanvasObjects may originate from different sources. The source is indicated by getInputSource. For now, the sources are the scribbles of the user in the editor and visualizations of string addressable objects. The latter are not editable while the former are, of course. However, editing of scribble objects can be disabled temporarily via the setEditable method.
A CanvasObject defines the smallest bounding box of a visualizable object. The upper left corner of the box in denoted by (X1, Y1) and the lower right corner is denoted by (X1, Y2). These coordinates are stored both in ICS and in CCS format. Subclasses may provide additional coordinates that will be maintained in both formats by CanvasObject via setAdditionalPoints.
Hit Draw Shape VisualChangeSupport
|
Create CanvasObject with top-left corner of bounding box at position (x1, y1), and bottom-right corner at position (x2, y2). Parameters are assumed Image Coordinate System values. |
|
Create CanvasObject with top-left corner of bounding box at position (x1, y1), and bottom-right corner at position (x2, y2). Parameters are assumed Image Coordinate System values. |
|
Create CanvasObject with top-left corner of bounding box at position (x1, y1), and bottom-right corner at position (x2, y2). Parameters are assumed Image Coordinate System values. |
|
To be removed.
|
|
Draw CanvasObject on 'g', using internal CCS values.
Reimplemented in CanvasArrow, CanvasArrowGrid, CanvasBlob, CanvasChain, CanvasColoredPolyline, CanvasFigure, CanvasFigureAggregate, CanvasHxBlob2d, CanvasHxHistogram3d, CanvasHxImage, CanvasHxImageLarge, CanvasJavaImage, CanvasLine, CanvasMask, CanvasOval, CanvasPoint, CanvasPolyline, CanvasRectangle, CanvasString, CanvasCorbaBlob2d, CanvasCorbaImage, and CanvasCorbaSequence. |
|
Return an identical copy of this CanvasObject.
Reimplemented in CanvasArrow, CanvasArrowGrid, CanvasBlob, CanvasChain, CanvasColoredPolyline, CanvasFigure, CanvasFigureAggregate, CanvasImage, CanvasLine, CanvasMask, CanvasOval, CanvasPoint, CanvasPolyline, CanvasRectangle, and CanvasString. |
|
Check if given position is inside CanvasObject's bounding box. Parameters are assumed Image Coordinate System values. |
|
Return x-value of upper left corner of CanvasObject's bounding box. Returned value represents the Image Coordinate System value. |
|
Return y-value of upper left corner of CanvasObject's bounding box. Returned value represents the Image Coordinate System value. |
|
Return x-value of lower right corner of CanvasObject's bounding box. Returned value represents the Image Coordinate System value. |
|
Return y-value of lower right corner of CanvasObject's bounding box. Returned value represents the Image Coordinate System value. |
|
Return width of CanvasObject's bounding box, i.e. X2 - X1. Returned value represents the Image Coordinate System value. |
|
Return height of CanvasObject's bounding box, i.e. Y2 - Y1. Returned value represents the Image Coordinate System value. |
|
Return x-value of upper left corner of CanvasObject's bounding box. Returned value represents the Pixel Coordinate System value. |
|
Return y-value of upper left corner of CanvasObject's bounding box. Returned value represents the Pixel Coordinate System value. |
|
Return x-value of lower right corner of CanvasObject's bounding box. Returned value represents the Pixel Coordinate System value. A small correction to the ICS value is made to ensure it falls within the bounding image box. |
|
Return y-value of lower right corner of CanvasObject's bounding box. Returned value represents the Pixel Coordinate System value. A small correction to the ICS value is made to ensure it falls within the bounding image box. |
|
Return current draw-mode.
|
|
Set current draw-mode.
Reimplemented in CanvasBlob, and CanvasFigureAggregate. |
|
Return current ICS to CCS zoom-factor.
|
|
Scale CanvasObject according to 'zoomFactor'. The internal ICS values are taken as base values to calculate the associated CCS values. Reimplemented in CanvasArrow, CanvasArrowGrid, CanvasBlob, CanvasFigureAggregate, and CanvasString. |
|
Return input source, i.e. who/what created the object. |
|
Set input source.
|
|
Return name of the string addressable object (if valid).
Reimplemented in CanvasHxBlob2d, CanvasHxBSplineCurve, CanvasHxHistogram, CanvasHxImage, CanvasHxImageLarge, CanvasHxPolyline2d, and CanvasHxSampledBSplineCurve. |
|
Return whether the object is editable at this moment, i.e. whether the object is selectable when moving, copying, reshaping, etc. |
|
Set whether the object is editable at this moment, i.e. whether the object is selectable when moving, copying, reshaping, etc. |
|
Builds up a list of functions that are to fill a menu for changing the visualization aspects of an object. Classes derived from this one typically add their class-specific methods to their parents' methods by first calling the parent to fill the vector and then add their own. The result is a Vector of CallableMethods. Reimplemented in CanvasArrow, CanvasBlob, CanvasFigure, CanvasHxBlob2d, CanvasHxBSplineCurve, CanvasHxImage, CanvasHxImageLarge, CanvasHxSampledBSplineCurve, CanvasPolyline, ScribbleFigure, CanvasCorbaBlob2d, CanvasCorbaBSplineCurve, CanvasCorbaImage, and CanvasCorbaSampledBSplineCurve. |
|
To be removed.
Reimplemented in CanvasArrow, CanvasArrowGrid, CanvasBlob, CanvasChain, CanvasFigureAggregate, CanvasImage, CanvasLine, CanvasMask, CanvasOval, CanvasPoint, CanvasPolyline, CanvasRectangle, and CanvasString. |
|
To be removed.
Reimplemented in CanvasArrow, CanvasArrowGrid, CanvasBlob, CanvasChain, CanvasFigureAggregate, CanvasImage, CanvasLine, CanvasMask, CanvasOval, CanvasPoint, CanvasPolyline, CanvasRectangle, and CanvasString. |
|
Checks whether this object is selected (hit) based on the bounding box.
|
|
Interface for a more specialized version of isHitCcs for CanvasFigures. The default implementation is the same as isHitCcs(int x, int y) but CanvasFigure provides a more accurate version based on the figures shape. Reimplemented in CanvasFigure. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Initialize CanvasObject.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Setup drawmode for 'g'.
Reimplemented in CanvasFigure, and ScribbleFigure. |
|
|
|
|
|
Perform a full ICS to CCS coordinate transformation.
Reimplemented in CanvasArrow, CanvasArrowGrid, CanvasChain, CanvasColoredPolyline, CanvasLine, and CanvasPolyline. |
|
Perform a full CCS to ICS coordinate transformation. This function is used only for scribbled objects. Reimplemented in CanvasArrowGrid, CanvasColoredPolyline, CanvasLine, and CanvasPolyline. |
|
Set additional points in ICS that will be sync-ed with coordinate transformations. Warning: the references to the arrays given will be stored. |
|
This function returns a reference (!) to the array of x-coordinates in CCS of the additional points specified by extensions of this class.
|
|
This function returns a reference (!) to the array of y-coordinates in CCS of the additional points specified by extensions of this class.
|
|
The user created the object.
|
|
Some other source created the object.
|
|
|
|
Copy draw mode.
|
|
Xor draw mode.
|
|
Xor draw color.
|
|
Influence region for isHit.
|
|
Default scale factor.
|
|
|