changeset 2954:b9433322fcaf

Add alpha transp. and fix exceptions on unknown style attributes. flys-client/trunk@4934 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Christian Lins <christian.lins@intevation.de>
date Wed, 11 Jul 2012 12:04:25 +0000
parents 75e9eab05ee4
children f1030909eeb6
files flys-client/.classpath flys-client/.project flys-client/ChangeLog flys-client/FLYS.launch flys-client/FLYSTest-dev.launch flys-client/FLYSTest-prod.launch flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java flys-client/src/main/java/de/intevation/flys/client/server/FileUploadServiceImpl.java
diffstat 12 files changed, 61 insertions(+), 120 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/.classpath	Wed Jul 11 11:24:27 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<classpath>
-   <classpathentry kind="src" path="src/main/java"/>
-   <classpathentry kind="src" path="src/test/java"/>
-   <classpathentry kind="lib" path="/vol1/download/ingo/gwt-2.1.1/gwt-user.jar"/>
-   <classpathentry kind="lib" path="/vol1/download/ingo/gwt-2.1.1/gwt-dev.jar"/>
-   <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-   <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-   <classpathentry kind="output" path="src/main/webapp/WEB-INF/classes"/>
-
-</classpath>
--- a/flys-client/.project	Wed Jul 11 11:24:27 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<projectDescription>
-   <name>FLYS</name>
-   <comment>FLYS project</comment>
-   <projects/>
-   <buildSpec>
-       <buildCommand>
-           <name>org.eclipse.jdt.core.javabuilder</name>
-           <arguments/>
-       </buildCommand>
-   </buildSpec>
-   <natures>
-       <nature>org.eclipse.jdt.core.javanature</nature>
-   </natures>
-</projectDescription>
--- a/flys-client/ChangeLog	Wed Jul 11 11:24:27 2012 +0000
+++ b/flys-client/ChangeLog	Wed Jul 11 12:04:25 2012 +0000
@@ -1,3 +1,17 @@
+2012-07-11	Christian Lins <christian.lins@intevation.de>
+
+	Eclipse specific project files removed from SVN.
+
+	* src/main/java/de/intevation/flys/client/server/FileUploadServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants.java,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants.properties,
+	  src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties:
+	  Fix exceptions on unknown style attributes.
+	  Introduce alpha transparency attribut for areas.
+
+
 2012-07-11  Raimund Renkert <raimund.renkert@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/server/SQKMChartServiceImpl.java:
--- a/flys-client/FLYS.launch	Wed Jul 11 11:24:27 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
-<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;FLYS&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/FLYS/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento project=&quot;FLYS&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx256M"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war src/main/webapp -startupUrl FLYS.html de.intevation.flys.client.FLYS"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="FLYS"/>
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-</launchConfiguration>
--- a/flys-client/FLYSTest-dev.launch	Wed Jul 11 11:24:27 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="de.intevation.flys.client.client.FLYSTest"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;FLYS&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/FLYS/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/FLYS/src/test/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento project=&quot;FLYS&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;/vol1/download/ingo/gwt-2.1.1/gwt-dev.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="FLYS"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dgwt.args=&quot;-standardsMode -logLevel WARN&quot; -Xmx256M"/>
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-</launchConfiguration>
--- a/flys-client/FLYSTest-prod.launch	Wed Jul 11 11:24:27 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="de.intevation.flys.client.client.FLYSTest"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER&quot; javaProject=&quot;FLYS&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/FLYS/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/FLYS/src/test/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento project=&quot;FLYS&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>
-<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;/vol1/download/ingo/gwt-2.1.1/gwt-dev.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="FLYS"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dgwt.args=&quot;-prod -standardsMode -logLevel WARN -out www-test&quot; -Xmx256M"/>
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-</launchConfiguration>
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Wed Jul 11 11:24:27 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Wed Jul 11 12:04:25 2012 +0000
@@ -882,6 +882,8 @@
     String showmaximum();
 
     String transparent();
+    
+    String alpha();
 
     String showarea();
 
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Wed Jul 11 11:24:27 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Wed Jul 11 12:04:25 2012 +0000
@@ -451,6 +451,7 @@
 showmaximum = Show maximum
 showborder = Show line
 transparent = Transparency
+alpha = Transparency Alpha
 showarea = Show Area
 showmiddleheight = Show middle height
 fillcolor = Fill Color
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Wed Jul 11 11:24:27 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Wed Jul 11 12:04:25 2012 +0000
@@ -451,6 +451,7 @@
 showmaximum = Maximum anzeigen
 showborder = Linie anzeigen
 transparent = Transparenz
+alpha = Alpha-Transparenzwert
 showarea = Fl\u00e4che beschriften
 showmiddleheight = Mittlere H\u00f6he anzeigen
 fillcolor = F\u00fcllfarbe
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Wed Jul 11 11:24:27 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Wed Jul 11 12:04:25 2012 +0000
@@ -453,6 +453,7 @@
 showmaximum = Show maximum
 showborder = Show line
 transparent = Transparency
+alpha = Transparency Alpha
 showarea = Show Area
 showmiddleheight = Show middle height
 fillcolor = Fill Color
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java	Wed Jul 11 11:24:27 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java	Wed Jul 11 12:04:25 2012 +0000
@@ -1,53 +1,45 @@
 package de.intevation.flys.client.client.ui;
 
-import java.util.Arrays;
-import java.util.Map;
-import java.util.LinkedHashMap;
-import java.util.Set;
-import java.util.Iterator;
-
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.rpc.AsyncCallback;
-
+import com.smartgwt.client.types.Alignment;
 import com.smartgwt.client.util.SC;
-
-import com.smartgwt.client.widgets.Window;
+import com.smartgwt.client.widgets.Button;
 import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.layout.VLayout;
-import com.smartgwt.client.widgets.layout.HLayout;
-import com.smartgwt.client.widgets.Button;
-import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.fields.FormItem;
-import com.smartgwt.client.widgets.form.fields.CheckboxItem;
-import com.smartgwt.client.widgets.form.fields.ColorPickerItem;
-import com.smartgwt.client.widgets.form.fields.SelectItem;
-import com.smartgwt.client.widgets.form.fields.StaticTextItem;
-
+import com.smartgwt.client.widgets.Window;
 import com.smartgwt.client.widgets.events.ClickEvent;
 import com.smartgwt.client.widgets.events.ClickHandler;
+import com.smartgwt.client.widgets.form.DynamicForm;
 import com.smartgwt.client.widgets.form.events.ItemChangedEvent;
 import com.smartgwt.client.widgets.form.events.ItemChangedHandler;
+import com.smartgwt.client.widgets.form.fields.CheckboxItem;
+import com.smartgwt.client.widgets.form.fields.ColorPickerItem;
+import com.smartgwt.client.widgets.form.fields.FormItem;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
 import com.smartgwt.client.widgets.form.fields.events.ChangedEvent;
 import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
+import com.smartgwt.client.widgets.layout.HLayout;
+import com.smartgwt.client.widgets.layout.VLayout;
 
-import com.smartgwt.client.types.Alignment;
-
+import de.intevation.flys.client.client.Config;
+import de.intevation.flys.client.client.FLYSConstants;
+import de.intevation.flys.client.client.services.CollectionItemAttributeService;
+import de.intevation.flys.client.client.services.CollectionItemAttributeServiceAsync;
+import de.intevation.flys.client.client.services.ThemeListingService;
+import de.intevation.flys.client.client.services.ThemeListingServiceAsync;
 import de.intevation.flys.client.shared.model.Collection;
 import de.intevation.flys.client.shared.model.CollectionItemAttribute;
+import de.intevation.flys.client.shared.model.FacetRecord;
 import de.intevation.flys.client.shared.model.Style;
 import de.intevation.flys.client.shared.model.StyleSetting;
-import de.intevation.flys.client.shared.model.FacetRecord;
 import de.intevation.flys.client.shared.model.Theme;
 
-import de.intevation.flys.client.client.services.CollectionItemAttributeServiceAsync;
-import de.intevation.flys.client.client.services.CollectionItemAttributeService;
-import de.intevation.flys.client.client.services.ThemeListingServiceAsync;
-import de.intevation.flys.client.client.services.ThemeListingService;
-
-import de.intevation.flys.client.client.ui.ThemePanel;
-
-import de.intevation.flys.client.client.FLYSConstants;
-import de.intevation.flys.client.client.Config;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
@@ -114,6 +106,7 @@
         styleChooser.setTitleAlign(Alignment.LEFT);
         styleChooser.setValue("aktuell");
         styleChooser.addChangedHandler(new ChangedHandler() {
+            @Override
             public void onChanged(ChangedEvent ce) {
                 String value = ce.getValue().toString();
                 Style s = null;
@@ -160,6 +153,10 @@
 
         Theme theme = facet.getTheme();
         Style style = attributes.getStyle(theme.getFacet(), theme.getIndex());
+        if(style == null) {
+            GWT.log("StyleEditorWindow.init(): style == null");
+            return;
+        }
         String name = style.getName();
         this.current = style;
 
@@ -167,20 +164,22 @@
             locale,
             name,
             new AsyncCallback<Map<String, Style> >() {
+                @Override
                 public void onFailure(Throwable caught) {
                     GWT.log("No listloaded.");
                 }
+                @Override
                 public void onSuccess(Map<String, Style> list) {
                     GWT.log("Successfully loaded list.");
 
                     styleGroups = list;
-                    Set keys = list.keySet();
+                    Set<String> keys = list.keySet();
                     LinkedHashMap<String, String> valueMap =
                         new LinkedHashMap<String, String>();
                     valueMap.put("aktuell", "Aktuell");
-                    Iterator i = keys.iterator();
-                    while (i.hasNext()) {
-                        String s = i.next().toString();
+                    Iterator<String> iter = keys.iterator();
+                    while (iter.hasNext()) {
+                        String s = iter.next().toString();
                         Style tmp = styleGroups.get(s);
                         tmp.setFacet(current.getFacet());
                         tmp.setIndex(current.getIndex());
@@ -201,6 +200,7 @@
         Button cancel = new Button(MSG.label_cancel());
         cancel.addClickHandler(this);
         accept.addClickHandler(new ClickHandler() {
+            @Override
             public void onClick(ClickEvent e) {
                 saveStyle();
             }
@@ -237,6 +237,7 @@
      * this method is called when the user aborts theming.
      * @param event The event.
      */
+    @Override
     public void onClick(ClickEvent event) {
         this.hide();
     }
@@ -453,6 +454,7 @@
         f.setTitleAlign(Alignment.LEFT);
         df.setFields(f);
         df.addItemChangedHandler(new ItemChangedHandler() {
+            @Override
             public void onItemChanged(ItemChangedEvent e) {
                 String name = e.getItem().getName();
                 String newValue = e.getNewValue().toString();
@@ -555,9 +557,11 @@
             locale,
             attributes,
             new AsyncCallback<Void>() {
+                @Override
                 public void onFailure (Throwable caught) {
                     GWT.log("Could not set Collection item attributes.");
                 }
+                @Override
                 public void onSuccess(Void v) {
                     GWT.log("Successfully saved collection item attributes.");
                     panel.requestRedraw();
--- a/flys-client/src/main/java/de/intevation/flys/client/server/FileUploadServiceImpl.java	Wed Jul 11 11:24:27 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/FileUploadServiceImpl.java	Wed Jul 11 12:04:25 2012 +0000
@@ -1,11 +1,8 @@
 package de.intevation.flys.client.server;
 
-import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator;
-
 import de.intevation.artifacts.common.utils.XMLUtils;
-
+import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator;
 import de.intevation.artifacts.httpclient.exceptions.ConnectionException;
-
 import de.intevation.artifacts.httpclient.http.HttpClient;
 import de.intevation.artifacts.httpclient.http.HttpClientImpl;
 
@@ -17,14 +14,10 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.codec.binary.Base64;
-
 import org.apache.commons.fileupload.FileItemIterator;
 import org.apache.commons.fileupload.FileItemStream;
-
 import org.apache.commons.fileupload.servlet.ServletFileUpload;
-
 import org.apache.log4j.Logger;
-
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -78,7 +71,6 @@
                 String name = item.getFieldName();
                 InputStream stream = item.openStream();
 
-
                 // Process the input stream
                 ByteArrayOutputStream out = new ByteArrayOutputStream();
                 int len;
@@ -87,8 +79,8 @@
                     out.write(buffer, 0, len);
                 }
 
-                Base64 encoder = new Base64();
-                String b64File = Base64.encodeBase64String(buffer);
+                buffer = Base64.encodeBase64(buffer);
+                String b64File = new String(buffer);
 
                 Document fileDoc = XMLUtils.newDocument();
 

http://dive4elements.wald.intevation.org