Mercurial > dive4elements > river
view flys-artifacts/src/main/java/de/intevation/flys/artifacts/transitions/DefaultTransition.java @ 4198:1cdbd8a0c994
Added two new tables ClickableQDTable and ClickableWTable and made Ws and Qs clickable in historical discharge calculation.
The new tables define listener interfaces (clicked lower or upper icon) to listen to user clicks.
In addition to this, there is an enum ClickMode with NONE, SINGLE and RANGE options, which allows to
specifiy, which icons are displayed in the tables. NONE means no icon for user clicks, SINGLE has 1
icon, RANGE 2 icons for lower and upper.
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 22 Oct 2012 13:31:25 +0200 |
parents | b2ea89a665bc |
children |
line wrap: on
line source
package de.intevation.flys.artifacts.transitions; import org.w3c.dom.Node; import de.intevation.artifacts.Artifact; import de.intevation.artifactdatabase.state.State; import de.intevation.artifactdatabase.transition.Transition; /** * The default implementation of a <code>Transition</code>. * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class DefaultTransition implements Transition { /** The ID of the current state */ protected String from; /** The ID of the target state */ protected String to; /** * The default constructor. */ public DefaultTransition() { } /** * The default constructor. * * @param from The current state. * @param to The target state. */ public DefaultTransition(String from, String to) { this.from = from; this.to = to; } public void init(Node config) { // nothing to do in the default transition } /** * Returns the current state ID. * * @return the current state ID. */ public String getFrom() { return from; } /** * Returns the target state ID. * * @return the target state ID. */ public String getTo() { return to; } /** * Set the current state ID. * * @param from current state ID. */ public void setFrom(String from) { this.from = from; } /** * Set the target state ID. * * @param to the target state ID. */ public void setTo(String to) { this.to = to; } /** * Determines if its valid to step from state <i>a</i> of an artifact * <i>artifact</i> to state <i>b</i>. This method always returns true - no * validation takes place. * * @param artifact The owner artifact of state a and b. * @param a The current state. * @param b The target state. * * @return true, if it is valid to step from a to b, otherwise false. */ public boolean isValid(Artifact artifact, State a, State b) { return true; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :