// -*- tab-width: 4; -*- %{ // // Vicente Caballero Navarro %} %start Break::FirstPoint %class BreakCADTool %package com.iver.cit.gvsig.gui.cad.tools.smc %import com.iver.cit.gvsig.gui.cad.tools.BreakCADTool %import java.awt.event.InputEvent %import com.iver.andami.PluginServices %map Break %% // A task begins life in suspended animation. FirstPoint Entry { selection(); setQuestion( PluginServices.getText(this,"insert_first_point")); setDescription(new String[]{"cancel"}); } Exit{ } { addPoint( pointX:double,pointY:double,event:InputEvent) [ctxt.intersects(pointX,pointY)] SecondPoint { setQuestion(PluginServices.getText(this,"insert_second_point")); setDescription(new String[]{"cancel"}); addPoint( pointX,pointY,event); } addPoint( pointX:double,pointY:double,event:InputEvent) [!ctxt.intersects(pointX,pointY)] FirstPoint { setQuestion(PluginServices.getText(this,"insert_first_point")); setDescription(new String[]{"cancel"}); } addOption(s:String) FirstPoint { setQuestion(PluginServices.getText(this,"insert_first_point")); setDescription(new String[]{"cancel"}); addOption(s); } } SecondPoint { addPoint( pointX:double,pointY:double,event:InputEvent) [ctxt.intersects(pointX,pointY)] FirstPoint { setQuestion(PluginServices.getText(this,"insert_first_point")); setDescription(new String[]{"cancel"}); addPoint( pointX,pointY,event); end(); } addPoint( pointX:double,pointY:double,event:InputEvent) [!ctxt.intersects(pointX,pointY)] SecondPoint { setQuestion(PluginServices.getText(this,"insert_second_point")); setDescription(new String[]{"cancel"}); } addOption(s:String) FirstPoint { setQuestion(PluginServices.getText(this,"insert_first_point")); setDescription(new String[]{"cancel"}); addOption(s); } } Default { addOption(s:String) [s.equals(PluginServices.getText(this,"cancel"))] FirstPoint{ end(); } addOption(s:String) FirstPoint{ throwOptionException(PluginServices.getText(this,"incorrect_option"),s); } addValue(d:double) FirstPoint{ throwValueException(PluginServices.getText(this,"incorrect_value"),d); } addPoint(pointX:double,pointY:double,event:InputEvent) FirstPoint{ throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY); } } %%