Horus Doc || Java GUI Reference || Doxygen's quick Index  

CanvasObject Class Reference

Base class of all objects that can be drawn on a canvas (still under construction). More...

Inheritance diagram for CanvasObject::

CanvasFigure CanvasImage ScribbleObject CanvasCorbaBlob2d CanvasCorbaBSplineCurve CanvasCorbaHistogram CanvasCorbaPolyline2d CanvasCorbaSampledBSplineCurve CanvasHxBlob2d CanvasHxBSplineCurve CanvasHxHistogram CanvasHxPolyline2d CanvasHxSampledBSplineCurve CanvasCorbaImage CanvasCorbaSequence CanvasHxHistogram3d CanvasHxImage CanvasHxImageLarge CanvasJavaImage ScribbleFigure List of all members.

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...


Detailed Description

Base class of all objects that can be drawn on a canvas (still under construction).

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


Constructor & Destructor Documentation

CanvasObject::CanvasObject double    x1,
double    y1,
double    x2,
double    y2
[inline]
 

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.

00080 {
00081     doInit(x1, y1, x2, y2, COPY_MODE, DEF_SCALE);
00082 }

CanvasObject::CanvasObject double    x1,
double    y1,
double    x2,
double    y2,
int    mode
[inline]
 

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.

00090 {
00091     doInit(x1, y1, x2, y2, mode, DEF_SCALE);
00092 }

CanvasObject::CanvasObject double    x1,
double    y1,
double    x2,
double    y2,
int    mode,
double    zoomFactor
[inline]
 

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.

00101 {
00102     doInit(x1, y1, x2, y2, mode, zoomFactor);
00103 }

CanvasObject::CanvasObject int    x1,
int    y1,
int    x2,
int    y2,
int    mode,
double    zoomFactor
[inline]
 

To be removed.

00340 {
00341     int[]    ccsVals = { x1, y1, x2, y2 };
00342     double[] icsVals = Converter.CCStoICS(ccsVals, zoomFactor);
00343 
00344     doInit(icsVals[0], icsVals[1], icsVals[2], icsVals[3], mode, zoomFactor);
00345 }


Member Function Documentation

abstract void CanvasObject::draw Graphics    g [pure virtual]
 

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.

abstract Object CanvasObject::clone   [pure virtual]
 

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.

boolean CanvasObject::inBoundingBox double    x,
double    y
[inline]
 

Check if given position is inside CanvasObject's bounding box.

Parameters are assumed Image Coordinate System values.

00120 {
00121     if ((x >= _ics[X1]) && (x < _ics[X2]) &&
00122                     (y >= _ics[Y1]) && (y < _ics[Y2])) {
00123         return true;
00124     }
00125     return false;
00126 }

double CanvasObject::getX1   [inline]
 

Return x-value of upper left corner of CanvasObject's bounding box.

Returned value represents the Image Coordinate System value.

00133 {
00134     return _ics[X1];
00135 }

double CanvasObject::getY1   [inline]
 

Return y-value of upper left corner of CanvasObject's bounding box.

Returned value represents the Image Coordinate System value.

00142 {
00143     return _ics[Y1];
00144 }

double CanvasObject::getX2   [inline]
 

Return x-value of lower right corner of CanvasObject's bounding box.

Returned value represents the Image Coordinate System value.

00151 {
00152     return _ics[X2];
00153 }

double CanvasObject::getY2   [inline]
 

Return y-value of lower right corner of CanvasObject's bounding box.

Returned value represents the Image Coordinate System value.

00160 {
00161     return _ics[Y2];
00162 }

double CanvasObject::getWidth   [inline]
 

Return width of CanvasObject's bounding box, i.e.

X2 - X1. Returned value represents the Image Coordinate System value.

00169 {
00170     return _ics[X2] - _ics[X1];
00171 }

double CanvasObject::getHeight   [inline]
 

Return height of CanvasObject's bounding box, i.e.

Y2 - Y1. Returned value represents the Image Coordinate System value.

00178 {
00179     return _ics[Y2] - _ics[Y1];
00180 }

int CanvasObject::getX1Pcs   [inline]
 

Return x-value of upper left corner of CanvasObject's bounding box.

Returned value represents the Pixel Coordinate System value.

00187 {
00188     return Converter.ICStoPCS(_ics[X1], false);
00189 }

int CanvasObject::getY1Pcs   [inline]
 

Return y-value of upper left corner of CanvasObject's bounding box.

Returned value represents the Pixel Coordinate System value.

00196 {
00197     return Converter.ICStoPCS(_ics[Y1], false);
00198 }

int CanvasObject::getX2Pcs   [inline]
 

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.

00207 {
00208     return Converter.ICStoPCS(_ics[X2], true);
00209 }

int CanvasObject::getY2Pcs   [inline]
 

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.

00218 {
00219     return Converter.ICStoPCS(_ics[Y2], true);
00220 }

int CanvasObject::getDrawMode   [inline]
 

Return current draw-mode.

00226 {
00227     return _drawMode;
00228 }

void CanvasObject::setDrawMode int    mode [inline]
 

Set current draw-mode.

Reimplemented in CanvasBlob, and CanvasFigureAggregate.

00234 {
00235     switch (mode) {
00236         case COPY_MODE :
00237 
00238         case XOR_MODE  : this._drawMode = mode;
00239                          break;
00240 
00241         default        : this._drawMode = COPY_MODE;
00242                          break;
00243     }
00244 }

double CanvasObject::getZoomFactor   [inline]
 

Return current ICS to CCS zoom-factor.

00250 {
00251     return _zoomFactor;
00252 }

void CanvasObject::setZoomFactor double    zoomFactor [inline]
 

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.

00259 {
00260     _zoomFactor = zoomFactor;
00261     _transformOK = false;
00262 }

int CanvasObject::getInputSource   [inline]
 

Return input source, i.e.

who/what created the object.

00268 {
00269     return _inputSource;
00270 }

void CanvasObject::setInputSource int    source [inline]
 

Set input source.

00276 {
00277     _inputSource = source;
00278 }

String CanvasObject::getSaName   [inline]
 

Return name of the string addressable object (if valid).

Reimplemented in CanvasHxBlob2d, CanvasHxBSplineCurve, CanvasHxHistogram, CanvasHxImage, CanvasHxImageLarge, CanvasHxPolyline2d, and CanvasHxSampledBSplineCurve.

00284 {
00285     return new String("unknown");
00286 }

boolean CanvasObject::getEditable   [inline]
 

Return whether the object is editable at this moment, i.e.

whether the object is selectable when moving, copying, reshaping, etc.

00293 {
00294     if (getInputSource() == INP_SASYSTEM)
00295         return false;
00296     return _editable;
00297 }

void CanvasObject::setEditable boolean    edit [inline]
 

Set whether the object is editable at this moment, i.e.

whether the object is selectable when moving, copying, reshaping, etc.

00304 {
00305     _editable = edit;
00306 }

Vector CanvasObject::getVisualChangeMethods   [inline]
 

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.

00316 {
00317     Vector v = new Vector();
00318     v.add(new CallableMethod("setEditable", "boolean", "b", "boolean"));
00319     return v;
00320 }

boolean CanvasObject::isInsideCcs int    x,
int    y
[inline]
 

To be removed.

Reimplemented in CanvasArrow, CanvasArrowGrid, CanvasBlob, CanvasChain, CanvasFigureAggregate, CanvasImage, CanvasLine, CanvasMask, CanvasOval, CanvasPoint, CanvasPolyline, CanvasRectangle, and CanvasString.

00351 {
00352     return false;
00353 }

boolean CanvasObject::isNearCcs int    x,
int    y
[inline]
 

To be removed.

Reimplemented in CanvasArrow, CanvasArrowGrid, CanvasBlob, CanvasChain, CanvasFigureAggregate, CanvasImage, CanvasLine, CanvasMask, CanvasOval, CanvasPoint, CanvasPolyline, CanvasRectangle, and CanvasString.

00359 {
00360     return false;
00361 }

boolean CanvasObject::isHitCcs int    x,
int    y
[inline]
 

Checks whether this object is selected (hit) based on the bounding box.

00367 {
00368     return inBoundingBoxCcs(x, y);
00369 }

boolean CanvasObject::isHitCcs int    x,
int    y,
Graphics2D    g
[inline]
 

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.

00377 {
00378     return isHitCcs(x, y);
00379 }

boolean CanvasObject::inBoundingBoxCcs int    x,
int    y
[inline]
 

00383 {
00384     if (!_transformOK)
00385         transformICStoCCS();
00386     if ((x >= _ccs[X1]) && (x <= _ccs[X2]) &&
00387         (y >= _ccs[Y1]) && (y <= _ccs[Y2])) {
00388         return true;
00389     }
00390     return false;
00391 }

int CanvasObject::getX1Ccs   [inline]
 

00395 {
00396     if (!_transformOK)
00397         transformICStoCCS();
00398     return _ccs[X1];
00399 }

int CanvasObject::getY1Ccs   [inline]
 

00403 {
00404     if (!_transformOK)
00405         transformICStoCCS();
00406     return _ccs[Y1];
00407 }

int CanvasObject::getX2Ccs   [inline]
 

00411 {
00412     if (!_transformOK)
00413         transformICStoCCS();
00414     return _ccs[X2];
00415 }

int CanvasObject::getY2Ccs   [inline]
 

00419 {
00420     if (!_transformOK)
00421         transformICStoCCS();
00422     return _ccs[Y2];
00423 }

int CanvasObject::getWidthCcs   [inline]
 

00427 {
00428     if (!_transformOK)
00429         transformICStoCCS();
00430     return _ccs[X2] - _ccs[X1];
00431 }

int CanvasObject::getHeightCcs   [inline]
 

00435 {
00436     if (!_transformOK)
00437         transformICStoCCS();
00438     return _ccs[Y2] - _ccs[Y1];
00439 }

int CanvasObject::getStartXCcs   [inline]
 

00443 {
00444     if (!_transformOK)
00445         transformICStoCCS();
00446     return _ccs[SX];
00447 }

int CanvasObject::getStartYCcs   [inline]
 

00451 {
00452     if (!_transformOK)
00453         transformICStoCCS();
00454     return _ccs[SY];
00455 }

Dimension CanvasObject::getDimensionCcs   [inline]
 

00459 {
00460     if (!_transformOK)
00461         transformICStoCCS();
00462     return new Dimension(getWidthCcs(), getHeightCcs());
00463 }

void CanvasObject::dump   [inline]
 

00467 {
00468     if (!_transformOK)
00469         transformICStoCCS();
00470     OutputStreamArea.println("dump CanvasObject");
00471     OutputStreamArea.println("     ICS: x1:  " + _ics[X1] + ", y1: " + _ics[Y1] +
00472                                      ", w: " + getWidth() + ", h: " + getHeight() +
00473                                      ", x2: " + _ics[X2] + ", y2: " + _ics[Y2]);
00474     OutputStreamArea.println("     PCS: x1:  " + getX1Pcs() + ", y1: " + getY1Pcs() +
00475                                      ", x2: " + getX2Pcs() + ", y2: " + getY2Pcs());
00476     OutputStreamArea.println("     CCS: x1:  " + _ccs[X1] + ", y1: " + _ccs[Y1] +
00477                                      ", w: " + getWidthCcs() + ", h: " + getHeightCcs() +
00478                                      ", x2: " + _ccs[X2] + ", y2: " + _ccs[Y2]);
00479 /*
00480     if (_addXIcs == null)
00481         return;
00482     for (int i=0 ; i<_addXIcs.length ; i++)
00483         OutputStreamArea.println("     addIcs: " + _addXIcs[i] + ", " + _addYIcs[i]);
00484 */
00485 }

void CanvasObject::doInit double    x1,
double    y1,
double    x2,
double    y2,
int    mode,
double    zoomFactor
[inline, protected]
 

Initialize CanvasObject.

00499 {
00500     setDrawMode(mode);
00501 
00502     _zoomFactor = zoomFactor;
00503     _ics[X1] = x1;
00504     _ics[Y1] = y1;
00505     _ics[X2] = x2;
00506     _ics[Y2] = y2;
00507     _ics[SX] = x1;
00508     _ics[SY] = y1;
00509 
00510     transformICStoCCS();
00511 }

void CanvasObject::setX1 double    x [inline, protected]
 

00515 {
00516     _ics[X1] = x;
00517 }

void CanvasObject::setY1 double    y [inline, protected]
 

00521 {
00522     _ics[Y1] = y;
00523 }

void CanvasObject::setX2 double    x [inline, protected]
 

00527 {
00528     _ics[X2] = x;
00529 }

void CanvasObject::setY2 double    y [inline, protected]
 

00533 {
00534     _ics[Y2] = y;
00535 }

void CanvasObject::setWidth double    w [inline, protected]
 

Deprecated:

00541 {
00542     _ics[X2] = _ics[X1] + w;
00543 }

void CanvasObject::setHeight double    h [inline, protected]
 

Deprecated:

00549 {
00550     _ics[Y2] = _ics[Y1] + h;
00551 }

double CanvasObject::getStartX   [inline, protected]
 

00555 {
00556     return _ics[SX];
00557 }

void CanvasObject::setStartX double    x [inline, protected]
 

00561 {
00562     _ics[SX] = x;
00563 }

double CanvasObject::getStartY   [inline, protected]
 

00567 {
00568     return _ics[SY];
00569 }

void CanvasObject::setStartY double    y [inline, protected]
 

00573 {
00574     _ics[SY] = y;
00575 }

void CanvasObject::setX1Ccs int    x [inline, protected]
 

00579 {
00580     _ccs[X1] = x;
00581 }

void CanvasObject::setY1Ccs int    y [inline, protected]
 

00585 {
00586     _ccs[Y1] = y;
00587 }

void CanvasObject::setX2Ccs int    x [inline, protected]
 

00591 {
00592     _ccs[X2] = x;
00593 }

void CanvasObject::setY2Ccs int    y [inline, protected]
 

