当前位置: 首页>>代码示例>>Java>>正文


Java Label.setWidth方法代码示例

本文整理汇总了Java中com.smartgwt.client.widgets.Label.setWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setWidth方法的具体用法?Java Label.setWidth怎么用?Java Label.setWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.smartgwt.client.widgets.Label的用法示例。


在下文中一共展示了Label.setWidth方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createAutoScaleButton

import com.smartgwt.client.widgets.Label; //导入方法依赖的package包/类
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;
}
 
开发者ID:52North,项目名称:SensorWebClient,代码行数:19,代码来源:DataControlsTimeSeries.java

示例2: createValueIntervalLabel

import com.smartgwt.client.widgets.Label; //导入方法依赖的package包/类
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;
}
 
开发者ID:52North,项目名称:SensorWebClient,代码行数:19,代码来源:LegendEntryTimeSeries.java

示例3: CustomCountriesFeatureInfoCanvas

import com.smartgwt.client.widgets.Label; //导入方法依赖的package包/类
public CustomCountriesFeatureInfoCanvas(Feature feature) {
	setBackgroundColor("#BBFFBB");
	l = new Label("<b>Custom DetailPanel for feature: </b>" + feature.getId());
	l.setWidth(250);
	l.setPadding(10);
	addChild(l);
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:8,代码来源:CustomCountriesFeatureInfoCanvasBuilder.java

示例4: createLabel

import com.smartgwt.client.widgets.Label; //导入方法依赖的package包/类
private Label createLabel(String message, boolean showLoading) {
	final Label label = new Label();
	label.setWrap(false);
	label.setPadding(10);
	label.setWidth(200);
	label.setHeight(40);
	label.setContents(message);
	label.setBackgroundColor(messageBoxBgColor);
	label.setBorder("1px solid #999");
	label.setShowShadow(true);
	label.setShadowSoftness(0);
	label.setShadowOffset(15);
	label.addDrawHandler(new DrawHandler() {
		public void onDraw(DrawEvent event) {
			int visibleWidth = label.getVisibleWidth();
			label.setWidth(visibleWidth);
			label.setMargin(10);
		}
	});
	label.setAlign(Alignment.CENTER);
	if (showLoading) {
		if (loadingIcon != null) { // icon provided by user
			label.setIcon(loadingIcon);
		} else { // show default icon from used skin
			String icon = Page.getSkinImgDir() + "loading.gif";
			label.setIcon(icon);
		}
		if (message.equals("")) { // no spacing, just show the loading icon
			// centered
			label.setIconSpacing(0);
		}
	}
	label.setZIndex(modal.getZIndex() + 2);
	return label;
}
 
开发者ID:SHARP-HTP,项目名称:phenotype-portal,代码行数:36,代码来源:ModalWindow.java

示例5: onModuleLoad

import com.smartgwt.client.widgets.Label; //导入方法依赖的package包/类
public void onModuleLoad() {
	VLayout mainLayout = new VLayout();
	mainLayout.setWidth100();
	mainLayout.setHeight100();
	mainLayout.setBackgroundColor("#A0A0A0");

	HLayout layout = new HLayout();
	layout.setWidth100();
	layout.setHeight100();
	layout.setMembersMargin(10);
	layout.setMargin(10);

	// ---------------------------------------------------------------------
	// Create the left-side (map and tabs):
	// ---------------------------------------------------------------------
	map = new MapWidget("mapMain", "app");
	final Toolbar toolbar = new Toolbar(map, WidgetLayout.toolbarLargeButtonSize);
	toolbar.setBackgroundColor("#647386");
	toolbar.setBackgroundImage("");
	toolbar.setBorder("0px");

	toolbar.addToolbarSeparator();
	toolbar.addMenuButton(getReportingMenuButton());

	Label title = new Label("Geomajas reporting demo");
	title.setStyleName("appTitle");
	title.setWidth(260);
	toolbar.addFill();
	toolbar.addMember(title);

	VLayout mapLayout = new VLayout();
	mapLayout.addMember(toolbar);
	mapLayout.addMember(map);
	mapLayout.setHeight("65%");

	VLayout leftLayout = new VLayout();
	leftLayout.setBorder("10px solid #777777");
	leftLayout.setStyleName("round_corner");
	leftLayout.addMember(mapLayout);

	layout.addMember(leftLayout);

	// ---------------------------------------------------------------------
	// Create the right-side (layer-tree, legend):
	// ---------------------------------------------------------------------
	final SectionStack sectionStack = new SectionStack();
	sectionStack.setBorder("10px solid #777777");
	sectionStack.setStyleName("round_corner");
	sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
	sectionStack.setCanReorderSections(true);
	sectionStack.setCanResizeSections(false);
	sectionStack.setSize("250px", "100%");

	// LayerTree layout:
	SectionStackSection section2 = new SectionStackSection("Layer tree");
	section2.setExpanded(true);
	LayerTree layerTree = new LayerTree(map);
	section2.addItem(layerTree);
	sectionStack.addSection(section2);

	// Legend layout:
	SectionStackSection section3 = new SectionStackSection("Legend");
	section3.setExpanded(true);
	legend = new Legend(map.getMapModel());
	legend.setBackgroundColor("#FFFFFF");
	section3.addItem(legend);
	sectionStack.addSection(section3);

	// Putting the right side layouts together:
	layout.addMember(sectionStack);

	// ---------------------------------------------------------------------
	// Finally draw everything:
	// ---------------------------------------------------------------------
	mainLayout.addMember(layout);
	mainLayout.draw();

	// Then initialize:
	initialize();
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:81,代码来源:Application.java

示例6: getViewPanel

import com.smartgwt.client.widgets.Label; //导入方法依赖的package包/类
public Canvas getViewPanel() {
	VLayout mainLayout = new VLayout();
	mainLayout.setWidth100();
	mainLayout.setHeight100();

	// ---------------------------------------------------------------------
	// Top bar:
	// ---------------------------------------------------------------------
	ToolStrip topBar = new ToolStrip();
	topBar.setHeight(33);
	topBar.setWidth100();
	topBar.addSpacer(6);

	Img icon = new Img("[ISOMORPHIC]/geomajas/geomajas_desktopicon_small.png");
	icon.setSize(24);
	topBar.addMember(icon);
	topBar.addSpacer(6);

	Label title = new Label("Geomajas, Simple printing GWT example");
	title.setStyleName("sgwtTitle");
	title.setWidth(400);
	topBar.addMember(title);

	mainLayout.addMember(topBar);

	HLayout layout = new HLayout();
	layout.setWidth100();
	layout.setHeight100();
	layout.setMembersMargin(5);
	layout.setMargin(5);

	// ---------------------------------------------------------------------
	// Create the left-side (map and tabs):
	// ---------------------------------------------------------------------
	final MapWidget map = new MapWidget("mapPrinting", "appPrinting");
	final Toolbar toolbar = new Toolbar(map, WidgetLayout.toolbarLargeButtonSize);
	map.getMapModel().runWhenInitialized(new Runnable() {

		public void run() {
			map.getMapModel().getVectorLayer("clientLayerCountriesPrinting").setLabeled(true);
		}
	});

	map.getMapModel().addMapModelChangedHandler(new AddWorldPaintables(map));

	VLayout mapLayout = new VLayout();
	mapLayout.addMember(toolbar);
	mapLayout.addMember(map);
	mapLayout.setHeight("100%");

	layout.addMember(mapLayout);

	// ---------------------------------------------------------------------
	// Finally draw everything:
	// ---------------------------------------------------------------------
	return layout;
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:58,代码来源:PrintingPanel.java

示例7: DefaultView

import com.smartgwt.client.widgets.Label; //导入方法依赖的package包/类
/**
 * Construct a default UI with the specified title.
 * 
 * @param applicationTitle title to display
 */
public DefaultView(String applicationTitle) {
	VLayout banner = new VLayout();
	banner.setLayoutAlign(Alignment.CENTER);
	banner.setLayoutAlign(VerticalAlignment.CENTER);

	LayoutSpacer spacerTop = new LayoutSpacer();
	spacerTop.setHeight(WidgetLayout.loadingScreenTopSpacerHeight);
	banner.addMember(spacerTop);

	Img logoImg = new Img(logo);
	logoImg.setWidth(logoWidth);
	logoImg.setHeight(logoHeight);
	logoImg.setLayoutAlign(Alignment.CENTER);
	logoImg.setLayoutAlign(VerticalAlignment.CENTER);
	banner.addMember(logoImg);

	Label titleLabel = new Label(applicationTitle);
	titleLabel.setWidth(logoWidth);
	titleLabel.setHeight(WidgetLayout.loadingScreenTitleHeight);
	titleLabel.setLayoutAlign(Alignment.CENTER);
	titleLabel.setAlign(Alignment.CENTER);
	banner.addMember(titleLabel);

	LayoutSpacer spacer = new LayoutSpacer();
	banner.addMember(spacer);

	VLayout progressLayout = new VLayout();
	progressLayout.setBackgroundColor(WidgetLayout.loadingScreenProgressBackgroundColor);
	progressLayout.setOpacity(WidgetLayout.loadingScreenProgressOpacity);
	progressLayout.setHeight(WidgetLayout.loadingScreenProgressHeight);
	progressLayout.setPadding(WidgetLayout.loadingScreenProgressPadding);

	label = new Label(I18nProvider.getGlobal().loadScreenDownLoadText());
	label.setLayoutAlign(Alignment.CENTER);
	label.setWidth100();
	label.setHeight(WidgetLayout.loadingScreenProgressLabelHeight);
	label.setStyleName("loadingScreenLabel");
	label.setOpacity(100);
	progressLayout.addMember(label);

	progressBar = new Progressbar();
	progressBar.setHeight(WidgetLayout.loadingScreenProgressBarHeight);
	progressBar.setWidth100();
	progressBar.setVertical(false);
	progressBar.setLayoutAlign(Alignment.CENTER);
	progressBar.setLayoutAlign(VerticalAlignment.CENTER);
	progressBar.setOpacity(100);
	progressLayout.addMember(progressBar);
	banner.addMember(progressLayout);

	setBackgroundColor(WidgetLayout.loadingScreenBackgroundColor);
	setShowEdges(true);
	setShowShadow(true);
	setShadowDepth(WidgetLayout.loadingScreenShadowDepth);
	setLayoutAlign(Alignment.CENTER);
	setLayoutAlign(VerticalAlignment.CENTER);
	setWidth(WidgetLayout.loadingScreenWidth);
	setHeight(WidgetLayout.loadingScreenHeight);
	if (!(WidgetLayout.loadingScreenBackgroundImage == null)) {
		setBackgroundImage(WidgetLayout.loadingScreenBackgroundImage);
	}
	setEdgeOpacity(WidgetLayout.loadingScreenEdgeOpacity);
	setAlign(Alignment.CENTER);
	addMember(banner);
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:71,代码来源:LoadingScreen.java


注:本文中的com.smartgwt.client.widgets.Label.setWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。