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

CanvasHxSampledBSplineCurve Class Reference

Display a HxSampledBSplineCurve (C++ object). More...

Inheritance diagram for CanvasHxSampledBSplineCurve::

CanvasFigure CanvasObject List of all members.

Public Methods

 CanvasHxSampledBSplineCurve (String name)
 Constructor. More...

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

void setShowControlPoly (boolean b)
String getCPoly ()
String getControlP ()
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 (C++ object).


Constructor & Destructor Documentation

CanvasHxSampledBSplineCurve::CanvasHxSampledBSplineCurve String    name [inline]
 

Constructor.

00030 {
00031     super(0., 0., 0., 0.);
00032     _name = name;
00033     _mediator = new HxMediatorPeer();
00034     setInputSource(INP_SASYSTEM);
00035     updateSampledBSplineCurve();
00036 }


Member Function Documentation

String CanvasHxSampledBSplineCurve::getSaName   [inline]
 

Overrides CanvasObject interface.

Reimplemented from CanvasObject.

00042 {
00043     return _name;
00044 }

void CanvasHxSampledBSplineCurve::setShowControlPoly boolean    b [inline]
 

00048 {
00049     _showControlPoly = b;
00050 }

String CanvasHxSampledBSplineCurve::getCPoly   [inline]
 

00054 {
00055     String[] args = new String[0];
00056     return _mediator.callMethod("HxSampledBSplineCurve", _name, "CPoly", "", args);
00057 }

String CanvasHxSampledBSplineCurve::getControlP   [inline]
 

00061 {
00062     String[] args = new String[0];
00063     return _mediator.callMethod("HxSampledBSplineCurve", _name, "controlP", "", args);
00064 }

Vector CanvasHxSampledBSplineCurve::getVisualChangeMethods   [inline]
 

Overrides CanvasObject interface.

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

Reimplemented from CanvasFigure.

00072 {
00073     Vector v = super.getVisualChangeMethods();
00074     v.add(new CallableMethod("setShowControlPoly", "boolean", "b", "boolean"));
00075     return v;
00076 }

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

00087 {
00088     // first do the curve itself
00089     int[] xp = getAddXCcs();
00090     int[] yp = getAddYCcs();
00091     GeneralPath curve = new GeneralPath(GeneralPath.WIND_NON_ZERO, xp.length);
00092     curve.moveTo(xp[0], yp[0]);
00093     for (int i=1 ; i < xp.length ; i++)
00094         curve.lineTo(xp[i], yp[i]);
00095 
00096     // Then check whether control polygon should be visualized
00097     if (_showControlPoly) {
00098         int[] ccsX = new int[_cpX.length];
00099         Converter.ICStoCCS(_cpX, ccsX, getZoomFactor());
00100         int[] ccsY = new int[_cpY.length];
00101         Converter.ICStoCCS(_cpY, ccsY, getZoomFactor());
00102         GeneralPath cp = new GeneralPath(GeneralPath.WIND_NON_ZERO, _cpX.length);
00103         cp.moveTo(ccsX[0], ccsY[0]);
00104         for (int i=1 ; i < ccsX.length ; i++)
00105             cp.lineTo(ccsX[i], ccsY[i]);
00106         curve.append(cp, false);
00107     }
00108 
00109     return curve;
00110 }

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

00114 {
00115     return true;
00116 }


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