[Dive4elements-commits] [PATCH 4 of 8] Add configurable logo for map print and rename/reorder fields
Wald Commits
scm-commit at wald.intevation.org
Mon Apr 15 18:41:58 CEST 2013
# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1366043022 -7200
# Node ID 22e03ca8c39d1480e25e8f575ce1089d97a3e13e
# Parent df330602b1a232294a31616496e831e748ffe5dd
Add configurable logo for map print and rename/reorder fields
diff -r df330602b1a2 -r 22e03ca8c39d flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Mon Apr 15 15:28:06 2013 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Mon Apr 15 18:23:42 2013 +0200
@@ -1218,7 +1218,7 @@
String mapfish_data_strech();
- String mapfish_data_created();
+ String mapfish_data_institution();
String mapfish_data_source();
@@ -1228,6 +1228,23 @@
String mapfish_data_river();
+ String mapTitle();
+
+ String mapSubtitle();
+
+ String mapRange();
+
+ String mapStretch();
+
+ String mapCreator();
+
+ String mapInstitution();
+
+ String mapSource();
+
+ String mapDate();
+
+ String mapLogo();
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r df330602b1a2 -r 22e03ca8c39d flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Mon Apr 15 15:28:06 2013 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Mon Apr 15 18:23:42 2013 +0200
@@ -640,8 +640,19 @@
mapfish_data_range = mapfish_data_3Range
mapfish_data_subtitle = mapfish_data_0Subtitle
mapfish_data_strech = mapfish_data_2Stretch
-mapfish_data_created = mapfish_data_4Created
-mapfish_data_source = mapfish_data_5Source
-mapfish_data_creator = mapfish_data_6Creator
+mapfish_data_institution = mapfish_data_5Institution
+mapfish_data_source = mapfish_data_6Source
+mapfish_data_creator = mapfish_data_5Creator
mapfish_data_dateplace = mapfish_data_7Place, Date
mapfish_data_river = mapfish_data_1River
+
+mapTitle = Title
+mapSubtitle = Subtitle
+mapRange = Range
+mapStretch = Stretch
+mapCreator = Creator
+mapInstitution = Institution
+mapSource = Source
+mapDate = Place, Date
+mapLogo = Logo
+
diff -r df330602b1a2 -r 22e03ca8c39d flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Mon Apr 15 15:28:06 2013 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Mon Apr 15 18:23:42 2013 +0200
@@ -639,8 +639,18 @@
mapfish_data_range = mapfish_data_3Bereich
mapfish_data_subtitle = mapfish_data_0Untertitel
mapfish_data_strech = mapfish_data_2Strecke
-mapfish_data_created = mapfish_data_4Aufgestellt
-mapfish_data_source = mapfish_data_5Datenquelle
-mapfish_data_creator = mapfish_data_6Ersteller
+mapfish_data_institution = mapfish_data_5Institution
+mapfish_data_source = mapfish_data_6Datenquelle
+mapfish_data_creator = mapfish_data_4Bearbeiter
mapfish_data_dateplace = mapfish_data_7Ort, Datum
mapfish_data_river = mapfish_data_1Gewässer
+
+mapTitle = Titel
+mapSubtitle = Untertitel
+mapRange = Bereich
+mapStretch = Strecke
+mapCreator = Bearbeiter
+mapInstitution = Institution
+mapSource = Datenquelle
+mapDate = Ort, Datum
+mapLogo = Logo
diff -r df330602b1a2 -r 22e03ca8c39d flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPrintPanel.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPrintPanel.java Mon Apr 15 15:28:06 2013 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPrintPanel.java Mon Apr 15 18:23:42 2013 +0200
@@ -9,6 +9,7 @@
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.form.fields.ButtonItem;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.types.Alignment;
@@ -43,11 +44,12 @@
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_CREATED = "mapfish_data_created";
+ 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";
private static final String MAPFISH_RIVER = "mapfish_data_river";
+ private static final String MAPFISH_LOGO = "mapfish_logo";
protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
@@ -61,11 +63,12 @@
protected TextItem pageTitle = new TextItem();
protected TextItem pageRange = new TextItem();
protected TextItem pageSubtitle = new TextItem();
- protected TextItem pageStrech = new TextItem();
- protected TextItem pageCreated = new TextItem();
+ protected TextItem pageStretch = new TextItem();
+ protected TextItem pageInstitution = new TextItem();
protected TextItem pageSource = new TextItem();
protected TextItem pageCreator = new TextItem();
protected TextItem pageDatePlace = new TextItem();
+ protected SelectItem pageLogo = createPageLogoSelectItem();
// protected SelectItem pageFormat = createPageFormatSelectItem();
protected MapToolbar mapToolbar;
protected MapPrintWindow parent;
@@ -96,10 +99,10 @@
this.pageSubtitle.setValue(props.getValue());
}
else if (props.getName().equals(MAPFISH_STRETCH)) {
- this.pageStrech.setValue(props.getValue());
+ this.pageStretch.setValue(props.getValue());
}
- else if (props.getName().equals(MAPFISH_CREATED)) {
- this.pageCreated.setValue(props.getValue());
+ else if (props.getName().equals(MAPFISH_INSTITUTION)) {
+ this.pageInstitution.setValue(props.getValue());
}
else if (props.getName().equals(MAPFISH_SOURCE)) {
this.pageSource.setValue(props.getValue());
@@ -118,20 +121,20 @@
protected void initLayout() {
// TODO: i18n
- this.pageTitle.setTitle("Titel");
- this.pageSubtitle.setTitle("Untertitel");
- this.pageRange.setTitle("Bereich");
- this.pageStrech.setTitle("Strecke");
- this.pageCreated.setTitle("Aufgestellt");
- this.pageSource.setTitle("Datenquelle");
- this.pageCreator.setTitle("Ersteller");
- this.pageDatePlace.setTitle("Ort, Datum");
+ this.pageTitle.setTitle(MSG.mapTitle());
+ this.pageSubtitle.setTitle(MSG.mapSubtitle());
+ this.pageRange.setTitle(MSG.mapRange());
+ this.pageStretch.setTitle(MSG.mapStretch());
+ this.pageInstitution.setTitle(MSG.mapInstitution());
+ this.pageSource.setTitle(MSG.mapSource());
+ this.pageCreator.setTitle(MSG.mapCreator());
+ this.pageDatePlace.setTitle(MSG.mapDate());
pageTitle.setLength(21);
pageSubtitle.setLength(21);
pageRange.setLength(21);
- pageStrech.setLength(21);
- pageCreated.setLength(21);
+ pageStretch.setLength(21);
+ pageInstitution.setLength(21);
pageSource.setLength(21);
pageCreator.setLength(21);
pageDatePlace.setLength(21);
@@ -145,15 +148,29 @@
this.pageTitle,
this.pageSubtitle,
this.pageRange,
- this.pageStrech,
- this.pageCreated,
+ this.pageStretch,
+ this.pageInstitution,
this.pageSource,
this.pageCreator,
this.pageDatePlace,
+ this.pageLogo,
printButton);
addChild(df);
}
+ protected SelectItem createPageLogoSelectItem() {
+ LinkedHashMap values = new LinkedHashMap();
+ // TODO: this should be configurable
+ values.put(MSG.bfgLogo(), "BfG Logo");
+
+ SelectItem selItem = new SelectItem();
+ selItem.setTitle(MSG.mapLogo());
+ selItem.setValueMap(values);
+ selItem.setDefaultToFirstOption(true);
+
+ return selItem;
+ }
+
/*
* Commented out because we only provide a layout for A4 Landscape atm
@@ -317,11 +334,12 @@
// properties.add(new PropertySetting(MAPFISH_LAYOUT, toJavaEncodedString(pageFormat.getValueAsString())));
properties.add(new PropertySetting(MAPFISH_SUBTITLE, toJavaEncodedString(pageSubtitle.getValueAsString())));
properties.add(new PropertySetting(MAPFISH_RANGE, toJavaEncodedString(pageRange.getValueAsString())));
- properties.add(new PropertySetting(MAPFISH_STRETCH, toJavaEncodedString(pageStrech.getValueAsString())));
- properties.add(new PropertySetting(MAPFISH_CREATED, toJavaEncodedString(pageCreated.getValueAsString())));
+ properties.add(new PropertySetting(MAPFISH_STRETCH, toJavaEncodedString(pageStretch.getValueAsString())));
+ properties.add(new PropertySetting(MAPFISH_INSTITUTION, toJavaEncodedString(pageInstitution.getValueAsString())));
properties.add(new PropertySetting(MAPFISH_SOURCE, toJavaEncodedString(pageSource.getValueAsString())));
properties.add(new PropertySetting(MAPFISH_CREATOR, toJavaEncodedString(pageCreator.getValueAsString())));
properties.add(new PropertySetting(MAPFISH_DATEPLACE, toJavaEncodedString(pageDatePlace.getValueAsString())));
+ properties.add(new PropertySetting(MAPFISH_LOGO, toJavaEncodedString(pageLogo.getValueAsString())));
settings.setSettings("default", properties);
collection.addSettings("print-settings", settings);
diff -r df330602b1a2 -r 22e03ca8c39d flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPrintWindow.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPrintWindow.java Mon Apr 15 15:28:06 2013 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPrintWindow.java Mon Apr 15 18:23:42 2013 +0200
@@ -13,7 +13,7 @@
public MapPrintWindow(Collection collection, MapToolbar mapToolbar) {
setWidth(255);
- setHeight(280);
+ setHeight(300);
setTitle(MSG.printWindowTitle());
centerInPage();
More information about the Dive4elements-commits
mailing list