Inheritance diagram for CanvasCorbaBSplineCurve::
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... |
|
00032 { 00033 super(0., 0., 0., 0.); 00034 _bspl = bspl; 00035 _nrC = nrC; 00036 setInputSource(INP_CORBA); 00037 updateBSplineCurve(); 00038 } |
|
00042 { 00043 _showControlPoly = b; 00044 } |
|
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 } |
|
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 } |
|
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 } |