Mercurial > dive4elements > river
view flys-client/src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java @ 89:131e3f23a74e
Modified the URL of the 'back button' image.
flys-client/trunk@1601 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 29 Mar 2011 09:45:57 +0000 |
parents | c8cd1b918901 |
children | f7967d12ce6e |
line wrap: on
line source
package de.intevation.flys.client.client.ui; import com.google.gwt.core.client.GWT; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Img; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.layout.HLayout; import de.intevation.flys.client.shared.model.Collection; import de.intevation.flys.client.shared.model.OutputMode; import de.intevation.flys.client.client.Config; /** * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class ChartOutputTab extends OutputTab { /** The canvas that wraps the theme editor.*/ protected Canvas left; /** The canvas that wraps the chart.*/ protected Canvas right; /** * The default constructor to create a new ChartOutputTab. * * @param title The title of this tab. * @param collection The Collection which this chart belongs to. * @param mode The OutputMode. */ public ChartOutputTab(String title, Collection collection, OutputMode mode){ super(title, collection, mode); left = new Canvas(); right = new Canvas(); left.setWidth("25%"); right.setWidth("*"); HLayout hLayout = new HLayout(); hLayout.setWidth100(); hLayout.setHeight100(); hLayout.setMembersMargin(10); hLayout.addMember(left); hLayout.addMember(right); Img chart = getChartImg(); chart.setWidth100(); chart.setHeight100(); right.addChild(chart); setPane(hLayout); } /** * Builds the chart image and returns it. * * @return the chart image. */ protected Img getChartImg() { return new Img(getImgUrl()); } /** * Builds the URL that points to the chart image. * * @return the URL to the chart image. */ protected String getImgUrl() { Config config = Config.getInstance(); String server = config.getServerUrl(); String uuid = collection.getItem(0).identifier(); String hash = collection.getItem(0).hash(); String imgUrl = GWT.getModuleBaseURL(); imgUrl += "chart"; imgUrl += "?target=chart"; imgUrl += "&server=" + server; imgUrl += "&mode=img"; imgUrl += "&width=600"; imgUrl += "&height=400"; imgUrl += "&points=false"; imgUrl += "&uuid=" + uuid; imgUrl += "&hash=" + hash; GWT.log("IMAGE URL = " + imgUrl); // TODO Build the correct url that points to the OUT() resource of the // collection. return imgUrl; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :