comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/transitions/DefaultTransition.java @ 354:542f280d72c3

Bugfix: Added the missing init() method to a Transition and call it in the TransitionFactory after a Transition has been created. flys-artifacts/trunk@1761 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 28 Apr 2011 11:16:21 +0000
parents a228b39494a9
children b2ea89a665bc
comparison
equal deleted inserted replaced
353:8378683fa07a 354:542f280d72c3
1 package de.intevation.flys.artifacts.transitions; 1 package de.intevation.flys.artifacts.transitions;
2
3 import org.w3c.dom.Node;
4
5 import de.intevation.artifacts.Artifact;
2 6
3 import de.intevation.artifactdatabase.state.State; 7 import de.intevation.artifactdatabase.state.State;
4 import de.intevation.artifactdatabase.transition.Transition; 8 import de.intevation.artifactdatabase.transition.Transition;
9
5 10
6 /** 11 /**
7 * The default implementation of a <code>Transition</code>. 12 * The default implementation of a <code>Transition</code>.
8 * 13 *
9 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 14 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
31 * @param to The target state. 36 * @param to The target state.
32 */ 37 */
33 public DefaultTransition(String from, String to) { 38 public DefaultTransition(String from, String to) {
34 this.from = from; 39 this.from = from;
35 this.to = to; 40 this.to = to;
41 }
42
43
44 public void init(Node config) {
45 // nothing to do in the default transition
36 } 46 }
37 47
38 48
39 /** 49 /**
40 * Returns the current state ID. 50 * Returns the current state ID.
75 this.to = to; 85 this.to = to;
76 } 86 }
77 87
78 88
79 /** 89 /**
80 * This method always returns <i>true</i>. 90 * Determines if its valid to step from state <i>a</i> of an artifact
91 * <i>artifact</i> to state <i>b</i>. This method always returns true - no
92 * validation takes place.
81 * 93 *
82 * @param state The target state. 94 * @param artifact The owner artifact of state a and b.
95 * @param a The current state.
96 * @param b The target state.
83 * 97 *
84 * @return true. 98 * @return true, if it is valid to step from a to b, otherwise false.
85 */ 99 */
86 public boolean isValid(State state) { 100 public boolean isValid(Artifact artifact, State a, State b) {
87 return true; 101 return true;
88 } 102 }
89 } 103 }
90 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 104 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org