// -*- tab-width: 4; -*- %{ // // Vicente Caballero Navarro %} %start Join::FirstPoint %class JoinCADTool %package com.iver.cit.gvsig.gui.cad.tools.smc %import com.iver.cit.gvsig.gui.cad.tools.JoinCADTool %import java.awt.event.InputEvent %import com.iver.andami.PluginServices %map Join %% // A task begins life in suspended animation. FirstPoint Entry { setQuestion( PluginServices.getText(this,"select_geometry")); setDescription(new String[]{"cancel"}); } Exit{ } { addPoint( pointX:double,pointY:double,event:InputEvent) FirstPoint { setQuestion(PluginServices.getText(this,"select_other_geometry_or_end")); setDescription(new String[]{"cancel","end"}); addPoint( pointX,pointY,event); } addOption(s:String) [s.equals("e") || s.equals("E") || s.equals(PluginServices.getText(this,"end"))] FirstPoint { setQuestion(PluginServices.getText(this,"select_geometry")); setDescription(new String[]{"cancel"}); addOption(s); end(); } } 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); } } %%