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

CanvasPoint Class Reference

Inheritance diagram for CanvasPoint::

ScribbleFigure ScribbleObject CanvasObject List of all members.

Public Methods

 CanvasPoint (double x, double y)
 CanvasPoint (double x, double y, Color color)
 CanvasPoint (double x, double y, Color color, double ccs_scale)
 CanvasPoint (double x, double y, int mode, Color color, float trans, double ccs_scale)
void draw (Graphics g)
 Draw CanvasObject on 'g', using internal CCS values. More...

Object clone ()
 Return an identical copy of this CanvasObject. More...

boolean isInside (double x, double y)
boolean isNear (double x, double y)
void setDimension (double w, double h)
 Resize CanvasObject to width 'w' and height 'h'. More...

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

 CanvasPoint (int x, int y, int mode, Color color, double ccs_scale)
boolean isInsideCcs (int x, int y)
 To be removed. More...

boolean isNearCcs (int x, int y)
 To be removed. More...

void setDimension (int w, int h)

Static Public Attributes

final double STD_SIZE = 1.0

Protected Methods

void initPoint ()

Constructor & Destructor Documentation

CanvasPoint::CanvasPoint double    x,
double    y
[inline]
 

00030     {
00031         this(x, y, COPY_MODE, NO_COLOR, DEF_TRANS, DEF_SCALE);
00032     }

CanvasPoint::CanvasPoint double    x,
double    y,
Color    color
[inline]
 

00036     {
00037         this(x, y, COPY_MODE, color, DEF_TRANS, DEF_SCALE);
00038     }

CanvasPoint::CanvasPoint double    x,
double    y,
Color    color,
double    ccs_scale
[inline]
 

00042     {
00043         this(x, y, COPY_MODE, color, DEF_TRANS, ccs_scale);
00044     }

CanvasPoint::CanvasPoint double    x,
double    y,
int    mode,
Color    color,
float    trans,
double    ccs_scale
[inline]
 

00049     {
00050         super(x-0.5, y-0.5, STD_SIZE, STD_SIZE, mode,
00051               color, false, DEF_LINEW, trans, ccs_scale);
00052         initPoint();
00053     }

CanvasPoint::CanvasPoint int    x,
int    y,
int    mode,
Color    color,
double    ccs_scale
[inline]
 

00133     {
00134         super(x, y, 1, 1, mode, color, ccs_scale);
00135         initPoint();
00136     }


Member Function Documentation

void CanvasPoint::draw Graphics    g [inline, virtual]
 

Draw CanvasObject on 'g', using internal CCS values.

Reimplemented from CanvasObject.

00060     {
00061         setupDrawMode(g);
00062         if (!getTransformOK()) {
00063             transformICStoCCS();
00064         }
00065         g.fillRect(getX1Ccs(), getY1Ccs(), getWidthCcs(), getHeightCcs());
00066     }

Object CanvasPoint::clone   [inline, virtual]
 

Return an identical copy of this CanvasObject.

Reimplemented from CanvasObject.

00070     {
00071         Color color = drawColor;
00072         if (hasNoColor) {
00073             color = NO_COLOR;
00074         }
00075         return (new CanvasPoint(getX1()+0.5, getY1()+0.5, getDrawMode(),
00076                                 color, transparency, getZoomFactor()));
00077     }

boolean CanvasPoint::isInside double    x,
double    y
[inline]
 

00081     {
00082         return inBoundingBox(x, y);
00083     }

boolean CanvasPoint::isNear double    x,
double    y
[inline]
 

00087     {
00088         if ((x >= getX1() - SPHERE) && (x < getX1() + getWidth() + SPHERE) &&
00089             (y >= getY1() - SPHERE) && (y < getY1() + getHeight() + SPHERE)) {
00090             return true;
00091         }
00092         return false;
00093     }

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

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

Parameters are assumed Image Coordinate System values.

Reimplemented from ScribbleObject.

00097     {
00098         // overrule super.setDimension(w, h), and do nothing
00099 
00100         return;
00101     }

void CanvasPoint::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 from ScribbleObject.

00105     {
00106         super.doPixelFit(zoomFactor);
00107 
00108         setX1((int)getX1() - 0.5);
00109         setY1((int)getY1() - 0.5);
00110         setStartX(getX1());
00111         setStartY(getY1());
00112 
00113         setTransformOK(false);
00114     }

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

To be removed.

Reimplemented from CanvasObject.

00140     {
00141         return inBoundingBoxCcs(x, y);
00142     }

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

To be removed.

Reimplemented from CanvasObject.

00146     {
00147         if (!getTransformOK()) {
00148             transformICStoCCS();
00149         }
00150 
00151         if ((x >= getX1Ccs() - SPHERE) && (x < getX1Ccs() + getWidthCcs() + SPHERE) &&
00152             (y >= getY1Ccs() - SPHERE) && (y < getY1Ccs() + getHeightCcs() + SPHERE)) {
00153             return true;
00154         }
00155         return false;
00156     }

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

Reimplemented from ScribbleObject.

00160     {
00161         // overrule super.setDimension(w, h), and do nothing
00162 
00163         return;
00164     }

void CanvasPoint::initPoint   [inline, protected]
 

00178     {
00179         resizeable   = false;
00180         hasLineWidth = false;
00181 
00182         setWidth(STD_SIZE);
00183         setHeight(STD_SIZE);
00184 
00185         transformICStoCCS();
00186     }


Member Data Documentation

final double CanvasPoint::STD_SIZE = 1.0 [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