@Override protected void removePoint(PipeCADToolContext context, InputEvent event, int numPoints) { PipeCADTool ctxt = context.getOwner(); if (numPoints > 1) { PipeCADToolState endState = context.getState(); context.clearState(); try { ctxt.removePoint(event); } finally { context.setState(endState); (context.getState()).Entry(context); } } else if (numPoints == 1) { (context.getState()).Exit(context); context.clearState(); try { ctxt.removePoint(event); } finally { context.setState(Polyline.FirstPoint); (context.getState()).Entry(context); } } else { super.removePoint(context, event, numPoints); } return; }
@Override protected void addOption(PipeCADToolContext context, String s) { PipeCADTool ctxt = context.getOwner(); if (s.equals("A") || s.equals("a") || s.equals(PluginServices.getText(this, "inter_arc"))) { (context.getState()).Exit(context); context.clearState(); try { ctxt.addOption(s); } finally { context.setState(Polyline.NextPointOrLine); (context.getState()).Entry(context); } } else { super.addOption(context, s); } return; }