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