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

CanvasHxPolyline2d Class Reference

Inheritance diagram for CanvasHxPolyline2d::

CanvasFigure CanvasObject List of all members.

Public Methods

 CanvasHxPolyline2d (String polyName)
String getSaName ()
 Overrides CanvasObject interface. More...

int getClosed ()
int getNrPoints ()
double getPX (int index)
double getPY (int index)

Protected Methods

Shape getShape ()
 Derived classes have to implement this method to supply the shape that represents the CanvasFigures. More...

boolean hitOnStroke ()
 Derived classes have to implement this method to indicate whether they are selected (hit) based on their stroke (border) or on their interior. More...


Constructor & Destructor Documentation

CanvasHxPolyline2d::CanvasHxPolyline2d String    polyName [inline]
 

00025 {
00026     super(0., 0., 0., 0.);
00027     _name = polyName;
00028     _mediator = new HxMediatorPeer();
00029 
00030     updatePolyline();
00031     setInputSource(INP_SASYSTEM);
00032 }


Member Function Documentation

String CanvasHxPolyline2d::getSaName   [inline]
 

Overrides CanvasObject interface.

Reimplemented from CanvasObject.

00038 {
00039     return _name;
00040 }

int CanvasHxPolyline2d::getClosed   [inline]
 

00044 {
00045     String[] args = new String[0];
00046     String result = _mediator.callMethod("HxPolyline2d",
00047                                          _name, "getClosed", "", args);
00048     return new Integer(result).intValue();
00049 }

int CanvasHxPolyline2d::getNrPoints   [inline]
 

00053 {
00054     String[] args = new String[0];
00055     String result = _mediator.callMethod("HxPolyline2d",
00056                                          _name, "getNrPoints", "", args);
00057     return new Integer(result).intValue();
00058 }

double CanvasHxPolyline2d::getPX int    index [inline]
 

00062 {
00063     String[] args = new String[1];
00064     args[0] = new String("int " + java.lang.String.valueOf(index));
00065     String result = _mediator.callMethod("HxPolyline2d",
00066                                          _name, "getPoint", "", args);
00067     int i = result.indexOf('(');
00068     int j = result.indexOf(',');
00069     return new Double(result.substring(i+1, j)).doubleValue();
00070 }

double CanvasHxPolyline2d::getPY int    index [inline]
 

00074 {
00075     String[] args = new String[1];
00076     args[0] = new String("int " + java.lang.String.valueOf(index));
00077     String result = _mediator.callMethod("HxPolyline2d",
00078                                          _name, "getPoint", "", args);
00079     int i = result.indexOf(' ');
00080     int j = result.indexOf(')');
00081     return new Double(result.substring(i+1, j)).doubleValue();
00082 }

Shape CanvasHxPolyline2d::getShape   [inline, protected, virtual]
 

Derived classes have to implement this method to supply the shape that represents the CanvasFigures.

It is used to draw to figure as well as determine which figure is selected (hit) by the cursor within a canvas.

Reimplemented from CanvasFigure.

00093 {
00094     int[] xp = getAddXCcs();
00095     int[] yp = getAddYCcs();
00096     GeneralPath path = new GeneralPath(GeneralPath.WIND_NON_ZERO, xp.length);
00097     path.moveTo(xp[0], yp[0]);
00098     for (int i=1 ; i < xp.length ; i++)
00099         path.lineTo(xp[i], yp[i]);
00100     return path;
00101 }

boolean CanvasHxPolyline2d::hitOnStroke   [inline, protected, virtual]
 

Derived classes have to implement this method to indicate whether they are selected (hit) based on their stroke (border) or on their interior.

Reimplemented from CanvasFigure.

00105 {
00106     return true;
00107 }


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