Inheritance diagram for CanvasHxPolyline2d::
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... |
|
00025 { 00026 super(0., 0., 0., 0.); 00027 _name = polyName; 00028 _mediator = new HxMediatorPeer(); 00029 00030 updatePolyline(); 00031 setInputSource(INP_SASYSTEM); 00032 } |
|
Overrides CanvasObject interface.
Reimplemented from CanvasObject.
00038 { 00039 return _name; 00040 } |
|
00044 { 00045 String[] args = new String[0]; 00046 String result = _mediator.callMethod("HxPolyline2d", 00047 _name, "getClosed", "", args); 00048 return new Integer(result).intValue(); 00049 } |
|
00053 { 00054 String[] args = new String[0]; 00055 String result = _mediator.callMethod("HxPolyline2d", 00056 _name, "getNrPoints", "", args); 00057 return new Integer(result).intValue(); 00058 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |