Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/exports/IsKmUpEvaluator.java @ 7160:f2ffa631c2ed
Diagram attributes: Use evaluators for title arguments, too. This makes it more consistent, powerful and a little bit faster.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 26 Sep 2013 12:56:37 +0200 |
parents | 053e39436ba3 |
children | a56fe3bc6700 |
rev | line source |
---|---|
7143
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
3 * |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
7 */ |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
8 |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
9 package org.dive4elements.river.exports; |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
10 |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
11 import org.dive4elements.artifacts.CallContext; |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
12 import org.dive4elements.river.artifacts.D4EArtifact; |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
13 import org.dive4elements.river.artifacts.access.RiverAccess; |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
14 import org.dive4elements.river.artifacts.model.RiverFactory; |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
15 import org.dive4elements.river.model.River; |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
16 |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
17 public class IsKmUpEvaluator |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
18 implements DiagramAttributes.Evaluator |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
19 { |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
20 public IsKmUpEvaluator() { |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
21 } |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
22 |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
23 @Override |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
24 public Object evaluate(D4EArtifact artifact, CallContext context) { |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
25 RiverAccess access = new RiverAccess(artifact); |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
26 River river = RiverFactory.getRiver(access.getRiver()); |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
27 return river == null |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
28 ? Boolean.FALSE |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
29 : river.getKmUp(); |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
30 } |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
31 } |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
32 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |