ingo@75: package de.intevation.flys.client.client.ui; ingo@75: ingo@75: import com.smartgwt.client.widgets.Canvas; ingo@75: import com.smartgwt.client.widgets.Img; ingo@75: import com.smartgwt.client.widgets.Label; ingo@75: import com.smartgwt.client.widgets.layout.HLayout; ingo@75: ingo@75: import de.intevation.flys.client.shared.model.Collection; ingo@75: import de.intevation.flys.client.shared.model.OutputMode; ingo@75: import de.intevation.flys.client.client.Config; ingo@75: ingo@75: ingo@75: /** ingo@75: * @author Ingo Weinzierl ingo@75: */ ingo@75: public class ChartOutputTab extends OutputTab { ingo@75: ingo@75: /** The canvas that wraps the theme editor.*/ ingo@75: protected Canvas left; ingo@75: ingo@75: /** The canvas that wraps the chart.*/ ingo@75: protected Canvas right; ingo@75: ingo@75: ingo@75: /** ingo@75: * The default constructor to create a new ChartOutputTab. ingo@75: * ingo@75: * @param title The title of this tab. ingo@75: * @param collection The Collection which this chart belongs to. ingo@75: * @param mode The OutputMode. ingo@75: */ ingo@75: public ChartOutputTab(String title, Collection collection, OutputMode mode){ ingo@75: super(title, collection, mode); ingo@75: ingo@75: left = new Canvas(); ingo@75: right = new Canvas(); ingo@75: ingo@75: left.setWidth("25%"); ingo@75: right.setWidth("*"); ingo@75: ingo@75: HLayout hLayout = new HLayout(); ingo@75: hLayout.setWidth100(); ingo@75: hLayout.setHeight100(); ingo@75: hLayout.setMembersMargin(10); ingo@75: ingo@75: hLayout.addMember(left); ingo@75: hLayout.addMember(right); ingo@75: ingo@75: Label todo = new Label("TODO: Implement theme editor."); ingo@75: Img chart = getChartImg(); ingo@75: ingo@75: left.addChild(todo); ingo@75: right.addChild(chart); ingo@75: ingo@75: setPane(hLayout); ingo@75: } ingo@75: ingo@75: ingo@75: /** ingo@75: * Builds the chart image and returns it. ingo@75: * ingo@75: * @return the chart image. ingo@75: */ ingo@75: protected Img getChartImg() { ingo@75: return new Img(getImgUrl()); ingo@75: } ingo@75: ingo@75: ingo@75: /** ingo@75: * Builds the URL that points to the chart image. ingo@75: * ingo@75: * @return the URL to the chart image. ingo@75: */ ingo@75: protected String getImgUrl() { ingo@75: Config config = Config.getInstance(); ingo@75: String server = config.getServerUrl(); ingo@75: ingo@75: // TODO Build the correct url that points to the OUT() resource of the ingo@75: // collection. ingo@75: return server; ingo@75: } ingo@75: } ingo@75: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :