Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/MinMaxState.java @ 2203:1db66b88868f
Fixed a bug in the winfo transitions.
flys-artifacts/trunk@3823 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 30 Jan 2012 10:54:38 +0000 |
parents | d1660809daab |
children | a22e0cb6eace |
rev | line source |
---|---|
2190
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.states; |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import org.w3c.dom.Element; |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
2202
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
5 import org.apache.log4j.Logger; |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
6 |
2190
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import de.intevation.artifacts.Artifact; |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import de.intevation.artifacts.CallContext; |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import de.intevation.artifacts.common.ArtifactNamespaceContext; |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import de.intevation.artifactdatabase.ProtocolUtils; |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.flys.artifacts.FLYSArtifact; |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 /** |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 */ |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 public abstract class MinMaxState extends DefaultState { |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 |
2202
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
23 private static final Logger logger = Logger.getLogger(MinMaxState.class); |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
24 |
2190
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 @Override |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 protected void appendItems( |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 Artifact artifact, |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 ElementCreator creator, |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 String name, |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 CallContext context, |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 Element select |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 ) { |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 FLYSArtifact flys = (FLYSArtifact) artifact; |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 select.setAttributeNS( |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 ArtifactNamespaceContext.NAMESPACE_URI, |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 "art:type", |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 getType()); |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 |
2202
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
40 String[] defMinMax = getDefaults(artifact, name); |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
41 |
2190
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 Element min = ProtocolUtils.createArtNode( |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 creator, |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 "min", |
2202
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
45 new String[] { "value", "default" }, |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
46 new String[] { String.valueOf(getLower(flys)), defMinMax[0] }); |
2190
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 Element max = ProtocolUtils.createArtNode( |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 creator, |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 "max", |
2202
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
51 new String[] { "value", "default" }, |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
52 new String[] { String.valueOf(getUpper(flys)), defMinMax[1] }); |
2190
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 select.appendChild(min); |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 select.appendChild(max); |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 } |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 |
2202
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
59 /** |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
60 * This method returns the default values for min and max. If the static |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
61 * field DefaultState.USE_DEFAULTS is set, the minimum and maximum inserted |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
62 * by the user is returned as string. Otherwise, the absolute minimum and |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
63 * maximum are returned. |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
64 * |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
65 * @param artifact The FLYSArtifact. |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
66 * @param name The name of the parameter. |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
67 * |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
68 * @return a string array [min,max] that contains the minimum and maximum |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
69 * values for the parameter <i>name</i>. |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
70 */ |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
71 protected String[] getDefaults(Artifact artifact, String name) { |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
72 if (DefaultState.USE_DEFAULTS) { |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
73 String[] tmp = getMinMaxByParameter(artifact, name); |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
74 |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
75 return tmp != null ? tmp : getMinMaxDefaults(artifact, name); |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
76 } |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
77 else { |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
78 return getMinMaxDefaults(artifact, name); |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
79 } |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
80 } |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
81 |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
82 |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
83 /** |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
84 * Returns a string array with minimum and maximum inserted by the user as |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
85 * [min,max]. |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
86 * |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
87 * @param artifact The FLYSArtifact that stores the parameter. |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
88 * @param name The name of the parameter for raw min/max value string. |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
89 * |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
90 * @return a string array [min,max]. |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
91 */ |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
92 protected String[] getMinMaxByParameter(Artifact artifact, String name) { |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
93 FLYSArtifact flys = (FLYSArtifact) artifact; |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
94 String rawValue = flys.getDataAsString(name); |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
95 |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
96 if (rawValue == null) { |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
97 logger.debug("No value for '" + rawValue + "' existing."); |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
98 return null; |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
99 } |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
100 |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
101 logger.debug("Raw value for '" + name + "' = " + rawValue); |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
102 |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
103 return rawValue.split(";"); |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
104 } |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
105 |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
106 |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
107 /** |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
108 * Returns a string array with absolute minimum and maximum as [min,max]. |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
109 * |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
110 * @param artifact The FLYSArtifact (not used in this implementation). |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
111 * @param name The parameter name (not used in this implementation). |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
112 * |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
113 * @return a string array [min,max]. |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
114 */ |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
115 protected String[] getMinMaxDefaults(Artifact artifact, String name) { |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
116 FLYSArtifact flys = (FLYSArtifact) artifact; |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
117 |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
118 Object lower = getLower(flys); |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
119 Object upper = getUpper(flys); |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
120 |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
121 return new String[] { String.valueOf(lower), String.valueOf(upper) }; |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
122 } |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
123 |
d1660809daab
Added default values for min and max items prepared by MinMaxState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2190
diff
changeset
|
124 |
2190
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 protected abstract Object getLower(FLYSArtifact flys); |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 protected abstract Object getUpper(FLYSArtifact flys); |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 protected abstract String getType(); |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 } |
2792d2617be9
Introduced an abstract MinMaxState and a concrete class IntRangeState to add min/max value pairs.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |