# HG changeset patch # User gernotbelger # Date 1516357422 -3600 # Node ID 28df64078f279b595aed33f133e4336465fab5e2 # Parent 7bbfb24e6eec67d3163b802cb094ae93ae41ba43# Parent 0862ea5d66baf60e7eee496d130a35157cc9ec12 Merge with 0862ea5d66baf60e7eee496d130a35157cc9ec12 diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/doc/conf/artifacts/manualpoints.xml --- a/artifacts/doc/conf/artifacts/manualpoints.xml Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/doc/conf/artifacts/manualpoints.xml Fri Jan 19 11:23:42 2018 +0100 @@ -35,6 +35,8 @@ + + diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/doc/conf/backend-db.xml --- a/artifacts/doc/conf/backend-db.xml Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/doc/conf/backend-db.xml Fri Jan 19 11:23:42 2018 +0100 @@ -5,7 +5,7 @@ d4e org.hibernate.dialect.PostgreSQLDialect org.postgresql.Driver - jdbc:postgresql://localhost:5432/d4e + jdbc:postgresql://localhost:63333/d4e select 1 from rivers 30000 diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/doc/conf/log4j.properties --- a/artifacts/doc/conf/log4j.properties Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/doc/conf/log4j.properties Fri Jan 19 11:23:42 2018 +0100 @@ -4,7 +4,7 @@ log4j.category.org.hibernate=WARN log4j.category.net.sf.ehcache=WARN log4j.category.org.eclipse=WARN -log4j.category.org.restlet=INFO +log4j.category.org.restlet=WARN ########## APPENDER SETTINGS @@ -12,10 +12,7 @@ log4j.appender.FLYS.layout.ConversionPattern=%d{HH:mm:ss} [%t] %-5p %c{1} - %m%n -log4j.appender.FLYS=org.apache.log4j.RollingFileAppender -log4j.appender.FLYS.File=/var/log/d4e-river/d4e-server.log -log4j.appender.FLYS.MaxFileSize=5000KB -log4j.appender.FLYS.MaxBackupIndex=1 +log4j.appender.FLYS=org.apache.log4j.ConsoleAppender log4j.logger.org.dive4elements.artifactdatabase.rest.Standalone=INFO, START log4j.appender.START=org.apache.log4j.ConsoleAppender diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/doc/conf/seddb-db.xml --- a/artifacts/doc/conf/seddb-db.xml Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/doc/conf/seddb-db.xml Fri Jan 19 11:23:42 2018 +0100 @@ -5,7 +5,7 @@ seddb org.hibernate.dialect.PostgreSQLDialect org.postgresql.Driver - jdbc:postgresql://localhost:5432/seddb + jdbc:postgresql://localhost:63333/seddb select 1 from gewaesser 30000 diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/AbstractStaticStateArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/AbstractStaticStateArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/AbstractStaticStateArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -116,7 +116,8 @@ root.appendChild(name); root.appendChild(createOutputModes(cc, desc, creator)); - ProtocolUtils.appendDescribeHeader(creator, root, identifier(), hash()); + ProtocolUtils.appendDescribeHeader( + creator, root, identifier(), hash()); // Add the data to an anonymous state. Collection datas = getAllData(); @@ -134,8 +135,10 @@ creator.addAttr(itemelent, "type", dataItem.getType(), true); state.appendChild(itemelent); Element valuement = creator.create("item"); - creator.addAttr(valuement, "label", dataItem.getDescription(), true); - creator.addAttr(valuement, "value", dataItem.getValue().toString(), true); + creator.addAttr( + valuement, "label", dataItem.getDescription(), true); + creator.addAttr( + valuement, "value", dataItem.getValue().toString(), true); itemelent.appendChild(valuement); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/AnnotationArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/AnnotationArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/AnnotationArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -62,11 +62,15 @@ Facet facet, String output ) { - if (output.contains(FacetTypes.ChartType.FLSC.toString())) { + if (output.contains( + FacetTypes.ChartType.FLSC.toString()) + ) { // Longitudinal section chart String name = facet.getName(); - if (name.contains(FacetTypes.LONGITUDINAL_ANNOTATION)) { + if (name.contains( + FacetTypes.LONGITUDINAL_ANNOTATION) + ) { return Boolean.FALSE; } } @@ -162,7 +166,8 @@ State current = getCurrentState(context); - ProtocolUtils.appendDescribeHeader(creator, root, identifier(), hash()); + ProtocolUtils.appendDescribeHeader( + creator, root, identifier(), hash()); ProtocolUtils.appendState(creator, root, current); Element name = ProtocolUtils.createArtNode( @@ -251,7 +256,8 @@ doc, outs, generated); } else{ - log.debug("Cannot append output to generated document."); + log.debug( + "Cannot append output to generated document."); } } else { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/BedHeightsArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/BedHeightsArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/BedHeightsArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -120,7 +120,8 @@ callMeta, "facet.bedheight.sounding_width", new Object[] { bedHName }); - facet = new BedHeightSoundingWidthFacet(facetType, bedHName); + facet = new BedHeightSoundingWidthFacet( + facetType, bedHName); } else { facet = new BedHeightFacet(facetType, bedHName); @@ -159,7 +160,11 @@ } @Override - protected void initialize(Artifact artifact, Object context, CallMeta meta) { + protected void initialize( + Artifact artifact, + Object context, + CallMeta meta + ) { // do not clone facets, etc. from master artifact log.debug("initialize"); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/CollectionMonitor.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/CollectionMonitor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/CollectionMonitor.java Fri Jan 19 11:23:42 2018 +0100 @@ -119,7 +119,10 @@ return creator.create("recommended-artifacts"); } - private static final String generateCacheKey(D4EArtifact artifact, String [] outs) { + private static final String generateCacheKey( + D4EArtifact artifact, + String [] outs + ) { StringBuilder sb = new StringBuilder(artifact.hash()); // XXX: The hash really should be unique enough. for (String out: outs) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -137,7 +137,9 @@ // Find min-km of cross sections, // then set DATA_KM to min(DATA_KM, minCross). String dataKmValue = getDataAsString(DATA_KM); - double dataKm = (dataKmValue != null) ? Double.valueOf(dataKmValue) : Double.MIN_VALUE; + double dataKm = (dataKmValue != null) + ? Double.valueOf(dataKmValue) + : Double.MIN_VALUE; if (dataKm < csl.getKm().doubleValue()) { addStringData(DATA_KM, csl.getKm().toString()); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -79,7 +79,7 @@ public static final String COMPUTING_CACHE = "computed.values"; - /** The XPath that points to the input data elements of the FEED document. */ + /** XPath that points to the input data elements of the FEED document. */ public static final String XPATH_FEED_INPUT = "/art:action/art:data/art:input"; @@ -97,7 +97,8 @@ public static final String XPATH_IDS = "/art:action/art:ids/@value"; /** Path to 'target_out' (data) in doc that comes from datacage. */ - public static final String XPATH_TARGET_OUT = "/art:action/art:target_out/@value"; + public static final String XPATH_TARGET_OUT = + "/art:action/art:target_out/@value"; /** The constant string that shows that an operation was successful. */ public static final String OPERATION_SUCCESSFUL = "SUCCESS"; @@ -180,7 +181,8 @@ /** - * Initialize the artifact and insert new data if data contains + * Initialize the artifact and insert new data + * if data contains * information necessary for this artifact. * * @param identifier The UUID. @@ -249,7 +251,11 @@ this.facets.put(currentState, staticFacets); } - protected void handleInitModel(Document data, Object context, CallMeta callMeta) { + protected void handleInitModel( + Document data, + Object context, + CallMeta callMeta + ) { RiverContext flysContext = RiverUtils.getFlysContext(context); String model = XMLUtils.xpathString( @@ -357,7 +363,8 @@ /** * (called from setup). - * @param artifact master-artifact (if any, otherwise initialize is not called). + * @param artifact master-artifact + * (if any, otherwise initialize is not called). */ protected void initialize( Artifact artifact, @@ -377,7 +384,7 @@ facets = flys.cloneFacets(); // Do not clone filter facets! - ArrayList stateIds = (ArrayList) getPreviousStateIds(); + ArrayList stateIds = (ArrayList) getPreviousStateIds(); ArrayList toInitialize = (ArrayList) stateIds.clone(); toInitialize.add(getCurrentStateId()); @@ -433,15 +440,17 @@ int index; try { - index = Integer.parseInt(facetElement.getAttribute("index")); + index = Integer.parseInt( + facetElement.getAttribute("index")); } catch (NumberFormatException nfe) { log.warn(nfe); index = 0; } if (log.isDebugEnabled()) { - log.debug("Creating filter facet " + fName + " with index " + index + - " for out " + oName); + log.debug("Creating filter facet " + fName + + " with index " + index + + " for out " + oName); } facets.add(new DefaultFacet(index, fName, "")); } @@ -535,7 +544,8 @@ State current = getCurrentState(context); - ProtocolUtils.appendDescribeHeader(creator, root, identifier(), hash()); + ProtocolUtils.appendDescribeHeader( + creator, root, identifier(), hash()); ProtocolUtils.appendState(creator, root, current); ProtocolUtils.appendReachableStates(creator, root, reachable); @@ -940,8 +950,8 @@ * * @param name The name of the StateData object. * - * @return a Boolean representing the value of the data object or null if no - * such object is existing. + * @return a Boolean representing the value of the data object or + * null if no such object is existing. */ public Boolean getDataAsBoolean(String name) { String value = getDataAsString(name); @@ -964,7 +974,7 @@ } /** - * This method returns all stored StateData in this artifact as a Collection + * Returns all stored StateData in this artifact as a Collection * @return a Collection of all StateData objects in this artifact */ public Collection getAllData() { @@ -1103,7 +1113,8 @@ protected boolean isStateReachable(String stateId, Object context) { if (log.isDebugEnabled()) { - log.debug("Determine if the state '" + stateId + "' is reachable."); + log.debug("Determine if the state '" + + stateId + "' is reachable."); } RiverContext flysContext = RiverUtils.getFlysContext(context); @@ -1190,7 +1201,8 @@ List fFacets = filterFacets.get(outName); if (fFacets != null) { if (debug) { - log.debug("" + fFacets.size() + " filters for: " + outName); + log.debug("" + fFacets.size() + + " filters for: " + outName); for (Facet tmp: fFacets) { log.debug(" filter = '" + tmp.getName() + "'"); } @@ -1430,8 +1442,9 @@ /** - * Dispatches the computation request to compute(CallContext context, String - * hash) with the current hash value of the artifact which is provided by + * Dispatches the computation request to + * compute(CallContext context, String hash) + * with the current hash value of the artifact which is provided by * hash(). * * @param context The CallContext. @@ -1517,7 +1530,8 @@ if (cache != null) { net.sf.ehcache.Element element = cache.get(key); if (element != null) { - log.debug("Got computation result from cache for key: " + key); + log.debug( + "Got computation result from cache for key: " + key); old = element.getValue(); } } @@ -1534,7 +1548,8 @@ res = state.computeAdvance(this, key, context, fs, old); break; case INIT: - res = state.computeInit(this, key, context, context.getMeta(), fs); + res = state.computeInit( + this, key, context, context.getMeta(), fs); default: res = null; } @@ -1679,7 +1694,7 @@ log.debug("D4EArtifact.endOfLife: " + identifier()); } - ArrayList ids = (ArrayList) getPreviousStateIds(); + ArrayList ids = (ArrayList) getPreviousStateIds(); ArrayList toDestroy = (ArrayList) ids.clone(); toDestroy.add(getCurrentStateId()); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/FixationArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/FixationArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/FixationArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -66,7 +66,8 @@ CallContext context ) { FixRealizingResult result = (FixRealizingResult) - ((CalculationResult)this.compute(context, ComputeType.ADVANCE, false)).getData(); + ((CalculationResult)this.compute( + context, ComputeType.ADVANCE, false)).getData(); WKms wkms = result.getWQKms()[facetIdx]; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/FlowVelocityMeasurementArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/FlowVelocityMeasurementArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/FlowVelocityMeasurementArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -75,7 +75,6 @@ * Trivial Constructor. */ public FlowVelocityMeasurementArtifact() { - log.debug("FlowVelocityMeasurementArtifact.FlowVelocityMeasurementArtifact"); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/FlowVelocityModelArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/FlowVelocityModelArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/FlowVelocityModelArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -156,7 +156,8 @@ String code = getDatacageIDValue(data); if (code != null) { - String name = FlowVelocityModel.getModelDescription(Integer.valueOf(code)); + String name = FlowVelocityModel.getModelDescription( + Integer.valueOf(code)); Facet facet = new FlowVelocityFacet( 0, diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/GaugeDischargeArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/GaugeDischargeArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/GaugeDischargeArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -191,17 +191,21 @@ try { tableId = Integer.parseInt(ids[1]); } catch (NumberFormatException e) { - log.error("Discharge tables ids string is wrong." + - " Fromat is ;;" + - " Fix your Datacage!"); + log.error("Discharge tables ids string is wrong. " + + "Format is " + + ";;" + + " Fix your Datacage!"); // Let's rather break down completly then show the wrong data. return null; } - DischargeTable table = DischargeTable.getDischargeTableById(tableId); + DischargeTable table = DischargeTable.getDischargeTableById( + tableId); map = new HashMap(); - map.put(getGaugeName(), DischargeTables.loadDischargeTableValues(table)); + map.put(getGaugeName(), DischargeTables.loadDischargeTableValues( + table)); } else { - DischargeTables dt = new DischargeTables(river.getName(), getGaugeName()); + DischargeTables dt = new DischargeTables( + river.getName(), getGaugeName()); map = dt.getValues(); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/GaugeDischargeCurveArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/GaugeDischargeCurveArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/GaugeDischargeCurveArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -47,9 +47,11 @@ Logger.getLogger(GaugeDischargeCurveArtifact.class); public static final String XPATH_RIVER = "/art:action/art:river/@art:name"; - public static final String XPATH_GAUGE = "/art:action/art:gauge/@art:reference"; + public static final String XPATH_GAUGE = + "/art:action/art:gauge/@art:reference"; public static final String NAME = "gaugedischargecurve"; - public static final String STATIC_STATE_NAME = "state.gaugedischargecurve.static"; + public static final String STATIC_STATE_NAME = + "state.gaugedischargecurve.static"; public static final String UIPROVIDER = "gauge_discharge_curve"; public static final String GAUGE_DISCHARGE_CURVE_FACET = "gauge_discharge_curve"; @@ -87,7 +89,8 @@ log.debug("GaugeDischargeCurveArtifact.setup"); if (log.isDebugEnabled()) { - log.debug("GaugeDischargeCurveArtifact.setup" + XMLUtils.toString(data)); + log.debug("GaugeDischargeCurveArtifact.setup" + + XMLUtils.toString(data)); } String gaugeref = XMLUtils.xpathString(data, XPATH_GAUGE, ArtifactNamespaceContext.INSTANCE); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/MainValuesArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/MainValuesArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/MainValuesArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -119,7 +119,8 @@ spawnState(); String restriction = getDatacageIDValue(data); log.debug("mainvalue restriction " + restriction); - boolean restricted = restriction.endsWith("q") || restriction.endsWith("w"); + boolean restricted = restriction.endsWith("q") + || restriction.endsWith("w"); if (!restricted || restriction.endsWith("q")) { fs.add(new MainValuesQFacet( MAINVALUES_Q, @@ -166,8 +167,11 @@ try { Long officialNumber = Long.valueOf(gaugeref); Gauge gauge = Gauge.getGaugeByOfficialNumber(officialNumber); - addData("ld_locations", new DefaultStateData("ld_locations", null, null, - String.valueOf(gauge.getStation()))); + addData( + "ld_locations", + new DefaultStateData("ld_locations", null, null, + String.valueOf(gauge.getStation())) + ); } catch (NumberFormatException nfe) { log.debug("MainValuesArtifact could not parse gaugeref from doc."); } @@ -194,7 +198,11 @@ /** Get important data from the 'calling' artifact. */ @Override - protected void initialize(Artifact artifact, Object context, CallMeta meta) { + protected void initialize( + Artifact artifact, + Object context, + CallMeta meta + ) { log.debug("MainValuesArtifact.initialize"); D4EArtifact winfo = (D4EArtifact) artifact; River river = new RiverAccess(winfo).getRiver(); @@ -202,22 +210,30 @@ if (locations != null) { double location = locations[0]; - addData("ld_locations", new DefaultStateData("ld_locations", null, null, - String.valueOf(location))); + addData( + "ld_locations", + new DefaultStateData("ld_locations", null, null, + String.valueOf(location)) + ); } else { log.error("No location for mainvalues given."); } importData(winfo, "river"); - // In the case of DischargeWQCurves, there are no locations, but a gauge. + // In the case of DischargeWQCurves, there are no locations, + // but a gauge. if (getDataAsString("ld_locations") == null) { // TODO its a tad difficult to remodel Range/Gauge-Access to // do this. String refGaugeID = winfo.getDataAsString("reference_gauge"); if (refGaugeID != null) { - Gauge g = Gauge.getGaugeByOfficialNumber(Integer.parseInt(refGaugeID)); - addData("ld_locations", new DefaultStateData("ld_locations", null, null, - String.valueOf(g.getStation()))); + Gauge g = Gauge.getGaugeByOfficialNumber( + Integer.parseInt(refGaugeID)); + addData( + "ld_locations", + new DefaultStateData("ld_locations", null, null, + String.valueOf(g.getStation())) + ); } else { log.error("MainValuesArtifact: No location/gauge."); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/ManualPointsArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/ManualPointsArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/ManualPointsArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -96,7 +96,11 @@ /** Setup state and facet. */ @Override - protected void initialize(Artifact artifact, Object context, CallMeta meta) { + protected void initialize( + Artifact artifact, + Object context, + CallMeta meta + ) { log.debug("ManualPointsArtifact.initialize"); List fs = new ArrayList(); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/MapArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/MapArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/MapArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -122,7 +122,8 @@ List list = cur.getOutputs(); if (list != null && list.size() > 0) { log.debug( - "Append output modes for current state: " + cur.getID()); + "Append output modes for current state: " + + cur.getID()); List fs = getFacets(cur.getID()); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/QSectorArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/QSectorArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/QSectorArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -104,7 +104,10 @@ log.debug(gr); } - for (int i = 0; i < FixingsKMChartService.I18N_Q_SECTOR_BOARDERS.length; ++i) { + for (int i = 0; + i < FixingsKMChartService.I18N_Q_SECTOR_BOARDERS.length; + ++i + ) { String key = FixingsKMChartService.I18N_Q_SECTOR_BOARDERS[i]; String def = FixingsKMChartService.DEFAULT_Q_SECTOR_BORDERS[i]; String label = Resources.getMsg(context.getMeta(), key, def); @@ -118,7 +121,11 @@ /** Setup state and facet. */ @Override - protected void initialize(Artifact artifact, Object context, CallMeta meta) { + protected void initialize( + Artifact artifact, + Object context, + CallMeta meta + ) { log.debug("QSectorArtifact.initialize"); List fs = new ArrayList(); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/RiverAxisArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/RiverAxisArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/RiverAxisArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -118,7 +118,8 @@ getName(), Integer.parseInt(kind)); } else { if (reproject) { - log.debug("Query extent for RiverAxis with Srid: " + getSrid()); + log.debug("Query extent for RiverAxis with Srid: " + + getSrid()); return GeometryUtils.transform( GeometryUtils.getRiverBoundary(river.getName()), getSrid()); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/SQRelationArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/SQRelationArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/SQRelationArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -66,7 +66,8 @@ if (code != null && !code.isEmpty()) { /* Case that we were instantiated from the datacage */ addStringData("ids", code); - super.setup(identifier, factory, context, callmeta, data, loadFacets); + super.setup( + identifier, factory, context, callmeta, data, loadFacets); return; } @@ -177,7 +178,10 @@ return NAME; } - private boolean hasParameter(StaticSQRelation.Parameter p, List fs) { + private boolean hasParameter( + StaticSQRelation.Parameter p, + List fs + ) { for (Facet f : fs) { if (f.getName().equals("sq_" + p.toString().toLowerCase() + "_curve")) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/SedimentDensityArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/SedimentDensityArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/SedimentDensityArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -133,9 +133,11 @@ String code = getDatacageIDValue(data); if (code != null) { - double[] depth = SedimentDensityFactory.getDepth(Integer.valueOf(code)); + double[] depth = SedimentDensityFactory.getDepth( + Integer.valueOf(code)); - String name = Resources.getMsg(callMeta, "sedimentdensity", "sedimentdensity"); + String name = Resources.getMsg( + callMeta, "sedimentdensity", "sedimentdensity"); name += " " + depth[0] + " - " + depth[1] + " cm"; Facet facet = new SedimentDensityFacet( 0, diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -64,7 +64,8 @@ root.appendChild(name); - ProtocolUtils.appendDescribeHeader(creator, root, identifier(), hash()); + ProtocolUtils.appendDescribeHeader( + creator, root, identifier(), hash()); root.appendChild(createOutputModes(cc, desc, creator)); // Add the data to an anonymous state. @@ -79,8 +80,10 @@ creator.addAttr(itemelent, "name", dataItem.getName(), true); creator.addAttr(itemelent, "type", dataItem.getType(), true); Element valuement = creator.create("item"); - creator.addAttr(valuement, "label", dataItem.getDescription(), true); - creator.addAttr(valuement, "value", dataItem.getValue().toString(), true); + creator.addAttr( + valuement, "label", dataItem.getDescription(), true); + creator.addAttr( + valuement, "value", dataItem.getValue().toString(), true); itemelent.appendChild(valuement); state.appendChild(itemelent); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/StaticMorphWidthArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticMorphWidthArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticMorphWidthArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -111,7 +111,11 @@ } @Override - protected void initialize(Artifact artifact, Object context, CallMeta meta) { + protected void initialize( + Artifact artifact, + Object context, + CallMeta meta + ) { } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWKmsArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWKmsArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWKmsArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -331,7 +331,13 @@ // Do linear interpolation. int mod = kmIncreasing ? -1 : +1; - return Linear.linear(km, wkms.getKm(idx+mod), wkms.getKm(idx), wkms.getW(idx+mod), wkms.getW(idx)); + return Linear.linear( + km, + wkms.getKm(idx+mod), + wkms.getKm(idx), + wkms.getW(idx+mod), + wkms.getW(idx) + ); } @@ -345,9 +351,15 @@ * @param next the next available input km (-1 if unavailable). * @param prev the previous available input km (-1 if unavailable). * - * @return W in wkms that is closer to km than to next and prev, or Double.NaN. + * @return W in wkms that is closer to km than to next and prev, + * or Double.NaN. */ - public double getWAtCloseKm(WKms wkms, double km, double next, double prev) { + public double getWAtCloseKm( + WKms wkms, + double km, + double next, + double prev + ) { // TODO symbolic "-1" pr next/prev is a bad idea (tm), as we compare // distances to these values later. // TODO issue888 diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWQKmsArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWQKmsArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWQKmsArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -71,7 +71,8 @@ String outputName ) { String fname = facet.getName(); - return (fname.equals(STATIC_WQKMS) || fname.equals(STATIC_WQKMS_W)); + return (fname.equals(STATIC_WQKMS) + || fname.equals(STATIC_WQKMS_W)); }}); } @@ -112,7 +113,8 @@ String [] parts = code.split("-"); if (parts.length >= 1) { - boolean official = parts[0].toLowerCase().startsWith("official"); + boolean official = parts[0].toLowerCase() + .startsWith("official"); addStringData("official", official ? "1" : "0"); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -79,7 +79,8 @@ public static final String ARTIFACT_NAME = "winfo"; /** XPath */ - public static final String XPATH_STATIC_UI ="/art:result/art:ui/art:static"; + public static final String XPATH_STATIC_UI = + "/art:result/art:ui/art:static"; /** The default number of steps between the start end end of a selected Q * range. */ @@ -258,7 +259,8 @@ log.debug("'free' calculation (km " + refKm + ")"); } else { - Gauge gauge = river.determineRefGauge(range, rangeAccess.isRange()); + Gauge gauge = river.determineRefGauge( + range, rangeAccess.isRange()); if (gauge == null) { return error( @@ -425,7 +427,11 @@ } /** Create CalculationResult with data and message with args. */ - protected static final CalculationResult error(Object data, String msg, Object ... args) { + protected static final CalculationResult error( + Object data, + String msg, + Object ... args + ) { return new CalculationResult(data, new Calculation(msg, args)); } @@ -728,7 +734,8 @@ log.debug("range: " + Arrays.toString(range)); } - Gauge g = rangeAccess.getRiver().determineRefGauge(range, rangeAccess.isRange()); + Gauge g = rangeAccess.getRiver().determineRefGauge( + range, rangeAccess.isRange()); if (g == null) { log.warn("no gauge found for km: " + range[0]); return null; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/WMSBackgroundArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/WMSBackgroundArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/WMSBackgroundArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -36,7 +36,11 @@ @Override - protected void initialize(Artifact artifact, Object context, CallMeta meta) { + protected void initialize( + Artifact artifact, + Object context, + CallMeta meta + ) { log.debug("Initialize internal state with: "+ artifact.identifier()); D4EArtifact flys = (D4EArtifact) artifact; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/WMSBuildingsArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/WMSBuildingsArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/WMSBuildingsArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -91,7 +91,8 @@ String kind = getIdPart(2); if (kind != null) { - buildings = Building.getBuildings(getRiverId(), Integer.parseInt(kind)); + buildings = Building.getBuildings( + getRiverId(), Integer.parseInt(kind)); } else { buildings = Building.getBuildings(getRiverId(), name); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/WMSDBArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/WMSDBArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/WMSDBArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -239,7 +239,8 @@ public void endOfLife(Artifact owner, Object context) { log.info("Destroy WMSDBState: " + getID()); - String p = RiverUtils.getXPathString(RiverUtils.XPATH_FLOODMAP_SHAPEFILE_DIR); + String p = RiverUtils.getXPathString( + RiverUtils.XPATH_FLOODMAP_SHAPEFILE_DIR); File dir = new File(p, owner.identifier()); if (dir != null && dir.exists()) { @@ -250,10 +251,11 @@ } /** - * This method returns the extent of a DB layer in the projection of the - * database. + * This method returns the extent of a DB layer + * in the projection of the database. * - * @return the extent of the DB layer in the projection of the database. + * @return the extent of the DB layer + * in the projection of the database. */ protected Envelope getExtent() { return getExtent(false); @@ -267,8 +269,9 @@ protected abstract String getSrid(); /** - * This method returns the extent of the DB layer. The projection of the - * extent depends on the reproject parameter. If reproject is set, + * Returns the extent of the DB layer. The projection of the + * extent depends on the reproject parameter. + * If reproject is set, * the extent is reprojected into the original projection which is * specified in the configuration. Otherwise, the projection of the * database is used. diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/WMSFloodmarksArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/WMSFloodmarksArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/WMSFloodmarksArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -135,7 +135,8 @@ return "geom FROM flood_marks USING SRID " + srid; } else { - return "geom FROM flood_marks USING UNIQUE id USING SRID " + srid; + return "geom FROM flood_marks USING UNIQUE id USING SRID " + + srid; } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/WMSHWSPointsArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/WMSHWSPointsArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/WMSHWSPointsArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -141,7 +141,8 @@ return "geom FROM hws_points USING SRID " + srid; } else { - return "geom FROM hws_points USING UNIQUE id USING SRID " + srid; + return "geom FROM hws_points USING UNIQUE id USING SRID " + + srid; } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/WMSHydrBoundaryArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/WMSHydrBoundaryArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/WMSHydrBoundaryArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -61,7 +61,8 @@ } - public static class HydrBoundaryState extends WMSDBState implements FacetTypes + public static class HydrBoundaryState + extends WMSDBState implements FacetTypes { private static final Logger log = Logger.getLogger(HydrBoundaryState.class); @@ -97,7 +98,8 @@ boundaries = HydrBoundary.getHydrBoundaries(getRiverId(), getName(), Integer.parseInt(kind)); } else { - boundaries = HydrBoundary.getHydrBoundaries(getRiverId(), getName()); + boundaries = HydrBoundary.getHydrBoundaries( + getRiverId(), getName()); } Envelope max = null; @@ -138,7 +140,8 @@ return "geom FROM hydr_boundaries USING SRID " + srid; } else { - return "geom FROM hydr_boundaries USING UNIQUE id USING SRID " + srid; + return "geom FROM hydr_boundaries USING UNIQUE id USING SRID " + + srid; } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/WMSHydrBoundaryPolyArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/WMSHydrBoundaryPolyArtifact.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/WMSHydrBoundaryPolyArtifact.java Fri Jan 19 11:23:42 2018 +0100 @@ -61,7 +61,8 @@ } - public static class HydrBoundaryPolyState extends WMSDBState implements FacetTypes + public static class HydrBoundaryPolyState + extends WMSDBState implements FacetTypes { private static final Logger log = Logger.getLogger(HydrBoundaryPolyState.class); @@ -170,7 +171,9 @@ return "geom FROM hydr_boundaries_poly USING SRID " + srid; } else { - return "geom FROM hydr_boundaries_poly USING UNIQUE id USING SRID " + srid; + return "geom FROM hydr_boundaries_poly " + + "USING UNIQUE id USING SRID " + + srid; } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/access/Access.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/Access.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/Access.java Fri Jan 19 11:23:42 2018 +0100 @@ -56,7 +56,7 @@ return (String)sd.getValue(); } - /** Get a data entry as double, returns null if string not double valueoffable. */ + /** Get a data entry as double, or null */ protected Double getDouble(String key) { StateData sd = artifact.getData(key); if (sd == null) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java Fri Jan 19 11:23:42 2018 +0100 @@ -58,7 +58,8 @@ String[] diff1parts = diff1.split(";"); String[] diff2parts = diff2.split(";"); if (log.isDebugEnabled()) { - log.debug("creating 2 artifacts." + diff1parts[0] + "; " + diff2parts[0]); + log.debug("creating 2 artifacts." + + diff1parts[0] + "; " + diff2parts[0]); } differenceArtifactIds[i][0] = diff1parts[0]; differenceArtifactIds[i][1] = diff2parts[0]; @@ -87,8 +88,10 @@ String [][] artifactsIds = getDifferenceArtifactIds(); int [][] ids = new int[artifactsIds.length][2]; for (int i = 0; i < artifactsIds.length; ++i) { - D4EArtifact a1 = RiverUtils.getArtifact(artifactsIds[i][0], context); - D4EArtifact a2 = RiverUtils.getArtifact(artifactsIds[i][1], context); + D4EArtifact a1 = RiverUtils.getArtifact( + artifactsIds[i][0], context); + D4EArtifact a2 = RiverUtils.getArtifact( + artifactsIds[i][1], context); ids[i][0] = getHeightId(a1); ids[i][1] = getHeightId(a2); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedHeightAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedHeightAccess.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedHeightAccess.java Fri Jan 19 11:23:42 2018 +0100 @@ -55,7 +55,8 @@ for (String part: parts) { if (part.indexOf(SoundingsSelect.PREFIX_SINGLE) >= 0) { - String tmp = part.replace(SoundingsSelect.PREFIX_SINGLE, ""); + String tmp = part.replace( + SoundingsSelect.PREFIX_SINGLE, ""); try { int i = Integer.parseInt(tmp); @@ -64,7 +65,8 @@ } } catch (NumberFormatException nfe) { - log.warn("Cannot parse int from string: '" + tmp + "'"); + log.warn( + "Cannot parse int from string: '" + tmp + "'"); } } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/access/DGMAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/DGMAccess.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/DGMAccess.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.access; import org.dive4elements.river.artifacts.D4EArtifact; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/access/ExtremeAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/ExtremeAccess.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/ExtremeAccess.java Fri Jan 19 11:23:42 2018 +0100 @@ -91,12 +91,18 @@ return null; } ranges = new ArrayList(); - DoubleUtil.parseSegments(rangesS, new DoubleUtil.SegmentCallback() { - @Override - public void newSegment(double from, double to, double [] values) { - ranges.add(new RangeWithValues(from, to, values)); - } - }); + DoubleUtil.parseSegments( + rangesS, + new DoubleUtil.SegmentCallback() { + @Override + public void newSegment( + double from, + double to, + double [] values + ) { + ranges.add(new RangeWithValues(from, to, values)); + } + }); } if (log.isDebugEnabled()) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/access/IsOfficialAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/IsOfficialAccess.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/IsOfficialAccess.java Fri Jan 19 11:23:42 2018 +0100 @@ -11,7 +11,7 @@ import org.dive4elements.river.artifacts.D4EArtifact; -/** Access data used to mark whether a certain Wst columns is an official line. */ +/** Access data used to mark a certain Wst column as an official line. */ public class IsOfficialAccess extends Access { protected Boolean isOfficial; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java Fri Jan 19 11:23:42 2018 +0100 @@ -87,7 +87,9 @@ if (locationStr == null || locationStr.length() == 0) { if (getArtifact() instanceof WINFOArtifact) { WINFOArtifact winfo = (WINFOArtifact) getArtifact(); - if (winfo.getReferenceStartKm() != null && winfo.getReferenceEndKms() != null) { + if (winfo.getReferenceStartKm() != null + && winfo.getReferenceEndKms() != null + ) { return new double[] { winfo.getReferenceStartKm().doubleValue(), diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/access/SedimentLoadAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/SedimentLoadAccess.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/SedimentLoadAccess.java Fri Jan 19 11:23:42 2018 +0100 @@ -18,7 +18,8 @@ public class SedimentLoadAccess extends RangeAccess { - private static final Logger log = Logger.getLogger(SedimentLoadAccess.class); + private static final Logger log = Logger.getLogger( + SedimentLoadAccess.class); private String time; private String unit; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/context/RiverContextFactory.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/context/RiverContextFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/context/RiverContextFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -103,11 +103,14 @@ public static final String XPATH_RIVER_WMS = "/artifact-database/floodmap/river"; - public static final String XPATH_MODULES = "/artifact-database/modules/module"; + public static final String XPATH_MODULES = + "/artifact-database/modules/module"; - private static final String XPATH_ZOOM_SCALES = "/artifact-database/options/zoom-scales/zoom-scale"; + private static final String XPATH_ZOOM_SCALES = + "/artifact-database/options/zoom-scales/zoom-scale"; - private static final String XPATH_DGM_PATH = "/artifact-database/options/dgm-path/text()"; + private static final String XPATH_DGM_PATH = + "/artifact-database/options/dgm-path/text()"; private static GlobalContext GLOBAL_CONTEXT_INSTANCE; @@ -205,7 +208,10 @@ * @param config the config document. * @param context the RiverContext. */ - protected void configureTransitions(Document config, RiverContext context) { + protected void configureTransitions( + Document config, + RiverContext context + ) { TransitionEngine engine = new TransitionEngine(); List artifacts = getArtifactConfigurations(config); @@ -231,7 +237,8 @@ "Artifact '" + artName + "' has " + trans + " transitions."); for (int i = 0; i < trans; i++) { - Transition t = TransitionFactory.createTransition(list.item(i)); + Transition t = TransitionFactory.createTransition( + list.item(i)); String s = t.getFrom(); engine.addTransition(s, t); } @@ -267,7 +274,8 @@ if (!xlink.isEmpty()) { File file = new File(xlink); if (!file.isFile() || !file.canRead()) { - log.warn("Artifact configuration '" + file + "' not found."); + log.warn("Artifact configuration '" + + file + "' not found."); } else { Document doc = XMLUtils.parseDocument(file); if (doc != null) { @@ -335,8 +343,10 @@ * @param config the config document. * @param context the RiverContext. */ - protected void configureOutGenerators(Document config, RiverContext context){ - + protected void configureOutGenerators( + Document config, + RiverContext context + ) { NodeList outGenerators = (NodeList) XMLUtils.xpath( config, XPATH_OUTPUT_GENERATORS, @@ -403,7 +413,8 @@ cis = new ArrayList(); for (String injector: injectors.split("[\\s,]+")) { try { - ContextInjector ci = (ContextInjector)Class.forName(injector) + ContextInjector ci = (ContextInjector)Class + .forName(injector) .newInstance(); ci.setup(item); cis.add(ci); @@ -511,11 +522,15 @@ log.debug("Parse theme cfg: " + themeConfig); - return XMLUtils.parseDocument(new File(themeConfig), true, XMLUtils.CONF_RESOLVER); + return XMLUtils.parseDocument( + new File(themeConfig), true, XMLUtils.CONF_RESOLVER); } - protected void configureThemesMappings(Document cfg, RiverContext context) { + protected void configureThemesMappings( + Document cfg, + RiverContext context + ) { log.debug("RiverContextFactory.configureThemesMappings"); Document config = getThemeConfig(cfg); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/DBConfig.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/DBConfig.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/DBConfig.java Fri Jan 19 11:23:42 2018 +0100 @@ -58,7 +58,8 @@ public static final String DEFAULT_URL = - "jdbc:h2:mem:datacage;INIT=RUNSCRIPT FROM '${artifacts.config.dir}/datacage.sql'"; + "jdbc:h2:mem:datacage;" + + "INIT=RUNSCRIPT FROM '${artifacts.config.dir}/datacage.sql'"; public static final String RESOURCE_PATH = "/datacage-sql"; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Datacage.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Datacage.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Datacage.java Fri Jan 19 11:23:42 2018 +0100 @@ -262,7 +262,8 @@ final String collectionName, final Date collectionCreated ) { - Integer c = getId(collections, collectionId, SQL_COLLECTION_BY_GID); + Integer c = getId( + collections, collectionId, SQL_COLLECTION_BY_GID); if (c != null) { return c; @@ -285,9 +286,10 @@ stmnt.setString(2, collectionId); stmnt.setInt (3, ownerId); setString(stmnt, 4, collectionName); - Timestamp timestamp = new Timestamp(collectionCreated != null - ? collectionCreated.getTime() - : System.currentTimeMillis()); + Timestamp timestamp = + new Timestamp(collectionCreated != null + ? collectionCreated.getTime() + : System.currentTimeMillis()); stmnt.setTimestamp(5, timestamp); stmnt.execute(); conn.commit(); @@ -504,7 +506,8 @@ } if (!(artifact instanceof D4EArtifact)) { - log.warn("need D4EArtifact here (have " + artifact.getClass() + ")"); + log.warn("need D4EArtifact here (have " + + artifact.getClass() + ")"); return; } @@ -551,7 +554,8 @@ ) { log.debug("storedArtifact"); if (!(artifact instanceof D4EArtifact)) { - log.warn("need D4EArtifact here but have a " + artifact.getClass()); + log.warn("need D4EArtifact here but have a " + + artifact.getClass()); return; } @@ -905,7 +909,8 @@ }; if (!exec.runWrite()) { - log.error("storing state of artifact failed ("+artifactId+","+artifact.getCurrentStateId()+")"); + log.error("storing state of artifact failed (" + + artifactId + "," + artifact.getCurrentStateId() + ")"); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java Fri Jan 19 11:23:42 2018 +0100 @@ -218,7 +218,8 @@ String macroName = ((Element)node).getAttribute("name"); Node inMacroNode = - findSelectNode(getMacroChildren(macroName), selectName); + findSelectNode( + getMacroChildren(macroName), selectName); if (inMacroNode != null) { return inMacroNode; } @@ -260,7 +261,8 @@ String container = expand(current.getAttribute("container")); if (container.isEmpty()) { - log.warn("dc:container-context: no 'container' attribute found"); + log.warn( + "dc:container-context: no 'container' attribute found"); return; } @@ -272,7 +274,8 @@ return; } - String [][] properties = extractProperties((Element)propertiesNode); + String [][] properties = extractProperties( + (Element)propertiesNode); if (properties.length == 0) { log.warn("dc:properties: No properties defined."); @@ -288,7 +291,8 @@ c = Arrays.asList((Object [])c); } if (!(c instanceof Collection)) { - log.warn("dc:container-context: container is not a collection."); + log.warn( + "dc:container-context: container is not a collection."); return; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/BuilderPool.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/BuilderPool.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/BuilderPool.java Fri Jan 19 11:23:42 2018 +0100 @@ -72,7 +72,8 @@ log.error(pce); } - log.error("Returning original document. This will lead to threading issues."); + log.error("Returning original document. " + + "This will lead to threading issues."); return document; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java Fri Jan 19 11:23:42 2018 +0100 @@ -459,7 +459,10 @@ return ""; } - public static Set allStateSuccessors(String artifactName, String stateId) { + public static Set allStateSuccessors( + String artifactName, + String stateId + ) { GlobalContext gc = RiverContextFactory.getGlobalContext(); if (gc == null) { return Collections.emptySet(); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/TypeConverter.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/TypeConverter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/TypeConverter.java Fri Jan 19 11:23:42 2018 +0100 @@ -58,7 +58,8 @@ return object; } try { - return new Timestamp((long)Double.parseDouble(object.toString())); + return new Timestamp( + (long)Double.parseDouble(object.toString())); } catch (NumberFormatException nfe) { log.warn(nfe); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/geom/Lines.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/geom/Lines.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/geom/Lines.java Fri Jan 19 11:23:42 2018 +0100 @@ -43,8 +43,10 @@ * @return area of polygon with four vertices. */ public static double area(Point2D p1, Point2D p2, Point2D p3, Point2D p4) { - double[] x = new double[] {p1.getX(), p2.getX(), p3.getX(), p4.getX(), p1.getX() }; - double[] y = new double[] {p1.getY(), p2.getY(), p3.getY(), p4.getY(), p1.getY() }; + double[] x = new double[] { + p1.getX(), p2.getX(), p3.getX(), p4.getX(), p1.getX() }; + double[] y = new double[] { + p1.getY(), p2.getY(), p3.getY(), p4.getY(), p1.getY() }; double area = 0d; for (int i=0; i <4; i++) { area += (x[i] * y[i+1]) - (x[i+1] * y[i]); @@ -88,8 +90,10 @@ * @return A list of Lines representing the water surface and the * calculated area between water surface and river bed. */ - public static ListWithArea fillWater(List points, double waterLevel) { - + public static ListWithArea fillWater( + List points, + double waterLevel + ) { boolean debug = log.isDebugEnabled(); if (debug) { @@ -222,7 +226,8 @@ // TODO trigger area calculation if (p1W || p2W) { if (debug) { - log.debug("water hits vertex: " + p1 + " " + p2 + " " + mode); + log.debug("water hits vertex: " + + p1 + " " + p2 + " " + mode); } if (p1W && p2W) { // parallel to water -> dry log.debug("water hits both vertices"); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/map/RiverMapfileGeneratorStarter.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/map/RiverMapfileGeneratorStarter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/map/RiverMapfileGeneratorStarter.java Fri Jan 19 11:23:42 2018 +0100 @@ -23,7 +23,8 @@ */ public class RiverMapfileGeneratorStarter implements LifetimeListener { - private static Logger log = Logger.getLogger(RiverMapfileGeneratorStarter.class); + private static Logger log = Logger.getLogger( + RiverMapfileGeneratorStarter.class); @Override public void setup(Document document) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/math/StdDevOutlier.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/math/StdDevOutlier.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/math/StdDevOutlier.java Fri Jan 19 11:23:42 2018 +0100 @@ -39,7 +39,8 @@ boolean debug = log.isDebugEnabled(); if (debug) { - log.debug("factor for std dev test (that calculates std err): " + factor); + log.debug("factor for std dev test (that calculates std err): " + + factor); } int N = values.size(); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/AreaFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/AreaFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/AreaFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -120,7 +120,13 @@ protected boolean doPaintBetween; /** Create a new result data bundle. */ - public Data(String upperFacetName, String lowerFacetName, Object low, Object up, boolean between) { + public Data( + String upperFacetName, + String lowerFacetName, + Object low, + Object up, + boolean between + ) { this.lowerData = low; this.upperData = up; this.doPaintBetween = between; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/Calculation4.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/Calculation4.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/Calculation4.java Fri Jan 19 11:23:42 2018 +0100 @@ -168,7 +168,9 @@ s2 = segments.get(0); Arrays.fill(functions, Identity.IDENTITY); } - else if (pos >= segments.get(segments.size()-1).referencePoint) { + else if ( + pos >= segments.get(segments.size()-1).referencePoint + ) { // after last segment -> "gleichwertig" if (debug) { log.debug("after last segment -> gleichwertig"); @@ -195,8 +197,9 @@ Segment si1 = segments.get(i-1); Segment si = segments.get(i); if (debug) { - log.debug("check " + pos + " in " + - si1.referencePoint + " - " + si.referencePoint); + log.debug("check " + pos + " in " + + si1.referencePoint + " - " + + si.referencePoint); } if (pos >= si1.referencePoint && pos <= si. referencePoint) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/Calculation6.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/Calculation6.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/Calculation6.java Fri Jan 19 11:23:42 2018 +0100 @@ -167,7 +167,8 @@ protected List fetchDischargeTables(Gauge gauge) { List all = gauge.getDischargeTables(); - List relevant = new ArrayList(all.size()); + List relevant = + new ArrayList(all.size()); for (DischargeTable dt: all) { if (isDischargeTableRelevant(dt)) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/ConstantWQKms.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ConstantWQKms.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ConstantWQKms.java Fri Jan 19 11:23:42 2018 +0100 @@ -31,7 +31,12 @@ this(kms, qs, ws, ""); } - public ConstantWQKms(double [] kms, double [] qs, double [] ws, String name) { + public ConstantWQKms( + double [] kms, + double [] qs, + double [] ws, + String name + ) { super(kms, qs, ws, name); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/CrossSectionFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/CrossSectionFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/CrossSectionFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -122,7 +122,8 @@ /** Do a deep copy. */ @Override public Facet deepCopy() { - CrossSectionFacet copy = new CrossSectionFacet(this.index, this.description); + CrossSectionFacet copy = new CrossSectionFacet( + this.index, this.description); copy.set(this); return copy; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/CrossSectionWaterLineFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/CrossSectionWaterLineFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/CrossSectionWaterLineFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -49,7 +49,11 @@ * @param name 'type' of this facet. * @param description (maybe) localized user-visible description. */ - public CrossSectionWaterLineFacet(int idx, String name, String description) { + public CrossSectionWaterLineFacet( + int idx, + String name, + String description + ) { super(idx, name, description); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/DifferenceCurveFilterFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/DifferenceCurveFilterFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/DifferenceCurveFilterFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.model; import org.dive4elements.artifactdatabase.state.Facet; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/FacetTypes.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/FacetTypes.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/FacetTypes.java Fri Jan 19 11:23:42 2018 +0100 @@ -189,6 +189,8 @@ SQF("sq_relation_f"), HD("historical_discharge"), HDWQ("historical_discharge_wq"); + // FIXME: do we need this? and why? + // SFD("sinfo_flow_depth"); private String chartTypeString; @@ -231,8 +233,10 @@ String DISCHARGE_LONGITUDINAL_W = "discharge_longitudinal_section.w"; String DISCHARGE_LONGITUDINAL_Q = "discharge_longitudinal_section.q"; - String DISCHARGE_LONGITUDINAL_Q_INFOLD = "discharge_longitudinal_section.q.infolding"; - String DISCHARGE_LONGITUDINAL_Q_INFOLD_CUT = "discharge_longitudinal_section.q.cutting"; + String DISCHARGE_LONGITUDINAL_Q_INFOLD = + "discharge_longitudinal_section.q.infolding"; + String DISCHARGE_LONGITUDINAL_Q_INFOLD_CUT = + "discharge_longitudinal_section.q.cutting"; String DISCHARGE_LONGITUDINAL_C = "discharge_longitudinal_section.c"; String LONGITUDINAL_W = "longitudinal_section.w"; @@ -287,9 +291,11 @@ String REPORT = "report"; String HISTORICAL_DISCHARGE_Q = "historical_discharge.historicalq"; - String HISTORICAL_DISCHARGE_Q_DIFF = "historical_discharge.historicalq.diff"; + String HISTORICAL_DISCHARGE_Q_DIFF = + "historical_discharge.historicalq.diff"; String HISTORICAL_DISCHARGE_W = "historical_discharge.historicalw"; - String HISTORICAL_DISCHARGE_W_DIFF = "historical_discharge.historicalw.diff"; + String HISTORICAL_DISCHARGE_W_DIFF = + "historical_discharge.historicalw.diff"; String HISTORICAL_DISCHARGE_WQ_Q = "historical_discharge.wq.q"; String HISTORICAL_DISCHARGE_WQ_W = "historical_discharge.wq.w"; @@ -300,8 +306,10 @@ String FLOW_VELOCITY_TOTALCHANNEL = "flow_velocity.totalchannel"; /** Also called SHEAR_STRESS. */ String FLOW_VELOCITY_TAU = "flow_velocity.tau"; - String FLOW_VELOCITY_MAINCHANNEL_FILTERED = "flow_velocity.mainchannel.filtered"; - String FLOW_VELOCITY_TOTALCHANNEL_FILTERED = "flow_velocity.totalchannel.filtered"; + String FLOW_VELOCITY_MAINCHANNEL_FILTERED = + "flow_velocity.mainchannel.filtered"; + String FLOW_VELOCITY_TOTALCHANNEL_FILTERED = + "flow_velocity.totalchannel.filtered"; String FLOW_VELOCITY_TAU_FILTERED = "flow_velocity.tau.filtered"; String FLOW_VELOCITY_ANNOTATION = "flow_velocity.annotation"; String FLOW_VELOCITY_MEASUREMENT = "flow_velocity.measurement"; @@ -311,33 +319,46 @@ String MIDDLE_BED_HEIGHT_SINGLE = "bedheight_middle.single"; String MIDDLE_BED_HEIGHT_ANNOTATION = "bedheight_middle.annotation"; - String BED_QUALITY_DATA_FACET = "bed_longitudinal_section"; - String BED_QUALITY_POROSITY_TOPLAYER = BED_QUALITY_DATA_FACET + ".porosity.toplayer"; - String BED_QUALITY_POROSITY_SUBLAYER = BED_QUALITY_DATA_FACET + ".porosity.sublayer"; - String BED_QUALITY_BED_DIAMETER_TOPLAYER = BED_QUALITY_DATA_FACET + ".diameter.toplayer"; - String BED_QUALITY_BED_DIAMETER_SUBLAYER = BED_QUALITY_DATA_FACET + ".diameter.sublayer"; - String BED_QUALITY_SEDIMENT_DENSITY_TOPLAYER = BED_QUALITY_DATA_FACET + ".density.toplayer"; - String BED_QUALITY_SEDIMENT_DENSITY_SUBLAYER = BED_QUALITY_DATA_FACET + ".density.sublayer"; - String BED_QUALITY_BEDLOAD_DIAMETER = BED_QUALITY_DATA_FACET + ".diameter.bedload"; - String BED_DIAMETER_DATA_TOP = BED_QUALITY_DATA_FACET + ".diameter.toplayer.data"; - String BED_DIAMETER_DATA_SUB = BED_QUALITY_DATA_FACET + ".diameter.sublayer.data"; - String BEDLOAD_DIAMETER_DATA = BED_QUALITY_DATA_FACET + ".diameter.bedload.data"; - String POROSITY = "porosity"; + String BED_QUALITY_DATA_FACET = "bed_longitudinal_section"; + String BED_QUALITY_POROSITY_TOPLAYER = + BED_QUALITY_DATA_FACET + ".porosity.toplayer"; + String BED_QUALITY_POROSITY_SUBLAYER = + BED_QUALITY_DATA_FACET + ".porosity.sublayer"; + String BED_QUALITY_BED_DIAMETER_TOPLAYER = + BED_QUALITY_DATA_FACET + ".diameter.toplayer"; + String BED_QUALITY_BED_DIAMETER_SUBLAYER = + BED_QUALITY_DATA_FACET + ".diameter.sublayer"; + String BED_QUALITY_SEDIMENT_DENSITY_TOPLAYER = + BED_QUALITY_DATA_FACET + ".density.toplayer"; + String BED_QUALITY_SEDIMENT_DENSITY_SUBLAYER = + BED_QUALITY_DATA_FACET + ".density.sublayer"; + String BED_QUALITY_BEDLOAD_DIAMETER = + BED_QUALITY_DATA_FACET + ".diameter.bedload"; + String BED_DIAMETER_DATA_TOP = + BED_QUALITY_DATA_FACET + ".diameter.toplayer.data"; + String BED_DIAMETER_DATA_SUB = + BED_QUALITY_DATA_FACET + ".diameter.sublayer.data"; + String BEDLOAD_DIAMETER_DATA = + BED_QUALITY_DATA_FACET + ".diameter.bedload.data"; + String POROSITY = "porosity"; - String BED_DIFFERENCE_YEAR = "bedheight_difference.year"; - String BED_DIFFERENCE_YEAR_FILTERED = "bedheight_difference.year.filtered"; - String BED_DIFFERENCE_HEIGHT_YEAR = "bedheight_difference.height_year"; - String BED_DIFFERENCE_HEIGHT_YEAR_FILTERED = "bedheight_difference.height_year.filtered"; - String BED_DIFFERENCE_YEAR_HEIGHT1 = "bedheight_difference.year.height1"; - String BED_DIFFERENCE_YEAR_HEIGHT2 = "bedheight_difference.year.height2"; - String BED_DIFFERENCE_YEAR_HEIGHT1_FILTERED = "bedheight_difference.year.height1.filtered"; - String BED_DIFFERENCE_YEAR_HEIGHT2_FILTERED = "bedheight_difference.year.height2.filtered"; + String BED_DIFFERENCE_YEAR = "bedheight_difference.year"; + String BED_DIFFERENCE_YEAR_FILTERED = "bedheight_difference.year.filtered"; + String BED_DIFFERENCE_HEIGHT_YEAR = "bedheight_difference.height_year"; + String BED_DIFFERENCE_HEIGHT_YEAR_FILTERED = + "bedheight_difference.height_year.filtered"; + String BED_DIFFERENCE_YEAR_HEIGHT1 = "bedheight_difference.year.height1"; + String BED_DIFFERENCE_YEAR_HEIGHT2 = "bedheight_difference.year.height2"; + String BED_DIFFERENCE_YEAR_HEIGHT1_FILTERED = + "bedheight_difference.year.height1.filtered"; + String BED_DIFFERENCE_YEAR_HEIGHT2_FILTERED = + "bedheight_difference.year.height2.filtered"; String MORPHOLOGIC_WIDTH = "morph-width"; - String SEDIMENT_DENSITY = "sediment.density"; + String SEDIMENT_DENSITY = "sediment.density"; - String SQ_OVERVIEW = "sq_overview"; + String SQ_OVERVIEW = "sq_overview"; String SQ_A_CURVE = "sq_a_curve"; String SQ_A_MEASUREMENT = "sq_a_measurement"; @@ -409,7 +430,8 @@ String SQ_E_MEASUREMENT_OV = "sq_e_measurement_overview"; String SQ_E_OUTLIER_OV = "sq_e_outlier_overview"; String SQ_E_OUTLIER_CURVE_OV = "sq_e_outlier_curve_overview"; - String SQ_E_OUTLIER_MEASUREMENT_OV = "sq_e_outlier_curve_measurement_overview"; + String SQ_E_OUTLIER_MEASUREMENT_OV = + "sq_e_outlier_curve_measurement_overview"; String SQ_F_CURVE_OV = "sq_f_curve_overview"; String SQ_F_MEASUREMENT_OV = "sq_f_measurement_overview"; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/FlowVelocityFilterFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/FlowVelocityFilterFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/FlowVelocityFilterFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -28,7 +28,8 @@ */ public class FlowVelocityFilterFacet extends DataFacet { - private static Logger log = Logger.getLogger(FlowVelocityFilterFacet.class); + private static Logger log = Logger.getLogger( + FlowVelocityFilterFacet.class); public FlowVelocityFilterFacet() { // required for clone operation deepCopy() @@ -70,9 +71,12 @@ FlowVelocityData oldData = data[index]; FlowVelocityData newData = new FlowVelocityData(); double[][] q = oldData.getQPoints(); - double[][] totalV = MovingAverage.weighted(oldData.getTotalChannelPoints(), radius); - double[][] mainV = MovingAverage.weighted(oldData.getMainChannelPoints(), radius); - double[][] tau = MovingAverage.weighted(oldData.getTauPoints(), radius); + double[][] totalV = MovingAverage.weighted( + oldData.getTotalChannelPoints(), radius); + double[][] mainV = MovingAverage.weighted( + oldData.getMainChannelPoints(), radius); + double[][] tau = MovingAverage.weighted( + oldData.getTauPoints(), radius); for(int j = 0; j < q[0].length; j++) { newData.addKM(q[0][j]); newData.addQ(q[1][j]); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/GaugeDischargeCurveFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/GaugeDischargeCurveFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/GaugeDischargeCurveFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -97,7 +97,8 @@ } return new WQKms(kms, values[0], values[1], name); } - double[] ws = transformToM(values[1], ((Number)pnpObject).doubleValue()); + double[] ws = transformToM( + values[1], ((Number)pnpObject).doubleValue()); return new WQKms(kms, values[0], ws, name); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/HYKFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/HYKFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/HYKFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -52,12 +52,14 @@ List providers = context.getDataProvider(dataKey); if (providers.size() < 1) { - log.warn("Could not find Cross-Section data provider to get master cs km."); + log.warn("Could not find Cross-Section data provider " + + "to get master cs km."); return null; } - FastCrossSectionLine crossSection = (FastCrossSectionLine) providers.get(0) - .provideData(dataKey, null, context); + FastCrossSectionLine crossSection = + (FastCrossSectionLine)providers.get(0).provideData( + dataKey, null, context); if(crossSection == null) { log.debug("getData: crossSection is null"); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/HistoricalWQTimerange.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/HistoricalWQTimerange.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/HistoricalWQTimerange.java Fri Jan 19 11:23:42 2018 +0100 @@ -26,7 +26,12 @@ public static class HistoricalTimerangeItem extends TimerangeItem { public double diff; - public HistoricalTimerangeItem (Timerange timerange, double q, double w, double diff) { + public HistoricalTimerangeItem( + Timerange timerange, + double q, + double w, + double diff + ) { super(timerange, q, w); this.diff = diff; } @@ -82,9 +87,11 @@ @Override public List sort() { - ArrayList items = new ArrayList(timeranges.size()); + ArrayList items = + new ArrayList(timeranges.size()); for (int i = 0, n = size(); i < n; i++) { - items.add(new HistoricalTimerangeItem(getTimerange(i), getQ(i), getW(i), diffs.get(i))); + items.add(new HistoricalTimerangeItem( + getTimerange(i), getQ(i), getW(i), diffs.get(i))); } Collections.sort(items); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -53,7 +53,10 @@ * curve in WQDay (if hit). * Employ linear interpolation. */ - protected static void setHitPoint(WQDay wqday, StickyAxisAnnotation annotation) { + protected static void setHitPoint( + WQDay wqday, + StickyAxisAnnotation annotation + ) { float q = annotation.getPos(); Double day = wqday.interpolateDayByQ(q); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -49,7 +49,10 @@ * curve in WQDay (if hit). * Employ linear interpolation. */ - protected static void setHitPoint(WQDay wqday, StickyAxisAnnotation annotation) { + protected static void setHitPoint( + WQDay wqday, + StickyAxisAnnotation annotation + ) { float w = annotation.getPos(); Double day = wqday.interpolateDayByW(w); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -152,11 +152,14 @@ ManagedFacet otherFacet = (ManagedFacet) other; return this.getVisible() == otherFacet.getVisible() && this.getActive() == otherFacet.getActive() && - CompareUtil.areSame(this.getArtifact(), otherFacet.getArtifact()) && + CompareUtil.areSame( + this.getArtifact(), otherFacet.getArtifact()) && this.getIndex() == otherFacet.getIndex() && CompareUtil.areSame(this.getName(), otherFacet.getName()) && - CompareUtil.areSame(this.getBoundToOut(), otherFacet.getBoundToOut()) && - CompareUtil.areSame(this.getDescription(), otherFacet.getDescription()); + CompareUtil.areSame( + this.getBoundToOut(), otherFacet.getBoundToOut()) && + CompareUtil.areSame( + this.getDescription(), otherFacet.getDescription()); // Missing properties are blackboard, data, position. } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManualPointsFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManualPointsFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManualPointsFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -26,7 +26,8 @@ extends DefaultFacet { /** Logger for this class. */ - private static final Logger log = Logger.getLogger(ManualPointsFacet.class); + private static final Logger log = Logger.getLogger( + ManualPointsFacet.class); /** @@ -51,7 +52,8 @@ /** * Get List of ManualPoints for river from Artifact. * - * @param artifact (ManualPoints-)Artifact to query for list of ManualPoints. + * @param artifact (ManualPoints-)Artifact to query + * for list of ManualPoints. * @param context Ignored. */ @Override diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/OfficialLineFinder.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/OfficialLineFinder.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/OfficialLineFinder.java Fri Jan 19 11:23:42 2018 +0100 @@ -206,7 +206,8 @@ return rivers2officialLines; } - public static final Range MAX_RANGE = new Range(-Double.MAX_VALUE, +Double.MAX_VALUE); + public static final Range MAX_RANGE = + new Range(-Double.MAX_VALUE, +Double.MAX_VALUE); private static final String nn(String s) { return s != null ? s : ""; @@ -259,7 +260,10 @@ } } - private static List filterByRange(Range range, List ranges) { + private static List filterByRange( + Range range, + List ranges + ) { List list = new ArrayList(ranges.size()); for (ValueRange r: ranges) { if (r.intersects(range)) { @@ -269,7 +273,10 @@ return list; } - private static List filterByQRange(Range range, List ranges) { + private static List filterByQRange( + Range range, + List ranges + ) { List list = new ArrayList(ranges.size()); for (ValueRange r: ranges) { if (r.intersectsValueRange(range) && !list.contains(r)) { @@ -279,7 +286,10 @@ return list; } - private static List filterByQValues(double[] values, List ranges) { + private static List filterByQValues( + double[] values, + List ranges + ) { List list = new ArrayList(ranges.size()); for (ValueRange r: ranges) { for (double val: values) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/Parameters.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/Parameters.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/Parameters.java Fri Jan 19 11:23:42 2018 +0100 @@ -183,7 +183,8 @@ /** * Performes a binary search in the column identified by its * index. - * @return Index of found element or negative insertion point (shifted by one) + * @return Index of found element or negative insertion point + * (shifted by one) */ public int binarySearch(int columnIndex, double value) { TDoubleArrayList column = columns[columnIndex]; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/QRangeTree.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/QRangeTree.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/QRangeTree.java Fri Jan 19 11:23:42 2018 +0100 @@ -382,12 +382,14 @@ sb.append(": ").append(current.q).append("\"]\n"); if (current.left != null) { String leftName = name(current.left); - sb.append(name).append(" -- n").append(leftName).append("\n"); + sb.append(name).append(" -- n").append(leftName) + .append("\n"); stack.push(current.left); } if (current.right != null) { String rightName = name(current.right); - sb.append(name).append(" -- n").append(rightName).append("\n"); + sb.append(name).append(" -- n").append(rightName) + .append("\n"); stack.push(current.right); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/RelativePointFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/RelativePointFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/RelativePointFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -128,7 +128,8 @@ } Double start = (Double) providers.get(0). - provideData(ReferenceCurveFacet.BB_REFERENCECURVE_STARTKM, null, context); + provideData( + ReferenceCurveFacet.BB_REFERENCECURVE_STARTKM, null, context); providers = context. getDataProvider(ReferenceCurveFacet.BB_REFERENCECURVE_ENDKMS); @@ -136,11 +137,13 @@ log.warn("Could not find reference curve endkms data provider."); } double[] ends = (double[]) providers.get(0). - provideData(ReferenceCurveFacet.BB_REFERENCECURVE_ENDKMS, null, context); + provideData( + ReferenceCurveFacet.BB_REFERENCECURVE_ENDKMS, null, context); log.debug("Got s " + start + " e " + ends); - double startW = StaticWKmsArtifact.getWAtKmLin(wKms, start.doubleValue()); + double startW = StaticWKmsArtifact.getWAtKmLin( + wKms, start.doubleValue()); // TODO handle multiple ends. double endW = StaticWKmsArtifact.getWAtKmLin(wKms, ends[0]); log.debug("Gotw s " + startW + " e " + endW); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/Segment.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/Segment.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/Segment.java Fri Jan 19 11:23:42 2018 +0100 @@ -62,7 +62,7 @@ return from < to; } - /** Checks whether given km lies inside the to/from bounds of this segment. */ + /** Checks if given km lies inside the to/from bounds of this segment. */ public boolean inside(double km) { return from < to ? km >= from && km <= to diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/WKmsFactory.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WKmsFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WKmsFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -87,15 +87,22 @@ private WKmsFactory() { } - public static WKms getWKms(int column, int wst_id, double from, double to) { + public static WKms getWKms( + int column, + int wst_id, + double from, + double to + ) { log.debug("WKmsFactory.getWKms"); Cache cache = CacheFactory.getCache(StaticWQKmsCacheKey.CACHE_NAME); - String cacheKey = Integer.toString(column) + ":" + Integer.toString(wst_id); + String cacheKey = Integer.toString(column) + ":" + + Integer.toString(wst_id); if (cache != null) { if (!Double.isNaN(from) && ! Double.isNaN(to)) { - cacheKey += ":" + Double.toString(from) + ":" + Double.toString(to); + cacheKey += ":" + Double.toString(from) + ":" + + Double.toString(to); } Element element = cache.get(cacheKey); if (element != null) { @@ -129,7 +136,8 @@ /** Get name for a WKms wrapped in W, if suitable. */ public static String getWKmsNameWWrapped(int column, int wst_id) { - log.debug("WKmsFactory.getWKmsNameWWrapped c/" + column + ", wst_id/" + wst_id); + log.debug("WKmsFactory.getWKmsNameWWrapped c/" + + column + ", wst_id/" + wst_id); String name = null; Session session = SessionHolder.HOLDER.get(); @@ -192,7 +200,8 @@ /** Get name for a WKms. */ public static String getWKmsName(int column, int wst_id) { - log.debug("WKmsFactory.getWKmsName c/" + column + ", wst_id/" + wst_id); + log.debug("WKmsFactory.getWKmsName c/" + + column + ", wst_id/" + wst_id); String name = null; Session session = SessionHolder.HOLDER.get(); @@ -217,10 +226,15 @@ * @param wst_id database id of the wst * @return according WKms. */ - public static WKms getWKmsUncached(int column, int wst_id, double from, double to) { - + public static WKms getWKmsUncached( + int column, + int wst_id, + double from, + double to + ) { if (log.isDebugEnabled()) { - log.debug("WKmsFactory.getWKmsUncached c/" + column + ", wst_id/" + wst_id); + log.debug("WKmsFactory.getWKmsUncached c/" + + column + ", wst_id/" + wst_id); } WKmsImpl wkms = new WKmsImpl(getWKmsName(column, wst_id)); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQDay.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQDay.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQDay.java Fri Jan 19 11:23:42 2018 +0100 @@ -25,7 +25,8 @@ public class WQDay extends WQ { - public static final Comparator FIRST_CMP = new Comparator() { + public static final Comparator FIRST_CMP = + new Comparator() { @Override public int compare(double [] a, double [] b) { double diff = a[0] - b[0]; @@ -71,8 +72,10 @@ return days.getQuick(idx); } - private static final Double interpolateX(ArrayList dxs, double x) { - + private static final Double interpolateX( + ArrayList dxs, + double x + ) { Collections.sort(dxs, FIRST_CMP); if (Math.abs(x - dxs.get(0)[1]) < EPSILON) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKms.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKms.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKms.java Fri Jan 19 11:23:42 2018 +0100 @@ -61,7 +61,12 @@ this(kms, wq.getQs(), wq.getWs(), wq.getName()); } - public WQKms(TDoubleArrayList kms, TDoubleArrayList qs, TDoubleArrayList ws, String name) { + public WQKms( + TDoubleArrayList kms, + TDoubleArrayList qs, + TDoubleArrayList ws, + String name + ) { super(qs, ws, name); this.kms = kms; } @@ -75,7 +80,8 @@ public static WQKms fromWKms(WKms wkms, double q) { TDoubleArrayList qs = new TDoubleArrayList(wkms.allKms().size()); qs.fill(q); - WQKms wqkms = new WQKms(wkms.allKms(), qs, wkms.allWs(), wkms.getName()); + WQKms wqkms = + new WQKms(wkms.allKms(), qs, wkms.allWs(), wkms.getName()); return wqkms; } @@ -184,7 +190,9 @@ double b = getKm(s-1); double c = getKm(s/2); - return Math.abs(a-b) > EPS || Math.abs(a-c) > EPS || Math.abs(b-c) > EPS + return Math.abs(a-b) > EPS + || Math.abs(a-c) > EPS + || Math.abs(b-c) > EPS ? null : a; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKmsFactory.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKmsFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKmsFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -147,7 +147,11 @@ for (int i = 0, N = results.size(); i < N; i++) { Object[] row = results.get(i); // add(w, q, km) - if (row == null || row[0] == null || row[1] == null || row[2] == null) { + if (row == null + || row[0] == null + || row[1] == null + || row[2] == null + ) { log.warn("A value in result for WQKms is null."); continue; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQTimerange.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQTimerange.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQTimerange.java Fri Jan 19 11:23:42 2018 +0100 @@ -92,7 +92,8 @@ } public List sort() { - ArrayList items = new ArrayList(timeranges.size()); + ArrayList items = + new ArrayList(timeranges.size()); for (int i = 0, n = size(); i < n; i++) { items.add(new TimerangeItem(getTimerange(i), getQ(i), getW(i))); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/WaterlevelFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WaterlevelFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WaterlevelFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -116,7 +116,8 @@ if (!kmIncreasing) { while (idx < size && wqkms.getKm(idx) < km) { if (Math.abs(wqkms.getKm(idx) - km) < 0.01d) { - resultWQKms.add(wqkms.getW(idx), wqkms.getQ(idx), wqkms.getKm(idx)); + resultWQKms.add( + wqkms.getW(idx), wqkms.getQ(idx), wqkms.getKm(idx)); return resultWQKms; } idx++; @@ -126,18 +127,24 @@ idx = size-1; while (idx > 0 && wqkms.getKm(idx) > km) { if (Math.abs(wqkms.getKm(idx) - km) < 0.01d) { - resultWQKms.add(wqkms.getW(idx), wqkms.getQ(idx), wqkms.getKm(idx)); + resultWQKms.add( + wqkms.getW(idx), wqkms.getQ(idx), wqkms.getKm(idx)); return resultWQKms; } idx--; } } if (Math.abs(wqkms.getKm(idx) - km) < 0.01d) { - resultWQKms.add(wqkms.getW(idx), wqkms.getQ(idx), wqkms.getKm(idx)); + resultWQKms.add( + wqkms.getW(idx), wqkms.getQ(idx), wqkms.getKm(idx)); return resultWQKms; } - if ((idx != -1) && (idx < size) && (idx - mod != -1) && (idx - mod < size)) { + if ((idx != -1) + && (idx < size) + && (idx - mod != -1) + && (idx - mod < size) + ) { double inW = Linear.linear( km, wqkms.getKm(idx), wqkms.getKm(idx - mod), @@ -149,7 +156,8 @@ resultWQKms.add(inW, inQ, km); } else { - log.debug("waterlevelfacet stuff " + idx + " size " + size + " mod: " + mod); + log.debug("waterlevelfacet stuff " + idx + + " size " + size + " mod: " + mod); } return resultWQKms; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTable.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTable.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTable.java Fri Jan 19 11:23:42 2018 +0100 @@ -761,8 +761,11 @@ /** * Interpolate W and Q values at a given km. */ - public double [][] interpolateWQ(double km, int steps, Calculation errors) { - + public double [][] interpolateWQ( + double km, + int steps, + Calculation errors + ) { int rowIndex = Collections.binarySearch(rows, new Row(km)); if (rowIndex >= 0) { // direct row match @@ -989,7 +992,10 @@ } } if (rowBefore != null) { - for (int after = rowIndex, R = rows.size(); after < R; after++) { + for (int after = rowIndex, R = rows.size(); + after < R; + after++ + ) { if (!Double.isNaN(rows.get(after).ws[col])) { rowAfter = rows.get(after); break; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTableFactory.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTableFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTableFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -107,7 +107,8 @@ WstValueTable.Column [] columns = loadColumns(session, wst_id); loadQRanges(session, columns, wst_id); - List rows = loadRows(session, wst_id, columns.length); + List rows = loadRows( + session, wst_id, columns.length); WstValueTable valueTable = new WstValueTable(columns, rows); @@ -149,7 +150,8 @@ WstValueTable.Column [] columns = loadColumn(session, wst_id, col_pos); loadQRanges(session, columns, wst_id, col_pos); - List rows = loadRowsOneColumn(session, wst_id, col_pos); + List rows = loadRowsOneColumn( + session, wst_id, col_pos); WstValueTable valueTable = new WstValueTable(columns, rows); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/extreme/ExtremeCurveFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/extreme/ExtremeCurveFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/extreme/ExtremeCurveFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -46,7 +46,8 @@ * @param description Description of the facet. */ public ExtremeCurveFacet(String description) { - super(0, EXTREME_WQ_CURVE, description, ComputeType.ADVANCE, null, null); + super(0, EXTREME_WQ_CURVE, description, + ComputeType.ADVANCE, null, null); } /** @@ -54,7 +55,8 @@ * @param showBase if true, gimme different name. */ public ExtremeCurveFacet(String description, boolean showBase) { - super(0, EXTREME_WQ_CURVE_BASE, description, ComputeType.ADVANCE, null, null); + super(0, EXTREME_WQ_CURVE_BASE, description, + ComputeType.ADVANCE, null, null); if (!showBase) { this.name = EXTREME_WQ_CURVE; } @@ -62,12 +64,13 @@ public ExtremeCurveFacet(int index, String description) { - super(index, EXTREME_WQ_CURVE, description, ComputeType.ADVANCE, null, null); + super(index, EXTREME_WQ_CURVE, description, + ComputeType.ADVANCE, null, null); } /** - * Returns the data (a curve/function) this facet provides at km given in context. + * Returns the data (curve) this facet provides at km given in context. * * @param artifact the owner artifact. * @param context the CallContext. diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/DateUniqueMaker.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/DateUniqueMaker.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/DateUniqueMaker.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.model.fixings; import java.util.Date; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAnalysisCalculation.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAnalysisCalculation.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAnalysisCalculation.java Fri Jan 19 11:23:42 2018 +0100 @@ -189,8 +189,10 @@ ArrayList allQWDs = new ArrayList(); // for all Q sectors. - for (int qSector = qSectorStart; qSector <= qSectorEnd; ++qSector) { - + for (int qSector = qSectorStart; + qSector <= qSectorEnd; + ++qSector + ) { Filter filter = new AndFilter() .add(kmFilter) .add(new SectorFilter(qSector)) @@ -265,7 +267,8 @@ String avgDescription = "avg.deltawt." + qSector; QWD avgQWD = new QWD( - avgQ, avgW, avgDescription, avgDate, true, avgDw, 0); + avgQ, avgW, avgDescription, + avgDate, true, avgDw, 0); qSectorAverages[qSector] = avgQWD; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAvSectorFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAvSectorFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAvSectorFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -81,7 +81,8 @@ kmPeriods.binarySearch(currentKm); if (kmPeriodsEntry == null) { - log.warn("No analysis periods found for km '" + currentKm + "'"); + log.warn("No analysis periods found for km '" + + currentKm + "'"); return null; } @@ -108,7 +109,8 @@ if (qwdData == null) { return null; } - return new QWDDateRange(qwdData[sectorNdx], periods[periodNdx].getDateRange()); + return new QWDDateRange( + qwdData[sectorNdx], periods[periodNdx].getDateRange()); } else { log.warn("Artifact is no instance of D4EArtifact."); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalAnalysisFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalAnalysisFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalAnalysisFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -29,7 +29,8 @@ implements FacetTypes { /** House log. */ - private static Logger log = Logger.getLogger(FixLongitudinalAnalysisFacet.class); + private static Logger log = Logger.getLogger( + FixLongitudinalAnalysisFacet.class); /** Trivial Constructor. */ public FixLongitudinalAnalysisFacet() { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalDeviationFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalDeviationFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalDeviationFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -34,7 +34,8 @@ implements FacetTypes { /** House log. */ - private static Logger log = Logger.getLogger(FixLongitudinalDeviationFacet.class); + private static Logger log = Logger.getLogger( + FixLongitudinalDeviationFacet.class); /** Trivial Constructor. */ public FixLongitudinalDeviationFacet() { @@ -115,7 +116,8 @@ */ @Override public FixLongitudinalDeviationFacet deepCopy() { - FixLongitudinalDeviationFacet copy = new FixLongitudinalDeviationFacet(); + FixLongitudinalDeviationFacet copy = + new FixLongitudinalDeviationFacet(); copy.set(this); return copy; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalReferenceFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalReferenceFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalReferenceFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -34,7 +34,8 @@ implements FacetTypes { /** House log. */ - private static Logger log = Logger.getLogger(FixLongitudinalReferenceFacet.class); + private static Logger log = Logger.getLogger( + FixLongitudinalReferenceFacet.class); /** Trivial Constructor. */ public FixLongitudinalReferenceFacet() { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWQCurveFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWQCurveFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWQCurveFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -52,7 +52,8 @@ } public FixWQCurveFacet(int index, String description) { - super(index, FIX_WQ_CURVE, description, ComputeType.ADVANCE, null, null); + super(index, FIX_WQ_CURVE, description, + ComputeType.ADVANCE, null, null); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixingsFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixingsFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixingsFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -42,8 +42,8 @@ /** * Returns the current km from the context. - * If the context is null or doesn't contain a currentKm then a double value of -1 will - * be returned. + * If the context is null or doesn't contain a currentKm + * then a double value of -1 will be returned. * @param context The CallContext instance * @return the current km as double */ diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/HWSFactory.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/HWSFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/HWSFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -34,14 +34,16 @@ private static final int HWS_POINTS = 1; public static final String SQL_SELECT_LINES = - "SELECT hl.name, hl.geom, hl.id, hl.kind_id, hl.official, fs.name AS fed, hl.description " + + "SELECT hl.name, hl.geom, hl.id, hl.kind_id, hl.official, " + + " fs.name AS fed, hl.description " + " FROM hws_lines hl" + " JOIN rivers r ON hl.river_id = r.id" + " LEFT JOIN fed_states fs ON hl.fed_state_id = fs.id" + " WHERE r.name = :river"; public static final String SQL_SELECT_POINTS = - "SELECT hp.name, hp.geom, hp.id, hp.kind_id, hp.official, fs.name AS fed, hp.description " + + "SELECT hp.name, hp.geom, hp.id, hp.kind_id, hp.official, " + + " fs.name AS fed, hp.description " + " FROM hws_points hp" + " JOIN rivers r ON hp.river_id = r.id" + " LEFT JOIN fed_states fs ON hp.fed_state_id = fs.id" + diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/ShapeFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/ShapeFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/ShapeFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.model.map; import java.io.File; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/WSPLGENCalculation.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/WSPLGENCalculation.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/WSPLGENCalculation.java Fri Jan 19 11:23:42 2018 +0100 @@ -22,7 +22,8 @@ public class WSPLGENCalculation extends Calculation { - private static final Logger log = Logger.getLogger(WSPLGENCalculation.class); + private static final Logger log = Logger.getLogger( + WSPLGENCalculation.class); protected Map errors; protected Map warnings; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/WSPLGENJob.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/WSPLGENJob.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/WSPLGENJob.java Fri Jan 19 11:23:42 2018 +0100 @@ -480,7 +480,8 @@ } log.error("Required cross section tracks missing!"); - throw new IllegalArgumentException("Required cross section tracks missing!"); + throw new IllegalArgumentException( + "Required cross section tracks missing!"); } protected void writeDgm(PrintWriter writer) diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiameterData.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiameterData.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiameterData.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.model.minfo; import gnu.trove.TDoubleArrayList; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiameterDataFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiameterDataFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiameterDataFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.model.minfo; import gnu.trove.TDoubleArrayList; @@ -14,7 +22,8 @@ public class BedDiameterDataFacet extends DataFacet { - private static final Logger log = Logger.getLogger(BedDiameterDataFacet.class); + private static final Logger log = Logger.getLogger( + BedDiameterDataFacet.class); public BedDiameterDataFacet() { } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java Fri Jan 19 11:23:42 2018 +0100 @@ -32,7 +32,10 @@ public BedDiffCalculation() { } - public CalculationResult calculate(BedDifferencesAccess access, CallContext context) { + public CalculationResult calculate( + BedDifferencesAccess access, + CallContext context + ) { log.info("BedDiffCalculation.calculate"); this.river = access.getRiverName(); @@ -53,10 +56,16 @@ } /** Get two BedHeights from factory. */ - private static BedHeightData [] getHeightPair(int [] ids, double from, double to) { + private static BedHeightData [] getHeightPair( + int [] ids, + double from, + double to + ) { return new BedHeightData [] { - (BedHeightData)BedHeightFactory.getHeight("single", ids[0], from, to), - (BedHeightData)BedHeightFactory.getHeight("single", ids[1], from, to) + (BedHeightData)BedHeightFactory.getHeight( + "single", ids[0], from, to), + (BedHeightData)BedHeightFactory.getHeight( + "single", ids[1], from, to) }; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffFilterFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffFilterFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffFilterFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -63,7 +63,8 @@ double radius = scales.getRadius(river, start, end); BedDiffYearResult oldData = data[index]; - double[][] diffs = MovingAverage.weighted(oldData.getDifferencesData(), radius); + double[][] diffs = MovingAverage.weighted( + oldData.getDifferencesData(), radius); this.addMetaData( Resources.getMsg(context.getMeta(), "chart.subtitle.radius"), diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.model.minfo; import org.apache.log4j.Logger; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFilterFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFilterFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFilterFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -32,13 +32,20 @@ public class BedDiffHeightMinFilterFacet extends DataFacet { - private static Logger log = Logger.getLogger(BedDiffHeightMinFilterFacet.class); + private static Logger log = Logger.getLogger( + BedDiffHeightMinFilterFacet.class); public BedDiffHeightMinFilterFacet() { } - public BedDiffHeightMinFilterFacet(int idx, String name, String description, - ComputeType type, String stateId, String hash) { + public BedDiffHeightMinFilterFacet( + int idx, + String name, + String description, + ComputeType type, + String stateId, + String hash + ) { super(idx, name, description, type, hash, stateId); this.metaData.put("X", "chart.longitudinal.section.xaxis.label"); this.metaData.put("Y", "chart.bedheight_middle.section.yaxis.label"); @@ -65,7 +72,8 @@ double radius = scales.getRadius(river, start, end); BedDiffYearResult oldData = data[index]; - double[][] heights = MovingAverage.weighted(oldData.getHeights1Data(), radius); + double[][] heights = MovingAverage.weighted( + oldData.getHeights1Data(), radius); this.addMetaData( Resources.getMsg(context.getMeta(), "chart.subtitle.radius"), diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.model.minfo; import org.apache.log4j.Logger; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFilterFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFilterFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFilterFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -32,13 +32,20 @@ public class BedDiffHeightSubFilterFacet extends DataFacet { - private static Logger log = Logger.getLogger(BedDiffHeightSubFilterFacet.class); + private static Logger log = Logger.getLogger( + BedDiffHeightSubFilterFacet.class); public BedDiffHeightSubFilterFacet() { } - public BedDiffHeightSubFilterFacet(int idx, String name, String description, - ComputeType type, String stateId, String hash) { + public BedDiffHeightSubFilterFacet( + int idx, + String name, + String description, + ComputeType type, + String stateId, + String hash + ) { super(idx, name, description, type, hash, stateId); this.metaData.put("X", "chart.longitudinal.section.xaxis.label"); this.metaData.put("Y", "chart.bedheight_middle.section.yaxis.label"); @@ -65,7 +72,8 @@ double radius = scales.getRadius(river, start, end); BedDiffYearResult oldData = data[index]; - double[][] heights = MovingAverage.weighted(oldData.getHeights2Data(), radius); + double[][] heights = MovingAverage.weighted( + oldData.getHeights2Data(), radius); this.addMetaData( Resources.getMsg(context.getMeta(), "chart.subtitle.radius"), diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffPerYearFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffPerYearFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffPerYearFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.model.minfo; import org.apache.log4j.Logger; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffPerYearFilterFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffPerYearFilterFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffPerYearFilterFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -30,7 +30,8 @@ public class BedDiffPerYearFilterFacet extends DataFacet { - private static Logger log = Logger.getLogger(BedDiffPerYearFilterFacet.class); + private static Logger log = Logger.getLogger( + BedDiffPerYearFilterFacet.class); public BedDiffPerYearFilterFacet() { } @@ -63,7 +64,8 @@ double radius = scales.getRadius(river, start, end); BedDiffYearResult oldData = data[index]; - double[][] diffs = MovingAverage.weighted(oldData.getHeightPerYearData(), radius); + double[][] diffs = MovingAverage.weighted( + oldData.getHeightPerYearData(), radius); this.addMetaData( Resources.getMsg(context.getMeta(), "chart.subtitle.radius"), diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -57,7 +57,12 @@ * If from or to are NaN all values are returned. Otherwise only get * values with stations between from and to. */ - public static BedHeightData getHeight(String type, int height_id, double from, double to) { + public static BedHeightData getHeight( + String type, + int height_id, + double from, + double to + ) { log.debug("BedHeightFactory.getHeight"); Cache cache = CacheFactory.getCache("bedheight-value-table-static"); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSoundingWidthFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSoundingWidthFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSoundingWidthFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.model.minfo; import java.util.List; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityCalculation.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityCalculation.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityCalculation.java Fri Jan 19 11:23:42 2018 +0100 @@ -137,14 +137,17 @@ result.setDateRange(dr); if (!bedDiameter.isEmpty()) { log.debug("Bed diameter is not empty + " + bedDiameter); - addValuesToResult(result, calculateBedParameter(bedMeasurements)); + addValuesToResult( + result, calculateBedParameter(bedMeasurements)); for (String bd : bedDiameter) { - addValuesToResult(result, calculateBed(bedMeasurements, bd)); + addValuesToResult( + result, calculateBed(bedMeasurements, bd)); } } if (!bedloadDiameter.isEmpty()) { for (String bld : bedloadDiameter) { - addValuesToResult(result, calculateBedload(loadMeasurements, bld)); + addValuesToResult( + result, calculateBedload(loadMeasurements, bld)); } } results.add(result); @@ -193,16 +196,20 @@ } return new BedQualityResultValue[] { new BedQualityResultValue("porosity", - new double[][] {location.toNativeArray(), porositySub.toNativeArray()}, + new double[][] {location.toNativeArray(), + porositySub.toNativeArray()}, "sublayer"), new BedQualityResultValue("porosity", - new double[][] {location.toNativeArray(), porosityCap.toNativeArray()}, + new double[][] {location.toNativeArray(), + porosityCap.toNativeArray()}, "toplayer"), new BedQualityResultValue("density", - new double[][] {location.toNativeArray(), densitySub.toNativeArray()}, + new double[][] {location.toNativeArray(), + densitySub.toNativeArray()}, "sublayer"), new BedQualityResultValue("density", - new double[][] {location.toNativeArray(), densityCap.toNativeArray()}, + new double[][] {location.toNativeArray(), + densityCap.toNativeArray()}, "toplayer")}; } @@ -230,10 +237,12 @@ } return new BedQualityResultValue[] { new BedQualityResultValue(diameter, - new double[][] {location.toNativeArray(), avDiameterSub.toNativeArray()}, + new double[][] {location.toNativeArray(), + avDiameterSub.toNativeArray()}, "sublayer"), new BedQualityResultValue(diameter, - new double[][] {location.toNativeArray(), avDiameterCap.toNativeArray()}, + new double[][] {location.toNativeArray(), + avDiameterCap.toNativeArray()}, "toplayer")}; } @@ -281,7 +290,8 @@ } return new BedQualityResultValue[] { new BedQualityResultValue(diameter, - new double[][] {location.toNativeArray(), avDiameter.toNativeArray()}, + new double[][] {location.toNativeArray(), + avDiameter.toNativeArray()}, "bedload")}; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityDataFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityDataFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityDataFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -28,15 +28,23 @@ private static Logger log = Logger.getLogger(BedQualityDataFacet.class); - private String valueName; /* Name of the ResultValue underlying this facet */ - private String valueType; /* Type of the ResultValue underlying this facet */ + private String valueName; /* Name of ResultValue underlying this facet */ + private String valueType; /* Type of ResultValue underlying this facet */ public BedQualityDataFacet() { // required for clone operation deepCopy() } - public BedQualityDataFacet(int idx, String name, String description, - ComputeType type, String stateId, String hash, String valueName, String valueType) { + public BedQualityDataFacet( + int idx, + String name, + String description, + ComputeType type, + String stateId, + String hash, + String valueName, + String valueType + ) { super(idx, name, description, type, hash, stateId); this.valueName = valueName; this.valueType = valueType; @@ -44,7 +52,8 @@ if (!valueName.equals("porosity") && !valueName.equals("density")) { this.metaData.put("Y", "chart.bedquality.yaxis.label.diameter"); } else { - this.metaData.put("Y", "chart.bedquality.yaxis.label." + valueName); + this.metaData.put( + "Y", "chart.bedquality.yaxis.label." + valueName); } } @@ -54,12 +63,13 @@ D4EArtifact flys = (D4EArtifact) artifact; - CalculationResult res = (CalculationResult) flys.compute(context, hash, - stateId, type, false); + CalculationResult res = (CalculationResult)flys.compute( + context, hash, stateId, type, false); int ndx = index >> 8; BedQualityResultValue value = - ((BedQualityResult[]) res.getData())[ndx].getValue(valueName, valueType); + ((BedQualityResult[]) res.getData())[ndx].getValue( + valueName, valueType); if (value == null) { /* Other facets check this so we do too */ diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityInterpolFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityInterpolFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityInterpolFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -27,17 +27,26 @@ private static final long serialVersionUID = 1L; - private static Logger log = Logger.getLogger(BedQualityInterpolFacet.class); + private static Logger log = Logger.getLogger( + BedQualityInterpolFacet.class); - private String valueName; /* Name of the ResultValue underlying this facet */ - private String valueType; /* Type of the ResultValue underlying this facet */ + private String valueName; /* Name of ResultValue underlying this facet */ + private String valueType; /* Type of ResultValue underlying this facet */ public BedQualityInterpolFacet() { // required for clone operation deepCopy() } - public BedQualityInterpolFacet(int idx, String name, String description, - ComputeType type, String stateId, String hash, String valueName, String valueType) { + public BedQualityInterpolFacet( + int idx, + String name, + String description, + ComputeType type, + String stateId, + String hash, + String valueName, + String valueType + ) { super(idx, name, description, type, hash, stateId); this.valueName = valueName; this.valueType = valueType; @@ -45,7 +54,8 @@ if (!valueName.equals("porosity") && !valueName.equals("density")) { this.metaData.put("Y", "chart.bedquality.yaxis.label.diameter"); } else { - this.metaData.put("Y", "chart.bedquality.yaxis.label." + valueName); + this.metaData.put( + "Y", "chart.bedquality.yaxis.label." + valueName); } } @@ -62,7 +72,8 @@ int ndx = index >> 8; BedQualityResultValue value = - ((BedQualityResult[]) res.getData())[ndx].getValue(valueName, valueType); + ((BedQualityResult[]) res.getData())[ndx].getValue( + valueName, valueType); if (value == null) { /* Other facets check this so we do too */ diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityResultValue.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityResultValue.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityResultValue.java Fri Jan 19 11:23:42 2018 +0100 @@ -133,7 +133,10 @@ public void setData(double [][] data) { this.data = data; - if (!isEmpty() && data[0].length > 1 && data[0].length == data[1].length) { + if (!isEmpty() + && data[0].length > 1 + && data[0].length == data[1].length + ) { int usable_points = 0; for (double val :data[1]) { if (!Double.isNaN(val)) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedloadDiameterDataFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedloadDiameterDataFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedloadDiameterDataFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.model.minfo; import gnu.trove.TDoubleArrayList; @@ -15,7 +23,8 @@ public class BedloadDiameterDataFacet extends DataFacet { - private static final Logger log = Logger.getLogger(BedloadDiameterDataFacet.class); + private static final Logger log = Logger.getLogger( + BedloadDiameterDataFacet.class); public BedloadDiameterDataFacet() { } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/FlowVelocityMeasurementFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/FlowVelocityMeasurementFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/FlowVelocityMeasurementFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -56,7 +56,8 @@ */ @Override public FlowVelocityMeasurementFacet deepCopy() { - FlowVelocityMeasurementFacet copy = new FlowVelocityMeasurementFacet(description); + FlowVelocityMeasurementFacet copy = + new FlowVelocityMeasurementFacet(description); copy.set(this); return copy; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/FlowVelocityMeasurementFactory.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/FlowVelocityMeasurementFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/FlowVelocityMeasurementFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -24,7 +24,8 @@ public class FlowVelocityMeasurementFactory { /** Private log to use here. */ - private static Logger log = Logger.getLogger(FlowVelocityMeasurementFactory.class); + private static Logger log = Logger.getLogger( + FlowVelocityMeasurementFactory.class); /** Query to get description and start year, given name and a km range. */ public static final String SQL_SELECT_ONE = @@ -40,7 +41,6 @@ public static FlowVelocityMeasurementValue.FastFlowVelocityMeasurementValue getFlowVelocityMeasurement(int id) { - log.debug("FlowVelocityMeasurementFactory.getFlowVelocityMeasurementValue"); Session session = SessionHolder.HOLDER.get(); SQLQuery sqlQuery = null; sqlQuery = session.createSQLQuery(SQL_SELECT_ONE) diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MiddleBedHeightData.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MiddleBedHeightData.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MiddleBedHeightData.java Fri Jan 19 11:23:42 2018 +0100 @@ -25,9 +25,11 @@ Comparable { /** Very private log. */ - private static final Logger log = Logger.getLogger(MiddleBedHeightData.class); + private static final Logger log = Logger.getLogger( + MiddleBedHeightData.class); - public static final String I18N_SINGLE_NAME = "facet.bedheight_middle.single"; + public static final String I18N_SINGLE_NAME = + "facet.bedheight_middle.single"; private int year; private String evaluatedBy; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MorphologicWidthFactory.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MorphologicWidthFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MorphologicWidthFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -26,12 +26,14 @@ public class MorphologicWidthFactory { /** Private log to use here. */ - private static Logger log = Logger.getLogger(MorphologicWidthFactory.class); + private static Logger log = Logger.getLogger( + MorphologicWidthFactory.class); public static final String SQL_SELECT = "SELECT mwv.station AS station, mwv.width AS width " + " FROM morphologic_width mw" + - " JOIN morphologic_width_values mwv on mwv.morphologic_width_id = mw.id" + + " JOIN morphologic_width_values mwv " + + " ON mwv.morphologic_width_id = mw.id" + " WHERE mw.id = :width_id"; private MorphologicWidthFactory() { @@ -43,7 +45,8 @@ */ public static MorphologicWidth getWidth(int width_id) { log.debug("MorphologicWidthFactory.getWidth"); - Cache cache = CacheFactory.getCache(StaticMorphoWidthCacheKey.CACHE_NAME); + Cache cache = CacheFactory.getCache( + StaticMorphoWidthCacheKey.CACHE_NAME); StaticMorphoWidthCacheKey cacheKey; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/QualityMeasurementFactory.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/QualityMeasurementFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/QualityMeasurementFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -24,7 +24,8 @@ public class QualityMeasurementFactory { - private static Logger log = Logger.getLogger(QualityMeasurementFactory.class); + private static Logger log = Logger.getLogger( + QualityMeasurementFactory.class); private static final String SQL_BED_MEASUREMENT = "SELECT dat.km as km," + @@ -55,8 +56,9 @@ "WHERE gw.name = :name AND " + " dat.km IS NOT NULL AND " + " sp.tiefevon IS NOT NULL AND " + - " sp.tiefebis IS NOT NULL AND " + // TODO: Test if char diameter ist null. + " sp.tiefebis IS NOT NULL AND " + " dat.km BETWEEN :from - 0.001 AND :to + 0.001 "; + // TODO: Test if char diameter ist null. private static final String SQL_BEDLOAD_MEASUREMENT = "SELECT dat.km as km," + diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensity.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensity.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensity.java Fri Jan 19 11:23:42 2018 +0100 @@ -72,7 +72,10 @@ private static final Comparator BY_KM = new Comparator() { @Override - public int compare(SedimentDensityValue a, SedimentDensityValue b) { + public int compare( + SedimentDensityValue a, + SedimentDensityValue b + ) { double diff = a.getKm() - b.getKm(); if (diff < 0.0) return -1; if (diff > 0.0) return +1; @@ -120,7 +123,8 @@ } if (densities.size() == 1) { - Map.Entry> entry = densities.firstEntry(); + Map.Entry> entry = + densities.firstEntry(); return entry.getKey() <= year ? getDensityAtKm(entry.getValue(), km) : SEDIMNET_DENSITY_FACTOR; @@ -132,7 +136,8 @@ Map.Entry> last = iter.next(); while (iter.hasNext()) { - Map.Entry> current = iter.next(); + Map.Entry> current = + iter.next(); last = current; int y1 = last.getKey(); int y2 = current.getKey(); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensityFactory.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensityFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensityFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -36,7 +36,8 @@ " sdv.year AS year " + " FROM sediment_density sd" + " JOIN rivers r ON sd.river_id = r.id " + - " JOIN sediment_density_values sdv ON sd.id = sdv.sediment_density_id" + + " JOIN sediment_density_values sdv " + + " ON sd.id = sdv.sediment_density_id" + " WHERE r.name = :name"; /** Query to get sediment density values and kms by id. */ @@ -45,7 +46,8 @@ " sdv.density AS density," + " sdv.year AS year " + " FROM sediment_density sd" + - " JOIN sediment_density_values sdv ON sd.id = sdv.sediment_density_id" + + " JOIN sediment_density_values sdv " + + " ON sd.id = sdv.sediment_density_id" + " WHERE sd.id = :id"; /** Query to get sediment density depth by sediment density id. */ @@ -110,7 +112,8 @@ SedimentDensity density = new SedimentDensity(); for (Object[] row : results) { if (row[0] != null && row[1] != null && row[2] != null) { - density.addDensity((Double)row[0], (Double)row[1], (Integer)row[2]); + density.addDensity( + (Double)row[0], (Double)row[1], (Integer)row[2]); } } @@ -122,7 +125,8 @@ public static double[] getDepth(int id) { log.debug("getDepth"); Session session = SessionHolder.HOLDER.get(); - SQLQuery sqlQuery = session.createSQLQuery(SQL_SELECT_DENSITY_DEPTH_BY_ID) + SQLQuery sqlQuery = session.createSQLQuery( + SQL_SELECT_DENSITY_DEPTH_BY_ID) .addScalar("lower", StandardBasicTypes.DOUBLE) .addScalar("upper", StandardBasicTypes.DOUBLE); sqlQuery.setInteger("id", id); @@ -136,7 +140,8 @@ public static String getSedimentDensityDescription(int id) { log.debug("getSedimentDensityDescription"); Session session = SessionHolder.HOLDER.get(); - SQLQuery sqlQuery = session.createSQLQuery(SQL_SELECT_DESCRIPTION_BY_ID) + SQLQuery sqlQuery = session.createSQLQuery( + SQL_SELECT_DESCRIPTION_BY_ID) .addScalar("description", StandardBasicTypes.STRING); sqlQuery.setInteger("id", id); List results = sqlQuery.list(); @@ -158,7 +163,8 @@ SedimentDensity density = new SedimentDensity(); for (Object[] row : results) { if (row[0] != null && row[1] != null && row[2] != null) { - density.addDensity((Double)row[0], (Double)row[1], (Integer)row[2]); + density.addDensity( + (Double)row[0], (Double)row[1], (Integer)row[2]); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java Fri Jan 19 11:23:42 2018 +0100 @@ -65,7 +65,8 @@ }; public static final int measurementStationType(int grainFraction) { - return grainFraction < 0 || grainFraction >= MEASUREMENT_STATION_GF.length + return grainFraction < 0 + || grainFraction >= MEASUREMENT_STATION_GF.length ? Station.UNKNOWN : MEASUREMENT_STATION_GF[grainFraction]; } @@ -248,8 +249,10 @@ } } - public void allLoadsWithValue(Collection loads, Integer sqRelationTimeInterval) { - + public void allLoadsWithValue( + Collection loads, + Integer sqRelationTimeInterval + ) { for (List values: grainFractions) { if (values == null) { continue; @@ -261,7 +264,9 @@ Load load = value.getLoad(); Integer sqId = load.getSQRelationTimeIntervalId(); if ((sqRelationTimeInterval == null) - || sqId != null && sqId.equals(sqRelationTimeInterval)) { + || sqId != null + && sqId.equals(sqRelationTimeInterval) + ) { loads.add(load); } } @@ -292,11 +297,13 @@ this.type |= other.type; for (int i = 0, N = grainFractions.size(); i < N; ++i) { grainFractions.set(i, - mergeValues(grainFractions.get(i), other.grainFractions.get(i))); + mergeValues( + grainFractions.get(i), other.grainFractions.get(i))); } } - private static final Comparator ID_CMP = new Comparator() { + private static final Comparator ID_CMP = + new Comparator() { @Override public int compare(Value a, Value b) { return a.getLoad().getId() - b.getLoad().getId(); @@ -354,7 +361,10 @@ } } - public List filterGrainFraction(int grainFraction, Value.Filter filter) { + public List filterGrainFraction( + int grainFraction, + Value.Filter filter + ) { final List result = new ArrayList(); filterGrainFraction(grainFraction, filter, new Value.Visitor() { @Override @@ -492,7 +502,8 @@ } }; - public static final Comparator LOAD_SQ_TI_CMP = new Comparator() { + public static final Comparator LOAD_SQ_TI_CMP = + new Comparator() { @Override public int compare(Load a, Load b) { Integer a_id = a.getSQRelationTimeIntervalId(); @@ -511,7 +522,11 @@ }; /** Find all loads in the range a/b with the according sq_time_interval */ - public Collection findLoadsWithValue(double a, double b, final Integer sqRelationTimeInterval) { + public Collection findLoadsWithValue( + double a, + double b, + final Integer sqRelationTimeInterval + ) { final TreeSet loads = new TreeSet(LOAD_ID_CMP); findStations(a, b, new Visitor() { @@ -528,7 +543,10 @@ * * This is mainly a convenience function for the SedimentLoadInfoService. */ - public Collection findDistinctSQTimeIntervalNonEpochLoadsWithValue(double a, double b) { + public Collection findDistinctSQTimeIntervalNonEpochLoadsWithValue( + double a, + double b + ) { final TreeSet loads = new TreeSet(LOAD_SQ_TI_CMP); findStations(a, b, new Visitor() { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataCalculation.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataCalculation.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataCalculation.java Fri Jan 19 11:23:42 2018 +0100 @@ -84,7 +84,10 @@ this.description = description; this.grainFractions = grainFractions; } - public static final LoadSum make(String description, int [] grainFractions) { + public static final LoadSum make( + String description, + int [] grainFractions + ) { return new LoadSum(description, grainFractions); } @@ -257,7 +260,8 @@ transformT2M3(sd, year, result); SedimentLoadDataResult.Fraction sldrf = - new SedimentLoadDataResult.Fraction(ls.getDescription(), result, period); + new SedimentLoadDataResult.Fraction( + ls.getDescription(), result, period); sldr.addFraction(sldrf); } @@ -345,7 +349,11 @@ : null; } - private static void transformT2M3(SedimentDensity sd, int year, double [][] data) { + private static void transformT2M3( + SedimentDensity sd, + int year, + double [][] data + ) { if (sd == null) { return; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -95,7 +95,8 @@ D4EArtifact flys = (D4EArtifact) artifact; - CalculationResult res = (CalculationResult) flys.compute(context, hash, stateId, type, false); + CalculationResult res = (CalculationResult)flys.compute( + context, hash, stateId, type, false); Object payload = res.getData(); if (!(payload instanceof SedimentLoadDataResult)) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataFactory.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -24,7 +24,8 @@ public class SedimentLoadDataFactory { - private static Logger log = Logger.getLogger(SedimentLoadDataFactory.class); + private static Logger log = Logger.getLogger( + SedimentLoadDataFactory.class); public static final String CACHE_NAME = "sediment-load-data"; @@ -40,7 +41,8 @@ "sl.sq_time_interval_id " + "FROM sediment_load sl " + "JOIN sediment_load_values slv ON sl.id = slv.sediment_load_id " + - "JOIN measurement_station ms ON ms.id = slv.measurement_station_id " + + "JOIN measurement_station ms " + + "ON ms.id = slv.measurement_station_id " + "JOIN ranges rs ON rs.id = ms.range_id " + "JOIN rivers r ON r.id = rs.river_id " + "WHERE r.name = :river) " + @@ -63,10 +65,12 @@ "JOIN ranges rs ON ms.range_id = rs.id " + "JOIN rivers r ON rs.river_id = r.id " + "JOIN time_intervals ti ON sl.time_interval_id = ti.id " + - "LEFT JOIN time_intervals sqti ON sl.sq_time_interval_id = sqti.id " + + "LEFT JOIN time_intervals sqti " + + "ON sl.sq_time_interval_id = sqti.id " + "JOIN grain_fraction gf ON sl.grain_fraction_id = gf.id " + "LEFT JOIN sediment_load_values slv " + - "ON ms.id=slv.measurement_station_id AND sl.id=slv.sediment_load_id " + + "ON ms.id=slv.measurement_station_id " + + "AND sl.id=slv.sediment_load_id " + "WHERE (" + "(ms.measurement_type='Geschiebe' AND gf.name IN " + "('coarse', 'fine_middle', 'sand', 'susp_sand', " + @@ -129,7 +133,8 @@ Session session = SessionHolder.HOLDER.get(); - SQLQuery sqlQuery = session.createSQLQuery(SQL_LOAD_RIVER_SEDIMENT_LOADS) + SQLQuery sqlQuery = session.createSQLQuery( + SQL_LOAD_RIVER_SEDIMENT_LOADS) .addScalar("sl_id", StandardBasicTypes.INTEGER) .addScalar("sl_kind", StandardBasicTypes.INTEGER) .addScalar("sl_description", StandardBasicTypes.STRING) diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataValueFilter.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataValueFilter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataValueFilter.java Fri Jan 19 11:23:42 2018 +0100 @@ -125,12 +125,13 @@ return true; } if (value.getLoad().getSQRelationTimeIntervalId() == null) { - /* Loads without sqRelationTimeInterval are "Schwebstoffe" and should - * be included. */ + /* Loads without sqRelationTimeInterval are "Schwebstoffe" + * and should be included. */ return true; } /* All other values should be filtered accordingly. */ - return value.getLoad().getSQRelationTimeIntervalId().equals(sqTiId); + return value.getLoad().getSQRelationTimeIntervalId() + .equals(sqTiId); } } // class SQTimeInterval diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -59,7 +59,8 @@ int id = Integer.valueOf(idStr); /* Get all the data from the river. This will be nicely cached. */ - SedimentLoadData allLoadData = SedimentLoadDataFactory.INSTANCE.getSedimentLoadData( + SedimentLoadData allLoadData = + SedimentLoadDataFactory.INSTANCE.getSedimentLoadData( access.getRiverName()); /* Now lets get what we want */ diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/Measurement.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/Measurement.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/Measurement.java Fri Jan 19 11:23:42 2018 +0100 @@ -193,16 +193,7 @@ deleteSieve(4.0); sieves.add(new Sieve(8d, eightValue)); sieves.add(new Sieve(4d, newFourValue)); - /* - sieveArray.adjust( - eightValue/sieveArray.totalLoad(), - newFourValue/sieveArray.totalLoad()); - if (log.isDebugEnabled()) { - log.debug("Adjusted loads: " + Arrays.toString(sieveArray.getLoads())); - log.debug("Adjusted norm loads:" + Arrays.toString(sieveArray.getNormLoads())); - } - */ } protected SieveArray calculateSieveArray() { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/MeasurementFactory.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/MeasurementFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/MeasurementFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -41,7 +41,8 @@ private static final Logger log = Logger.getLogger(MeasurementFactory.class); - public static final String MINFO_DUMP_SQ_SEDDB_PREFIX = "minfo.dump.sq.seddb.prefix"; + public static final String MINFO_DUMP_SQ_SEDDB_PREFIX = + "minfo.dump.sq.seddb.prefix"; public static final String SQL_TOTALS = "SELECT " + @@ -126,7 +127,9 @@ return Integer.parseInt(s.substring(s.length()-2))-1; } - public abstract static class CSVTransformer extends BasicTransformerAdapter { + public abstract static class CSVTransformer + extends BasicTransformerAdapter + { private static final long serialVersionUID = 1L; private CSVWriter rawWriter; @@ -292,7 +295,8 @@ getCVSWriter("totals", river, location, dateRange); try { - TotalsTransformer totalTransformer = new TotalsTransformer(csvWriter); + TotalsTransformer totalTransformer = + new TotalsTransformer(csvWriter); query.setResultTransformer(totalTransformer); return (List)query.list(); @@ -479,8 +483,9 @@ return accumulated; } - protected static List separateByDate(List measurements) { - + protected static List separateByDate( + List measurements + ) { List result = new ArrayList(); List same = new ArrayList(); @@ -508,7 +513,9 @@ } - protected static Measurement processSameDate(List measurements) { + protected static Measurement processSameDate( + List measurements + ) { int N = measurements.size(); boolean debug = log.isDebugEnabled(); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQMeasurementFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQMeasurementFacet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQMeasurementFacet.java Fri Jan 19 11:23:42 2018 +0100 @@ -29,7 +29,8 @@ */ public class SQMeasurementFacet extends DataFacet implements FacetTypes { - private static final Logger log = Logger.getLogger(SQMeasurementFacet.class); + private static final Logger log = Logger.getLogger( + SQMeasurementFacet.class); private int fractionIdx; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQMeasurementsJRDataSource.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQMeasurementsJRDataSource.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQMeasurementsJRDataSource.java Fri Jan 19 11:23:42 2018 +0100 @@ -23,7 +23,8 @@ public class SQMeasurementsJRDataSource implements JRDataSource { /** The log used in this exporter.*/ - private static Logger log = Logger.getLogger(SQMeasurementsJRDataSource.class); + private static Logger log = Logger.getLogger( + SQMeasurementsJRDataSource.class); private ArrayList data; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/services/BedKMChartService.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/BedKMChartService.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/BedKMChartService.java Fri Jan 19 11:23:42 2018 +0100 @@ -240,7 +240,8 @@ plot.setRangeGridlinePaint(Color.gray); plot.setDomainGridlinesVisible(true); plot.setRangeGridlinesVisible(true); - XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer(); + XYLineAndShapeRenderer renderer = + (XYLineAndShapeRenderer)plot.getRenderer(); renderer.setSeriesPaint(0, Color.gray); renderer.setSeriesLinesVisible(0, false); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/services/BedloadKMChartService.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/BedloadKMChartService.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/BedloadKMChartService.java Fri Jan 19 11:23:42 2018 +0100 @@ -240,7 +240,8 @@ plot.setRangeGridlinePaint(Color.gray); plot.setDomainGridlinesVisible(true); plot.setRangeGridlinesVisible(true); - XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer(); + XYLineAndShapeRenderer renderer = + (XYLineAndShapeRenderer)plot.getRenderer(); renderer.setSeriesPaint(0, Color.gray); renderer.setSeriesLinesVisible(0, false); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/services/DischargeInfoService.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/DischargeInfoService.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/DischargeInfoService.java Fri Jan 19 11:23:42 2018 +0100 @@ -40,7 +40,8 @@ public static final String GAUGE_XPATH = "/art:gauge/text()"; - public static final String RIVER_NAME_XPATH = "/art:gauge/art:river/text()"; + public static final String RIVER_NAME_XPATH = + "/art:gauge/art:river/text()"; public DischargeInfoService() { } @@ -69,7 +70,8 @@ return XMLUtils.newDocument(); } - log.debug("Getting discharge for gauge: " + gaugeNumber + " at river: " + river); + log.debug("Getting discharge for gauge: " + gaugeNumber + + " at river: " + river); long gn; try { @@ -126,14 +128,16 @@ Date stopTime = ti.getStopTime(); if (startTime != null) { - discharge.setAttribute("start", String.valueOf(startTime.getTime())); + discharge.setAttribute( + "start", String.valueOf(startTime.getTime())); } else { continue; } if (stopTime != null) { - discharge.setAttribute("end", String.valueOf(stopTime.getTime())); + discharge.setAttribute( + "end", String.valueOf(stopTime.getTime())); } else { long now = System.currentTimeMillis(); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/services/DischargeTablesOverview.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/DischargeTablesOverview.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/DischargeTablesOverview.java Fri Jan 19 11:23:42 2018 +0100 @@ -49,20 +49,26 @@ private static final long serialVersionUID = 1L; - public static final String I18N_CHART_TITLE = "gauge.discharge.service.chart.title"; + public static final String I18N_CHART_TITLE = + "gauge.discharge.service.chart.title"; public static final String DEFAULT_CHART_TITLE = "Pegel: XXX"; - public static final String I18N_CHART_X_AXIS_TITLE = "gauge.discharge.service.chart.x.title"; + public static final String I18N_CHART_X_AXIS_TITLE = + "gauge.discharge.service.chart.x.title"; public static final String DEFAULT_X_AXIS_TITLE = "Q [m^3/s]"; - public static final String I18N_CHART_Y_AXIS_TITLE = "gauge.discharge.service.chart.y.title"; + public static final String I18N_CHART_Y_AXIS_TITLE = + "gauge.discharge.service.chart.y.title"; public static final String DEFAULT_Y_AXIS_TITLE = "W [cm]"; - public static final String I18N_CHART_SERIES_TITLE = "gauge.discharge.service.chart.series.title"; + public static final String I18N_CHART_SERIES_TITLE = + "gauge.discharge.service.chart.series.title"; public static final String DEFAULT_CHART_SERIES_TITLE = "Abflusskurve"; - public static final String I18N_CHART_SERIES_TITLE_MASTER = "gauge.discharge.service.chart.series.title.master"; - public static final String DEFAULT_CHART_SERIES_TITLE_MASTER = "Aktuelle Abflusskurve"; + public static final String I18N_CHART_SERIES_TITLE_MASTER = + "gauge.discharge.service.chart.series.title.master"; + public static final String DEFAULT_CHART_SERIES_TITLE_MASTER = + "Aktuelle Abflusskurve"; public static final DateFormat DATE_FORMAT = DateFormat.getDateInstance( DateFormat.SHORT, Locale.GERMANY); @@ -172,7 +178,9 @@ mainValue.getMainValue().getName()); plot.addDomainMarker(m); } - else if (mainValue.getMainValue().getType().getName().equals("W")) { + else if ( + mainValue.getMainValue().getType().getName().equals("W") + ) { // Its a W main value. Marker m = FixingsKMChartService.createQSectorMarker( mainValue.getValue().doubleValue(), diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java Fri Jan 19 11:23:42 2018 +0100 @@ -46,11 +46,13 @@ /** The log that is used by this service.*/ private static Logger log = Logger.getLogger(MainValuesService.class); - /** The XPath that points to the river definition of the incoming request.*/ - public static final String XPATH_RIVER = "/art:mainvalues/art:river/text()"; + /** XPath that points to the river definition of the incoming request.*/ + public static final String XPATH_RIVER = + "/art:mainvalues/art:river/text()"; - /** The XPath that points to the start definition of the incoming request.*/ - public static final String XPATH_START = "/art:mainvalues/art:start/text()"; + /** XPath that points to the start definition of the incoming request.*/ + public static final String XPATH_START = + "/art:mainvalues/art:start/text()"; /** The XPath that points to the end definition of the incoming request.*/ public static final String XPATH_END = "/art:mainvalues/art:end/text()"; @@ -124,7 +126,8 @@ /** * This method extracts the start and end point from incoming request - * document and returns both values in an array. If no start and end strings + * document and returns both values in an array. + * If no start and end strings * are found in the document, the min/max values of the river are * returned. * @@ -259,9 +262,14 @@ /** Checks i a main value has an official associated, */ - protected static boolean hasOfficialLine(NamedMainValue nmv, Integer riverId) { + protected static boolean hasOfficialLine( + NamedMainValue nmv, + Integer riverId + ) { for (OfficialLine ol: nmv.getOfficialLines()) { - if (ol.getWstColumn().getWst().getRiver().getId().equals(riverId)) { + if ( + ol.getWstColumn().getWst().getRiver().getId().equals(riverId) + ) { return true; } } @@ -287,7 +295,8 @@ Element list = cr.create("mainvalues"); for (MainValue mainValue: mainValues) { - Element newEl = buildMainValueElement(doc, mainValue, riverId, context); + Element newEl = buildMainValueElement( + doc, mainValue, riverId, context); if (newEl != null) { list.appendChild(newEl); @@ -330,11 +339,13 @@ if (mainValue.getTimeInterval() != null) { if (mainValue.getTimeInterval().getStartTime() != null) { cr.addAttr(el, "starttime", - Long.toString(mainValue.getTimeInterval().getStartTime().getTime())); + Long.toString( + mainValue.getTimeInterval().getStartTime().getTime())); } if (mainValue.getTimeInterval().getStopTime() != null) { cr.addAttr(el, "stoptime", - Long.toString(mainValue.getTimeInterval().getStopTime().getTime())); + Long.toString( + mainValue.getTimeInterval().getStopTime().getTime())); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/services/MapInfoService.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/MapInfoService.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/MapInfoService.java Fri Jan 19 11:23:42 2018 +0100 @@ -43,13 +43,16 @@ public static final String XPATH_MAPTYPE = "/mapinfo/maptype/text()"; private static final String XPATH_RIVER_PROJECTION = - "/artifact-database/*[local-name()=$maptype]/river[@name=$river]/srid/@value"; + "/artifact-database/*[local-name()=$maptype]/" + + "river[@name=$river]/srid/@value"; private static final String XPATH_RIVER_BACKGROUND = - "/artifact-database/*[local-name()=$maptype]/river[@name=$river]/background-wms"; + "/artifact-database/*[local-name()=$maptype]/" + + "river[@name=$river]/background-wms"; private static final String XPATH_RIVER_WMS = - "/artifact-database/*[local-name()=$maptype]/river[@name=$river]/river-wms"; + "/artifact-database/*[local-name()=$maptype]/" + + "river[@name=$river]/river-wms"; /** The log used in this service.*/ diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/services/MetaDataService.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/MetaDataService.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/MetaDataService.java Fri Jan 19 11:23:42 2018 +0100 @@ -37,21 +37,28 @@ * "/art:meta/art:artifact-id/@value" The UUID of the artifact. Optional. * Used to fill the template enviroment. * "/art:meta/art:user-id/@value" The UUID of the user. Optional. - * If given the user specific template is filled. - * "/art:meta/art:outs/@value" The list of outs used to recommend for the + * If given the user specific template is + * filled. + * "/art:meta/art:outs/@value" The list of outs used to recommend + * for the * various outputs. * "/art:meta/art:parameters/@value" A list of key/value pairs to inject more - * filters to the templating, as "key:value;key2:value2" + * filters to the templating, as + * "key:value;key2:value2" */ public class MetaDataService extends D4EService { private static Logger log = Logger.getLogger(MetaDataService.class); - public static final String XPATH_ARTIFACT_ID = "/art:meta/art:artifact-id/@value"; - public static final String XPATH_USER_ID = "/art:meta/art:user-id/@value"; - public static final String XPATH_OUTS = "/art:meta/art:outs/@value"; - public static final String XPATH_PARAMETERS = "/art:meta/art:parameters/@value"; + public static final String XPATH_ARTIFACT_ID = + "/art:meta/art:artifact-id/@value"; + public static final String XPATH_USER_ID = + "/art:meta/art:user-id/@value"; + public static final String XPATH_OUTS = + "/art:meta/art:outs/@value"; + public static final String XPATH_PARAMETERS = + "/art:meta/art:parameters/@value"; /** The global context key of the artifact database. */ public static final String ARTIFACT_DATA_BASE_KEY = diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/services/ModuleService.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/ModuleService.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/ModuleService.java Fri Jan 19 11:23:42 2018 +0100 @@ -45,7 +45,8 @@ ArtifactNamespaceContext.NAMESPACE_PREFIX); Element em = ec.create("modules"); - List modules = (List)globalContext.get(RiverContext.MODULES); + List modules = (List)globalContext.get( + RiverContext.MODULES); for (Module module : modules) { Element m = ec.create("module"); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/services/SQKMChartService.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/SQKMChartService.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/SQKMChartService.java Fri Jan 19 11:23:42 2018 +0100 @@ -253,7 +253,8 @@ plot.setRangeGridlinePaint(Color.gray); plot.setDomainGridlinesVisible(true); plot.setRangeGridlinesVisible(true); - XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer(); + XYLineAndShapeRenderer renderer = + (XYLineAndShapeRenderer)plot.getRenderer(); renderer.setSeriesPaint(0, Color.gray); renderer.setSeriesLinesVisible(0, false); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/services/SedimentLoadInfoService.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/SedimentLoadInfoService.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/SedimentLoadInfoService.java Fri Jan 19 11:23:42 2018 +0100 @@ -30,13 +30,16 @@ extends D4EService { /** The log used in this service. */ - private static Logger log = Logger.getLogger(SedimentLoadInfoService.class); + private static Logger log = Logger.getLogger( + SedimentLoadInfoService.class); public static final String RIVER_XPATH = "/art:river/text()"; public static final String TYPE_XPATH = "/art:river/art:type/text()"; public static final String SQ_TI_XPATH = "/art:river/art:sq_ti_id/text()"; - public static final String FROM_XPATH = "/art:river/art:location/art:from/text()"; - public static final String TO_XPATH = "/art:river/art:location/art:to/text()"; + public static final String FROM_XPATH = + "/art:river/art:location/art:from/text()"; + public static final String TO_XPATH = + "/art:river/art:location/art:to/text()"; /** * Create document with sedimentload infos, @@ -79,13 +82,14 @@ /* This call initializes the sedimentloaddata for the river. Might be * expensive but has to be done anyway for the calculation later on. */ - SedimentLoadData allLoadData = SedimentLoadDataFactory.INSTANCE.getSedimentLoadData( - river); + SedimentLoadData allLoadData = + SedimentLoadDataFactory.INSTANCE.getSedimentLoadData(river); log.debug("Requested type: " + type + " with sq_ti_id: " + sq_ti_id); Collection loads; if (type.equals("sq_time_intervals")) { - loads = allLoadData.findDistinctSQTimeIntervalNonEpochLoadsWithValue(fromD, toD); + loads = allLoadData + .findDistinctSQTimeIntervalNonEpochLoadsWithValue(fromD, toD); for (Iterator it = loads.iterator(); it.hasNext();) { /* Skip loads without time interval for this info type. */ @@ -138,7 +142,9 @@ } /* SQ Time interval */ if (load.getSQRelationTimeIntervalId() != null) { - ele.setAttribute("sq_ti_id", String.valueOf(load.getSQRelationTimeIntervalId())); + ele.setAttribute( + "sq_ti_id", + String.valueOf(load.getSQRelationTimeIntervalId())); Date start = load.getSQStartTime(); Date stop = load.getSQStopTime(); if (start != null && stop != null) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/services/ServerInfoService.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/ServerInfoService.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/ServerInfoService.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.services; import javax.xml.xpath.XPathConstants; @@ -23,7 +31,8 @@ /** The log used in this service.*/ private static Logger log = Logger.getLogger(ServerInfoService.class); - private static final String XPATH_HELP_URL = "/artifact-database/help-url/text()"; + private static final String XPATH_HELP_URL = + "/artifact-database/help-url/text()"; @Override protected Document doProcess(Document data, GlobalContext globalContext, diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/CalculationSelectSinfo.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/CalculationSelectSinfo.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/CalculationSelectSinfo.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,5 +1,7 @@ /* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde - * Software engineering by Intevation GmbH + * Software engineering by + * Björnsen Beratende Ingenieure GmbH + * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt * * This file is Free Software under the GNU AGPL (>=v3) * and comes with ABSOLUTELY NO WARRANTY! Check out the diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/AnnotationRiverState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/AnnotationRiverState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/AnnotationRiverState.java Fri Jan 19 11:23:42 2018 +0100 @@ -33,10 +33,12 @@ implements FacetTypes { /** Developer-centric description of facet. */ - public static final String I18N_DESCRIPTION = "facet.longitudinal_section.annotations"; + public static final String I18N_DESCRIPTION = + "facet.longitudinal_section.annotations"; /** The log that is used in this state. */ - private static final Logger log = Logger.getLogger(AnnotationRiverState.class); + private static final Logger log = Logger.getLogger( + AnnotationRiverState.class); /** diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/AreaCreationState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/AreaCreationState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/AreaCreationState.java Fri Jan 19 11:23:42 2018 +0100 @@ -54,7 +54,8 @@ if (facets != null) { AreaArtifact aArt = (AreaArtifact) areaArtifact; - facets.add(new AreaFacet(0, aArt.getFacetName(), aArt.getAreaName())); + facets.add( + new AreaFacet(0, aArt.getFacetName(), aArt.getAreaName())); } // TODO use compute to exploit caching strategies. diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/ComputedDischargeCurveState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/ComputedDischargeCurveState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/ComputedDischargeCurveState.java Fri Jan 19 11:23:42 2018 +0100 @@ -87,7 +87,8 @@ "chart.computed.discharge.curve.curve.label", args); - facets.add(new WaterlevelFacet(i, COMPUTED_DISCHARGE_Q, name)); + facets.add( + new WaterlevelFacet(i, COMPUTED_DISCHARGE_Q, name)); facets.add(new WaterlevelFacet(i, AT, "AT data")); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/EnterMultipleLocationsState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/EnterMultipleLocationsState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/EnterMultipleLocationsState.java Fri Jan 19 11:23:42 2018 +0100 @@ -23,7 +23,8 @@ */ public class EnterMultipleLocationsState extends EnterLocationState { /** The log for this class. */ - private static Logger log = Logger.getLogger(EnterMultipleLocationsState.class); + private static Logger log = Logger.getLogger( + EnterMultipleLocationsState.class); @Override protected String getUIProvider() { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/FloodMapState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FloodMapState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FloodMapState.java Fri Jan 19 11:23:42 2018 +0100 @@ -104,19 +104,22 @@ private static final String HWS_LINES_SHAPE = "hws-lines.shp"; - private static final String I18N_HWS_POINTS_OFFICIAL = "floodmap.hws.points.official"; - private static final String I18N_HWS_LINES_OFFICIAL = "floodmap.hws.lines.official"; + private static final String I18N_HWS_POINTS_OFFICIAL = + "floodmap.hws.points.official"; + private static final String I18N_HWS_LINES_OFFICIAL = + "floodmap.hws.lines.official"; private static final String HWS_LINES = "hws-lines"; private static final String HWS_POINT_SHAPE = "hws-points.shp"; private static final String HWS_POINTS = "hws-points"; /* List of possible map files this state handles . */ - private static final String[] POSSIBLE_ADDITIONAL_MAPFILES = {HWS_LINES, - HWS_POINTS, - WSPLGEN_USER_RGD, - "barriers-lines", - "barriers-poly"}; + private static final String[] POSSIBLE_ADDITIONAL_MAPFILES = { + HWS_LINES, + HWS_POINTS, + WSPLGEN_USER_RGD, + "barriers-lines", + "barriers-poly"}; @@ -158,15 +161,18 @@ FileTools.copyDirectory(origDir, thisDir); for (String candidate: POSSIBLE_ADDITIONAL_MAPFILES) { - File f = new File(thisDir, MapfileGenerator.MS_LAYER_PREFIX + candidate); + File f = new File( + thisDir, MapfileGenerator.MS_LAYER_PREFIX + candidate); if (f.exists()) { log.debug("Fixing artifiact id's in: " + f); try { String content = FileUtils.readFileToString(f); FileUtils.writeStringToFile(f, - content.replaceAll(orig.identifier(), owner.identifier())); + content.replaceAll( + orig.identifier(), owner.identifier())); } catch (IOException e) { - log.error("Failed to rewrite file: " + f + " Error: " + e.getMessage()); + log.error("Failed to rewrite file: " + f + + " Error: " + e.getMessage()); } } } @@ -197,7 +203,8 @@ if (layer.contains(orig.identifier())) { wms.removeLayer(layer); - String newLayer = layer.replace(orig.identifier(), owner.identifier()); + String newLayer = layer.replace( + orig.identifier(), owner.identifier()); wms.addLayer(newLayer); @@ -298,7 +305,7 @@ /** - * Removes the directory and all its content where the required data and the + * Removes directory and all its content where the required data and the * results of WSPLGEN are stored. Should be called in endOfLife(). */ protected void removeDirectory(D4EArtifact artifact) { @@ -443,7 +450,7 @@ MapfileGenerator.MS_LAYER_PREFIX + HWS_LINES, HWS_LINES_SHAPE, "LINE", - "31467", // XXX: This should be dynamically fetched from database. + "31467", // XXX: should be dynamically fetched from database. "hws"); job.addLin(artifactDir + "/" + HWS_LINES_SHAPE); facetCreator.createShapeFacet(I18N_HWS_LINES_OFFICIAL, @@ -473,7 +480,8 @@ info.setGroupTitle(group); info.setGroup(group + artifact.identifier()); MapfileGenerator generator = new ArtifactMapfileGenerator(); - Template tpl = generator.getTemplateByName(MapfileGenerator.SHP_LAYER_TEMPLATE); + Template tpl = generator.getTemplateByName( + MapfileGenerator.SHP_LAYER_TEMPLATE); try { File layer = new File(artifactDir.getCanonicalPath() + "/" + name); generator.writeLayer(info, layer, tpl); @@ -602,7 +610,8 @@ boolean l = GeometryUtils.writeShapefile( shapeLines, - GeometryUtils.buildFeatureType("lines", srs, LineString.class, obj), + GeometryUtils.buildFeatureType( + "lines", srs, LineString.class, obj), fcs[0]); if (l) { @@ -628,7 +637,8 @@ boolean p = GeometryUtils.writeShapefile( shapePolys, - GeometryUtils.buildFeatureType("polygons", srs, Polygon.class, obj), + GeometryUtils.buildFeatureType( + "polygons", srs, Polygon.class, obj), fcs[1]); @@ -691,7 +701,9 @@ } - protected FeatureCollection[] splitLinesAndPolygons(List f) { + protected FeatureCollection[] splitLinesAndPolygons( + List f + ) { FeatureCollection lines = FeatureCollections.newCollection(); FeatureCollection polygons = FeatureCollections.newCollection(); @@ -857,7 +869,8 @@ boolean q = GeometryUtils.writeShapefile( qpsShape, - GeometryUtils.buildFeatureType("qps", srs, LineString.class, attrs), + GeometryUtils.buildFeatureType( + "qps", srs, LineString.class, attrs), collection); if (q) { @@ -966,7 +979,8 @@ log.debug("Use waterlevel provided by Artifact: " + src.identifier()); - // The state actually depends on the kind of artifact. E.g. StaticWQKmsArtifact needs other state + // The state actually depends on the kind of artifact. + // E.g. StaticWQKmsArtifact needs other state Object computed = src.compute( cc, //null, @@ -983,7 +997,8 @@ CalculationResult rawData = (CalculationResult) computed; WQKms[] wqkms; if (rawData.getData() instanceof FixRealizingResult) { - wqkms = (WQKms[]) ((FixRealizingResult) rawData.getData()).getWQKms(); + wqkms = (WQKms[])((FixRealizingResult)rawData.getData()) + .getWQKms(); } else { wqkms = (WQKms[]) rawData.getData(); @@ -999,11 +1014,13 @@ } else if (computed == null && src instanceof StaticWKmsArtifact) { // Floodmarks and protection. - WQKms wqkms = WQKms.fromWKms(((StaticWKmsArtifact) src).getWKms(0), 1d); + WQKms wqkms = WQKms.fromWKms( + ((StaticWKmsArtifact)src).getWKms(0), 1d); return wqkms; } - log.warn("getWQKms cannot handle " + computed.getClass() + " " + src.getClass()); + log.warn("getWQKms cannot handle " + computed.getClass() + + " " + src.getClass()); return null; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/FlowVelocityState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FlowVelocityState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FlowVelocityState.java Fri Jan 19 11:23:42 2018 +0100 @@ -92,7 +92,8 @@ newFacets.add(new FlowVelocityFacet( idx, FLOW_VELOCITY_MAINCHANNEL, - buildFacetName(artifact, context, d, I18N_MAINCHANNEL_FACET_RAW), + buildFacetName( + artifact, context, d, I18N_MAINCHANNEL_FACET_RAW), ComputeType.ADVANCE, id, hash @@ -127,7 +128,8 @@ newFacets.add(new FlowVelocityFacet( idx, FLOW_VELOCITY_TOTALCHANNEL, - buildFacetName(artifact, context, d, I18N_TOTALCHANNEL_FACET_RAW), + buildFacetName( + artifact, context, d, I18N_TOTALCHANNEL_FACET_RAW), ComputeType.ADVANCE, id, hash @@ -146,7 +148,8 @@ newFacets.add(new FlowVelocityFacet( idx, FLOW_VELOCITY_MAINCHANNEL, - buildFacetName(artifact, context, d, I18N_MAINCHANNEL_FACET_RAW), + buildFacetName( + artifact, context, d, I18N_MAINCHANNEL_FACET_RAW), ComputeType.ADVANCE, id, hash @@ -162,7 +165,8 @@ newFacets.add(new FlowVelocityFacet( idx, FLOW_VELOCITY_TOTALCHANNEL, - buildFacetName(artifact, context, d, I18N_TOTALCHANNEL_FACET_RAW), + buildFacetName( + artifact, context, d, I18N_TOTALCHANNEL_FACET_RAW), ComputeType.ADVANCE, id, hash diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeDischargeCurveState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeDischargeCurveState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeDischargeCurveState.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.states; import java.util.List; @@ -31,17 +39,22 @@ Date stopTime = validity.getStopTime(); String description = Resources.getMsg( context.getMeta(), - "chart.discharge.curve.model" + (stopTime != null ? "" : ".nostop"), + "chart.discharge.curve.model" + + (stopTime != null ? "" : ".nostop"), new Object[] {gaugeName, validity.getStartTime(), stopTime } ); - facets.add(new GaugeDischargeCurveFacet("gauge_discharge_curve", description)); - facets.add(new GaugeDischargeCurveFacet("at", "gauge_discharge_curve")); - facets.add(new GaugeDischargeCurveFacet("csv", "gauge_discharge_curve")); - facets.add(new GaugeDischargeCurveFacet("pdf", "gauge_discharge_curve")); + facets.add(new GaugeDischargeCurveFacet("gauge_discharge_curve", + description)); + facets.add(new GaugeDischargeCurveFacet("at", + "gauge_discharge_curve")); + facets.add(new GaugeDischargeCurveFacet("csv", + "gauge_discharge_curve")); + facets.add(new GaugeDischargeCurveFacet("pdf", + "gauge_discharge_curve")); return null; } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeDischargeInitState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeDischargeInitState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeDischargeInitState.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.states; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeDischargeState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeDischargeState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeDischargeState.java Fri Jan 19 11:23:42 2018 +0100 @@ -70,7 +70,8 @@ Date stopTime = validity.getStopTime(); String name = Resources.getMsg( meta, - "chart.discharge.curve.model" + (stopTime != null ? "" : ".nostop"), + "chart.discharge.curve.model" + + (stopTime != null ? "" : ".nostop"), new Object[] {gauge.getName(), validity.getStartTime(), stopTime @@ -126,7 +127,8 @@ ) { if (artifact instanceof GaugeDischargeArtifact) { log.debug("GaugeDischargeState.computeAdvance()"); - GaugeDischargeArtifact dischargeArtifact = (GaugeDischargeArtifact) artifact; + GaugeDischargeArtifact dischargeArtifact = + (GaugeDischargeArtifact)artifact; CalculationResult res; @@ -141,7 +143,8 @@ WQKms[] wqkms = (WQKms[]) res.getData(); if (wqkms != null && facets != null) { - log.debug("GaugeDischargeState.computeAdvance(): create facets"); + log.debug( + "GaugeDischargeState.computeAdvance(): create facets"); GaugeDischargeFacet facet = new GaugeDischargeFacet( 0, @@ -156,9 +159,11 @@ } else { if (wqkms == null) - log.debug("GaugeDischargeState.computeAdvance(): wqkms 0"); + log.debug( + "GaugeDischargeState.computeAdvance(): wqkms 0"); else - log.debug("GaugeDischargeState.computeAdvance(): facets 0"); + log.debug( + "GaugeDischargeState.computeAdvance(): facets 0"); } return res; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeTimerangeState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeTimerangeState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeTimerangeState.java Fri Jan 19 11:23:42 2018 +0100 @@ -63,7 +63,8 @@ Calendar up = (Calendar) res[1]; if (lo != null && up != null) { - return new long[] { lo.getTimeInMillis(), up.getTimeInMillis() }; + return new long[] { lo.getTimeInMillis(), + up.getTimeInMillis() }; } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/HWSBarriersState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/HWSBarriersState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/HWSBarriersState.java Fri Jan 19 11:23:42 2018 +0100 @@ -109,7 +109,8 @@ shapeLines, lineType, collectionLines); } - FeatureCollection collectionPoints = FeatureCollections.newCollection(); + FeatureCollection collectionPoints = + FeatureCollections.newCollection(); SimpleFeatureType pointType = null; for (HWS h : selectedPoints) { pointType = h.getFeatureType(); @@ -181,7 +182,8 @@ FloodMapState.createMapfile( artifact, artifactDir, - MapfileGenerator.MS_LAYER_PREFIX + FloodMapState.WSPLGEN_USER_RGD, + MapfileGenerator.MS_LAYER_PREFIX + + FloodMapState.WSPLGEN_USER_RGD, FloodMapState.WSPLGEN_USER_RGD_SHAPE, type, epsg, @@ -208,7 +210,8 @@ } catch (IOException ioe) { log.warn("Zip archive " + dir + "/" - + FloodMapState.WSPLGEN_USER_RGD_ZIP + " could not be extracted."); + + FloodMapState.WSPLGEN_USER_RGD_ZIP + + " could not be extracted."); return false; } } @@ -238,10 +241,14 @@ return true; } try { - FileTools.copyFile(file, new File(target, FloodMapState.WSPLGEN_USER_RGD + "." + suffix)); + FileTools.copyFile( + file, + new File(target, + FloodMapState.WSPLGEN_USER_RGD + + "." + suffix)); } catch (IOException ioe) { - log.warn ("Error while copying file " + file.getName()); + log.warn("Error while copying file " + file.getName()); return true; } } @@ -264,7 +271,7 @@ /** - * Removes the directory and all its content where the required data and the + * Removes directory and all its content where the required data and the * results of WSPLGEN are stored. Should be called in endOfLife(). */ // FIXME: I've seen this code somewhere else... diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/HistoricalDischargeComputeState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/HistoricalDischargeComputeState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/HistoricalDischargeComputeState.java Fri Jan 19 11:23:42 2018 +0100 @@ -117,12 +117,13 @@ HISTORICAL_DISCHARGE_Q, createFacetTitle(wqt))); if (wqt instanceof HistoricalWQTimerange) { - log - .debug("Create another facet for historical differences."); + log.debug( + "Create another facet for historical differences."); // TODO CREATE BETTER TITLE FOR FACETS (issue1180) facets.add(new HistoricalDischargeDifferenceFacet(i, - HISTORICAL_DISCHARGE_Q_DIFF, "DIFF: " + wqt.getName())); + HISTORICAL_DISCHARGE_Q_DIFF, + "DIFF: " + wqt.getName())); } } else { @@ -130,12 +131,13 @@ HISTORICAL_DISCHARGE_W, createFacetTitle(wqt))); if (wqt instanceof HistoricalWQTimerange) { - log - .debug("Create another facet for historical differences."); + log.debug( + "Create another facet for historical differences."); // TODO CREATE BETTER TITLE FOR FACETS facets.add(new HistoricalDischargeDifferenceFacet(i, - HISTORICAL_DISCHARGE_W_DIFF, "DIFF: " + wqt.getName())); + HISTORICAL_DISCHARGE_W_DIFF, + "DIFF: " + wqt.getName())); } } @@ -152,14 +154,22 @@ Resources.getLocale(cc.getMeta())); for (int k = 0; k < ws.length; k++) { facets.add(new HistoricalDischargeWQFacet(k, - HISTORICAL_DISCHARGE_WQ_W, "W=" + format.format(ws[k]), ComputeType.ADVANCE, - hash, getID(), ws[k])); + HISTORICAL_DISCHARGE_WQ_W, + "W=" + format.format(ws[k]), + ComputeType.ADVANCE, + hash, + getID(), + ws[k])); } for (int k = 0; k < qs.length; k++) { facets.add(new HistoricalDischargeWQFacet(k, - HISTORICAL_DISCHARGE_WQ_Q, "Q=" + format.format(qs[k]), ComputeType.ADVANCE, - hash, getID(), qs[k])); + HISTORICAL_DISCHARGE_WQ_Q, + "Q=" + format.format(qs[k]), + ComputeType.ADVANCE, + hash, + getID(), + qs[k])); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/ManualPointsSingleState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/ManualPointsSingleState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/ManualPointsSingleState.java Fri Jan 19 11:23:42 2018 +0100 @@ -80,7 +80,8 @@ fName, Resources.getMsg(meta, MANUALPOINTS, "Manual Points")); facets.add(facet); - log.debug("compute(): ManualPointsFacet for " + ct + " created"); + log.debug("compute(): ManualPointsFacet for " + + ct + " created"); } else { log.debug("compute(): No points for " + ct); @@ -98,11 +99,13 @@ double y = array.getDouble(0); String name = array.getString(1); String fName = ct + "." + MANUALLINE; - log.debug("have facet: " + y + " / " + name + " -> " + fName); - CrossSectionWaterLineFacet facet = new CrossSectionWaterLineFacet( - i, - fName, - name); + log.debug("have facet: " + y + " / " + + name + " -> " + fName); + CrossSectionWaterLineFacet facet = + new CrossSectionWaterLineFacet( + i, + fName, + name); facets.add(facet); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/MultiIntArrayState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/MultiIntArrayState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/MultiIntArrayState.java Fri Jan 19 11:23:42 2018 +0100 @@ -47,8 +47,10 @@ for (KVP kvp: getOptions(artifact, name)) { Element item = creator.create("item"); - creator.addAttr(item, "label", kvp.getValue().toString(), true); - creator.addAttr(item, "value", kvp.getKey().toString(), true); + creator.addAttr( + item, "label", kvp.getValue().toString(), true); + creator.addAttr( + item, "value", kvp.getKey().toString(), true); select.appendChild(item); } @@ -79,8 +81,10 @@ for (int val: values) { try { Element item = creator.create("item"); - creator.addAttr(item, "value", String.valueOf(val), true); - creator.addAttr(item, "label", getLabelFor(cc, name, val), true); + creator.addAttr( + item, "value", String.valueOf(val), true); + creator.addAttr( + item, "label", getLabelFor(cc, name, val), true); data.appendChild(item); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/ReferenceCurveState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/ReferenceCurveState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/ReferenceCurveState.java Fri Jan 19 11:23:42 2018 +0100 @@ -79,8 +79,10 @@ if (wws.length > 0) { log.debug("Adding CSV and PDF data facet."); - Facet csv = new DataFacet (CSV, "CSV data", ComputeType.ADVANCE, hash, id); - Facet pdf = new DataFacet (PDF, "PDF data", ComputeType.ADVANCE, hash, id); + Facet csv = new DataFacet( + CSV, "CSV data", ComputeType.ADVANCE, hash, id); + Facet pdf = new DataFacet( + PDF, "PDF data", ComputeType.ADVANCE, hash, id); facets.add(csv); facets.add(pdf); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/SQRelation.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/SQRelation.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/SQRelation.java Fri Jan 19 11:23:42 2018 +0100 @@ -74,7 +74,8 @@ SQ_D_CURVE, SQ_E_CURVE, SQ_F_CURVE, SQ_G_CURVE }, { SQ_A_MEASUREMENT, SQ_B_MEASUREMENT, SQ_C_MEASUREMENT, - SQ_D_MEASUREMENT, SQ_E_MEASUREMENT, SQ_F_MEASUREMENT, SQ_G_MEASUREMENT + SQ_D_MEASUREMENT, SQ_E_MEASUREMENT, SQ_F_MEASUREMENT, + SQ_G_MEASUREMENT }, { SQ_A_OUTLIER, SQ_B_OUTLIER, SQ_C_OUTLIER, SQ_D_OUTLIER, SQ_E_OUTLIER, SQ_F_OUTLIER, SQ_G_OUTLIER @@ -341,7 +342,8 @@ container.add(new SQOutlierMeasurementFacet( index, i, - getFractionOverviewFacetname(OUTLIER_MEASUREMENT_INDEX, i), + getFractionOverviewFacetname( + OUTLIER_MEASUREMENT_INDEX, i), sqr[res].getFractionName(i) + " - " + Resources.getMsg( meta, diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelect.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelect.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelect.java Fri Jan 19 11:23:42 2018 +0100 @@ -62,7 +62,11 @@ } } - private static Element order(ElementCreator creator, String name, String order) { + private static Element order( + ElementCreator creator, + String name, + String order + ) { Element element = creator.create(name); creator.addAttr(element, "order", order, false); return element; @@ -107,7 +111,8 @@ appendSingles(river, kmLo, kmHi, creator, select, context); - List> kvp = Collections.>emptyList(); + List> kvp = + Collections.>emptyList(); return kvp.toArray(new KVP[kvp.size()]); } @@ -223,8 +228,8 @@ /** - * This method might be used to test, if a parameter name is handled by this - * state. + * This method might be used to test, if a parameter name + * is handled by this state. * * @param parameterName The name of a parameter. * diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/StaticHYKState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/StaticHYKState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/StaticHYKState.java Fri Jan 19 11:23:42 2018 +0100 @@ -32,7 +32,8 @@ implements FacetTypes { /** The log that is used in this state. */ - transient private static final Logger log = Logger.getLogger(StaticHYKState.class); + transient private static final Logger log = Logger.getLogger( + StaticHYKState.class); /** diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/StaticState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/StaticState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/StaticState.java Fri Jan 19 11:23:42 2018 +0100 @@ -80,7 +80,8 @@ return staticCompute(facets); } - /** End-point and most important compute-method. Override for desired effect. */ + /** End-point and most important compute-method. + * Override for desired effect. */ public Object staticCompute(List facets) { return null; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/WDifferencesState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WDifferencesState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WDifferencesState.java Fri Jan 19 11:23:42 2018 +0100 @@ -110,7 +110,12 @@ * Access the data (wkms) of an artifact, coded in mingle. */ // FIXME: meanwhile used by several places outside this context; refactor into separate helper class to access waterlevels - public WKms getWKms(String mingle, CallContext context, double from, double to) { + public WKms getWKms( + String mingle, + CallContext context, + double from, + double to + ) { log.debug("WDifferencesState.getWKms " + mingle); String[] def = mingle.split(";"); String uuid = def[0]; @@ -121,7 +126,8 @@ context); if (d4eArtifact == null) { - log.warn("One of the artifacts (1) for diff calculation could not be loaded"); + log.warn("One of the artifacts (1) for diff calculation " + + "could not be loaded"); return null; } @@ -163,9 +169,10 @@ if (retval == null) { - log.error("Do not know how to handle (getWKms) minuend/subtrahend"); + log.error( + "Do not know how to handle (getWKms) minuend/subtrahend"); } else if (!Double.isNaN(from) && !Double.isNaN(to)) { - /* Filter out only the relevant data points for calulation results.*/ + /* Filter out only relevant data points for calulation results.*/ log.debug("Before filter: " + retval.size()); retval = retval.filteredKms(from, to); log.debug("After filter: " + retval.size()); @@ -199,7 +206,7 @@ double to = rangeAccess.getTo(true); // Load the Artifacts/facets that we want to subtract and display. // Expected format is: - // [42537f1e-3522-42ef-8968-635b03d8e9c6;longitudinal_section.w;0]#[1231f2-....] + //[42537f1e-3522-42ef-8968-635b03d8e9c6;longitudinal_section.w;0]#[...] String diffids = winfo.getDataAsString("diffids"); log.debug("WDifferencesState has: " + diffids); String datas[] = diffids.split("#"); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/WMSBackgroundState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WMSBackgroundState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WMSBackgroundState.java Fri Jan 19 11:23:42 2018 +0100 @@ -50,7 +50,8 @@ protected Map variables; - private static final Logger log = Logger.getLogger(WMSBackgroundState.class); + private static final Logger log = Logger.getLogger( + WMSBackgroundState.class); @Override diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/WQAdapted.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WQAdapted.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WQAdapted.java Fri Jan 19 11:23:42 2018 +0100 @@ -74,9 +74,10 @@ /** - * This method creates one element for each gauge of the selected river that + * This method creates one element for each gauge of selected river that * is intersected by the given kilometer range. Each element is a tuple of - * (from;to) where from is the lower bounds of the gauge or the lower + * (from;to) where from is the lower bounds of the gauge or + * the lower * kilometer range. to is the upper bounds of the gauge or the upper * kilometer range. * @@ -175,7 +176,11 @@ double[] mmW = gauge.determineMinMaxW(); elements.add(createItem( - cr, new String[] { from + ";" + to, gauge.getName()}, mmQ, mmW)); + cr, + new String[] { from + ";" + to, + gauge.getName()}, + mmQ, + mmW)); } } else { @@ -196,7 +201,11 @@ double[] mmW = gauge.determineMinMaxW(); elements.add(createItem( - cr, new String[] { to + ";" + from, gauge.getName()}, mmQ, mmW)); + cr, + new String[] { to + ";" + from, + gauge.getName()}, + mmQ, + mmW)); } } @@ -318,7 +327,8 @@ return validateQ(artifact); } else { - throw new IllegalArgumentException("error_feed_no_wq_mode_selected"); + throw new IllegalArgumentException( + "error_feed_no_wq_mode_selected"); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/WQFixing.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WQFixing.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WQFixing.java Fri Jan 19 11:23:42 2018 +0100 @@ -29,7 +29,8 @@ { log.debug("WQFixing.validate"); - RangeWithValues[] rwvs = extractInput(getData((D4EArtifact) artifact, "wq_values")); + RangeWithValues[] rwvs = extractInput( + getData((D4EArtifact) artifact, "wq_values")); if (rwvs == null) { throw new IllegalArgumentException("error_missing_wq_data"); @@ -39,7 +40,8 @@ double[] values = rwv.getValues(); for (double val: values) { if (val <= 0) { - throw new IllegalArgumentException("error_validate_positive"); + throw new IllegalArgumentException( + "error_validate_positive"); } } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelInfoState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelInfoState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelInfoState.java Fri Jan 19 11:23:42 2018 +0100 @@ -114,7 +114,8 @@ } // TODO Adjust to WaterlevelState - implementation. - facets.add(new CrossSectionWaterLineFacet(0, "Q=" + winfo.getDataAsString("wq_single"))); + facets.add(new CrossSectionWaterLineFacet(0, + "Q=" + winfo.getDataAsString("wq_single"))); // Assume to be in wq_single mode. return res; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelPairSelectState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelPairSelectState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelPairSelectState.java Fri Jan 19 11:23:42 2018 +0100 @@ -82,9 +82,12 @@ { log.debug("createItems: " + name); if (name.equals("diffids")) { - Element item = ProtocolUtils.createArtNode(cr, "item", null, null); - Element label = ProtocolUtils.createArtNode(cr, "label", null, null); - Element value = ProtocolUtils.createArtNode(cr, "value", null, null); + Element item = ProtocolUtils.createArtNode( + cr, "item", null, null); + Element label = ProtocolUtils.createArtNode( + cr, "label", null, null); + Element value = ProtocolUtils.createArtNode( + cr, "value", null, null); D4EArtifact flys = (D4EArtifact) artifact; String s = flys.getDataAsString("diffids"); value.setTextContent(s); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelSelectState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelSelectState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelSelectState.java Fri Jan 19 11:23:42 2018 +0100 @@ -70,7 +70,8 @@ return null; } - return new DefaultStateData(name, null, null, StringUtil.unbracket(val)); + return new DefaultStateData( + name, null, null, StringUtil.unbracket(val)); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelState.java Fri Jan 19 11:23:42 2018 +0100 @@ -126,7 +126,8 @@ report.addProblem(Resources.format( cc.getMeta(), "official.line.found", - "Found official line for {0} from year {1,date,yyyy} from {2}.", + "Found official line for {0} from year {1,date,yyyy} " + + "from {2}.", ol.getName(), nn(ol.getDate()), nn(ol.getSource()))); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeCompute.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeCompute.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeCompute.java Fri Jan 19 11:23:42 2018 +0100 @@ -113,10 +113,10 @@ new DataFacet(WST, "WST data", ComputeType.ADVANCE, hash, id)); facets.add(new ExtremeCurveFacet(Resources.getMsg(context.getMeta(), - "extreme_wq_curve", "extreme_wq_curve"))); + "extreme_wq_curve", "extreme_wq_curve"))); facets.add(new ExtremeCurveFacet(Resources.getMsg(context.getMeta(), - "extreme_wq_base_curve", "extreme_wq_base_curve") - , true)); + "extreme_wq_base_curve", "extreme_wq_base_curve"), + true)); return res; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeQInput.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeQInput.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeQInput.java Fri Jan 19 11:23:42 2018 +0100 @@ -45,7 +45,8 @@ /** * State to input Q data in segments for extreme value calculations.. - * The data item ranges is expected to have this format ;;:;;:... + * The data item ranges is expected to have this format + * ;;:;;:... * (;;;:;;;:;;;:...) */ public class ExtremeQInput extends DefaultState { @@ -103,7 +104,10 @@ for (Range range: ranges) { elements.add(createItem( - cr, new String[] { range.getStart() + ";" + range.getEnd(), ""}, new double[] {0,100000})); + cr, + new String[] { range.getStart() + ";" + range.getEnd(), + ""}, + new double[] {0,100000})); } Element[] els = new Element[elements.size()]; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixAnalysisCompute.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixAnalysisCompute.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixAnalysisCompute.java Fri Jan 19 11:23:42 2018 +0100 @@ -56,7 +56,8 @@ /** The log used in this class. */ private static Logger log = Logger.getLogger(FixAnalysisCompute.class); - private static final String I18N_REFERENCEPERIOD_SHORT = "fix.reference.period.event.short"; + private static final String I18N_REFERENCEPERIOD_SHORT = + "fix.reference.period.event.short"; private static final String I18N_ANALYSISPERIODS = "fix.analysis.periods"; @@ -68,9 +69,11 @@ private static final String I18N_DEVIATION = "fix.deviation"; - private static final String I18N_REFERENCEDEVIATION = "fix.reference.deviation"; + private static final String I18N_REFERENCEDEVIATION = + "fix.reference.deviation"; - private static final String I18N_REFERENCEPERIOD = "state.fix.analysis.referenceperiod"; + private static final String I18N_REFERENCEPERIOD = + "state.fix.analysis.referenceperiod"; public static final String [] SECTOR_LABELS = { "fix.mnq", @@ -90,7 +93,9 @@ Facet facet, String output ) { - if (output.contains(FacetTypes.ChartType.FLSC.toString())) { + if ( + output.contains(FacetTypes.ChartType.FLSC.toString()) + ) { // Longitudinal section chart String name = facet.getName(); @@ -105,7 +110,8 @@ } } if (output.contains(FacetTypes.ChartType.FDWC.toString()) - && facet.getName().contains(FacetTypes.FIX_SECTOR_AVERAGE_DWT)) { + && facet.getName().contains( + FacetTypes.FIX_SECTOR_AVERAGE_DWT)) { return Boolean.FALSE; } @@ -172,8 +178,10 @@ int qsS = access.getQSectorStart(); int qsE = access.getQSectorEnd(); - DateFormat df = Formatter.getDateFormatter(context.getMeta(), "dd.MM.yyyy"); - DateFormat lf = Formatter.getDateFormatter(context.getMeta(), "dd.MM.yyyy'T'HH:mm"); + DateFormat df = Formatter.getDateFormatter( + context.getMeta(), "dd.MM.yyyy"); + DateFormat lf = Formatter.getDateFormatter( + context.getMeta(), "dd.MM.yyyy'T'HH:mm"); DateRange [] periods = access.getAnalysisPeriods(); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityDistanceSelect.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityDistanceSelect.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityDistanceSelect.java Fri Jan 19 11:23:42 2018 +0100 @@ -8,7 +8,6 @@ package org.dive4elements.river.artifacts.states.minfo; -import java.util.Date; import java.util.List; import org.w3c.dom.Element; @@ -30,7 +29,8 @@ /** Extended Distance Select with default values appropiate for BedQuality */ public class BedQualityDistanceSelect extends DistanceSelect { - private static Logger log = Logger.getLogger(BedQualityDistanceSelect.class); + private static Logger log = Logger.getLogger( + BedQualityDistanceSelect.class); /** * The default constructor that initializes an empty State object. diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityPeriodsSelect.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityPeriodsSelect.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityPeriodsSelect.java Fri Jan 19 11:23:42 2018 +0100 @@ -40,7 +40,8 @@ public class BedQualityPeriodsSelect extends DefaultState { /** The log used in this class. */ - private static Logger log = Logger.getLogger(BedQualityPeriodsSelect.class); + private static Logger log = Logger.getLogger( + BedQualityPeriodsSelect.class); private static final String I18N_NO_DATA = "state.minfo.bed.error.no_data"; @@ -54,15 +55,17 @@ public BedQualityPeriodsSelect() { } - /** Get either the start and end date of the data at the current position. */ + /** Get the start and end date of the data at the current position. */ protected Long[] getDataMinMaxDate(Artifact artifact) { D4EArtifact arti = (D4EArtifact) artifact; RangeAccess access = new RangeAccess(arti); double a = access.getFrom(true); double b = access.getTo(true); - BedOverview overview = BedOverviewFactory.getOverview(access.getRiverName()); - BedloadOverview overview2 = BedloadOverviewFactory.getOverview(access.getRiverName()); + BedOverview overview = BedOverviewFactory.getOverview( + access.getRiverName()); + BedloadOverview overview2 = BedloadOverviewFactory.getOverview( + access.getRiverName()); /* Filter is not implemented and only checks if a complete * KMIndex list is acceptable or not. So KMFiltering wont work */ @@ -104,7 +107,9 @@ } Element def = createItem( cr, - new String[] {"default", values[0].toString() + "," + values[1].toString()}); + new String[] {"default", + values[0].toString() + "," + values[1].toString()} + ); return new Element[] { def }; } @@ -117,9 +122,10 @@ Long[] minMax = getDataMinMaxDate(artifact); if (minMax == null) { - throw new IllegalArgumentException(Resources.getMsg(context.getMeta(), - I18N_NO_DATA, - I18N_NO_DATA)); + throw new IllegalArgumentException(Resources.getMsg( + context.getMeta(), + I18N_NO_DATA, + I18N_NO_DATA)); } long min = minMax[0]; @@ -129,12 +135,14 @@ long b = range.getTo().getTime(); log.debug("min max a b " + min + " " + max + " " + a + " " + b); if (b < min || a > max || a > b) { - DateFormat df = Formatter.getDateFormatter(context.getMeta(), "dd.MM.yyyy"); - throw new IllegalArgumentException(Resources.getMsg(context.getMeta(), - I18N_NO_DATA_FOR_PERIOD, - I18N_NO_DATA_FOR_PERIOD, - new Object[] {df.format(range.getFrom()), - df.format(range.getTo())})); + DateFormat df = Formatter.getDateFormatter( + context.getMeta(), "dd.MM.yyyy"); + throw new IllegalArgumentException(Resources.getMsg( + context.getMeta(), + I18N_NO_DATA_FOR_PERIOD, + I18N_NO_DATA_FOR_PERIOD, + new Object[] {df.format(range.getFrom()), + df.format(range.getTo())})); } } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityState.java Fri Jan 19 11:23:42 2018 +0100 @@ -48,15 +48,19 @@ .getLogger(BedQualityState.class); /* The suffix to append to interpol facets. */ - public static final String I18N_INTERPOL_SUFFIX = "facet.bedquality.interpol.suffix"; + public static final String I18N_INTERPOL_SUFFIX = + "facet.bedquality.interpol.suffix"; - /* I18n is in the pattern base.. with the optional suffix .data */ + /* I18n is in the pattern base.. with optional suffix .data */ public static final String I18N_FACET_BED_BASE = "facet.bedquality.bed"; /* Data Layers */ - public static final String I18N_FACET_BEDLOAD_DIAMETER_DATA = "facet.bedquality.bed.diameter.bedload.data"; - public static final String I18N_FACET_BED_DIAMETER_DATA_TOPLAYER = "facet.bedquality.bed.diameter.toplayer.data"; - public static final String I18N_FACET_BED_DIAMETER_DATA_SUBLAYER = "facet.bedquality.bed.diameter.sublayer.data"; + public static final String I18N_FACET_BEDLOAD_DIAMETER_DATA = + "facet.bedquality.bed.diameter.bedload.data"; + public static final String I18N_FACET_BED_DIAMETER_DATA_TOPLAYER = + "facet.bedquality.bed.diameter.toplayer.data"; + public static final String I18N_FACET_BED_DIAMETER_DATA_SUBLAYER = + "facet.bedquality.bed.diameter.sublayer.data"; public static final String I18N_TOPLAYER = "bedquality.toplayer"; public static final String I18N_SUBLAYER = "bedquality.sublayer"; @@ -100,7 +104,8 @@ BedQualityAccess access = new BedQualityAccess(artifact, context); - CalculationResult res = old instanceof CalculationResult ? (CalculationResult) old + CalculationResult res = old instanceof CalculationResult + ? (CalculationResult)old : new BedQualityCalculation().calculate(access); if (facets == null || res == null) { @@ -294,7 +299,8 @@ CallMeta meta = context.getMeta(); - newFacets.add(new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); + newFacets.add( + new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); for (int idx = 0; idx < results.length; idx++) { BedQualityResult result = results[idx]; DateRange range = result.getDateRange(); @@ -347,7 +353,8 @@ return Resources.getMsg(meta, i18n, i18n, new Object[] { value.getName().toUpperCase(), from, to, layerSuffix }); } else { - return Resources.getMsg(meta, i18n, i18n, new Object[] { from, to, layerSuffix }); + return Resources.getMsg(meta, i18n, i18n, new Object[] { + from, to, layerSuffix }); } } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java Fri Jan 19 11:23:42 2018 +0100 @@ -51,19 +51,31 @@ private static Logger log = Logger.getLogger(DifferencesState.class); public static final String I18N_DIFF_YEAR = "beddifference.year"; - public static final String I18N_FACET_BED_DIFF_YEAR = "facet.bedheight.diff.year"; - public static final String I18N_FACET_BED_DIFF_YEAR_RAW = "facet.bedheight.diff.year.raw"; - public static final String I18N_FACET_BED_DIFF_ABSOLUTE = "facet.bedheight.diff.absolute"; - public static final String I18N_FACET_BED_DIFF_ABSOLUTE_RAW = "facet.bedheight.diff.absolute.raw"; - public static final String I18N_FACET_BED_DIFF_SOUNDING = "facet.bedheight.diff.sounding"; - public static final String I18N_FACET_BED_DIFF_MORPH1 = "facet.bedheight.diff.morph1"; - public static final String I18N_FACET_BED_DIFF_MORPH2 = "facet.bedheight.diff.morph2"; - public static final String I18N_FACET_BED_DIFF_HEIGHT1 = "facet.bedheight.diff.height1"; - public static final String I18N_FACET_BED_DIFF_HEIGHT1_RAW = "facet.bedheight.diff.height1.raw"; - public static final String I18N_FACET_BED_DIFF_HEIGHT2 = "facet.bedheight.diff.height2"; - public static final String I18N_FACET_BED_DIFF_HEIGHT2_RAW = "facet.bedheight.diff.height2.raw"; + public static final String I18N_FACET_BED_DIFF_YEAR = + "facet.bedheight.diff.year"; + public static final String I18N_FACET_BED_DIFF_YEAR_RAW = + "facet.bedheight.diff.year.raw"; + public static final String I18N_FACET_BED_DIFF_ABSOLUTE = + "facet.bedheight.diff.absolute"; + public static final String I18N_FACET_BED_DIFF_ABSOLUTE_RAW = + "facet.bedheight.diff.absolute.raw"; + public static final String I18N_FACET_BED_DIFF_SOUNDING = + "facet.bedheight.diff.sounding"; + public static final String I18N_FACET_BED_DIFF_MORPH1 = + "facet.bedheight.diff.morph1"; + public static final String I18N_FACET_BED_DIFF_MORPH2 = + "facet.bedheight.diff.morph2"; + public static final String I18N_FACET_BED_DIFF_HEIGHT1 = + "facet.bedheight.diff.height1"; + public static final String I18N_FACET_BED_DIFF_HEIGHT1_RAW = + "facet.bedheight.diff.height1.raw"; + public static final String I18N_FACET_BED_DIFF_HEIGHT2 = + "facet.bedheight.diff.height2"; + public static final String I18N_FACET_BED_DIFF_HEIGHT2_RAW = + "facet.bedheight.diff.height2.raw"; - public static final String I18N_FACET_BED_DIFF_HEIGHT_RAW = "facet.bedheight.diff.height.raw"; + public static final String I18N_FACET_BED_DIFF_HEIGHT_RAW = + "facet.bedheight.diff.height.raw"; public DifferencesState() { } @@ -85,7 +97,8 @@ return res; } - BedDifferencesResult[] results = (BedDifferencesResult[]) res.getData(); + BedDifferencesResult[] results = + (BedDifferencesResult[])res.getData(); if (results == null || results.length == 0) { log.warn("Calculation computed no results!"); @@ -120,8 +133,10 @@ CallMeta meta = context.getMeta(); - newFacets.add(new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); - newFacets.add(new DataFacet(PDF, "PDF data", ComputeType.ADVANCE, hash, id)); + newFacets.add( + new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); + newFacets.add( + new DataFacet(PDF, "PDF data", ComputeType.ADVANCE, hash, id)); for (int idx = 0; idx < results.length; idx++) { if (results[idx] instanceof BedDiffYearResult) { newFacets.add(new BedDiffFacet( @@ -224,12 +239,18 @@ boolean raw ) { if (raw && ndx == 0) { - return Resources.getMsg(meta, I18N_FACET_BED_DIFF_HEIGHT_RAW, - I18N_FACET_BED_DIFF_HEIGHT_RAW, new Object[] {result.getNameFirst()}); + return Resources.getMsg( + meta, + I18N_FACET_BED_DIFF_HEIGHT_RAW, + I18N_FACET_BED_DIFF_HEIGHT_RAW, + new Object[] {result.getNameFirst()}); } if (raw && ndx == 1) { - return Resources.getMsg(meta, I18N_FACET_BED_DIFF_HEIGHT_RAW, - I18N_FACET_BED_DIFF_HEIGHT_RAW, new Object[] {result.getNameSecond()}); + return Resources.getMsg( + meta, + I18N_FACET_BED_DIFF_HEIGHT_RAW, + I18N_FACET_BED_DIFF_HEIGHT_RAW, + new Object[] {result.getNameSecond()}); } if (ndx == 0) { return result.getNameFirst(); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadDataCalculate.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadDataCalculate.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadDataCalculate.java Fri Jan 19 11:23:42 2018 +0100 @@ -39,14 +39,22 @@ private static final Logger log = Logger .getLogger(SedimentLoadDataCalculate.class); - public static final String I18N_FACET_SEDIMENTLOAD_COARSE = "facet.sedimentload.coarse"; - public static final String I18N_FACET_SEDIMENTLOAD_SAND = "facet.sedimentload.sand"; - public static final String I18N_FACET_SEDIMENTLOAD_FINE_MIDDLE = "facet.sedimentload.fine_middle"; - public static final String I18N_FACET_SEDIMENTLOAD_SUSPSAND = "facet.sedimentload.susp_sand"; - public static final String I18N_FACET_SEDIMENTLOAD_SUSPSANDBED = "facet.sediemntload.susp_sand_bed"; - public static final String I18N_FACET_SEDIMENTLOAD_SUSPSEDIMENT = "facet.sedimentload.susp_sediment"; - public static final String I18N_FACET_SEDIMENTLOAD_TOTAL_LOAD = "facet.sedimentload.total_load"; - public static final String I18N_FACET_SEDIMENTLOAD_TOTAL = "facet.sedimentload.total"; + public static final String I18N_FACET_SEDIMENTLOAD_COARSE = + "facet.sedimentload.coarse"; + public static final String I18N_FACET_SEDIMENTLOAD_SAND = + "facet.sedimentload.sand"; + public static final String I18N_FACET_SEDIMENTLOAD_FINE_MIDDLE = + "facet.sedimentload.fine_middle"; + public static final String I18N_FACET_SEDIMENTLOAD_SUSPSAND = + "facet.sedimentload.susp_sand"; + public static final String I18N_FACET_SEDIMENTLOAD_SUSPSANDBED = + "facet.sediemntload.susp_sand_bed"; + public static final String I18N_FACET_SEDIMENTLOAD_SUSPSEDIMENT = + "facet.sedimentload.susp_sediment"; + public static final String I18N_FACET_SEDIMENTLOAD_TOTAL_LOAD = + "facet.sedimentload.total_load"; + public static final String I18N_FACET_SEDIMENTLOAD_TOTAL = + "facet.sedimentload.total"; static { // Active/deactivate facets. diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadYearSelect.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadYearSelect.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadYearSelect.java Fri Jan 19 11:23:42 2018 +0100 @@ -44,7 +44,8 @@ public boolean validate(Artifact artifact) throws IllegalArgumentException { - SedimentLoadAccess access = new SedimentLoadAccess((D4EArtifact) artifact); + SedimentLoadAccess access = + new SedimentLoadAccess((D4EArtifact)artifact); // Second year should be later than first. if (access.getYears() == null || access.getYears().length == 0) diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/sq/SQInitState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/sq/SQInitState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/sq/SQInitState.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.artifacts.states.sq; import org.dive4elements.river.artifacts.states.DefaultState; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/sq/SQPeriodSelect.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/sq/SQPeriodSelect.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/sq/SQPeriodSelect.java Fri Jan 19 11:23:42 2018 +0100 @@ -40,7 +40,8 @@ RangeAccess access = new RangeAccess(arti); double km = access.getLocations()[0]; - SQOverview overview = SQOverviewFactory.getOverview(access.getRiverName()); + SQOverview overview = SQOverviewFactory.getOverview( + access.getRiverName()); /* Filter is not implemented and only checks if a complete * KMIndex list is acceptable or not. So KMFiltering wont work */ @@ -48,7 +49,9 @@ TreeSet allDates = new TreeSet(); for (int i = 0; i < entries.size(); i++) { - if (EpsilonComparator.CMP.compare(entries.get(i).getKm(), km) == 0) { + if (EpsilonComparator.CMP.compare(entries.get(i).getKm(), km) + == 0 + ) { allDates.addAll(entries.get(i).getValue()); } } @@ -56,7 +59,9 @@ return null; } - return minDate ? allDates.first().getTime() : allDates.last().getTime(); + return minDate + ? allDates.first().getTime() + : allDates.last().getTime(); } @Override diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/artifacts/states/sq/SQStaticState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/sq/SQStaticState.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/sq/SQStaticState.java Fri Jan 19 11:23:42 2018 +0100 @@ -63,7 +63,8 @@ ms = Integer.parseInt(measurementStation); } catch (NumberFormatException nfe) { - log.error("Unparseable measurement station: " + measurementStation); + log.error("Unparseable measurement station: " + + measurementStation); return null; } log.debug("Parsed measurement station: " + ms); @@ -71,7 +72,9 @@ sqRelations = StaticSQFactory.getSQRelationsForLocation(river, ms); DateFormat df = new SimpleDateFormat("yyyy"); - for (StaticSQRelation.Parameter p: StaticSQRelation.Parameter.values()) { + for ( + StaticSQRelation.Parameter p: StaticSQRelation.Parameter.values() + ) { log.debug("parameter: " + p.toString()); List relations = sqRelations.getRelationsByParameter(p); @@ -81,7 +84,8 @@ for (StaticSQRelation relation : relations) { log.debug("add facet for " + p.toString().toLowerCase()); - String name = "sq_" + p.toString().toLowerCase() + "_curve"; + String name = "sq_" + p.toString().toLowerCase() + + "_curve"; String desc = Resources.getMsg(context.getMeta(), FACET_DESCRIPTION, @@ -125,11 +129,12 @@ } if (static_id != -1) { - // If the next line fails a traceback is the best debug output anyhow + // If next line fails a traceback is the best debug output anyhow sqRelations = StaticSQFactory.getDistinctRelation(static_id); log.debug("Got a distinct relation" + sqRelations); } else { - StaticSQRelationAccess access = new StaticSQRelationAccess(artifact); + StaticSQRelationAccess access = + new StaticSQRelationAccess(artifact); String river = access.getRiverName(); String measurementStation = access.getMeasurementStation(); @@ -138,7 +143,8 @@ ms = Integer.parseInt(measurementStation); } catch (NumberFormatException nfe) { - log.error("Unparseable measurement station: " + measurementStation); + log.error("Unparseable measurement station: " + + measurementStation); return null; } log.debug("Parsed measurement station: " + ms); @@ -148,7 +154,9 @@ DateFormat df = new SimpleDateFormat("yyyy"); - for (StaticSQRelation.Parameter p: StaticSQRelation.Parameter.values()) { + for ( + StaticSQRelation.Parameter p: StaticSQRelation.Parameter.values() + ) { List relations = sqRelations.getRelationsByParameter(p); @@ -157,7 +165,8 @@ int count = 0; for (StaticSQRelation relation : relations) { - String name = "sq_" + p.toString().toLowerCase() + "_curve"; + String name = "sq_" + p.toString().toLowerCase() + + "_curve"; String desc = static_desc == null ? Resources.getMsg(meta, FACET_DESCRIPTION, diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/collections/AttributeWriter.java --- a/artifacts/src/main/java/org/dive4elements/river/collections/AttributeWriter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/collections/AttributeWriter.java Fri Jan 19 11:23:42 2018 +0100 @@ -165,7 +165,8 @@ throws ArtifactDatabaseException { if (compatibleFacets == null) { - log.warn("No compatible facets, not generating out " + outputName + "."); + log.warn("No compatible facets, not generating out " + + outputName + "."); return false; } @@ -208,7 +209,8 @@ genuinelyNewFacets.add(picked); } else { - log.debug("Skip clone facet that shall be present in two outs"); + log.debug( + "Skip clone facet that shall be present in two outs"); } } else { @@ -253,7 +255,7 @@ currentFacets.add(newMF); } - // Fill/correct "gaps" (e.g. position 1,2,5 are taken, after gap filling + // Fill "gaps" (e.g. position 1,2,5 are taken, after gap filling // expect positions 1,2,3 [5->3]) // Preparations to be able to detect gaps. Map mfmap = @@ -293,7 +295,10 @@ /** Returns true if a likely clone of facet is * contained in genuinelyNewFacets, as happens when same facet is defined * for two outs. */ - private boolean facetInTwoOuts(ManagedFacet facet, List genuinelyNewFacets) { + private boolean facetInTwoOuts( + ManagedFacet facet, + List genuinelyNewFacets + ) { for (ManagedFacet otherFacet: genuinelyNewFacets) { if (facet.isSame(otherFacet)) { return true; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/collections/D4EArtifactCollection.java --- a/artifacts/src/main/java/org/dive4elements/river/collections/D4EArtifactCollection.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/collections/D4EArtifactCollection.java Fri Jan 19 11:23:42 2018 +0100 @@ -231,7 +231,8 @@ try { // Save the merged document into database. - getArtifactDB().setCollectionAttribute(identifier(), getContext().getMeta(), doc); + getArtifactDB().setCollectionAttribute( + identifier(), getContext().getMeta(), doc); log.info("Saving CollectionAttribute was successful."); @@ -325,7 +326,7 @@ return null; } - // XXX NOTE: the outGen is not able to process its generate() operation, + // XXX NOTE: outGen is not able to process its generate() operation, // because it has no OutputStream set! Document dummy = XMLUtils.newDocument(); outGen.init(out, dummy, null, getContext()); @@ -382,7 +383,9 @@ // If type contains 'chartinfo' use a generator that // just allow access to width, height etc. - String key = type != null && !type.isEmpty() && type.indexOf("chartinfo") > 0 + String key = type != null + && !type.isEmpty() + && type.indexOf("chartinfo") > 0 ? type : name; @@ -440,7 +443,10 @@ * * @param generator The generator that gets a master Artifact. */ - protected void prepareMasterArtifact(D4EArtifact master, OutGenerator generator) { + protected void prepareMasterArtifact( + D4EArtifact master, + OutGenerator generator + ) { // Get master artifact. if (master != null) { log.debug("Set master Artifact to uuid: " + master.identifier()); @@ -464,7 +470,9 @@ identifier(), callMeta); String masterUUID = XMLUtils.xpathString( - document, XPATH_MASTER_UUID, ArtifactNamespaceContext.INSTANCE); + document, + XPATH_MASTER_UUID, + ArtifactNamespaceContext.INSTANCE); D4EArtifact masterArtifact = (D4EArtifact) getArtifact(masterUUID); return masterArtifact; @@ -574,7 +582,7 @@ * This method returns the list of artifact UUIDs that this collections * contains. * - * @param context The CallContext that is necessary to get information about + * @param context CallContext that is necessary to get information about * the ArtifactDatabase. * * @return a list of uuids. @@ -666,7 +674,9 @@ try { for (String uuid: getArtifactUUIDs()) { D4EArtifact subArt = (D4EArtifact) getArtifact(uuid); - if (subArt.getName() != null && subArt.getName().equals(name)) { + if ( + subArt.getName() != null && subArt.getName().equals(name) + ) { ret.add(subArt); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/collections/OutputParser.java --- a/artifacts/src/main/java/org/dive4elements/river/collections/OutputParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/collections/OutputParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -100,7 +100,8 @@ pos = o.getFacets().size() + 1; } - List mfacets = facet2ManagedFacet(uuid, out.getFacets(), pos); + List mfacets = facet2ManagedFacet( + uuid, out.getFacets(), pos); o.addFacets(mfacets); this.facets.addAll(mfacets); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/ATExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/ATExporter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ATExporter.java Fri Jan 19 11:23:42 2018 +0100 @@ -59,7 +59,12 @@ } @Override - public void init(String outName, Document request, OutputStream out, CallContext context) { + public void init( + String outName, + Document request, + OutputStream out, + CallContext context + ) { this.outName = outName; this.context = context; this.out = out; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/AbstractExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/AbstractExporter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/AbstractExporter.java Fri Jan 19 11:23:42 2018 +0100 @@ -37,7 +37,7 @@ /** - * An abstract exporter that implements some basic methods for exporting data of + * Abstract exporter that implements some basic methods for exporting data of * artifacts. * * @author Ingo Weinzierl @@ -244,7 +244,8 @@ * @return true, if facet is valid, otherwise false. */ protected boolean isFacetValid(String facet) { - log.debug("AbstractExporter.isFacetValid : " + facet + " (" + getFacet() + ")" ); + log.debug("AbstractExporter.isFacetValid : " + + facet + " (" + getFacet() + ")" ); String thisFacet = getFacet(); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/ChartExportHelper.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartExportHelper.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartExportHelper.java Fri Jan 19 11:23:42 2018 +0100 @@ -152,13 +152,17 @@ ChartRenderingInfo info = new ChartRenderingInfo(); - chart.draw(graphics, new Rectangle2D.Double(0.0D, 0.0D,size[0],size[1]), info); + chart.draw( + graphics, + new Rectangle2D.Double(0.0D, 0.0D,size[0],size[1]), + info); try { graphics.stream(new OutputStreamWriter(out, encoding)); } catch (SVGGraphics2DIOException svge) { - log.error("Error while writing svg export to output stream.", svge); + log.error( + "Error while writing svg export to output stream.", svge); } catch (UnsupportedEncodingException uee) { log.error("Unsupported encoding: " + encoding, uee); @@ -220,7 +224,8 @@ float spaceX = width - marginLeft - marginRight; if (size[0] > spaceX) { - log.warn("Width of the chart is too big for pdf -> resize it now."); + log.warn( + "Width of the chart is too big for pdf -> resize it now."); double ratio = ((double)spaceX) / size[0]; size[0] *= ratio; size[1] *= ratio; @@ -229,7 +234,8 @@ float spaceY = height - marginTop - marginBottom; if (size[1] > spaceY) { - log.warn("Height of the chart is too big for pdf -> resize it now."); + log.warn( + "Height of the chart is too big for pdf -> resize it now."); double ratio = ((double)spaceY) / size[1]; size[0] *= ratio; size[1] *= ratio; @@ -247,7 +253,8 @@ try { PdfWriter writer = PdfWriter.getInstance(document, out); - document.addSubject(chart.getTitle() != null ? chart.getTitle().getText() : ""); + document.addSubject( + chart.getTitle() != null ? chart.getTitle().getText() : ""); document.addCreationDate(); document.open(); @@ -422,7 +429,7 @@ /** - * This method returns the anchor of the chart so that the chart is centered + * Returns the anchor of the chart so that the chart is centered * according to the given parameters. * * @param mLeft Left margin diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -118,7 +118,7 @@ protected D4EArtifactCollection collection; - /** The artifact that is used to decorate the chart with meta information.*/ + /** Artifact that is used to decorate the chart with meta information.*/ protected Artifact master; /** The settings that should be used during output creation.*/ @@ -128,7 +128,8 @@ protected SortedMap datasets; /** List of annotations to insert in plot. */ - protected List annotations = new ArrayList(); + protected List annotations = + new ArrayList(); protected String outName; @@ -370,7 +371,12 @@ @Override - public void init(String outName, Document request, OutputStream out, CallContext context) { + public void init( + String outName, + Document request, + OutputStream out, + CallContext context + ) { log.debug("ChartGenerator.init"); this.outName = outName; @@ -410,7 +416,7 @@ /** - * Returns an instance of ChartSettings with a chart specific section + * Returns instance of ChartSettings with a chart specific section * but with no axes settings. * * @return an instance of ChartSettings. @@ -486,7 +492,7 @@ /** - * Creates a list of Sections that contains all axes of the chart (including + * Create list of Sections that contains all axes of the chart (including * X and Y axes). * * @return a list of Sections for each axis in this chart. @@ -959,7 +965,8 @@ Long lowerTime = as.getLowerTimeRange(); Long upperTime = as.getUpperTimeRange(); if ( lowerTime != null && upperTime != null ) { - log.debug("Using time range: " + lowerTime + " - " + upperTime); + log.debug("Using time range: " + + lowerTime + " - " + upperTime); return lowerTime < upperTime ? new Range(lowerTime, upperTime) : new Range(upperTime, lowerTime); @@ -1218,7 +1225,8 @@ } - /** Returns null if the (x|y)range-element was not found in request document. + /** Returns null if the (x|y)range-element was not found in + * request document. * This usally means that the axis are not manually zoomed, i.e. showing * full data extent. */ protected String[] getValueAxisRangeFromRequest() { @@ -1280,7 +1288,8 @@ Range.expandToInclude(axisDataset.getRange(), 0d)); } - setYBounds(axisIndex, expandPointRange(axisDataset.getRange())); + setYBounds( + axisIndex, expandPointRange(axisDataset.getRange())); // Add contained datasets, mapping to axis. for (XYDataset dataset: axisDataset.getDatasets()) { @@ -1411,7 +1420,8 @@ area.applyTheme(dRenderer); // i18n - dRenderer.setAreaLabelNumberFormat(Formatter.getFormatter(context.getMeta(), 2, 4)); + dRenderer.setAreaLabelNumberFormat( + Formatter.getFormatter(context.getMeta(), 2, 4)); dRenderer.setAreaLabelTemplate(Resources.getMsg( context.getMeta(), "area.label.template", "Area=%sm2")); @@ -1447,7 +1457,8 @@ } else if (range.getLowerBound() == range.getUpperBound()) { Range expandedRange = ChartHelper.expandRange(range, 5d); - return new DoubleBounds(expandedRange.getLowerBound(), expandedRange.getUpperBound()); + return new DoubleBounds( + expandedRange.getLowerBound(), expandedRange.getUpperBound()); } return new DoubleBounds(range.getLowerBound(), range.getUpperBound()); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator2.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator2.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator2.java Fri Jan 19 11:23:42 2018 +0100 @@ -119,7 +119,7 @@ protected D4EArtifactCollection collection; - /** The artifact that is used to decorate the chart with meta information.*/ + /** Artifact that is used to decorate the chart with meta information.*/ protected Artifact master; /** The settings that should be used during output creation.*/ @@ -132,7 +132,8 @@ protected SortedMap yAnnotations; /** List of annotations to insert in plot. */ - protected List annotations = new ArrayList(); + protected List annotations = + new ArrayList(); protected abstract List buildYAxisSections(); @@ -379,7 +380,12 @@ @Override - public void init(String outName, Document request, OutputStream out, CallContext context) { + public void init( + String outName, + Document request, + OutputStream out, + CallContext context + ) { log.debug("ChartGenerator2.init"); this.outName = outName; @@ -419,7 +425,7 @@ /** - * Returns an instance of ChartSettings with a chart specific section + * Return instance of ChartSettings with a chart specific section * but with no axes settings. * * @return an instance of ChartSettings. @@ -1183,7 +1189,8 @@ } - /** Returns null if the (x|y)range-element was not found in request document. + /** Returns null if the (x|y)range-element was not found in + *request document. * This usally means that the axis are not manually zoomed, i.e. showing * full data extent. */ protected String[] getValueAxisRangeFromRequest() { @@ -1381,7 +1388,8 @@ area.applyTheme(dRenderer); // i18n - dRenderer.setAreaLabelNumberFormat(Formatter.getFormatter(context.getMeta(), 2, 4)); + dRenderer.setAreaLabelNumberFormat( + Formatter.getFormatter(context.getMeta(), 2, 4)); dRenderer.setAreaLabelTemplate(Resources.getMsg( context.getMeta(), "area.label.template", "Area=%sm2")); @@ -1417,7 +1425,8 @@ } else if (range.getLowerBound() == range.getUpperBound()) { Range expandedRange = ChartHelper.expandRange(range, 5d); - return new DoubleBounds(expandedRange.getLowerBound(), expandedRange.getUpperBound()); + return new DoubleBounds( + expandedRange.getLowerBound(), expandedRange.getUpperBound()); } return new DoubleBounds(range.getLowerBound(), range.getUpperBound()); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/ChartInfoGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartInfoGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartInfoGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -81,7 +81,12 @@ * @param out * @param context */ - public void init(String outName, Document request, OutputStream out, CallContext context) { + public void init( + String outName, + Document request, + OutputStream out, + CallContext context + ) { this.out = out; generator.init(outName, request, out, context); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/ChartSettings.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartSettings.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartSettings.java Fri Jan 19 11:23:42 2018 +0100 @@ -229,14 +229,21 @@ section.setIdentifier(id); section.setLabel(label); - section.setFontSize(Integer.parseInt(fSize.length() > 0 ? fSize : "-1")); + section.setFontSize( + Integer.parseInt(fSize.length() > 0 ? fSize : "-1")); section.setFixed(Boolean.valueOf(fixation)); - if (upTime != null && !upTime.isEmpty() && lowTime != null && !lowTime.isEmpty()) { + if (upTime != null + && !upTime.isEmpty() + && lowTime != null + && !lowTime.isEmpty() + ) { section.setLowerTimeRange(Long.parseLong(lowTime)); section.setUpperTimeRange(Long.parseLong(upTime)); } else { - section.setLowerRange(Double.parseDouble(low.length() > 0 ? low : "0")); - section.setUpperRange(Double.parseDouble(up.length() > 0 ? up : "0")); + section.setLowerRange( + Double.parseDouble(low.length() > 0 ? low : "0")); + section.setUpperRange( + Double.parseDouble(up.length() > 0 ? up : "0")); } section.setSuggestedLabel(sugLabel); @@ -283,7 +290,8 @@ String vis = XMLUtils.xpathString(legend, "legend/visibility", null); String fSize = XMLUtils.xpathString(legend, "legend/font-size", null); - String lthre = XMLUtils.xpathString(legend, "legend/aggregation-threshold", null); + String lthre = XMLUtils.xpathString( + legend, "legend/aggregation-threshold", null); if (log.isDebugEnabled()) { log.debug("Found legend visibility: '" + vis + "'"); @@ -292,8 +300,10 @@ } section.setVisibility(Boolean.valueOf(vis)); - section.setFontSize(Integer.valueOf(fSize.length() > 0 ? fSize : "-1")); - section.setAggregationThreshold(Integer.valueOf(lthre.length() >0 ? lthre : "-1")); + section.setFontSize( + Integer.valueOf(fSize.length() > 0 ? fSize : "-1")); + section.setAggregationThreshold( + Integer.valueOf(lthre.length() >0 ? lthre : "-1")); target.setLegendSection(section); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java Fri Jan 19 11:23:42 2018 +0100 @@ -65,9 +65,12 @@ public static final String DEFAULT_CSV_W_HEADER = "W [NN + m]"; public static final String DEFAULT_CSV_Q_HEADER = "Q [m\u00b3/s]"; - public static final String PDF_HEADER_MODE = "export.computed.discharge.pdf.mode"; - public static final String PDF_HEADER_CALC_MODE = "export.computed.discharge.pdf.calc.mode"; - public static final String JASPER_FILE = "export.computed.discharge.pdf.file"; + public static final String PDF_HEADER_MODE = + "export.computed.discharge.pdf.mode"; + public static final String PDF_HEADER_CALC_MODE = + "export.computed.discharge.pdf.calc.mode"; + public static final String JASPER_FILE = + "export.computed.discharge.pdf.file"; protected List data; @@ -244,7 +247,8 @@ source.addMetaData("gauge", gaugeName); if (!Double.isNaN(gaugeDatum)) { NumberFormat mf = Formatter.getMeterFormat(context); - source.addMetaData("datum", mf.format(gaugeDatum) + " " + riverUnit); + source.addMetaData( + "datum", mf.format(gaugeDatum) + " " + riverUnit); } else { source.addMetaData("datum", ""); } @@ -270,7 +274,9 @@ PDF_HEADER_CALC_MODE, "Computed Discharge")); } else { - source.addMetaData("valid_since", validSince == null ? "" : df.format(validSince)); + source.addMetaData( + "valid_since", + validSince == null ? "" : df.format(validSince)); source.addMetaData("calculation", Resources.getMsg( locale, PDF_HEADER_MODE, diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/CrossSectionGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/CrossSectionGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/CrossSectionGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -117,7 +117,8 @@ @Override protected String getDefaultChartSubtitle() { List providers = - context.getDataProvider(CrossSectionFacet.BLACKBOARD_CS_MASTER_DATA); + context.getDataProvider( + CrossSectionFacet.BLACKBOARD_CS_MASTER_DATA); double km = 0d; if (providers.size() > 0) { FastCrossSectionLine csl = (FastCrossSectionLine) providers.get(0). @@ -208,21 +209,37 @@ // the lines and a text to display the type. fillPaint = colorForHYKZone(zone.getName()); - XYBoxAnnotation boxA = new XYBoxAnnotation(zone.getFrom(), area.atGround(), - zone.getTo(), area.ofGround(0.03f), basicStroke, tranPaint, fillPaint); - XYBoxAnnotation boxB = new XYBoxAnnotation(zone.getFrom(), area.atGround(), - zone.getTo(), area.atTop(), basicStroke, fillPaint, tranPaint); + XYBoxAnnotation boxA = new XYBoxAnnotation( + zone.getFrom(), + area.atGround(), + zone.getTo(), + area.ofGround(0.03f), + basicStroke, + tranPaint, + fillPaint); + XYBoxAnnotation boxB = new XYBoxAnnotation( + zone.getFrom(), + area.atGround(), + zone.getTo(), + area.atTop(), + basicStroke, + fillPaint, + tranPaint); - XYTextAnnotation tex = new XYTextAnnotation(zone.getName(), - zone.getFrom() + (zone.getTo() - zone.getFrom()) / 2.0d, - area.ofGround(0.015f)); + XYTextAnnotation tex = new XYTextAnnotation( + zone.getName(), + zone.getFrom() + (zone.getTo() - zone.getFrom()) / 2.0d, + area.ofGround(0.015f)); if (textStyle != null) { textStyle.apply(tex); } - plot.getRenderer().addAnnotation(boxA, org.jfree.ui.Layer.BACKGROUND); - plot.getRenderer().addAnnotation(boxB, org.jfree.ui.Layer.BACKGROUND); - plot.getRenderer().addAnnotation(tex, org.jfree.ui.Layer.BACKGROUND); + plot.getRenderer().addAnnotation( + boxA, org.jfree.ui.Layer.BACKGROUND); + plot.getRenderer().addAnnotation( + boxB, org.jfree.ui.Layer.BACKGROUND); + plot.getRenderer().addAnnotation( + tex, org.jfree.ui.Layer.BACKGROUND); } } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -291,10 +291,12 @@ */ java.net.URL imageURL; if (logo.equals("Intevation")) { - imageURL = DiagramGenerator.class.getResource("/images/intevation.png"); + imageURL = DiagramGenerator.class.getResource( + "/images/intevation.png"); } else { // TODO else if ... - imageURL = DiagramGenerator.class.getResource("/images/bfg_logo.gif"); + imageURL = DiagramGenerator.class.getResource( + "/images/bfg_logo.gif"); } imageIcon = new ImageIcon(imageURL); @@ -314,7 +316,8 @@ yPos = (Double)getYBounds(0).getLower(); } else if (placev.equals("center")) { - yPos = ((Double)getYBounds(0).getUpper() + (Double)getYBounds(0).getLower())/2d; + yPos = ((Double)getYBounds(0).getUpper() + + (Double)getYBounds(0).getLower())/2d; } else { log.debug("Unknown place-v value: " + placev); @@ -330,7 +333,8 @@ xPos = getRightX(); } else if (placeh.equals("center")) { - xPos = ((Double)getXBounds(0).getUpper() + (Double)getXBounds(0).getLower())/2d; + xPos = ((Double)getXBounds(0).getUpper() + + (Double)getXBounds(0).getLower())/2d; } else { log.debug("Unknown place-h value: " + placeh); @@ -376,7 +380,8 @@ XYAnnotation xyannotation = new XYImageAnnotation(xPos, yPos, imageIcon.getImage(), anchor); - plot.getRenderer().addAnnotation(xyannotation, org.jfree.ui.Layer.BACKGROUND); + plot.getRenderer().addAnnotation( + xyannotation, org.jfree.ui.Layer.BACKGROUND); } @@ -456,9 +461,14 @@ * Registers an area to be drawn. * @param area Area to be drawn. * @param axisName Name of the axis. - * @param visible Whether or not to be visible (important for range calculations). + * @param visible Whether or not to be visible + * (important for range calculations). */ - public void addAreaSeries(StyledAreaSeriesCollection area, String axisName, boolean visible) { + public void addAreaSeries( + StyledAreaSeriesCollection area, + String axisName, + boolean visible + ) { addAreaSeries(area, diagramAttributes.getAxisIndex(axisName), visible); } @@ -466,9 +476,14 @@ * Registers an area to be drawn. * @param area Area to be drawn. * @param index 'axis index' - * @param visible Whether or not to be visible (important for range calculations). + * @param visible Whether or not to be visible + * (important for range calculations). */ - public void addAreaSeries(StyledAreaSeriesCollection area, int index, boolean visible) { + public void addAreaSeries( + StyledAreaSeriesCollection area, + int index, + boolean visible + ) { if (area == null) { log.warn("Cannot yet render above/under curve."); return; @@ -510,12 +525,22 @@ * @param axisName name of the axis. * @param visible whether or not the data should be plotted. */ - public void addAxisSeries(XYSeries series, String axisName, boolean visible) { - addAxisSeries(series, diagramAttributes.getAxisIndex(axisName), visible); + public void addAxisSeries( + XYSeries series, + String axisName, + boolean visible + ) { + addAxisSeries( + series, diagramAttributes.getAxisIndex(axisName), visible); } - public void addAxisDataset(XYDataset dataset, String axisName, boolean visible) { - addAxisDataset(dataset, diagramAttributes.getAxisIndex(axisName), visible); + public void addAxisDataset( + XYDataset dataset, + String axisName, + boolean visible + ) { + addAxisDataset( + dataset, diagramAttributes.getAxisIndex(axisName), visible); } /** @@ -656,7 +681,8 @@ if (b != null && b.getLower().equals(b.getUpper())) { - log.debug("Check whether to expand a x axis.i ("+b.getLower() + "-" + b.getUpper()+")"); + log.debug("Check whether to expand a x axis.i (" + + b.getLower() + "-" + b.getUpper() + ")"); setXBounds(key, ChartHelper.expandBounds(b, 5)); } } @@ -788,8 +814,12 @@ * * @return true, if a zoom range was specified, otherwise false. */ - protected boolean zoom(XYPlot plot, ValueAxis axis, Bounds bounds, Range x) { - + protected boolean zoom( + XYPlot plot, + ValueAxis axis, + Bounds bounds, + Range x + ) { if (bounds == null) { return false; } @@ -990,7 +1020,8 @@ * @return hash for given legenditem to identify mergeables. */ public static String legendItemHash(LegendItem li) { - // TODO Do proper implementation. Ensure that only mergable sets are created. + // TODO Do proper implementation. + // Ensure that only mergable sets are created. // getFillPaint() // getFillPaintTransformer() // getLabel() @@ -1104,7 +1135,9 @@ } return label; } - for (Processor pr: diagramAttributes.getProcessorsForAxisName(axisName)) { + for ( + Processor pr: diagramAttributes.getProcessorsForAxisName(axisName) + ) { String label = pr.getAxisLabel(this); if (label != null) { return label; @@ -1122,7 +1155,8 @@ protected List buildYAxisSections() { List axisSections = new ArrayList(); - List axesAttrs = diagramAttributes.getAxesAttributes(); + List axesAttrs = + diagramAttributes.getAxesAttributes(); for (int i = 0, n = axesAttrs.size(); i < n; i++) { AxisSection ySection = new AxisSection(); @@ -1208,7 +1242,8 @@ if (visible) { // Save the label that should be added for this processor - int axisIdx = diagramAttributes.getAxisIndex(pr.getAxisName()); + int axisIdx = diagramAttributes.getAxisIndex( + pr.getAxisName()); LinkedHashSet curLabels = axesLabels.get(axisIdx); if (curLabels == null) { curLabels = new LinkedHashSet(5); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -81,7 +81,11 @@ /** * Returns the PNP (Datum) of gauge, if at gauge, 0 otherwise. */ - public static double getCurrentGaugeDatum(double km, D4EArtifact artifact, double tolerance) { + public static double getCurrentGaugeDatum( + double km, + D4EArtifact artifact, + double tolerance + ) { // Look if there is a gauge at chosen km: // Get gauge which is defined for km Gauge gauge = new RiverAccess(artifact).getRiver() @@ -154,22 +158,27 @@ fixedWinMRange.getUpperBound()); } - log.debug("Syncing Axis Bounds. Bounds W: " + boundsInMGauge.toString() + - " Bounds Wcm: " + boundsInCM.toString()); + log.debug("Syncing Axis Bounds. Bounds W: " + + boundsInMGauge.toString() + + " Bounds Wcm: " + boundsInCM.toString()); double datum = getCurrentGaugeDatum(); // Convert boundsInMGauge to Datum+cm - double convertedLower = ((Double)boundsInMGauge.getLower() - datum) * 100; - double convertedUpper = ((Double)boundsInMGauge.getUpper() - datum) * 100; - Bounds convertedBounds = new DoubleBounds(convertedLower, convertedUpper); + double convertedLower = + ((Double)boundsInMGauge.getLower() - datum) * 100; + double convertedUpper = + ((Double)boundsInMGauge.getUpper() - datum) * 100; + Bounds convertedBounds = + new DoubleBounds(convertedLower, convertedUpper); // Now combine both Ranges boundsInCM = boundsInCM.combine(convertedBounds); // Recalculate absolute bounds - boundsInMGauge = new DoubleBounds((Double)boundsInCM.getLower() / 100d + datum, - (Double)boundsInCM.getUpper() / 100d + datum); + boundsInMGauge = new DoubleBounds( + (Double)boundsInCM.getLower() / 100d + datum, + (Double)boundsInCM.getUpper() / 100d + datum); // Set the new combined bounds setYBounds(YAXIS.W.idx, boundsInMGauge); @@ -222,7 +231,12 @@ /* TODO is this one really needed? */ @Override - protected boolean zoomX(XYPlot plot, ValueAxis axis, Bounds bounds, Range x) { + protected boolean zoomX( + XYPlot plot, + ValueAxis axis, + Bounds bounds, + Range x + ) { boolean zoomin = super.zoom(plot, axis, bounds, x); if (!zoomin) { @@ -240,12 +254,16 @@ log.debug("Translate some river annotation."); double translate = getCurrentGaugeDatum(); double factor = 100d; - for (StickyAxisAnnotation annotation: riverAnnotation.getAxisTextAnnotations()){ + for (StickyAxisAnnotation annotation: + riverAnnotation.getAxisTextAnnotations() + ){ if (!annotation.atX()) { annotation.setPos((annotation.getPos() - translate)*factor); } } - for (XYTextAnnotation annotation: riverAnnotation.getTextAnnotations()) { + for ( + XYTextAnnotation annotation: riverAnnotation.getTextAnnotations() + ) { annotation.setY((annotation.getY() - translate)*factor); } } @@ -260,10 +278,12 @@ String name = artifactFacet.getFacetName(); log.debug("DischargeCurveGenerator.doOut: " + name); - MiscDischargeProcessor dProcessor = new MiscDischargeProcessor(getRange()[0]); + MiscDischargeProcessor dProcessor = new MiscDischargeProcessor( + getRange()[0]); if (dProcessor.canHandle(name)) { // In Base DischargeCurveGenerator, always at gauge, use WCm axis. - dProcessor.doOut(this, artifactFacet, theme, visible, YAXIS.WCm.idx); + dProcessor.doOut( + this, artifactFacet, theme, visible, YAXIS.WCm.idx); } else if (name.equals(DISCHARGE_CURVE) || name.equals(GAUGE_DISCHARGE_CURVE)) { @@ -286,7 +306,8 @@ visible); } else { - log.warn("DischargeCurveGenerator.doOut: Unknown facet name: " + name); + log.warn("DischargeCurveGenerator.doOut: Unknown facet name: " + + name); return; } } @@ -408,7 +429,8 @@ // If no Q values (i.e. all -1) found, add annotations. if (hasNoDischarge(data)) { - List xy = new ArrayList(); + List xy = + new ArrayList(); for (double y: data[1]) { if (translate != 0d) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/DurationCurveGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/DurationCurveGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/DurationCurveGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -134,7 +134,12 @@ @Override - protected boolean zoomX(XYPlot plot, ValueAxis axis, Bounds bounds, Range x) { + protected boolean zoomX( + XYPlot plot, + ValueAxis axis, + Bounds bounds, + Range x + ) { boolean zoomin = super.zoom(plot, axis, bounds, x); if (!zoomin) { @@ -153,7 +158,12 @@ * values on its own. */ @Override - protected boolean zoomY(XYPlot plot, ValueAxis axis, Bounds bounds, Range x) { + protected boolean zoomY( + XYPlot plot, + ValueAxis axis, + Bounds bounds, + Range x + ) { boolean zoomin = super.zoom(plot, axis, bounds, x); if (!zoomin && axis instanceof IdentifiableNumberAxis) { @@ -258,7 +268,8 @@ ){ log.debug("DurationCurveGenerator.doPointOut"); - XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); + XYSeries series = + new StyledXYSeries(aandf.getFacetDescription(), theme); series.add(point.getX(), point.getY()); @@ -310,6 +321,7 @@ }; } - // MainValue-Annotations should be visualized by a line that goes to the curve itself. + // MainValue-Annotations should be visualized by + // a line that goes to the curve itself. } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityExporter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityExporter.java Fri Jan 19 11:23:42 2018 +0100 @@ -110,10 +110,14 @@ String vMain = ""; String vTotal = ""; - if (data.getType().equals("main") || data.getType().equals("main_total")) { + if (data.getType().equals("main") + || data.getType().equals("main_total") + ) { vMain = valF.format(data.getVMain(i)); } - if (data.getType().equals("total") || data.getType().equals("main_total")) { + if (data.getType().equals("total") + || data.getType().equals("main_total") + ) { vTotal = valF.format(data.getVTotal(i)); } writer.writeNext(new String[] { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/GeneratorLookup.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/GeneratorLookup.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/GeneratorLookup.java Fri Jan 19 11:23:42 2018 +0100 @@ -24,7 +24,11 @@ private Object ctx; private List cis; - public Item(Class generator, Object ctx, List cis) { + public Item( + Class generator, + Object ctx, + List cis + ) { this.generator = generator; this.ctx = ctx; this.cis = cis; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveExporter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveExporter.java Fri Jan 19 11:23:42 2018 +0100 @@ -92,7 +92,8 @@ log.debug("Internal data of CalculationResult: " + d.getClass()); if (d instanceof HistoricalDischargeData) { - d = (WQTimerange[]) ((HistoricalDischargeData) d).getWQTimeranges(); + d = (WQTimerange[])((HistoricalDischargeData)d) + .getWQTimeranges(); if (d instanceof WQTimerange[]) { log.debug("Add new data of type WQTimerange"); @@ -145,12 +146,14 @@ protected void writeCSVHeader(CSVWriter writer) { - HistoricalDischargeAccess hda = new HistoricalDischargeAccess((D4EArtifact) master); + HistoricalDischargeAccess hda = + new HistoricalDischargeAccess((D4EArtifact) master); writer.writeNext(new String[] { msg(CSV_TIMERANGE_HEADER, CSV_TIMERANGE_HEADER), msg(CSV_WATERLEVEL_HEADER, CSV_WATERLEVEL_HEADER), msg(CSV_DISCHARGE_HEADER, CSV_DISCHARGE_HEADER), - (hda.getEvaluationMode() == HistoricalDischargeAccess.EvaluationMode.W) + (hda.getEvaluationMode() + == HistoricalDischargeAccess.EvaluationMode.W) ? msg(CSV_DIFF_HEADER_W, CSV_DIFF_HEADER_W) : msg(CSV_DIFF_HEADER_Q, CSV_DIFF_HEADER_Q), msg(CSV_GAUGENAME_HEADER, CSV_GAUGENAME_HEADER) diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -47,15 +47,20 @@ private static Logger log = Logger .getLogger(HistoricalDischargeCurveGenerator.class); - public static final String I18N_CHART_TITLE = "chart.historical.discharge.title"; - - public static final String I18N_CHART_SUBTITLE = "chart.historical.discharge.subtitle"; + public static final String I18N_CHART_TITLE = + "chart.historical.discharge.title"; - public static final String I18N_XAXIS_LABEL = "chart.historical.discharge.xaxis.label"; + public static final String I18N_CHART_SUBTITLE = + "chart.historical.discharge.subtitle"; - public static final String I18N_YAXIS_LABEL = "chart.historical.discharge.yaxis.label"; + public static final String I18N_XAXIS_LABEL = + "chart.historical.discharge.xaxis.label"; - public static final String I18N_YAXIS_SECOND_LABEL = "chart.historical.discharge.yaxis.second.label"; + public static final String I18N_YAXIS_LABEL = + "chart.historical.discharge.yaxis.label"; + + public static final String I18N_YAXIS_SECOND_LABEL = + "chart.historical.discharge.yaxis.second.label"; public static enum YAXIS { W(0), Q(1); @@ -159,7 +164,8 @@ } else if (FacetTypes.IS.MANUALPOINTS(name)) { HistoricalDischargeAccess.EvaluationMode mode = - new HistoricalDischargeAccess((D4EArtifact)getMaster()).getEvaluationMode(); + new HistoricalDischargeAccess( + (D4EArtifact)getMaster()).getEvaluationMode(); int axis = mode == HistoricalDischargeAccess.EvaluationMode.W ? YAXIS.Q.idx : YAXIS.W.idx; @@ -228,7 +234,11 @@ * looks like a "step chart". */ protected TimeSeriesCollection newTimeSeriesCollection( - Timerange[] timeranges, double[] values, ThemeDocument theme, String desc) { + Timerange[] timeranges, + double[] values, + ThemeDocument theme, + String desc + ) { log.debug("Create new TimeSeriesCollection for: " + desc); TimeSeriesCollection tsc = new TimeSeriesCollection(); @@ -263,7 +273,8 @@ } /** - * Creates an array that consists of two FixedMillisecond periods [start, end]. + * Create array that consists of two + * FixedMillisecond periods [start, end]. * * @param timerange * Supports start and end time. @@ -274,7 +285,9 @@ Date start = new Date(timerange.getStart()); Date end = new Date(timerange.getEnd() - 1000 * 60 * 60 * 24); - return new RegularTimePeriod[] { new FixedMillisecond(start), new FixedMillisecond(end) }; + return new RegularTimePeriod[] { + new FixedMillisecond(start), + new FixedMillisecond(end) }; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/LegendProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/LegendProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/LegendProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -38,7 +38,8 @@ * @return hash for given legenditem to identify mergeables. */ protected static String legendItemHash(LegendItem li) { - // TODO Do proper implementation. Ensure that only mergable sets are created. + // TODO Do proper implementation. + // Ensure that only mergable sets are created. // getFillPaint() // getFillPaintTransformer() // getLabel() @@ -86,7 +87,8 @@ return; } - HashMap> entries = new LinkedHashMap>(); + HashMap> entries = + new LinkedHashMap>(); for (Iterator i = old.iterator(); i.hasNext();) { LegendItem item = i.next(); String hash = legendItemHash(item); @@ -114,8 +116,9 @@ if (itemList.size() >= AGGR_THRESHOLD) { // Now do merging. // XXX: DEAD CODE // LegendItem item = itemList.get(0); - // Unfortunately we cannot clone and just setDescription, as this - // method was added in JFreeChart 1.0.14 (we are at .13). + // Unfortunately we cannot clone and just setDescription, + // as this method was added in JFreeChart 1.0.14 + // (we are at .13). // Remove the shapes of all but the first items, // to prevent "overfill" of legenditemblock. @@ -125,11 +128,21 @@ // Make shape and line really small. LegendItem merged = new LegendItem( - "," + litem.getLabel(), litem.getDescription(), litem.getToolTipText(), - litem.getURLText(), false, SPACE, - false, litem.getFillPaint(), false, - litem.getOutlinePaint(), litem.getOutlineStroke(), false, - SPACE, litem.getLineStroke(), litem.getLinePaint()); + "," + litem.getLabel(), + litem.getDescription(), + litem.getToolTipText(), + litem.getURLText(), + false, + SPACE, + false, + litem.getFillPaint(), + false, + litem.getOutlinePaint(), + litem.getOutlineStroke(), + false, + SPACE, + litem.getLineStroke(), + litem.getLinePaint()); newLegend.add(merged); } else { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -92,7 +92,8 @@ public static final String I18N_2YAXIS_LABEL = "chart.longitudinal.section.yaxis.second.label"; - public static final String I18N_CHART_TITLE_DEFAULT = "W-L\u00e4ngsschnitt"; + public static final String I18N_CHART_TITLE_DEFAULT = + "W-L\u00e4ngsschnitt"; public static final String I18N_XAXIS_LABEL_DEFAULT = "km"; public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]"; public static final String I18N_2YAXIS_LABEL_DEFAULT = "Q [m\u00b3/s]"; @@ -228,7 +229,8 @@ label = msg(getQAxisLabelKey(), getQAxisDefaultLabel()); } else if (index == YAXIS.D.idx) { - label = msg(I18N_WDIFF_YAXIS_LABEL, I18N_WDIFF_YAXIS_LABEL_DEFAULT); + label = msg( + I18N_WDIFF_YAXIS_LABEL, I18N_WDIFF_YAXIS_LABEL_DEFAULT); } return label; @@ -345,19 +347,24 @@ Processor annotationProcessor = new AnnotationProcessor(); if (wProcessor.canHandle(name)) { - wProcessor.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx); + wProcessor.doOut( + this, artifactAndFacet, attr, visible, YAXIS.W.idx); } if (qProcessor.canHandle(name)) { - qProcessor.doOut(this, artifactAndFacet, attr, visible, YAXIS.Q.idx); + qProcessor.doOut( + this, artifactAndFacet, attr, visible, YAXIS.Q.idx); } else if (bdyProcessor.canHandle(name)) { - bdyProcessor.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx); + bdyProcessor.doOut( + this, artifactAndFacet, attr, visible, YAXIS.W.idx); } else if (bdhyProcessor.canHandle(name)) { - bdhyProcessor.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx); + bdhyProcessor.doOut( + this, artifactAndFacet, attr, visible, YAXIS.W.idx); } else if (annotationProcessor.canHandle(name)) { - annotationProcessor.doOut(this, artifactAndFacet, attr, visible, 0); + annotationProcessor.doOut( + this, artifactAndFacet, attr, visible, 0); } else if (name.equals(W_DIFFERENCES)) { doWDifferencesOut( @@ -402,7 +409,8 @@ return; } - XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); + XYSeries series = + new StyledXYSeries(aandf.getFacetDescription(), theme); if (log.isDebugEnabled()) { if (wkms.size() > 0) { @@ -473,20 +481,24 @@ up = new StyledXYSeries(seriesName, false, theme); if (data.getUpperData() instanceof WQKms) { if (FacetTypes.IS.Q(data.getUpperFacetName())) { - StyledSeriesBuilder.addPointsKmQ(up, (WQKms) data.getUpperData()); + StyledSeriesBuilder.addPointsKmQ( + up, (WQKms)data.getUpperData()); } else { - StyledSeriesBuilder.addPoints(up, (WKms) data.getUpperData()); + StyledSeriesBuilder.addPoints( + up, (WKms) data.getUpperData()); } } else if (data.getUpperData() instanceof double[][]) { - StyledSeriesBuilder.addPoints(up, (double [][]) data.getUpperData(), false); + StyledSeriesBuilder.addPoints( + up, (double [][]) data.getUpperData(), false); } else if (data.getUpperData() instanceof WKms) { StyledSeriesBuilder.addPoints(up, (WKms) data.getUpperData()); } else if (data.getUpperData() instanceof Lines.LineData) { - StyledSeriesBuilder.addPoints(up, ((Lines.LineData) data.getUpperData()).points, false); + StyledSeriesBuilder.addPoints( + up, ((Lines.LineData) data.getUpperData()).points, false); } else { log.error("Do not know how to deal with (up) area info from: " @@ -494,7 +506,8 @@ } } - // TODO Depending on style, the area (e.g. 20m^2) should be added as annotation. + // TODO Depending on style, the area (e.g. 20m^2) + // should be added as annotation. if (data.getLowerData() != null) { // TODO: Sort this out: when the two series have the same name, @@ -502,23 +515,31 @@ down = new StyledXYSeries(seriesName + " ", false, theme); if (data.getLowerData() instanceof WQKms) { if (FacetTypes.IS.Q(data.getLowerFacetName())) { - StyledSeriesBuilder.addPointsKmQ(down, (WQKms) data.getLowerData()); + StyledSeriesBuilder.addPointsKmQ( + down, (WQKms) data.getLowerData()); } else { - StyledSeriesBuilder.addPoints(down, (WQKms) data.getLowerData()); + StyledSeriesBuilder.addPoints( + down, (WQKms) data.getLowerData()); } } else if (data.getLowerData() instanceof double[][]) { - StyledSeriesBuilder.addPoints(down, (double[][]) data.getLowerData(), false); + StyledSeriesBuilder.addPoints( + down, (double[][]) data.getLowerData(), false); } else if (data.getLowerData() instanceof WKms) { - StyledSeriesBuilder.addPoints(down, (WKms) data.getLowerData()); + StyledSeriesBuilder.addPoints( + down, (WKms) data.getLowerData()); } else if (data.getLowerData() instanceof Lines.LineData) { - StyledSeriesBuilder.addPoints(down, ((Lines.LineData) data.getLowerData()).points, false); + StyledSeriesBuilder.addPoints( + down, + ((Lines.LineData) data.getLowerData()).points, + false); } else { - log.error("Do not know how to deal with (down) area info from: " + log.error( + "Do not know how to deal with (down) area info from: " + data.getLowerData()); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java Fri Jan 19 11:23:42 2018 +0100 @@ -27,7 +27,8 @@ public class LongitudinalSectionGenerator2 extends DiagramGenerator { - private static Logger log = Logger.getLogger(LongitudinalSectionGenerator2.class); + private static Logger log = Logger.getLogger( + LongitudinalSectionGenerator2.class); /** Wrapper around the doOut info for postprocessing. */ protected static class SuperBundle @@ -35,7 +36,11 @@ public ArtifactAndFacet bundle; public ThemeDocument theme; boolean visible; - public SuperBundle(ArtifactAndFacet bundle, ThemeDocument theme, boolean visible) { + public SuperBundle( + ArtifactAndFacet bundle, + ThemeDocument theme, + boolean visible + ) { this.bundle = bundle; this.theme = theme; this.visible = visible; @@ -153,7 +158,10 @@ calculateRadius(); // This calculates the real start and end km's for (SuperBundle superbundle: postOutAF) { - super.doOut(superbundle.bundle, superbundle.theme, superbundle.visible); + super.doOut( + superbundle.bundle, + superbundle.theme, + superbundle.visible); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -73,7 +73,12 @@ } @Override - public void init(String outName, Document request, OutputStream out, CallContext context) { + public void init( + String outName, + Document request, + OutputStream out, + CallContext context + ) { log.debug("MapGenerator.init"); this.outName = outName; @@ -150,13 +155,22 @@ try { if(wms instanceof WSPLGENLayerFacet) { // Retrieve waterlevel ground differences from artifact - StateData dFrom = flys.getData(WaterlevelGroundDifferences.LOWER_FIELD); - StateData dTo = flys.getData(WaterlevelGroundDifferences.UPPER_FIELD); - StateData dStep = flys.getData(WaterlevelGroundDifferences.DIFF_FIELD); + StateData dFrom = + flys.getData(WaterlevelGroundDifferences.LOWER_FIELD); + StateData dTo = + flys.getData(WaterlevelGroundDifferences.UPPER_FIELD); + StateData dStep = + flys.getData(WaterlevelGroundDifferences.DIFF_FIELD); - String fromStr = dFrom != null ? (String) dFrom.getValue() : null; - String toStr = dTo != null ? (String) dTo.getValue() : null; - String stepStr = dStep != null ? (String) dStep.getValue() : null; + String fromStr = dFrom != null + ? (String) dFrom.getValue() + : null; + String toStr = dTo != null + ? (String) dTo.getValue() + : null; + String stepStr = dStep != null + ? (String) dStep.getValue() + : null; float from = Float.parseFloat(fromStr); float to = Float.parseFloat(toStr); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/OutGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/OutGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/OutGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -43,7 +43,12 @@ * @param context The CallContext that provides further information and * objects used for the output generation. */ - void init(String outName, Document request, OutputStream out, CallContext context); + void init( + String outName, + Document request, + OutputStream out, + CallContext context + ); /** * This method is used to tell the OutGenerator which artifact is the master @@ -64,8 +69,8 @@ * Creates the output of an Artifact and appends that single output to the * total output. * - * @param bundle The Facet and artifact that provides information and data for the - * single output. + * @param bundle The Facet and artifact that provides information and + * data for the single output. * @param attr A document that might contain some attributes used while * producing the output. * @param visible Specifies, if this output should be visible or not. @@ -80,7 +85,7 @@ void generate() throws IOException; /** - * This method is used to set a Settings object for the Output + * Used to set a Settings object for the Output * that is produced by this OutGenerator. * * @param settings The Settings that might be used while diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java Fri Jan 19 11:23:42 2018 +0100 @@ -57,7 +57,10 @@ this.masterArtifact = masterArtifact; } - private static List getContextInjectors(CallContext context, String out) { + private static List getContextInjectors( + CallContext context, + String out + ) { RiverContext flysContext = context instanceof RiverContext ? (RiverContext)context : (RiverContext)context.globalContext(); @@ -189,7 +192,8 @@ Document attr = db.getCollectionItemAttribute(identifier, uuid, meta); if (attr == null) { - attr = initItemAttribute(uuid, facet, pattern, index, outName, context); + attr = initItemAttribute( + uuid, facet, pattern, index, outName, context); if (attr == null) { return null; @@ -227,7 +231,8 @@ vars); if (theme == null) { - log.warn("Could not find the theme in attribute of: " + facet + " " + uuid); + log.warn("Could not find the theme in attribute of: " + + facet + " " + uuid); Theme t = getThemeForFacet( uuid, facet, pattern, index, outName, context); @@ -364,11 +369,14 @@ Artifact artifact = getArtifact(uuid, context); D4EArtifact flys = (D4EArtifact) artifact; Facet face = flys.getNativeFacet(theme, outname); - log.debug("Looking for Native Facet for theme: " + theme + " and out: " + - outname + " in artifact: " + uuid + - face == null ? " Found. " : " Not Found. "); + log.debug("Looking for Native Facet for theme: " + + theme + " and out: " + + outname + " in artifact: " + uuid + + face == null ? " Found. " : " Not Found. "); if (face == null) { - log.warn("Theme " + theme.getName() + " for " + outname + " has no facets!. Removing theme."); + log.warn("Theme " + theme.getName() + + " for " + outname + + " has no facets!. Removing theme."); themeList.remove(i); i--; continue; @@ -437,7 +445,8 @@ log.debug("OutputHelper.initItemAttribute"); } - Theme t = getThemeForFacet(uuid, facet, pattern, index, outName, context); + Theme t = getThemeForFacet( + uuid, facet, pattern, index, outName, context); if (t == null) { log.info("Could not find theme for facet. Cancel initialization."); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/ReferenceCurveExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/ReferenceCurveExporter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ReferenceCurveExporter.java Fri Jan 19 11:23:42 2018 +0100 @@ -70,16 +70,25 @@ public static final String DEFAULT_CSV_LOCATION_HEADER = "Lage"; - public static final String RC_DEFAULT_CSV_KM_HEADER = "Fluss-Km"; - public static final String RC_DEFAULT_CSV_W_M_HEADER = "W (m + NHN)"; - public static final String RC_DEFAULT_CSV_W_CM_HEADER = "W (cm am Pegel)"; - public static final String RC_DEFAULT_CSV_Q_HEADER = "gleichw. Q (m\u00b3/s)"; + public static final String RC_DEFAULT_CSV_KM_HEADER = + "Fluss-Km"; + public static final String RC_DEFAULT_CSV_W_M_HEADER = + "W (m + NHN)"; + public static final String RC_DEFAULT_CSV_W_CM_HEADER = + "W (cm am Pegel)"; + public static final String RC_DEFAULT_CSV_Q_HEADER = + "gleichw. Q (m\u00b3/s)"; - public static final String PDF_HEADER_MODE = "export.reference_curve.pdf.mode"; - public static final String JASPER_FILE = "export.reference_curve.pdf.file"; - public static final String JASPER_FILE_GAUGE = "export.reference_curve.pdf.file.gauge"; - public static final String JASPER_FILE_GAUGE_END = "export.reference_curve.pdf.file.gauge.end"; - public static final String JASPER_FILE_GAUGE_START_END = "export.reference_curve.pdf.file.gauge.start.end"; + public static final String PDF_HEADER_MODE = + "export.reference_curve.pdf.mode"; + public static final String JASPER_FILE = + "export.reference_curve.pdf.file"; + public static final String JASPER_FILE_GAUGE = + "export.reference_curve.pdf.file.gauge"; + public static final String JASPER_FILE_GAUGE_END = + "export.reference_curve.pdf.file.gauge.end"; + public static final String JASPER_FILE_GAUGE_START_END = + "export.reference_curve.pdf.file.gauge.start.end"; /** The storage that contains all WKms objects for the different facets. */ protected List data; @@ -111,7 +120,8 @@ generatePDF(); } else { - throw new IOException("invalid facet (" + facet + ") for exporter"); + throw new IOException( + "invalid facet (" + facet + ") for exporter"); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/ReferenceCurveGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/ReferenceCurveGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ReferenceCurveGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -169,7 +169,8 @@ } else if (name.equals(MAINVALUES_W)) { doAnnotations( - ((RiverAnnotation) artifactFacet.getData(context)).flipStickyAxis(), + ((RiverAnnotation)artifactFacet.getData(context)) + .flipStickyAxis(), artifactFacet, theme, visible); @@ -223,7 +224,8 @@ ){ log.debug("ReferenceCurveGenerator.doPointOut"); - XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); + XYSeries series = + new StyledXYSeries(aandf.getFacetDescription(), theme); series.add(point.getX(), point.getY()); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/ReportGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/ReportGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ReportGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -47,7 +47,12 @@ } @Override - public void init(String outName, Document request, OutputStream out, CallContext context) { + public void init( + String outName, + Document request, + OutputStream out, + CallContext context + ) { log.debug("init"); this.outName = outName; this.out = out; @@ -102,7 +107,7 @@ /** - * This method is not implemented. Override it in subclasses if those need a + * Not implemented. Override it in subclasses if those need a * Settings object. */ public void setSettings(Settings settings) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/ShapeExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/ShapeExporter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ShapeExporter.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.exports; import java.io.File; @@ -37,7 +45,12 @@ } @Override - public void init(String outName, Document request, OutputStream out, CallContext context) { + public void init( + String outName, + Document request, + OutputStream out, + CallContext context + ) { this.outName = outName; this.request = request; this.out = out; @@ -55,7 +68,11 @@ } @Override - public void doOut(ArtifactAndFacet bundle, ThemeDocument attr, boolean visible) { + public void doOut( + ArtifactAndFacet bundle, + ThemeDocument attr, + boolean visible + ) { String name = bundle.getFacetName(); if (!isFacetValid(name)) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/StyledSeriesBuilder.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/StyledSeriesBuilder.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/StyledSeriesBuilder.java Fri Jan 19 11:23:42 2018 +0100 @@ -40,7 +40,8 @@ /** - * Add points to series, create gaps if certain distance between points is met. + * Add points to series, create gaps if certain distance + * between points is met. * * @param series Series to add points to. * @param points Points to add to series, points[0] to 1st dim, points[1] @@ -48,9 +49,15 @@ * @param skipNANs if true, skip NAN values in points parameter. Otherwise, * the NaNs lead to gaps in graph. * @param distance if two consecutive entries in points[0] are more - * than distance apart, create a NaN value to skip in display. + * than distance apart, create a NaN value to skip + * in display. */ - public static void addPoints(XYSeries series, double[][] points, boolean skipNANs, double distance) { + public static void addPoints( + XYSeries series, + double[][] points, + boolean skipNANs, + double distance + ) { if (points == null || points.length <= 1) { return; } @@ -108,7 +115,11 @@ * to 2nd dim. * @param skipNANs if true, skip NAN values in points parameter. */ - public static void addPoints(XYSeries series, double[][] points, boolean skipNANs) { + public static void addPoints( + XYSeries series, + double[][] points, + boolean skipNANs + ) { if (points == null || points.length <= 1) { return; } @@ -218,7 +229,8 @@ double prevQ; if (wqkms.getKm(i + 1) < wqkms.getKm(i)) { /* Depending on the data direction the previous km / q - * might have a larger index when we draw right to left data. */ + * might have a larger index when we draw + * right to left data. */ prevX = wqkms.getKm(i + 1); prevQ = wqkms.getQ(i + 1); } else { @@ -260,7 +272,12 @@ * @param wAdd Value to add to each Q while adding to series. * @param wScale multiply with */ - public static void addPointsQW(XYSeries series, double[][] qws, double wTrans, double wScale) { + public static void addPointsQW( + XYSeries series, + double[][] qws, + double wTrans, + double wScale + ) { if (qws == null || qws.length == 0) { return; } @@ -281,7 +298,12 @@ * @param wAdd Value to add to each Q while adding to series. * @param wScale multiply with */ - public static void addPointsQW(XYSeries series, WQKms wqkms, double wTrans, double wScale) { + public static void addPointsQW( + XYSeries series, + WQKms wqkms, + double wTrans, + double wScale + ) { if (wqkms == null) { return; } @@ -359,7 +381,8 @@ * between the newly created and the given series. */ public static XYSeries createGroundAtInfinity(XYSeries series) { - XYSeries ground = new XYSeries(series.getKey() + /** TODO rand + */ "INF"); + XYSeries ground = + new XYSeries(series.getKey() + /** TODO rand + */ "INF"); ground.add(series.getMinX(), -BIG_DOUBLE_VALUE); ground.add(series.getMaxX(), -BIG_DOUBLE_VALUE); return ground; @@ -371,7 +394,8 @@ * between the newly created and the given series. */ public static XYSeries createCeilingAtInfinity(XYSeries series) { - XYSeries ground = new XYSeries(series.getKey() + /** TODO rand + */ "INF"); + XYSeries ground = + new XYSeries(series.getKey() + /** TODO rand + */ "INF"); ground.add(series.getMinX(), BIG_DOUBLE_VALUE); ground.add(series.getMaxX(), BIG_DOUBLE_VALUE); return ground; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/TimeseriesChartGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/TimeseriesChartGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/TimeseriesChartGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -183,10 +183,12 @@ */ java.net.URL imageURL; if (logo.equals("Intevation")) { - imageURL = XYChartGenerator.class.getResource("/images/intevation.png"); + imageURL = XYChartGenerator.class.getResource( + "/images/intevation.png"); } else { // TODO else if ... - imageURL = XYChartGenerator.class.getResource("/images/bfg_logo.gif"); + imageURL = XYChartGenerator.class.getResource( + "/images/bfg_logo.gif"); } imageIcon = new ImageIcon(imageURL); double xPos = 0d, yPos = 0d; @@ -204,7 +206,8 @@ yPos = (Double)getYBounds(0).getLower(); } else if (placev.equals("center")) { - yPos = ((Double)getYBounds(0).getUpper() + (Double)getYBounds(0).getLower())/2d; + yPos = ((Double)getYBounds(0).getUpper() + + (Double)getYBounds(0).getLower())/2d; } else { log.debug("Unknown place-v value: " + placev); @@ -220,7 +223,8 @@ xPos = getRightX(); } else if (placeh.equals("center")) { - xPos = ((Long)getXBounds(0).getUpper() + (Long)getXBounds(0).getLower())/2d; + xPos = ((Long)getXBounds(0).getUpper() + + (Long)getXBounds(0).getLower())/2d; } else { log.debug("Unknown place-h value: " + placeh); @@ -266,7 +270,8 @@ XYAnnotation xyannotation = new XYImageAnnotation(xPos, yPos, imageIcon.getImage(), anchor); - plot.getRenderer().addAnnotation(xyannotation, org.jfree.ui.Layer.BACKGROUND); + plot.getRenderer().addAnnotation( + xyannotation, org.jfree.ui.Layer.BACKGROUND); } /** @@ -418,13 +423,13 @@ if (rx == null) { log.warn("Range for x axis not set." + " Using default values: 0 - 1."); - rx = new TimeBounds(0l, 1l); + rx = new TimeBounds(0L, 1L); } if (ry == null) { log.warn("Range for y axis not set." + " Using default values: 0 - 1."); - ry = new DoubleBounds(0l, 1l); + ry = new DoubleBounds(0L, 1L); } log.debug("X Bounds at index " + index + " is: " + rx); @@ -528,8 +533,10 @@ long max = total.getUpper().longValue(); long diff = max > min ? max - min : min - max; - long newMin = Math.round(min + user.getLower().doubleValue() * diff); - long newMax = Math.round(min + user.getUpper().doubleValue() * diff); + long newMin = Math.round( + min + user.getLower().doubleValue() * diff); + long newMax = Math.round( + min + user.getUpper().doubleValue() * diff); TimeBounds newBounds = new TimeBounds(newMin, newMax); @@ -585,7 +592,8 @@ /** - * Adjusts the (look of) axes of a plot. This method sets the labelFont of the + * Adjusts the (look of) axes of a plot. + * This method sets the labelFont of the * X axis. * * (Duplicate in XYChartGenerator). @@ -610,7 +618,8 @@ } - protected Date decodeXAxisValue(JSONArray array) throws JSONException, ParseException { + protected Date decodeXAxisValue(JSONArray array) + throws JSONException, ParseException { try { double x = array.getDouble(0); long l = (new Double(x)).longValue(); @@ -639,7 +648,8 @@ // Add text annotations for single points. List xy = new ArrayList(); - HashMap names = new HashMap(); + HashMap names = + new HashMap(); try { JSONArray points = new JSONArray((String) o); @@ -685,7 +695,8 @@ new RiverAnnotation(null, null, null, theme); annotations.setTextAnnotations(xy); - // Do not generate second legend entry. (null was passed for the aand before). + // Do not generate second legend entry. + // (null was passed for the aand before). doAnnotations(annotations, null, theme, visible); addAxisDataset(tsc, axisIndex, visible); @@ -768,7 +779,8 @@ legendItem.getLinePaint() ); interLegend.setSeriesKey(series.getKey()); - log.debug("applySeriesAttributes: draw unfilled legend item"); + log.debug("applySeriesAttributes: " + + "draw unfilled legend item"); plot.getLegendItems().add(interLegend); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/TypeSection.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/TypeSection.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/TypeSection.java Fri Jan 19 11:23:42 2018 +0100 @@ -27,7 +27,11 @@ /** Set a string value for a attribute with additional (choice) type. */ - public void setChoiceStringValue(String key, String value, String choiceType) { + public void setChoiceStringValue( + String key, + String value, + String choiceType + ) { if (value == null || value.length() == 0) { return; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java Fri Jan 19 11:23:42 2018 +0100 @@ -161,9 +161,12 @@ officalFixings = new ArrayList(); - for (Artifact art: collection.getArtifactsByName(STATICWQKMSNAME, context)) { + for (Artifact art: collection.getArtifactsByName( + STATICWQKMSNAME, context) + ) { if (art instanceof StaticWQKmsArtifact) { - IsOfficialAccess access = new IsOfficialAccess((D4EArtifact)art); + IsOfficialAccess access = + new IsOfficialAccess((D4EArtifact)art); StaticWQKmsArtifact sart = (StaticWQKmsArtifact) art; if (!access.isOfficial()) { continue; @@ -537,7 +540,8 @@ ) { log.info("WaterlevelExporter.writeCSVHeader"); - String unit = RiverUtils.getRiver((D4EArtifact) master).getWstUnit().getName(); + String unit = RiverUtils.getRiver( + (D4EArtifact) master).getWstUnit().getName(); if (atGauge) { writer.writeNext(new String[] { @@ -629,7 +633,8 @@ if (flys instanceof WINFOArtifact) { if (wqkms != null && wqkms.getRawValue() != null) { WINFOArtifact winfo = (WINFOArtifact) flys; - colDesc = RiverUtils.getNamedMainValue(winfo, wqkms.getRawValue()); + colDesc = RiverUtils.getNamedMainValue( + winfo, wqkms.getRawValue()); // For 'W am Pegel' s if (colDesc == null) { Double value = RiverUtils.getValueFromWQ(wqkms); @@ -834,42 +839,6 @@ entry.getValue().add(wqkms.getW(idx), wqkms.getQ(idx)); } } - - /* Variant: Interpolate the values - // Now get the lines for the of the calculation - Map calcLines = writer.getLines(); - - // Create an interpolater for the official KM -> W relation - UnivariateRealFunction wFunc = new LinearInterpolator( - ).interpolate(wqkms.allKms().toNativeArray(), - wqkms.allWs().toNativeArray()); - - // Now for each calculated point add the interpolated official - for (Map.Entry entry : calcLines.entrySet()) { - try { - double wVal = wFunc.value(entry.getKey().doubleValue()); - // Matching Q's are guranteed otherwise we would - // not have an official line - entry.getValue().add(wVal, entry.getValue().getQ(0)); - } - catch (FunctionEvaluationException aode) { - // should not happen - log.error("spline interpolation failed", aode); - // entry.getValue().add(Double.NaN, entry.getValue().getQ(0)); - } - }*/ - - /* Variant: Add all official fixings - // Warning the WSTWriter does not handle this properly - // as it writes the points for which only a calculation - // exists in the first column - int size = wqkms.size(); - result = new double[4]; - for (int i = 0; i < size; i++) { - result = wqkms.get(i, result); - writer.add(result); - } - */ } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/XYChartGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/XYChartGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/XYChartGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -206,10 +206,12 @@ */ java.net.URL imageURL; if (logo.equals("Intevation")) { - imageURL = XYChartGenerator.class.getResource("/images/intevation.png"); + imageURL = XYChartGenerator.class.getResource( + "/images/intevation.png"); } else { // TODO else if ... - imageURL = XYChartGenerator.class.getResource("/images/bfg_logo.gif"); + imageURL = XYChartGenerator.class.getResource( + "/images/bfg_logo.gif"); } imageIcon = new ImageIcon(imageURL); @@ -229,7 +231,8 @@ yPos = (Double)getYBounds(0).getLower(); } else if (placev.equals("center")) { - yPos = ((Double)getYBounds(0).getUpper() + (Double)getYBounds(0).getLower())/2d; + yPos = ((Double)getYBounds(0).getUpper() + + (Double)getYBounds(0).getLower())/2d; } else { log.debug("Unknown place-v value: " + placev); @@ -245,7 +248,8 @@ xPos = getRightX(); } else if (placeh.equals("center")) { - xPos = ((Double)getXBounds(0).getUpper() + (Double)getXBounds(0).getLower())/2d; + xPos = ((Double)getXBounds(0).getUpper() + + (Double)getXBounds(0).getLower())/2d; } else { log.debug("Unknown place-h value: " + placeh); @@ -291,7 +295,8 @@ XYAnnotation xyannotation = new XYImageAnnotation(xPos, yPos, imageIcon.getImage(), anchor); - plot.getRenderer().addAnnotation(xyannotation, org.jfree.ui.Layer.BACKGROUND); + plot.getRenderer().addAnnotation( + xyannotation, org.jfree.ui.Layer.BACKGROUND); } @@ -366,9 +371,14 @@ * Registers an area to be drawn. * @param area Area to be drawn. * @param index 'axis index' - * @param visible Whether or not to be visible (important for range calculations). + * @param visible Whether or not to be visible + * (important for range calculations). */ - public void addAreaSeries(StyledAreaSeriesCollection area, int index, boolean visible) { + public void addAreaSeries( + StyledAreaSeriesCollection area, + int index, + boolean visible + ) { if (area == null) { log.warn("Cannot yet render above/under curve."); return; @@ -536,7 +546,8 @@ if (b != null && b.getLower().equals(b.getUpper())) { - log.debug("Check whether to expand a x axis.i ("+b.getLower() + "-" + b.getUpper()+")"); + log.debug("Check whether to expand a x axis.i (" + + b.getLower() + "-" + b.getUpper() + ")"); setXBounds(key, ChartHelper.expandBounds(b, 5)); } } @@ -658,12 +669,22 @@ } - protected boolean zoomX(XYPlot plot, ValueAxis axis, Bounds bounds, Range x) { + protected boolean zoomX( + XYPlot plot, + ValueAxis axis, + Bounds bounds, + Range x + ) { return zoom(plot, axis, bounds, x); } - protected boolean zoomY(XYPlot plot, ValueAxis axis, Bounds bounds, Range x) { + protected boolean zoomY( + XYPlot plot, + ValueAxis axis, + Bounds bounds, + Range x + ) { return zoom(plot, axis, bounds, x); } @@ -910,10 +931,12 @@ log.error("Could not decode json."); } - RiverAnnotation annotations = new RiverAnnotation(null, null, null, theme); + RiverAnnotation annotations = + new RiverAnnotation(null, null, null, theme); annotations.setTextAnnotations(xy); - // Do not generate second legend entry. (null was passed for the aand before). + // Do not generate second legend entry. + // (null was passed for the aand before). doAnnotations(annotations, null, theme, visible); addAxisSeries(series, axisIndex, visible); } @@ -925,7 +948,8 @@ * @return hash for given legenditem to identify mergeables. */ public static String legendItemHash(LegendItem li) { - // TODO Do proper implementation. Ensure that only mergable sets are created. + // TODO Do proper implementation. + // Ensure that only mergable sets are created. // getFillPaint() // getFillPaintTransformer() // getLabel() diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/extreme/ExtremeWQCurveGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/extreme/ExtremeWQCurveGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/extreme/ExtremeWQCurveGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -72,9 +72,14 @@ "W [NN + m]"; - /** First, ask parent to add data, then handle extreme_wq_curve(_base) data.*/ + /** First, ask parent to add data, then handle extreme_wq_curve(_base) + * data.*/ @Override - public boolean prepareChartData(ArtifactAndFacet aaf, ThemeDocument theme, boolean visible) { + public boolean prepareChartData( + ArtifactAndFacet aaf, + ThemeDocument theme, + boolean visible + ) { if (super.prepareChartData(aaf, theme, visible)) { return true; } @@ -102,7 +107,11 @@ } /** Do Extreme Curve nonextrapolated points out. */ - protected void doExtremeCurveBaseOut(ArtifactAndFacet aaf, ThemeDocument theme, boolean visible) { + protected void doExtremeCurveBaseOut( + ArtifactAndFacet aaf, + ThemeDocument theme, + boolean visible + ) { log.debug("doExtremeCurveBaseOut"); ExtremeCurveFacet facet = (ExtremeCurveFacet) aaf.getFacet(); Curve curve = (Curve) facet.getData(aaf.getArtifact(), context); @@ -111,20 +120,25 @@ return; } - XYSeries qwseries = new StyledXYSeries(aaf.getFacetDescription(), theme); + XYSeries qwseries = new StyledXYSeries( + aaf.getFacetDescription(), theme); double gaugeDatum = getCurrentGaugeDatum(); if (gaugeDatum == 0d) { - StyledSeriesBuilder.addPointsQW(qwseries, curve.getQs(), curve.getWs()); + StyledSeriesBuilder.addPointsQW( + qwseries, curve.getQs(), curve.getWs()); addAxisSeries(qwseries, YAXIS.W.idx, visible); } else { - XYSeries series2 = new StyledXYSeries(aaf.getFacetDescription(), theme); - StyledSeriesBuilder.addPointsQW(series2, curve.getQs(), curve.getWs()); + XYSeries series2 = + new StyledXYSeries(aaf.getFacetDescription(), theme); + StyledSeriesBuilder.addPointsQW( + series2, curve.getQs(), curve.getWs()); addAxisSeries(series2, YAXIS.W.idx, false); - StyledSeriesBuilder.addPointsQW(qwseries, curve.getQs(), curve.getWs(), -gaugeDatum, 100d); + StyledSeriesBuilder.addPointsQW( + qwseries, curve.getQs(), curve.getWs(), -gaugeDatum, 100d); addAxisSeries(qwseries, YAXIS.WCm.idx, visible); } @@ -134,7 +148,11 @@ /** Do Extreme Curve out */ - protected void doExtremeCurveOut(ArtifactAndFacet aaf, ThemeDocument theme, boolean visible) { + protected void doExtremeCurveOut( + ArtifactAndFacet aaf, + ThemeDocument theme, + boolean visible + ) { log.debug("doExtremeCurveOut"); ExtremeCurveFacet facet = (ExtremeCurveFacet) aaf.getFacet(); Curve curve = (Curve) facet.getData(aaf.getArtifact(), context); @@ -231,7 +249,10 @@ unit = "cm"; } - return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT, new Object[] { unit }); + return msg( + I18N_YAXIS_LABEL, + I18N_YAXIS_LABEL_DEFAULT, + new Object[] { unit }); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/fixings/DeltaWtExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/DeltaWtExporter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/DeltaWtExporter.java Fri Jan 19 11:23:42 2018 +0100 @@ -272,7 +272,8 @@ log.debug("DeltaWtExporter.writeCSVHeader"); /* issue825 - km; Ereignis, Abfluss, GEMESSENER Wasserstand; Status (RECHTSBÜNDIG), del W + km; Ereignis, Abfluss, GEMESSENER Wasserstand; + Status (RECHTSBÜNDIG), del W */ writer.writeNext(new String[] { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATExport.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATExport.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATExport.java Fri Jan 19 11:23:42 2018 +0100 @@ -52,7 +52,11 @@ @Override - public void doOut(ArtifactAndFacet bundle, ThemeDocument attr, boolean visible) { + public void doOut( + ArtifactAndFacet bundle, + ThemeDocument attr, + boolean visible + ) { log.debug("AT Export doOut()."); Object data = bundle.getData(context); if (data instanceof CalculationResult) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixChartGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixChartGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixChartGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -33,7 +33,12 @@ "/art:action/art:attributes/art:currentKm/@art:km"; @Override - public void init(String outName, Document request, OutputStream out, CallContext context) { + public void init( + String outName, + Document request, + OutputStream out, + CallContext context + ) { super.init(outName, request, out, context); Double currentKm = getCurrentKmFromRequest(request); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -166,7 +166,8 @@ ) { String name = artifactFacet.getFacetName(); log.debug("FixDeltaWtGenerator.doOut: " + name); - log.debug("Theme description is: " + artifactFacet.getFacetDescription()); + log.debug("Theme description is: " + + artifactFacet.getFacetDescription()); this.artifact = (D4EArtifact)artifactFacet.getArtifact(); @@ -291,14 +292,17 @@ addAxisDataset(tsc, 0, visible); if (visible && theme.parseShowLineLabel()) { - List textAnnos = new ArrayList(); + List textAnnos = + new ArrayList(); XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( - "\u0394 W(t) [cm] " + (float)Math.round(qwd.qwd.getDeltaW() * 10000) / 10000, + "\u0394 W(t) [cm] " + + (float)Math.round(qwd.qwd.getDeltaW() * 10000) / 10000, tsc.getXValue(0, 0), qwd.qwd.getDeltaW()); textAnnos.add(anno); - RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, theme); + RiverAnnotation flysAnno = + new RiverAnnotation(null, null, null, theme); flysAnno.setTextAnnotations(textAnnos); addAnnotations(flysAnno); } @@ -319,8 +323,12 @@ } - protected void doQWDEventsOut(QWD qwd, String desc, ThemeDocument theme, boolean visible) - { + protected void doQWDEventsOut( + QWD qwd, + String desc, + ThemeDocument theme, + boolean visible + ) { TimeSeriesCollection tsc = new TimeSeriesCollection(); TimeSeries series = new StyledTimeSeries(desc, theme); @@ -367,7 +375,8 @@ /** - * @param annoIdxMap map of index in qwds to series/data item indices in tsc. + * @param annoIdxMap map of index in qwds to series/data item indices + * in tsc. */ protected void doQWDTextAnnotations(Map annoIdxMap, TimeSeriesCollection tsc, QWD qwd, ThemeDocument theme, @@ -429,8 +438,10 @@ return; } double[] value = (double[]) data; - StyledDomainMarker lower = new StyledDomainMarker((value[0] * -1), 0, theme); - StyledDomainMarker upper = new StyledDomainMarker(0, value[0], theme); + StyledDomainMarker lower = + new StyledDomainMarker((value[0] * -1), 0, theme); + StyledDomainMarker upper = + new StyledDomainMarker(0, value[0], theme); valueMarker.add(lower); valueMarker.add(upper); @@ -463,7 +474,12 @@ @Override - public void init(String outName, Document request, OutputStream out, CallContext context) { + public void init( + String outName, + Document request, + OutputStream out, + CallContext context + ) { super.init(outName, request, out, context); Double currentKm = FixChartGenerator.getCurrentKmFromRequest(request); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -156,22 +156,27 @@ fixedWinMRange.getUpperBound()); } - log.debug("Syncing Axis Bounds. Bounds W: " + boundsInMGauge.toString() + - " Bounds Wcm: " + boundsInCM.toString()); + log.debug("Syncing Axis Bounds. Bounds W: " + + boundsInMGauge.toString() + + " Bounds Wcm: " + boundsInCM.toString()); double datum = getCurrentGaugeDatum(); // Convert boundsInMGauge to Datum+cm - double convertedLower = ((Double)boundsInMGauge.getLower() - datum) * 100; - double convertedUpper = ((Double)boundsInMGauge.getUpper() - datum) * 100; - Bounds convertedBounds = new DoubleBounds(convertedLower, convertedUpper); + double convertedLower = + ((Double)boundsInMGauge.getLower() - datum) * 100; + double convertedUpper = + ((Double)boundsInMGauge.getUpper() - datum) * 100; + Bounds convertedBounds = + new DoubleBounds(convertedLower, convertedUpper); // Now combine both Ranges boundsInCM = boundsInCM.combine(convertedBounds); // Recalculate absolute bounds - boundsInMGauge = new DoubleBounds((Double)boundsInCM.getLower() / 100d + datum, - (Double)boundsInCM.getUpper() / 100d + datum); + boundsInMGauge = new DoubleBounds( + (Double)boundsInCM.getLower() / 100d + datum, + (Double)boundsInCM.getUpper() / 100d + datum); // Set the new combined bounds setYBounds(YAXIS.W.idx, boundsInMGauge); @@ -181,7 +186,11 @@ } @Override - public void doOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) { + public void doOut( + ArtifactAndFacet aaf, + ThemeDocument doc, + boolean visible + ) { log.debug("doOut: " + aaf.getFacetName()); if (!prepareChartData(aaf, doc, visible)) { log.warn("Unknown facet, name " + aaf.getFacetName()); @@ -192,7 +201,11 @@ * Return true if data could be handled, * to be overridden to add more handled data. */ - public boolean prepareChartData(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) { + public boolean prepareChartData( + ArtifactAndFacet aaf, + ThemeDocument doc, + boolean visible + ) { String name = aaf.getFacetName(); this.artifact = (D4EArtifact) aaf.getArtifact(); @@ -266,7 +279,11 @@ /** Add sector average points to chart. */ - protected void doSectorAverageOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) { + protected void doSectorAverageOut( + ArtifactAndFacet aaf, + ThemeDocument doc, + boolean visible + ) { log.debug("doSectorAverageOut"); QWDDateRange qwdd = (QWDDateRange) aaf.getData(context); @@ -321,7 +338,8 @@ if (visible && doc.parseShowPointLabel()) { - List textAnnos = new ArrayList(); + List textAnnos = + new ArrayList(); DateFormat dateFormat = DateFormat.getDateInstance( DateFormat.SHORT); @@ -331,7 +349,8 @@ w); textAnnos.add(anno); - RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, doc); + RiverAnnotation flysAnno = + new RiverAnnotation(null, null, null, doc); flysAnno.setTextAnnotations(textAnnos); addAnnotations(flysAnno); } @@ -339,7 +358,11 @@ /** Add reference event points to chart. */ - protected void doReferenceEventsOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) { + protected void doReferenceEventsOut( + ArtifactAndFacet aaf, + ThemeDocument doc, + boolean visible + ) { log.debug("doReferenceEventsOut"); QWI qwd = (QWI)aaf.getData(context); @@ -379,9 +402,11 @@ qwd.getQ(), w); - List textAnnos = new ArrayList(); + List textAnnos = + new ArrayList(); textAnnos.add(anno); - RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, doc); + RiverAnnotation flysAnno = + new RiverAnnotation(null, null, null, doc); flysAnno.setTextAnnotations(textAnnos); addAnnotations(flysAnno); } @@ -409,13 +434,15 @@ series.add(wqkms.getQ(i), wqkms.getW(i), false); addAxisSeries(series, YAXIS.W.idx, visible); if(visible && theme.parseShowPointLabel()) { - List textAnnos = new ArrayList(); + List textAnnos = + new ArrayList(); XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( title, wqkms.getQ(i), factor*(wqkms.getW(i)-gaugeDatum)); textAnnos.add(anno); - RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, theme); + RiverAnnotation flysAnno = + new RiverAnnotation(null, null, null, theme); flysAnno.setTextAnnotations(textAnnos); addAnnotations(flysAnno); } @@ -424,7 +451,11 @@ } } - protected void doEventsOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) { + protected void doEventsOut( + ArtifactAndFacet aaf, + ThemeDocument doc, + boolean visible + ) { log.debug("doEventsOut"); // Find W/Q at km. addPointFromWQKms((WQKms) aaf.getData(context), @@ -432,7 +463,11 @@ } - protected void doWQCurveOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) { + protected void doWQCurveOut( + ArtifactAndFacet aaf, + ThemeDocument doc, + boolean visible + ) { log.debug("doWQCurveOut"); FixWQCurveFacet facet = (FixWQCurveFacet)aaf.getFacet(); @@ -472,7 +507,10 @@ // Use second axis at cm if at gauge. for (int i = 0, N = series.getItemCount(); i < N; i++) { series.updateByIndex( - i, new Double(100d*(series.getY(i).doubleValue()-gaugeDatum))); + i, + new Double(100d * + (series.getY(i).doubleValue() - gaugeDatum)) + ); } addAxisSeries(series, YAXIS.WCm.idx, visible); } @@ -482,7 +520,11 @@ } } - protected void doOutlierOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) { + protected void doOutlierOut( + ArtifactAndFacet aaf, + ThemeDocument doc, + boolean visible + ) { log.debug("doOutlierOut"); QWI[] qws = (QWI[])aaf.getData(context); @@ -491,7 +533,11 @@ /** Add markers for q sectors. */ - protected void doQSectorOut(ArtifactAndFacet aaf, ThemeDocument theme, boolean visible) { + protected void doQSectorOut( + ArtifactAndFacet aaf, + ThemeDocument theme, + boolean visible + ) { log.debug("doQSectorOut"); if (!visible) { return; @@ -504,7 +550,9 @@ } List qsectorsList = (List) qsectorsObj; - if (qsectorsList.size() == 0 || !(qsectorsList.get(0) instanceof NamedDouble)) { + if (qsectorsList.size() == 0 + || !(qsectorsList.get(0) instanceof NamedDouble) + ) { log.warn("No QSectors coming from data."); return; } @@ -571,7 +619,8 @@ double [][] data = (double [][]) wqkms; for (int i = 0; i< data[0].length; i++) { xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), - (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); + (float) data[1][i], + StickyAxisAnnotation.SimpleAxis.Y_AXIS)); } doAnnotations(new RiverAnnotation(facet.getDescription(), xy), @@ -660,13 +709,15 @@ // be delivered by the facet already (instead of in the Generator). log.debug("FixWQCurveGenerator: doWQOut: WQKms"); - addPointFromWQKms((WQKms) aaf.getData(context), aaf.getFacetDescription(), theme, visible); + addPointFromWQKms((WQKms)aaf.getData(context), + aaf.getFacetDescription(), theme, visible); } else { log.debug("FixWQCurveGenerator: doWQOut: double[][]"); double [][] data = (double [][]) wqkms; - XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), false, true, theme); + XYSeries series = new StyledXYSeries( + aaf.getFacetDescription(), false, true, theme); StyledSeriesBuilder.addPoints(series, data, true); addAxisSeries(series, YAXIS.W.idx, visible); @@ -802,7 +853,10 @@ ? "cm" : RiverUtils.getRiver(flys).getWstUnit().getName(); - return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT, new Object[] { unit }); + return msg( + I18N_YAXIS_LABEL, + I18N_YAXIS_LABEL_DEFAULT, + new Object[] { unit }); } @Override diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/injector/InjectorConstants.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/injector/InjectorConstants.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/injector/InjectorConstants.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.exports.injector; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/injector/KmFromGaugeNameInjector.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/injector/KmFromGaugeNameInjector.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/injector/KmFromGaugeNameInjector.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.exports.injector; import org.apache.log4j.Logger; @@ -17,14 +25,19 @@ implements ContextInjector { - private static Logger log = Logger.getLogger(KmFromGaugeNameInjector.class); + private static Logger log = Logger.getLogger( + KmFromGaugeNameInjector.class); @Override public void setup(Element cfg) { } @Override - public void injectContext(CallContext ctx, Artifact artifact, Document doc) { + public void injectContext( + CallContext ctx, + Artifact artifact, + Document doc + ) { if (ctx.getContextValue(CURRENT_KM) instanceof Number) { return; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/injector/KmFromGaugeNumberInjector.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/injector/KmFromGaugeNumberInjector.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/injector/KmFromGaugeNumberInjector.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.exports.injector; import org.apache.log4j.Logger; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/injector/KmFromLocationInjector.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/injector/KmFromLocationInjector.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/injector/KmFromLocationInjector.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.exports.injector; import org.apache.log4j.Logger; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/injector/KmFromRequestInjector.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/injector/KmFromRequestInjector.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/injector/KmFromRequestInjector.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.exports.injector; import org.apache.log4j.Logger; @@ -17,7 +25,8 @@ public class KmFromRequestInjector implements ContextInjector { - private static final Logger log = Logger.getLogger(KmFromRequestInjector.class); + private static final Logger log = Logger.getLogger( + KmFromRequestInjector.class); public static final String XPATH_CHART_CURRENTKM = "/art:action/art:attributes/art:currentKm/@art:km"; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/injector/PNPInjector.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/injector/PNPInjector.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/injector/PNPInjector.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.exports.injector; import org.apache.log4j.Logger; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java Fri Jan 19 11:23:42 2018 +0100 @@ -204,8 +204,11 @@ header.add(msg(CSV_HEADER_DIFF, "cm")); if (results.length > 0 && results[0] instanceof BedDiffYearResult) { - header.add(msg(CSV_HEADER_SOUNDING1, "soundung width minuend [m]")); - header.add(msg(CSV_HEADER_SOUNDING2, "sounding width subtrahend [m]")); + header.add( + msg(CSV_HEADER_SOUNDING1, "soundung width minuend [m]")); + header.add( + msg(CSV_HEADER_SOUNDING2, + "sounding width subtrahend [m]")); header.add(msg(CSV_HEADER_GAP1, "data gap minuend")); header.add(msg(CSV_HEADER_GAP2, "data gap subtrahend")); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java Fri Jan 19 11:23:42 2018 +0100 @@ -135,7 +135,8 @@ } header.add(msg(CSV_HEADER_KM, "km")); - DateFormat df = Formatter.getDateFormatter(context.getMeta(), "dd.MM.yyyy"); + DateFormat df = Formatter.getDateFormatter( + context.getMeta(), "dd.MM.yyyy"); for (BedQualityResult result: results) { String d1 = df.format(result.getDateRange().getFrom()); String d2 = df.format(result.getDateRange().getTo()); @@ -146,10 +147,12 @@ String i18n; if (value.isDiameterResult()) { i18n = CSV_HEADER_BASE + ".diameter." + value.getType(); - header.add(msg(i18n, i18n) + - " - " + value.getName().toUpperCase() + " - " + d1 + "-" + d2); + header.add(msg(i18n, i18n) + + " - " + value.getName().toUpperCase() + + " - " + d1 + "-" + d2); } else { - i18n = CSV_HEADER_BASE + "." + value.getName() + "." + value.getType(); + i18n = CSV_HEADER_BASE + "." + value.getName() + + "." + value.getType(); header.add(msg(i18n, i18n) + " - " + d1 + "-" + d2); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/AreaProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/AreaProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/AreaProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -33,8 +33,12 @@ private static final Logger log = Logger.getLogger(AreaProcessor.class); - protected XYSeries getSeries(String seriesName, Object data, String facetType, - ThemeDocument theme) { + protected XYSeries getSeries( + String seriesName, + Object data, + String facetType, + ThemeDocument theme + ) { if (data == null || facetType == null) { return null; } @@ -62,7 +66,8 @@ StyledSeriesBuilder.addPoints(series, (WKms) data); } else if (data instanceof Lines.LineData) { - StyledSeriesBuilder.addPoints(series, ((Lines.LineData) data).points, false); + StyledSeriesBuilder.addPoints( + series, ((Lines.LineData) data).points, false); } else { log.error("Do not know how to deal with (up) area info from: " @@ -89,11 +94,14 @@ String lowerFacetName = data.getLowerFacetName(); String upperFacetName = data.getUpperFacetName(); - XYSeries up = getSeries(seriesName, data.getUpperData(), upperFacetName, theme); - XYSeries down = getSeries(seriesName + " ", data.getLowerData(), lowerFacetName, theme); + XYSeries up = getSeries( + seriesName, data.getUpperData(), upperFacetName, theme); + XYSeries down = getSeries( + seriesName + " ", data.getLowerData(), lowerFacetName, theme); - // TODO Depending on style, the area (e.g. 20m^2) should be added as annotation. + // TODO Depending on style, the area (e.g. 20m^2) + // should be added as annotation. if (up == null && down != null) { area.setMode(StyledAreaSeriesCollection.FILL_MODE.ABOVE); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffHeightYearProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffHeightYearProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffHeightYearProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -50,13 +50,15 @@ if (!(data instanceof double[][])) { // Should not happen if canHandle is correct - log.error("Can't process " + data.getClass().getName() + " objects"); + log.error("Can't process " + data.getClass().getName() + + " objects"); return; } double[][] bData = (double[][]) data; - StyledXYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); + StyledXYSeries series = + new StyledXYSeries(bundle.getFacetDescription(), theme); series.putMetaData(metaData, bundle.getArtifact(), context); StyledSeriesBuilder.addPoints(series, bData, false, GAP_TOLERANCE); @@ -77,12 +79,14 @@ if (!(data instanceof double[][])) { // Should not happen if canHandle is correct - log.error("Can't process " + data.getClass().getName() + " objects"); + log.error("Can't process " + data.getClass().getName() + + " objects"); return; } double[][] bData = (double[][]) data; - XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); + XYSeries series = + new StyledXYSeries(bundle.getFacetDescription(), theme); StyledSeriesBuilder.addPoints(series, bData, false, GAP_TOLERANCE); generator.addAxisSeries(series, index, visible); @@ -90,9 +94,10 @@ @Override public boolean canHandle(String facetType) { - return BED_DIFFERENCE_HEIGHT_YEAR.equals(facetType) // from BedDiffYearHeight - || BED_DIFFERENCE_HEIGHT_YEAR_FILTERED.equals(facetType) // from BedDiffYearHeight - ; + return BED_DIFFERENCE_HEIGHT_YEAR.equals(facetType) + // from BedDiffYearHeight + || BED_DIFFERENCE_HEIGHT_YEAR_FILTERED.equals(facetType); + // from BedDiffYearHeight } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffYearProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffYearProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffYearProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -53,7 +53,8 @@ } if (!(data instanceof double[][])) { - log.error("Can't process " + data.getClass().getName() + " objects"); + log.error("Can't process " + data.getClass().getName() + + " objects"); return; } double[][] bData = (double[][]) data; @@ -62,7 +63,8 @@ bData[1][i] *= 100d; } - StyledXYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); + StyledXYSeries series = + new StyledXYSeries(bundle.getFacetDescription(), theme); series.putMetaData(metaData, bundle.getArtifact(), context); StyledSeriesBuilder.addPoints(series, bData, @@ -76,8 +78,10 @@ @Override public boolean canHandle(String facetType) { - return BED_DIFFERENCE_YEAR.equals(facetType) // from BedDifferencesYear - || BED_DIFFERENCE_YEAR_FILTERED.equals(facetType); // from BedDifferencesYear + return BED_DIFFERENCE_YEAR.equals(facetType) + // from BedDifferencesYear + || BED_DIFFERENCE_YEAR_FILTERED.equals(facetType); + // from BedDifferencesYear } @Override diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedHeightProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -45,7 +45,8 @@ ArtifactAndFacet bundle, ThemeDocument theme, boolean visible) { - XYSeries series = prepareSeries(bundle, theme, generator.getCallContext()); + XYSeries series = prepareSeries( + bundle, theme, generator.getCallContext()); if (series != null) { generator.addAxisSeries(series, axisName, visible); } @@ -59,7 +60,8 @@ boolean visible, int index ) { - XYSeries series = prepareSeries(bundle, theme, generator.getCallContext()); + XYSeries series = prepareSeries( + bundle, theme, generator.getCallContext()); if (series != null) { generator.addAxisSeries(series, index, visible); } @@ -101,8 +103,10 @@ return FacetTypes.BEDHEIGHT.equals(facetType) || FacetTypes.BED_DIFFERENCE_YEAR_HEIGHT1.equals(facetType) || FacetTypes.BED_DIFFERENCE_YEAR_HEIGHT2.equals(facetType) - || FacetTypes.BED_DIFFERENCE_YEAR_HEIGHT1_FILTERED.equals(facetType) - || FacetTypes.BED_DIFFERENCE_YEAR_HEIGHT2_FILTERED.equals(facetType); + || FacetTypes.BED_DIFFERENCE_YEAR_HEIGHT1_FILTERED.equals( + facetType) + || FacetTypes.BED_DIFFERENCE_YEAR_HEIGHT2_FILTERED.equals( + facetType); } @Override diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/DefaultProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/DefaultProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/DefaultProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -60,7 +60,8 @@ /** - * Returns true if the Processor class is able to generate output for a facet type + * Returns true if Processor class is able to generate + * output for facet type * * @param facettype Name of the facet type * @return true if the facettype can be processed diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/DeltaWProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/DeltaWProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/DeltaWProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -58,7 +58,8 @@ doReferenceEventsOut(generator, bundle, theme, visible); } else if (facettype.equals(FacetTypes.FIX_ANALYSIS_EVENTS_LS)) { doAnalysisEventsOut(generator, bundle, theme, visible); - } else if (facettype.startsWith(FacetTypes.FIX_SECTOR_AVERAGE_LS_DEVIATION)) { + } else if (facettype.startsWith( + FacetTypes.FIX_SECTOR_AVERAGE_LS_DEVIATION)) { doSectorAverageDeviationOut(generator, bundle, theme, visible); } else if (facettype.equals(FacetTypes.FIX_DEVIATION_LS)) { doReferenceDeviationOut(generator, bundle, theme, visible); @@ -98,7 +99,8 @@ return; } - XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), doc); + XYSeries series = new StyledXYSeries( + bundle.getFacetDescription(), doc); for (KMIndex.Entry entry: kms) { double km = entry.getKm(); @@ -127,8 +129,8 @@ XYSeriesCollection col = new XYSeriesCollection(); - StyledXYSeries series = new StyledXYSeries(bundle.getFacetDescription(), false, - doc); + StyledXYSeries series = new StyledXYSeries( + bundle.getFacetDescription(), false, doc); for (KMIndex.Entry entry: kms) { double km = entry.getKm(); @@ -157,7 +159,8 @@ XYSeriesCollection col = new XYSeriesCollection(); - StyledXYSeries series = new StyledXYSeries(bundle.getFacetDescription(), false, doc); + StyledXYSeries series = new StyledXYSeries( + bundle.getFacetDescription(), false, doc); for (KMIndex.Entry entry: kms) { double km = entry.getKm(); @@ -190,8 +193,8 @@ StyledAreaSeriesCollection area = new StyledAreaSeriesCollection(doc); XYSeries upper = new StyledXYSeries(bundle.getFacetDescription(), false, doc); - XYSeries lower = - new StyledXYSeries(bundle.getFacetDescription() + " ", false, doc); + XYSeries lower = new StyledXYSeries( + bundle.getFacetDescription() + " ", false, doc); for (KMIndex.Entry entry: kms) { double km = entry.getKm(); @@ -230,8 +233,8 @@ StyledAreaSeriesCollection area = new StyledAreaSeriesCollection(doc); XYSeries upper = new StyledXYSeries(bundle.getFacetDescription(), false, doc); - XYSeries lower = - new StyledXYSeries(bundle.getFacetDescription() + " ", false, doc); + XYSeries lower = new StyledXYSeries( + bundle.getFacetDescription() + " ", false, doc); for (KMIndex.Entry entry: kms) { double km = entry.getKm(); @@ -257,7 +260,8 @@ @Override public String getAxisLabel(DiagramGenerator generator) { - return generator.msg(I18N_DW_YAXIS_LABEL, I18N_DW_YAXIS_LABEL_DEFAULT); + return generator.msg( + I18N_DW_YAXIS_LABEL, I18N_DW_YAXIS_LABEL_DEFAULT); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/DischargeProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/DischargeProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/DischargeProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -124,7 +124,8 @@ @Override public String getAxisLabel(DiagramGenerator generator) { CallMeta meta = generator.getCallContext().getMeta(); - RiverAccess access = new RiverAccess((D4EArtifact)generator.getMaster()); + RiverAccess access = + new RiverAccess((D4EArtifact)generator.getMaster()); String unit = access.getRiver().getWstUnit().getName(); if (yAxisLabel != null && !yAxisLabel.isEmpty()) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/FixDeltaWAProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/FixDeltaWAProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/FixDeltaWAProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -42,7 +42,8 @@ CallContext context = generator.getCallContext(); Object data = bundle.getData(context); - XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); + XYSeries series = new StyledXYSeries( + bundle.getFacetDescription(), theme); // Handle WKms data. WKms wkms = (WKms) data; @@ -60,7 +61,8 @@ StyledSeriesBuilder.addUpperBand(seriesUp, wkms, bandWidth); StyledSeriesBuilder.addLowerBand(seriesDown, wkms, bandWidth); - StyledAreaSeriesCollection area = new StyledAreaSeriesCollection(theme); + StyledAreaSeriesCollection area = + new StyledAreaSeriesCollection(theme); area.addSeries(seriesUp); area.addSeries(seriesDown); area.setMode(StyledAreaSeriesCollection.FILL_MODE.BETWEEN); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/FixDeltaWProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/FixDeltaWProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/FixDeltaWProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -42,7 +42,8 @@ CallContext context = generator.getCallContext(); Object data = bundle.getData(context); - XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); + XYSeries series = new StyledXYSeries( + bundle.getFacetDescription(), theme); // Handle WKms data. WKms wkms = (WKms) data; @@ -60,7 +61,8 @@ StyledSeriesBuilder.addUpperBand(seriesUp, wkms, bandWidth); StyledSeriesBuilder.addLowerBand(seriesDown, wkms, bandWidth); - StyledAreaSeriesCollection area = new StyledAreaSeriesCollection(theme); + StyledAreaSeriesCollection area = + new StyledAreaSeriesCollection(theme); area.addSeries(seriesUp); area.addSeries(seriesDown); area.setMode(StyledAreaSeriesCollection.FILL_MODE.BETWEEN); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/FixDerivedProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/FixDerivedProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/FixDerivedProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.exports.process; import java.util.Map; @@ -79,7 +87,8 @@ @Override public String getAxisLabel(DiagramGenerator generator) { CallMeta meta = generator.getCallContext().getMeta(); - RiverAccess access = new RiverAccess((D4EArtifact)generator.getMaster()); + RiverAccess access = + new RiverAccess((D4EArtifact)generator.getMaster()); String unit = access.getRiver().getWstUnit().getName(); if (yAxisLabel != null && !yAxisLabel.isEmpty()) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/FixWQProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/FixWQProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/FixWQProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.exports.process; import java.awt.BasicStroke; @@ -62,7 +70,8 @@ // TODO: Simplify this processor and move general facets/data to // MiscDischargeProcessor or something... String facetType = bundle.getFacetName(); - log.debug("facet: " + facetType + " name: " + bundle.getFacetDescription()); + log.debug("facet: " + facetType + + " name: " + bundle.getFacetDescription()); if(facetType.startsWith(FIX_SECTOR_AVERAGE_WQ)) { doSectorAverageOut(generator, bundle, theme, visible); } @@ -101,7 +110,8 @@ boolean visible ) { log.debug("doSectorAverageOut"); - QWDDateRange qwdd = (QWDDateRange)bundle.getData(generator.getCallContext()); + QWDDateRange qwdd = (QWDDateRange)bundle.getData( + generator.getCallContext()); QWD qwd = qwdd != null ? qwdd.getQWD() : null; if(qwd != null) { @@ -153,7 +163,7 @@ // Force empty symbol. if (qwd.getInterpolated()) { - theme = new ThemeDocument(theme); // prevent potential side effects. + theme = new ThemeDocument(theme); // prevent potential side effects theme.setValue(ThemeDocument.USE_FILL_PAINT, "true"); } @@ -170,7 +180,8 @@ if (visible && theme.parseShowPointLabel()) { - List textAnnos = new ArrayList(); + List textAnnos = + new ArrayList(); DateFormat dateFormat = DateFormat.getDateInstance( DateFormat.SHORT); @@ -180,7 +191,8 @@ qwd.getW()); textAnnos.add(anno); - RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, theme); + RiverAnnotation flysAnno = + new RiverAnnotation(null, null, null, theme); flysAnno.setTextAnnotations(textAnnos); generator.addAnnotations(flysAnno); } @@ -196,13 +208,14 @@ QWI qwd = (QWI)bundle.getData(generator.getCallContext()); if (qwd == null) { - log.debug("doReferenceEventsOut: qwds == null in " + bundle.getFacetDescription()); + log.debug("doReferenceEventsOut: qwds == null in " + + bundle.getFacetDescription()); return; } // Force empty symbol. if (qwd.getInterpolated()) { - theme = new ThemeDocument(theme); // prevent potential side effects. + theme = new ThemeDocument(theme); // prevent potential side effects theme.setValue(ThemeDocument.USE_FILL_PAINT, "true"); } @@ -224,9 +237,11 @@ qwd.getQ(), qwd.getW()); - List textAnnos = new ArrayList(); + List textAnnos = + new ArrayList(); textAnnos.add(anno); - RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, theme); + RiverAnnotation flysAnno = + new RiverAnnotation(null, null, null, theme); flysAnno.setTextAnnotations(textAnnos); generator.addAnnotations(flysAnno); } @@ -330,7 +345,9 @@ } List qsectorsList = (List) qsectorsObj; - if (qsectorsList.size() == 0 || !(qsectorsList.get(0) instanceof NamedDouble)) { + if (qsectorsList.size() == 0 + || !(qsectorsList.get(0) instanceof NamedDouble) + ) { log.warn("No QSectors coming from data."); return; } @@ -394,8 +411,10 @@ log.debug("Got double[][]"); double [][] values = (double [][]) data; for (int i = 0; i< values[0].length; i++) { - xy.add(new StickyAxisAnnotation(bundle.getFacetDescription(), - (float) values[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); + xy.add(new StickyAxisAnnotation( + bundle.getFacetDescription(), + (float) values[1][i], + StickyAxisAnnotation.SimpleAxis.Y_AXIS)); } if (visible) { @@ -411,7 +430,8 @@ WKms wkms = (WKms) data; Double ckm = - (Double) generator.getCallContext().getContextValue(FixChartGenerator.CURRENT_KM); + (Double)generator.getCallContext().getContextValue( + FixChartGenerator.CURRENT_KM); double location = (ckm != null) ? ckm.doubleValue() : getRange()[0]; @@ -439,7 +459,8 @@ WQKms wqkms = (WQKms)data; // TODO As in doEventsOut, the value-searching should // be delivered by the facet already - XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); + XYSeries series = new StyledXYSeries( + bundle.getFacetDescription(), theme); Double ckm = (Double) generator.getCallContext() .getContextValue(CURRENT_KM); @@ -456,13 +477,16 @@ series.add(wqkms.getQ(i), wqkms.getW(i), false); generator.addAxisSeries(series, axisName, visible); if(visible && theme.parseShowPointLabel()) { - List textAnnos = new ArrayList(); - XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( - bundle.getFacetDescription(), - wqkms.getQ(i), - wqkms.getW(i)); + List textAnnos = + new ArrayList(); + XYTextAnnotation anno = + new CollisionFreeXYTextAnnotation( + bundle.getFacetDescription(), + wqkms.getQ(i), + wqkms.getW(i)); textAnnos.add(anno); - RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, theme); + RiverAnnotation flysAnno = + new RiverAnnotation(null, null, null, theme); flysAnno.setTextAnnotations(textAnnos); generator.addAnnotations(flysAnno); } @@ -474,7 +498,8 @@ log.debug("FixWQCurveGenerator: doWQOut: double[][]"); double [][] values = (double [][]) data; - XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), false, true, theme); + XYSeries series = new StyledXYSeries( + bundle.getFacetDescription(), false, true, theme); StyledSeriesBuilder.addPoints(series, values, true); generator.addAxisSeries(series, axisName, visible); @@ -502,7 +527,8 @@ public String getAxisLabel(DiagramGenerator generator) { CallMeta meta = generator.getCallContext().getMeta(); - RiverAccess access = new RiverAccess((D4EArtifact)generator.getMaster()); + RiverAccess access = new RiverAccess((D4EArtifact)generator + .getMaster()); String unit = access.getRiver().getWstUnit().getName(); return Resources.getMsg( meta, diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/FlowVelocityProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/FlowVelocityProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/FlowVelocityProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -43,8 +43,9 @@ boolean visible) { CallContext context = generator.getCallContext(); Map metaData = bundle.getFacet().getMetaData(); - StyledXYSeries series = new StyledXYSeries(bundle.getFacetDescription(), - theme); + StyledXYSeries series = new StyledXYSeries( + bundle.getFacetDescription(), + theme); series.putMetaData(metaData, bundle.getArtifact(), context); yAxisLabel = metaData.get("Y"); String facetName = bundle.getFacetName(); @@ -58,11 +59,15 @@ double [][] points; if (facetName.equals(FacetTypes.FLOW_VELOCITY_TOTALCHANNEL) || - facetName.equals(FacetTypes.FLOW_VELOCITY_TOTALCHANNEL_FILTERED)) { + facetName.equals( + FacetTypes.FLOW_VELOCITY_TOTALCHANNEL_FILTERED) + ) { FlowVelocityData fData = (FlowVelocityData) data; points = fData.getTotalChannelPoints(); } else if (facetName.equals(FacetTypes.FLOW_VELOCITY_MAINCHANNEL) || - facetName.equals(FacetTypes.FLOW_VELOCITY_MAINCHANNEL_FILTERED)) { + facetName.equals( + FacetTypes.FLOW_VELOCITY_MAINCHANNEL_FILTERED) + ) { FlowVelocityData fData = (FlowVelocityData) data; points = fData.getMainChannelPoints(); // I hate facets! } else if (facetName.equals(FacetTypes.FLOW_VELOCITY_MEASUREMENT)) { @@ -79,11 +84,11 @@ @Override public boolean canHandle(String facettype) { - return facettype.equals(FacetTypes.FLOW_VELOCITY_MAINCHANNEL_FILTERED) || - facettype.equals(FacetTypes.FLOW_VELOCITY_MAINCHANNEL) || - facettype.equals(FacetTypes.FLOW_VELOCITY_TOTALCHANNEL_FILTERED) || - facettype.equals(FacetTypes.FLOW_VELOCITY_TOTALCHANNEL) || - facettype.equals(FacetTypes.FLOW_VELOCITY_MEASUREMENT); + return facettype.equals(FacetTypes.FLOW_VELOCITY_MAINCHANNEL_FILTERED) + || facettype.equals(FacetTypes.FLOW_VELOCITY_MAINCHANNEL) + || facettype.equals(FacetTypes.FLOW_VELOCITY_TOTALCHANNEL_FILTERED) + || facettype.equals(FacetTypes.FLOW_VELOCITY_TOTALCHANNEL) + || facettype.equals(FacetTypes.FLOW_VELOCITY_MEASUREMENT); } @Override diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/ManualPointsProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/ManualPointsProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/ManualPointsProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -31,7 +31,8 @@ public class ManualPointsProcessor extends DefaultProcessor { - private static final Logger log = Logger.getLogger(ManualPointsProcessor.class); + private static final Logger log = Logger.getLogger( + ManualPointsProcessor.class); @Override public void doOut( @@ -67,7 +68,8 @@ log.error("Could not decode json."); } - RiverAnnotation annotation = new RiverAnnotation(null, null, null, theme); + RiverAnnotation annotation = new RiverAnnotation( + null, null, null, theme); annotation.setTextAnnotations(xy); if (visible) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/MiscDischargeProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/MiscDischargeProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/MiscDischargeProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -143,7 +143,8 @@ boolean visible, int axisIndex ) { - XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); + XYSeries series = new StyledXYSeries( + bundle.getFacetDescription(), theme); Object wq = bundle.getData(generator.getCallContext()); if (wq instanceof double[][]) { double [][] data = (double [][]) wq; @@ -177,14 +178,16 @@ series.add(wqkms.getQ(i), wqkms.getW(i)); generator.addAxisSeries(series, axidx, visible); if(visible && theme.parseShowPointLabel()) { - List textAnnos = new ArrayList(); + List textAnnos = + new ArrayList(); XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( title, wqkms.getQ(i), // TODO add a percentage to the extend of W axis wqkms.getW(i)); textAnnos.add(anno); - RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, theme); + RiverAnnotation flysAnno = + new RiverAnnotation(null, null, null, theme); flysAnno.setTextAnnotations(textAnnos); generator.addAnnotations(flysAnno); } @@ -235,7 +238,8 @@ // TODO subtract gauge null point if at gauge. String title = bundle.getFacetDescription(); - List yMarks = new ArrayList(); + List yMarks = + new ArrayList(); for (double yPos: data[1]) { yMarks.add(new StickyAxisAnnotation( @@ -275,7 +279,8 @@ ) { double value = Double.valueOf( bundle.getData(generator.getCallContext()).toString()); - generator.addDomainMarker(new StyledValueMarker(value, theme), visible); + generator.addDomainMarker( + new StyledValueMarker(value, theme), visible); } protected void doHistoricalDischargeOutW( @@ -286,7 +291,8 @@ ) { double value = Double.valueOf( bundle.getData(generator.getCallContext()).toString()); - generator.addValueMarker(new StyledValueMarker(value, theme), visible); + generator.addValueMarker( + new StyledValueMarker(value, theme), visible); } private void doPointsOut( @@ -296,7 +302,8 @@ ThemeDocument theme, boolean visible ) { - XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); + XYSeries series = new StyledXYSeries( + bundle.getFacetDescription(), theme); StyledSeriesBuilder.addPoints(series, data, true); generator.addAxisSeries(series, axisName, visible); } @@ -322,14 +329,16 @@ series.add(wqkms.getQ(i), wqkms.getW(i)); generator.addAxisSeries(series, axisName, visible); if(visible && theme.parseShowPointLabel()) { - List textAnnos = new ArrayList(); + List textAnnos = + new ArrayList(); XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( title, wqkms.getQ(i), // TODO add a percentage to the extend of W axis wqkms.getW(i)); textAnnos.add(anno); - RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, theme); + RiverAnnotation flysAnno = new RiverAnnotation( + null, null, null, theme); flysAnno.setTextAnnotations(textAnnos); generator.addAnnotations(flysAnno); } @@ -365,7 +374,8 @@ @Override public String getAxisLabel(DiagramGenerator generator) { CallMeta meta = generator.getCallContext().getMeta(); - RiverAccess access = new RiverAccess((D4EArtifact)generator.getMaster()); + RiverAccess access = new RiverAccess((D4EArtifact)generator + .getMaster()); String unit = access.getRiver().getWstUnit().getName(); return Resources.getMsg( diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/Processor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/Processor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/Processor.java Fri Jan 19 11:23:42 2018 +0100 @@ -14,7 +14,8 @@ import org.dive4elements.river.exports.DiagramGenerator; /** - * A processor is intended to generate an output e.g. curve in a chart diagramm from + * A processor is intended to generate an output e.g. curve in a + * chart diagramm from * arbitrary data input which can be reused in several generators. * * @author Björn Ricks @@ -78,7 +79,8 @@ int index); /** - * Returns true if the Processor class is able to generate output for a facet type + * Returns true if the Processor class is able to generate + * output for a facet type * * @param facettype Name of the facet type * @return true if the facettype can be processed diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/QOutProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/QOutProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/QOutProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -49,7 +49,8 @@ boolean visible) { CallContext context = generator.getCallContext(); Object data = bundle.getData(context); - XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); + XYSeries series = new StyledXYSeries( + bundle.getFacetDescription(), theme); String facetName = bundle.getFacetName(); if (facetName.equals(FacetTypes.FLOW_VELOCITY_DISCHARGE)) { @@ -60,7 +61,8 @@ else { FastFlowVelocityMeasurementValue fData = (FastFlowVelocityMeasurementValue) data; - double[][] points = new double[][] {{fData.getStation()},{fData.getQ()}}; + double[][] points = new double[][] { + {fData.getStation()},{fData.getQ()}}; StyledSeriesBuilder.addPoints(series, points, true); } } else { @@ -82,7 +84,8 @@ CallContext context = generator.getCallContext(); WQKms wqkms = (WQKms) bundle.getData(context); - XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); + XYSeries series = new StyledXYSeries( + bundle.getFacetDescription(), theme); StyledSeriesBuilder.addStepPointsKmQ(series, wqkms); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/SQRelationProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/SQRelationProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/SQRelationProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -79,7 +79,8 @@ series = new StyledXYSeries(desc, theme); List xy = new ArrayList(); - DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT, + DateFormat dateFormat = DateFormat.getDateInstance( + DateFormat.SHORT, Resources.getLocale(context.getMeta())); for (SQ sq: sqs) { @@ -89,14 +90,16 @@ series.add(q, s, false); // Annotate with measurement date if (sq.getDate() != null) { - xy.add(new CollisionFreeXYTextAnnotation(dateFormat.format(sq.getDate()), q, s)); + xy.add(new CollisionFreeXYTextAnnotation( + dateFormat.format(sq.getDate()), q, s)); } } } if (visible && theme.parseShowPointLabel()) { - RiverAnnotation annotation = new RiverAnnotation("Messdatum", null, null, theme); + RiverAnnotation annotation = new RiverAnnotation( + "Messdatum", null, null, theme); annotation.setTextAnnotations(xy); generator.addAnnotations(annotation); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/process/WOutProcessor.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/process/WOutProcessor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/WOutProcessor.java Fri Jan 19 11:23:42 2018 +0100 @@ -53,13 +53,17 @@ CallContext context = generator.getCallContext(); Object data = bundle.getData(context); - XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); + XYSeries series = new StyledXYSeries( + bundle.getFacetDescription(), theme); // Handle non WKms data. - if (bundle.getFacetName().equals(FacetTypes.FLOW_VELOCITY_WATERLEVEL)) { + if ( + bundle.getFacetName().equals(FacetTypes.FLOW_VELOCITY_WATERLEVEL) + ) { FastFlowVelocityMeasurementValue fData = (FastFlowVelocityMeasurementValue) data; - double[][] points = new double[][] {{fData.getStation()},{fData.getW()}}; + double[][] points = new double[][] { + {fData.getStation()},{fData.getW()}}; StyledSeriesBuilder.addPoints(series, points, true); generator.addAxisSeries(series, axisName, visible); return; @@ -68,7 +72,9 @@ // Handle WKms data. WKms wkms = (WKms) data; - if (bundle.getFacetName().equals(FacetTypes.DISCHARGE_LONGITUDINAL_C)) { + if ( + bundle.getFacetName().equals(FacetTypes.DISCHARGE_LONGITUDINAL_C) + ) { // Add corrected values WQCKms wqckms = (WQCKms) data; int size = wqckms.size(); @@ -90,17 +96,21 @@ StyledSeriesBuilder.addUpperBand(seriesUp, wkms, bandWidth); StyledSeriesBuilder.addLowerBand(seriesDown, wkms, bandWidth); - StyledAreaSeriesCollection area = new StyledAreaSeriesCollection(theme); + StyledAreaSeriesCollection area = + new StyledAreaSeriesCollection(theme); area.addSeries(seriesUp); area.addSeries(seriesDown); area.setMode(StyledAreaSeriesCollection.FILL_MODE.BETWEEN); generator.addAreaSeries(area, axisName, visible); } - if (bundle.getFacetName().equals(FacetTypes.LONGITUDINAL_W) || - bundle.getFacetName().equals(FacetTypes.DISCHARGE_LONGITUDINAL_W) || - bundle.getFacetName().equals(FacetTypes.STATIC_WQKMS_W) || - bundle.getFacetName().equals(FacetTypes.DISCHARGE_LONGITUDINAL_C)) { + if (bundle.getFacetName().equals(FacetTypes.LONGITUDINAL_W) + || bundle.getFacetName().equals( + FacetTypes.DISCHARGE_LONGITUDINAL_W) + || bundle.getFacetName().equals( + FacetTypes.STATIC_WQKMS_W) + || bundle.getFacetName().equals( + FacetTypes.DISCHARGE_LONGITUDINAL_C)) { /* Only use W values to check if the diagram should be inverted * see flys/issue1290 for details */ log.debug("Check for RTL data: "+ wkms.guessRTLData()); @@ -120,7 +130,8 @@ CallContext context = generator.getCallContext(); - XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme); + XYSeries series = new StyledXYSeries( + bundle.getFacetDescription(), theme); WKms wkms = (WKms) bundle.getData(context); @@ -137,16 +148,19 @@ StyledSeriesBuilder.addUpperBand(seriesUp, wkms, bandWidth); StyledSeriesBuilder.addLowerBand(seriesDown, wkms, bandWidth); - StyledAreaSeriesCollection area = new StyledAreaSeriesCollection(theme); + StyledAreaSeriesCollection area = + new StyledAreaSeriesCollection(theme); area.addSeries(seriesUp); area.addSeries(seriesDown); area.setMode(StyledAreaSeriesCollection.FILL_MODE.BETWEEN); generator.addAreaSeries(area, index, visible); } - if (bundle.getFacetName().equals(FacetTypes.LONGITUDINAL_W) || - bundle.getFacetName().equals(FacetTypes.DISCHARGE_LONGITUDINAL_W) || - bundle.getFacetName().equals(FacetTypes.STATIC_WQKMS_W)) { + if (bundle.getFacetName().equals(FacetTypes.LONGITUDINAL_W) + || bundle.getFacetName().equals( + FacetTypes.DISCHARGE_LONGITUDINAL_W) + || bundle.getFacetName().equals( + FacetTypes.STATIC_WQKMS_W)) { /* Only use W values to check if the diagram should be inverted * see flys/issue1290 for details */ generator.setInverted(wkms.guessRTLData()); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java Fri Jan 19 11:23:42 2018 +0100 @@ -249,7 +249,10 @@ } } - protected List data2StringArrays(SQResult result, boolean includeMeasurements) { + protected List data2StringArrays( + SQResult result, + boolean includeMeasurements + ) { String km = Formatter.getSQRelationKM(context ).format(result.getKm()); List retval = new ArrayList(); @@ -280,7 +283,8 @@ /* The std_dev parameter contains the standard error actually */ sd = fThreeFormatter.format(parameters.getValue(0, "std_dev")); max_q = fZeroFormatter.format(parameters.getValue(0, "max_q")); - c_ferguson = fTwoFormatter.format(parameters.getValue(0, "c_ferguson")); + c_ferguson = fTwoFormatter.format( + parameters.getValue(0, "c_ferguson")); c_duan = fTwoFormatter.format(parameters.getValue(0, "c_duan")); r2 = fTwoFormatter.format(parameters.getValue(0, "r2")); @@ -393,7 +397,8 @@ source.addMetaData("date", df.format(new Date())); SQRelationAccess access = new SQRelationAccess(arti); - source.addMetaData("location", "KM " + getKmFormatter().format(access.getLocation())); + source.addMetaData( + "location", "KM " + getKmFormatter().format(access.getLocation())); DateRange period = access.getPeriod(); source.addMetaData("periods", df.format(period.getFrom()) + " - " + @@ -402,7 +407,8 @@ source.addMetaData("outliertest", Resources.getMsg(meta, access.getOutlierMethod(), access.getOutlierMethod())); - source.addMetaData("outliers", Formatter.getRawFormatter(context).format( + source.addMetaData( + "outliers", Formatter.getRawFormatter(context).format( access.getOutliers())); source.addMetaData("calculation", Resources.getMsg( @@ -418,7 +424,8 @@ source.addMetaData("msName", ""); } - String measurementStationGaugeName = access.getMeasurementStationGaugeName(); + String measurementStationGaugeName = access + .getMeasurementStationGaugeName(); if (measurementStationGaugeName != null) { source.addMetaData("msGauge", measurementStationGaugeName); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/jfree/AnnotationHelper.java --- a/artifacts/src/main/java/org/dive4elements/river/jfree/AnnotationHelper.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/jfree/AnnotationHelper.java Fri Jan 19 11:23:42 2018 +0100 @@ -160,7 +160,8 @@ textStyle.apply(ta); } ta.setY(area.above(0.05d, ta.getY())); - plot.getRenderer().addAnnotation(ta, org.jfree.ui.Layer.FOREGROUND); + plot.getRenderer().addAnnotation( + ta, org.jfree.ui.Layer.FOREGROUND); } } } @@ -196,7 +197,9 @@ if (annotation.atX()) { textAnnotation = new CollisionFreeXYTextAnnotation( - annotation.getText(), annotation.getPos(), area.ofGround(TEXT_OFF)); + annotation.getText(), + annotation.getPos(), + area.ofGround(TEXT_OFF)); // OPTIMIZE externalize the calculation involving PI. //textAnnotation.setRotationAngle(270f*Math.PI/180f); lineAnnotation = createGroundStickAnnotation( @@ -230,7 +233,8 @@ XYLineAnnotation hitLineAnnotation = createStickyLineAnnotation( StickyAxisAnnotation.SimpleAxis.X_AXIS, - annotation.getHitPoint(), annotation.getPos(),// annotation.getHitPoint(), + annotation.getHitPoint(), annotation.getPos(), + // annotation.getHitPoint(), area2, lineStyle); renderer.addAnnotation(hitLineAnnotation, org.jfree.ui.Layer.BACKGROUND); @@ -248,10 +252,13 @@ } else { // Stick to the left y-axis. textAnnotation = new CollisionFreeXYTextAnnotation( - annotation.getText(), area.ofLeft(TEXT_OFF), annotation.getPos()); + annotation.getText(), + area.ofLeft(TEXT_OFF), + annotation.getPos()); textAnnotation.setRotationAnchor(TextAnchor.CENTER_LEFT); textAnnotation.setTextAnchor(TextAnchor.CENTER_LEFT); - lineAnnotation = createLeftStickAnnotation(area, annotation.getPos(), lineStyle); + lineAnnotation = createLeftStickAnnotation( + area, annotation.getPos(), lineStyle); if (!Float.isNaN(annotation.getHitPoint()) && theme != null) { // New line annotation to hit curve. if (theme.parseShowHorizontalLine()) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/jfree/AxisDataset.java --- a/artifacts/src/main/java/org/dive4elements/river/jfree/AxisDataset.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/jfree/AxisDataset.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,8 +1,8 @@ /* Copyright (C) 2013 by Bundesanstalt für Gewässerkunde * Software engineering by Intevation GmbH * - * XYDatasethis file is Free Software under the GNU AGPL (>=v3) - * and comes with ABSOLUXYDatasetELY NO WARRANTY! Check out the + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the * documentation coming with Dive4Elements River for details. */ @@ -80,7 +80,8 @@ newRange = ((RangeInfo) dataset).getRangeBounds(false); } else if (dataset instanceof TimeSeriesCollection) { /* Lalala <3 Jfreechart's class hirarchy */ - newRange = ((TimeSeriesCollection) dataset).getRangeBounds(false); + newRange = ((TimeSeriesCollection)dataset) + .getRangeBounds(false); } /* Now we only expand as we also only add new data */ diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/jfree/EnhancedLineAndShapeRenderer.java --- a/artifacts/src/main/java/org/dive4elements/river/jfree/EnhancedLineAndShapeRenderer.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/jfree/EnhancedLineAndShapeRenderer.java Fri Jan 19 11:23:42 2018 +0100 @@ -89,7 +89,8 @@ String text, float textX, float textY, Color bgColor ) { Rectangle2D hotspotBox = g2.getFontMetrics().getStringBounds(text, g2); - float w = (float) hotspotBox.getWidth(), h = (float) hotspotBox.getHeight(); + float w = (float)hotspotBox.getWidth(); + float h = (float)hotspotBox.getHeight(); hotspotBox.setRect(textX, textY-h, w, h); Color oldColor = g2.getColor(); g2.setColor(bgColor); @@ -102,16 +103,24 @@ * Whether or not a specific item in a series (maybe the maxima) should * be rendered with shape. */ - public boolean getItemShapeVisible(XYDataset dataset, int series, int item){ + public boolean getItemShapeVisible( + XYDataset dataset, + int series, + int item + ){ if (super.getItemShapeVisible(series, item)) { return true; } - if (isMinimumShapeVisible(series) && isMinimum(dataset, series, item)) { + if (isMinimumShapeVisible(series) + && isMinimum(dataset, series, item) + ) { return true; } - if (isMaximumShapeVisible(series) && isMaximum(dataset, series, item)) { + if (isMaximumShapeVisible(series) + && isMaximum(dataset, series, item) + ) { return true; } @@ -215,7 +224,8 @@ // OPTIMIZE: instead of calculating minimum and maximum for every // point, calculate it just once (assume that dataset // content does not change during rendering). - // NOTE: Above OPTIMIZE might already be fulfilled to most extend. + // NOTE: Above OPTIMIZE might already be fulfilled to + // most extend. boolean isMinimum = isMinimumShapeVisible(series) && isMinimum(dataset, series, item); @@ -299,11 +309,13 @@ && isShowLineLabel(series) && isMinimumX (dataset, series, item) ) { - XYSeries xYSeries = ((XYSeriesCollection) dataset).getSeries(series); + XYSeries xYSeries = ((XYSeriesCollection)dataset) + .getSeries(series); String waterlevelLabel = (xYSeries instanceof HasLabel) ? ((HasLabel)xYSeries).getLabel() : xYSeries.getKey().toString(); - // TODO Force water of some German rivers to flow direction mountains. + // TODO Force water of some German rivers to flow + // direction mountains. Font oldFont = g2.getFont(); @@ -330,8 +342,13 @@ CollisionFreeLineLabelEntity.class)) { xx += 5f; hotspot = TextUtilities.calculateRotatedStringBounds( - waterlevelLabel, g2, (float)xx, (float)yy-3f, TextAnchor.CENTER_LEFT, - 0f, TextAnchor.CENTER_LEFT); + waterlevelLabel, + g2, + (float)xx, + (float)yy-3f, + TextAnchor.CENTER_LEFT, + 0f, + TextAnchor.CENTER_LEFT); } // Register to avoid collissions. diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/jfree/RiverAnnotation.java --- a/artifacts/src/main/java/org/dive4elements/river/jfree/RiverAnnotation.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/jfree/RiverAnnotation.java Fri Jan 19 11:23:42 2018 +0100 @@ -38,13 +38,18 @@ protected String label; - public RiverAnnotation(String label, List annotations) { + public RiverAnnotation( + String label, + List annotations + ) { this(label, annotations, null, null); } /** Create annotations, parameter might be null. */ - public RiverAnnotation(String label, List annotations, + public RiverAnnotation( + String label, + List annotations, List bAnnotations ) { this(label, annotations, bAnnotations, null); @@ -52,16 +57,19 @@ /** Create annotations, parameter might be null. */ - public RiverAnnotation(String label, List annotations, - List bAnnotations, ThemeDocument theme + public RiverAnnotation( + String label, + List annotations, + List bAnnotations, + ThemeDocument theme ) { this.label = label; this.axisTextAnnotations = (annotations != null) - ? annotations - : Collections.emptyList(); + ? annotations + : Collections.emptyList(); this.boxes = (bAnnotations != null) - ? bAnnotations - : Collections.emptyList(); + ? bAnnotations + : Collections.emptyList(); this.textAnnotations = Collections.emptyList(); this.setTheme(theme); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/jfree/StableXYDifferenceRenderer.java --- a/artifacts/src/main/java/org/dive4elements/river/jfree/StableXYDifferenceRenderer.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/jfree/StableXYDifferenceRenderer.java Fri Jan 19 11:23:42 2018 +0100 @@ -147,7 +147,8 @@ public class StableXYDifferenceRenderer extends AbstractXYItemRenderer implements XYItemRenderer, PublicCloneable { - private static Logger log = Logger.getLogger(StableXYDifferenceRenderer.class); + private static Logger log = Logger.getLogger( + StableXYDifferenceRenderer.class); public static final int CALCULATE_POSITIVE_AREA = 1; public static final int CALCULATE_NEGATIVE_AREA = 2; @@ -969,8 +970,13 @@ dataset, series, item, crosshairState); } - // Find geometric middle, calculate area and paint a string with it here. - if (pass == 1 && this.labelArea && areaLabelNumberFormat != null && areaLabelTamplate != null) { + // Find geometric middle, calculate area and paint + // a string with it here. + if (pass == 1 + && this.labelArea + && areaLabelNumberFormat != null + && areaLabelTamplate != null + ) { double center_x = centroid.getX(); double center_y = centroid.getY(); center_x = domainAxis.valueToJava2D(center_x, dataArea, @@ -1821,7 +1827,8 @@ // toolTipText, urlText, line, stroke, paint); if (drawOutline) { - // TODO Include outline style in legenditem (there is a constructor for that) + // TODO Include outline style in legenditem + // (there is a constructor for that) } // Filled Shape ("Area-Style"). @@ -1888,7 +1895,8 @@ * @throws CloneNotSupportedException if the renderer cannot be cloned. */ public Object clone() throws CloneNotSupportedException { - StableXYDifferenceRenderer clone = (StableXYDifferenceRenderer) super.clone(); + StableXYDifferenceRenderer clone = + (StableXYDifferenceRenderer) super.clone(); clone.legendShape = ShapeUtilities.clone(this.legendShape); return clone; } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/jfree/StyledAreaSeriesCollection.java --- a/artifacts/src/main/java/org/dive4elements/river/jfree/StyledAreaSeriesCollection.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/jfree/StyledAreaSeriesCollection.java Fri Jan 19 11:23:42 2018 +0100 @@ -32,7 +32,7 @@ /** MODE in use. */ protected FILL_MODE mode; - /** The theme-document with attributes about actual visual representation. */ + /** Theme-document with attributes about actual visual representation. */ protected ThemeDocument theme; @@ -72,13 +72,16 @@ applyOutlineStyle(renderer); applyShowAreaLabel(renderer); if (mode == FILL_MODE.UNDER) { - renderer.setAreaCalculationMode(StableXYDifferenceRenderer.CALCULATE_NEGATIVE_AREA); + renderer.setAreaCalculationMode( + StableXYDifferenceRenderer.CALCULATE_NEGATIVE_AREA); } else if (mode == FILL_MODE.ABOVE) { - renderer.setAreaCalculationMode(StableXYDifferenceRenderer.CALCULATE_POSITIVE_AREA); + renderer.setAreaCalculationMode( + StableXYDifferenceRenderer.CALCULATE_POSITIVE_AREA); } else { - renderer.setAreaCalculationMode(StableXYDifferenceRenderer.CALCULATE_ALL_AREA); + renderer.setAreaCalculationMode( + StableXYDifferenceRenderer.CALCULATE_ALL_AREA); } // Apply text style. diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/jfree/StyledXYSeries.java --- a/artifacts/src/main/java/org/dive4elements/river/jfree/StyledXYSeries.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/jfree/StyledXYSeries.java Fri Jan 19 11:23:42 2018 +0100 @@ -49,7 +49,11 @@ } - public StyledXYSeries(String key, ThemeDocument theme, XYSeries unstyledSeries) { + public StyledXYSeries( + String key, + ThemeDocument theme, + XYSeries unstyledSeries + ) { this(key, theme); add(unstyledSeries); } @@ -68,7 +72,12 @@ * to one extrema which can cause problems in certain * algorithms. */ - public StyledXYSeries(String key, boolean sorted, ThemeDocument theme, Shape shape) { + public StyledXYSeries( + String key, + boolean sorted, + ThemeDocument theme, + Shape shape + ) { super(key, sorted); setStyle(new XYStyle(theme, shape)); this.label = key.toString(); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/jfree/XYMetaSeriesCollection.java --- a/artifacts/src/main/java/org/dive4elements/river/jfree/XYMetaSeriesCollection.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/jfree/XYMetaSeriesCollection.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.jfree; import java.util.Map; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/jfree/XYStyle.java --- a/artifacts/src/main/java/org/dive4elements/river/jfree/XYStyle.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/jfree/XYStyle.java Fri Jan 19 11:23:42 2018 +0100 @@ -49,7 +49,10 @@ * whether to draw lines and/or points. */ @Override - public XYLineAndShapeRenderer applyTheme(XYLineAndShapeRenderer r, int idx) { + public XYLineAndShapeRenderer applyTheme( + XYLineAndShapeRenderer r, + int idx + ) { this.renderer = r; if (shape != null) { r.setShape(shape); @@ -77,7 +80,8 @@ applyLineLabelBGColor(r, idx); // Point label styles - // TODO: Currently point label are annotations and are not drawn this way + // TODO: Currently point label are annotations and + // are not drawn this way /* applyShowPointLabelBG(r, idx); applyLinePointFont(r, idx); @@ -123,7 +127,8 @@ return; } boolean showLabelLine = theme.parseLabelShowBackground(); - ((EnhancedLineAndShapeRenderer)r).setShowLineLabelBG(idx, showLabelLine); + ((EnhancedLineAndShapeRenderer)r).setShowLineLabelBG( + idx, showLabelLine); } /** Tell the renderer which font (and -size and -style) to use for diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/themes/ThemeDocument.java --- a/artifacts/src/main/java/org/dive4elements/river/themes/ThemeDocument.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/themes/ThemeDocument.java Fri Jan 19 11:23:42 2018 +0100 @@ -31,7 +31,8 @@ private static final String MSG_ISOBATH_CLASS = "floodmap.isobath.class"; - private static final String MSG_ISOBATH_LASTCLASS = "floodmap.isobath.lastclass"; + private static final String MSG_ISOBATH_LASTCLASS = + "floodmap.isobath.lastclass"; public final static String FILL_COLOR = "fillcolor"; @@ -664,9 +665,12 @@ int numClasses = (int)((to - from) / step + 1); - float rd = (endColor.getRed() - startColor.getRed()) / (float)numClasses; - float gd = (endColor.getGreen() - startColor.getGreen()) / (float)numClasses; - float bd = (endColor.getBlue() - startColor.getBlue()) / (float)numClasses; + float rd = (endColor.getRed() - startColor.getRed()) + / (float)numClasses; + float gd = (endColor.getGreen() - startColor.getGreen()) + / (float)numClasses; + float bd = (endColor.getBlue() - startColor.getBlue()) + / (float)numClasses; for (int n = 0; n < numClasses; n++) { StringBuilder newColor = new StringBuilder(); @@ -676,8 +680,10 @@ newColor.append(' '); newColor.append(startColor.getBlue() + Math.round(n * bd)); - String expr = createWSPLGENClassExpression(from + n * step, step, n + 1, numClasses); - String name = createWSPLGENClassName(from + n * step, step, n + 1, numClasses, meta); + String expr = createWSPLGENClassExpression( + from + n * step, step, n + 1, numClasses); + String name = createWSPLGENClassName( + from + n * step, step, n + 1, numClasses, meta); Clazz c = new Clazz(name); Style s = new Style(); @@ -694,7 +700,12 @@ } - protected static String createWSPLGENClassExpression(float val, float step, int idx, int maxIdx) { + protected static String createWSPLGENClassExpression( + float val, + float step, + int idx, + int maxIdx + ) { if (idx < maxIdx) { return "[DIFF] >= " + val + " AND [DIFF] < " + (val + step); } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/utils/ArtifactMapfileGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/utils/ArtifactMapfileGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/utils/ArtifactMapfileGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -33,7 +33,8 @@ public class ArtifactMapfileGenerator extends MapfileGenerator { - private static Logger log = Logger.getLogger(ArtifactMapfileGenerator.class); + private static Logger log = Logger.getLogger( + ArtifactMapfileGenerator.class); public static final String FLOODMAP_UESK_KEY = "floodmap.uesk"; @@ -43,17 +44,20 @@ @Override protected String getVelocityLogfile() { - return RiverUtils.getXPathString(RiverUtils.XPATH_FLOODMAP_VELOCITY_LOGFILE); + return RiverUtils.getXPathString( + RiverUtils.XPATH_FLOODMAP_VELOCITY_LOGFILE); } @Override protected String getMapserverTemplatePath() { - return RiverUtils.getXPathString(RiverUtils.XPATH_FLOODMAP_MAPSERVER_TEMPLATE_PATH); + return RiverUtils.getXPathString( + RiverUtils.XPATH_FLOODMAP_MAPSERVER_TEMPLATE_PATH); } @Override public String getMapserverUrl() { - return RiverUtils.getXPathString(RiverUtils.XPATH_FLOODMAP_MAPSERVER_URL); + return RiverUtils.getXPathString( + RiverUtils.XPATH_FLOODMAP_MAPSERVER_URL); } /** @@ -264,11 +268,13 @@ @Override protected String getMapfilePath() { - return RiverUtils.getXPathString(RiverUtils.XPATH_FLOODMAP_MAPFILE_PATH); + return RiverUtils.getXPathString( + RiverUtils.XPATH_FLOODMAP_MAPFILE_PATH); } @Override protected String getMapfileTemplate() { - return RiverUtils.getXPathString(RiverUtils.XPATH_FLOODMAP_MAPFILE_TEMPLATE); + return RiverUtils.getXPathString( + RiverUtils.XPATH_FLOODMAP_MAPFILE_TEMPLATE); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/utils/DataUtil.java --- a/artifacts/src/main/java/org/dive4elements/river/utils/DataUtil.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/utils/DataUtil.java Fri Jan 19 11:23:42 2018 +0100 @@ -27,7 +27,10 @@ return ((d1dir && d2dir) || (!d1dir && !d2dir)) && size > 1; } - public static boolean guessDataIncreasing(TDoubleArrayList data, float factor) { + public static boolean guessDataIncreasing( + TDoubleArrayList data, + float factor + ) { int N = data.size(); if (N < 2) return false; diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java --- a/artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java Fri Jan 19 11:23:42 2018 +0100 @@ -49,7 +49,11 @@ private DoubleUtil() { } - public static final double [] explode(double from, double to, double step) { + public static final double [] explode( + double from, + double to, + double step + ) { return explode(from, to, step, DEFAULT_STEP_PRECISION); } @@ -62,7 +66,8 @@ } /** - * Returns array with values from parameter from to to with given step width. + * Returns array with values from parameter from to to + * with given step width. * from and to are included. */ public static final double [] explode( @@ -316,8 +321,12 @@ /** Convieniance function for results to get an interpolator. * This is basically a static wrapper to for LinearInterpolator.interpolate * with error handling. Returns null on error.*/ - public static PolynomialSplineFunction getLinearInterpolator(double[] x, double[] y) { - /* We want copies here to remove NaNs but don't change the original data. */ + public static PolynomialSplineFunction getLinearInterpolator( + double[] x, + double[] y + ) { + /* We want copies here to remove NaNs but don't + * change the original data. */ TDoubleArrayList tX = new TDoubleArrayList(); TDoubleArrayList tY = new TDoubleArrayList(); for (int i = 0; i < x.length; i++) { @@ -330,17 +339,23 @@ try { return lpol.interpolate(tX.toNativeArray(), tY.toNativeArray()); } catch (DimensionMismatchException e) { - log.error("KMs and Result values have different sizes. Failed to interpolate: " + - e.getMessage()); + log.error("KMs and Result values have different sizes. " + + "Failed to interpolate: " + + e.getMessage()); } catch (NonMonotonousSequenceException e) { - log.error("KMs are not monotonous. Failed to interpolate: " + e.getMessage()); + log.error("KMs are not monotonous. Failed to interpolate: " + + e.getMessage()); } catch (NumberIsTooSmallException e) { - log.error("Result is to small. Failed to interpolate: " + e.getMessage()); + log.error("Result is to small. Failed to interpolate: " + + e.getMessage()); } return null; } - public static PolynomialSplineFunction getLinearInterpolator(TDoubleArrayList x, TDoubleArrayList y) { + public static PolynomialSplineFunction getLinearInterpolator( + TDoubleArrayList x, + TDoubleArrayList y + ) { return getLinearInterpolator(x.toNativeArray(), y.toNativeArray()); } } diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java --- a/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java Fri Jan 19 11:23:42 2018 +0100 @@ -153,7 +153,11 @@ /** * Returns a number formatter that uses an exponent after max digits. */ - public static NumberFormat getScientificFormater(CallContext c, int min, int max) { + public static NumberFormat getScientificFormater( + CallContext c, + int min, + int max + ) { NumberFormat nf = getRawFormatter(c); if (nf instanceof DecimalFormat) { DecimalFormat df = (DecimalFormat)nf; @@ -407,7 +411,9 @@ } - public static NumberFormat getMiddleBedHeightSounding(CallContext context) { + public static NumberFormat getMiddleBedHeightSounding( + CallContext context + ) { return getFormatter( context, MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MIN_DIGITS, diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/utils/GeometryUtils.java --- a/artifacts/src/main/java/org/dive4elements/river/utils/GeometryUtils.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/utils/GeometryUtils.java Fri Jan 19 11:23:42 2018 +0100 @@ -85,7 +85,7 @@ } /** - * Returns the boundary of Envelope env in OpenLayers representation. + * Returns boundary of Envelope env in OpenLayers representation. * * @param env The envelope of a geometry. * @@ -140,7 +140,7 @@ * @param name The name of the FeatureType. * @param srs The SRS (e.g. "EPSG:31466"). * @param geometryType The geometry type's class (e.g. Polygon.class). - * @param attrs Optional. An object with attribute-name/attribute-class pairs + * @param attrs Optional. Object with attribute-name/attribute-class pairs * where index 0 specifies the name as string and index 1 the * ype as class. * @@ -325,7 +325,8 @@ FeatureWriter writer = newDataStore.getFeatureWriter(typeName, transaction); - SimpleFeatureIterator iterator = (SimpleFeatureIterator) collection.features(); + SimpleFeatureIterator iterator = + (SimpleFeatureIterator)collection.features(); while (iterator.hasNext()){ SimpleFeature feature = iterator.next(); diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/utils/MapUtils.java --- a/artifacts/src/main/java/org/dive4elements/river/utils/MapUtils.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/utils/MapUtils.java Fri Jan 19 11:23:42 2018 +0100 @@ -72,7 +72,8 @@ String host = m.group(2); String port = m.group(3); String backend = m.group(4); - connection = user + "/" + pass + "@" + host + ":" + port + "/" + backend; + connection = user + "/" + pass + + "@" + host + ":" + port + "/" + backend; } else { if (groups < 4) { diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/utils/Pair.java --- a/artifacts/src/main/java/org/dive4elements/river/utils/Pair.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/utils/Pair.java Fri Jan 19 11:23:42 2018 +0100 @@ -13,7 +13,7 @@ /** * @param * @param - * @author Sascha L. Teichmann + * @author Sascha L. Teichmann */ public final class Pair implements Serializable diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/utils/RiverMapfileGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/utils/RiverMapfileGenerator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/utils/RiverMapfileGenerator.java Fri Jan 19 11:23:42 2018 +0100 @@ -106,7 +106,12 @@ writeMapfile(riverFiles); } - protected void createRiverAxisLayer(String riverName, int riverID, String srid, String extend) { + protected void createRiverAxisLayer( + String riverName, + int riverID, + String srid, + String extend + ) { LayerInfo layerInfo = new LayerInfo(); layerInfo.setName(riverName); layerInfo.setConnection(MapUtils.getConnection()); @@ -147,7 +152,8 @@ @Override protected String getMapserverTemplatePath() { - return RiverUtils.getXPathString(XPATH_RIVERMAP_MAPSERVER_TEMPLATE_PATH); + return RiverUtils.getXPathString( + XPATH_RIVERMAP_MAPSERVER_TEMPLATE_PATH); } @Override diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java --- a/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java Fri Jan 19 11:23:42 2018 +0100 @@ -51,7 +51,8 @@ /** * Static helper methods to e.g. access D4EArtifacts data. * - * @deprecated Don't use RiverUtils to get data from an {@link Artifact} anymore. + * @deprecated Don't use RiverUtils to get data from an + * {@link Artifact} anymore. * Instead use and/or create a {@link Access} class hierarchy. **/ @Deprecated @@ -61,7 +62,7 @@ private static Logger log = Logger.getLogger(RiverUtils.class); /** - * An enum that represents the 5 possible WQ modes in FLYS. The 5 values are + * Enum that represents the 5 possible WQ modes in FLYS. The 5 values are * QFREE QGAUGE WGAUGE WFREE and NONE. */ public static enum WQ_MODE { QFREE, QGAUGE, WFREE, WGAUGE, NONE }; @@ -272,7 +273,9 @@ if (locationStr == null || locationStr.length() == 0) { if (flys instanceof WINFOArtifact) { WINFOArtifact winfo = (WINFOArtifact) flys; - if (winfo.getReferenceStartKm() != null && winfo.getReferenceEndKms() != null) { + if (winfo.getReferenceStartKm() != null + && winfo.getReferenceEndKms() != null + ) { return new double[] { winfo.getReferenceStartKm().doubleValue(), @@ -589,7 +592,8 @@ for (MainValue mv: mainValues) { if (mv.getValue().doubleValue() == value) { - log.debug("Found named main value: " + mv.getMainValue().getName()); + log.debug("Found named main value: " + + mv.getMainValue().getName()); return mv.getMainValue().getName(); } } @@ -695,10 +699,12 @@ String diffs = ""; for(int i = 0; i < datas.length; i+=2) { // e.g.: - // 42537f1e-3522-42ef-8968-635b03d8e9c6;longitudinal_section.w;1 - WKms minuendWKms = wState.getWKms(StringUtil.unbracket(datas[i+0]), + //42537f1e-3522-42ef-8968-635b03d8e9c6;longitudinal_section.w;1 + WKms minuendWKms = wState.getWKms( + StringUtil.unbracket(datas[i + 0]), context, 0, 0); - WKms subtrahendWKms = wState.getWKms(StringUtil.unbracket(datas[i+1]), + WKms subtrahendWKms = wState.getWKms( + StringUtil.unbracket(datas[i + 1]), context, 0, 0); if (minuendWKms != null && subtrahendWKms != null) { diffs += StringUtil.wWrap(minuendWKms.getName()) diff -r 7bbfb24e6eec -r 28df64078f27 artifacts/src/main/java/org/dive4elements/river/wsplgen/FacetCreator.java --- a/artifacts/src/main/java/org/dive4elements/river/wsplgen/FacetCreator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/wsplgen/FacetCreator.java Fri Jan 19 11:23:42 2018 +0100 @@ -168,7 +168,8 @@ hash, getUrl()); - barriers.addLayer(MapfileGenerator.MS_BARRIERS_PREFIX + artifact.identifier()); + barriers.addLayer( + MapfileGenerator.MS_BARRIERS_PREFIX + artifact.identifier()); barriers.setSrid(getSrid()); barriers.setExtent(getBounds()); diff -r 7bbfb24e6eec -r 28df64078f27 backend/pom.xml --- a/backend/pom.xml Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/pom.xml Fri Jan 19 11:23:42 2018 +0100 @@ -82,6 +82,28 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.0.0 + + ../checkstyle.xml + UTF-8 + + + + validate + validate + + true + true + + + check + + + + diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/backend/utils/DBCPConnectionProvider.java --- a/backend/src/main/java/org/dive4elements/river/backend/utils/DBCPConnectionProvider.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/backend/utils/DBCPConnectionProvider.java Fri Jan 19 11:23:42 2018 +0100 @@ -44,10 +44,10 @@ import org.hibernate.cfg.Environment; /** - *

A connection provider that uses an Apache commons DBCP connection pool.

+ * A connection provider that uses an Apache commons DBCP connection pool. * - *

To use this connection provider set:
- * hibernate.connection.provider_class org.hibernate.connection.DBCPConnectionProvider

+ * To use this connection provider set hibernate.connection.provider_class + * to org.hibernate.connection.DBCPConnectionProvider * *
Supported Hibernate properties:
  *   hibernate.connection.driver_class
@@ -61,18 +61,8 @@
  * 
* All DBCP properties are also supported by using the hibernate.dbcp prefix. * A complete list can be found on the DBCP configuration page: - * http://jakarta.apache.org/commons/dbcp/configuration.html. + * http://jakarta.apache.org/commons/dbcp/configuration.html *
- *
Example:
- *   hibernate.connection.provider_class org.hibernate.connection.DBCPConnectionProvider
- *   hibernate.connection.driver_class org.hsqldb.jdbcDriver
- *   hibernate.connection.username sa
- *   hibernate.connection.password
- *   hibernate.connection.url jdbc:hsqldb:test
- *   hibernate.connection.pool_size 20
- *   hibernate.dbcp.initialSize 10
- *   hibernate.dbcp.maxWait 3000
- *   hibernate.dbcp.validationQuery select 1 from dual
* *

More information about configuring/using DBCP can be found on the * DBCP website. @@ -123,7 +113,9 @@ String isolationLevel = props.getProperty(Environment.ISOLATION); if (isolationLevel != null && (isolationLevel = isolationLevel.trim()).length() > 0) { - dbcpProperties.put("defaultTransactionIsolation", isolationLevel); + dbcpProperties.put( + "defaultTransactionIsolation", + isolationLevel); } // Turn off autocommit (unless autocommit property is set) @@ -132,7 +124,9 @@ && (autocommit = autocommit.trim()).length() > 0) { dbcpProperties.put("defaultAutoCommit", autocommit); } else { - dbcpProperties.put("defaultAutoCommit", String.valueOf(Boolean.FALSE)); + dbcpProperties.put( + "defaultAutoCommit", + String.valueOf(Boolean.FALSE)); } // Pool size @@ -169,7 +163,8 @@ // Copy all DBCP properties removing the prefix for (Iterator iter = props.entrySet().iterator(); - iter.hasNext(); ) { + iter.hasNext(); + ) { Map.Entry entry = (Map.Entry)iter.next(); String key = (String)entry.getKey(); if (key.startsWith(PREFIX)) { @@ -206,7 +201,8 @@ // This needs to be done manually as it is somehow ignored // by the BasicDataSourceFactory if you set it as a dbcpProperty - String connectionInitSqls = props.getProperty("connectionInitSqls"); + String connectionInitSqls = props.getProperty( + "connectionInitSqls"); if (connectionInitSqls != null) { String[] statements = connectionInitSqls.split(";"); ds.setConnectionInitSqls(Arrays.asList(statements)); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/backend/utils/DateGuesser.java --- a/backend/src/main/java/org/dive4elements/river/backend/utils/DateGuesser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/backend/utils/DateGuesser.java Fri Jan 19 11:23:42 2018 +0100 @@ -45,13 +45,16 @@ Pattern.compile("^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2})$"); public static final Pattern YYYY_MM_DDThh_mm_ss = - Pattern.compile("^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})$"); + Pattern.compile( + "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})$"); public static final Pattern DD_MM_YYYYThh_mm = - Pattern.compile("^(\\d{1,2})\\.(\\d{1,2})\\.(\\d{2,4})T(\\d{1,2}):(\\d{2})$"); + Pattern.compile( + "^(\\d{1,2})\\.(\\d{1,2})\\.(\\d{2,4})T(\\d{1,2}):(\\d{2})$"); public static final Pattern DD_MM_YYYYThh_mm_ss = - Pattern.compile("^(\\d{1,2})\\.(\\d{1,2})\\.(\\d{2,4})T(\\d{1,2}):(\\d{2}):(\\d{2})$"); + Pattern.compile("^(\\d{1,2})\\.(\\d{1,2})\\.(\\d{2,4})" + + "T(\\d{1,2}):(\\d{2}):(\\d{2})$"); public static final Pattern DDMMYY = Pattern.compile("^(\\d{2})(\\d{2})(\\d{2})$"); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/backend/utils/StringUtil.java --- a/backend/src/main/java/org/dive4elements/river/backend/utils/StringUtil.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/backend/utils/StringUtil.java Fri Jan 19 11:23:42 2018 +0100 @@ -318,7 +318,11 @@ return n; } - public static final String ensureWidthPadLeft(String s, int width, char pad) { + public static final String ensureWidthPadLeft( + String s, + int width, + char pad + ) { int N = s.length(); if (N >= width) { return s; @@ -508,7 +512,11 @@ return repeat(what, times, new StringBuilder()).toString(); } - public static final StringBuilder repeat(String what, int times, StringBuilder sb) { + public static final StringBuilder repeat( + String what, + int times, + StringBuilder sb + ) { while (times-- > 0) { sb.append(what); } @@ -545,7 +553,8 @@ int i = x.lastIndexOf('.'); return i < 0 ? new String[] { x, null } - : new String[] { x.substring(0, Math.max(0, i)), x.substring(i+1).toLowerCase() }; + : new String[] { x.substring(0, Math.max(0, i)), + x.substring(i+1).toLowerCase() }; } public static String entityEncode(String s) { @@ -678,7 +687,11 @@ } */ - public static String sprintf(Locale locale, String format, Object ... args) { + public static String sprintf( + Locale locale, + String format, + Object ... args + ) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); pw.printf(locale, format, args); @@ -687,138 +700,6 @@ } - public static void testQuote() { - System.err.println("testing quote:"); - - String cases [] = { - "", "''", - "test", "test", - "test test", "'test test'", - " test", "' test'", - "test ", "'test '", - " test ", "' test '", - "'test", "'\\'test'", - "'", "'\\''", - " ' ' ", "' \\' \\' '", - "te'st", "'te\\'st'" - }; - - int failed = 0; - - for (int i = 0; i < cases.length; i += 2) { - String in = cases[i]; - String out = cases[i+1]; - - String res = quote(in, '\''); - if (!res.equals(out)) { - ++failed; - System.err.println( - "quote failed on: >" + in + - "< result: >" + res + - "< expected: >" + out + "<"); - } - } - - int T = cases.length/2; - - System.err.println("tests total: " + T); - System.err.println("tests failed: " + failed); - System.err.println("tests passed: " + (T - failed)); - } - - public static void testQuoteReplacement() { - System.err.println("testing quoteReplacement:"); - - String cases [] = { - "", "", - "test", "test", - "$", "\\$", - "\\", "\\\\", - "\\$", "\\\\\\$", - "test\\$", "test\\\\\\$", - "\\test", "\\\\test", - "test$", "test\\$", - "test$test", "test\\$test", - "$test$", "\\$test\\$" - }; - - int failed = 0; - - for (int i = 0; i < cases.length; i += 2) { - String in = cases[i]; - String out = cases[i+1]; - - String res = quoteReplacement(in); - if (!res.equals(out)) { - ++failed; - System.err.println( - "quoteReplacement failed on: '" + in + - "' result: '" + res + - "' expected: '" + out + "'"); - } - } - - int T = cases.length/2; - - System.err.println("tests total: " + T); - System.err.println("tests failed: " + failed); - System.err.println("tests passed: " + (T - failed)); - } - - public static void testStringArray2D() { - int total = 0; - int fail = 0; - int passed = 0; - - System.err.println("testing StringArray2D:"); - - double[][] testarray = {{1.0, 2.0, 3.0}, - {1.1, 2.1, 3.1}, - {100.2, 200.2} - }; - String str = double2DArrayToString(testarray); - - total += 1; - if (str.equals("1.0;2.0;3.0:1.1;2.1;3.1:100.2;200.2")) { - passed +=1; - } - else { - fail +=1; - System.err.println("Der Ergebnis-String ist nicht richtig:"); - System.err.println(str); - } - - - - double[][] testarray2 = stringToDouble2DArray(str); - boolean failed = false; - - total +=1; - for (int i=0; i < testarray.length; i++) - for (int j=0; j < testarray[i].length; j++) - if (testarray[i][j] != testarray2[i][j]) { - System.err.println("Test scheitert bei i=" +i +" j=" +j); - System.err.println("alter Wert=" + testarray[i][j] +" neuer Wert=" +testarray2[i][j]); - failed = true; - } - if (failed) { - fail +=1; - } - else { - passed +=1; - } - System.err.println("tests total: "+ total); - System.err.println("tests failed: "+ fail); - System.err.println("tests passed: "+ passed); - } - - public static void main(String [] args) { - - testQuoteReplacement(); - testQuote(); - testStringArray2D(); - } - /** Check for occurence of needle in hay, converting both to lowercase * to be ignorant of cases. */ public static boolean containsIgnoreCase(String hay, String needle) { diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportAnnotation.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportAnnotation.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportAnnotation.java Fri Jan 19 11:23:42 2018 +0100 @@ -126,7 +126,8 @@ Edge e = edge != null ? edge.getPeer() : null; AnnotationType t = type != null ? type.getPeer() : null; - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from Annotation where " + "range=:range and " + diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportAnnotationType.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportAnnotationType.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportAnnotationType.java Fri Jan 19 11:23:42 2018 +0100 @@ -43,7 +43,8 @@ public AnnotationType getPeer() { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from AnnotationType where name=:name"); query.setParameter("name", name); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportAttribute.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportAttribute.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportAttribute.java Fri Jan 19 11:23:42 2018 +0100 @@ -55,8 +55,10 @@ public Attribute getPeer() { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); - Query query = session.createQuery("from Attribute where value=:value"); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); + Query query = session.createQuery( + "from Attribute where value=:value"); query.setString("value", value); List attributes = query.list(); if (attributes.isEmpty()) { diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportBedHeight.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportBedHeight.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportBedHeight.java Fri Jan 19 11:23:42 2018 +0100 @@ -133,7 +133,9 @@ if (peer == null) { BedHeightType theType = type != null ? type.getPeer() : null; ElevationModel theCurModel = curElevationModel.getPeer(); - Range theRange = range != null ? range.getPeer(river) : null; + Range theRange = range != null + ? range.getPeer(river) + : null; if (theType == null) { log.warn("BHS: No bed height type given. Skip file '" + @@ -152,7 +154,8 @@ description + "'"); } - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from BedHeight where " + @@ -177,7 +180,9 @@ theType, locationSystem.getPeer(), theCurModel, - oldElevationModel != null ? oldElevationModel.getPeer() : null, + oldElevationModel != null + ? oldElevationModel.getPeer() + : null, range.getPeer(river), evaluationBy, description diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightType.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightType.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightType.java Fri Jan 19 11:23:42 2018 +0100 @@ -45,10 +45,11 @@ public BedHeightType getPeer() { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); - Query query = session.createQuery( - "from BedHeightType where name=:name and description=:description"); + Query query = session.createQuery("from BedHeightType " + + "where name=:name and description=:description"); query.setParameter("name", name); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightValue.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightValue.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightValue.java Fri Jan 19 11:23:42 2018 +0100 @@ -64,7 +64,8 @@ */ public BedHeightValue getPeer(BedHeight bedHeight) { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from BedHeightValue where " + diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportDepth.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportDepth.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportDepth.java Fri Jan 19 11:23:42 2018 +0100 @@ -48,12 +48,13 @@ log.info("get peer"); if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( - "from Depth where " + - " lower between :lower - 0.0001f and :lower + 0.00001f and " + - " upper between :upper - 0.0001f and :upper + 0.00001f"); + "from Depth where " + + "lower between :lower - 0.0001f and :lower + 0.00001f and " + + "upper between :upper - 0.0001f and :upper + 0.00001f"); query.setParameter("lower", lower.floatValue()); query.setParameter("upper", upper.floatValue()); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportDischargeTable.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportDischargeTable.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportDischargeTable.java Fri Jan 19 11:23:42 2018 +0100 @@ -59,7 +59,9 @@ } - public void setDischargeTableValues(List values){ + public void setDischargeTableValues( + List values + ) { this.dischargeTableValues = values; } @@ -82,7 +84,8 @@ TimeInterval ti = timeInterval != null ? timeInterval.getPeer() : null; - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); String timeIntervalQuery = ti != null ? "timeInterval=:interval" diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportDischargeZone.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportDischargeZone.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportDischargeZone.java Fri Jan 19 11:23:42 2018 +0100 @@ -58,7 +58,8 @@ public DischargeZone getPeer(River river) { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from DischargeZone where " + diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportEdge.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportEdge.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportEdge.java Fri Jan 19 11:23:42 2018 +0100 @@ -63,7 +63,8 @@ public Edge getPeer() { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from Edge where top=:top and bottom=:bottom"); query.setParameter("top", top); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportElevationModel.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportElevationModel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportElevationModel.java Fri Jan 19 11:23:42 2018 +0100 @@ -47,7 +47,8 @@ } if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from ElevationModel where " + "name=:name and unit=:unit"); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportFlowVelocityMeasurementValue.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportFlowVelocityMeasurementValue.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportFlowVelocityMeasurementValue.java Fri Jan 19 11:23:42 2018 +0100 @@ -67,7 +67,8 @@ public FlowVelocityMeasurementValue getPeer(FlowVelocityMeasurement m) { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from FlowVelocityMeasurementValue where " + diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportFlowVelocityModelValue.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportFlowVelocityModelValue.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportFlowVelocityModelValue.java Fri Jan 19 11:23:42 2018 +0100 @@ -52,7 +52,8 @@ public FlowVelocityModelValue getPeer(FlowVelocityModel model) { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from FlowVelocityModelValue where " + diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportGauge.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportGauge.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportGauge.java Fri Jan 19 11:23:42 2018 +0100 @@ -149,7 +149,9 @@ return namedMainValues; } - public void setNamedMainValues(List namedMainValues) { + public void setNamedMainValues( + List namedMainValues + ) { this.namedMainValues = namedMainValues; } @@ -265,7 +267,8 @@ public Gauge getPeer(River river) { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from Gauge where officialNumber=:officialNumber " + "and river.id=:river"); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportLocationSystem.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportLocationSystem.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportLocationSystem.java Fri Jan 19 11:23:42 2018 +0100 @@ -45,7 +45,8 @@ public LocationSystem getPeer() { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from LocationSystem where " + "name=:name and description=:description"); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportMainValue.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportMainValue.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportMainValue.java Fri Jan 19 11:23:42 2018 +0100 @@ -71,7 +71,8 @@ public MainValue getPeer(River river) { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query; diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportMainValueType.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportMainValueType.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportMainValueType.java Fri Jan 19 11:23:42 2018 +0100 @@ -55,8 +55,10 @@ public MainValueType getPeer() { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); - Query query = session.createQuery("from MainValueType where name=:name"); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); + Query query = session.createQuery( + "from MainValueType where name=:name"); query.setString("name", name); List values = query.list(); if (values.isEmpty()) { diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportMeasurementStation.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportMeasurementStation.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportMeasurementStation.java Fri Jan 19 11:23:42 2018 +0100 @@ -80,7 +80,8 @@ } if (range == null) { - log.warn("No range found for measurement station '" + name + "'"); + log.warn("No range found for measurement station '" + + name + "'"); } TimeInterval observationTimerange = this.observationTimerange diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportMorphWidthValue.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportMorphWidthValue.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportMorphWidthValue.java Fri Jan 19 11:23:42 2018 +0100 @@ -52,7 +52,8 @@ public MorphologicalWidthValue getPeer(MorphologicalWidth parent) { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from MorphologicalWidthValue where " + diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportNamedMainValue.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportNamedMainValue.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportNamedMainValue.java Fri Jan 19 11:23:42 2018 +0100 @@ -53,7 +53,8 @@ public NamedMainValue getPeer() { if (peer == null) { MainValueType type = mainValueType.getPeer(); - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from NamedMainValue where " + "name=:name and type.id=:id"); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportOfficialLine.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportOfficialLine.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportOfficialLine.java Fri Jan 19 11:23:42 2018 +0100 @@ -43,9 +43,12 @@ public OfficialLine getPeer(River river) { if (peer == null) { // XXX: This is a bit odd. We do not have not enough infos here - // to create a new NamedMainValue. So we just look for existing ones. - Session session = ImporterSession.getInstance().getDatabaseSession(); - NamedMainValue nmv = NamedMainValue.fetchByNameAndType(name, "Q", session); + // to create a new NamedMainValue. + // So we just look for existing ones. + Session session = ImporterSession.getInstance() + .getDatabaseSession(); + NamedMainValue nmv = NamedMainValue.fetchByNameAndType( + name, "Q", session); if (nmv == null) { // failed -> failed to create OfficialLine return null; diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportOfficialWstColumn.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportOfficialWstColumn.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportOfficialWstColumn.java Fri Jan 19 11:23:42 2018 +0100 @@ -15,7 +15,8 @@ new ImportWst.ImportWstColumnFactory() { @Override public ImportWstColumn create(ImportWst importWst, int position) { - return new ImportOfficialWstColumn(importWst, null, null, position); + return new ImportOfficialWstColumn( + importWst, null, null, position); } }; diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportPorosityValue.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportPorosityValue.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportPorosityValue.java Fri Jan 19 11:23:42 2018 +0100 @@ -62,14 +62,17 @@ log.info("get peer"); if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( - "from PorosityValue where " + - " porosity=:porosity and " + - " station between :station - 0.0001f and :station + 0.0001f and" + - " porosityValue between :poros -0.0001f and :poros + 0.0001f and" + - " description=:description"); + "from PorosityValue " + + "where porosity=:porosity " + + "and station between :station - 0.0001f " + + " and :station + 0.0001f " + + "and porosityValue between :poros -0.0001f " + + " and :poros + 0.0001f " + + "and description=:description"); query.setParameter("porosity", porosity); query.setParameter("station", station.floatValue()); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportPosition.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportPosition.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportPosition.java Fri Jan 19 11:23:42 2018 +0100 @@ -43,8 +43,10 @@ public Position getPeer() { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); - Query query = session.createQuery("from Position where value=:value"); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); + Query query = session.createQuery( + "from Position where value=:value"); query.setString("value", value); List positions = query.list(); if (positions.isEmpty()) { diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportRange.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportRange.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportRange.java Fri Jan 19 11:23:42 2018 +0100 @@ -87,7 +87,8 @@ public void setA(BigDecimal a) { if (this.b != null && a.compareTo(b) >= 0) { - throw new IllegalArgumentException("a (" + a + ") must be smaller than b (" + b + ")."); + throw new IllegalArgumentException( + "a (" + a + ") must be smaller than b (" + b + ")."); } this.a = a; } @@ -98,7 +99,8 @@ public void setB(BigDecimal b) { if (b != null && b.compareTo(a) <= 0) { - throw new IllegalArgumentException("b (" + b + ") must be greater than a (" + a + ") or null."); + throw new IllegalArgumentException( + "b (" + b + ") must be greater than a (" + a + ") or null."); } this.b = b; } diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportRiver.java Fri Jan 19 11:23:42 2018 +0100 @@ -98,9 +98,11 @@ public static final String POROSITY_DIR = "Porositaet"; - public static final String MORPHOLOGICAL_WIDTH_DIR = "morphologische_Breite"; + public static final String MORPHOLOGICAL_WIDTH_DIR = + "morphologische_Breite"; - public static final String FLOW_VELOCITY_DIR = "Geschwindigkeit_Schubspannung"; + public static final String FLOW_VELOCITY_DIR = + "Geschwindigkeit_Schubspannung"; public static final String FLOW_VELOCITY_MODEL = "Modellrechnungen"; @@ -116,19 +118,23 @@ public static final String SEDIMENT_LOAD_EPOCH_DIR = "Epochen"; - public static final String SEDIMENT_LOAD_OFF_EPOCH_DIR = "amtliche Epochen"; + public static final String SEDIMENT_LOAD_OFF_EPOCH_DIR = + "amtliche Epochen"; public static final String MINFO_FIXATIONS_DIR = "Fixierungsanalyse"; public static final String MINFO_WATERLEVELS_DIR = "Wasserspiegellagen"; - public static final String MINFO_WATERLEVEL_DIFF_DIR = "Wasserspiegeldifferenzen"; + public static final String MINFO_WATERLEVEL_DIFF_DIR = + "Wasserspiegeldifferenzen"; public static final String MINFO_BASE_DIR = "Basisdaten"; - public static final String MINFO_CORE_DATA_FILE = "Stammdaten_Messstellen.csv"; + public static final String MINFO_CORE_DATA_FILE = + "Stammdaten_Messstellen.csv"; - public static final String MINFO_SQ_DIR = "Feststofftransport-Abfluss-Beziehung"; + public static final String MINFO_SQ_DIR = + "Feststofftransport-Abfluss-Beziehung"; protected String name; @@ -216,7 +222,8 @@ HashedFile hf = new HashedFile(file); boolean success = files.add(hf); if (!success) { - log.warn(type + " file '" + file + "' seems to be a duplicate."); + log.warn(type + " file '" + file + + "' seems to be a duplicate."); } return success; } @@ -249,7 +256,8 @@ List points = entry.getValue(); numReadPoints += points.size(); if (simplificationEpsilon != null) { - points = DouglasPeuker.simplify(points, simplificationEpsilon); + points = DouglasPeuker.simplify( + points, simplificationEpsilon); } numRemainingPoints += points.size(); lines.add(new ImportCrossSectionLine(km, points)); @@ -275,29 +283,31 @@ ImportTimeInterval ti, List lines ) { - crossSections.add(new ImportCrossSection(this, description, ti, lines)); + crossSections.add( + new ImportCrossSection(this, description, ti, lines)); } public ImportRiver() { - hyks = new ArrayList(); - crossSections = new ArrayList(); - extraWsts = new ArrayList(); - fixations = new ArrayList(); - officialLines = new ArrayList(); - floodWater = new ArrayList(); - waterlevels = new ArrayList(); - waterlevelDifferences = new ArrayList(); - floodProtection = new ArrayList(); - sedimentDensities = new ArrayList(); - porosities = new ArrayList(); - morphologicalWidths = new ArrayList(); - flowVelocityModels = new ArrayList(); - flowVelocityMeasurements = new ArrayList(); - sedimentLoadLSs = new ArrayList(); - sedimentLoads = new ArrayList(); - measurementStations = new ArrayList(); - sqRelations = new ArrayList(); + hyks = new ArrayList(); + crossSections = new ArrayList(); + extraWsts = new ArrayList(); + fixations = new ArrayList(); + officialLines = new ArrayList(); + floodWater = new ArrayList(); + waterlevels = new ArrayList(); + waterlevelDifferences = new ArrayList(); + floodProtection = new ArrayList(); + sedimentDensities = new ArrayList(); + porosities = new ArrayList(); + morphologicalWidths = new ArrayList(); + flowVelocityModels = new ArrayList(); + flowVelocityMeasurements = + new ArrayList(); + sedimentLoadLSs = new ArrayList(); + sedimentLoads = new ArrayList(); + measurementStations = new ArrayList(); + sqRelations = new ArrayList(); } public ImportRiver( @@ -364,7 +374,8 @@ } public File getMinfoDir() { - File riverDir = wstFile.getParentFile().getParentFile().getParentFile(); + File riverDir = wstFile + .getParentFile().getParentFile().getParentFile(); return new File(riverDir, MINFO_DIR); } @@ -434,7 +445,8 @@ wstParser.parse(file); ImportWst iw = wstParser.getWst(); iw.setKind(5); - iw.setDescription(FLOOD_PROTECTION + "/" + iw.getDescription()); + iw.setDescription( + FLOOD_PROTECTION + "/" + iw.getDescription()); floodProtection.add(iw); } catch (WstParser.ParseException e) { @@ -492,7 +504,8 @@ sedimentDensities = parser.getSedimentDensities(); - log.info("Parsed " + sedimentDensities.size() + " sediment densities."); + log.info("Parsed " + sedimentDensities.size() + + " sediment densities."); } protected void parsePorosity() throws IOException { @@ -550,7 +563,8 @@ morphologicalWidths = parser.getMorphologicalWidths(); - log.info("Parsed " + morphologicalWidths.size() + " morph. widths files."); + log.info("Parsed " + morphologicalWidths.size() + + " morph. widths files."); } @@ -668,7 +682,8 @@ protected void parseSedimentLoad() throws IOException { if (Config.INSTANCE.skipSedimentLoad()) { - log.info("skip parsing sediment load data at measurement stations"); + log.info( + "skip parsing sediment load data at measurement stations"); return; } @@ -734,7 +749,8 @@ File coredataFile = new File(minfoBaseDir, MINFO_CORE_DATA_FILE); if (coredataFile == null || !coredataFile.exists()) { - log.warn("No core data file '" + coredataFile.getAbsolutePath() + "' found"); + log.warn("No core data file '" + + coredataFile.getAbsolutePath() + "' found"); return; } @@ -743,7 +759,8 @@ parser.parse(coredataFile); measurementStations = parser.getMeasurementStations(); - log.info("Successfully parsed " + measurementStations.size() + " measurement stations."); + log.info("Successfully parsed " + measurementStations.size() + + " measurement stations."); } catch (IOException ioe) { log.error("unable to parse file '" + coredataFile.getName() + @@ -907,7 +924,8 @@ } log.debug("Found WST file: " + file); - ImportWst iw = new ImportWst(ImportOfficialWstColumn.COLUMN_FACTORY); + ImportWst iw = new ImportWst( + ImportOfficialWstColumn.COLUMN_FACTORY); WstParser wstParser = new WstParser(iw); try { @@ -921,12 +939,14 @@ iw.setKind(3); iw.setDescription(folder + "/" + iw.getDescription()); - File configFile = FileTools.repair(new File(dir, OFFICIAL_LINES_CONFIG)); + File configFile = FileTools.repair( + new File(dir, OFFICIAL_LINES_CONFIG)); if (!configFile.isFile() || !configFile.canRead()) { log.warn("no config file for official lines found"); } else { - OfficialLinesConfigParser olcp = new OfficialLinesConfigParser(); + OfficialLinesConfigParser olcp = + new OfficialLinesConfigParser(); try { olcp.parse(configFile); } @@ -935,16 +955,19 @@ } List mainValueNames = olcp.getMainValueNames(); if (mainValueNames.isEmpty()) { - log.warn("config file for offical lines contains no entries"); + log.warn( + "config file for offical lines contains no entries"); } else { // Join as much as possible. Iterator wi = iw.getColumns().iterator(); Iterator si = olcp.getMainValueNames().iterator(); while (wi.hasNext() && si.hasNext()) { - ImportOfficialWstColumn wc = (ImportOfficialWstColumn)wi.next(); + ImportOfficialWstColumn wc = + (ImportOfficialWstColumn)wi.next(); String name = si.next(); - ImportOfficialLine iol = new ImportOfficialLine(name, wc); + ImportOfficialLine iol = + new ImportOfficialLine(name, wc); wc.setOfficialLine(iol); } } @@ -1044,7 +1067,8 @@ wstParser.parse(file); ImportWst iw = wstParser.getWst(); iw.setKind(1); - iw.setDescription(EXTRA_LONGITUDINALS + "/" + iw.getDescription()); + iw.setDescription( + EXTRA_LONGITUDINALS + "/" + iw.getDescription()); extraWsts.add(iw); } catch (WstParser.ParseException e) { @@ -1131,7 +1155,8 @@ HashedFile hf = new HashedFile(file); boolean success = hfs.add(hf); if (!success) { - log.warn("HYK file '" + file + "' seems to be a duplicate."); + log.warn("HYK file '" + file + + "' seems to be a duplicate."); } return success; } @@ -1211,7 +1236,8 @@ /** Create a DA66 Parser and parse the da66 files found. */ - // TODO this is a copy of parsePRFs, extract interfaces (e.g. CrossSectionParser). + // TODO this is a copy of parsePRFs, extract interfaces + //(e.g. CrossSectionParser). public void parseDA66s() { if (Config.INSTANCE.skipDA66s()) { log.info("skip parsing DA66s"); @@ -1267,7 +1293,8 @@ query.setString("name", name); List rivers = query.list(); if (rivers.isEmpty() && Config.INSTANCE.skipWst()){ - log.error("River not yet in database. You cannot skip importing waterlevel model."); + log.error("River not yet in database. " + + "You cannot skip importing waterlevel model."); return; } @@ -1298,7 +1325,8 @@ public void storeWstUnit() { if (wst == null) { - log.warn("No unit given. Waterlevel-model WST-file has to be imported already."); + log.warn("No unit given. " + + "Waterlevel-model WST-file has to be imported already."); } else { wstUnit = wst.getUnit(); @@ -1336,7 +1364,8 @@ // The flow direction of the main wst and the corresponding // waterlevels determine if the river is 'km_up'. - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); river.setKmUp(wst.getKmUp()); session.save(river); } @@ -1408,7 +1437,8 @@ ImportOfficialLine ioc = owc.getOfficialLine(); if (ioc != null) { if (ioc.getPeer(river) == null) { - log.warn("Cannot store official line: " + ioc.getName()); + log.warn("Cannot store official line: " + + ioc.getName()); } } } @@ -1512,7 +1542,8 @@ River river = getPeer(); - for (ImportFlowVelocityModel flowVelocityModel: flowVelocityModels){ + for (ImportFlowVelocityModel flowVelocityModel: flowVelocityModels + ) { flowVelocityModel.storeDependencies(river); } @@ -1609,7 +1640,8 @@ public River getPeer() { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery("from River where name=:name"); Unit u = null; diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportSQRelation.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportSQRelation.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportSQRelation.java Fri Jan 19 11:23:42 2018 +0100 @@ -66,7 +66,8 @@ TimeInterval timeInter = timeInterval.getPeer(); if (timeInter == null) { - log.warn("ISQ: Cannot determine sq relation without time interval"); + log.warn( + "ISQ: Cannot determine sq relation without time interval"); return null; } diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportSQRelationValue.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportSQRelationValue.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportSQRelationValue.java Fri Jan 19 11:23:42 2018 +0100 @@ -76,7 +76,8 @@ public SQRelationValue getPeer(SQRelation owner) { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from SQRelationValue " + " where sqRelation=:owner " + diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportSedimentDensityValue.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportSedimentDensityValue.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportSedimentDensityValue.java Fri Jan 19 11:23:42 2018 +0100 @@ -66,7 +66,8 @@ log.info("get peer"); if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from SedimentDensityValue where " + diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoad.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoad.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoad.java Fri Jan 19 11:23:42 2018 +0100 @@ -72,7 +72,8 @@ public SedimentLoad getPeer() { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); String sqtquery = sqTimeInterval == null ? "sq_time_interval_id is null" diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoadLS.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoadLS.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoadLS.java Fri Jan 19 11:23:42 2018 +0100 @@ -103,7 +103,8 @@ : null; if (ti == null || u == null) { - log.warn("Skip invalid SedimentLoadLS: time interval or unit null!"); + log.warn( + "Skip invalid SedimentLoadLS: time interval or unit null!"); return null; } diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoadLSValue.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoadLSValue.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoadLSValue.java Fri Jan 19 11:23:42 2018 +0100 @@ -38,7 +38,8 @@ public SedimentLoadLSValue getPeer(SedimentLoadLS sedimentLoadLS) { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from SedimentLoadLSValue where " + " sedimentLoadLS=:sedimentLoadLS and " + diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoadValue.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoadValue.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportSedimentLoadValue.java Fri Jan 19 11:23:42 2018 +0100 @@ -37,7 +37,8 @@ protected SedimentLoadValue getPeer(SedimentLoad sedimentLoad) { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from SedimentLoadValue where " + " measurementStation = :station and " + diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportTimeInterval.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportTimeInterval.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportTimeInterval.java Fri Jan 19 11:23:42 2018 +0100 @@ -76,14 +76,16 @@ public TimeInterval getPeer() { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); if (startTime == null) { log.error("Null Start time will be ignored."); } Query query; if (stopTime == null) { query = session.createQuery( - "from TimeInterval where startTime=:a and stopTime is null"); + "from TimeInterval " + + "where startTime=:a and stopTime is null"); } else { query = session.createQuery( diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportUnit.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportUnit.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportUnit.java Fri Jan 19 11:23:42 2018 +0100 @@ -39,7 +39,8 @@ public Unit getPeer() { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery("from Unit where name=:name"); query.setParameter("name", name); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportWst.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportWst.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportWst.java Fri Jan 19 11:23:42 2018 +0100 @@ -65,7 +65,10 @@ this(description, COLUMN_FACTORY); } - public ImportWst(String description, ImportWstColumnFactory columnFactory) { + public ImportWst( + String description, + ImportWstColumnFactory columnFactory + ) { this(columnFactory); this.description = description; } @@ -150,7 +153,8 @@ /** Get corresponding mapped wst (from database). */ public Wst getPeer(River river) { if (peer == null) { - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from Wst where " + "river=:river and description=:description and kind=:kind"); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportWstColumn.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportWstColumn.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportWstColumn.java Fri Jan 19 11:23:42 2018 +0100 @@ -183,7 +183,8 @@ public WstColumn getPeer(River river) { if (peer == null) { Wst w = wst.getPeer(river); - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from WstColumn where" + " wst=:wst and name=:name" + diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportWstColumnQRange.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportWstColumnQRange.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportWstColumnQRange.java Fri Jan 19 11:23:42 2018 +0100 @@ -56,7 +56,8 @@ if (peer == null) { WstColumn c = wstColumn.getPeer(river); WstQRange q = qRange.getPeer(river); - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from WstColumnQRange where " + "wstColumn=:c and wstQRange=:q"); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImportWstQRange.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImportWstQRange.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImportWstQRange.java Fri Jan 19 11:23:42 2018 +0100 @@ -65,7 +65,8 @@ public WstQRange getPeer(River river) { if (peer == null) { Range r = range.getPeer(river); - Session session = ImporterSession.getInstance().getDatabaseSession(); + Session session = ImporterSession.getInstance() + .getDatabaseSession(); Query query = session.createQuery( "from WstQRange where " + "range=:range and q=:q"); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/Importer.java --- a/backend/src/main/java/org/dive4elements/river/importer/Importer.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/Importer.java Fri Jan 19 11:23:42 2018 +0100 @@ -143,7 +143,8 @@ log.info("parsing info gew file: " + gew); File gewFile = new File(gew); if (bwastrFile == null) { - bwastrFile = new File(gewFile.getParentFile(), BWASTR_ID_CSV_FILE); + bwastrFile = new File( + gewFile.getParentFile(), BWASTR_ID_CSV_FILE); } try { infoGewParser.parse(gewFile); @@ -159,7 +160,8 @@ log.info("parsing info gew file: " + gew); File gewFile = new File(gew); if (bwastrFile == null) { - bwastrFile = new File(gewFile.getParentFile(), BWASTR_ID_CSV_FILE); + bwastrFile = new File( + gewFile.getParentFile(), BWASTR_ID_CSV_FILE); } try { infoGewParser.parse(gewFile); @@ -183,9 +185,11 @@ // Now link rivers with official numbers. for(ImportRiver river: infoGewParser.getRivers()) { for(Map.Entry entry: map.entrySet()) { - if (StringUtil.containsIgnoreCase(river.getName(), entry.getKey())) { + if (StringUtil.containsIgnoreCase( + river.getName(), entry.getKey())) { river.setOfficialNumber(entry.getValue()); - log.debug(river.getName() + " is mapped to bwastr " + entry.getValue()); + log.debug(river.getName() + + " is mapped to bwastr " + entry.getValue()); } } } diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/ImporterSession.java --- a/backend/src/main/java/org/dive4elements/river/importer/ImporterSession.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/ImporterSession.java Fri Jan 19 11:23:42 2018 +0100 @@ -242,7 +242,8 @@ riversToMeasurementStations.get(rivername); if (km2Stations == null) { km2Stations = - new TreeMap>(EpsilonComparator.CMP); + new TreeMap>( + EpsilonComparator.CMP); riversToMeasurementStations.put(rivername, km2Stations); Query query = databaseSession.createQuery( "from MeasurementStation where range.river = :river"); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/AbstractSedimentLoadParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/AbstractSedimentLoadParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/AbstractSedimentLoadParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -35,7 +35,8 @@ Logger.getLogger(AbstractSedimentLoadParser.class); - public static final NumberFormat nf = NumberFormat.getInstance(DEFAULT_LOCALE); + public static final NumberFormat nf = NumberFormat.getInstance( + DEFAULT_LOCALE); public static final Pattern TIMEINTERVAL_SINGLE = @@ -92,7 +93,8 @@ @Override - protected void handleLine(int lineNum, String line) throws LineParserException { + protected void handleLine(int lineNum, String line) + throws LineParserException { if (line.startsWith(START_META_CHAR)) { handleMetaLine(stripMetaLine(line)); } @@ -125,14 +127,16 @@ } - public boolean handleMetaFractionName(String line) throws LineParserException { + public boolean handleMetaFractionName(String line) + throws LineParserException { Matcher m = META_FRACTION_NAME.matcher(line); if (m.matches()) { String name = m.group(1); - GrainFraction gf = ImporterSession.getInstance().getGrainFraction(name); + GrainFraction gf = ImporterSession.getInstance() + .getGrainFraction(name); if (gf != null) { @@ -146,12 +150,14 @@ gf.getLower()) != 0 || EpsilonComparator.CMP.compare(upval, gf.getUpper()) != 0) { - log.warn("ASLP: Invalid grain size for grain fraction '" + - name + "'. Ignored."); + log.warn( + "ASLP: Invalid grain size for grain fraction '" + + name + "'. Ignored."); } } catch (ParseException pe) { - log.warn("ASLP: Could not parse grain-size interval. Ignored."); + log.warn("ASLP: Could not parse grain-size interval. " + + "Ignored."); } } @@ -240,7 +246,8 @@ if (b.matches()) { int year = nf.parse(b.group(1)).intValue(); - return new ImportTimeInterval(DateUtil.getStartDateFromYear(year)); + return new ImportTimeInterval( + DateUtil.getStartDateFromYear(year)); } log.warn("ASLP: Unknown time interval string: '" + column + "'"); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/AnnotationsParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/AnnotationsParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/AnnotationsParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -118,7 +118,8 @@ } } catch (NumberFormatException nfe) { - log.warn("ANN: invalid number in line " + in.getLineNumber()); + log.warn("ANN: invalid number in line " + + in.getLineNumber()); continue; } @@ -149,7 +150,8 @@ } catch (NumberFormatException nfe) { log.warn( - "ANN: cannot parse 'Unterkante' or 'Oberkante' in line " + "ANN: cannot parse 'Unterkante' or 'Oberkante' " + + "in line " + in.getLineNumber()); } } diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -84,7 +84,8 @@ Pattern.compile("^Weitere Bemerkungen: (.*).*"); - protected static NumberFormat nf = NumberFormat.getInstance(DEFAULT_LOCALE); + protected static NumberFormat nf = NumberFormat.getInstance( + DEFAULT_LOCALE); protected List bedHeights; @@ -111,7 +112,8 @@ public void parse(File file) throws IOException { log.info("Parsing bed height single file '" + file + "'"); - ImportBedHeight obj = newImportBedHeight(file.getName().replaceAll("\\.csv", "")); + ImportBedHeight obj = newImportBedHeight( + file.getName().replaceAll("\\.csv", "")); kmExists.clear(); @@ -213,7 +215,10 @@ } - protected boolean handleMetaTimeInterval(ImportBedHeight obj, String line) { + protected boolean handleMetaTimeInterval( + ImportBedHeight obj, + String line + ) { Matcher m = META_TIMEINTERVAL.matcher(line); if (m.matches()) { diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/DA66Parser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/DA66Parser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/DA66Parser.java Fri Jan 19 11:23:42 2018 +0100 @@ -363,7 +363,8 @@ // TODO 'move' last line to match river axis // TODO find river axis intersection currentLine = new ArrayList(); - double station = stationInKm(Double.parseDouble(m.group(FIELD.STATION.getIdx()))); + double station = stationInKm( + Double.parseDouble(m.group(FIELD.STATION.getIdx()))); data.put(station, currentLine); } else { diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -43,16 +43,20 @@ Pattern.compile("([a-zA-Z]+)+(\\d+)*[\\w()]*"); private static final Pattern META_MAINVALUE_B = - Pattern.compile("(([a-zA-Z]+)+(\\d+)*)\\s*-\\s*(([a-zA-Z]+)+(\\d+)*\\S*)"); + Pattern.compile( + "(([a-zA-Z]+)+(\\d+)*)\\s*-\\s*(([a-zA-Z]+)+(\\d+)*\\S*)"); private static final Pattern META_MAINVALUE_C = Pattern.compile("([0-9]++)\\s?(\\S*)|([0-9]++,[0-9]++)\\s?(\\S*)"); private static final Pattern META_MAINVALUE_D = - Pattern.compile("(([0-9]*)\\s?(\\w*)|([0-9]++,[0-9]++)\\s?(\\w*))\\s*bis (([0-9]*)\\s?(\\S*)|([0-9]++,[0-9]++)\\s?(\\S*))"); + Pattern.compile( + "(([0-9]*)\\s?(\\w*)|([0-9]++,[0-9]++)\\s?(\\w*))\\s*" + + "bis (([0-9]*)\\s?(\\S*)|([0-9]++,[0-9]++)\\s?(\\S*))"); private static final Pattern META_MAINVALUE_E = - Pattern.compile("(([a-zA-Z]+)+(\\d+)*)\\s*bis (([a-zA-Z]+)+(\\d+)*\\S*)"); + Pattern.compile( + "(([a-zA-Z]+)+(\\d+)*)\\s*bis (([a-zA-Z]+)+(\\d+)*\\S*)"); private static final NumberFormat nf = NumberFormat.getInstance(DEFAULT_LOCALE); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/HYKParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/HYKParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/HYKParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -184,8 +184,8 @@ } catch (NumberFormatException nfe) { log.error( - "HYK: parsing num zones, bottom or top height " + - "failed in line " + in.getLineNumber()); + "HYK: parsing num zones, bottom or top height " + + "failed in line " + in.getLineNumber()); return false; } @@ -266,11 +266,14 @@ for (int i = 0; i < coords.length; ++i) { BigDecimal a = coords[i]; BigDecimal b = i == coords.length-1 - ? (lastZoneEnd != null ? lastZoneEnd : coords[i]) + ? (lastZoneEnd != null + ? lastZoneEnd + : coords[i]) : coords[i+1]; if (a.compareTo(b) > 0) { - log.warn("HYK: zone coordinates swapped in line " + + log.warn( + "HYK: zone coordinates swapped in line " + in.getLineNumber()); BigDecimal c = a; a = b; b = c; } diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/InfoGewParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/InfoGewParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/InfoGewParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -118,7 +118,8 @@ } wst = FileTools.repair(wst); if (!wst.isFile() || !wst.canRead()) { - log.error("cannot access WST file '" + wstFilename + "'"); + log.error( + "cannot access WST file '" + wstFilename + "'"); continue; } log.info("Found wst file '" + wst + "'"); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/LineParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/LineParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/LineParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -52,7 +52,8 @@ } // class LineParserException - protected abstract void handleLine(int lineNum, String line) throws LineParserException; + protected abstract void handleLine(int lineNum, String line) + throws LineParserException; protected abstract void reset(); @@ -66,7 +67,8 @@ /** * This method reads each line of file. At the beginning, - * reset() is called; afterwards for each line handleLine() is + * reset() is called; + * afterwards for each line handleLine() is * called; at the end finish is called. * * @param file The file which should be parsed. @@ -127,7 +129,8 @@ return tmp.replaceAll(SEPERATOR_CHAR + "*$", "").trim(); } - public static double getDouble(String doubleString) throws ParseException { + public static double getDouble(String doubleString) + throws ParseException { NumberFormat nf = NumberFormat.getInstance(DEFAULT_LOCALE); Number value = nf.parse(doubleString); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/MorphologicalWidthParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/MorphologicalWidthParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/MorphologicalWidthParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -30,7 +30,8 @@ private static final Logger log = Logger.getLogger(MorphologicalWidthParser.class); - public static final NumberFormat nf = NumberFormat.getInstance(DEFAULT_LOCALE); + public static final NumberFormat nf = NumberFormat.getInstance( + DEFAULT_LOCALE); public static final Pattern META_UNIT = Pattern.compile("^Einheit: \\[(.*)\\].*"); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/OfficialLinesConfigParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/OfficialLinesConfigParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/OfficialLinesConfigParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -20,7 +20,8 @@ public class OfficialLinesConfigParser { - private static Logger log = Logger.getLogger(OfficialLinesConfigParser.class); + private static Logger log = Logger.getLogger( + OfficialLinesConfigParser.class); public static final String ENCODING = "ISO-8859-1"; @@ -46,7 +47,8 @@ try { String line; while ((line = reader.readLine()) != null) { - if ((line = line.trim()).length() == 0 || line.charAt(0) == '*') { + if ((line = line.trim()).length() == 0 + || line.charAt(0) == '*') { continue; } NameAndTimeInterval nat = NameAndTimeInterval.parseName(line); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/PRFParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/PRFParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/PRFParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -107,7 +107,8 @@ String second = line.substring( pos + firstIntegerPlaces, - Math.min(L, pos + firstIntegerPlaces + secondIntegerPlaces)); + Math.min( + L, pos + firstIntegerPlaces + secondIntegerPlaces)); double x, y; try { @@ -284,7 +285,8 @@ Matcher m = DATA_PATTERN.matcher(line); if (!m.matches()) { - log.warn("PRF: First line does not look like a PRF data pattern."); + log.warn( + "PRF: First line does not look like a PRF data pattern."); return false; } @@ -318,7 +320,8 @@ if (!m.matches()) { log.warn( - "PRF: line 4 does not look like a PRF km extraction pattern."); + "PRF: line 4 does not look like " + + "a PRF km extraction pattern."); return false; } @@ -356,7 +359,8 @@ km = kmFormat.extractKm(line); } catch (NumberFormatException iae) { - log.warn("PRF: cannot extract km in line " + in.getLineNumber()); + log.warn("PRF: cannot extract km in line " + + in.getLineNumber()); return false; } @@ -369,7 +373,8 @@ if (kmData == null) { kmData = new ArrayList(); data.put(station, kmData); - // When a station change occurs, dummy lines will occur, too. + // When a station change occurs, + // dummy lines will occur, too. skip = lineSkipCount -1; continue; } @@ -404,8 +409,10 @@ description = null; } - public void parsePRFs(File root, final CrossSectionParser.Callback callback) { - + public void parsePRFs( + File root, + final CrossSectionParser.Callback callback + ) { FileTools.walkTree(root, new FileTools.FileVisitor() { @Override public boolean visit(File file) { diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/PegelGltParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/PegelGltParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/PegelGltParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -65,7 +65,8 @@ int kmPos = line.indexOf(KM); if (kmPos < 0) { - log.warn("GLT: no gauge found in line " + in.getLineNumber()); + log.warn("GLT: no gauge found in line " + + in.getLineNumber()); continue; } diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/PorosityParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/PorosityParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/PorosityParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -114,7 +114,8 @@ Date fromYear = DateUtil.getStartDateFromYear(lower); Date toYear = DateUtil.getEndDateFromYear(upper); - current.setTimeInterval(new ImportTimeInterval(fromYear, toYear)); + current.setTimeInterval( + new ImportTimeInterval(fromYear, toYear)); } catch (NumberFormatException e) { log.warn("PP: could not parse timeinterval", e); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/SQRelationParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/SQRelationParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/SQRelationParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -134,13 +134,17 @@ || qMax == null || parameter.length() == 0 ) { if (km == null) { - log.error("No km for measurement station: Can not reference measurement station: " + log.error( + "No km for measurement station: " + + "Can not reference measurement station: " + line); } if (a == null || b == null || qMax == null || parameter.length() == 0 ) { - log.error("Incomplete SQ-relation row (missing a, b, Qmax or parameter): " + log.error( + "Incomplete SQ-relation row " + + "(missing a, b, Qmax or parameter): " + line); } return; diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentDensityParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentDensityParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentDensityParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -106,7 +106,8 @@ String lo = m.group(1); String up = m.group(2); - log.info("Found sediment density depth: " + lo + " - " + up + " cm"); + log.info("Found sediment density depth: " + + lo + " - " + up + " cm"); try { ImportDepth depth = new ImportDepth( diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentLoadLSParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentLoadLSParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentLoadLSParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -121,7 +121,8 @@ } } catch (ParseException pe) { - log.warn("SLLSP: unparseable number in data row '" + line + "':", pe); + log.warn( + "SLLSP: unparseable number in data row '" + line + "':", pe); } } diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/W80CSVParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/W80CSVParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/W80CSVParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -199,7 +199,12 @@ * @return true if point could been added, false otherwise (e.g. not * parsable y or z values. */ - private boolean addPoint(double gkr, double gkh, double height, String idx) { + private boolean addPoint( + double gkr, + double gkh, + double height, + String idx + ) { // Calculate distance between this and lst point (add distances). double d = distanceToLastPoint(gkr, gkh); double totalX = getLastPointX() + d; @@ -220,7 +225,8 @@ } // As per documentation: - // BW;WPA;ST;UF;PN;LS;BL-LS;Y;X;Z;DL;LZK;SY;SX;SZ;BML;HS;BL-HS;H;DH;HZK;SH;WVA;BMH;BMP;DST;DB;LDS;LKZ; + // BW;WPA;ST;UF;PN;LS;BL-LS;Y;X;Z;DL;LZK;SY;SX;SZ;BML;HS;BL-HS; + // H;DH;HZK;SH;WVA;BMH;BMP;DST;DB;LDS;LKZ; /** @@ -233,7 +239,8 @@ if (lineNum == 1 || lineNum == 2) { return; } - // The 'shore' field shows which side of the river the shore is measured. + // The 'shore' field shows which side of the river the shore + // is measured. // Therefore, the points have to be added in the correct order (also // because later distances are calculated which cannot be // negative. @@ -258,8 +265,8 @@ try { stationKm = Double.parseDouble(station) / 1000d; - gkRightKm = Double.parseDouble(gkRight.replace(",","."));//.substring(0,7)); - gkHighKm = Double.parseDouble(gkHigh.replace(",","."));//.substring(0,7)); + gkRightKm = Double.parseDouble(gkRight.replace(",",".")); + gkHighKm = Double.parseDouble(gkHigh.replace(",",".")); heightM = Double.parseDouble(height.replace(",",".")); } catch (java.lang.NumberFormatException nfe) { diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/W80Parser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/W80Parser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/W80Parser.java Fri Jan 19 11:23:42 2018 +0100 @@ -193,7 +193,12 @@ * @return true if point could been added, false otherwise (e.g. not * parsable y or z values. */ - private boolean addPoint(double gkr, double gkh, double height, String idx) { + private boolean addPoint( + double gkr, + double gkh, + double height, + String idx + ) { // Calculate distance between this and lst point (add distances). double d = distanceToLastPoint(gkr, gkh); double totalX = getLastPointX() + d; @@ -219,7 +224,8 @@ */ @Override protected void handleLine(int lineNum, String line) { - // The 'shore' field shows which side of the river the shore is measured. + // The 'shore' field shows which side of the river + // the shore is measured. // Therefore, the points have to be added in the correct order (also // because later distances are calculated which cannot be // negative. diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelDifferencesParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelDifferencesParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelDifferencesParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -184,7 +184,8 @@ /** Setup column structures with name, description and time interval. */ private void initColumns(String[] cols) { current.setNumberColumns(cols.length); - columns = current.getColumns().toArray(new ImportWstColumn[cols.length]); + columns = current.getColumns().toArray( + new ImportWstColumn[cols.length]); for (int i = 0; i < cols.length; i++) { String name = cols[i].replace("\"", ""); @@ -224,8 +225,8 @@ } try { - // The first value in a line like 12,9;4,3;4,5 is the station, later - // real values. + // The first value in a line like 12,9;4,3;4,5 is the station, + // later real values. Double station = nf.parse(cols[0]).doubleValue(); for (int i = 0; i < columns.length; i++) { diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -97,7 +97,8 @@ column.setDescription(currentDescription); // Try to extract and set the TimeInterval. - Matcher m = WaterlevelDifferencesParser.YEARS_IN_COLUMN.matcher(currentDescription); + Matcher m = WaterlevelDifferencesParser.YEARS_IN_COLUMN.matcher( + currentDescription); if (m.matches()) { int startYear = Integer.parseInt(m.group(1)); @@ -108,7 +109,8 @@ ); column.setTimeInterval(time); } else { - log.debug("No time interval in column header found: " + currentDescription); + log.debug("No time interval in column header found: " + + currentDescription); } current.setKind(7); @@ -125,7 +127,8 @@ // TODO: should otherwise be extended to // (first station of next range - INTERVAL_GAP), // assuming always ascending stations - BigDecimal lastStation = cValues.get(cValues.size() -1).getPosition(); + BigDecimal lastStation = cValues.get(cValues.size() -1) + .getPosition(); if (lastStation.compareTo(currentRange.getA()) == 0) { currentRange.setB(new BigDecimal(lastStation.doubleValue() + INTERVAL_GAP)); @@ -179,9 +182,11 @@ try { if (currentQRange != null) { // Finish off the last one. - List cValues = column.getColumnValues(); + List cValues = column + .getColumnValues(); // Set end of range to last station. - currentRange.setB(cValues.get(cValues.size() -1).getPosition()); + currentRange.setB(cValues.get(cValues.size() -1) + .getPosition()); currentQRange.setRange(currentRange); column.addColumnQRange(currentQRange); } diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/importer/parsers/WstParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/WstParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/WstParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -188,11 +188,14 @@ // handle Q-lines if (line.startsWith("*\u001f")) { - BigDecimal [] data = parseLineAsDouble(line, columnCount, false, true); + BigDecimal [] data = parseLineAsDouble( + line, columnCount, false, true); - if (aktAbfluesse != null) { // add Q-ranges obtained from previous lines + if (aktAbfluesse != null) { + // add Q-ranges obtained from previous lines if (kmHist1 != null && kmHist2 != null - && kmHist1.compareTo(kmHist2) < 0) { // stations descending in file + && kmHist1.compareTo(kmHist2) < 0) { + // stations descending in file BigDecimal t = minKm; minKm = maxKm; maxKm = t; } addInterval(minKm, maxKm, aktAbfluesse); @@ -210,7 +213,8 @@ } } - // remember Q-values from first Q-line for header generation + // remember Q-values from first Q-line + // for header generation if (firstAbfluesse == null) { firstAbfluesse = (BigDecimal [])aktAbfluesse.clone(); } @@ -226,14 +230,16 @@ } if (spezial.startsWith(COLUMN_BEZ_TEXT)) { - spezial = spezial.substring(COLUMN_BEZ_TEXT.length()).trim(); + spezial = spezial.substring( + COLUMN_BEZ_TEXT.length()).trim(); if (spezial.length() == 0) { continue; } langBezeichner = StringUtil.splitQuoted(spezial, '"'); } else if (spezial.startsWith(COLUMN_BEZ_BREITE)) { - spezial = spezial.substring(COLUMN_BEZ_BREITE.length()).trim(); + spezial = spezial.substring( + COLUMN_BEZ_BREITE.length()).trim(); if (spezial.length() == 0) { continue; @@ -247,7 +253,8 @@ } } else if (spezial.startsWith(COLUMN_QUELLE)) { - spezial = spezial.substring(COLUMN_QUELLE.length()).trim(); + spezial = spezial.substring( + COLUMN_QUELLE.length()).trim(); if (spezial.length() == 0) { continue; } @@ -255,7 +262,8 @@ log.debug("sources: " + Arrays.toString(quellen)); } else if (spezial.startsWith(COLUMN_DATUM)) { - spezial = spezial.substring(COLUMN_DATUM.length()).trim(); + spezial = spezial.substring( + COLUMN_DATUM.length()).trim(); if (spezial.length() == 0) { continue; } @@ -322,7 +330,8 @@ if (quellen != null && i < quellen.length) { iwc.setSource(quellen[i]); } - String potentialDate = daten != null && i < daten.length + String potentialDate = + daten != null && i < daten.length ? daten[i] : candidate; iwc.setTimeInterval(guessDate(potentialDate)); @@ -330,7 +339,8 @@ columnHeaderChecked = true; } - BigDecimal [] data = parseLineAsDouble(line, columnCount, true, false); + BigDecimal [] data = parseLineAsDouble( + line, columnCount, true, false); BigDecimal kaem = data[0]; @@ -344,7 +354,8 @@ // check consistence of station ordering in file if (kmHist2 != null && - kmHist2.compareTo(kmHist1) != kmHist1.compareTo(kaem)) { + kmHist2.compareTo(kmHist1) != kmHist1.compareTo(kaem) + ) { throw new ParseException("WST: Stations in " + file + " near line " + in.getLineNumber() + " not ordered. File rejected."); @@ -389,8 +400,10 @@ // but the last one may be shorter if (col < lsBezeichner.length) { lsBezeichner[col++] = - input.substring(i, - Math.min(i + 9, input.length())).trim(); + input.substring( + i, + Math.min(i + 9, input.length()) + ).trim(); } if (col == lsBezeichner.length) { break; @@ -411,7 +424,8 @@ // but only if there were values following the last Q-line if (minKm != MAX_RANGE && maxKm != MIN_RANGE) { if (kmHist1 != null && kmHist2 != null - && kmHist1.compareTo(kmHist2) < 0) { // stations descending in file + && kmHist1.compareTo(kmHist2) < 0) { + // stations descending in file BigDecimal t = minKm; minKm = maxKm; maxKm = t; } addInterval(minKm, maxKm, aktAbfluesse); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/model/BedHeightType.java --- a/backend/src/main/java/org/dive4elements/river/model/BedHeightType.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/model/BedHeightType.java Fri Jan 19 11:23:42 2018 +0100 @@ -75,8 +75,10 @@ return fetchBedHeightTypeForType(type, null); } - public static BedHeightType fetchBedHeightTypeForType(String name, Session session) { - + public static BedHeightType fetchBedHeightTypeForType( + String name, + Session session + ) { if (session == null) { session = SessionHolder.HOLDER.get(); } diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/model/CrossSection.java --- a/backend/src/main/java/org/dive4elements/river/model/CrossSection.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/model/CrossSection.java Fri Jan 19 11:23:42 2018 +0100 @@ -67,7 +67,8 @@ " GROUP BY cross_section_id" + ") cs_ranges " + "JOIN cross_sections cs ON cs_ranges.cross_section_id = cs.id " + - "LEFT OUTER JOIN time_intervals ON cs.time_interval_id = time_intervals.id " + + "LEFT OUTER JOIN time_intervals " + + " ON cs.time_interval_id = time_intervals.id " + "WHERE :km BETWEEN minkm AND maxkm " + "ORDER BY stop_time desc, start_time desc, :km - minkm"; // Order by time interval missing. @@ -167,7 +168,8 @@ ) { Session session = SessionHolder.HOLDER.get(); - SQLQuery sqlQuery = session.createSQLQuery(SQL_FAST_CROSS_SECTION_LINES) + SQLQuery sqlQuery = session.createSQLQuery( + SQL_FAST_CROSS_SECTION_LINES) .addScalar("km", StandardBasicTypes.DOUBLE) .addScalar("x", StandardBasicTypes.DOUBLE) .addScalar("y", StandardBasicTypes.DOUBLE) @@ -220,10 +222,11 @@ } /** - * True if the given section is the "newest" for that river and has values at km. + * True if the given section is the "newest" for that river + * and has values at km. * @param km Given station. - * @return true if the section has the most advanced end of its validity interval - * or the most advanced start of its validity interval. + * @return true if the section has the most advanced end of its validity + * interval or the most advanced start of its validity interval. */ public boolean shouldBeMaster(double km) { Session session = SessionHolder.HOLDER.get(); diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/model/Floodplain.java --- a/backend/src/main/java/org/dive4elements/river/model/Floodplain.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/model/Floodplain.java Fri Jan 19 11:23:42 2018 +0100 @@ -98,8 +98,11 @@ this.name = name; } - public static List getFloodplains(String river, String name, int kind) - throws HibernateException { + public static List getFloodplains( + String river, + String name, + int kind + ) throws HibernateException { Session session = SessionHolder.HOLDER.get(); Query query = session.createQuery( "from Floodplain as fp where river.name =:river" + diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/model/FlowVelocityMeasurementValue.java --- a/backend/src/main/java/org/dive4elements/river/model/FlowVelocityMeasurementValue.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/model/FlowVelocityMeasurementValue.java Fri Jan 19 11:23:42 2018 +0100 @@ -115,7 +115,13 @@ } public static FastFlowVelocityMeasurementValue getUnmapped( - double station, double w, double q, double v, Date datetime, String description) { + double station, + double w, + double q, + double v, + Date datetime, + String description + ) { return new FastFlowVelocityMeasurementValue( station, w, q, v, datetime, description); } diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/model/Gauge.java --- a/backend/src/main/java/org/dive4elements/river/model/Gauge.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/model/Gauge.java Fri Jan 19 11:23:42 2018 +0100 @@ -228,7 +228,10 @@ return results.isEmpty() ? null : results.get(0); } - public static Gauge getGaugeByOfficialNumber(long number, String river_name) { + public static Gauge getGaugeByOfficialNumber( + long number, + String river_name + ) { Session session = SessionHolder.HOLDER.get(); Query query = session.createQuery( diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/model/HydrBoundary.java --- a/backend/src/main/java/org/dive4elements/river/model/HydrBoundary.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/model/HydrBoundary.java Fri Jan 19 11:23:42 2018 +0100 @@ -99,7 +99,11 @@ this.geom = geom; } - public static List getHydrBoundaries(int riverId, String name, int kindId) { + public static List getHydrBoundaries( + int riverId, + String name, + int kindId + ) { Session session = SessionHolder.HOLDER.get(); Query query = session.createQuery( @@ -112,7 +116,10 @@ return query.list(); } - public static List getHydrBoundaries(int riverId, String name) { + public static List getHydrBoundaries( + int riverId, + String name + ) { Session session = SessionHolder.HOLDER.get(); Query query = session.createQuery( diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/model/HydrBoundaryPoly.java --- a/backend/src/main/java/org/dive4elements/river/model/HydrBoundaryPoly.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/model/HydrBoundaryPoly.java Fri Jan 19 11:23:42 2018 +0100 @@ -101,7 +101,10 @@ } - public static List getHydrBoundaries(int riverId, String name) { + public static List getHydrBoundaries( + int riverId, + String name + ) { Session session = SessionHolder.HOLDER.get(); Query query = session.createQuery( diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/model/MeasurementStation.java --- a/backend/src/main/java/org/dive4elements/river/model/MeasurementStation.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/model/MeasurementStation.java Fri Jan 19 11:23:42 2018 +0100 @@ -36,7 +36,8 @@ @Entity @Table(name = "measurement_station") public class MeasurementStation { - private static final Logger log = Logger.getLogger(MeasurementStation.class); + private static final Logger log = Logger.getLogger( + MeasurementStation.class); private Integer id; @@ -108,8 +109,13 @@ } @Id - @SequenceGenerator(name = "SEQ_MEASUREMENT_STATION_ID_SEQ", sequenceName = "MEASUREMENT_STATION_ID_SEQ", allocationSize = 1) - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_MEASUREMENT_STATION_ID_SEQ") + @SequenceGenerator( + name = "SEQ_MEASUREMENT_STATION_ID_SEQ", + sequenceName = "MEASUREMENT_STATION_ID_SEQ", + allocationSize = 1) + @GeneratedValue( + strategy = GenerationType.SEQUENCE, + generator = "SEQ_MEASUREMENT_STATION_ID_SEQ") @Column(name = "id") public Integer getId() { return id; diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/model/RiverAxis.java --- a/backend/src/main/java/org/dive4elements/river/model/RiverAxis.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/model/RiverAxis.java Fri Jan 19 11:23:42 2018 +0100 @@ -123,8 +123,11 @@ } - public static List getRiverAxis(String river, String name, int kind) - throws HibernateException { + public static List getRiverAxis( + String river, + String name, + int kind + ) throws HibernateException { Session session = SessionHolder.HOLDER.get(); Query query = session.createQuery( "from RiverAxis as ax where river.name =:river" + diff -r 7bbfb24e6eec -r 28df64078f27 backend/src/main/java/org/dive4elements/river/model/Wst.java --- a/backend/src/main/java/org/dive4elements/river/model/Wst.java Thu Jan 18 18:34:41 2018 +0100 +++ b/backend/src/main/java/org/dive4elements/river/model/Wst.java Fri Jan 19 11:23:42 2018 +0100 @@ -169,12 +169,12 @@ Session session = SessionHolder.HOLDER.get(); Query query = session.createQuery( - "select min(q), max(q) from WstQRange where " + - " id in " + - " (select wstQRange.id from WstColumnQRange where " + - " wstColumn.id in (select id from WstColumn where wst.id = :wst)) " + - " and range.id in " + - " (select id from Range where not (a > :end or b < :start))"); + "select min(q), max(q) from WstQRange where " + + "id in " + + " (select wstQRange.id from WstColumnQRange where " + + " wstColumn.id in (select id from WstColumn where wst.id = :wst)) " + + "and range.id in " + + " (select id from Range where not (a > :end or b < :start))"); query.setParameter("wst", getId()); query.setParameter("start", new BigDecimal(fromKm)); diff -r 7bbfb24e6eec -r 28df64078f27 checkstyle.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/checkstyle.xml Fri Jan 19 11:23:42 2018 +0100 @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/pom.xml --- a/gwt-client/pom.xml Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/pom.xml Fri Jan 19 11:23:42 2018 +0100 @@ -225,6 +225,29 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.0.0 + + ../checkstyle.xml + UTF-8 + + + + validate + validate + + true + true + + + check + + + + + diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java Fri Jan 19 11:23:42 2018 +0100 @@ -69,7 +69,8 @@ /** The UserService used to retrieve information about the current user. */ protected UserServiceAsync userService = GWT.create(UserService.class); - protected ServerInfoServiceAsync serverInfoService = GWT.create(ServerInfoService.class); + protected ServerInfoServiceAsync serverInfoService = + GWT.create(ServerInfoService.class); /** The RiverService used to retrieve the supported rivers of the server.*/ protected RiverServiceAsync riverService = GWT.create(RiverService.class); @@ -111,7 +112,10 @@ private FLYSHeader header; - public static String getExceptionString(FLYSConstants msg, Throwable caught) { + public static String getExceptionString( + FLYSConstants msg, + Throwable caught + ) { try { return msg.getString(caught.getMessage()); } @@ -156,7 +160,8 @@ Config config = Config.getInstance(); final String locale = config.getLocale(); - serverInfoService.getConfig(locale, new AsyncCallback>() { + serverInfoService.getConfig( + locale, new AsyncCallback>() { @Override public void onSuccess(Map result) { @@ -491,7 +496,8 @@ mainValueView.setShowMaximizeButton(true); mainValueView.setKeepInParentRect(true); - mainValueView.setTitle(MSG.mainvalues() + " " + gauge.getName() + " (" + gauge.getRiverName() + ")" ); + mainValueView.setTitle(MSG.mainvalues() + " " + + gauge.getName() + " (" + gauge.getRiverName() + ")" ); workspace.addChild(mainValueView); } @@ -509,8 +515,8 @@ /** - * This CloseClickHandler is used to remove lock on a specific Collection so - * that is might be opened again. + * This CloseClickHandler is used to remove lock on a specific Collection + * so that is might be opened again. */ public class CloseCollectionViewHandler implements CloseClickHandler { protected FLYS flys; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/services/SedimentLoadInfoService.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/services/SedimentLoadInfoService.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/services/SedimentLoadInfoService.java Fri Jan 19 11:23:42 2018 +0100 @@ -24,7 +24,7 @@ public interface SedimentLoadInfoService extends RemoteService { /** - * This method returns a list of SedimentLoadInfoObjects for a specific river. + * Returns a list of SedimentLoadInfoObjects for a specific river. */ SedimentLoadInfoObject[] getSedimentLoadInfo( String locale, diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/services/ServerInfoService.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/services/ServerInfoService.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/services/ServerInfoService.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.client.client.services; import com.google.gwt.user.client.rpc.RemoteService; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/services/ServerInfoServiceAsync.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/services/ServerInfoServiceAsync.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/services/ServerInfoServiceAsync.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.client.client.services; import com.google.gwt.user.client.rpc.AsyncCallback; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractUIProvider.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractUIProvider.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractUIProvider.java Fri Jan 19 11:23:42 2018 +0100 @@ -113,7 +113,8 @@ * @param e The StepBackEvent. */ protected void fireStepBackEvent(StepBackEvent e) { - GWT.log("AbstractUIProvider - fireStepBackEvent() handlers: " + backHandlers.size()); + GWT.log("AbstractUIProvider - fireStepBackEvent() handlers: " + + backHandlers.size()); for (StepBackHandler handler: backHandlers) { handler.onStepBack(e); } @@ -127,7 +128,8 @@ * @param e The StepForwardEvent. */ protected void fireStepForwardEvent(StepForwardEvent e) { - GWT.log("AbstractUIProvider - fireStepForwardEvent() handlers: " + forwardHandlers.size()); + GWT.log("AbstractUIProvider - fireStepForwardEvent() handlers: " + + forwardHandlers.size()); for (StepForwardHandler handler: forwardHandlers) { handler.onStepForward(e); } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/CollectionView.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/CollectionView.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/CollectionView.java Fri Jan 19 11:23:42 2018 +0100 @@ -664,12 +664,15 @@ new AsyncCallback() { @Override public void onFailure(Throwable caught) { - GWT.log("An error occured while adding artifact."); - SC.warn(FLYS.getExceptionString(messages, caught)); + GWT.log("An error occured while " + + "adding artifact."); + SC.warn(FLYS.getExceptionString( + messages, caught)); } @Override - public void onSuccess(Collection newCollection) { + public void onSuccess( + Collection newCollection) { GWT.log("Successfully added artifacts."); setCollection(newCollection); } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageWindow.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageWindow.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageWindow.java Fri Jan 19 11:23:42 2018 +0100 @@ -194,7 +194,8 @@ new AsyncCallback() { public void onFailure(Throwable caught) { decreateInProgress(); - GWT.log("Create-artifact failed: " + caught.getMessage()); + GWT.log("Create-artifact failed: " + + caught.getMessage()); SC.warn(caught.getMessage()); } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DigitizePanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DigitizePanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DigitizePanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -165,7 +165,8 @@ helperContainer.addResizedHandler(new ResizedHandler() { @Override public void onResized(ResizedEvent event) { - mapPanel.doLayout(helperContainer.getWidth(), helperContainer.getHeight()); + mapPanel.doLayout( + helperContainer.getWidth(), helperContainer.getHeight()); } }); helperContainer.addParentMovedHandler(new ParentMovedHandler() { @@ -174,10 +175,12 @@ mapPanel.getFloodMap().updateSize(); } }); - helperContainer.addVisibilityChangedHandler(new VisibilityChangedHandler() { + helperContainer.addVisibilityChangedHandler( + new VisibilityChangedHandler() { @Override public void onVisibilityChanged(VisibilityChangedEvent event) { - mapPanel.doLayout(helperContainer.getWidth(), helperContainer.getHeight()); + mapPanel.doLayout( + helperContainer.getWidth(), helperContainer.getHeight()); } }); helperContainer.addMember(mapPanel); @@ -204,7 +207,8 @@ false, true); map.addLayer(hwsLayer); } - String userRgd = getDataValue("state.winfo.uesk.user-rgd", "uesk.user-rgd"); + String userRgd = getDataValue( + "state.winfo.uesk.user-rgd", "uesk.user-rgd"); if (userRgd != null && userRgd.length() > 0) { WMS userLayer = getLayer( //TODO: Use Mapinfo to get hws layer infos. @@ -217,11 +221,18 @@ map.addControl(new Attribution()); map.zoomToMaxExtent(); - mapPanel.doLayout(helperContainer.getWidth(), helperContainer.getHeight()); + mapPanel.doLayout( + helperContainer.getWidth(), helperContainer.getHeight()); } - protected WMS getLayer(String url, String layers, String proj, boolean isBaseLayer, boolean singleTiled) { + protected WMS getLayer( + String url, + String layers, + String proj, + boolean isBaseLayer, + boolean singleTiled + ) { final WMSParams params = new WMSParams(); params.setLayers(layers); params.setFormat("image/png"); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DistancePanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DistancePanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DistancePanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -58,7 +58,8 @@ /** Panel to allow input of distance for calculation range. */ -public class DistancePanel extends AbstractUIProvider implements BlurHandler, FilterHandler +public class DistancePanel + extends AbstractUIProvider implements BlurHandler, FilterHandler { private static final long serialVersionUID = -883142387908664588L; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/FLYSHeader.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/FLYSHeader.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/FLYSHeader.java Fri Jan 19 11:23:42 2018 +0100 @@ -103,7 +103,8 @@ @Override public void onSuccess(Void result) { - /* Just reload the page. GGInAFilter is goint to redirect + /* Just reload the page. GGInAFilter is going + * to redirect * to the correct login page */ Window.Location.reload(); } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/GaugeTimeRangePanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/GaugeTimeRangePanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/GaugeTimeRangePanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -295,7 +295,8 @@ }; - ListGridField addstart = new ListGridField ("addstart", MESSAGES.from()); + ListGridField addstart = new ListGridField ( + "addstart", MESSAGES.from()); addstart.setType (ListGridFieldType.ICON); addstart.setWidth (30); addstart.setCellIcon(baseUrl + MESSAGES.markerGreen()); @@ -330,7 +331,8 @@ }); ListGridField desc = - new ListGridField("description", MESSAGES.discharge_curve_gaugeless()); + new ListGridField( + "description", MESSAGES.discharge_curve_gaugeless()); desc.setType(ListGridFieldType.TEXT); desc.setWidth("*"); @@ -365,7 +367,9 @@ if (data != null && data.length > 0) { for (int i = 0; i < data.length; i++) { DataList dl = data[i]; - if (dl.getState().equals("state.winfo.historicalq.reference_gauge")) { + if (dl.getState().equals( + "state.winfo.historicalq.reference_gauge") + ) { for (int j = 0; j < dl.size(); j++) { Data d = dl.get(j); DataItem[] di = d.getItems(); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/HWSDatacagePanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/HWSDatacagePanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/HWSDatacagePanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -128,7 +128,8 @@ Data[] data = new Data[1]; DataItem item = new DefaultDataItem( "uesk.hws", "uesk.hws", result); - data[0] = new DefaultData("uesk.hws", null, null, new DataItem[] {item}); + data[0] = new DefaultData( + "uesk.hws", null, null, new DataItem[] {item}); return data; } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ImgLink.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ImgLink.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ImgLink.java Fri Jan 19 11:23:42 2018 +0100 @@ -48,7 +48,8 @@ protected void update() { String target = newTab ? "_blank" : "_self"; - setContents(""); + setContents(""); setWidth(width); setHeight(height); setOverflow(Overflow.VISIBLE); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LocationDistancePanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LocationDistancePanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LocationDistancePanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -290,8 +290,8 @@ if (isLocationMode ()) { appendLocation(r.getAttribute("to")); } else { - /* Distance and double pin behavior is only defined for - * location mode. */ + /* Distance and double pin behavior is only + * defined for location mode. */ GWT.log("Unhandled input state."); } } @@ -320,8 +320,8 @@ if (!isLocationMode ()) { setTo(r.getAttribute("from")); } else { - /* Distance and double pin behavior is only defined for - * location mode. */ + /* Distance and double pin behavior is only + * defined for location mode. */ GWT.log("Unhandled input state."); } } @@ -884,7 +884,8 @@ Data dFrom = getDataFrom(); Data dTo = getDataTo(); Data dStep = getDataStep(); - DataItem loc = new DefaultDataItem("ld_locations", "ld_locations",""); + DataItem loc = new DefaultDataItem( + "ld_locations", "ld_locations",""); data.add(dFrom); data.add(dTo); @@ -1160,11 +1161,13 @@ radio.setVertical(false); radio.setWrap(false); - LinkedHashMap values = new LinkedHashMap(); + LinkedHashMap values = + new LinkedHashMap(); values.put(FIELD_VALUE_LOCATION, MESSAGES.location()); values.put(FIELD_VALUE_DISTANCE, MESSAGES.distance()); - LinkedHashMap initial = new LinkedHashMap(); + LinkedHashMap initial = + new LinkedHashMap(); initial.put(FIELD_MODE, FIELD_VALUE_DISTANCE); radio.setValueMap(values); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LocationPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LocationPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LocationPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -30,7 +30,8 @@ import java.util.List; /** - * This UIProvider serves as base for UI Providers to enter a single location (km). + * This UIProvider serves as base for UI Providers to enter + * a single location (km). */ public abstract class LocationPanel extends AbstractUIProvider diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/MapSelection.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/MapSelection.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/MapSelection.java Fri Jan 19 11:23:42 2018 +0100 @@ -60,7 +60,8 @@ form.setWidth(400); form.setLayoutAlign(VerticalAlignment.TOP); - // TODO implement event handling in the river map (here? or in LinkSelection) + // TODO implement event handling in the river map + // (here? or in LinkSelection) h.addMember(form); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ModuleSelection.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ModuleSelection.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ModuleSelection.java Fri Jan 19 11:23:42 2018 +0100 @@ -59,7 +59,8 @@ protected Module[] modules; /** The ModuleService used to retrieve the available modules of a user.*/ - protected ModuleServiceAsync moduleService = GWT.create(ModuleService.class); + protected ModuleServiceAsync moduleService = GWT.create( + ModuleService.class); private Map > modulesRiverMap; protected Map rivers; @@ -123,7 +124,11 @@ if (selected == null) { selected = getSelectedModule(); } - if (rivers != null && !rivers.isEmpty() && modules != null && selected != null) { + if (rivers != null + && !rivers.isEmpty() + && modules != null + && selected != null + ) { List allowedRivers = modulesRiverMap.get(selected); if ( allowedRivers == null ) { GWT.log("No configured rivers for module: " + selected); @@ -143,7 +148,8 @@ } private void setModules() { - LinkedHashMap values = new LinkedHashMap(); + LinkedHashMap values = + new LinkedHashMap(); if (this.modules!= null) { for(Module module : this.modules) { diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/MultiPeriodPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/MultiPeriodPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/MultiPeriodPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -112,7 +112,9 @@ @Override public void onRecordClick(final RecordClickEvent event) { // Just handle remove-clicks - if(!event.getField().getName().equals(removeField.getName())) { + if(!event.getField().getName() + .equals(removeField.getName()) + ) { return; } event.getViewer().removeData(event.getRecord()); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/MultipleLocationPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/MultipleLocationPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/MultipleLocationPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -91,7 +91,8 @@ labelString = MSG.getString(getDataItemName()); } catch(java.util.MissingResourceException mre) { - GWT.log("Cannot find translation for data item name : " + getDataItemName()); + GWT.log("Cannot find translation for data item name : " + + getDataItemName()); labelString = getLabelString(); } Label label = new Label(labelString); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ParameterList.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ParameterList.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ParameterList.java Fri Jan 19 11:23:42 2018 +0100 @@ -374,7 +374,8 @@ String river = riversItems[0].getStringValue(); if (module == null || river == null) { - GWT.log("ParameterList.renderNew(): module == null || river == null"); + GWT.log("ParameterList.renderNew(): module == null " + + "|| river == null"); unlockUI(); return; } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ParameterMatrix.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ParameterMatrix.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ParameterMatrix.java Fri Jan 19 11:23:42 2018 +0100 @@ -134,7 +134,8 @@ DataItem[] items = options.getItems(); if (items == null) { - GWT.log("No items found in StringOptionsData '" + groupTitle + "'"); + GWT.log("No items found in StringOptionsData '" + + groupTitle + "'"); return; } @@ -160,7 +161,8 @@ DataItem[] items = options.getItems(); if (items == null) { - GWT.log("No items found in StringOptionsData '" + groupTitle + "'"); + GWT.log("No items found in StringOptionsData '" + + groupTitle + "'"); return; } @@ -218,14 +220,16 @@ } for (int i = 0, n = columnNames.size(); i < n; i++) { - ListGridField field = new ListGridField(columnNames.get(i), MESSAGE.getString(columnNames.get(i))); + ListGridField field = new ListGridField( + columnNames.get(i), MESSAGE.getString(columnNames.get(i))); field.setType(ListGridFieldType.BOOLEAN); field.setCanEdit(true); fields.add(field); selected.put(columnNames.get(i), new ArrayList()); } - ListGridField[] fieldsArray = fields.toArray(new ListGridField[fields.size()]); + ListGridField[] fieldsArray = fields.toArray( + new ListGridField[fields.size()]); listGrid.setFields(fieldsArray); int nVals = valueNames.size(); @@ -338,7 +342,8 @@ String columnName = columnNames.get(i); if (Boolean.valueOf(record.getAttribute(columnName)) == true) { if (result.containsKey(columnName)) { - result.get(columnName).add(record.getAttribute(columnName + "-value")); + result.get(columnName).add( + record.getAttribute(columnName + "-value")); } else { List items = new ArrayList(); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ParameterMatrixPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ParameterMatrixPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ParameterMatrixPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -130,7 +130,8 @@ DataItem item = items[j]; Label value = new Label(item.getLabel()); - value.setValign(com.smartgwt.client.types.VerticalAlignment.TOP); + value.setValign( + com.smartgwt.client.types.VerticalAlignment.TOP); value.setWidth(130); value.setHeight(15); @@ -206,7 +207,9 @@ List errors = new ArrayList(); // Early stop on one (only) error. boolean ok = false; - for (Map.Entry> entry : matrix.getSelection().entrySet()) { + for (Map.Entry> entry: + matrix.getSelection().entrySet() + ) { /* single entries are allowed!! if (entry.getValue() == null || entry.getValue().size() == 0) { errors.add(MESSAGES.error_values_needed()); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/PeriodPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/PeriodPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/PeriodPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -184,8 +184,10 @@ if(valid) { String start = Long.valueOf(this.start).toString(); String end = Long.valueOf(this.end).toString(); - DataItem startItem = new DefaultDataItem(startName, startName, start); - DataItem endItem = new DefaultDataItem(endName, endName, end); + DataItem startItem = new DefaultDataItem( + startName, startName, start); + DataItem endItem = new DefaultDataItem( + endName, endName, end); data.add(new DefaultData( startName, null, diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ProjectList.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ProjectList.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ProjectList.java Fri Jan 19 11:23:42 2018 +0100 @@ -538,7 +538,8 @@ public void onSuccess(Void v) { updateUserCollections(); if(flys.getWorkspace().hasView(c.identifier())) { - flys.getWorkspace().updateTitle(c.identifier(), c.getName()); + flys.getWorkspace().updateTitle( + c.identifier(), c.getName()); } } }); @@ -723,7 +724,8 @@ date.setCellFormatter(new CellFormatter() { @Override - public String format(Object value, ListGridRecord rec, int r, int c) { + public String format( + Object value, ListGridRecord rec, int r, int c) { if (value == null) { return null; } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/QSegmentedInputPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/QSegmentedInputPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/QSegmentedInputPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -302,7 +302,11 @@ String title = item.getLabel(); DoubleArrayPanel dap = new DoubleArrayPanel( - createLineTitle(title), null, this, null, TitleOrientation.LEFT); + createLineTitle(title), + null, + this, + null, + TitleOrientation.LEFT); wqranges.put(title, dap); @@ -368,7 +372,8 @@ wqvalue = createValueString(key + "; ", values); } else { - wqvalue += GAUGE_SEPARATOR + createValueString(key + "; ", values); + wqvalue += GAUGE_SEPARATOR + + createValueString(key + "; ", values); } } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RadioPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RadioPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RadioPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -64,7 +64,8 @@ RadioGroupItem rgi = new RadioGroupItem("selection"); rgi.setShowTitle(false); GWT.log("items: " + items.length); - LinkedHashMap elems = new LinkedHashMap(); + LinkedHashMap elems = + new LinkedHashMap(); for (int i = 0; i < items.length; i++) { GWT.log(items[i].getStringValue() + "; " + items[i].getLabel()); elems.put(items[i].getStringValue(), items[i].getLabel()); @@ -91,7 +92,8 @@ @Override protected Data[] getData() { String value = form.getValueAsString("selection"); - DataItem item = new DefaultDataItem(this.dataName, this.dataName, value); + DataItem item = new DefaultDataItem( + this.dataName, this.dataName, value); return new Data[] { new DefaultData( this.dataName, null, null, new DataItem[]{item})}; } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RiverInfoPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RiverInfoPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RiverInfoPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -97,8 +97,9 @@ MSG.gauge_river_url() + number : MSG.gauge_river_url(); String wikiBaseUrl = Config.getInstance().getWikiUrl(); - DynamicForm infoLink = WikiLinks.linkDynamicForm(this.flys, wikiBaseUrl + url, - MSG.gauge_river_info_link()); + DynamicForm infoLink = WikiLinks.linkDynamicForm( + this.flys, wikiBaseUrl + url, + MSG.gauge_river_info_link()); infoLink.setTop(5); infoLink.setMargin(5); addMember(infoLink); @@ -112,7 +113,8 @@ } private void addLabel(String text, boolean wordwrap) { - Label label = new Label("" + text + ""); + Label label = new Label( + "" + text + ""); label.setWrap(wordwrap); label.setMargin(5); addMember(label); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/SelectProvider.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/SelectProvider.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/SelectProvider.java Fri Jan 19 11:23:42 2018 +0100 @@ -164,16 +164,20 @@ label.setHeight(20); label.setWidth(400); - LinkedHashMap initial = new LinkedHashMap(); + LinkedHashMap initial = + new LinkedHashMap(); ArrayList formItems = new ArrayList(); for (DataItem item: d.getItems()) { - initial.put(item.getLabel().replace(' ', '_'), item.getStringValue()); - GWT.log("put: " + item.getLabel().replace(' ', '_') + "=" + item.getStringValue()); + initial.put( + item.getLabel().replace(' ', '_'), item.getStringValue()); + GWT.log("put: " + item.getLabel().replace(' ', '_') + + "=" + item.getStringValue()); LinkItem link = new LinkItem(d.getLabel()); link.setLinkTitle(item.getLabel()); // i18n text of the link - link.setAttribute(d.getLabel(), item.getStringValue()); // e.g. "calculation_mode":"foo" + link.setAttribute(d.getLabel(), item.getStringValue()); + // e.g. "calculation_mode":"foo" link.setShowTitle(false); link.setEndRow(true); link.setWidth("350px"); @@ -202,7 +206,8 @@ layout.setAlign(VerticalAlignment.TOP); layout.setHeight(25); - LinkedHashMap initial = new LinkedHashMap(); + LinkedHashMap initial = + new LinkedHashMap(); int size = data.size(); @@ -217,7 +222,8 @@ SelectItem combobox = new SelectItem(d.getLabel()); combobox.setWidth(250); - LinkedHashMap it = new LinkedHashMap(); + LinkedHashMap it = + new LinkedHashMap(); boolean defaultSet = false; boolean first = true; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/StyleEditorWindow.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/StyleEditorWindow.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/StyleEditorWindow.java Fri Jan 19 11:23:42 2018 +0100 @@ -388,7 +388,8 @@ f.setValue(value); } else if (name.equals("labelfontsize") || name.equals("textsize")) { - LinkedHashMap valueMap = new LinkedHashMap(); + LinkedHashMap valueMap = + new LinkedHashMap(); valueMap.put("3", "3"); valueMap.put("5", "5"); valueMap.put("8", "8"); @@ -401,7 +402,8 @@ f.setValue(value); } else if (name.equals("bandwidth")) { - LinkedHashMap valueMap = new LinkedHashMap(); + LinkedHashMap valueMap = + new LinkedHashMap(); valueMap.put("0", "0"); valueMap.put("1", "1"); valueMap.put("2", "2"); @@ -418,7 +420,8 @@ f.setValue(value); } else if (name.equals("pointsize")) { - LinkedHashMap valueMap = new LinkedHashMap(); + LinkedHashMap valueMap = + new LinkedHashMap(); valueMap.put("1", "1"); valueMap.put("2", "2"); valueMap.put("3", "3"); @@ -430,7 +433,8 @@ f.setValue(value); } else if (name.equals("numclasses")) { - LinkedHashMap valueMap = new LinkedHashMap(); + LinkedHashMap valueMap = + new LinkedHashMap(); valueMap.put("5", "5"); valueMap.put("6", "6"); valueMap.put("7", "7"); @@ -448,7 +452,8 @@ return null; } else if (name.contains("transparency")) { - LinkedHashMap valueMap = new LinkedHashMap(); + LinkedHashMap valueMap = + new LinkedHashMap(); for (int n = 10; n < 100; n += 10) { valueMap.put(Integer.toString(n), n + "%"); } @@ -459,7 +464,8 @@ else if (type.equals("boolean")) { if(name.equals("textorientation")) { f = new SelectItem(name, MSG.getString(name)); - LinkedHashMap valueMap = new LinkedHashMap(); + LinkedHashMap valueMap = + new LinkedHashMap(); valueMap.put("true", MSG.getString("horizontal")); valueMap.put("false", MSG.getString("vertical")); f.setValueMap(valueMap); @@ -506,12 +512,15 @@ } else if (type.equals("dash")) { f = new SelectItem(name, MSG.getString(name)); - LinkedHashMap valueIcons = new LinkedHashMap(); - f.setImageURLPrefix(GWT.getHostPageBaseURL() + "images/linestyle-dash-"); + LinkedHashMap valueIcons = + new LinkedHashMap(); + f.setImageURLPrefix(GWT.getHostPageBaseURL() + + "images/linestyle-dash-"); f.setImageURLSuffix(".png"); f.setValueIconHeight(20); f.setValueIconWidth(80); - LinkedHashMap valueMap = new LinkedHashMap(); + LinkedHashMap valueMap = + new LinkedHashMap(); valueMap.put("10", ""); valueMap.put("10,5", ""); valueMap.put("20,10", ""); @@ -528,20 +537,29 @@ } else if (type.equals("font")) { f = new SelectItem(name, MSG.getString(name)); - LinkedHashMap valueMap = new LinkedHashMap(); - valueMap.put("arial", "Arial"); - valueMap.put("courier", "Courier"); - valueMap.put("verdana", "Verdana"); - valueMap.put("times", "Times"); + LinkedHashMap valueMap = + new LinkedHashMap(); + valueMap.put( + "arial", "Arial"); + valueMap.put( + "courier", "Courier"); + valueMap.put( + "verdana", "Verdana"); + valueMap.put( + "times", "Times"); f.setValueMap(valueMap); f.setValue(value); } else if (type.equals("style")) { f = new SelectItem(name, MSG.getString(name)); - LinkedHashMap valueMap = new LinkedHashMap(); - valueMap.put("standard", "Normal"); - valueMap.put("bold", "Bold"); - valueMap.put("italic", "Italic"); + LinkedHashMap valueMap = + new LinkedHashMap(); + valueMap.put( + "standard", "Normal"); + valueMap.put( + "bold", "Bold"); + valueMap.put( + "italic", "Italic"); f.setValueMap(valueMap); f.setValue(value); } @@ -570,12 +588,14 @@ protected FormItem createLineSizeUI(FormItem f) { - LinkedHashMap valueIcons = new LinkedHashMap(); + LinkedHashMap valueIcons = + new LinkedHashMap(); f.setImageURLPrefix(GWT.getHostPageBaseURL() + "images/linestyle-"); f.setImageURLSuffix("px.png"); f.setValueIconHeight(20); f.setValueIconWidth(80); - LinkedHashMap valueMap = new LinkedHashMap(); + LinkedHashMap valueMap = + new LinkedHashMap(); valueMap.put("1", ""); valueMap.put("2", ""); valueMap.put("3", ""); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ThemePanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ThemePanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ThemePanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -52,7 +52,8 @@ /** * ThemePanel on the left in CollectionView. - * Contains control widgets for "themes", which are plotted in a diagram (chart). + * Contains control widgets for "themes", which are plotted in + * a diagram (chart). * * @author Ingo Weinzierl */ diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UserRGDProvider.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UserRGDProvider.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UserRGDProvider.java Fri Jan 19 11:23:42 2018 +0100 @@ -80,7 +80,9 @@ uploadTargetFrame.setWidth("200px"); uploadTargetFrame.setHeight("50px"); uploadTargetFrame.setContents( - ""); + ""); uploadTargetFrame.setBorder("0px"); uploadTargetFrame.setScrollbarSize(0); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQAdaptedInputPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQAdaptedInputPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQAdaptedInputPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -235,7 +235,8 @@ double val = r.getAttributeAsDouble("value"); doubleArrayPanels.get(fi).setValues(new double[]{val}); - // If a named value for first gauge is chosen, try to find and set + // If a named value for first gauge is chosen, + // try to find and set // the values to the other panels too. if (fi == 0) { String valueName = r.getAttribute("name"); @@ -246,12 +247,14 @@ oi++; continue; } - Double value = otherQDTable.findRecordValue(valueName); + Double value = otherQDTable.findRecordValue( + valueName); if (value == null) { SC.warn(MSG.noMainValueAtGauge()); } else { - doubleArrayPanels.get(oi).setValues(new double[]{value}); + doubleArrayPanels.get(oi).setValues( + new double[]{value}); } oi++; } @@ -285,7 +288,8 @@ double val = r.getAttributeAsDouble("value"); doubleArrayPanels.get(fi).setValues(new double[]{val}); - // If a named value for first gauge is chosen, try to find and set + // If a named value for first gauge is chosen, + // try to find and set // the values to the other panels too. if (fi == 0) { String valueName = r.getAttribute("name"); @@ -296,13 +300,15 @@ oi++; continue; } - Double value = otherWTable.findRecordValue(valueName); + Double value = otherWTable.findRecordValue( + valueName); if (value == null) { // TODO: afterwards it freaks out SC.warn(MSG.noMainValueAtGauge()); } else { - doubleArrayPanels.get(oi).setValues(new double[]{value}); + doubleArrayPanels.get(oi).setValues( + new double[]{value}); } oi++; } @@ -766,7 +772,8 @@ wqvalue = createValueString(key + ";" + label, values); } else { - wqvalue += GAUGE_SEPARATOR + createValueString(key + ";" + label, values); + wqvalue += GAUGE_SEPARATOR + + createValueString(key + ";" + label, values); } } @@ -837,10 +844,12 @@ // Get Data for respective gauge. for (double[] range : gaugeRanges){ - // Gauge ranges overlap, move start and end a bit closer to each other. + // Gauge ranges overlap, move start and end a bit closer + // to each other. final double rDiff = (range[1] - range[0]) / 10d; final int fi = i; - wqInfoService.getWQInfo(locale, river, range[0]+rDiff, range[1]-rDiff, + wqInfoService.getWQInfo( + locale, river, range[0]+rDiff, range[1]-rDiff, new AsyncCallback() { @Override public void onFailure(Throwable caught) { @@ -851,7 +860,8 @@ @Override public void onSuccess(WQInfoObject[] wqi) { int num = wqi != null ? wqi.length :0; - GWT.log("Received " + num + " wq informations (" + fi + "."); + GWT.log("Received " + num + + " wq informations (" + fi + "."); if (num == 0) { return; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQInputPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQInputPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQInputPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -606,7 +606,8 @@ VLayout v = new VLayout(); for (String col: cols) { - Label l = new Label(col + " " + (isFree ? MESSAGE.unitWFree() : MESSAGE.unitWSingle())); + Label l = new Label(col + " " + + (isFree ? MESSAGE.unitWFree() : MESSAGE.unitWSingle())); l.setHeight(20); v.addMember(l); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQSimpleArrayPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQSimpleArrayPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQSimpleArrayPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -240,18 +240,22 @@ final String river = desc.getRiver(); final String refGauge = desc.getReferenceGauge(); - gaugeService.getGaugeInfo(river, refGauge, new AsyncCallback>() { - @Override - public void onFailure(Throwable throwable) { - GWT.log("ERROR WHILE FETCHING GAUGES!"); - } + gaugeService.getGaugeInfo( + river, + refGauge, + new AsyncCallback>() { + @Override + public void onFailure(Throwable throwable) { + GWT.log("ERROR WHILE FETCHING GAUGES!"); + } - @Override - public void onSuccess(List gauges) { - Gauge g = gauges.get(0); - updateWQData(river, g.getLower(), g.getUpper()); + @Override + public void onSuccess(List gauges) { + Gauge g = gauges.get(0); + updateWQData(river, g.getLower(), g.getUpper()); + } } - }); + ); } @@ -314,7 +318,7 @@ NumberFormat nf = NumberFormat.getDecimalFormat(); DataItem[] items = modeData.getItems(); - String unit = items[0].getStringValue().equals("0") ? "cm" : "m³/s"; + String unit = items[0].getStringValue().equals("0") ? "cm" : "m³/s"; VLayout layout = new VLayout(); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiImgLink.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiImgLink.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiImgLink.java Fri Jan 19 11:23:42 2018 +0100 @@ -16,7 +16,13 @@ protected FLYS instance; - public WikiImgLink(String imgUrl, String href, int width, int height, FLYS instance) { + public WikiImgLink( + String imgUrl, + String href, + int width, + int height, + FLYS instance + ) { super(imgUrl, href, width, height, false); this.instance = instance; update(); @@ -24,7 +30,8 @@ @Override protected void update() { - setContents(WikiLinks.imageLinkForm(instance, href, imgUrl, "wikiImgLink" + toString())); + setContents(WikiLinks.imageLinkForm( + instance, href, imgUrl, "wikiImgLink" + toString())); setWidth(width); setHeight(height); setOverflow(Overflow.VISIBLE); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiLinks.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiLinks.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiLinks.java Fri Jan 19 11:23:42 2018 +0100 @@ -22,7 +22,12 @@ public class WikiLinks { - public static String imageLinkForm(FLYS instance, String url, String imageUrl, String formName) { + public static String imageLinkForm( + FLYS instance, + String url, + String imageUrl, + String formName + ) { String saml = null; if (instance != null && instance.getCurrentUser() != null) { saml = instance.getCurrentUser().getSamlXMLBase64(); @@ -39,11 +44,16 @@ + ""; } else { - return ""; + return ""; } } - public static DynamicForm linkDynamicForm(FLYS flys, String url, String text) { + public static DynamicForm linkDynamicForm( + FLYS flys, + String url, + String text + ) { User currentUser = flys.getCurrentUser(); String quotedUrl = SafeHtmlUtils.htmlEscape(url); String quotedText = SafeHtmlUtils.htmlEscape(text); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WspDatacagePanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WspDatacagePanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WspDatacagePanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -159,7 +159,10 @@ } - protected String createDataString(String artifact, Recommendation recommendation) { + protected String createDataString( + String artifact, + Recommendation recommendation + ) { Facet f = null; // The filter will only be available or previous calculation artifacts. @@ -178,10 +181,12 @@ } } - return "[" + artifact + ";" + f.getName() + ";" + f.getIndex() + "]"; + return "[" + artifact + ";" + f.getName() + ";" + + f.getIndex() + "]"; } else { - return "[" + artifact + ";" + recommendation.getFactory() + ";" + 0 + "]"; + return "[" + artifact + ";" + + recommendation.getFactory() + ";" + 0 + "]"; } } } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartOutputTab.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartOutputTab.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartOutputTab.java Fri Jan 19 11:23:42 2018 +0100 @@ -70,7 +70,8 @@ * chart. */ protected ChartInfo chartInfo; - /** Transformer used to transform image pixels into chart (data) coordinates. */ + /** Transformer used to transform image pixels into chart (data) + * coordinates. */ protected Transform2D[] transformer; /** The collection view.*/ @@ -420,7 +421,9 @@ Number min = axis.getMin(); Number max = axis.getMax(); - Number range = isBigger(max, min) ? subtract(max, min) : subtract(min, max); + Number range = isBigger(max, min) + ? subtract(max, min) + : subtract(min, max); Number curFrom = axis.getFrom(); Number curTo = axis.getTo(); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartPropertiesEditor.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartPropertiesEditor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartPropertiesEditor.java Fri Jan 19 11:23:42 2018 +0100 @@ -193,9 +193,11 @@ if (pg.getName().equals("axis")) { // Certain axis shall be skipped (W/Q-Diagrams cm-axis especially). String outputName = tab.getOutputName(); - if (outputName.equals("fix_wq_curve") || outputName.equals("computed_discharge_curve") + if (outputName.equals("fix_wq_curve") + || outputName.equals("computed_discharge_curve") || outputName.equals("extreme_wq_curve")) { - String labelString = ((StringProperty)origPg.getPropertyByName("label")).getValue(); + String labelString = ((StringProperty)origPg.getPropertyByName( + "label")).getValue(); if(labelString.equals("W [cm]")) { VLayout layout = new VLayout(); layout.setHeight(0); @@ -223,7 +225,8 @@ // otherwise add an hidden property for suggestedLabel sugLabel = createStringProperty(suggestedLabel); sugLabel.setValue( - ((StringProperty)origPg.getPropertyByName("suggested-label")).getValue()); + ((StringProperty)origPg.getPropertyByName( + "suggested-label")).getValue()); } IntegerProperty fontsize = @@ -270,16 +273,22 @@ } else { // Time range axis scaleLayout = new VLayout(); - StringProperty dateUpper = (StringProperty)pg.getPropertyByName("upper-time"); - StringProperty dateLower = (StringProperty)pg.getPropertyByName("lower-time"); + StringProperty dateUpper = + (StringProperty)pg.getPropertyByName("upper-time"); + StringProperty dateLower = + (StringProperty)pg.getPropertyByName("lower-time"); if (dateUpper != null && dateLower != null) { DateItem lowerDI = createDateProperty(dateLower); DateItem upperDI = createDateProperty(dateUpper); - StringProperty origUp = (StringProperty)origPg.getPropertyByName("upper-time"); - StringProperty origLow = (StringProperty)origPg.getPropertyByName("lower-time"); + StringProperty origUp = + (StringProperty)origPg.getPropertyByName("upper-time"); + StringProperty origLow = + (StringProperty)origPg.getPropertyByName("lower-time"); try { - lowerDI.setValue(new Date(Long.valueOf(origLow.getValue()))); - upperDI.setValue(new Date(Long.valueOf(origUp.getValue()))); + lowerDI.setValue(new Date( + Long.valueOf(origLow.getValue()))); + upperDI.setValue(new Date( + Long.valueOf(origUp.getValue()))); } catch (NumberFormatException e) { // Just leave it at default then. } @@ -296,7 +305,8 @@ (BooleanProperty)pg.getPropertyByName("fixation"); FormItem fix = createBooleanProperty(fixation); fix.setValue(((BooleanProperty) - origPg.getPropertyByName("fixation")).getValue().booleanValue()); + origPg.getPropertyByName("fixation")) + .getValue().booleanValue()); fix.setWidth(30); fix.addChangedHandler(new ChangedHandler() { @@ -381,12 +391,14 @@ if (choiceAttribute != null && choiceAttribute.equals("logo")) { SelectItem logoChooser = new SelectItem(); - logoChooser.setImageURLPrefix(GWT.getHostPageBaseURL() + "images/logo-"); + logoChooser.setImageURLPrefix( + GWT.getHostPageBaseURL() + "images/logo-"); logoChooser.setValueIconHeight(50); logoChooser.setValueIconWidth(100); LinkedHashMap valueMap = new LinkedHashMap(); - LinkedHashMap valueIcons = new LinkedHashMap(); + LinkedHashMap valueIcons = + new LinkedHashMap(); valueMap.put("none", MSG.getString("none")); /* If you want to add images, remember to change code in these places: diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartThemePanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartThemePanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartThemePanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -41,7 +41,8 @@ /** * ThemePanel on the left in CollectionView. - * Contains control widgets for "themes", which are plotted in a diagram (chart). + * Contains control widgets for "themes", which are plotted + * in a diagram (chart). * * @author Ingo Weinzierl */ @@ -384,7 +385,8 @@ int nThemes = themes.getThemeCount(); // Create the "under..." submenu. - MenuItem underMenuItem = new MenuItem(MSG.chart_themepanel_area_under()); + MenuItem underMenuItem = new MenuItem( + MSG.chart_themepanel_area_under()); Menu underMenu = new Menu(); for (int i = 0; i < nThemes; i++) { final Theme theme = themes.getThemeAt(i+1); @@ -443,7 +445,8 @@ overMenu.addItem(againstAxis); // Create the "between..." submenu. - MenuItem betweenMenuItem = new MenuItem(MSG.chart_themepanel_area_between()); + MenuItem betweenMenuItem = new MenuItem( + MSG.chart_themepanel_area_between()); Menu betweenMenu = new Menu(); for (int i = 0; i < nThemes; i++) { final Theme theme = themes.getThemeAt(i+1); @@ -475,7 +478,8 @@ areaMenu.addItem(overMenuItem); areaMenu.addItem(underMenuItem); areaMenu.addItem(createSeparator()); - MenuItem standAloneAgainstAxis = new MenuItem(MSG.getString("against_x_axis")); + MenuItem standAloneAgainstAxis = new MenuItem( + MSG.getString("against_x_axis")); standAloneAgainstAxis.addClickHandler(new ClickHandler() { @Override public void onClick(MenuItemClickEvent evt) { diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartToolbar.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartToolbar.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartToolbar.java Fri Jan 19 11:23:42 2018 +0100 @@ -82,8 +82,10 @@ addWSP.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent ce) { - new ManualWSPEditor(finalChartTab.getView().getCollection(), - finalChartTab, finalChartTab.getMode().getName()).show(); + new ManualWSPEditor( + finalChartTab.getView().getCollection(), + finalChartTab, + finalChartTab.getMode().getName()).show(); }}); } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/CrossSectionChartThemePanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/CrossSectionChartThemePanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/CrossSectionChartThemePanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -69,7 +69,8 @@ /** Service to query measurement points of cross sections. */ CrossSectionKMServiceAsync kmService = GWT.create( - org.dive4elements.river.client.client.services.CrossSectionKMService.class); + org.dive4elements.river.client.client.services + .CrossSectionKMService.class); /** UUID of the current "master" cross section. */ protected String currentCSMasterUUID; @@ -83,7 +84,8 @@ /** Data item name for CrossSections reference ('master') flag. */ protected static String CS_IS_MASTER = "cross_section.master?"; - /** List of cross-section themes through which is moved through synchronously. */ + /** List of cross-section themes through which is moved + * through synchronously. */ protected HashSet synchronCrossSectionThemes = new HashSet(); /** Data for master artifact combobox.*/ @@ -286,8 +288,8 @@ return Double.NaN; } Arrays.sort(in); - GWT.log ("Closest match for " + (up ? "next" : "previous") + " value to: " + - to + " candidates: " + Arrays.toString(in)); + GWT.log ("Closest match for " + (up ? "next" : "previous") + + " value to: " + to + " candidates: " + Arrays.toString(in)); if (up) { double max = in[in.length - 1]; for (int i = 0; i < in.length; i++) { @@ -333,7 +335,8 @@ new AsyncCallback>() { @Override public void onFailure(Throwable caught) { - GWT.log("Could not feed many artifacts " + caught.getMessage()); + GWT.log("Could not feed many artifacts " + + caught.getMessage()); SC.warn(MSG.getString(caught.getMessage())); enable(); } @@ -451,13 +454,15 @@ Double closest = CrossSectionChartThemePanel.closest(kms, enteredKm, up); if (Double.isNaN(closest)) { - GWT.log("Failed to find a closest km. Staying on current km."); + GWT.log("Failed to find a closest km. " + + "Staying on current km."); updateCollection(); enable(); return; } - GWT.log("Got single km close to " + enteredKm + " for " + dbid + ", it is " + GWT.log("Got single km close to " + + enteredKm + " for " + dbid + ", it is " + closest); // Do not set value, as it will trigger strange @@ -472,9 +477,11 @@ final Theme theme = themes.getThemeAt(i+1); if (theme.getFacet().equals("cross_section") && theme.getActive() == 1 && - synchronCrossSectionThemes.contains(themeHash(theme)) + synchronCrossSectionThemes.contains( + themeHash(theme)) ) { - artifacts.add(artifactReference(theme.getArtifact())); + artifacts.add( + artifactReference(theme.getArtifact())); } } sendFeed(artifacts, closest); @@ -515,8 +522,11 @@ // Place KMSpinner in Grid with currently chosen km value. if (fieldName.equals(GRID_FIELD_ACTIONS)) { double currentValue = - Double.valueOf(facetRecord.getTheme().getCollectionItem().getData().get(CS_KM)); - KMSpinner kmSpinner = new KMSpinner(currentValue, facetRecord); + Double.valueOf( + facetRecord.getTheme().getCollectionItem() + .getData().get(CS_KM)); + KMSpinner kmSpinner = new KMSpinner( + currentValue, facetRecord); kmSpinner.addChangeListener(parent); return kmSpinner; } @@ -634,7 +644,8 @@ MenuItem synchronNavigationMenuItem = new MenuItem(); final String themeHash = themeHash(facetTheme); if (synchronCrossSectionThemes.contains(themeHash)) { - synchronNavigationMenuItem.setTitle(MSG.chart_themepanel_asynchron()); + synchronNavigationMenuItem.setTitle( + MSG.chart_themepanel_asynchron()); synchronNavigationMenuItem.addClickHandler(new ClickHandler() { @Override public void onClick(MenuItemClickEvent evt) { @@ -643,7 +654,8 @@ }); } else { - synchronNavigationMenuItem.setTitle(MSG.chart_themepanel_synchron()); + synchronNavigationMenuItem.setTitle( + MSG.chart_themepanel_synchron()); synchronNavigationMenuItem.addClickHandler(new ClickHandler() { @Override public void onClick(MenuItemClickEvent evt) { diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ManualDatePointsEditor.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ManualDatePointsEditor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ManualDatePointsEditor.java Fri Jan 19 11:23:42 2018 +0100 @@ -90,11 +90,17 @@ CellFormatter doubleFormat = new CellFormatter() { @Override - public String format(Object value, ListGridRecord record, int rowNum, int colNum) { + public String format( + Object value, + ListGridRecord record, + int rowNum, + int colNum + ) { if(value != null) { NumberFormat nf = NumberFormat.getDecimalFormat(); try { - double d = Double.valueOf(value.toString()).doubleValue(); + double d = Double.valueOf( + value.toString()).doubleValue(); return nf.format(d); } catch (Exception e) { return value.toString(); @@ -106,7 +112,12 @@ CellFormatter dateFormat = new CellFormatter() { @Override - public String format(Object value, ListGridRecord record, int rowNum, int colNum) { + public String format( + Object value, + ListGridRecord record, + int rowNum, + int colNum + ) { if(value != null && !value.toString().equals("")) { try { DateTimeFormat df = @@ -132,7 +143,8 @@ CellEditValueParser cevp = new CellEditValueParser() { @Override - public Object parse(Object value, ListGridRecord record, int rowNum, int colNum) { + public Object parse( + Object value, ListGridRecord record, int rowNum, int colNum) { if (value == null) return null; try { @@ -148,11 +160,13 @@ CellEditValueFormatter cevf = new CellEditValueFormatter() { @Override - public Object format(Object value, ListGridRecord record, int rowNum, int colNum) { + public Object format( + Object value, ListGridRecord record, int rowNum, int colNum) { if (value != null) { NumberFormat nf = NumberFormat.getDecimalFormat(); try { - double d = Double.valueOf(value.toString()).doubleValue(); + double d = Double.valueOf( + value.toString()).doubleValue(); return nf.format(d); } catch (Exception e) { return value.toString(); @@ -222,7 +236,9 @@ @Override public void onRecordClick(final RecordClickEvent event) { // Just handle remove-clicks - if(!event.getField().getName().equals(removeField.getName())) { + if(!event.getField().getName() + .equals(removeField.getName()) + ) { return; } event.getViewer().removeData(event.getRecord()); @@ -235,7 +251,8 @@ // Add points to grid. if (item != null) { - String jsonData = item.getData().get(outputModeName + "." + POINT_DATA); + String jsonData = item.getData().get( + outputModeName + "." + POINT_DATA); JSONArray jsonArray = (JSONArray) JSONParser.parse(jsonData); for (int i = 0; i < jsonArray.size(); i++) { JSONArray point = (JSONArray) jsonArray.get(i); @@ -296,7 +313,8 @@ else { JSONArray data = new JSONArray(); - String nameString = record.getAttributeAsString(PointRecord.ATTRIBUTE_NAME); + String nameString = record.getAttributeAsString( + PointRecord.ATTRIBUTE_NAME); // Apply default name if none set. if (nameString == null || nameString.equals("")) { String xString = record.getAttributeAsString( @@ -306,7 +324,8 @@ nameString = xString + "/" + yString; } - String dateString = record.getAttributeAsString(PointRecord.ATTRIBUTE_X); + String dateString = record.getAttributeAsString( + PointRecord.ATTRIBUTE_X); DateTimeFormat df = DateTimeFormat.getFormat( DateTimeFormat.PredefinedFormat.DATE_MEDIUM); @@ -316,8 +335,9 @@ data.set(1, new JSONNumber(record. getAttributeAsDouble(PointRecord.ATTRIBUTE_Y))); data.set(2, new JSONString(nameString)); - data.set(3, JSONBoolean.getInstance(record.getAttributeAsBoolean( - PointRecord.ATTRIBUTE_ACTIVE))); + data.set(3, JSONBoolean.getInstance( + record.getAttributeAsBoolean( + PointRecord.ATTRIBUTE_ACTIVE))); list.set(idx, data); idx++; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ManualPointsEditor.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ManualPointsEditor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ManualPointsEditor.java Fri Jan 19 11:23:42 2018 +0100 @@ -86,7 +86,8 @@ /** Service handle to clone and add artifacts to collection. */ LoadArtifactServiceAsync loadArtifactService = GWT.create( - org.dive4elements.river.client.client.services.LoadArtifactService.class); + org.dive4elements.river.client.client.services + .LoadArtifactService.class); /** Service to feed the artifact with new point-data. */ FeedServiceAsync feedService = GWT.create( @@ -214,7 +215,8 @@ ListGridField xField = new ListGridField(PointRecord.ATTRIBUTE_X, xAxis); if(xAxis.equalsIgnoreCase("date") || xAxis.equalsIgnoreCase("Datum")) { - // FIXME: This is a hack for Timeseries charts with Date types on the x axis + // FIXME: This is a hack for Timeseries charts + // with Date types on the x axis xField.setType(ListGridFieldType.DATE); this.fieldTypeX = ListGridFieldType.DATE; } @@ -258,7 +260,9 @@ @Override public void onRecordClick(final RecordClickEvent event) { // Just handle remove-clicks - if(!event.getField().getName().equals(removeField.getName())) { + if(!event.getField().getName() + .equals(removeField.getName()) + ) { return; } event.getViewer().removeData(event.getRecord()); @@ -307,11 +311,13 @@ protected CellFormatter createCellFormatter() { return new CellFormatter() { @Override - public String format(Object value, ListGridRecord record, int rowNum, int colNum) { + public String format( + Object value, ListGridRecord record, int rowNum, int colNum) { if(value != null) { NumberFormat nf = NumberFormat.getDecimalFormat(); try { - double d = Double.valueOf(value.toString()).doubleValue(); + double d = Double.valueOf( + value.toString()).doubleValue(); return nf.format(d); } catch (Exception e) { return value.toString(); @@ -326,7 +332,8 @@ protected CellEditValueParser createCellEditValueParser() { return new CellEditValueParser() { @Override - public Object parse(Object value, ListGridRecord record, int rowNum, int colNum) { + public Object parse( + Object value, ListGridRecord record, int rowNum, int colNum) { if (value == null) return null; try { @@ -345,7 +352,8 @@ protected CellEditValueFormatter createCellEditValueFormatter() { return new CellEditValueFormatter() { @Override - public Object format(Object value, ListGridRecord record, int rowNum, int colNum) { + public Object format( + Object value, ListGridRecord record, int rowNum, int colNum) { if (value == null) { return ""; } @@ -403,7 +411,8 @@ else { JSONArray data = new JSONArray(); - String nameString = record.getAttributeAsString(PointRecord.ATTRIBUTE_NAME); + String nameString = record.getAttributeAsString( + PointRecord.ATTRIBUTE_NAME); // Apply default name if none set. if (nameString == null || nameString.equals("")) { String xString = record.getAttributeAsString( @@ -414,7 +423,8 @@ } if(fieldTypeX.equals(ListGridFieldType.DATE)) { - Date date = record.getAttributeAsDate(PointRecord.ATTRIBUTE_X); + Date date = record.getAttributeAsDate( + PointRecord.ATTRIBUTE_X); data.set(0, new JSONString(formatDate(date))); GWT.log("Date: " + formatDate(date)); } @@ -425,7 +435,8 @@ data.set(1, new JSONNumber(record. getAttributeAsDouble(PointRecord.ATTRIBUTE_Y))); data.set(2, new JSONString(nameString)); - data.set(3, JSONBoolean.getInstance(record.getAttributeAsBoolean( + data.set(3, JSONBoolean.getInstance( + record.getAttributeAsBoolean( PointRecord.ATTRIBUTE_ACTIVE))); list.set(idx, data); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ManualWSPEditor.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ManualWSPEditor.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ManualWSPEditor.java Fri Jan 19 11:23:42 2018 +0100 @@ -73,7 +73,8 @@ /** Service handle to clone and add artifacts to collection. */ LoadArtifactServiceAsync loadArtifactService = GWT.create( - org.dive4elements.river.client.client.services.LoadArtifactService.class); + org.dive4elements.river.client.client.services + .LoadArtifactService.class); /** Service to feed the artifact with new point-data. */ FeedServiceAsync feedService = GWT.create( diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/NaviChartOutputTab.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/NaviChartOutputTab.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/NaviChartOutputTab.java Fri Jan 19 11:23:42 2018 +0100 @@ -99,7 +99,8 @@ if (art instanceof FixAnalysisArtifact) { FixAnalysisArtifact fix = (FixAnalysisArtifact) art; FixFilter fixFilter = fix.getFilter(); - String s = fix.getArtifactDescription().getDataValueAsString("ld_step"); + String s = fix.getArtifactDescription().getDataValueAsString( + "ld_step"); try { double ds = Double.parseDouble(s); collectionView.setSteps(ds); @@ -113,7 +114,8 @@ else { // Probably WINFOArtifact kind of artifact. String ld_step = - art.getArtifactDescription().getDataValueAsString("ld_step"); + art.getArtifactDescription().getDataValueAsString( + "ld_step"); try { collectionView.setSteps(Double.valueOf(ld_step)); } @@ -312,7 +314,9 @@ } } else if (collectionView.getCurrentKm() == -1) { - collectionView.setCurrentKm(collectionView.getArtifact().getArtifactDescription().getKMRange()[0]); + collectionView.setCurrentKm( + collectionView.getArtifact().getArtifactDescription() + .getKMRange()[0]); } if (collectionView.getCurrentKm() != -1) { imgUrl += "¤tKm=" + collectionView.getCurrentKm(); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/OverviewOutputTab.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/OverviewOutputTab.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/OverviewOutputTab.java Fri Jan 19 11:23:42 2018 +0100 @@ -46,7 +46,8 @@ ) { } @Override - public void addOutputParameterChangeHandler(OutputParameterChangeHandler h) { } + public void addOutputParameterChangeHandler( + OutputParameterChangeHandler h) { } @Override public void addRedrawRequestHandler(RedrawRequestHandler h){ } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ZoomboxControl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ZoomboxControl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ZoomboxControl.java Fri Jan 19 11:23:42 2018 +0100 @@ -43,8 +43,8 @@ */ public class ZoomboxControl extends ImgButton -implements MouseDownHandler, MouseUpHandler, MouseMoveHandler, HasZoomHandlers, - MouseOutHandler +implements MouseDownHandler, MouseUpHandler, MouseMoveHandler, + HasZoomHandlers, MouseOutHandler { protected List handlers; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java Fri Jan 19 11:23:42 2018 +0100 @@ -27,7 +27,8 @@ import java.util.Map; public class FixFunctionSelect extends FixationPanel { - private static final Map funcDesc = new HashMap(); + private static final Map funcDesc = + new HashMap(); static { funcDesc.put("log", "W(Q) = m*ln(Q + b)"); @@ -65,7 +66,8 @@ SelectItem combobox = new SelectItem(d.getLabel()); combobox.setWidth(250); - LinkedHashMap funcTypes = new LinkedHashMap(); + LinkedHashMap funcTypes = + new LinkedHashMap(); boolean defaultSet = false; boolean first = true; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixLocationPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixLocationPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixLocationPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -136,9 +136,12 @@ DataItem fi = new DefaultDataItem("ld_from", "ld_from", f); DataItem ti = new DefaultDataItem("ld_to", "ld_to", t); DataItem si = new DefaultDataItem("ld_step", "ld_step", s); - data.add(new DefaultData("ld_from", null, null, new DataItem[]{ fi })); - data.add(new DefaultData("ld_to", null, null, new DataItem[]{ ti })); - data.add(new DefaultData("ld_step", null, null, new DataItem[]{ si })); + data.add(new DefaultData( + "ld_from", null, null, new DataItem[]{ fi })); + data.add(new DefaultData( + "ld_to", null, null, new DataItem[]{ ti })); + data.add(new DefaultData( + "ld_step", null, null, new DataItem[]{ si })); } // what else? return data.toArray(new Data[data.size()]); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixMultiPeriodPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixMultiPeriodPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixMultiPeriodPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -109,7 +109,9 @@ elements.addRecordClickHandler(new RecordClickHandler() { public void onRecordClick(final RecordClickEvent event) { // Just handle remove-clicks - if(!event.getField().getName().equals(removeField.getName())) { + if(!event.getField().getName() + .equals(removeField.getName()) + ) { return; } event.getViewer().removeData(event.getRecord()); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixPeriodPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixPeriodPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixPeriodPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -145,7 +145,8 @@ if(valid) { String start = Long.valueOf(this.start).toString(); String end = Long.valueOf(this.end).toString(); - DataItem startItem = new DefaultDataItem(startName, startName, start); + DataItem startItem = new DefaultDataItem( + startName, startName, start); DataItem endItem = new DefaultDataItem(endName, endName, end); data.add(new DefaultData( startName, @@ -183,7 +184,8 @@ DateTimeFormat df = DateTimeFormat.getFormat("dd.MM.yyyy"); if (!setFromAndToDate(list, df)) { - GWT.log("FixPeriodPanel::success(): could not set from and to dates!"); + GWT.log("FixPeriodPanel::success(): could not set " + + "from and to dates!"); } } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixationPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixationPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixationPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -63,7 +63,8 @@ { private static final long serialVersionUID = -3667553404493415619L; - protected static HashMap instances = new HashMap(); + protected static HashMap instances = + new HashMap(); /** The message class that provides i18n strings. */ protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); @@ -80,7 +81,8 @@ protected Img chartImg; protected TextItem kmText; - public static final DateTimeFormat DTF = DateTimeFormat.getFormat("dd.MM.yyyy"); + public static final DateTimeFormat DTF = DateTimeFormat.getFormat( + "dd.MM.yyyy"); public FixationPanel() { @@ -424,7 +426,10 @@ return ""; } - protected static JSONObject createFilter(FixFilter filter, JSONObject root) { + protected static JSONObject createFilter( + FixFilter filter, + JSONObject root + ) { double fromKm = filter.getFromKm(); double toKm = filter.getToKm(); boolean hasDate = filter.hasDate(); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/DrawControl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/DrawControl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/DrawControl.java Fri Jan 19 11:23:42 2018 +0100 @@ -38,9 +38,11 @@ import org.gwtopenmaps.openlayers.client.util.Attributes; /** - * Widget that handles the drawing of pipes and dikes in the DigitizePanel (MapPanel). + * Widget that handles the drawing of pipes and dikes + * in the DigitizePanel (MapPanel). */ -public class DrawControl extends HLayout implements VectorFeatureAddedListener { +public class DrawControl + extends HLayout implements VectorFeatureAddedListener { public static final String BARRIER_PIPE1 = "pipe1"; public static final String BARRIER_PIPE2 = "pipe2"; @@ -111,14 +113,16 @@ form.setTitlePrefix(""); form.setTitleSuffix(""); - final LinkedHashMap map = new LinkedHashMap(); + final LinkedHashMap map = + new LinkedHashMap(); map.put(BARRIER_PIPE1, MSG.getString(BARRIER_PIPE1)); map.put(BARRIER_PIPE2, MSG.getString(BARRIER_PIPE2)); map.put(BARRIER_DITCH, MSG.getString(BARRIER_DITCH)); map.put(BARRIER_DAM, MSG.getString(BARRIER_DAM)); map.put(BARRIER_RINGDIKE, MSG.getString(BARRIER_RINGDIKE)); - final LinkedHashMap ics = new LinkedHashMap(); + final LinkedHashMap ics = + new LinkedHashMap(); ics.put(BARRIER_PIPE1, BARRIER_PIPE1); ics.put(BARRIER_PIPE2, BARRIER_PIPE2); ics.put(BARRIER_DITCH, BARRIER_DITCH); @@ -221,7 +225,8 @@ map.addControl(control); control.activate(); - // Make sure the barrier layer is on top; sometime it looses it z-index... + // Make sure the barrier layer is on top; + // sometime it looses it z-index... layer.setZIndex(1000); } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/ExternalWMSWindow.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/ExternalWMSWindow.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/ExternalWMSWindow.java Fri Jan 19 11:23:42 2018 +0100 @@ -261,7 +261,8 @@ panel.setHeight(420); root.addMember(panel); - root.addMember(createButtonPanel(backHandler, goHandler, cancelHandler)); + root.addMember( + createButtonPanel(backHandler, goHandler, cancelHandler)); return root; } @@ -313,7 +314,8 @@ tree.setHeight(420); root.addMember(tree); - root.addMember(createButtonPanel(backHandler, goHandler, cancelHandler)); + root.addMember( + createButtonPanel(backHandler, goHandler, cancelHandler)); return root; } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/GetFeatureInfo.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/GetFeatureInfo.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/GetFeatureInfo.java Fri Jan 19 11:23:42 2018 +0100 @@ -69,7 +69,10 @@ } - protected void newGetFeatureInfoWindow(List features, String title) { + protected void newGetFeatureInfoWindow( + List features, + String title + ) { if (gfiWindow != null) { gfiWindow.destroy(); } @@ -117,12 +120,15 @@ public void onSuccess(FeatureInfoResponse response) { List features = response.getFeatures(); if (features != null && !features.isEmpty()) { - newGetFeatureInfoWindow(features, at.getAttr("description")); + newGetFeatureInfoWindow( + features, at.getAttr("description")); } else if (response.getFeatureInfoHTML() != null) { - newGetFeatureInfoWindow(response.getFeatureInfoHTML(), + newGetFeatureInfoWindow( + response.getFeatureInfoHTML(), at.getAttr("description")); } else { - GWT.log("GetFeatureInfo returned neither a list of features nor a string"); + GWT.log("GetFeatureInfo returned neither " + + "a list of features nor a string"); } } } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/GetFeatureInfoWindow.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/GetFeatureInfoWindow.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/GetFeatureInfoWindow.java Fri Jan 19 11:23:42 2018 +0100 @@ -110,7 +110,8 @@ List fields = new ArrayList(); DetailViewerRecord dr = new DetailViewerRecord(); - DetailViewerField path_field = null; // Make sure path is always the last element + DetailViewerField path_field = null; + // Make sure path is always the last element for (Map.Entry entry: entries) { String localized; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/LegendWindow.java Fri Jan 19 11:23:42 2018 +0100 @@ -63,8 +63,8 @@ } if (theme instanceof AttributedTheme) { - legendContainer - .addMember(createLegendGraphicsRow((AttributedTheme) theme)); + legendContainer.addMember( + createLegendGraphicsRow((AttributedTheme) theme)); } } } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapOutputTab.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapOutputTab.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapOutputTab.java Fri Jan 19 11:23:42 2018 +0100 @@ -73,7 +73,8 @@ public class MapOutputTab extends OutputTab -implements RedrawRequestHandler, ExternalWMSWindow.LayerLoader, TabSelectedHandler, OutputParameterChangeHandler { +implements RedrawRequestHandler, ExternalWMSWindow.LayerLoader, + TabSelectedHandler, OutputParameterChangeHandler { public static final String DEFAULT_SRID = "4326"; @@ -104,7 +105,8 @@ protected VLayout rootLayout = new VLayout(); protected AbsolutePanel absPan = new AbsolutePanel(); protected FloodMap floodMap; - protected java.util.Map wmsUrls = new HashMap(); + protected java.util.Map wmsUrls = + new HashMap(); public MapOutputTab( @@ -192,7 +194,8 @@ return; } - // Manually set the height of the AbsolutePanel, somehow this is necessary + // Manually set the height of the AbsolutePanel, + // somehow this is necessary absPan.setHeight(String.valueOf( rootLayout.getHeight() - controlPanel.getHeight() - 2) + "px"); @@ -200,7 +203,9 @@ int height = rootLayout.getHeight() - controlPanel.getHeight() - 6; int width = controlPanel.getWidth() - - (themePanelCanvas.isVisible() ? themePanelCanvas.getWidth() + 4 : 2); + (themePanelCanvas.isVisible() + ? themePanelCanvas.getWidth() + 4 + : 2); // Set size and position of Map String w = String.valueOf(width) + "px"; @@ -210,14 +215,17 @@ mapPanel.setSize(w, h); mapPanel.getMap().updateSize(); if(themePanelCanvas.isVisible()) { - absPan.setWidgetPosition(mapPanel, themePanelCanvas.getWidth() + 2, 0); + absPan.setWidgetPosition( + mapPanel, themePanelCanvas.getWidth() + 2, 0); } else { absPan.setWidgetPosition(mapPanel, 0, 0); } // Set bounds of ThemePanelCanvas - themePanelCanvas.setSize(themePanelCanvas.getWidthAsString(), String.valueOf(height + 2) + "px"); + themePanelCanvas.setSize( + themePanelCanvas.getWidthAsString(), + String.valueOf(height + 2) + "px"); } @@ -251,7 +259,7 @@ ArtifactDescription desc = artifact.getArtifactDescription(); String geojson = getGeoJSONFromStatic(desc); - geojson = geojson != null ? geojson : getGeoJSONFromDynamic(desc); + geojson = geojson != null ? geojson : getGeoJSONFromDynamic(desc); if (geojson == null || geojson.length() == 0) { GWT.log("No geojson string found -> no barriers existing."); @@ -273,7 +281,7 @@ map.addLayer(layer); if (layer instanceof WMS) { wmsUrls.put(layer.getName(), - ((WMS)layer).getFullRequestString(new WMSParams(), null)); + ((WMS)layer).getFullRequestString(new WMSParams(), null)); } } } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -70,7 +70,8 @@ return; } - floodMapWidget.setSize(Integer.toString(width), Integer.toString(height)); + floodMapWidget.setSize( + Integer.toString(width), Integer.toString(height)); floodMapWidget.getMap().updateSize(); } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapPrintPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapPrintPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapPrintPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -51,7 +51,8 @@ private static final String MAPFISH_RANGE = "mapfish_data_range"; private static final String MAPFISH_SUBTITLE = "mapfish_data_subtitle"; private static final String MAPFISH_STRETCH = "mapfish_data_strech"; - private static final String MAPFISH_INSTITUTION = "mapfish_data_institution"; + private static final String MAPFISH_INSTITUTION = + "mapfish_data_institution"; private static final String MAPFISH_SOURCE = "mapfish_data_source"; private static final String MAPFISH_CREATOR = "mapfish_data_creator"; private static final String MAPFISH_DATEPLACE = "mapfish_data_dateplace"; @@ -80,7 +81,11 @@ protected MapToolbar mapToolbar; protected MapPrintWindow parent; - public MapPrintPanel(Collection collection, MapToolbar mapToolbar, MapPrintWindow parent) { + public MapPrintPanel( + Collection collection, + MapToolbar mapToolbar, + MapPrintWindow parent + ) { this.collection = collection; this.mapToolbar = mapToolbar; this.parent = parent; @@ -317,16 +322,24 @@ GWT.log("MapPrintPanel.updateCollection via RPC now"); List properties = new ArrayList(); - properties.add(new PropertySetting(MAPFISH_MAPTITLE, pageTitle.getValueAsString())); -// properties.add(new PropertySetting(MAPFISH_LAYOUT, pageFormat.getValueAsString())); - properties.add(new PropertySetting(MAPFISH_SUBTITLE, pageSubtitle.getValueAsString())); - properties.add(new PropertySetting(MAPFISH_RANGE, pageRange.getValueAsString())); - properties.add(new PropertySetting(MAPFISH_STRETCH, pageStretch.getValueAsString())); - properties.add(new PropertySetting(MAPFISH_INSTITUTION, pageInstitution.getValueAsString())); - properties.add(new PropertySetting(MAPFISH_SOURCE, pageSource.getValueAsString())); - properties.add(new PropertySetting(MAPFISH_CREATOR, pageCreator.getValueAsString())); - properties.add(new PropertySetting(MAPFISH_DATEPLACE, pageDatePlace.getValueAsString())); - properties.add(new PropertySetting(MAPFISH_LOGO, pageLogo.getValueAsString())); + properties.add(new PropertySetting( + MAPFISH_MAPTITLE, pageTitle.getValueAsString())); + properties.add(new PropertySetting( + MAPFISH_SUBTITLE, pageSubtitle.getValueAsString())); + properties.add(new PropertySetting( + MAPFISH_RANGE, pageRange.getValueAsString())); + properties.add(new PropertySetting( + MAPFISH_STRETCH, pageStretch.getValueAsString())); + properties.add(new PropertySetting( + MAPFISH_INSTITUTION, pageInstitution.getValueAsString())); + properties.add(new PropertySetting( + MAPFISH_SOURCE, pageSource.getValueAsString())); + properties.add(new PropertySetting( + MAPFISH_CREATOR, pageCreator.getValueAsString())); + properties.add(new PropertySetting( + MAPFISH_DATEPLACE, pageDatePlace.getValueAsString())); + properties.add(new PropertySetting( + MAPFISH_LOGO, pageLogo.getValueAsString())); settings.setSettings("default", properties); collection.addSettings("print-settings", settings); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapThemePanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapThemePanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapThemePanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -198,7 +198,8 @@ item.addClickHandler(new ClickHandler() { @Override public void onClick(MenuItemClickEvent evt) { - String url = getMapOutputTab().wmsUrls().get(at.getAttr("layers")); + String url = getMapOutputTab().wmsUrls().get( + at.getAttr("layers")); SC.say(MSG.wmsURLBoxTitle(), url); } }); @@ -225,7 +226,8 @@ theme.setActive(0); AttributedTheme at = (AttributedTheme) theme; - getMapOutputTab().removeLayer(at.getAttr("layers")); + getMapOutputTab().removeLayer( + at.getAttr("layers")); } updateCollection(); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapToolbar.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapToolbar.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapToolbar.java Fri Jan 19 11:23:42 2018 +0100 @@ -644,7 +644,8 @@ protected ImgButton createMapPrintControl() { final MapToolbar mtb = this; - ImgButton btn = createButton(MSG.printMapSettings(), new ClickHandler() { + ImgButton btn = createButton( + MSG.printMapSettings(), new ClickHandler() { @Override public void onClick(ClickEvent event) { MapPrintWindow mpsw = diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedloadCampaignChart.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedloadCampaignChart.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedloadCampaignChart.java Fri Jan 19 11:23:42 2018 +0100 @@ -26,7 +26,10 @@ protected Img chartImg; - public BedloadCampaignChart(Artifact artifact, ResizedHandler resizeHandler) { + public BedloadCampaignChart( + Artifact artifact, + ResizedHandler resizeHandler + ) { super(); this.artifact = artifact; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/SedLoadDistancePanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/SedLoadDistancePanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/SedLoadDistancePanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -90,7 +90,8 @@ public Canvas create(DataList data) { picker = new LocationPicker(this); distancePanel = new DoubleRangeOnlyPanel( - MSG.dpUnitFrom() + " - ", MSG.dpUnitTo(), 0d, 0d, 250, this, "right"); + MSG.dpUnitFrom() + " - ", + MSG.dpUnitTo(), 0d, 0d, 250, this, "right"); VLayout layout = new VLayout(); layout.setMembersMargin(10); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/SedLoadEpochPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/SedLoadEpochPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/SedLoadEpochPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -129,7 +129,9 @@ @Override public void onRecordClick(final RecordClickEvent event) { // Just handle remove-clicks - if(!event.getField().getName().equals(removeField.getName())) { + if(!event.getField().getName() + .equals(removeField.getName()) + ) { return; } event.getViewer().removeData(event.getRecord()); @@ -297,7 +299,8 @@ GWT.log("Failed to find sq time interval id in data."); } - sedLoadInfoService.getSedimentLoadInfo(locale, river, "single", km[0], km[1], sq_ti_id, + sedLoadInfoService.getSedimentLoadInfo( + locale, river, "single", km[0], km[1], sq_ti_id, new AsyncCallback() { public void onFailure(Throwable caught) { GWT.log("Could not recieve sediment load informations."); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/SedLoadPeriodPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/SedLoadPeriodPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/SedLoadPeriodPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -128,7 +128,8 @@ descr.setWidth("*"); String baseUrl = GWT.getHostPageBaseURL(); - ListGridField pinFrom = new ListGridField ("fromIcon", MESSAGES.selection()); + ListGridField pinFrom = new ListGridField( + "fromIcon", MESSAGES.selection()); pinFrom.setWidth (60); pinFrom.setType (ListGridFieldType.ICON); pinFrom.setCellIcon(baseUrl + MESSAGES.markerGreen()); @@ -169,7 +170,8 @@ if (yearsItem != null && !yearsItem.getValueAsString().isEmpty()) { List data = new ArrayList(); - DataItem yearsdata = new DefaultDataItem("years", "years", yearsItem.getValueAsString().trim()); + DataItem yearsdata = new DefaultDataItem( + "years", "years", yearsItem.getValueAsString().trim()); data.add(new DefaultData( "years", null, @@ -252,7 +254,8 @@ GWT.log("Failed to find sq time interval id in data."); } - sedLoadInfoService.getSedimentLoadInfo(locale, river, "single", km[0], km[1], sq_ti_id, + sedLoadInfoService.getSedimentLoadInfo( + locale, river, "single", km[0], km[1], sq_ti_id, new AsyncCallback() { public void onFailure(Throwable caught) { GWT.log("Could not recieve sediment load informations."); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/SedLoadSQTiPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/SedLoadSQTiPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/SedLoadSQTiPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -84,7 +84,9 @@ layout.addMember(vLayout); layout.addMember(back); - GWT.log("Old data: " + strItems[0].getDescription() + " label " + strItems[0].getLabel() + " value: " + strItems[0].getStringValue()); + GWT.log("Old data: " + strItems[0].getDescription() + + " label " + strItems[0].getLabel() + + " value: " + strItems[0].getStringValue()); return layout; } @@ -146,7 +148,8 @@ GWT.log("Got attribute sq_ti_id : " + d + " desc: " + desc); } DataItem item = new DefaultDataItem("sq_ti_id", "this is ignored", d); - DataItem dateLabel = new DefaultDataItem("sq_ti_date", "this is ignored", desc); + DataItem dateLabel = new DefaultDataItem( + "sq_ti_date", "this is ignored", desc); data.add(new DefaultData( "sq_ti_id", null, @@ -171,7 +174,8 @@ double[] km = artifact.getArtifactDescription().getKMRange(); String river = artifact.getArtifactDescription().getRiver(); - sedLoadInfoService.getSedimentLoadInfo(locale, river, "sq_time_intervals", km[0], km[1], "", + sedLoadInfoService.getSedimentLoadInfo( + locale, river, "sq_time_intervals", km[0], km[1], "", new AsyncCallback() { public void onFailure(Throwable caught) { GWT.log("Could not receive sediment load informations."); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/range/DischargeInfoDataSource.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/range/DischargeInfoDataSource.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/range/DischargeInfoDataSource.java Fri Jan 19 11:23:42 2018 +0100 @@ -17,7 +17,8 @@ public class DischargeInfoDataSource extends DataSource { - public static final String XPATH_DISCHARGE_DEFAULT = "/discharges/discharge"; + public static final String XPATH_DISCHARGE_DEFAULT = + "/discharges/discharge"; public DischargeInfoDataSource(String url, long gauge, String river) { diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.java Fri Jan 19 11:23:42 2018 +0100 @@ -73,7 +73,8 @@ ListGridField efield = new ListGridField("kmend", "Ende [km]", 60); ListGridField stfield = new ListGridField("station", "Station [km]"); ListGridField lfield = new ListGridField("infolink", "Info"); - ListGridField cfield = new ListGridField("curvelink", MSG.gauge_curve_link()); + ListGridField cfield = new ListGridField( + "curvelink", MSG.gauge_curve_link()); cfield.addRecordClickHandler(this); this.setShowRecordComponents(true); @@ -135,7 +136,8 @@ for (int j = dl.size()-1; j >= 0; --j) { Data d = dl.get(j); String label = d.getLabel(); - GWT.log("GaugeListGrid - setData - label " + label + " " + d.getStringValue()); + GWT.log("GaugeListGrid - setData - label " + + label + " " + d.getStringValue()); if (label.equals("ld_from")) { ldfrom = getDoubleValue(d); } @@ -161,7 +163,8 @@ for (int j = dl.size()-1; j >= 0; --j) { Data d = dl.get(j); String label = d.getLabel(); - GWT.log("GaugeListGrid - setData - label " + label + " " + d.getStringValue()); + GWT.log("GaugeListGrid - setData - label " + + label + " " + d.getStringValue()); if (label.equals("ld_from")) { ldfrom = getDoubleValue(d); } @@ -180,13 +183,19 @@ openOnLocations(locations); return; } - else if (state.equals("state.winfo.reference.curve.input.start")) { + else if (state + .equals("state.winfo.reference.curve.input.start") + ) { getLocations("reference_startpoint", locations, dl); } - else if (state.equals("state.winfo.reference.curve.input.end")) { + else if (state + .equals("state.winfo.reference.curve.input.end") + ) { getLocations("reference_endpoint", locations, dl); } - else if (state.equals("state.winfo.historicalq.reference_gauge")) { + else if (state + .equals("state.winfo.historicalq.reference_gauge") + ) { for (int j = dl.size()-1; j >= 0; --j) { Data d = dl.get(j); String label = d.getLabel(); @@ -275,9 +284,11 @@ } } else if (item.getKmStart() != null && item.getKmEnd() != null) { - // as getStart()/getEnd() return Double objects, they can be null and + // as getStart()/getEnd() return Double objects, + // they can be null and // can cause NPEs when comparing with double... strange... - GWT.log("GaugeListGrid - openOnDistance item " + item.getKmStart() + " " + item.getKmEnd()); + GWT.log("GaugeListGrid - openOnDistance item " + + item.getKmStart() + " " + item.getKmEnd()); if ((start >= item.getKmStart() && start <= item.getKmEnd()) || (end >= item.getKmStart() && end <= item.getKmEnd()) || (start <= item.getKmStart() && end >= item.getKmEnd())) { @@ -455,7 +466,8 @@ int colNum) { if (colNum == ABFLUSSTAFEL_COLUMN) { // display the ablfusstafel cell like a link - return "text-decoration: underline; color: #0000EE; cursor: pointer;"; + return "text-decoration: underline; color: #0000EE; " + + "cursor: pointer;"; } else { return super.getCellCSSText(record, rowNum, colNum); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/InfoPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/InfoPanel.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/InfoPanel.java Fri Jan 19 11:23:42 2018 +0100 @@ -34,7 +34,8 @@ /** The message class that provides i18n strings.*/ protected FLYSConstants MSG = GWT.create(FLYSConstants.class); - protected RiverInfoServiceAsync riverInfoService = GWT.create(RiverInfoService.class); + protected RiverInfoServiceAsync riverInfoService = GWT.create( + RiverInfoService.class); /** Panel to show the info about the river */ protected RiverInfoPanel riverinfopanel; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationListGrid.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationListGrid.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationListGrid.java Fri Jan 19 11:23:42 2018 +0100 @@ -60,11 +60,13 @@ public MeasurementStationListGrid(FLYS flys) { super(flys); ListGridField nfield = new ListGridField("name", "Messtelle"); - ListGridField mfield = new ListGridField("measurementtype", "Messstellenart"); + ListGridField mfield = new ListGridField( + "measurementtype", "Messstellenart"); ListGridField sfield = new ListGridField("kmstart", "Start [km]", 60); ListGridField efield = new ListGridField("kmend", "Ende [km]", 60); ListGridField lfield = new ListGridField("infolink", "Info"); - ListGridField cfield = new ListGridField("curvelink", "Feststofftransport-Abfluss-Beziehung"); + ListGridField cfield = new ListGridField( + "curvelink", "Feststofftransport-Abfluss-Beziehung"); cfield.addRecordClickHandler(this); this.setShowRecordComponents(true); @@ -225,7 +227,8 @@ public String getCellCSSText(ListGridRecord record, int rowNum, int colNum) { if (colNum == 6) { - return "text-decoration: underline; color: #0000EE; cursor: pointer;"; + return "text-decoration: underline; color: #0000EE; " + + "cursor: pointer;"; } else { return super.getCellCSSText(record, rowNum, colNum); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/ClickableWTable.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/ClickableWTable.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/ClickableWTable.java Fri Jan 19 11:23:42 2018 +0100 @@ -68,7 +68,9 @@ setEmptyMessage(MESSAGE.empty_table()); ListGridField name = new ListGridField("name", - useWaterlevelLabel ? MESSAGE.wq_waterlevel_label() : MESSAGE.name() ); + useWaterlevelLabel + ? MESSAGE.wq_waterlevel_label() + : MESSAGE.name() ); name.setType(ListGridFieldType.TEXT); name.setWidth("*"); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/QDTable.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/QDTable.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/QDTable.java Fri Jan 19 11:23:42 2018 +0100 @@ -73,9 +73,11 @@ type.setType(ListGridFieldType.TEXT); type.setWidth("10%"); - ListGridField startTime = WTable.createYearListGridField("starttime", MESSAGE.starttime()); + ListGridField startTime = WTable.createYearListGridField( + "starttime", MESSAGE.starttime()); - ListGridField stopTime = WTable.createYearListGridField("stoptime", MESSAGE.stoptime()); + ListGridField stopTime = WTable.createYearListGridField( + "stoptime", MESSAGE.stoptime()); final NumberFormat nf = NumberFormat.getDecimalFormat(); @@ -99,11 +101,13 @@ }); value.setWidth("15%"); - ListGridField official = new ListGridField("official", MESSAGE.official_regulation()); + ListGridField official = new ListGridField( + "official", MESSAGE.official_regulation()); official.setType(ListGridFieldType.TEXT); official.setWidth("25%"); - setFields(addMax, addMin, select, name, startTime, stopTime, type, value, official); + setFields(addMax, addMin, select, name, + startTime, stopTime, type, value, official); } public void hideIconFields () { diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/WTable.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/WTable.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/WTable.java Fri Jan 19 11:23:42 2018 +0100 @@ -54,9 +54,11 @@ type.setType(ListGridFieldType.TEXT); type.setWidth("50"); - ListGridField startTime = createYearListGridField("starttime", MESSAGE.starttime()); + ListGridField startTime = createYearListGridField( + "starttime", MESSAGE.starttime()); - ListGridField stopTime = createYearListGridField("stoptime", MESSAGE.stoptime()); + ListGridField stopTime = createYearListGridField( + "stoptime", MESSAGE.stoptime()); final NumberFormat nf = NumberFormat.getDecimalFormat(); @@ -94,18 +96,23 @@ public static ListGridField createYearListGridField( final String propertyName, String displayName) { - ListGridField listGridField = new ListGridField(propertyName, displayName); + ListGridField listGridField = new ListGridField( + propertyName, displayName); listGridField.setType(ListGridFieldType.DATE); listGridField.setWidth("50"); listGridField.setCellFormatter(createYearDateFormatter(propertyName)); return listGridField; } - /** Create CellFormatter that prints just the year of a date stored in attributeName. */ - private static CellFormatter createYearDateFormatter(final String attributeName) { + /** Create CellFormatter that prints just the year of a date + * stored in attributeName. */ + private static CellFormatter createYearDateFormatter( + final String attributeName + ) { return new CellFormatter() { @Override - public String format(Object arg0, ListGridRecord record, int arg2, int arg3) { + public String format( + Object arg0, ListGridRecord record, int arg2, int arg3) { Date date = record.getAttributeAsDate(attributeName); if (date == null) { return ""; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/widgets/KMSpinner.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/widgets/KMSpinner.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/widgets/KMSpinner.java Fri Jan 19 11:23:42 2018 +0100 @@ -36,7 +36,8 @@ * SpinnerItem-like element with text label and up/down buttons. */ public class KMSpinner extends HLayout { - protected List listeners = new ArrayList(); + protected List listeners = + new ArrayList(); protected Label label; protected FacetRecord facetRecord; @@ -55,7 +56,8 @@ minusButton.setWidth(18); minusButton.setHeight(22); minusButton.setValign(VerticalAlignment.CENTER); - minusButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { + minusButton.addClickHandler( + new com.smartgwt.client.widgets.events.ClickHandler() { public void onClick(ClickEvent evt) { fireChangedEvent(value - 0.1d, false); } @@ -69,15 +71,18 @@ kmField.setHeight(20); FormItemValueFormatter doubleFormat = new FormItemValueFormatter() { - public String formatValue(Object value, Record record, DynamicForm form, FormItem item) { + public String formatValue( + Object value, Record record, DynamicForm form, FormItem item) { if (value != null) { NumberFormat nf = NumberFormat.getDecimalFormat(); try { - double d = Double.valueOf(value.toString()).doubleValue(); + double d = Double.valueOf( + value.toString()).doubleValue(); return nf.format(d); } catch (Exception e) { - GWT.log("EditorValueFormatter exception: " + e.toString()); + GWT.log("EditorValueFormatter exception: " + + e.toString()); // Remove junk chars from input string return doublefyString(value.toString()); @@ -91,7 +96,8 @@ kmField.setEditorValueFormatter(doubleFormat); FormItemValueParser doubleParser = new FormItemValueParser() { - public Object parseValue(String value, DynamicForm form, FormItem item) { + public Object parseValue( + String value, DynamicForm form, FormItem item) { if (value == null) return null; try { @@ -112,7 +118,8 @@ public void onBlur(BlurEvent be) { if (kmField.getValue() != null) { try { - fireChangedEvent(Double.parseDouble(kmField.getValue().toString()), true); + fireChangedEvent(Double.parseDouble( + kmField.getValue().toString()), true); } catch(NumberFormatException nfe) { GWT.log("entered string cannot be parsed to double."); @@ -129,7 +136,8 @@ } }); - // TODO: i18n Now add all the validators, formatters, editors/parsers etc. + // TODO: i18n Now add all the validators, formatters, + // editors/parsers etc. form.setFields(kmField); form.setTitle(""); form.setTitlePrefix(""); @@ -142,7 +150,8 @@ plusButton.setWidth(18); plusButton.setHeight(22); plusButton.setValign(VerticalAlignment.CENTER); - plusButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { + plusButton.addClickHandler( + new com.smartgwt.client.widgets.events.ClickHandler() { public void onClick(ClickEvent evt) { fireChangedEvent(value + 0.1d, true); } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/client/widgets/KMSpinnerChangeListener.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/widgets/KMSpinnerChangeListener.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/widgets/KMSpinnerChangeListener.java Fri Jan 19 11:23:42 2018 +0100 @@ -11,5 +11,10 @@ import org.dive4elements.river.client.shared.model.FacetRecord; public interface KMSpinnerChangeListener { - public void spinnerValueEntered(KMSpinner spinner, double km, FacetRecord facetRecord, boolean up); + public void spinnerValueEntered( + KMSpinner spinner, + double km, + FacetRecord facetRecord, + boolean up + ); } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/AdvanceServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/AdvanceServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/AdvanceServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -43,7 +43,8 @@ public static final String OPERATION_FAILURE = "FAILED"; - public static final String ERROR_ADVANCE_ARTIFACT = "error_advance_artifact"; + public static final String ERROR_ADVANCE_ARTIFACT = + "error_advance_artifact"; public Artifact advance( diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactDescriptionFactory.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactDescriptionFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactDescriptionFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -125,7 +125,10 @@ * entered by the user in the current state or null, if no data might be * entered. */ - protected static DataList extractCurrentData(Node dynamicNode, String state) { + protected static DataList extractCurrentData( + Node dynamicNode, + String state + ) { log.debug("ArtifactDescriptionFactory.extractCurrentData"); NodeList data = ClientProtocolUtils.getSelectNode(dynamicNode); @@ -212,7 +215,9 @@ else if (type.equals("intarray")) { list.add(new IntegerArrayData(name, label, null)); } - else if (type.equals("intoptions") && uiProvider.equals("parameter-matrix")) { + else if (type.equals("intoptions") + && uiProvider.equals("parameter-matrix") + ) { list.add(DataFactory.createIntegerOptionsData(d, name, label)); } else if (type.equals("options")) { @@ -586,7 +591,8 @@ if (factory != null && factory.length() > 0) { log.debug("Adding Recommendation. Factory: " + factory + " IDs: " + index + " target out " + targetOut); - rec[i] = new Recommendation(factory, index, null, null, targetOut); + rec[i] = new Recommendation( + factory, index, null, null, targetOut); } } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactHelper.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactHelper.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactHelper.java Fri Jan 19 11:23:42 2018 +0100 @@ -46,7 +46,8 @@ public static final String ERROR_CREATE_ARTIFACT = "error_create_artifact"; /** Name of the factory to generate a GaugeDischargeCurveArtifact. */ - private static final String GAUGE_DISCHARGE_CURVE_ARTIFACT = "gaugedischargecurve"; + private static final String GAUGE_DISCHARGE_CURVE_ARTIFACT = + "gaugedischargecurve"; /** Name of the factory to generate a MainvaluesArtifact. */ private static final String MAINVALUE_ARTIFACT_FACTORY = "mainvalue"; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/AuthenticationServlet.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/AuthenticationServlet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/AuthenticationServlet.java Fri Jan 19 11:23:42 2018 +0100 @@ -49,7 +49,8 @@ protected void redirectSuccess(HttpServletResponse resp, String path, String uri) throws IOException { if (uri == null) { - String redirecturl = getServletContext().getInitParameter("redirect-url"); + String redirecturl = getServletContext().getInitParameter( + "redirect-url"); if (redirecturl == null) { redirecturl = FLYS_PAGE; } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/BaseServletContextListener.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/BaseServletContextListener.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/BaseServletContextListener.java Fri Jan 19 11:23:42 2018 +0100 @@ -27,7 +27,8 @@ public static final String LOG4J_PROPERTIES = "FLYS_CLIENT_LOG4J_PROPERIES"; - public static final Logger log = Logger.getLogger(BaseServletContextListener.class); + public static final Logger log = Logger.getLogger( + BaseServletContextListener.class); @Override public void contextInitialized(ServletContextEvent sce) { @@ -39,7 +40,8 @@ log.debug("Initializing ServletContext"); try { - XMLFileFeatures features = new XMLFileFeatures(sc.getRealPath(filename)); + XMLFileFeatures features = new XMLFileFeatures( + sc.getRealPath(filename)); sc.setAttribute(Features.CONTEXT_ATTRIBUTE, features); } catch(IOException e) { log.error(e); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/CapabilitiesParser.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/CapabilitiesParser.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/CapabilitiesParser.java Fri Jan 19 11:23:42 2018 +0100 @@ -112,7 +112,8 @@ public static void main(String[] args) { log.info("Do static Capabilities request/parsing."); - String log4jProperties = System.getenv(BaseServletContextListener.LOG4J_PROPERTIES); + String log4jProperties = System.getenv( + BaseServletContextListener.LOG4J_PROPERTIES); LoggingConfigurator.init(log4jProperties); try { @@ -222,7 +223,8 @@ // Parse MIME types of supported return types, e.g. image/jpeg NodeList mapFormatNodes = (NodeList) - XMLUtils.xpath(capabilities, XPATH_MAP_FORMAT, XPathConstants.NODESET); + XMLUtils.xpath( + capabilities, XPATH_MAP_FORMAT, XPathConstants.NODESET); List mapFormats = new ArrayList(); for (int n = 0; n < mapFormatNodes.getLength(); n++) { mapFormats.add(mapFormatNodes.item(n).getTextContent()); @@ -337,7 +339,10 @@ } - protected static WMSLayer parseLayer(Node layerNode, String onlineResource) { + protected static WMSLayer parseLayer( + Node layerNode, + String onlineResource + ) { String title = (String) XMLUtils.xpath( layerNode, "Title/text()", @@ -351,8 +356,11 @@ log.debug("Found layer: " + title + "(" + name + ")"); boolean queryable = true; - Node queryableAttr = layerNode.getAttributes().getNamedItem("queryable"); - if (queryableAttr != null && queryableAttr.getNodeValue().equals("0")) { + Node queryableAttr = layerNode.getAttributes() + .getNamedItem("queryable"); + if (queryableAttr != null + && queryableAttr.getNodeValue().equals("0") + ) { queryable = false; } @@ -365,7 +373,8 @@ List layers = parseLayers(layersNodes, onlineResource); - return new WMSLayer(onlineResource, title, name, srs, layers, queryable); + return new WMSLayer( + onlineResource, title, name, srs, layers, queryable); } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/ChartOutputServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/ChartOutputServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/ChartOutputServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -60,7 +60,8 @@ Document request = ClientProtocolUtils.newOutCollectionDocument( uuid, type, type, - ChartServiceHelper.getChartAttributes(prepareChartAttributes(req))); + ChartServiceHelper.getChartAttributes( + prepareChartAttributes(req))); HttpClient client = new HttpClientImpl(url, locale); @@ -78,7 +79,9 @@ } - protected Map prepareChartAttributes(HttpServletRequest req) { + protected Map prepareChartAttributes( + HttpServletRequest req + ) { Map attr = new HashMap(); Map params = req.getParameterMap(); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/CollectionHelper.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/CollectionHelper.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/CollectionHelper.java Fri Jan 19 11:23:42 2018 +0100 @@ -79,7 +79,8 @@ public static final String XPATH_FACETS = "art:facets/art:facet"; public static final String XPATH_LOADED_RECOMMENDATIONS = - "/art:artifact-collection/art:attribute/art:loaded-recommendations/art:recommendation"; + "/art:artifact-collection/art:attribute/" + + "art:loaded-recommendations/art:recommendation"; public static Document createAttribute(Collection collection) { @@ -243,7 +244,8 @@ cr.addAttr(t, "pos", Integer.toString(theme.getPosition()), true); cr.addAttr(t, "index", Integer.toString(theme.getIndex()), true); cr.addAttr(t, "description", theme.getDescription(), true); - cr.addAttr(t, "visible", Integer.toString(theme.getVisible()), true); + cr.addAttr(t, "visible", Integer.toString(theme.getVisible()), + true); } return t; @@ -479,7 +481,8 @@ } } - Map themeLists = parseThemeLists(description, collectionItems); + Map themeLists = parseThemeLists( + description, collectionItems); c.setThemeLists(themeLists); Map outSettings = parseSettings(description); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/CrossSectionKMServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/CrossSectionKMServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/CrossSectionKMServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -94,8 +94,10 @@ // Document should contain: // crosse-sections: // attribute(id), attribute(km) attribute(n) - Document response = client.callService(url, "cross-section-km", doc); - //... + Document response = client.callService( + url, "cross-section-km", doc); + // + //... NodeList nodeList = (NodeList) XMLUtils.xpath(response, XPATH_CROSS_SECTIONS, diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/DataFactory.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/DataFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/DataFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -123,7 +123,9 @@ } - private static Map> extractMeta(Element element) { + private static Map> extractMeta( + Element element + ) { NodeList nl = element.getElementsByTagName("meta"); int N = nl.getLength(); if (N < 1) { @@ -192,7 +194,11 @@ * * @return an instance of DefaultData. */ - protected static Data createDefaultData(Element ele, String name, String label) { + protected static Data createDefaultData( + Element ele, + String name, + String label + ) { log.debug("Create new DefaultData"); return new DefaultData(name, label, "default", extractDataItems(ele)); } @@ -207,7 +213,11 @@ * * @return an instance of StringData. */ - protected static Data createStringData(Element ele, String name, String label) { + protected static Data createStringData( + Element ele, + String name, + String label + ) { return new StringData(name, label, extractDataItems(ele)); } @@ -221,7 +231,11 @@ * * @return an instance of IntegerData. */ - protected static Data createIntegerData(Element ele, String name, String label) { + protected static Data createIntegerData( + Element ele, + String name, + String label + ) { return new IntegerData(name, label, extractDataItems(ele)); } @@ -235,7 +249,11 @@ * * @return an instance of StringOptionsData. */ - protected static Data createStringOptionsData(Element ele, String name, String label) { + protected static Data createStringOptionsData( + Element ele, + String name, + String label + ) { return new StringOptionsData(name, label, extractDataItems(ele)); } @@ -249,7 +267,11 @@ * * @return an instance of IntegerOptionsData. */ - protected static Data createIntegerOptionsData(Element ele, String name, String label) { + protected static Data createIntegerOptionsData( + Element ele, + String name, + String label + ) { return new IntegerOptionsData(name, label, extractDataItems(ele)); } @@ -263,7 +285,11 @@ * * @return an instance of IntegerRangeData. */ - protected static Data createIntegerRangeData(Element ele, String name, String label) { + protected static Data createIntegerRangeData( + Element ele, + String name, + String label + ) { DataItem[] items = extractDataItems(ele); String rawValue = items[0].getStringValue(); @@ -286,7 +312,11 @@ * * @return an instance of IntegerArrayData. */ - protected static Data createIntegerArrayData(Element ele, String name, String label) { + protected static Data createIntegerArrayData( + Element ele, + String name, + String label + ) { IntDataItem[] items = extractIntDataItems(ele); return new IntegerArrayData(name, label, items); } @@ -301,7 +331,11 @@ * * @return an instance of DoubleArrayData. */ - protected static Data createDoubleArrayData(Element ele, String name, String label) { + protected static Data createDoubleArrayData( + Element ele, + String name, + String label + ) { DataItem[] items = extractDataItems(ele); String rawValue = items[0].getStringValue(); @@ -412,7 +446,11 @@ * * @return an instance of IntegerRangeData. */ - protected static Data createLongRangeData(Element ele, String name, String label) { + protected static Data createLongRangeData( + Element ele, + String name, + String label + ) { DataItem[] items = extractDataItems(ele); String rawValue = items[0].getStringValue(); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/ExportServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/ExportServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/ExportServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -83,7 +83,8 @@ client.collectionOut(request, uuid, mode), "UTF-8"); try { - OutputStreamWriter encOut = new OutputStreamWriter(out, enc); + OutputStreamWriter encOut = new OutputStreamWriter( + out, enc); char buf [] = new char[4096]; int c; while ((c = in.read(buf, 0, buf.length)) >= 0) { diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/FileUploadServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/FileUploadServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/FileUploadServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -34,7 +34,8 @@ public class FileUploadServiceImpl extends HttpServlet { - private static final Logger log = Logger.getLogger(FileUploadServiceImpl.class); + private static final Logger log = Logger.getLogger( + FileUploadServiceImpl.class); @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) { @@ -55,7 +56,9 @@ resp.setContentType("text/html"); PrintWriter respWriter = resp.getWriter(); - respWriter.write("

"); + respWriter.write( + "
"); if (result == null) { log.warn("FileUpload service returned no result."); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/GFIServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/GFIServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/GFIServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -243,7 +243,8 @@ log.debug(" node name: '" + nodeName + "'"); if (nodeName.equals("gml:name")) { - log.debug("NAME node has child: " + tmp.getFirstChild().getNodeValue()); + log.debug("NAME node has child: " + + tmp.getFirstChild().getNodeValue()); f.setLayername(tmp.getFirstChild().getNodeValue()); } else if (nodeName.endsWith("_feature")) { diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/GGInATrustStrategy.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/GGInATrustStrategy.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/GGInATrustStrategy.java Fri Jan 19 11:23:42 2018 +0100 @@ -20,7 +20,10 @@ */ @Override - public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException { + public boolean isTrusted( + X509Certificate[] chain, + String authType + ) throws CertificateException { // FIXME validate Certificate return true; } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/LoginServlet.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/LoginServlet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/LoginServlet.java Fri Jan 19 11:23:42 2018 +0100 @@ -58,11 +58,16 @@ } } - private Authentication auth(String username, String password, String encoding) + private Authentication auth( + String username, + String password, + String encoding + ) throws AuthenticationException, IOException { ServletContext sc = this.getServletContext(); - Features features = (Features)sc.getAttribute(Features.CONTEXT_ATTRIBUTE); + Features features = (Features)sc.getAttribute( + Features.CONTEXT_ATTRIBUTE); String auth = sc.getInitParameter("authentication"); return AuthenticationFactory.getInstance(auth).auth(username, password, encoding, features, sc); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/MapInfoServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/MapInfoServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/MapInfoServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -96,7 +96,10 @@ } - public static Document getRequestDocument(String rivername, String maptypeStr) { + public static Document getRequestDocument( + String rivername, + String maptypeStr + ) { log.debug("MapInfoServiceImpl.getRequestDocument"); Document request = XMLUtils.newDocument(); @@ -125,10 +128,14 @@ String bboxS = XMLUtils.xpathString(result, XPATH_BBOX, null); BBox bbox = BBox.getBBoxFromString(bboxS); - String riverWMS = XMLUtils.xpathString(result, XPATH_RIVER_WMS, null); - String riverLayers = XMLUtils.xpathString(result, XPATH_RIVER_LAYERS, null); - String wmsURL = XMLUtils.xpathString(result, XPATH_WMS_URL, null); - String wmsLayers = XMLUtils.xpathString(result, XPATH_WMS_LAYERS, null); + String riverWMS = XMLUtils.xpathString( + result, XPATH_RIVER_WMS, null); + String riverLayers = XMLUtils.xpathString( + result, XPATH_RIVER_LAYERS, null); + String wmsURL = XMLUtils.xpathString( + result, XPATH_WMS_URL, null); + String wmsLayers = XMLUtils.xpathString( + result, XPATH_WMS_LAYERS, null); int srid = 4326; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/MapOutputServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/MapOutputServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/MapOutputServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -44,7 +44,8 @@ public static final String ERROR_NO_MAP_CONFIG = "error_no_map_config"; - public static final String ERROR_NO_MAP_OUTPUT_TYPE = "error_no_map_output_type"; + public static final String ERROR_NO_MAP_OUTPUT_TYPE = + "error_no_map_output_type"; public MapConfig doOut(Collection collection) throws ServerException @@ -71,7 +72,7 @@ uuid, requestMode, requestMode); HttpClient client = new HttpClientImpl(url); - InputStream is = client.collectionOut(request, uuid, requestMode); + InputStream is = client.collectionOut(request, uuid, requestMode); Document response = XMLUtils.parseDocument(is); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/MapPrintServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/MapPrintServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/MapPrintServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -116,8 +116,9 @@ layer.put("layers", subLayers); // XXX: osm.intevation.de mapache only offers low dpi maps // so we need to use the uncached service - layer.put("baseURL", url.replace("http://osm.intevation.de/mapcache/?", - "http://osm.intevation.de/cgi-bin/germany.fcgi?")); + layer.put("baseURL", url.replace( + "http://osm.intevation.de/mapcache/?", + "http://osm.intevation.de/cgi-bin/germany.fcgi?")); layer.put("format", "image/png"); // TODO: Make configurable. return layer; @@ -212,7 +213,8 @@ Map legend = new LinkedHashMap(); List classes = new ArrayList(1); Map clazz = new LinkedHashMap(); - String lgu = MapUtils.getLegendGraphicUrl(layer.url, encode(layer.layers), dpi); + String lgu = MapUtils.getLegendGraphicUrl( + layer.url, encode(layer.layers), dpi); clazz.put("icon", lgu); clazz.put("name", layer.description); classes.add(clazz); @@ -259,7 +261,8 @@ maxY = Double.parseDouble(maxYS); } catch (NumberFormatException nfe) { - throw new ServletException("Misspelled minX, minY, maxX or maxY"); + throw new ServletException( + "Misspelled minX, minY, maxX or maxY"); } } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/MapUrlServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/MapUrlServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/MapUrlServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -42,7 +42,8 @@ log.info("MapUrlServiceImpl.getUrls"); Map urls = new HashMap(); - InputStream in = getServletContext().getResourceAsStream("/WEB-INF/wms-services.xml"); + InputStream in = getServletContext().getResourceAsStream( + "/WEB-INF/wms-services.xml"); Document doc = XMLUtils.parseDocument(in); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/MetaDataServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/MetaDataServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/MetaDataServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -61,7 +61,8 @@ * @param artifactId ID of masterartifact (can be null) * @param userId can be null * @param outs can be null - * @param parameters can be null or parameters like "load-system:true;key:value" + * @param parameters can be null or parameters like + * "load-system:true;key:value" */ @Override public DataCageTree getMetaData( @@ -117,7 +118,8 @@ try { Converter converter = new Converter(); - DataCageTree tree = converter.convert(client.callService(url, "metadata", doc)); + DataCageTree tree = converter.convert( + client.callService(url, "metadata", doc)); tree.prune(this); return tree; } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/ModuleServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/ModuleServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/ModuleServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -97,7 +97,8 @@ } log.debug("Found module " + name + " " + localname); if (user == null || user.canUseFeature("module:" + name)) { - modules.add(new DefaultModule(name, localname, selected, riverUuids)); + modules.add(new DefaultModule( + name, localname, selected, riverUuids)); } } return modules.toArray(new Module[modules.size()]); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/RemoveArtifactServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/RemoveArtifactServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/RemoveArtifactServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -36,7 +36,8 @@ String url = getServletContext().getInitParameter("server-url"); - return CollectionHelper.removeArtifact(collection, artifactId, url, locale); + return CollectionHelper.removeArtifact( + collection, artifactId, url, locale); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/RiverInfoServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/RiverInfoServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/RiverInfoServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -59,7 +59,8 @@ private static final String XPATH_STATIONS = "/art:river-info/art:measurement-stations/art:measurement-station"; - private static final String XPATH_GAUGES = "/art:river-info/art:gauges/art:gauge"; + private static final String XPATH_GAUGES = + "/art:river-info/art:gauges/art:gauge"; public static final DateFormat DATE_FORMAT = DateFormat.getDateInstance( DateFormat.SHORT, Locale.GERMANY); @@ -105,7 +106,8 @@ throw new ServerException(ERROR_NO_RIVER_INFO_FOUND); } - public RiverInfo getMeasurementStations(String river) throws ServerException { + public RiverInfo getMeasurementStations(String river) + throws ServerException { log.info("RiverInfoServiceImpl.getMeasurementStations"); String url = getServletContext().getInitParameter("server-url"); @@ -125,7 +127,8 @@ HttpClient client = new HttpClientImpl(url); try { - Document result = client.callService(url, "measurementstationinfo", doc); + Document result = client.callService( + url, "measurementstationinfo", doc); DefaultRiverInfo riverinfo = getRiverInfo(result); List mstations = createMeasurementStations( @@ -211,7 +214,8 @@ int num = stationnodes == null ? 0 : stationnodes.getLength(); - ArrayList mstations = new ArrayList(num); + ArrayList mstations = + new ArrayList(num); if (num == 0) { log.warn("No measurement station found."); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/SamlServlet.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/SamlServlet.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/SamlServlet.java Fri Jan 19 11:23:42 2018 +0100 @@ -87,7 +87,8 @@ throw new AuthenticationException("Login failed."); } - Features features = (Features)sc.getAttribute(Features.CONTEXT_ATTRIBUTE); + Features features = (Features)sc.getAttribute( + Features.CONTEXT_ATTRIBUTE); return new org.dive4elements.river.client.server.auth.saml.User( assertion, samlTicketXML, features.getFeatures(assertion.getRoles()), null); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/SedimentLoadInfoServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/SedimentLoadInfoServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/SedimentLoadInfoServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -160,7 +160,8 @@ String sq_ti_id = node.getAttribute("sq_ti_id").trim(); if (desc.length() > 0 && date.length() > 0) { - return new SedimentLoadInfoObjectImpl(desc, date, sq_ti_date, sq_ti_id); + return new SedimentLoadInfoObjectImpl( + desc, date, sq_ti_date, sq_ti_id); } log.warn("Invalid sediment load info object found."); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/ServerInfoServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/ServerInfoServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/ServerInfoServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.client.server; import java.util.HashMap; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/WQInfoServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/WQInfoServiceImpl.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/WQInfoServiceImpl.java Fri Jan 19 11:23:42 2018 +0100 @@ -51,7 +51,8 @@ public static final String ERROR_NO_WQINFO_FOUND = "error_no_wqinfo_found"; - public static final String XPATH_WQS = "art:service/art:mainvalues/art:mainvalue"; + public static final String XPATH_WQS = + "art:service/art:mainvalues/art:mainvalue"; public WQInfoObject[] getWQInfo( diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/auth/AuthenticationFactory.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/AuthenticationFactory.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/AuthenticationFactory.java Fri Jan 19 11:23:42 2018 +0100 @@ -19,19 +19,22 @@ throws IllegalArgumentException { if (name == null) { - throw new IllegalArgumentException("Authentication type name is null"); + throw new IllegalArgumentException( + "Authentication type name is null"); } if (name.equalsIgnoreCase("was") || name.equalsIgnoreCase("ggina")) { log.debug("Using GGinA authenticator."); return - new org.dive4elements.river.client.server.auth.was.Authenticator(); + new org.dive4elements.river.client.server.auth.was + .Authenticator(); } else if (name.equalsIgnoreCase("plain")) { log.debug("Using plain authenticator."); return - new org.dive4elements.river.client.server.auth.plain.Authenticator(); + new org.dive4elements.river.client.server.auth.plain + .Authenticator(); } throw new IllegalArgumentException("Unkown Authentication " + name); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/auth/plain/Authenticator.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/plain/Authenticator.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/plain/Authenticator.java Fri Jan 19 11:23:42 2018 +0100 @@ -36,7 +36,7 @@ Logger.getLogger(Authenticator.class); public static class Authentication - implements org.dive4elements.river.client.server.auth.Authentication + implements org.dive4elements.river.client.server.auth.Authentication { protected String user; protected String password; @@ -63,7 +63,9 @@ @Override public User getUser() { return isSuccess() - ? new DefaultUser(user, password, null, false, roles, this.features.getFeatures(roles)) + ? new DefaultUser( + user, password, null, false, roles, + this.features.getFeatures(roles)) : null; } } // class Authentication @@ -98,7 +100,8 @@ File file = credentialsFile(); if (!file.canRead() || !file.isFile()) { log.error("cannot find user file '" + file + "'"); - return new Authentication(null, null, new ArrayList(0), features); + return new Authentication( + null, null, new ArrayList(0), features); } BufferedReader reader = @@ -128,7 +131,8 @@ } log.debug("success"); - return new Authentication(username, password, roles, features); + return new Authentication( + username, password, roles, features); } // Stop: user found, wrong password break; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/auth/was/Response.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/was/Response.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/was/Response.java Fri Jan 19 11:23:42 2018 +0100 @@ -92,7 +92,7 @@ public String getStatus() { return XPathUtils.xpathString(this.root, - "./samlp:Status/samlp:StatusCode/@Value"); + "./samlp:Status/samlp:StatusCode/@Value"); } @@ -115,7 +115,8 @@ public User getUser() throws AuthenticationException { Assertion assertion = this.getAssertion(); if (assertion == null) { - throw new AuthenticationException("Response doesn't contain an assertion"); + throw new AuthenticationException( + "Response doesn't contain an assertion"); } List features = this.features.getFeatures( this.assertion.getRoles()); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/features/Features.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/features/Features.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/features/Features.java Fri Jan 19 11:23:42 2018 +0100 @@ -12,7 +12,8 @@ public interface Features { - public static final String CONTEXT_ATTRIBUTE = "org.dive4elements.river.client.server.features"; + public static final String CONTEXT_ATTRIBUTE = + "org.dive4elements.river.client.server.features"; /** * Returns all allowed features to a list of roles diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/filter/GGInAFilter.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/filter/GGInAFilter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/filter/GGInAFilter.java Fri Jan 19 11:23:42 2018 +0100 @@ -91,7 +91,11 @@ * @param chain the filter chain */ @Override - public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) + public void doFilter( + ServletRequest req, + ServletResponse resp, + FilterChain chain + ) throws IOException, ServletException { if (this.deactivate) { @@ -104,7 +108,9 @@ String requesturi = sreq.getRequestURI(); if (log.isDebugEnabled()) { - for (Enumeration e = req.getAttributeNames() ; e.hasMoreElements() ;) { + for (Enumeration e = req.getAttributeNames(); + e.hasMoreElements(); + ) { log.debug(e.nextElement()); } } @@ -130,10 +136,13 @@ log.debug("Request for login " + requesturi); if (loginDisabled && requesturi.equals(path + LOGIN_JSP)) { log.debug("Login disabled. Redirecting."); - if (noAuthRedir.equals(LOGIN_JSP) || noAuthRedir.equals(path + LOGIN_JSP)) { - handleResponse(resp, false); /* Dont redirect to the same page */ + if (noAuthRedir.equals(LOGIN_JSP) + || noAuthRedir.equals(path + LOGIN_JSP) + ) { + handleResponse(resp, false); + /* Dont redirect to the same page */ } else { - handleResponse(resp, true); + handleResponse(resp, true); } return; } @@ -193,18 +202,21 @@ ((HttpServletResponse) resp).sendRedirect(noAuthRedir); } else { log.debug("Redirect to: " + noAuthRedir); - ((HttpServletResponse) resp).sendRedirect(this.sc.getContextPath() + - noAuthRedir); - + ((HttpServletResponse) resp).sendRedirect( + this.sc.getContextPath() + noAuthRedir); } } private void sendNotAuthenticated(ServletResponse resp) throws IOException { log.debug("Send not authenticated"); - ((HttpServletResponse)resp).sendError(HttpServletResponse.SC_FORBIDDEN, "User not authenticated"); + ((HttpServletResponse)resp).sendError( + HttpServletResponse.SC_FORBIDDEN, "User not authenticated"); } - private void handleResponse(ServletResponse resp, boolean redirect) throws IOException { + private void handleResponse( + ServletResponse resp, + boolean redirect + ) throws IOException { if (redirect) { this.redirect(resp); } @@ -223,7 +235,8 @@ private Authentication auth(User user, String encoding) throws AuthenticationException, IOException { - Features features = (Features)sc.getAttribute(Features.CONTEXT_ATTRIBUTE); + Features features = (Features)sc.getAttribute( + Features.CONTEXT_ATTRIBUTE); return AuthenticationFactory.getInstance(this.authmethod).auth( user.getName(), user.getPassword(), encoding, features, sc); } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/filter/NoCacheFilter.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/filter/NoCacheFilter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/filter/NoCacheFilter.java Fri Jan 19 11:23:42 2018 +0100 @@ -48,7 +48,11 @@ * @param chain the filter chain */ @Override - public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) + public void doFilter( + ServletRequest req, + ServletResponse resp, + FilterChain chain + ) throws IOException, ServletException { HttpServletRequest httpreq = (HttpServletRequest)req; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/server/meta/Converter.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/meta/Converter.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/meta/Converter.java Fri Jan 19 11:23:42 2018 +0100 @@ -70,7 +70,8 @@ } } // I18NConverter - private static Map converters = new HashMap(); + private static Map converters = + new HashMap(); public static final NodeConverter NAME_CONVERTER = new NameConverter(); public static final NodeConverter I18N_CONVERTER = new I18NConverter(); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/shared/MapUtils.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/MapUtils.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/MapUtils.java Fri Jan 19 11:23:42 2018 +0100 @@ -25,7 +25,11 @@ return getLegendGraphicUrl(server, layer, -1); } - public static String getLegendGraphicUrl(String server, String layer, int dpi) { + public static String getLegendGraphicUrl( + String server, + String layer, + int dpi + ) { if (server == null || layer == null) { return null; } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultCollection.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultCollection.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultCollection.java Fri Jan 19 11:23:42 2018 +0100 @@ -191,7 +191,8 @@ /** * Get item whose identifier is the given string. * @param uuid identifier of collection item (artifacts uuid). - * @return CollectionItem whose identifier is given String, null if not found. + * @return CollectionItem whose identifier is given String, + * null if not found. */ public CollectionItem getItem(String uuid) { int size = getItemLength(); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DoubleRangeData.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DoubleRangeData.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DoubleRangeData.java Fri Jan 19 11:23:42 2018 +0100 @@ -28,7 +28,12 @@ } - public DoubleRangeData(String label, String desc, double lower, double upper) { + public DoubleRangeData( + String label, + String desc, + double lower, + double upper + ) { this(label, desc, lower, upper, null, null); } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/shared/model/FeatureInfoResponse.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/FeatureInfoResponse.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/FeatureInfoResponse.java Fri Jan 19 11:23:42 2018 +0100 @@ -27,7 +27,10 @@ public FeatureInfoResponse() { } - public FeatureInfoResponse(List features, String featureInfoHTML) { + public FeatureInfoResponse( + List features, + String featureInfoHTML + ) { this.featureInfoHTML = featureInfoHTML; this.features = features; } diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/shared/model/MultiAttributeData.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/MultiAttributeData.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/MultiAttributeData.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.client.shared.model; import java.util.Map; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/shared/model/MultiDataItem.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/MultiDataItem.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/MultiDataItem.java Fri Jan 19 11:23:42 2018 +0100 @@ -1,3 +1,11 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + package org.dive4elements.river.client.shared.model; import java.util.Map; diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ThemeList.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ThemeList.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ThemeList.java Fri Jan 19 11:23:42 2018 +0100 @@ -149,9 +149,12 @@ * @param facetName name to match against facets whose info to put in map. * @return mapping of index to description */ - public LinkedHashMap toMapIndexDescription(String facetName) { + public LinkedHashMap toMapIndexDescription( + String facetName + ) { int count = getThemeCount(); - LinkedHashMap valueMap = new LinkedHashMap(); + LinkedHashMap valueMap = + new LinkedHashMap(); for (int i = 0; i <= count; i++) { Theme theme = getThemeAt(i + 1); @@ -172,7 +175,8 @@ toMapArtifactUUIDDescription(String facetName ) { int count = getThemeCount(); - LinkedHashMap valueMap = new LinkedHashMap(); + LinkedHashMap valueMap = + new LinkedHashMap(); for (int i = 0; i <= count; i++) { Theme theme = getThemeAt(i + 1); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ToLoad.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ToLoad.java Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ToLoad.java Fri Jan 19 11:23:42 2018 +0100 @@ -40,7 +40,9 @@ return false; } StringTriple other = (StringTriple) o; - return second.equals(other.second) && first.equals(other.first) && third.equals(other.third); + return second.equals(other.second) + && first.equals(other.first) + && third.equals(other.third); } } public static final String SYNTHETIC_KEY = "key-"; @@ -89,7 +91,8 @@ artifactName = uniqueKey(artifacts); } - Map artifact = artifacts.get(artifactName); + Map artifact = artifacts.get( + artifactName); if (artifact == null) { artifact = new HashMap(); @@ -99,7 +102,8 @@ ArtifactFilter filter = artifact.get(factory); if (filter == null) { filter = new ArtifactFilter(factory); - artifact.put(new StringTriple(factory, displayName, targetOut), filter); + artifact.put(new StringTriple( + factory, displayName, targetOut), filter); } filter.add(out, name, ids); diff -r 7bbfb24e6eec -r 28df64078f27 gwt-client/src/main/webapp/WEB-INF/log4j.properties --- a/gwt-client/src/main/webapp/WEB-INF/log4j.properties Thu Jan 18 18:34:41 2018 +0100 +++ b/gwt-client/src/main/webapp/WEB-INF/log4j.properties Fri Jan 19 11:23:42 2018 +0100 @@ -1,18 +1,15 @@ log4j.rootLogger=DEBUG, FLYS ########## INTERNAL PACKAGES -log4j.category.de.intevation.flys.client.server=DEBUG - +log4j.category.org.dive4elements.river.client.server=DEBUG ########## EXTERNAL PACKAGES log4j.category.org.apache.http=ERROR -log4j.category.de.intevation.artifacts.httpclient=WARN +log4j.category.org.dive4elements.artifacts.httpclient=WARN ########## APPENDER SETTINGS log4j.appender.FLYS.layout=org.apache.log4j.PatternLayout log4j.appender.FLYS.layout.ConversionPattern=%d [%t] %-5p %c - %m%n -log4j.appender.FLYS=org.apache.log4j.RollingFileAppender -log4j.appender.FLYS.File=/var/log/d4e-river/d4e-client.log -log4j.appender.FLYS.MaxFileSize=5000KB -log4j.appender.FLYS.MaxBackupIndex=3 +log4j.appender.FLYS=org.apache.log4j.ConsoleAppender +log4j.appender.FLYS.Target = System.out diff -r 7bbfb24e6eec -r 28df64078f27 java.header --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java.header Fri Jan 19 11:23:42 2018 +0100 @@ -0,0 +1,7 @@ +^/\* Copyright \(C\) .* by Bundesanstalt für Gewässerkunde$ +^ \* Software engineering by .*$ +^ \*$ +^ \* This file is Free Software under the GNU AGPL \(>=v3\)$ +^ \* and comes with ABSOLUTELY NO WARRANTY! Check out the$ +^ \* documentation coming with Dive4Elements River for details.$ +^ \*/$