@Override protected void addPoint( SymmetryCADToolContext context, double pointX, double pointY, InputEvent event) { SymmetryCADTool ctxt = context.getOwner(); (context.getState()).Exit(context); context.clearState(); try { ctxt.setQuestion( PluginServices.getText(this, "del_original_geometries") + " " + PluginServices.getText(this, "yes") + "[" + PluginServices.getText(this, "SymmetryCADTool.yes") + "], " + PluginServices.getText(this, "cad.or") + " " + PluginServices.getText(this, "no") + "[" + PluginServices.getText(this, "SymmetryCADTool.no") + "]"); ctxt.setDescription(new String[] {"cancel", "cut", "copy"}); ctxt.addPoint(pointX, pointY, event); } finally { context.setState(Symmetry.CutOrCopy); (context.getState()).Entry(context); } return; }
@Override protected void addOption(SymmetryCADToolContext context, String s) { SymmetryCADTool ctxt = context.getOwner(); (context.getState()).Exit(context); context.clearState(); try { ctxt.setDescription(new String[] {"cancel"}); ctxt.addOption(s); ctxt.end(); } finally { context.setState(Symmetry.FirstPoint); (context.getState()).Entry(context); } return; }
@Override protected void addPoint( SymmetryCADToolContext context, double pointX, double pointY, InputEvent event) { SymmetryCADTool ctxt = context.getOwner(); (context.getState()).Exit(context); context.clearState(); try { ctxt.setQuestion(PluginServices.getText(this, "insert_second_point")); ctxt.setDescription(new String[] {"cancel"}); ctxt.addPoint(pointX, pointY, event); } finally { context.setState(Symmetry.SecondPoint); (context.getState()).Entry(context); } return; }
@Override protected void Entry(SymmetryCADToolContext context) { SymmetryCADTool ctxt = context.getOwner(); ctxt.selection(); ctxt.setQuestion(PluginServices.getText(this, "insert_first_point")); ctxt.setDescription(new String[] {"cancel"}); return; }
@Override protected void addValue(SymmetryCADToolContext context, double d) { SymmetryCADTool ctxt = context.getOwner(); boolean loopbackFlag = context.getState().getName().equals(Symmetry.FirstPoint.getName()); if (loopbackFlag == false) { (context.getState()).Exit(context); } context.clearState(); try { ctxt.throwValueException(PluginServices.getText(this, "incorrect_value"), d); } finally { context.setState(Symmetry.FirstPoint); if (loopbackFlag == false) { (context.getState()).Entry(context); } } return; }
protected void Default(SymmetryCADToolContext context) { throw (new statemap.TransitionUndefinedException( "State: " + context.getState().getName() + ", Transition: " + context.getTransition())); }
@Override protected void addOption(SymmetryCADToolContext context, String s) { SymmetryCADTool ctxt = context.getOwner(); if (s.equals(PluginServices.getText(this, "cancel"))) { boolean loopbackFlag = context.getState().getName().equals(Symmetry.FirstPoint.getName()); if (loopbackFlag == false) { (context.getState()).Exit(context); } context.clearState(); try { ctxt.end(); } finally { context.setState(Symmetry.FirstPoint); if (loopbackFlag == false) { (context.getState()).Entry(context); } } } else { boolean loopbackFlag = context.getState().getName().equals(Symmetry.FirstPoint.getName()); if (loopbackFlag == false) { (context.getState()).Exit(context); } context.clearState(); try { ctxt.throwOptionException(PluginServices.getText(this, "incorrect_option"), s); } finally { context.setState(Symmetry.FirstPoint); if (loopbackFlag == false) { (context.getState()).Entry(context); } } } return; }