Java Code Examples for com.google.gwt.user.client.ui.HorizontalPanel#setSpacing()

The following examples show how to use com.google.gwt.user.client.ui.HorizontalPanel#setSpacing() . 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: BasicToolBar.java    From geowe-core with GNU General Public License v3.0 6 votes vote down vote up
private void initializew3wPanel() {
	w3wPanel = new HorizontalPanel();
	w3wPanel.setSpacing(5);
	w3wPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
	StyleInjector.inject(".w3wPanel { " + "background: #E0ECF8;"
			+ "border-radius: 5px 10px;" + "opacity: 0.8}");
	w3wPanel.setStyleName("w3wPanel");
	w3wPanel.setWidth("415px");

	wordsLabel = new Label();
	w3wAnchor = new AnchorBuilder().setHref("https://what3words.com/")
			.setText(UIMessages.INSTANCE.what3Words())
			.setTitle("https://what3words.com/").build();
	w3wAnchor.getElement().getStyle().setColor("#FF0000");
	w3wAnchor.setVisible(false);
	w3wPanel.add(w3wAnchor);
	w3wPanel.add(wordsLabel);
}
 
Example 2
Source File: JoinDataDialog.java    From geowe-core with GNU General Public License v3.0 6 votes vote down vote up
private void createSeparatorPanel() {
	separatorPanel = new HorizontalPanel();
	separatorPanel.setSpacing(1);
	separatorPanel.setWidth("100%");
	separatorPanel.addStyleName(ThemeStyles.get().style().borderTop());
	separatorPanel.addStyleName(ThemeStyles.get().style().borderBottom());
	separatorPanel
			.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	separatorPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
	separatorPanel.add(new Label(UIMessages.INSTANCE
			.separator(DEFAULT_CSV_SEPARATOR)));
	separatorTextField = new TextField();
	separatorTextField.setText(DEFAULT_CSV_SEPARATOR);
	separatorTextField.setWidth(30);

	separatorPanel.add(separatorTextField);
}
 
Example 3
Source File: Toolbar.java    From appinventor-extensions with Apache License 2.0 6 votes vote down vote up
/**
 * Initializes and assembles all commands into buttons in the toolbar.
 */
public Toolbar() {
  buttonMap = new HashMap<String, TextButton>();
  dropDownButtonMap = new HashMap<String, DropDownButton>();

  leftButtons = new HorizontalPanel();
  leftButtons.setSpacing(4);

  rightButtons = new HorizontalPanel();
  rightButtons.setSpacing(4);
  rightButtons.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);

  HorizontalPanel toolbar = new HorizontalPanel();
  toolbar.add(leftButtons);  // this nesting keeps buttons left aligned
  toolbar.add(rightButtons);
  toolbar.setCellHorizontalAlignment(rightButtons, HorizontalPanel.ALIGN_RIGHT);
  toolbar.setWidth("100%");
  toolbar.setStylePrimaryName("ya-Toolbar");

  initWidget(toolbar);
}
 
Example 4
Source File: LinksWidget.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Widget asWidget() {
	if (widget == null) {
		//String width="320px";
		String width="370px";
		String height="50px";
		widget = new HorizontalLayoutContainer();
		widget.getElement().getStyle().setPosition(Position.ABSOLUTE);
		widget.getElement().getStyle().setRight(5, Unit.PX);
		widget.getElement().getStyle().setTop(0, Unit.PX);
		widget.setSize(width, height);
		
		hp = new HorizontalPanel();
		hp.setSpacing(10);
		StyleInjector.inject(".linkPanel { " + "background: #FFFFFF;"
				+ "border-radius: 5px 10px;" + "opacity: 0.8}");
		hp.setStyleName("linkPanel");
		hp.setSize(width, height);
		
		ScrollSupport scrollSupport = widget.getScrollSupport();
		scrollSupport.setScrollMode(ScrollMode.AUTOX);
		
		setDefaultLinks();
		
		widget.add(hp);
	}
	return widget;
}
 
Example 5
Source File: AttributeSearchDialog.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
private HorizontalPanel createSearchButtonPanel() {
	HorizontalPanel hPanel = new HorizontalPanel();
	hPanel.setSpacing(10);
	searchButton = getSearchMenuButton();
	hPanel.add(searchButton);

	isCaseSensitive = new CheckBox();
	isCaseSensitive.setBoxLabel(UIMessages.INSTANCE.caseSensitive());
	isCaseSensitive.setValue(true);
	hPanel.add(isCaseSensitive);
	return hPanel;
}
 
Example 6
Source File: AttributeSearchDialog.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
private HorizontalPanel createAttrPanel(){
	HorizontalPanel hPanel = new HorizontalPanel();
	hPanel.setSpacing(10);
	hPanel.addStyleName(ThemeStyles.get().style().borderBottom());
	hPanel.addStyleName(ThemeStyles.get().style().borderTop());
	hPanel.add(getAttrCombo());
	hPanel.add(getAttrValuePanel());
	
	return hPanel;
}
 
Example 7
Source File: MenuPanelWidget.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
private HorizontalPanel getLayerGroupTools() {
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.setSpacing(5);
	horizontalGroup.getElement().getStyle()
			.setVerticalAlign(VerticalAlign.MIDDLE);

	horizontalGroup.add(addLayerTool);
	horizontalGroup.add(layerInfoTool);
	horizontalGroup.add(changeStyleTool);

	return horizontalGroup;
}
 
Example 8
Source File: JoinDataDialog.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
private void createLayerAttributeComboPanel() {
	layerAttributeComboPanel = new HorizontalPanel();
	layerAttributeComboPanel.setWidth("100%");
	layerAttributeComboPanel.addStyleName(ThemeStyles.get().style()
			.borderBottom());
	layerAttributeComboPanel.setSpacing(5);
	layerAttributeComboPanel.setVisible(false);
	layerAttributeComboPanel.add(new Label(UIMessages.INSTANCE
			.layerSchemaToolText()));
	layerAttributeComboPanel.add(layerAttributeCombo);

}
 
Example 9
Source File: JoinDataDialog.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
private void getCSVComboPanel() {
	comboPanel = new HorizontalPanel();
	comboPanel.setWidth("100%");
	comboPanel.addStyleName(ThemeStyles.get().style().borderTop());
	comboPanel.setSpacing(5);
	comboPanel.setVisible(false);
	comboPanel.add(new Label(UIMessages.INSTANCE.bindableAttribute()));
	comboPanel.add(csvAttributeCombo);
}
 
Example 10
Source File: MenuPanelWidget.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
private HorizontalPanel getProjectGroupTools() {
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.setSpacing(5);
	horizontalGroup.getElement().getStyle()
			.setVerticalAlign(VerticalAlign.MIDDLE);

	horizontalGroup.add(openProjectTool);
	horizontalGroup.add(saveProjectTool);	
	horizontalGroup.add(infoProjectTool);
	
	return horizontalGroup;
}
 
Example 11
Source File: FeatureInfoToolBar.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
public void initialize(GridEditing<FeatureAttributeBean> gridEditing,
		ListStore<FeatureAttributeBean> featureAttributes) {
	this.gridEditing = gridEditing;
	this.featureAttributes = featureAttributes;
	setHeaderVisible(false);
	addStyleName(ThemeStyles.get().style().borderBottom());
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.setSpacing(5);
	horizontalGroup.add(getEditButton());
	horizontalGroup.add(getClearButton());
	horizontalGroup.add(getWKTButton());
	horizontalGroup.add(getExportCSVButton());
	setWidget(horizontalGroup);
}
 
Example 12
Source File: SimpleMapVerticalLegend.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected List<Widget> getData() {
	List<Widget> widgets = new ArrayList<Widget>();
	for (Layer layer : layers) {
		HorizontalPanel hpanel = new HorizontalPanel();
		hpanel.setSpacing(2);
		hpanel.add(getColorPanel(layer));
		hpanel.add(new Label(layer.getName()));

		widgets.add(hpanel);
	}
	return widgets;
}
 
Example 13
Source File: MenuPanelWidget.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
private HorizontalPanel getLayer2GroupTools() {
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.setSpacing(5);
	horizontalGroup.getElement().getStyle()
			.setVerticalAlign(VerticalAlign.MIDDLE);

	horizontalGroup.add(searchAttributeTool);
	horizontalGroup.add(snappingTool);
	horizontalGroup.add(geometricAnalysisTool);

	return horizontalGroup;
}
 
Example 14
Source File: MenuPanelWidget.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
private Widget getSaveToolGroup1Tools() {
	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.getElement().getStyle()
			.setVerticalAlign(VerticalAlign.MIDDLE);
	horizontalGroup.setSpacing(5);
	horizontalGroup.add(saveLayerTool);
	horizontalGroup.add(exportLayerTool);
	//horizontalGroup.add(saveProjectTool);
	return horizontalGroup;
}
 
Example 15
Source File: GeoDataImportDialog.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
private Widget createUrlToShareAnchor() {
	urlPanel = new HorizontalPanel();
	urlPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
	urlPanel.setSpacing(1);
	urlToShareAnchor = new AnchorBuilder().build();
	urlPanel.add(urlToShareAnchor);
	Image img = new Image(ImageProvider.INSTANCE.externalLink16());
	urlPanel.add(img);
	urlPanel.setVisible(false);
	return urlPanel;
}
 
Example 16
Source File: RasterInfoDialog.java    From geowe-core with GNU General Public License v3.0 4 votes vote down vote up
private Widget createPanel() {
	String fieldWidth = "225px";
	HorizontalPanel hPanel = new HorizontalPanel();
	hPanel.setSpacing(10);
	// Panel izquierdo
	VerticalPanel leftPanel = new VerticalPanel();
	leftPanel.setSpacing(5);

	layerNameField = new TextField();
	layerNameField.setEnabled(false);
	layerNameField.setWidth(fieldWidth);
	leftPanel.add(new Label((UIMessages.INSTANCE.lidLayerNameLabel())));
	leftPanel.add(layerNameField);

	projectionField = new TextField();
	projectionField.setEnabled(false);
	projectionField.setWidth(fieldWidth);
	leftPanel.add(new Label((UIMessages.INSTANCE.lidProjectionLabel())));
	leftPanel.add(projectionField);

	baseLayerField = new TextField();
	baseLayerField.setEnabled(false);
	baseLayerField.setWidth(fieldWidth);
	leftPanel.add(new Label((UIMessages.INSTANCE.baseLayer())));
	leftPanel.add(baseLayerField);

	layerZoomField = new TextField();
	layerZoomField.setEnabled(false);
	layerZoomField.setWidth(fieldWidth);
	leftPanel.add(new Label(
			(UIMessages.INSTANCE.mpZoomToolsLabel() + "(min/max)")));
	leftPanel.add(layerZoomField);

	// Panel derecho
	VerticalPanel rightPanel = new VerticalPanel();
	leftPanel.setSpacing(5);

	layerScalesTextArea = new TextArea();
	layerScalesTextArea.setSize(fieldWidth, "100px");
	layerScalesTextArea.setEnabled(false);
	rightPanel.add(new Label((UIMessages.INSTANCE.scales())));
	rightPanel.add(layerScalesTextArea);
	layerScalesTextArea.setToolTip(UIMessages.INSTANCE.scalesDescription());

	layerResolutionsTextArea = new TextArea();
	layerResolutionsTextArea.setSize(fieldWidth, "100px");
	layerResolutionsTextArea.setEnabled(false);
	rightPanel.add(new Label((UIMessages.INSTANCE.resolution())));
	rightPanel.add(layerResolutionsTextArea);
	layerResolutionsTextArea.setToolTip(UIMessages.INSTANCE
			.resolutionsDescription());

	hPanel.add(leftPanel);
	hPanel.add(rightPanel);
	return hPanel;
}
 
Example 17
Source File: GeocodingPanelWidget.java    From geowe-core with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Widget asWidget() {

	if (panel == null) {
		panel = new ContentPanel();
		panel.setBorders(true);
		panel.setPixelSize(490, 47);
		panel.setHeaderVisible(false);
		panel.setPosition(300, 0);
		panel.getElement().getStyle().setPosition(Position.ABSOLUTE);

		StyleInjector.inject(".statusBarStyle { " + "position: absolute; " + "bottom: 35 px;"
				+ "background: #E0ECF8;" + "border-radius: 5px 10px;" + "opacity: 0.8}");
		panel.setStyleName("geocodingPanelStyle");

		final HorizontalPanel horizontalGroup = new HorizontalPanel();
		horizontalGroup.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
		horizontalGroup.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
		horizontalGroup.setSpacing(5);
		horizontalGroup.getElement().getStyle().setBackgroundColor("#E0ECF8");

		addressTextField.setWidth("320px");
		addressTextField.setEmptyText(UIMessages.INSTANCE.gcAddressTextField());
		addressTextField.getElement().setId("autocompletar");

		addressTextField.addKeyDownHandler(new KeyDownHandler() {
			@Override
			public void onKeyDown(final KeyDownEvent event) {
				if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
					searchGeocoding(addressTextField.getText());
				}
			}
		});

		horizontalGroup.add(addressTextField);
		horizontalGroup.add(getSearchButton());
		horizontalGroup.add(getW3WLocationButton());
		horizontalGroup.add(getLocationMenuButton());
		panel.setWidget(horizontalGroup);
		panel.setVisible(false);
	}
	return panel;
}
 
