Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/exports/IsKmUpEvaluator.java @ 7691:fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
The SyncNumberAxis was completely broken. It only synced
in one direction and even that did not work correctly when
data was added to the axis (and the syncAxis rescaled but
forgot the old axis) then there were lots of ways to bypass
that scaling. And i also think the trans calculation was wrong.
It has been replaced by a "mostly" simple method to just keep
the W in M and W in CM+Datum axes in sync. I say "Mostly" because
it had to deal with the Bounds interface.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 13 Dec 2013 19:03:00 +0100 |
parents | 4eea35874943 |
children |
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.model.River; |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
15 |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
16 public class IsKmUpEvaluator |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
17 implements DiagramAttributes.Evaluator |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
18 { |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
19 public IsKmUpEvaluator() { |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
20 } |
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 @Override |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
23 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
|
24 RiverAccess access = new RiverAccess(artifact); |
7261
a56fe3bc6700
Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7143
diff
changeset
|
25 River river = access.getRiver(); |
7143
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
26 return river == null |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
27 ? Boolean.FALSE |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
28 : river.getKmUp(); |
053e39436ba3
Diagrams: Determine if axis should be inverted dynamically.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
29 } |
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 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |