Java Code Examples for com.google.gwt.user.client.ui.HTML

The following are top voted examples for showing how to use com.google.gwt.user.client.ui.HTML. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: EasyML   File: BaseWidget.java   View source code 6 votes vote down vote up
public BaseWidget(String text, String id) {
	this.label = new Label(text);
	p.setWidget(new HTML(text));
	p.getElement().getStyle().setZIndex(6);
	this.id = id;

	label.setStyleName("basewidget");
	label.setTitle(text);

	canvas = new GWTCanvas();
	abspanel.add(label, 0, 0);
	abspanel.add(canvas, 0, 0);
	focusPanel.add(abspanel.asWidget());
	focusPanel.setHeight("35px");
	focusPanel.setFocus(true);
	focusPanel.setStyleName("basefocuspanel");
	abspanel.setHeight("100%");
	initWidget(focusPanel);

	addDomHandler(this, MouseDownEvent.getType());
	addDomHandler(this, MouseUpEvent.getType());
	addDomHandler(this, MouseOverEvent.getType());
	addDomHandler(this, MouseOutEvent.getType());


}
 
Example 2
Project: unitimes   File: WebTable.java   View source code 6 votes vote down vote up
public IconCell(ImageResource resource, final String title, String text) {
	super(null);
	iIcon = new Image(resource);
	iIcon.setTitle(title);
	iIcon.setAltText(title);
	if (text != null && !text.isEmpty()) {
		iLabel = new HTML(text, false);
		iPanel = new HorizontalPanel();
		iPanel.setStyleName("icon");
		iPanel.add(iIcon);
		iPanel.add(iLabel);
		iIcon.getElement().getStyle().setPaddingRight(3, Unit.PX);
		iPanel.setCellVerticalAlignment(iIcon, HasVerticalAlignment.ALIGN_MIDDLE);
	}
	iIcon.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			event.stopPropagation();
			UniTimeConfirmationDialog.info(title);
		}
	});
}
 
Example 3
Project: unitimes   File: FilterBox.java   View source code 6 votes vote down vote up
public ChipPanel(Chip chip, String color) {
	iChip = chip;
	setStyleName("chip");
	addStyleName(color);
	iLabel = new Label(chip.getTranslatedValue());
	iLabel.setStyleName("text");
	add(iLabel);
	iButton = new HTML("×");
	iButton.setStyleName("button");
	add(iButton);
	if (chip.hasToolTip())
		setTitle(toString() + "\n" + chip.getToolTip());
	else
		setTitle(toString());
	Roles.getDocumentRole().setAriaHiddenState(getElement(), true);
}
 
Example 4
Project: unitimes   File: TimeGrid.java   View source code 6 votes vote down vote up
public BusyPanel(String text, int dayOfWeek, int startSlot, int length) {
	super();
	iText = text;
	iDayOfWeek = dayOfWeek;
	iStartSlot = startSlot;
	iLength = length;
	if (iText != null || !iText.isEmpty()) {
		setTitle(iText);
		boolean empty = true;
		for (int i = 0; i < 3; i++) {
			if (iMeetingTable[iDayOfWeek].length <= iStartSlot + i) { empty = false; break; }
			if (iMeetingTable[iDayOfWeek][iStartSlot + i] != null && !iMeetingTable[iDayOfWeek][iStartSlot + i].isEmpty()) {
				empty = false; break;
			}
		}
		if (empty) {
			HTML widget = new HTML(text, false);
			widget.setStyleName("text");
			setWidget(widget);
		}
	}
	setStyleName("busy");
	getElement().getStyle().setWidth(iCellWidth + (iPrint ? 3 : iDayOfWeek + 1 < iNrDays ? 3 : 0), Unit.PX);
	getElement().getStyle().setHeight(125 * iLength / 30, Unit.PX);
	iGrid.insert(this, iCellWidth * iDayOfWeek, 125 * iStartSlot / 30 - 50 * iStart, 1);
}
 
Example 5
Project: sig-seguimiento-vehiculos   File: InfoProjectTool.java   View source code 6 votes vote down vote up
private void showDialog(final HTML htmlReport) {
	final Dialog simple = new Dialog();
	simple.setHeadingText(project.getTitle());
	simple.setSize("420px", "420px");
	simple.setResizable(true);
	simple.setHideOnButtonClick(true);
	simple.setPredefinedButtons(PredefinedButton.CLOSE);
	simple.setBodyStyleName("pad-text");
	simple.getBody().addClassName("pad-text");
	simple.add(getPanel(htmlReport));
	simple.addButton(new TextButton(UIMessages.INSTANCE.download(),
			new SelectHandler() {
				@Override
				public void onSelect(SelectEvent event) {
					FileExporter.saveAs(htmlReport.getHTML(),
							project.getTitle() + ".html");
				}
			}));
	simple.show();
}
 
Example 6
Project: sig-seguimiento-vehiculos   File: WmsGetInfoTool.java   View source code 6 votes vote down vote up
private void showDialog(final HTML info) {
	final Dialog simple = new Dialog();
	simple.setHeadingText(UIMessages.INSTANCE.wmsInfo());
	HorizontalLayoutContainer container = new HorizontalLayoutContainer();
	container.setScrollMode(ScrollMode.AUTO);
	container.setSize("280px", "180px");

	container.add(replaceHref(info));
	simple.setSize("300px", "200px");
	simple.setResizable(true);
	simple.setHideOnButtonClick(true);
	simple.setPredefinedButtons(PredefinedButton.CLOSE);
	simple.setBodyStyleName("pad-text");
	simple.getBody().addClassName("pad-text");

	simple.add(container);

	simple.show();
}
 
Example 7
Project: sig-seguimiento-vehiculos   File: HtmlReportLayerTool.java   View source code 6 votes vote down vote up
private void showDialog(final HTML htmlReport) {
	final Dialog simple = new Dialog();
	simple.setHeadingText("GeoWe Report");
	simple.setSize("420px", "420px");
	simple.setResizable(true);
	simple.setHideOnButtonClick(true);
	simple.setPredefinedButtons(PredefinedButton.CLOSE);
	simple.setBodyStyleName("pad-text");
	simple.getBody().addClassName("pad-text");
	simple.add(getPanel(htmlReport));
	simple.addButton(new TextButton(UIMessages.INSTANCE.download(),
			new SelectHandler() {
				@Override
				public void onSelect(SelectEvent event) {
					FileExporter.saveAs(htmlReport.getHTML(),
							getSelectedVectorLayer().getName() + ".html");
				}
			}));
	simple.show();
}
 
Example 8
Project: sig-seguimiento-vehiculos   File: LayerManagerWidget.java   View source code 6 votes vote down vote up
private VerticalPanel getFoot() {
	slider.setWidth("290px");
	slider.disable();
	slider.setIncrement(1);

	slider.addValueChangeHandler(new ValueChangeHandler<Integer>() {

		@Override
		public void onValueChange(final ValueChangeEvent<Integer> event) {
			final Layer layer = getSelectedLayer(getSelectedTabName());
			layer.setOpacity((float) (event.getValue().intValue() / 100.0));
		}

	});

	final VerticalPanel panel = new VerticalPanel();
	panel.setWidth("300px");
	panel.addStyleName(ThemeStyles.get().style().borderTop());
	panel.add(new HTML(UIMessages.INSTANCE.lmOpacityHtmlLabel()));
	panel.add(slider);

	panel.add(statusBar);
	return panel;
}
 
Example 9
Project: calendar-component   File: SimpleDayCell.java   View source code 6 votes vote down vote up
public SimpleDayCell(VCalendar calendar, int row, int cell) {
    this.calendar = calendar;
    this.row = row;
    this.cell = cell;
    setStylePrimaryName("v-calendar-month-day");
    caption = new Label();
    caption.setStyleName("v-calendar-day-number");
    caption.addMouseDownHandler(this);
    caption.addMouseUpHandler(this);
    add(caption);

    bottomspacer = new HTML();
    bottomspacer.setStyleName("v-calendar-bottom-spacer-empty");
    bottomspacer.setWidth(3 + "em");
    add(bottomspacer);
}
 
Example 10
Project: appinventor-extensions   File: GalleryPage.java   View source code 6 votes vote down vote up
/**
 * Helper method called by constructor to initialize the report section
 */
private void initAppShare() {
  final HTML sharePrompt = new HTML();
  sharePrompt.setHTML(MESSAGES.gallerySharePrompt());
  sharePrompt.addStyleName("primary-prompt");
  final TextBox urlText = new TextBox();
  urlText.addStyleName("action-textbox");
  urlText.setText(Window.Location.getHost() + MESSAGES.galleryGalleryIdAction() + app.getGalleryAppId());
  urlText.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      urlText.selectAll();
    }
  });
  appSharePanel.add(sharePrompt);
  appSharePanel.add(urlText);
}
 
Example 11
Project: appinventor-extensions   File: AssetList.java   View source code 6 votes vote down vote up
private void refreshAssetList() {
  OdeLog.log("AssetList: refreshing for project " + projectId);
  assetList.clear();

  if (assetsFolder != null) {
    for (ProjectNode node : assetsFolder.getChildren()) {
      // Add the name to the tree. We need to enclose it in a span
      // because the CSS style for selection specifies a span.
      String nodeName = node.getName();
      if (nodeName.length() > 20)
        nodeName = nodeName.substring(0, 8) + "..." + nodeName.substring(nodeName.length() - 9,
            nodeName.length());
      TreeItem treeItem = new TreeItem(
          new HTML("<span>" + nodeName + "</span>"));
      // keep a pointer from the tree item back to the actual node
      treeItem.setUserObject(node);
      assetList.addItem(treeItem);
    }
  }
}
 
Example 12
Project: appinventor-extensions   File: YoungAndroidFormUpgrader.java   View source code 6 votes vote down vote up
private static void upgradeWarnDialog(String aMessage) {
  final DialogBox dialogBox = new DialogBox(false, true);
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.warningDialogTitle());
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  final HTML message = new HTML(aMessage);
  message.setStyleName("DialogBox-message");
  VerticalPanel vPanel = new VerticalPanel();
  Button okButton = new Button("OK");
  okButton.addClickListener(new ClickListener() {
      @Override
      public void onClick(Widget sender) {
        dialogBox.hide();
      }
    });
  vPanel.add(message);
  vPanel.add(okButton);
  dialogBox.setWidget(vPanel);
  dialogBox.center();
  dialogBox.show();
}
 
Example 13
Project: appinventor-extensions   File: OdeLog.java   View source code 6 votes vote down vote up
/**
 * Creates a new output panel for displaying internal messages.
 */
private OdeLog() {
  // Initialize UI
  Button clearButton = new Button(MESSAGES.clearButton());
  clearButton.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      clear();
    }
  });

  text = new HTML();
  text.setWidth("100%");

  VerticalPanel panel = new VerticalPanel();
  panel.add(clearButton);
  panel.add(text);
  panel.setSize("100%", "100%");
  panel.setCellHeight(text, "100%");
  panel.setCellWidth(text, "100%");

  initWidget(panel);
}
 
Example 14
Project: appinventor-extensions   File: BlockSelectorBox.java   View source code 6 votes vote down vote up
/**
 * Constructs a tree item for built-in blocks.
 *
 * @return tree item
 */
public TreeItem getBuiltInBlocksTree() {
  initBundledImages();
  TreeItem builtinNode = new TreeItem(new HTML("<span>" + MESSAGES.builtinBlocksLabel()
      + "</span>"));
  for (final String drawerName : BUILTIN_DRAWER_NAMES) {
    Image drawerImage = new Image(bundledImages.get(drawerName));
    TreeItem itemNode = new TreeItem(new HTML("<span>" + drawerImage
        + getBuiltinDrawerNames(drawerName) + "</span>"));
    SourceStructureExplorerItem sourceItem = new BlockSelectorItem() {
      @Override
      public void onSelected() {
        fireBuiltinDrawerSelected(drawerName);
      }
    };
    itemNode.setUserObject(sourceItem);
    builtinNode.addItem(itemNode);
  }
  builtinNode.setState(true);
  return builtinNode;
}
 
Example 15
Project: appinventor-extensions   File: BlockSelectorBox.java   View source code 6 votes vote down vote up
/**
 * Constructs a tree item for generic ("Advanced") component blocks for
 * component types that appear in form.
 *
 * @param form
 *          only component types that appear in this Form will be included
 * @return tree item for this form
 */
public TreeItem getGenericComponentsTree(MockForm form) {
  Map<String, String> typesAndIcons = Maps.newHashMap();
  form.collectTypesAndIcons(typesAndIcons);
  TreeItem advanced = new TreeItem(new HTML("<span>" + MESSAGES.anyComponentLabel() + "</span>"));
  List<String> typeList = new ArrayList<String>(typesAndIcons.keySet());
  Collections.sort(typeList);
  for (final String typeName : typeList) {
    TreeItem itemNode = new TreeItem(new HTML("<span>" + typesAndIcons.get(typeName)
        + MESSAGES.textAnyComponentLabel()
        + ComponentsTranslation.getComponentName(typeName) + "</span>"));
    SourceStructureExplorerItem sourceItem = new BlockSelectorItem() {
      @Override
      public void onSelected() {
        fireGenericDrawerSelected(typeName);
      }
    };
    itemNode.setUserObject(sourceItem);
    advanced.addItem(itemNode);
  }
  return advanced;
}
 
Example 16
Project: appinventor-extensions   File: StatusPanel.java   View source code 6 votes vote down vote up
/**
   * Initializes and assembles all UI elements shown in the status panel.
   */
  public StatusPanel() {
    HorizontalPanel hpanel = new HorizontalPanel();
    hpanel.setWidth("100%");
    hpanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    String tosUrl = Ode.getInstance().getSystemConfig().getTosUrl();
    if (!Strings.isNullOrEmpty(tosUrl)) {
      String appInventorFooter =
          "<a href=\"" + tosUrl + "\" target=\"_blank\">" + MESSAGES.privacyTermsLink() + "</a>";
      hpanel.add(new HTML(appInventorFooter));
    }

    // This shows the git version and the date of the build
//    String version = GitBuildId.getVersion();
//    String date = GitBuildId.getDate();
//    if (version != null && date != null) {
//      Label buildId = new Label(MESSAGES.gitBuildId(date, version));
//      hpanel.add(buildId);
//      hpanel.setCellHorizontalAlignment(buildId, HorizontalPanel.ALIGN_RIGHT);
//    }

    initWidget(hpanel);
    setStyleName("ode-StatusPanel");
  }
 
Example 17
Project: appinventor-extensions   File: Ode.java   View source code 6 votes vote down vote up
/**
 * The "Final" Dialog box. When a user chooses to end their session
 * due to a conflicting login, we should show this dialog which is modal
 * and has no exit! My preference would have been to close the window
 * altogether, but the browsers won't let javascript code close windows
 * that it didn't open itself (like the main window). I also tried to
 * use document.write() to write replacement HTML but that caused errors
 * in Firefox and strange behavior in Chrome. So we do this...
 *
 * We are called from invalidSessionDialog() (above).
 */
private void finalDialog() {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.finalDialogText());
  dialogBox.setHeight("100px");
  dialogBox.setWidth("400px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(MESSAGES.finalDialogMessage());
  message.setStyleName("DialogBox-message");
  DialogBoxContents.add(message);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 18
Project: appinventor-extensions   File: Ode.java   View source code 6 votes vote down vote up
/**
 * corruptionDialog -- Put up a dialog box explaining that we detected corruption
 * while reading in a project file. There is no continuing once this happens.
 *
 */
void corruptionDialog() {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.corruptionDialogText());
  dialogBox.setHeight("100px");
  dialogBox.setWidth("400px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(MESSAGES.corruptionDialogMessage());
  message.setStyleName("DialogBox-message");
  DialogBoxContents.add(message);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 19
Project: appinventor-extensions   File: Ode.java   View source code 6 votes vote down vote up
/**
 * This dialog is showned if an account is disabled. It is
 * completely modal with no escape. The provided URL is displayed in
 * an iframe, so it can be tailored to each person whose account is
 * disabled.
 *
 * @param Url the Url to display in the dialog box.
 */

public void disabledAccountDialog(String Url) {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.accountDisabledMessage());
  dialogBox.setHeight("700px");
  dialogBox.setWidth("700px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML("<iframe src=\"" + Url + "\" style=\"border: 0; width: 680px; height: 660px;\"></iframe>");
  message.setStyleName("DialogBox-message");
  DialogBoxContents.add(message);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 20
Project: LAS   File: ComparisonAxisSelector.java   View source code 6 votes vote down vote up
public ComparisonAxisSelector(String width) {
        // The the other widgets have flextable layouts.  Without it, this one doesn't line up.
		layout = new FlexTable();
		axes = new ListBox();
		flex = new FlexTable();
		// It looks funny without some sort of label on the same line.
		HTML html = new HTML("Axis: ");
		flex.setWidget(0, 0, html);
		flex.setWidget(0, 1, axes);
		disPanel = new DisclosurePanel("Compare");
		disPanel.add(flex);
		disPanel.setOpen(true);
		
//		if ( width != null && !width.equals("") ) {
//		    disPanel.setWidth(width);
//		}
		layout.setWidget(0, 0, disPanel);
		initWidget(layout);
	}
 
Example 21
Project: LAS   File: ColumnEditorWidget.java   View source code 6 votes vote down vote up
private void turnOffRow(int row) {
    CellFormatter formatter = datatable.getCellFormatter();
    int dataRow = row - headerRows;
    
    
    String[] oldnew = dirtyrows.get(row);
    HTML html = new HTML(oldnew[0]);
    html.setTitle(oldnew[0]);
    int width = headertable.getWidget(0, 1).getOffsetWidth();
    html.setWidth(width+"px");
    // Put the old value back in the data structure used to make the JSON payload.
    List<String[]> affectedrow = allrows.get(ids.getValue());
    String[] parts = affectedrow.get(dataRow);
    for (int i = 0; i < parts.length; i++) {
        if ( headers[i].contains("WOCE") ) {
            parts[i] = oldnew[0];                        
        }
    }
    formatter.removeStyleName(row, 1, "dirty");
    datatable.setWidget(row, 1, html);
  
    
    
}
 
Example 22
Project: LAS   File: ColumnEditorWidget.java   View source code 6 votes vote down vote up
@Override
public void onResponseReceived(Request request, Response response) {
    String text = response.getText();
    PopupPanel popup = new PopupPanel(true);
    popup.add(new HTML("<strong>Saved edits for:<p></p></strong>"+text+"<p></p>Click outside box to dismiss."));
    popup.setPopupPosition(200, Window.getClientHeight()/3);
    popup.show();
    CellFormatter formatter = datatable.getCellFormatter();
    for (Iterator dirtyIt = dirtyrows.keySet().iterator(); dirtyIt.hasNext();) {
        Integer widgetrow = (Integer) dirtyIt.next();
        for (int i = 0; i < headers.length; i++) {
            formatter.removeStyleName(widgetrow, i, "dirty");
        }
        
        CheckBox box = (CheckBox) datatable.getWidget(widgetrow, 0);
        box.setValue(false);
    }
    dirtyrows.clear();
}
 
Example 23
Project: LAS   File: ColumnEditorWidget.java   View source code 6 votes vote down vote up
/**
 * Set the column headers.
 * 
 */
private void setHeaders() {
    CellFormatter cellFormatter = headertable.getCellFormatter();
    headertable.setWidget(0, 0, new HTML(""));
    int column = 0;
    for (int p = 0; p < headers.length; p++) {
        if ( headers[p].startsWith("\"")) headers[p] = headers[p].substring(1, headers[p].length());
        if ( headers[p].endsWith("\"")) headers[p] = headers[p].substring(0,headers[p].length()-1);
        if ( headers[p].endsWith("_")) headers[p] = headers[p].substring(0, headers[p].length()-1);
        if ( headers[p].toLowerCase().equals(wocevar.toLowerCase()) ) {
            headertable.setWidget(0, 1, new HTML(headers[p]));
            cellFormatter.addStyleName(0, 1, "nowrap");
        } else if (headers[p].toLowerCase().equals(datavar.toLowerCase()) ) {
            headertable.setWidget(0, 2, new HTML(headers[p]));
            cellFormatter.addStyleName(0, 2, "nowrap");
        } else {
            headertable.setWidget(0, column + columnOffset, new HTML(headers[p]));
            cellFormatter.addStyleName(0, column + columnOffset, "nowrap");
            column++;
        }
    }
    headertable.setWidget(0, 0, allNone);
    RowFormatter formatter = headertable.getRowFormatter();
    formatter.addStyleName(0, "nowrap");
}
 
Example 24
Project: LAS   File: DropDown.java   View source code 6 votes vote down vote up
public DropDown() {
    current = new FlexTable();
    current.addStyleName("datatable");
    itemlist = new FlexTable();
    dropdown = new PopupPanel(true);
    scroller = new ScrollPanel();
    scroller.add(itemlist);
    dropdown.add(scroller);
    down =new HTML(" &#9660;");
    down.addStyleName("current-item");
    initWidget(current);
    HTML load = new HTML("loading...");
    load.addStyleName("current-item");
    current.setWidget(0, 0, load);
    current.setWidget(0, 1, down);
    current.addClickHandler(show);
}
 
Example 25
Project: mentor   File: CourseView.java   View source code 6 votes vote down vote up
private CourseView() {
	
	MaterialRow row = new MaterialRow();
		MaterialColumn tocColumn = new MaterialColumn();
		tocColumn.setGrid("l2");
		tocColumn.setHideOn(HideOn.HIDE_ON_MED_DOWN);
			toc = new MaterialScrollspy();
			toc.addStyleName(ApplicationShell.res().style().toc());
		tocColumn.add(toc);
			HTML dummy = new HTML("&nbsp;");	// for column to survive pinning of TOC
		tocColumn.add(dummy);
	row.add(tocColumn);
		MaterialColumn lecturesColumn = new MaterialColumn();
		lecturesColumn.setGrid("s12 m12 l8");
			courseBanner = new CourseBanner();
		lecturesColumn.add(courseBanner);
			lecturesContainer = new MaterialPanel();
		lecturesColumn.add(lecturesContainer);
	row.add(lecturesColumn);
	add(row);
	
	MaterialPushpin.apply(toc, 64.0, 0.0);
	
}
 
Example 26
Project: mentor   File: LectureView.java   View source code 6 votes vote down vote up
private LectureView() {

		MaterialRow row = new MaterialRow();
			MaterialColumn tocColumn = new MaterialColumn();
			tocColumn.setGrid("l2");
			tocColumn.setHideOn(HideOn.HIDE_ON_MED_DOWN);
				toc = new MaterialScrollspy();
				toc.addStyleName(ApplicationShell.res().style().toc());
			tocColumn.add(toc);
				HTML dummy = new HTML("&nbsp;");	// for column to survive pinning of TOC
			tocColumn.add(dummy);
		row.add(tocColumn);
			MaterialColumn unitsColumn = new MaterialColumn();
			unitsColumn.setGrid("s12 m12 l8");
				lectureBanner = new LectureBanner();
			unitsColumn.add(lectureBanner);
				unitsContainer = new MaterialPanel();
			unitsColumn.add(unitsContainer);
		row.add(unitsColumn);
		add(row);
		
		MaterialPushpin.apply(toc, 64.0, 0.0);
		
	}
 
Example 27
Project: mentor   File: ImageUnitWidget.java   View source code 6 votes vote down vote up
public ImageUnitWidget(ImageUnit unit) {

		super();
		
		MaterialColumn imageColumn = new MaterialColumn();
		imageColumn.setGrid("s12");
		imageColumn.setTextAlign(TextAlign.CENTER);
			image = new MaterialImage();
		imageColumn.add(image);
		getContentRow().add(imageColumn);

		captionColumn = new MaterialColumn();
		captionColumn.setGrid("s12");
		captionColumn.setTextAlign(TextAlign.CENTER);
			caption = new HTML();
			caption.addStyleName(res.style().caption());
		captionColumn.add(caption);
		getContentRow().add(captionColumn);

		if (unit != null)
			setUnit(unit);
		
	}
 
Example 28
Project: document-management-system   File: HelloWorld.java   View source code 6 votes vote down vote up
public HelloWorld() {
	HTML html = new HTML("Hello Word");
	refresh = new Button("refresh UI");
	refresh.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			GeneralComunicator.refreshUI();
		}
	});

	vPanel = new VerticalPanel();
	vPanel.add(html);
	vPanel.add(refresh);

	refresh.setStyleName("okm-Input");

	initWidget(vPanel);
}
 
Example 29
Project: document-management-system   File: DebugConsolePopup.java   View source code 6 votes vote down vote up
/**
 * Logout popup
 */
public DebugConsolePopup() {
	// Establishes auto-close when click outside
	super(false, false);

	setText(Main.i18n("debug.console.label"));
	vPanel = new VerticalPanel();
	button = new Button(Main.i18n("button.close"), this);
	text = new HTML(Main.i18n("debug.enable.disable"));

	vPanel.add(new HTML("<br>"));
	vPanel.add(text);
	vPanel.add(Log.getLogger(DivLogger.class).getWidget());
	vPanel.add(new HTML("<br>"));
	vPanel.add(button);
	vPanel.add(new HTML("<br>"));

	vPanel.setCellHorizontalAlignment(button, VerticalPanel.ALIGN_CENTER);

	button.setStyleName("okm-YesButton");

	super.hide();
	Log.getLogger(DivLogger.class).getWidget().setVisible(true);
	setWidget(vPanel);
}
 
Example 30
Project: document-management-system   File: LogoutPopup.java   View source code 6 votes vote down vote up
/**
 * Logout popup
 */
public LogoutPopup() {
	// Establishes auto-close when click outside
	super(false, true);

	vPanel = new VerticalPanel();
	text = new HTML(Main.i18n("logout.logout"));
	button = new Button(Main.i18n("button.close"), this);

	vPanel.setWidth("250px");
	vPanel.setHeight("100px");

	vPanel.add(new HTML("<br>"));
	vPanel.add(text);
	vPanel.add(new HTML("<br>"));
	vPanel.add(button);
	vPanel.add(new HTML("<br>"));

	vPanel.setCellHorizontalAlignment(text, VerticalPanel.ALIGN_CENTER);
	vPanel.setCellHorizontalAlignment(button, VerticalPanel.ALIGN_CENTER);

	button.setStyleName("okm-YesButton");

	super.hide();
	setWidget(vPanel);
}
 
Example 31
Project: document-management-system   File: WorkflowWidget.java   View source code 6 votes vote down vote up
/**
 * WorkflowWidget
 */
public WorkflowWidget(String name, String uuid, WorkflowWidgetToFire workflowWidgetToFire, Map<String, Object> workflowVariables) {
	this.name = name;
	this.uuid = uuid;
	this.workflowWidgetToFire = workflowWidgetToFire;
	this.workflowVariables = workflowVariables;
	drawed = false;

	vPanel = new VerticalPanel();
	hPanel = new HorizontalPanel();
	manager = new FormManager();

	vPanel.setWidth("300px");
	vPanel.setHeight("50px");

	vPanel.add(new HTML("<br>"));
	vPanel.add(manager.getTable());
	vPanel.add(new HTML("<br>"));

	vPanel.setCellHorizontalAlignment(hPanel, VerticalPanel.ALIGN_CENTER);

	initWidget(vPanel);
}
 
Example 32
Project: document-management-system   File: Status.java   View source code 6 votes vote down vote up
/**
 * The status
 */
public Status() {
	super(false, true);
	hPanel = new HorizontalPanel();
	image = new Image(OKMBundleResources.INSTANCE.indicator());
	msg = new HTML("");
	space = new HTML("");

	hPanel.add(image);
	hPanel.add(msg);
	hPanel.add(space);

	hPanel.setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellVerticalAlignment(msg, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
	hPanel.setCellWidth(image, "30px");
	hPanel.setCellWidth(space, "7px");

	hPanel.setHeight("25px");

	msg.setStyleName("okm-NoWrap");

	super.hide();
	setWidget(hPanel);
}
 
Example 33
Project: document-management-system   File: WidgetUtil.java   View source code 6 votes vote down vote up
/**
 * Draws a tag cloud
 */
public static void drawTagCloud(final TagCloud keywordsCloud, Collection<String> keywords) {
	// Deletes all tag clouds keys
	keywordsCloud.clear();
	keywordsCloud.setMinFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMinFrequency());
	keywordsCloud.setMaxFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMaxFrequency());

	for (Iterator<String> it = keywords.iterator(); it.hasNext(); ) {
		String keyword = it.next();
		HTML tagKey = new HTML(keyword);
		tagKey.setStyleName("okm-cloudTags");
		Style linkStyle = tagKey.getElement().getStyle();
		int fontSize = keywordsCloud.getLabelSize(Main.get().mainPanel.dashboard.keyMapDashboard.getKeywordRate(keyword));
		linkStyle.setProperty("fontSize", fontSize + "pt");
		linkStyle.setProperty("color", keywordsCloud.getColor(fontSize));
		if (fontSize > 0) {
			linkStyle.setProperty("top", (keywordsCloud.getMaxFontSize() - fontSize) / 2 + "px");
		}
		keywordsCloud.add(tagKey);
	}
}
 
Example 34
Project: document-management-system   File: Status.java   View source code 6 votes vote down vote up
/**
 * Status
 */
public Status() {
	super(false, true);
	hPanel = new HorizontalPanel();
	image = new Image(OKMBundleResources.INSTANCE.indicator());
	msg = new HTML("");
	space = new HTML("");

	hPanel.add(image);
	hPanel.add(msg);
	hPanel.add(space);

	hPanel.setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellVerticalAlignment(msg, HasAlignment.ALIGN_MIDDLE);
	hPanel.setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
	hPanel.setCellWidth(image, "30px");
	hPanel.setCellWidth(space, "7px");

	hPanel.setHeight("25px");

	msg.setStyleName("okm-NoWrap");

	super.hide();
	setWidget(hPanel);
}
 
Example 35
Project: gwt-cs   File: Tiles3DPointCloud.java   View source code 6 votes vote down vote up
@Override
public void buildPanel() {
    final ViewerPanel csVPanel = new ViewerPanel();

    Cesium3DTileset tileset = csVPanel.getViewer().scene().primitives().add(Cesium3DTileset.create("https://beta.cesium.com/api/assets/1460?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyMzk2YzJiOS1jZGFmLTRlZmYtYmQ4MS00NTA3NjEwMzViZTkiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjBdLCJpYXQiOjE0OTkyNjQ3NTV9.oWjvN52CRQ-dk3xtvD4e8ZnOHZhoWSpJLlw115mbQJM"));

    tileset.readyPromise().then(new Fulfill<Cesium3DTileset>() {
        @Override
        public void onFulfilled(Cesium3DTileset value) {
            BoundingSphere boundingSphere = value.boundingSphere();
            csVPanel.getViewer().camera.viewBoundingSphere(boundingSphere, new org.cesiumjs.cs.core.HeadingPitchRange(0.0, -0.5, boundingSphere.radius));
            csVPanel.getViewer().camera.lookAtTransform(Matrix4.IDENTITY());
        }
    });

    contentPanel.add(new HTML("<p>Example styles for a point cloud tileset.</p>"));
    contentPanel.add(csVPanel);

    initWidget(contentPanel);
}
 
Example 36
Project: gwt-cs   File: GoogleEarthEnterprise.java   View source code 6 votes vote down vote up
@Override
public void buildPanel() {
    GoogleEarthEnterpriseMetadata geeMetadata = GoogleEarthEnterpriseMetadata.create("http://www.earthenterprise.org/3d");

    ViewerOptions options = new ViewerOptions();
    options.imageryProvider = GoogleEarthEnterpriseImageryProvider.create(geeMetadata);
    options.terrainProvider = GoogleEarthEnterpriseTerrainProvider.create(geeMetadata);
    options.baseLayerPicker = false;
    ViewerPanel csVPanel = new ViewerPanel(options);

    ViewOptions viewOptions = new ViewOptions();
    viewOptions.destinationRec = Rectangle.fromDegrees(-123.0, 36.0, -121.7, 39.0);
    csVPanel.getViewer().camera.setView(viewOptions);

    contentPanel.add(new HTML("<p>Add imagery from a Web Map Service (WMS) server.</p>"));
    contentPanel.add(csVPanel);

    initWidget(contentPanel);
}
 
