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

ScribbleObject Class Reference

Extension of CanvasObject introducing scribble (editing) behaviour. More...

Inheritance diagram for ScribbleObject::

CanvasObject ScribbleFigure CanvasArrow CanvasArrowGrid CanvasBlob CanvasChain CanvasFigureAggregate CanvasLine CanvasMask CanvasOval CanvasPoint CanvasPolyline CanvasRectangle CanvasString List of all members.

Public Methods

 ScribbleObject (double x, double y, double w, double h)
 Create ScribbleObject with top-left corner of bounding box at position (x, y), and size (w, h). More...

 ScribbleObject (double x, double y, double w, double h, int mode)
 Create ScribbleObject with top-left corner of bounding box at position (x, y), size (w, h), and drawmode 'mode'. More...

 ScribbleObject (double x, double y, double w, double h, int mode, double ccs_scale)
 Create ScribbleObject with top-left corner of bounding box at position (x, y), size (w, h), drawmode 'mode', and scalefactor 'ccs_scale' (used for conversion between the Image Coordinate System and the Canvas Coordinate System). More...

void setDimension (double w, double h)
 Resize CanvasObject to width 'w' and height 'h'. More...

void setPosition (double x, double y)
 Place top left position of CanvasObject's bounding box at position (x, y). More...

void doPixelFit (double zoomFactor)
 Round internal ICS values to nearest natural number. More...

void doMove (double w, double h)
 Move CanvasObject 'w' positions in x-direction, and 'h' posi- tions in y-direction. More...

 ScribbleObject (int x, int y, int w, int h, int mode, double ccs_scale)
void setPosition (int x, int y)
void setDimension (int w, int h)
void doMove (int w, int h)

Detailed Description

Extension of CanvasObject introducing scribble (editing) behaviour.


Constructor & Destructor Documentation

ScribbleObject::ScribbleObject double    x,
double    y,
double    w,
double    h
[inline]
 

Create ScribbleObject with top-left corner of bounding box at position (x, y), and size (w, h).

Parameters are assumed Image Coordinate System values.

00032 {
00033     super(x, y, x+w, y+h);
00034 }

ScribbleObject::ScribbleObject double    x,
double    y,
double    w,
double    h,
int    mode
[inline]
 

Create ScribbleObject with top-left corner of bounding box at position (x, y), size (w, h), and drawmode 'mode'.

Parameters are assumed Image Coordinate System values.

00042 {
00043     super(x, y, x+w, y+h, mode);
00044 }

ScribbleObject::ScribbleObject double    x,
double    y,
double    w,
double    h,
int    mode,
double    ccs_scale
[inline]
 

Create ScribbleObject with top-left corner of bounding box at position (x, y), size (w, h), drawmode 'mode', and scalefactor 'ccs_scale' (used for conversion between the Image Coordinate System and the Canvas Coordinate System).

Parameters are assumed Image Coordinate System values. Related CCS values are calculated according to 'ccs_scale'.

00056 {
00057     super(x, y, x+w, y+h, mode, ccs_scale);
00058 }

ScribbleObject::ScribbleObject int    x,
int    y,
int    w,
int    h,
int    mode,
double    ccs_scale
[inline]
 

00146 {
00147     super(x, y, x+w, y+h, mode, ccs_scale);
00148 }


Member Function Documentation

void ScribbleObject::setDimension double    w,
double    h
[inline]
 

Resize CanvasObject to width 'w' and height 'h'.

Parameters are assumed Image Coordinate System values.

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

00065 {
00066     setX1(getStartX());
00067     setY1(getStartY());
00068 
00069     if (w < 0.) {
00070         w     = -w;
00071         setX1(getX1() - w);
00072     }
00073     if (h < 0.) {
00074         h     = -h;
00075         setY1(getY1() - h);
00076     }
00077     setWidth(w);
00078     setHeight(h);
00079 
00080     setTransformOK(false);
00081 }

void ScribbleObject::setPosition double    x,
double    y
[inline]
 

Place top left position of CanvasObject's bounding box at position (x, y).

Parameters are assumed Image Coordinate System values.

Reimplemented in CanvasArrow.

00088 {
00089     doMove(x-getX1(), y-getY1());
00090 }

void ScribbleObject::doPixelFit double    zoomFactor [inline]
 

Round internal ICS values to nearest natural number.

Although the ICS values are changed, they are not converted to 'integer' internally.

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

00098 {
00099     // Round ICS values...
00100 
00101     setX1(Math.round(getX1()));
00102     setY1(Math.round(getY1()));
00103     setWidth(Math.round(getWidth()));
00104     setHeight(Math.round(getHeight()));
00105     setStartX(Math.round(getStartX()));
00106     setStartY(Math.round(getStartY()));
00107 
00108     setZoomFactor(zoomFactor);
00109     setTransformOK(false);
00110 }

void ScribbleObject::doMove double    w,
double    h
[inline]
 

Move CanvasObject 'w' positions in x-direction, and 'h' posi- tions in y-direction.

Parameters are assumed Image Coordinate System values.

Reimplemented in CanvasArrowGrid, CanvasBlob, CanvasChain, CanvasFigureAggregate, CanvasLine, and CanvasPolyline.

00118 {
00119     setX1(getX1() + w);
00120     setY1(getY1() + h);
00121     setStartX(getStartX() + w);
00122     setStartY(getStartY() + h);
00123     setX2(getX2() + w);
00124     setY2(getY2() + h);
00125 
00126     setTransformOK(false);
00127 }

void ScribbleObject::setPosition int    x,
int    y
[inline]
 

Reimplemented in CanvasArrow.

00152 {
00153     if (!getTransformOK()) {
00154         transformICStoCCS();
00155     }
00156     doMove(x-getX1Ccs(), y-getY1Ccs());
00157 }

void ScribbleObject::setDimension int    w,
int    h
[inline]
 

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

00161 {
00162     if (!getTransformOK()) {
00163         transformICStoCCS();
00164     }
00165 
00166     setX1Ccs(getStartXCcs());
00167     setY1Ccs(getStartYCcs());
00168 
00169     if (w < 0) {
00170         w     = -w;
00171         setX1Ccs(getX1Ccs() - w);
00172     }
00173     if (h < 0.) {
00174         h     = -h;
00175         setY1Ccs(getY1Ccs() - h);
00176     }
00177     setWidthCcs(w);
00178     setHeightCcs(h);
00179 
00180     transformCCStoICS();
00181 }

void ScribbleObject::doMove int    w,
int    h
[inline]
 

Reimplemented in CanvasArrow, CanvasArrowGrid, CanvasBlob, CanvasChain, CanvasFigureAggregate, CanvasLine, and CanvasPolyline.

00185 {
00186     if (!getTransformOK()) {
00187         transformICStoCCS();
00188     }
00189 
00190     setX1Ccs(getX1Ccs() + w);
00191     setY1Ccs(getY1Ccs() + h);
00192     setStartXCcs(getStartXCcs() + w);
00193     setStartYCcs(getStartYCcs() + h);
00194     setX2Ccs(getX2Ccs() + w);
00195     setY2Ccs(getY2Ccs() + h);
00196 
00197     transformCCStoICS();
00198 }


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