當前位置: 首頁>>代碼示例>>Java>>正文


Java SimplePanel.setHeight方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.ui.SimplePanel.setHeight方法的典型用法代碼示例。如果您正苦於以下問題:Java SimplePanel.setHeight方法的具體用法?Java SimplePanel.setHeight怎麽用?Java SimplePanel.setHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.ui.SimplePanel的用法示例。


在下文中一共展示了SimplePanel.setHeight方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: makeSideHeader

import com.google.gwt.user.client.ui.SimplePanel; //導入方法依賴的package包/類
protected Widget makeSideHeader() {

        Widget close = makeCloseButton(false);

        SimplePanel panel= new SimplePanel();
        panel.addStyleName(_ffCss.titleBgColor());
        panel.addStyleName(_ffCss.titleColor());
        panel.setHeight("100%");


        VerticalPanel header = new VerticalPanel();
        titleLabel.addStyleName("title-label");
        titleLabel.setHeight("100%");
        DOM.setStyleAttribute(titleLabel.getElement(), "cursor", "default");

        GwtUtil.setStyle(header, "paddingTop", "3px");

        titleLabel.setHTML(" ");

        header.addStyleName(_ffCss.popupTitleVerticalBackground());
        header.addStyleName(_ffCss.titleBgColor());
        header.addStyleName(_ffCss.titleColor());
//        header.addStyleName(_ffCss.popupBackground());

        header.add(close);
        header.add(titleLabel);
        header.setCellHeight(titleLabel, "100%");
        header.setWidth("15px");
        header.setHeight("100%");

        panel.setWidget(header);
        return panel;
    }
 
開發者ID:lsst,項目名稱:firefly,代碼行數:34,代碼來源:PopupPane.java

示例2: ConsoleUnit

import com.google.gwt.user.client.ui.SimplePanel; //導入方法依賴的package包/類
public ConsoleUnit(int width, int height, boolean fullscreen) {
//		if (fullscreen) {
//			width = BrowserUtils.getWindowWidth();
//			height = BrowserUtils.getWindowHeight();
//		}
////		if (width > height) {
////			int tempWidth = height;
////			height = width;
////			width = tempWidth;
////		}
//
//		this.width = width;
//		this.height = height;
		
		// Create a display and add to console container
		consoleDisplay = new ConsoleDisplay();
//		DOM.setStyleAttribute(consoleDisplay.getElement(), "borderStyle", "solid ");
//		DOM.setStyleAttribute(consoleDisplay.getElement(), "borderWidth", BOSS_WIDTH + "px");
		add(consoleDisplay);
		
		// Create Logo
		SimplePanel logoPanel = new SimplePanel();
		logoPanel.getElement().setId("consoleFrameLogo");
		logoPanel.setHeight(FRAME_WIDTH_BOTTOM - BOSS_WIDTH + "px");
		logoPanel.getElement().setAttribute("onselect", "return false;");
		add(logoPanel);
		
		// Set static console unit styling
		setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
		getElement().setId(CONSOLE_HTML_ELEMENT_ID);
		addStyleName("portrait");
		getElement().setAttribute("unselectable", "on");
		BrowserUtils.setStyleAttributeAllBrowsers(getElement(), "userSelect", "none");
		consoleDisplay.getElement().setAttribute("unselectable", "on");
		
		// Set Size
		setSize(width, height, fullscreen);
		
		// Register gesture and controller message handlers
		registerHandlers();
	}
 
開發者ID:openremote,項目名稱:WebConsole,代碼行數:42,代碼來源:ConsoleUnit.java

示例3: TabBarItemComponent

import com.google.gwt.user.client.ui.SimplePanel; //導入方法依賴的package包/類
public TabBarItemComponent(TabBarItem item, EnumSystemTabItemType systemTabType) {
	this.item = item;
	this.systemTabType = systemTabType;
	setStylePrimaryName(TAB_ITEM_CLASS_NAME);
	TabImage tabImage = item.getImage();
	setHeight("100%");
	setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	boolean hasText = false;
	this.addStyleName(INTERACTIVE_CLASS_NAME);
	
	// Check if we have text
	if (item.getName() != null && !item.getName().equals("")) {
		hasText = true;
	}
	
	// Add Image
	if (tabImage != null) {
		boolean isSystemImage = false;
		if (tabImage.getSystemImage() != null && tabImage.getSystemImage()) isSystemImage = true;
		int tabImageSize = hasText ? (TAB_BAR_HEIGHT - IMAGE_PADDING_TOP - TAB_TEXT_HEIGHT) : (TAB_BAR_HEIGHT - IMAGE_PADDING_TOP);
		imageComponent = new SimplePanel();
		imageComponent.setStylePrimaryName(TAB_IMAGE_CLASS_NAME);
		imageComponent.setWidth("100%");
		imageComponent.setHeight(tabImageSize + "px");
		String marginStr = hasText ? IMAGE_PADDING_TOP + "px 0 0 0" : IMAGE_PADDING_TOP + "px 0";
		DOM.setStyleAttribute(imageComponent.getElement(), "margin", marginStr);
		Element elem = imageComponent.getElement();
		
		String imagePath = "";
		if (isSystemImage) {
			imagePath = BrowserUtils.getSystemImageDir() + tabImage.getSrc();
		} else {
			imagePath = WebConsole.getConsoleUnit().getControllerService().getController().getResourcesUrl() + tabImage.getSrc();
		}
		
		DOM.setStyleAttribute(elem, "backgroundImage", "url(" + imagePath + ")");
		DOM.setStyleAttribute(elem, "backgroundRepeat", "no-repeat");
		DOM.setStyleAttribute(elem, "backgroundPosition", "center center");
		DOM.setStyleAttribute(elem, "backgroundColor", "transparent");
		DOM.setStyleAttribute(elem, "backgroundSize", "contain");
		DOM.setStyleAttribute(elem, "border", "none");
		this.add(imageComponent);
		hasImage = true;
	}
	
	// Add Text
	if (item.getName() != null && !item.getName().equals("")) {
		int lineHeight = hasImage ? TAB_TEXT_HEIGHT : TAB_BAR_HEIGHT;

		nameComponent = new Label();
		nameComponent.setText(item.getName());
		nameComponent.setWidth("100%");
		nameComponent.setStylePrimaryName(TAB_TEXT_CLASS_NAME);
		DOM.setStyleAttribute(nameComponent.getElement(), "lineHeight", lineHeight + "px");
		this.add(nameComponent);
		hasText = true;
	}
}
 
開發者ID:openremote,項目名稱:WebConsole,代碼行數:59,代碼來源:TabBarComponent.java


注:本文中的com.google.gwt.user.client.ui.SimplePanel.setHeight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。