protected void addPoint( SplineCADToolContext context, double pointX, double pointY, InputEvent event) { SplineCADTool ctxt = context.getOwner(); SplineCADToolState endState = context.getState(); context.clearState(); try { ctxt.setQuestion( PluginServices.getText(this, "insert_next_point") + ", " + PluginServices.getText(this, "close") + " " + "[" + PluginServices.getText(this, "SplineCADTool.close") + "] " + PluginServices.getText(this, "cad.or") + " " + PluginServices.getText(this, "end") + " " + "[" + PluginServices.getText(this, "SplineCADTool.end") + "]"); ctxt.setDescription(new String[] {"close", "terminate", "cancel"}); ctxt.addPoint(pointX, pointY, event); } finally { context.setState(endState); } return; }
protected void endPoint( SplineCADToolContext context, double pointX, double pointY, InputEvent event) { SplineCADTool ctxt = context.getOwner(); boolean loopbackFlag = context.getState().getName().equals(Spline.FirstPoint.getName()); if (loopbackFlag == false) { (context.getState()).Exit(context); } context.clearState(); try { ctxt.addPoint(pointX, pointY, event); ctxt.endGeometry(); } finally { context.setState(Spline.FirstPoint); if (loopbackFlag == false) { (context.getState()).Entry(context); } } return; }