com.smartgwt.client.widgets.layout.Layout Java Examples

The following examples show how to use com.smartgwt.client.widgets.layout.Layout. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Header.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Layout getHomeLabel() {
	Layout layout = new VLayout();
	layout.setStyleName("n52_sensorweb_client_logoBlock");
	Img homeLabel = new Img("../img/client-logo.png", 289, 55);
	homeLabel.setStyleName("n52_sensorweb_client_logo");
	homeLabel.setCursor(Cursor.POINTER);
       homeLabel.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			String url = "http://52north.org/communities/sensorweb/";
               Window.open(url, "_blank", "");
		}
       });
       layout.addMember(homeLabel);
	return layout;
}
 
Example #2
Source File: LegendEntryTimeSeries.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Canvas createValueIntervalLabel() {
	Layout interval = new HLayout();
	interval.setAutoWidth();
	interval.setStyleName("n52_sensorweb_client_legendInfoRow");
	this.firstValueInterval.setAutoWidth();
	this.firstValueInterval.setWrap(false);
	this.firstValueInterval.setStyleName("n52_sensorweb_client_legendlink");
	this.lastValueInterval.setAutoWidth();
	this.lastValueInterval.setWrap(false);
	this.lastValueInterval.setStyleName("n52_sensorweb_client_legendlink");
	Label separator = new Label(i18n.to());
	separator.setAlign(Alignment.CENTER);
	separator.setWidth(20);
	interval.addMember(this.firstValueInterval);
	interval.addMember(separator);
	interval.addMember(this.lastValueInterval);
	return interval;
}
 
Example #3
Source File: DataControlsTimeSeries.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Canvas createAutoScaleButton() {
	Layout layout = new Layout();
	layout.setStyleName("n52_sensorweb_client_scaleButtonLayout");
	autoScaleButton = new Label(i18n.resetScale());
	autoScaleButton.setStyleName("n52_sensorweb_client_scaleButton");
    autoScaleButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            EventBus.getMainEventBus().fireEvent(new SwitchAutoscaleEvent(true), new EventCallback() {
                public void onEventFired() {
                    EventBus.getMainEventBus().fireEvent(new RequestDataEvent());
                }
            });
        }
    });
    autoScaleButton.setWidth(80);
    autoScaleButton.setWrap(false);
    return autoScaleButton;
}
 
Example #4
Source File: EditorWorkFlow.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
public EditorWorkFlow(EventBus ebus, PlaceController placeController,
        ActivityManager activityManager, Layout delegate,
        PresenterFactory presenterFactory, ClientMessages i18n) {

    this.presenterFactory = presenterFactory;
    this.i18n = i18n;
    this.ebus = (ebus != null) ? ebus : new SimpleEventBus();
    // PlaceController uses delegate to ask user with blocking Window.confirm
    // whether to leave the current place.
    // In order to use non blocking SmartGWT dialog
    // it will be necessary to override PlaceController.goto method.
    this.placeController = (placeController != null) ? placeController
            : new PlaceController(this.ebus);
    this.activityManager = (activityManager != null) ? activityManager
            : new ActivityManager(new EditorActivityMapper(), this.ebus);
    this.activityManager.setDisplay(new EditorDisplay(delegate));
    EditorPlaceHistoryMapper historyMapper = GWT.create(EditorPlaceHistoryMapper.class);
    placeHistoryHandler = new PlaceHistoryHandler(historyMapper);
    placeHistoryHandler.register(this.placeController, this.ebus, Place.NOWHERE);
}
 
Example #5
Source File: ChannelsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void onDraw() {
	ToolStrip toolStrip = new ToolStrip();
	toolStrip.setHeight(20);
	toolStrip.setWidth100();
	toolStrip.addSpacer(2);
	ToolStripButton refresh = new ToolStripButton();
	refresh.setTitle(I18N.message("refresh"));
	toolStrip.addButton(refresh);
	refresh.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			list.refresh(new ChannelsDS());
		}
	});
	toolStrip.addFill();

	Layout listing = new VLayout();
	setMembers(toolStrip, listing);

	ListGridField name = new ListGridField("name", I18N.message("channel"), 150);
	name.setCanEdit(false);

	ListGridField members = new ListGridField("members", I18N.message("members"));
	members.setCanEdit(false);
	members.setWidth("*");

	list = new RefreshableListGrid();
	list.setEmptyMessage(I18N.message("notitemstoshow"));
	list.setCanEdit(false);
	list.setWidth100();
	list.setHeight100();
	list.setAutoFetchData(true);
	list.setSelectionType(SelectionStyle.SINGLE);
	list.setFields(name, members);
	list.setDataSource(new ChannelsDS());

	listing.addMember(list);
}
 
Example #6
Source File: InteractionWindow.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
public InteractionWindow(Layout content) {
	this.setContent(content);
	
	title = new Label();
	title.setWidth100();
	title.setAutoHeight();
	title.setStyleName("n52_sensorweb_client_interactionmenuHeader");
	title.setWrap(false);
	title.hide();
	addMember(title);
	addMember(content);
	
	setStyleName("n52_sensorweb_client_interactionmenu");
}
 
Example #7
Source File: Impressum.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
public Impressum() {
	setTitle(IMPRESSUM_TITLE);
       setWidth(500);
       setHeight(500);
       centerInPage();
       setIsModal(true);
       Layout layout = new VLayout();
       HTMLPane htmlContentPane = new HTMLPane();
       htmlContentPane.setContentsURL(CONTENT_PATH);
       layout.addMember(htmlContentPane);
       addItem(layout);
}
 
Example #8
Source File: View.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Layout getDataViewAndLegendPanel() {
    HLayout hLayout = new HLayout();
    hLayout.setOverflow(Overflow.HIDDEN);
    hLayout.addMember(getLegend());
    hLayout.addMember(getLegendHider());
    hLayout.addMember(getDataPanel());
    hLayout.setTabIndex( -1);
    return hLayout;
}
 
Example #9
Source File: Header.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private void generateHeader(){

        setStyleName("n52_sensorweb_client_headerContainer");
        setBackgroundImage("../img/52n_bg.png");
        setAutoHeight();

        addMember(getHomeLabel());

        Layout rightLayout = new VLayout();
        Layout linkLayout = new HLayout();
        linkLayout.setStyleName("n52_sensorweb_client_linkBlock");
        linkLayout.setAlign(Alignment.RIGHT);

//        linkLayout.addMember(getVersionInfo());
//        linkLayout.addMember(getSeparator());
        
        // temporary button for metadata reset
        //linkLayout.addMember(getMetadatareset());
        //linkLayout.addMember(getSeparator());
        
        linkLayout.addMember(getPermalinkLink());
        linkLayout.addMember(getSeparator());
        linkLayout.addMember(getHelpLink());
        linkLayout.addMember(getSeparator());
        linkLayout.addMember(getAddBookmarkLink());
        linkLayout.addMember(getSeparator());
        linkLayout.addMember(getImprintLink());
        linkLayout.addMember(getSeparator());
        linkLayout.addMember(getCopyrightLink());
        rightLayout.addMember(linkLayout);
        
        if (ClientUtils.isSesEnabled()) {
        	rightLayout.addMember(createLoginInfo());
        }
        
        addMember(rightLayout);
    }
 
Example #10
Source File: DiagramTab.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
public DiagramTab(String ID, String title) {
    super("DiagramTab");
	layout = new Layout();

    MousePointerDomainBoundsHandler listener = new MousePointerDomainBoundsHandler();
    this.mainChartEventBus.addHandler(SetDomainBoundsEvent.TYPE, listener);

    controller = new DiagramTabController(this);

    setID(ID);
    setTitle(title);
    setIcon("../img/icons/chart_curve.png");
}
 
Example #11
Source File: StationSelector.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Canvas createSelectionMenuWindow() {
	Layout layout = new Layout();
       layout.addMember(createExpandableSelectionGrid());
	selectionMenu = new InteractionWindow(layout);
	selectionMenu.setZIndex(1000000);
	selectionMenu.setWidth(250);
	selectionMenu.setHeight(290);
	selectionMenu.setWindowTitle(i18n.dataprovider());
	setSelectionMenuWindowPosition();
	return selectionMenu;
}
 
Example #12
Source File: SensorLossRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Canvas createEditCanvas() {
    controller.clearSelectionData();
    Layout layout = new VLayout();
    layout.setStyleName("n52_sensorweb_client_create_abo_template_sensorlosscondition");
    layout.addMember(alignVerticalCenter(createEditConditionCanvas()));
    return layout;
}
 
Example #13
Source File: EventSubscriptionWindow.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Canvas createRuleTemplateSelectionCanvas() {
    Layout selectionCanvas = new VLayout();
    SelectSubscriptionForm selectionRadioForm = new SelectSubscriptionForm(controller);
    SubscriptionTemplate template = selectionRadioForm.getDefaultSubscriptionTemplate();
    Canvas ruleTemplateEditCanvas = createRuleTemplateEditorCanvas(template);
    selectionCanvas.addMember(selectionRadioForm);
    selectionCanvas.addMember(ruleTemplateEditCanvas);
    return selectionCanvas;
}
 
Example #14
Source File: EventSubscriptionWindow.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Canvas createNewEventAbonnementCanvas() {
    Layout subscriptionContent = new VLayout();
    subscriptionContent.setStyleName("n52_sensorweb_client_create_abo_form_content");
    subscriptionContent.addMember(createStationInfo());
    subscriptionContent.addMember(createRuleTemplateSelectionCanvas());
    subscriptionContent.addMember(new EventNameForm(controller));
    subscriptionContent.addMember(createApplyCancelCanvas());
    subscriptionContent.addMember(new TimeSeriesMetadataTable(controller));
    return subscriptionContent;
}
 
Example #15
Source File: EventSubscriptionWindow.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private Canvas createSubscribeAndHelpContent() {
    Layout layout = new HLayout();
    layout.addMember(createNewEventAbonnementCanvas());
    layout.addMember(createContextWindowHelp());
    layout.setOverflow(VISIBLE);
    return layout;
}
 
Example #16
Source File: OverUndershootRuleTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Canvas createEditCanvas() {
    controller.clearSelectionData();
    Layout layout = new VLayout();
    layout.setStyleName("n52_sensorweb_client_create_abo_template_overundershootcondition");
    layout.addMember(alignVerticalCenter(createEntryConditionEditCanvas()));
    layout.addMember(alignVerticalCenter(createExitConditionEditCanvas()));
    return layout;
}
 
Example #17
Source File: DigitalObjectPreview.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public ImageLoadTask(Layout display, Zoom zoom, boolean focus, ClientMessages i18n) {
            this.imgContainer = new VLayout();
            this.imgContainer.setLayoutMargin(4);
            // center vertically
            this.imgContainer.setAlign(Alignment.CENTER);
            // center horizontally
            // #461: do not try to center horizontally as browsers crop large images in small containers
//            this.imgContainer.setDefaultLayoutAlign(Alignment.CENTER);
            this.imgContainer.setOverflow(Overflow.AUTO);
            this.display = display;
            this.i18n = i18n;
            this.zoom = zoom;
            this.focus = focus;
        }
 
Example #18
Source File: DigitalObjectPreview.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public void show(String previewUrl, String mime) {
    if (previewUrl == null) {
        Layout container = previewLoadTask.getImgContainer();
        container.removeMembers(container.getMembers());
        previewLoadTask.stop();
    } else {
        previewLoadTask.load(previewUrl, mime);
    }
}
 
Example #19
Source File: DigitalObjectEditor.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private OptionalEditor(ClientMessages i18n, Layout previewContainer) {
    SimpleEventBus eventBus = new SimpleEventBus();
    embeddedPlaces = new PlaceController(eventBus);
    DigitalObjectEditor embeddedEditor = new DigitalObjectEditor(i18n, embeddedPlaces, true);
    embeddedEditor.setOptionalView(true);
    ActivityManager activityManager = new ActivityManager(
            new ChildActivities(embeddedEditor), eventBus);
    activityManager.setDisplay(new ChildEditorDisplay(previewContainer));
}
 
Example #20
Source File: ClientUtils.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Sets layout members just in case they differ from current members.
 */
public static void setMembers(Layout l, Canvas... members) {
    Canvas[] oldies = l.getMembers();
    if (!Arrays.equals(oldies, members)) {
        l.setMembers(members);
    }
}
 
