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

CanvasCorbaBSplineCurve Class Reference

Display a HxBSplineCurve. More...

Inheritance diagram for CanvasCorbaBSplineCurve::

CanvasFigure CanvasObject List of all members.

Public Methods

 CanvasCorbaBSplineCurve (HxCorba.BSplineCurve bspl, int nrC)
 Constructor. More...

void setShowControlPoly (boolean b)
Vector getVisualChangeMethods ()
 Overrides CanvasObject interface. More...


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


Detailed Description

Display a HxBSplineCurve.


Constructor & Destructor Documentation

CanvasCorbaBSplineCurve::CanvasCorbaBSplineCurve HxCorba.BSplineCurve    bspl,
int    nrC
[inline]
 

Constructor.

00032 {
00033     super(0., 0., 0., 0.);
00034     _bspl = bspl;
00035     _nrC = nrC;
00036     setInputSource(INP_CORBA);
00037     updateBSplineCurve();
00038 }


Member Function Documentation

void CanvasCorbaBSplineCurve::setShowControlPoly boolean    b [inline]
 

00042 {
00043     _showControlPoly = b;
00044 }

Vector CanvasCorbaBSplineCurve::getVisualChangeMethods   [inline]
 

Overrides CanvasObject interface.

Extends the list of callable functions obtained from the parent with the functions for this class.

Reimplemented from CanvasFigure.

00052 {
00053     Vector v = super.getVisualChangeMethods();
00054     v.add(new CallableMethod("setShowControlPoly", "boolean", "b", "boolean"));
00055     return v;
00056 }

Shape CanvasCorbaBSplineCurve::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.

00067 {
00068     // first do the curve itself
00069     int[] xp = getAddXCcs();
00070     int[] yp = getAddYCcs();
00071     GeneralPath curve = new GeneralPath(GeneralPath.WIND_NON_ZERO, xp.length);
00072     curve.moveTo(xp[0], yp[0]);
00073     for (int i=1 ; i < xp.length ; i++)
00074         curve.lineTo(xp[i], yp[i]);
00075 
00076     // Then check whether control polygon should be visualized
00077     if (_showControlPoly) {
00078         int[] ccsX = new int[_cpX.length];
00079         Converter.ICStoCCS(_cpX, ccsX, getZoomFactor());
00080         int[] ccsY = new int[_cpY.length];
00081         Converter.ICStoCCS(_cpY, ccsY, getZoomFactor());
00082         GeneralPath cp = new GeneralPath(GeneralPath.WIND_NON_ZERO, _cpX.length);
00083         cp.moveTo(ccsX[0], ccsY[0]);
00084         for (int i=1 ; i < ccsX.length ; i++)
00085             cp.lineTo(ccsX[i], ccsY[i]);
00086         curve.append(cp, false);
00087     }
00088 
00089     return curve;
00090 }

boolean CanvasCorbaBSplineCurve::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.

00094 {
00095     return true;
00096 }


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