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

CanvasCorbaSampledBSplineCurve Class Reference

Display a HxSampledBSplineCurve. More...

Inheritance diagram for CanvasCorbaSampledBSplineCurve::

CanvasFigure CanvasObject List of all members.

Public Methods

 CanvasCorbaSampledBSplineCurve (HxCorba.SampledBSplineCurve bspl)
 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 HxSampledBSplineCurve.


Constructor & Destructor Documentation

CanvasCorbaSampledBSplineCurve::CanvasCorbaSampledBSplineCurve HxCorba.SampledBSplineCurve    bspl [inline]
 

Constructor.

00031 {
00032     super(0., 0., 0., 0.);
00033     _bspl = bspl;
00034     setInputSource(INP_CORBA);
00035     updateSampledBSplineCurve();
00036 }


Member Function Documentation

void CanvasCorbaSampledBSplineCurve::setShowControlPoly boolean    b [inline]
 

00040 {
00041     _showControlPoly = b;
00042 }

Vector CanvasCorbaSampledBSplineCurve::getVisualChangeMethods   [inline]
 

Overrides CanvasObject interface.

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

Reimplemented from CanvasFigure.

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

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

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

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

00092 {
00093     return true;
00094 }


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