comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 722:4800230fba8a

Improved situtation on rendering "Abflusskurve am Pegel". Not fully working, yet. flys-artifacts/trunk@2200 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 22 Jun 2011 10:36:27 +0000
parents 757ff56b43b3
children db68806e6563
comparison
equal deleted inserted replaced
721:7298d58a1f5a 722:4800230fba8a
278 /** 278 /**
279 * Returns the identifier of the current state. 279 * Returns the identifier of the current state.
280 * 280 *
281 * @return the identifier of the current state. 281 * @return the identifier of the current state.
282 */ 282 */
283 protected String getCurrentStateId() { 283 public String getCurrentStateId() {
284 return currentStateId; 284 return currentStateId;
285 } 285 }
286 286
287 287
288 /** 288 /**
317 FLYSContext flysContext = getFlysContext(context); 317 FLYSContext flysContext = getFlysContext(context);
318 StateEngine engine = (StateEngine) flysContext.get( 318 StateEngine engine = (StateEngine) flysContext.get(
319 FLYSContext.STATE_ENGINE_KEY); 319 FLYSContext.STATE_ENGINE_KEY);
320 320
321 return engine.getState(getCurrentStateId()); 321 return engine.getState(getCurrentStateId());
322 }
323
324 protected State getState(Object context, String stateID) {
325 FLYSContext flysContext = getFlysContext(context);
326 StateEngine engine = (StateEngine) flysContext.get(
327 FLYSContext.STATE_ENGINE_KEY);
328 return engine.getState(stateID);
322 } 329 }
323 330
324 331
325 /** 332 /**
326 * Returns the vector of previous state identifiers. 333 * Returns the vector of previous state identifiers.
1033 for (Map.Entry<String, StateData> entry: entries) { 1040 for (Map.Entry<String, StateData> entry: entries) {
1034 String key = entry.getKey(); 1041 String key = entry.getKey();
1035 Object value = entry.getValue().getValue(); 1042 Object value = entry.getValue().getValue();
1036 1043
1037 hash ^= ((long)key.hashCode() << shift) 1044 hash ^= ((long)key.hashCode() << shift)
1038 | ((long)value.hashCode() << (shift + shift)); 1045 | ((long)value.hashCode() << (shift + 3));
1039 shift += 2; 1046 shift += 2;
1040 } 1047 }
1041 1048
1042 return getCurrentStateId() + hash; 1049 return getCurrentStateId() + hash;
1043 } 1050 }
1075 String hash, 1082 String hash,
1076 ComputeType type, 1083 ComputeType type,
1077 boolean generateFacets 1084 boolean generateFacets
1078 ) { 1085 ) {
1079 DefaultState current = (DefaultState) getCurrentState(context); 1086 DefaultState current = (DefaultState) getCurrentState(context);
1080
1081 logger.debug("Create ComputeCallback for state: " + current.getID());
1082
1083 return compute(context, hash, current, type, generateFacets); 1087 return compute(context, hash, current, type, generateFacets);
1084 } 1088 }
1085 1089
1090 public Object compute(
1091 CallContext context,
1092 String stateID,
1093 String hash,
1094 ComputeType type,
1095 boolean generateFacets
1096 ) {
1097 DefaultState current = stateID == null
1098 ? (DefaultState)getCurrentState(context)
1099 : (DefaultState)getState(context, stateID);
1100
1101 if (hash == null) {
1102 hash = hash();
1103 }
1104
1105 return compute(context, hash, current, type, generateFacets);
1106 }
1086 1107
1087 public Object compute( 1108 public Object compute(
1088 CallContext context, 1109 CallContext context,
1089 String key, 1110 String key,
1090 DefaultState state, 1111 DefaultState state,

http://dive4elements.wald.intevation.org