Example #21
Source File: RunLevelPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void onDraw() {
	ToolStrip toolbar = new ToolStrip();
	toolbar.setWidth100();
	ToolStripButton save = new ToolStripButton(I18N.message("save"));
	save.setDisabled("demo".equals(Session.get().getConfig("runlevel")));
	save.addClickHandler(new ClickHandler() {

		@Override
		public void onClick(ClickEvent event) {
			onSave();
		}
	});
	currentRunlevel = ItemFactory.newRunlevelSelector();

	toolbar.addFormItem(currentRunlevel);
	toolbar.addSeparator();
	toolbar.addButton(save);

	Layout layout = new VLayout();
	layout.setWidth100();
	layout.setHeight100();
	layout.addMember(toolbar);
	layout.addMember(prepareAspectsTable());

	Tab tab = new Tab();
	tab.setTitle(I18N.message("runlevel"));
	tab.setPane(layout);

	TabSet tabs = new TabSet();
	tabs.setTabs(tab);

	setMembers(tabs);
}
 
Example #22
Source File: EditorWorkFlow.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public EditorDisplay(Layout display) {
    this.display = display;
}
 
Example #23
Source File: EditorWorkFlow.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public EditorWorkFlow(Layout delegate, PresenterFactory presenterFactory, ClientMessages i18n) {
    this(null, null, null, delegate, presenterFactory, i18n);
}
 
Example #24
Source File: DigitalObjectPreview.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public Layout getImgContainer() {
    return display;
}
 
Example #25
Source File: LegendEntryTimeSeries.java    From SensorWebClient with GNU General Public License v2.0 4 votes vote down vote up
public Layout getLayout() {
	return this;
}
 
Example #26
Source File: DigitalObjectChildrenEditor.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public ChildEditorDisplay(Layout display) {
    this.display = display;
}
 
Example #27
Source File: SearchIndexingPanel.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
private Tab fillLanguagesTab() {
	Tab languagesTab = new Tab(I18N.message("languages"));
	Layout languagesTabPanel = new HLayout();
	languagesTabPanel.setWidth100();
	languagesTabPanel.setHeight100();

	ListGridField enabled = new ListGridField("eenabled", " ", 24);
	enabled.setType(ListGridFieldType.IMAGE);
	enabled.setCanSort(false);
	enabled.setAlign(Alignment.CENTER);
	enabled.setShowDefaultContextMenu(false);
	enabled.setImageURLPrefix(Util.imagePrefix());
	enabled.setImageURLSuffix(".gif");
	enabled.setCanFilter(false);

	ListGridField code = new ListGridField("code", I18N.message("code"), 80);
	code.setCanEdit(false);

	ListGridField name = new ListGridField("name", I18N.message("name"));
	name.setCanEdit(false);

	langsList = new ListGrid();
	langsList.setCanEdit(false);
	langsList.setWidth100();
	langsList.setHeight100();
	langsList.setAutoFetchData(true);
	langsList.setDataSource(new LanguagesDS(false));
	langsList.setShowFilterEditor(true);
	langsList.setFilterOnKeypress(true);
	langsList.setSelectionType(SelectionStyle.SINGLE);
	langsList.setFields(enabled, code, name);

	languagesTabPanel.addMember(langsList);
	languagesTab.setPane(languagesTabPanel);

	if (Feature.enabled(Feature.INDEX_LANGUAGES))
		langsList.addCellContextClickHandler(new CellContextClickHandler() {
			@Override
			public void onCellContextClick(CellContextClickEvent event) {
				showLanguagesMenu();
				event.cancel();
			}
		});

	return languagesTab;
}
 
Example #28
Source File: InteractionWindow.java    From SensorWebClient with GNU General Public License v2.0 4 votes vote down vote up
public Layout getContent() {
	return content;
}
 
Example #29
Source File: InteractionWindow.java    From SensorWebClient with GNU General Public License v2.0 4 votes vote down vote up
public void setContent(Layout content) {
	this.content = content;
}
 
Example #30
Source File: LegendElement.java    From SensorWebClient with GNU General Public License v2.0 votes vote down vote up
public Layout getLayout();