# HG changeset patch # User Felix Wolfsteller # Date 1318844500 0 # Node ID 1627a28c4504ba11634ef3351bdd9bc99ccb6901 # Parent ab2b1a4a9eadb353d19690b56fd018195b69164b Cosmetics, docs. flys-client/trunk@2978 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r ab2b1a4a9ead -r 1627a28c4504 flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java Mon Oct 17 09:37:27 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageTwinPanel.java Mon Oct 17 09:41:40 2011 +0000 @@ -152,6 +152,11 @@ } + /** + * Creates the graphical representation and interaction widgets for the data. + * @param dataList the data. + * @return graphical representation and interaction widgets for data. + */ @Override public Canvas create(DataList dataList) { GWT.log("createData()"); @@ -254,11 +259,15 @@ } + /** + * Add record to list of removed records. + */ public void trackRemoved(Record r) { RecommendationPairRecord pr = (RecommendationPairRecord) r; this.removedPairs.add(pr); } + /** * Validates data, does nothing if invalid, otherwise clones new selected * waterlevels and add them to collection, forward the artifact. @@ -278,11 +287,19 @@ List ar = new ArrayList(); List all = new ArrayList(); + List statics = new ArrayList(); for (ListGridRecord record : records) { RecommendationPairRecord r = (RecommendationPairRecord) record; // Do not add "old" recommendations. if (!r.isAlreadyLoaded()) { + // Check whether one of those is a dike or similar. + // TODO differentiate and merge: new clones, new, old. + if(r.getFirst().getIDs() != null + && r.getFirst().getIDs().startsWith("flood_protection")) + { + // These do not get cloned but loaded ("spawned"). + } ar.add(r.getFirst()); ar.add(r.getSecond()); } @@ -361,7 +378,16 @@ /** - * Create Data and DataItem from selection. + * Create Data and DataItem from selection (a long string with identifiers + * to construct diff-pairs). + * + * @param newRecommendations "new" recommendations (did not survive a + * backjump). + * @param newArtifacts artifacts cloned from newRecommendations. + * @param oldRecommendations old recommendations that survived a backjump. + * + * @return dataitem with a long string with identifiers to construct + * diff-pairs. */ protected Data[] getData( Recommendation[] newRecommendations, diff -r ab2b1a4a9ead -r 1627a28c4504 flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java Mon Oct 17 09:37:27 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java Mon Oct 17 09:41:40 2011 +0000 @@ -297,6 +297,7 @@ } + /** Notify DatacageDoubleClickHandlers that a doubleclick happened. */ protected void fireOnDoubleClick() { for (DatacageDoubleClickHandler handler: doubleHandlers) { handler.onDoubleClick(toLoad); diff -r ab2b1a4a9ead -r 1627a28c4504 flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java Mon Oct 17 09:37:27 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java Mon Oct 17 09:41:40 2011 +0000 @@ -17,12 +17,12 @@ public class DoubleArrayPanel extends DynamicForm { - /** The message class that provides i18n strings.*/ + /** The message class that provides i18n strings. */ protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); protected TextItem ti; - /** The constant input field name.*/ + /** The constant input field name. */ public static final String FIELD_NAME = "doublearray"; diff -r ab2b1a4a9ead -r 1627a28c4504 flys-client/src/main/java/de/intevation/flys/client/client/ui/RecommendationPairRecord.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/RecommendationPairRecord.java Mon Oct 17 09:37:27 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/RecommendationPairRecord.java Mon Oct 17 09:41:40 2011 +0000 @@ -35,7 +35,8 @@ boolean alreadyLoaded; - public RecommendationPairRecord() { + /** Trivial, blocked constructor. */ + private RecommendationPairRecord() { } @@ -61,6 +62,8 @@ /** * Sets the first recommendation with info (minuend). + * @param first Recommendation to store. + * @param name human-readable name to identify recommendation */ public void setFirst(Recommendation first, String name) { this.first = first; @@ -71,6 +74,8 @@ /** * Sets the second recommendation with info (subtrahend). + * @param second Recommendation to store. + * @param name human-readable name to identify recommendation. */ public void setSecond(Recommendation second, String name) { this.second = second; diff -r ab2b1a4a9ead -r 1627a28c4504 flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java Mon Oct 17 09:37:27 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java Mon Oct 17 09:41:40 2011 +0000 @@ -45,25 +45,26 @@ /** The interface that provides i18n messages. */ protected FLYSConstants MSG = GWT.create(FLYSConstants.class); - /** The collection */ + /** The collection. */ protected Collection collection; - /** The parent collection view */ + /** The parent collection view. */ protected CollectionView view; - /** The attributes */ + /** The attributes. */ protected CollectionItemAttribute attributes; /** The selected facet. */ protected FacetRecord facet; - /** Main layout */ + /** Main layout. */ protected VLayout layout; /** The service used to set collection item attributes. */ protected CollectionItemAttributeServiceAsync itemAttributeService = GWT.create(CollectionItemAttributeService.class); + public StyleEditorWindow ( Collection collection, CollectionItemAttribute attributes, @@ -207,7 +208,8 @@ return df; } - protected String rgbToHtml(String rgb) { + + protected static String rgbToHtml(String rgb) { String[] parts = rgb.split(","); int values[] = new int[parts.length]; for (int i = 0; i < parts.length; i++) { @@ -229,7 +231,8 @@ return hex; } - protected String htmlToRgb(String html) { + + protected static String htmlToRgb(String html) { if (!html.startsWith("#")) { return "0, 0, 0"; } @@ -241,6 +244,7 @@ return r + ", " + g + ", " + b; } + protected void saveStyle () { GWT.log("StyleEditorWindow.saveStyle()"); Config config = Config.getInstance(); @@ -266,6 +270,7 @@ this.hide(); } + protected final void setNewValue(String name, String value) { Theme t = facet.getTheme(); Style s = attributes.getStyle(t.getFacet(), t.getIndex());