raimund@1429: package de.intevation.flys.client.client.ui.chart; raimund@1429: raimund@1429: import java.util.LinkedHashMap; raimund@1429: raimund@1429: import com.google.gwt.core.client.GWT; raimund@1429: raimund@1429: import com.smartgwt.client.widgets.Window; raimund@1429: import com.smartgwt.client.widgets.tab.TabSet; raimund@1429: import com.smartgwt.client.widgets.tab.Tab; raimund@1429: import com.smartgwt.client.widgets.layout.VLayout; raimund@1429: import com.smartgwt.client.widgets.layout.HLayout; raimund@1429: import com.smartgwt.client.widgets.Button; raimund@1429: import com.smartgwt.client.widgets.form.DynamicForm; raimund@1429: import com.smartgwt.client.widgets.form.fields.FormItem; raimund@1429: import com.smartgwt.client.widgets.form.fields.CheckboxItem; raimund@1429: import com.smartgwt.client.widgets.form.fields.SelectItem; raimund@1429: import com.smartgwt.client.widgets.form.fields.StaticTextItem; raimund@1429: raimund@1429: import com.smartgwt.client.widgets.events.ClickEvent; raimund@1429: import com.smartgwt.client.widgets.events.ClickHandler; raimund@1429: import com.smartgwt.client.widgets.form.events.ItemChangedEvent; raimund@1429: import com.smartgwt.client.widgets.form.events.ItemChangedHandler; raimund@1429: import com.smartgwt.client.types.Alignment; raimund@1429: raimund@1429: import de.intevation.flys.client.client.FLYSConstants; raimund@1429: import de.intevation.flys.client.client.ui.OutputTab; raimund@1429: raimund@1429: /** raimund@1429: * @author Raimund Renkert raimund@1429: */ raimund@1429: public class ChartPropertiesEditor raimund@1429: extends Window raimund@1429: implements ClickHandler raimund@1429: { raimund@1429: /** The interface that provides i18n messages. */ raimund@1429: protected FLYSConstants MSG = GWT.create(FLYSConstants.class); raimund@1429: raimund@1429: /** The tab called the editor window. */ raimund@1429: protected OutputTab tab; raimund@1429: raimund@1429: /** The tabset for chart properties */ raimund@1429: protected TabSet tabs; raimund@1429: raimund@1429: /** raimund@1429: * Setup editor dialog. raimund@1429: * @param callerTab The tab called the editor window. raimund@1429: */ raimund@1429: public ChartPropertiesEditor(OutputTab callerTab) { raimund@1429: this.tab = callerTab; raimund@1429: this.tabs = new TabSet(); raimund@1429: raimund@1429: init(); raimund@1429: } raimund@1429: raimund@1429: /** raimund@1429: * Initialize the editor window and its components. raimund@1429: */ raimund@1429: protected void init() { raimund@1429: setTitle(MSG.properties()); raimund@1429: setCanDragReposition(true); raimund@1429: setCanDragResize(true); raimund@1429: raimund@1429: Tab diagram = new Tab(MSG.diagram()); raimund@1429: Tab axes = new Tab(MSG.axes()); raimund@1429: Tab legend = new Tab(MSG.legend()); raimund@1429: tabs.addTab(diagram); raimund@1429: tabs.addTab(axes); raimund@1429: tabs.addTab(legend); raimund@1429: raimund@1429: Button accept = new Button(MSG.label_ok()); raimund@1429: Button cancel = new Button(MSG.label_cancel()); raimund@1429: cancel.addClickHandler(this); raimund@1429: accept.addClickHandler(new ClickHandler() { raimund@1429: public void onClick(ClickEvent e) { raimund@1429: raimund@1429: } raimund@1429: }); raimund@1429: raimund@1429: HLayout buttons = new HLayout(); raimund@1429: buttons.addMember(accept); raimund@1429: buttons.addMember(cancel); raimund@1429: buttons.setAlign(Alignment.CENTER); raimund@1429: buttons.setHeight(30); raimund@1429: raimund@1429: addItem(tabs); raimund@1429: addItem(buttons); raimund@1429: setWidth(300); raimund@1429: setHeight(410); raimund@1429: centerInPage(); raimund@1429: } raimund@1429: raimund@1429: /** raimund@1429: * This method is called when the user aborts theming. raimund@1429: * @param event The event. raimund@1429: */ raimund@1429: public void onClick(ClickEvent event) { raimund@1429: this.hide(); raimund@1429: } raimund@1429: }