# HG changeset patch # User Christian Lins # Date 1342008265 0 # Node ID b9433322fcaf4a25d19a6d294b4348e49429b25d # Parent 75e9eab05ee4cd6689dbb901e5baffd47f41a983 Add alpha transp. and fix exceptions on unknown style attributes. flys-client/trunk@4934 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 75e9eab05ee4 -r b9433322fcaf flys-client/.classpath --- 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 @@ - - - - - - - - - - - diff -r 75e9eab05ee4 -r b9433322fcaf flys-client/.project --- 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 @@ - - - FLYS - FLYS project - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.jdt.core.javanature - - diff -r 75e9eab05ee4 -r b9433322fcaf flys-client/ChangeLog --- 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 + + 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 * src/main/java/de/intevation/flys/client/server/SQKMChartServiceImpl.java: diff -r 75e9eab05ee4 -r b9433322fcaf flys-client/FLYS.launch --- 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 @@ - - - - - - - - - - - - - - diff -r 75e9eab05ee4 -r b9433322fcaf flys-client/FLYSTest-dev.launch --- 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 @@ - - - - - - - - - - - - - - - - - diff -r 75e9eab05ee4 -r b9433322fcaf flys-client/FLYSTest-prod.launch --- 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 @@ - - - - - - - - - - - - - - - - - diff -r 75e9eab05ee4 -r b9433322fcaf 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 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(); diff -r 75e9eab05ee4 -r b9433322fcaf 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 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 diff -r 75e9eab05ee4 -r b9433322fcaf 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 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 diff -r 75e9eab05ee4 -r b9433322fcaf flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties --- 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 diff -r 75e9eab05ee4 -r b9433322fcaf 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 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 Raimund Renkert @@ -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 >() { + @Override public void onFailure(Throwable caught) { GWT.log("No listloaded."); } + @Override public void onSuccess(Map list) { GWT.log("Successfully loaded list."); styleGroups = list; - Set keys = list.keySet(); + Set keys = list.keySet(); LinkedHashMap valueMap = new LinkedHashMap(); valueMap.put("aktuell", "Aktuell"); - Iterator i = keys.iterator(); - while (i.hasNext()) { - String s = i.next().toString(); + Iterator 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() { + @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(); diff -r 75e9eab05ee4 -r b9433322fcaf flys-client/src/main/java/de/intevation/flys/client/server/FileUploadServiceImpl.java --- 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();