# HG changeset patch # User Felix Wolfsteller # Date 1350889829 -7200 # Node ID 7d0fb0109c012b1ea9cd77593679c1b97ee57e5b # Parent 8fbe7012c4b97c28d93f8f205b9607b3350f8ffe Let AnnotationFacets come to life inactively in FixAnalysis LS settings. diff -r 8fbe7012c4b9 -r 7d0fb0109c01 flys-artifacts/src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java Mon Oct 22 07:51:30 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java Mon Oct 22 09:10:29 2012 +0200 @@ -16,10 +16,13 @@ import de.intevation.artifactdatabase.ProtocolUtils; import de.intevation.artifactdatabase.state.Facet; +import de.intevation.artifactdatabase.state.FacetActivity; import de.intevation.artifactdatabase.state.Output; import de.intevation.artifactdatabase.state.State; import de.intevation.artifactdatabase.state.StateEngine; +import de.intevation.flys.artifacts.model.FacetTypes; + import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.flys.artifacts.states.DefaultState; @@ -30,7 +33,9 @@ /** * Artifact to access names of Points Of Interest along a segment of a river. */ -public class AnnotationArtifact extends StaticFLYSArtifact { +public class AnnotationArtifact +extends StaticFLYSArtifact +implements FacetTypes { /** The logger for this class. */ private static Logger logger = Logger.getLogger(AnnotationArtifact.class); @@ -38,6 +43,32 @@ /** The name of the artifact. */ public static final String ARTIFACT_NAME = "annotation"; + // Let Annotations enter life inactively if in Fix Analysis LS setting. + static { + FacetActivity.Registry.getInstance().register( + "annotation", + new FacetActivity() { + @Override + public Boolean isInitialActive( + Artifact artifact, + Facet facet, + String output + ) { + if (output.contains(FacetTypes.ChartType.FLSC.toString())) { + // Longitudinal section chart + String name = facet.getName(); + + if (name.contains(FacetTypes.LONGITUDINAL_ANNOTATION)) { + return Boolean.FALSE; + } + } + + return Boolean.TRUE; + } + }); + } + + @Override public void setup( String identifier,