List of usage examples for com.google.gwt.user.client.ui HasVerticalAlignment ALIGN_MIDDLE
VerticalAlignmentConstant ALIGN_MIDDLE
To view the source code for com.google.gwt.user.client.ui HasVerticalAlignment ALIGN_MIDDLE.
Click Source Link
From source file:com.google.gwt.sample.stockwatcher.client.ReportingPage.java
public ReportingPage() { Header.setHeaderTitle("Main Menu > Monitoring > Historical"); setHandlers();// w w w.j a va 2 s. c o m setWidgetContent(); basicFilterMenu.clear(); basicFilterMenu.setStyleName("mainStyle"); basicFilterMenu.addLabel("View Reading By"); basicFilterMenu.addItem(reportViewLB); basicFilterMenu.addLabel("Sort Reading By"); basicFilterMenu.addItem(reportSortLB); advancedFilterMenu.clear(); advancedFilterMenu.setStyleName("mainStyle"); advancedFilterMenu.setVisible(false); advancedFilterMenu.addLabel("Start date"); advancedFilterMenu.addItem(sDateBox); advancedFilterMenu.addLabel("End date"); advancedFilterMenu.addItem(eDateBox); advancedFilterMenu.addLabel("Prediction menu"); advancedFilterMenu.addItem(predictionBox); advancedFilterMenu.addLabel("Prediction", "Input steps"); advancedFilterMenu.addItem("Prediction", tb); advancedFilterMenu.addNewRow(refreshButton); advancedFilterMenu.hideGroup("Prediction"); VerticalPanel temp = new VerticalPanel(); temp.setSpacing(10); temp.add(filterBox); temp.add(advancedFilterMenu); filterPanel.clear(); filterPanel.add(temp); filterPanel.setStyleName("filterMenu"); VerticalPanel selectionPanel = new VerticalPanel(); selectionPanel.setStyleName("mainStyle"); selectionPanel.add(new HTML("<h2>Selection Menu</h2></br>")); selectionPanel.add(new HTML("Please select site:")); selectionPanel.add(siteListBox); selectionPanel.add(new HTML("Please select controller:")); selectionPanel.add(siteControllerListBox); selectionPanel.add(new HTML("Please select sensor:")); selectionPanel.add(controllerSensorListBox); selectionPanel.add(new HTML("<h3>Basic Filter Menu</h3></br>")); selectionPanel.add(basicFilterMenu); selectionPanel.add(goButton); selectionPanel.setSpacing(10); parameterPanel.clear(); parameterPanel.add(selectionPanel); parameterPanel.setHeight("100%"); parameterPanel.setStyleName("parameterPanel"); chartPanel.clear(); chartPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); chartPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); contentPanel.clear(); contentPanel.addLeft(parameterPanel); contentPanel.add(chartPanel); contentPanel.addRight(filterPanel); initWidget(contentPanel); }
From source file:com.google.gwt.sample.userwatcher.client.FileUploaderWidget_v2.java
/** * constructor//from w w w . ja v a 2 s .co m * * @param cp */ public FileUploaderWidget_v2(ClientPersistence cp) { this.cp = cp; HorizontalPanel hp = new HorizontalPanel(); hp.add(pUpload); pUpload.setWidth("100%"); hp.setCellWidth(pUpload, "100%"); hp.setCellHorizontalAlignment(pUpload, HasHorizontalAlignment.ALIGN_CENTER); hp.setCellVerticalAlignment(pUpload, HasVerticalAlignment.ALIGN_MIDDLE); hp.add(bCancel); hp.setCellHorizontalAlignment(bCancel, HasHorizontalAlignment.ALIGN_RIGHT); hp.setCellVerticalAlignment(bCancel, HasVerticalAlignment.ALIGN_MIDDLE); pWidget.add(hp); hp.setWidth("100%"); pWidget.setCellWidth(hp, "100%"); pWidget.add(pFullSize); pWidget.add(pThumb); initWidget(pWidget); pWidget.setWidth("100%"); //pWidget.addStyleName("test2"); //hp.addStyleName("test3"); //pFullSize.addStyleName("test3"); setup(); }
From source file:com.google.sampling.experiential.client.DailyPanel.java
License:Open Source License
public DailyPanel(SignalScheduleDAO schedule) { MyConstants myConstants = GWT.create(MyConstants.class); this.schedule = schedule; VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setSpacing(2);//from w w w . ja va2 s . c om verticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setSize("290px", "43px"); initWidget(verticalPanel); if (schedule.getScheduleType() == null || schedule.getScheduleType() == SignalScheduleDAO.DAILY) { RepeatEveryNPanel repeatWeeksPanel = new RepeatEveryNPanel(myConstants.repeatTypeDays(), schedule); verticalPanel.add(repeatWeeksPanel); repeatWeeksPanel.setWidth("239px"); } TimeListPanel timeListPanel = new TimeListPanel(schedule); verticalPanel.add(timeListPanel); timeListPanel.setWidth("286px"); TimeoutPanel timeoutPanel = new TimeoutPanel(schedule); verticalPanel.add(timeoutPanel); timeoutPanel.setWidth("286px"); SnoozePanel snoozePanel = new SnoozePanel(schedule); verticalPanel.add(snoozePanel); snoozePanel.setWidth("286px"); }
From source file:com.google.sampling.experiential.client.EsmPanel.java
License:Open Source License
public EsmPanel(final SignalScheduleDAO schedule) { MyConstants myConstants = GWT.create(MyConstants.class); this.schedule = schedule; VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setSpacing(2);/*from ww w . j av a 2 s . co m*/ initWidget(verticalPanel); HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setSpacing(2); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellVerticalAlignment(horizontalPanel, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setWidth(""); Label lblFrequency = new Label(myConstants.frequency() + ":"); lblFrequency.setStyleName("gwt-Label-Header"); horizontalPanel.add(lblFrequency); ValueSpinnerFixed frequencySpinner = new ValueSpinnerFixed(schedule.getEsmFrequency(), 0, 100); frequencySpinner.getTextBox().setWidth("18px"); frequencySpinner.setWidth("35px"); horizontalPanel.add(frequencySpinner); frequencySpinner.getSpinner().addSpinnerListener(new SpinnerListener() { public void onSpinning(long value) { schedule.setEsmFrequency((int) value); } }); Label lblPeriod = new Label(myConstants.period() + ": "); lblPeriod.setStyleName("gwt-Label-Header"); horizontalPanel.add(lblPeriod); final ListBox listBox = new ListBox(); for (int i = 0; i < SignalScheduleDAO.ESM_PERIODS.length; i++) { listBox.addItem(SignalScheduleDAO.ESM_PERIODS_NAMES[i]); } horizontalPanel.add(listBox); listBox.setVisibleItemCount(1); Integer period = schedule.getEsmPeriodInDays(); if (period == null) { period = SignalScheduleDAO.DEFAULT_ESM_PERIOD; schedule.setEsmPeriodInDays(SignalScheduleDAO.DEFAULT_ESM_PERIOD); } listBox.setSelectedIndex(period); listBox.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { schedule.setEsmPeriodInDays(listBox.getSelectedIndex()); } }); verticalPanel.add(horizontalPanel); HorizontalPanel weekendsPanel = new HorizontalPanel(); weekendsPanel.setSpacing(2); weekendsPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.add(weekendsPanel); weekendsPanel.setWidth(""); Label lblWeekends = new Label(myConstants.includeWeekends() + ": "); lblWeekends.setStyleName("gwt-Label-Header"); weekendsPanel.add(lblWeekends); final CheckBox weekendsBox = new CheckBox(""); weekendsPanel.add(weekendsBox); weekendsBox.setValue(schedule.getEsmWeekends()); weekendsBox.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { schedule.setEsmWeekends(weekendsBox.getValue()); } }); HorizontalPanel horizontalPanel_1 = new HorizontalPanel(); horizontalPanel_1.setSpacing(2); horizontalPanel_1.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.add(horizontalPanel_1); horizontalPanel_1.setWidth(""); Label lblStartHour = new Label(myConstants.startTime() + ":"); lblStartHour.setStyleName("gwt-Label-Header"); horizontalPanel_1.add(lblStartHour); lblStartHour.setWidth("83px"); Date setTime = null; if (schedule.getEsmStartHour() != null) { setTime = new Date(); long offset = schedule.getEsmStartHour(); int hours = (int) (offset / (60 * 60 * 1000)); int minutes = (int) (offset - (hours * 60 * 60 * 1000)) / (60 * 1000); setTime.setHours(hours); setTime.setMinutes(minutes); setTime.setSeconds(0); } else { Date now = new Date(); now.setMinutes(0); now.setSeconds(0); setTime = now; } final TimePickerFixed startTimeBox = new TimePickerFixed(setTime, DateTimeFormat.getFormat("aa"), DateTimeFormat.getFormat("hh"), DateTimeFormat.getFormat("mm"), null); horizontalPanel_1.add(startTimeBox); HorizontalPanel horizontalPanel_2 = new HorizontalPanel(); horizontalPanel_2.setSpacing(2); horizontalPanel_2.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.add(horizontalPanel_2); horizontalPanel_2.setWidth(""); startTimeBox.addValueChangeHandler(new ValueChangeHandler() { public void onValueChange(ValueChangeEvent event) { Date dateTime = startTimeBox.getDateTime(); long offset = (dateTime.getHours() * 60 * 60 * 1000) + (dateTime.getMinutes() * 60 * 1000); schedule.setEsmStartHour(offset); } }); Label lblEndTime = new Label(myConstants.endTime() + ": "); lblEndTime.setStyleName("gwt-Label-Header"); horizontalPanel_2.add(lblEndTime); lblEndTime.setWidth("83px"); setTime = null; if (schedule.getEsmEndHour() != null) { setTime = new Date(); long offset = schedule.getEsmEndHour(); int hours = (int) (offset / (60 * 60 * 1000)); int minutes = (int) (offset - (hours * 60 * 60 * 1000)) / (60 * 1000); setTime.setHours(hours); setTime.setMinutes(minutes); } else { Date now = new Date(); now.setMinutes(0); now.setSeconds(0); setTime = now; } final TimePickerFixed endTimePicker = new TimePickerFixed(setTime, DateTimeFormat.getFormat("aa"), DateTimeFormat.getFormat("hh"), DateTimeFormat.getFormat("mm"), null); horizontalPanel_2.add(endTimePicker); endTimePicker.addValueChangeHandler(new ValueChangeHandler() { public void onValueChange(ValueChangeEvent event) { Date dateTime = endTimePicker.getDateTime(); long offset = (dateTime.getHours() * 60 * 60 * 1000) + (dateTime.getMinutes() * 60 * 1000); schedule.setEsmEndHour(offset); } }); TimeoutPanel timeoutPanel = new TimeoutPanel(schedule); verticalPanel.add(timeoutPanel); timeoutPanel.setWidth("286px"); MinimumBufferPanel minimumBufferPanel = new MinimumBufferPanel(schedule); verticalPanel.add(minimumBufferPanel); minimumBufferPanel.setWidth("286px"); SnoozePanel snoozePanel = new SnoozePanel(schedule); verticalPanel.add(snoozePanel); snoozePanel.setWidth("286px"); }
From source file:com.google.sampling.experiential.client.ExperimentRow.java
License:Open Source License
public ExperimentRow(Images resources, ExperimentDAO experiment, ExperimentListener listener, boolean joined, boolean findView) { this.images = resources; this.myConstants = GWT.create(MyConstants.class); this.experiment = experiment; this.joined = joined; this.findView = findView; this.listeners = new ArrayList<ExperimentListener>(); if (listener != null) { listeners.add(listener);/*from ww w .j a va2 s .co m*/ } HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setStyleName("paco-experimentRow"); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setSpacing(1); horizontalPanel.setHeight("42px"); initWidget(horizontalPanel); Image experimentIcon = new Image(resources.question()); experimentIcon.setAltText(myConstants.experimentIcon()); horizontalPanel.add(experimentIcon); horizontalPanel.setCellHeight(experimentIcon, "42"); horizontalPanel.setCellWidth(experimentIcon, "42"); horizontalPanel.setCellHorizontalAlignment(experimentIcon, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel.setCellVerticalAlignment(experimentIcon, HasVerticalAlignment.ALIGN_BOTTOM); experimentIcon.setSize("42px", "42px"); VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setHeight("39px"); horizontalPanel.add(verticalPanel); HorizontalPanel horizontalPanel_2 = new HorizontalPanel(); horizontalPanel_2.setHeight("19px"); verticalPanel.add(horizontalPanel_2); Label experimentTitleLabel = new Label(experiment.getTitle()); if (experiment.getDeleted() != null && experiment.getDeleted()) { experimentTitleLabel.setStyleName("gwt-Link-underline-strikethrough"); } else { experimentTitleLabel.setStyleName("gwt-Link-underline"); } horizontalPanel_2.add(experimentTitleLabel); horizontalPanel_2.setCellWidth(experimentTitleLabel, "22px"); horizontalPanel_2.setCellHeight(experimentTitleLabel, "18px"); experimentTitleLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); horizontalPanel.setCellVerticalAlignment(experimentTitleLabel, HasVerticalAlignment.ALIGN_MIDDLE); experimentTitleLabel.setWidth("180px"); ClickHandler titleHandler = new ClickHandler() { public void onClick(ClickEvent event) { showExperimentDetails(); } }; if (!isExperimentPurged()) { experimentTitleLabel.addClickHandler(titleHandler); experimentIcon.addClickHandler(titleHandler); } HorizontalPanel horizontalPanel_1 = new HorizontalPanel(); horizontalPanel_1.setSpacing(1); verticalPanel.add(horizontalPanel_1); createButtonPanel(experiment, joined, horizontalPanel, horizontalPanel_1, findView); }
From source file:com.google.sampling.experiential.client.ExperimentRow.java
License:Open Source License
private void createDetailsButton(HorizontalPanel horizontalPanel, HorizontalPanel horizontalPanel_1) { Button copyButton = new Button(myConstants.copy()); copyButton.setStyleName("paco-ExperimentRow-Button"); copyButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { showExperimentDetails();//from w w w . ja v a 2 s. c om } }); horizontalPanel_1.add(copyButton); horizontalPanel.setCellVerticalAlignment(copyButton, HasVerticalAlignment.ALIGN_MIDDLE); }
From source file:com.google.sampling.experiential.client.ExperimentRow.java
License:Open Source License
private void createEodRefButton(HorizontalPanel horizontalPanel, HorizontalPanel horizontalPanel_1) { Button refButton = new Button(myConstants.eodRef()); refButton.setStyleName("paco-ExperimentRow-Button"); refButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { showRefDialog();// w w w.j av a2s .com } }); horizontalPanel_1.add(refButton); horizontalPanel.setCellVerticalAlignment(refButton, HasVerticalAlignment.ALIGN_MIDDLE); }
From source file:com.google.sampling.experiential.client.ExperimentRow.java
License:Open Source License
private void createQRCodeButton(HorizontalPanel horizontalPanel, HorizontalPanel horizontalPanel_1) { Button qrCodeButton = new Button(myConstants.qrCode()); qrCodeButton.setStyleName("paco-ExperimentRow-Button"); qrCodeButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { showQRCode();/*from ww w . j a va 2 s. co m*/ } }); horizontalPanel_1.add(qrCodeButton); horizontalPanel.setCellVerticalAlignment(qrCodeButton, HasVerticalAlignment.ALIGN_MIDDLE); }
From source file:com.google.sampling.experiential.client.ExperimentRow.java
License:Open Source License
private void createPurgeButton(HorizontalPanel horizontalPanel, HorizontalPanel horizontalPanel_1) { Button deleteButton = new Button(myConstants.purge()); deleteButton.setStyleName("paco-ExperimentRow-Button"); deleteButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { deleteExperiment();/* ww w . j a v a2 s .c o m*/ } }); horizontalPanel_1.add(deleteButton); horizontalPanel.setCellVerticalAlignment(deleteButton, HasVerticalAlignment.ALIGN_MIDDLE); }
From source file:com.google.sampling.experiential.client.ExperimentRow.java
License:Open Source License
private void createDeleteButton(ExperimentDAO experiment, HorizontalPanel horizontalPanel, HorizontalPanel horizontalPanel_1) { Button deleteButton = new Button( experiment.getDeleted() != null && experiment.getDeleted() ? myConstants.unHide() : myConstants.hide()); deleteButton.setStyleName("paco-ExperimentRow-Button"); deleteButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { softDeleteExperiment();// w ww . ja v a 2s.co m } }); horizontalPanel_1.add(deleteButton); horizontalPanel.setCellVerticalAlignment(deleteButton, HasVerticalAlignment.ALIGN_MIDDLE); }