Example 18
Source File: ColorStyleTab.java    From geowe-core with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void initializePanel() {
	String fieldWidth = "125px";

	fillColor = new TextField();
	fillColor.setWidth(fieldWidth);
	addFocusHandler(fillColor);
	
	fillOpacity = new Slider();
	fillOpacity.setWidth(fieldWidth);
	fillOpacity.setValue(0);
	fillOpacity.setIncrement(1);
	
	lineColor = new TextField();
	lineColor.setWidth(fieldWidth);
	addFocusHandler(lineColor);
	
	lineThick = new Slider();
	lineThick.setWidth(fieldWidth);
	lineThick.setValue(0);
	lineThick.setMaxValue(20);
	lineThick.setIncrement(1);

	colorPicker = new ColorPicker();
	colorPicker.addSelectedColorChangedListener(this);

	HorizontalPanel mainPanel = new HorizontalPanel();
	mainPanel.setSpacing(10);

	VerticalLayoutContainer vlc = new VerticalLayoutContainer();
	vlc.add(new FieldLabel(fillColor, UIMessages.INSTANCE.vlswFillcolor()),
			new VerticalLayoutData(-18, -1));
	vlc.add(new FieldLabel(fillOpacity, UIMessages.INSTANCE
			.vlswFillopacity()), new VerticalLayoutData(-18, -1));
	vlc.add(new FieldLabel(lineColor, UIMessages.INSTANCE.vlswStrokeColor()),
			new VerticalLayoutData(-18, -1));
	vlc.add(new FieldLabel(lineThick, UIMessages.INSTANCE.vlswStrokeWidth()),
			new VerticalLayoutData(-18, -1));

	mainPanel.add(vlc);
	mainPanel.add(colorPicker);
	
	panel.add(mainPanel);
}
 
Example 19
Source File: Ode.java    From appinventor-extensions with Apache License 2.0 4 votes vote down vote up
private Widget createLoadingWidget(final int pending) {
  final HorizontalPanel container = new HorizontalPanel();
  container.setWidth("100%");
  container.setSpacing(0);
  container.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
  HorizontalPanel panel = new HorizontalPanel();
  Image image = new Image();
  image.setResource(IMAGES.waitingIcon());
  panel.add(image);
  Label label = new Label();
  label.setText(MESSAGES.defaultRpcMessage());
  panel.add(label);
  container.add(panel);
  GalleryClient.getInstance().addListener(new GalleryRequestListener() {
    volatile int count = pending;
    private void hideLoadingWidget() {
      if (container.getParent() != null) {
        container.clear();
        container.removeFromParent();
      }
    }
    @Override
    public boolean onAppListRequestCompleted(GalleryAppListResult appsResult, int requestID, boolean refreshable) {
      if ((--count) <= 0) {
        hideLoadingWidget();
        return true;
      }
      return false;
    }
    @Override
    public boolean onCommentsRequestCompleted(List<GalleryComment> comments) {
      if ((--count) <= 0) {
        hideLoadingWidget();
        return true;
      }
      return false;
    }
    @Override
    public boolean onSourceLoadCompleted(UserProject projectInfo) {
      if ((--count) <= 0) {
        hideLoadingWidget();
        return true;
      }
      return false;
    }
  });
  return container;
}
 
Example 20
Source File: PreviewWidget.java    From geowe-core with GNU General Public License v3.0 4 votes vote down vote up
public Widget createPanel() {
	addLayerButton = new TextButton(UIMessages.INSTANCE.previewAddLayer());
	printButton = new TextButton(UIMessages.INSTANCE.previewPrint());
	applyButton = new TextButton(UIMessages.INSTANCE.previewApply());

	getButtonBar().add(printButton);

	initializeLayerCombo();

	HorizontalPanel hPanel = new HorizontalPanel();
	hPanel.setSpacing(5);
	hPanel.add(createFrame());

	VerticalPanel vPanel = new VerticalPanel();
	vPanel.setSpacing(5);

	zoomPageComboBox = new IntegerValueComboBox("180px");
	zoomPageComboBox.setValues(Arrays.asList(zoomLevel));

	vPanel.add(new Label(UIMessages.INSTANCE.previewZoomLevel()));
	vPanel.add(zoomPageComboBox);
	
	vPanel.add(new Label(UIMessages.INSTANCE.sbSelectLayerLabel()));
	vPanel.add(layerCombo);
	vPanel.add(addLayerButton);

	titleField = new TextField();
	titleField.setEnabled(true);
	titleField.setWidth("280px");

	vPanel.add(new Label(UIMessages.INSTANCE.projectTitle()));
	vPanel.add(titleField);

	descriptionField = new TextArea();
	descriptionField.setEnabled(true);
	descriptionField.setWidth("280px");
	descriptionField.setHeight("200px");

	vPanel.add(new Label(UIMessages.INSTANCE.projectDescription()));
	htmlEditor = new HtmlEditor();
	
	htmlEditor.setEnabled(true);
	htmlEditor.setWidth("280px");
	htmlEditor.setHeight("200px");
	
	vPanel.add(htmlEditor);		
	vPanel.add(applyButton);
	hPanel.add(vPanel);

	return hPanel;
}