Example 37
Project: gwt-cs   File: GeoJSONsimplestyle.java   View source code 6 votes vote down vote up
@Override
public void buildPanel() {
    ViewerOptions viewerOptions = new ViewerOptions();
    viewerOptions.sceneMode = SceneMode.SCENE2D();
    viewerOptions.timeline = false;
    viewerOptions.animation = false;
    csVPanel = new ViewerPanel(viewerOptions);

    Promise<GeoJsonDataSource, String> dataSource = GeoJsonDataSource.load(GWT.getModuleBaseURL() + "SampleData/simplestyles.geojson");
    csVPanel.getViewer().dataSources().add(dataSource);
    dataSource.then(new Fulfill<GeoJsonDataSource>() {
        @Override
        public void onFulfilled(GeoJsonDataSource value) {
            csVPanel.getViewer().zoomTo(value);
        }
    });

    contentPanel.add(new HTML("<p>Load GeoJSON with simplestyle information.</p>"));
    contentPanel.add(csVPanel);

    initWidget(contentPanel);
}
 
Example 38
Project: gwt-cs   File: Tiles3DInterior.java   View source code 6 votes vote down vote up
@Override
public void buildPanel() {
    ViewerPanel csVPanel = new ViewerPanel();

    csVPanel.getViewer().scene().primitives().add(Cesium3DTileset.create("https://beta.cesium.com/api/assets/1463?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI5ZGExZTdmMS0xZjA5LTQxODAtOThmYi04MWU1YjZkMWZjNjgiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjNdLCJpYXQiOjE0OTkyNzYwNzV9.eTEtaAEBUehNIZushZQnp0On9BPRtZYS7XEWFwneSRU"));

    Cartesian3 initialPosition = new Cartesian3(-1111583.3721328347, -5855888.151574568, 2262561.444696748);
    org.cesiumjs.cs.core.HeadingPitchRoll initialOrientation = org.cesiumjs.cs.core.HeadingPitchRoll.fromDegrees(100.0, -15.0, 0.0);
    ViewOptions viewOptions = new ViewOptions();
    viewOptions.destinationPos = initialPosition;
    viewOptions.orientation = initialOrientation;
    viewOptions.endTransform = Matrix4.IDENTITY();
    csVPanel.getViewer().scene().camera().setView(viewOptions);

    contentPanel.add(new HTML("<p>A sample interior rendered with 3D Tiles.</p>"));
    contentPanel.add(csVPanel);

    initWidget(contentPanel);
}
 
Example 39
Project: gwt-cs   File: CesiumNavigation.java   View source code 6 votes vote down vote up
@Override
public void buildPanel() {
    ViewerCesiumNavigationMixinOptions options = new ViewerCesiumNavigationMixinOptions();
    options.defaultResetView = Rectangle.fromDegrees(71, 3, 90, 14);
    options.enableCompass = true;
    options.enableZoomControls = true;
    options.enableDistanceLegend = true;
    options.enableCompassOuterRing = true;

    ViewerPanel csVPanel = new ViewerPanel();
    csVPanel.getViewer().extend(viewerCesiumNavigationMixin.instance(), options);

    contentPanel.add(new HTML("<p>Use CesiumNavigation plugin with GWT wrapper.</p>"));
    contentPanel.add(csVPanel);

    initWidget(contentPanel);
}
 
Example 40
Project: gwt-cs   File: Tiles3DInspector.java   View source code 6 votes vote down vote up
@Override
public void buildPanel() {
    final ViewerPanel csVPanel = new ViewerPanel();

    csVPanel.getViewer().extend(viewerCesium3DTilesInspectorMixin.instance());

    Cesium3DTileset tileset = csVPanel.getViewer().scene().primitives().add(Cesium3DTileset.create("https://beta.cesium.com/api/assets/1461?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkYWJmM2MzNS02OWM5LTQ3OWItYjEyYS0xZmNlODM5ZDNkMTYiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjFdLCJpYXQiOjE0OTkyNjQ3NDN9.vuR75SqPDKcggvUrG_vpx0Av02jdiAxnnB1fNf-9f7s"));
    csVPanel.getViewer().cesium3DTilesInspector.viewModel.tileset = tileset;

    tileset.readyPromise().then(new Fulfill<Cesium3DTileset>() {
        @Override
        public void onFulfilled(Cesium3DTileset value) {
            BoundingSphere boundingSphere = value.boundingSphere();
            csVPanel.getViewer().camera.viewBoundingSphere(boundingSphere, new org.cesiumjs.cs.core.HeadingPitchRange(0.0, -0.5, boundingSphere.radius / 4.0));
            csVPanel.getViewer().camera.lookAtTransform(Matrix4.IDENTITY());
        }
    });

    contentPanel.add(new HTML("<p>Use the 3D Tiles inspector as a debugging tool for different tilesets.</p>"));
    contentPanel.add(csVPanel);

    initWidget(contentPanel);
}