00597 {
00598     _ccs[Y2] = y;
00599 }

void CanvasObject::setWidthCcs int    w [inline, protected]
 

Deprecated:

00605 {
00606     _ccs[X2] = _ccs[X1] + w;
00607 }

void CanvasObject::setHeightCcs int    h [inline, protected]
 

Deprecated:

00613 {
00614     _ccs[Y2] = _ccs[Y1] + h;
00615 }

void CanvasObject::setStartXCcs int    x [inline, protected]
 

00619 {
00620     _ccs[SX] = x;
00621 }

void CanvasObject::setStartYCcs int    y [inline, protected]
 

00625 {
00626     _ccs[SY] = y;
00627 }

void CanvasObject::setupDrawMode Graphics    g [inline, protected]
 

Setup drawmode for 'g'.

Reimplemented in CanvasFigure, and ScribbleFigure.

00633 {
00634 if (g == null)
00635 OutputStreamArea.println("........g == null");
00636     switch (this._drawMode) {
00637         case COPY_MODE : g.setPaintMode();
00638                          break;
00639 
00640         case XOR_MODE  : g.setXORMode(XOR_COLOR);
00641                          break;
00642 
00643         default        : break;
00644     }
00645 }

boolean CanvasObject::getTransformOK   [inline, protected]
 

00649 {
00650     return _transformOK;
00651 }

void CanvasObject::setTransformOK boolean    ok [inline, protected]
 

00655 {
00656     _transformOK = ok;
00657 }

void CanvasObject::transformICStoCCS   [inline, protected]
 

Perform a full ICS to CCS coordinate transformation.

Reimplemented in CanvasArrow, CanvasArrowGrid, CanvasChain, CanvasColoredPolyline, CanvasLine, and CanvasPolyline.

00663 {
00664     Converter.ICStoCCS(_ics, _ccs, _zoomFactor);
00665     if (_addXIcs != null) {
00666         Converter.ICStoCCS(_addXIcs, _addXCcs, _zoomFactor);
00667         Converter.ICStoCCS(_addYIcs, _addYCcs, _zoomFactor);
00668     }
00669     _transformOK = true;
00670 }

void CanvasObject::transformCCStoICS   [inline, protected]
 

Perform a full CCS to ICS coordinate transformation.

This function is used only for scribbled objects.

Reimplemented in CanvasArrowGrid, CanvasColoredPolyline, CanvasLine, and CanvasPolyline.

00677 {
00678     Converter.CCStoICS(_ccs, _ics, _zoomFactor);
00679     if (_addXIcs != null) {
00680         Converter.CCStoICS(_addXCcs, _addXIcs, _zoomFactor);
00681         Converter.CCStoICS(_addYCcs, _addYIcs, _zoomFactor);
00682     }
00683 }

void CanvasObject::setAdditionalPoints double    xCoords[],
double    yCoords[]
[inline, protected]
 

Set additional points in ICS that will be sync-ed with coordinate transformations.

Warning: the references to the arrays given will be stored.

00691 {
00692     _addXIcs = xCoords;
00693     _addYIcs = yCoords;
00694     _addXCcs = new int[_addXIcs.length];
00695     _addYCcs = new int[_addYIcs.length];
00696     _transformOK = false;
00697 }

int [] CanvasObject::getAddXCcs   [inline, protected]
 

This function returns a reference (!) to the array of x-coordinates in CCS of the additional points specified by extensions of this class.

00704 {
00705     if (!_transformOK)
00706         transformICStoCCS();
00707     return _addXCcs;
00708 }

int [] CanvasObject::getAddYCcs   [inline, protected]
 

This function returns a reference (!) to the array of y-coordinates in CCS of the additional points specified by extensions of this class.

00715 {
00716     if (!_transformOK)
00717         transformICStoCCS();
00718     return _addYCcs;
00719 }


Member Data Documentation

final int CanvasObject::INP_USER = 0 [static]
 

The user created the object.

final int CanvasObject::INP_SASYSTEM = 1 [static]
 

Some other source created the object.

final int CanvasObject::INP_CORBA = 1 [static]
 

final int CanvasObject::COPY_MODE = 0 [static]
 

Copy draw mode.

final int CanvasObject::XOR_MODE = 1 [static]
 

Xor draw mode.

final Color CanvasObject::XOR_COLOR = Color.cyan [static]
 

Xor draw color.

final int CanvasObject::SPHERE = 3 [static]
 

Influence region for isHit.

final double CanvasObject::DEF_SCALE = 1.0f [static]
 

Default scale factor.

boolean CanvasObject::DEBUG_OBJECTS = false [static]
 


The documentation for this class was generated from the following file:
Generated on Tue Feb 3 14:19:40 2004 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001