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


Java AbsolutePanel類代碼示例

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


AbsolutePanel類屬於com.google.gwt.user.client.ui包,在下文中一共展示了AbsolutePanel類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: PeriodPreferencesWidget

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
public PeriodPreferencesWidget(boolean editable) {
	iEditable = editable;

	iPanel = new AbsolutePanel();
	
	iHorizontal = new CheckBox(MESSAGES.periodPreferenceHorizontal());
	iHorizontal.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
		@Override
		public void onValueChange(ValueChangeEvent<Boolean> event) {
			RoomCookie.getInstance().setHorizontal(iHorizontal.getValue());
			render();
		}
	});
	
	initWidget(iPanel);
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:17,代碼來源:PeriodPreferencesWidget.java

示例2: WorkAreaPanel

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
/**
 * Creates a new work area.
 *
 * @param boxRegistry  box registry for creating boxes
 * @param layout  initial layout for work area
 */
public WorkAreaPanel(BoxRegistry boxRegistry, Layout layout) {
  this.boxRegistry = boxRegistry;
  this.layout = layout;

  layouts = new HashMap<String, Layout>();
  layouts.put(layout.getName(), layout);

  boundaryPanel = new AbsolutePanel();
  boundaryPanel.setSize("100%", "100%");
  setWidget(boundaryPanel);
  setSize("100%", "100%");

  widgetDragController = new PickupDragController(boundaryPanel, false);
  widgetDragController.setBehaviorMultipleSelection(false);

  switchLayout(layout.getName());
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:24,代碼來源:WorkAreaPanel.java

示例3: ConsoleDisplay

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
public ConsoleDisplay() {
	super(new AbsolutePanel(), CLASS_NAME);
	getElement().setId("consoleDisplayWrapper");
	
	// Create display panel where screen is actually loaded
	display = new AbsolutePanel();
	display.addStyleName("portrait");
	display.getElement().setId("consoleDisplay");
	
	// Add display to the wrapper
	((AbsolutePanel)getWidget()).add(display, 0, 0);
			
	// Add move handlers which are only used on this display component
	if(BrowserUtils.isMobile) {
		this.addDomHandler(this, TouchMoveEvent.getType());
	} else {
		this.addDomHandler(this, MouseMoveEvent.getType());
		this.addDomHandler(this, MouseOutEvent.getType());
	}
}
 
開發者ID:openremote,項目名稱:WebConsole,代碼行數:21,代碼來源:ConsoleDisplay.java

示例4: setInitialImage

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
public void setInitialImage(String src) {
		String url = WebConsole.getConsoleUnit().getControllerService().getController().getResourcesUrl();
		url += src;
		initialImage = WebConsole.getConsoleUnit().getImageFromCache(url);
		initialImage.addCallback(loadedCallback);
//		initialImage.setUrl(url);
//		initialImage.getImage().addLoadHandler(new LoadHandler() {
//			@Override
//			public void onLoad(LoadEvent event) {
//				initialImage.setExists(true);
//				initialImage.setVisible(true);
//			}
//		});
		if (initialImage != null) {
			((AbsolutePanel)getWidget()).add(initialImage.getImage(), 0, 0);
		}
	}
 
開發者ID:openremote,項目名稱:WebConsole,代碼行數:18,代碼來源:ImageComponent.java

示例5: MenuLockLayer

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
public MenuLockLayer(CloseMenuHandler closeMenuCallback, int topOffset) {
  this.closeMenuCallback = closeMenuCallback;
  this.topOffset = topOffset;

  getElement().setId("menu-lock-layer-id");
  RootPanel.get().add(this, 0, topOffset);
  getElement().getStyle().setProperty("right", "0px");
  getElement().getStyle().setProperty("bottom", "0px");
  getElement().getStyle().setProperty("zIndex", (Integer.MAX_VALUE - 5) + "");

  AbsolutePanel blockMouseEventsPanel = new LockLayer();
  blockMouseEventsPanel.setStyleName("exo-lockLayer");
  blockMouseEventsPanel.getElement().getStyle().setProperty("position", "absolute");
  blockMouseEventsPanel.getElement().getStyle().setProperty("left", "0px");
  blockMouseEventsPanel.getElement().getStyle().setProperty("top", "0px");
  blockMouseEventsPanel.getElement().getStyle().setProperty("right", "0px");
  blockMouseEventsPanel.getElement().getStyle().setProperty("bottom", "0px");
  add(blockMouseEventsPanel);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:20,代碼來源:MenuLockLayer.java

示例6: onMouseMove

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
public void onMouseMove(Widget source, int x, int y) {
	if (dragging) {
		// System.out.println("MOUSE MOVE:" + x + "," + y);
		
		AbsolutePanel rootPanel = getAbsoluteWidgetPanel(dragWidget);
		
		
		int newX = x + dragWidget.getAbsoluteLeft() - xOffset;
		int newY = y + dragWidget.getAbsoluteTop() - yOffset;
		
		
    	
    	
    	int rootOffsetY = newY - rootPanel.getAbsoluteTop();
    	int rootOffsetX =  newX-rootPanel.getAbsoluteLeft();
    	if (rootOffsetX < 0) {
    		rootOffsetX = 0;
    	}
    	if (rootOffsetY < 0) {
    		rootOffsetY = 0;
    	}
    	rootPanel.setWidgetPosition(dragWidget, rootOffsetX, rootOffsetY);
	}
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:25,代碼來源:DragControl.java

示例7: TabPane

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
public TabPane() {
        tabs = new ArrayList<Tab<T>>();
//        visibleTabs = new ArrayList<Tab<T>>();
        tabPanel = new TabLayoutPanelPlus(20, Style.Unit.PX);
        tabPanel.setStyleName("firefly-TabPane");

        wrapper = new AbsolutePanel();
        wrapper.add(tabPanel);
        tabPanel.setSize("100%", "100%");
        initWidget(wrapper);

        SelHandler selHandler = new SelHandler();

        tabPanel.addBeforeSelectionHandler(selHandler);
        tabPanel.addSelectionHandler(selHandler);

        WebEventManager.getAppEvManager().addListener(Name.WINDOW_RESIZE,
                new WebEventListener(){
                    public void eventNotify(WebEvent ev) {
                        ensureHelpPos();
                    }
                });

    }
 
開發者ID:lsst,項目名稱:firefly,代碼行數:25,代碼來源:TabPane.java

示例8: ShadowedPanel

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
public ShadowedPanel(Widget w) {
    p = new AbsolutePanel();
    initWidget(p);
    p.add(_panel);
    _panel.setStyleName("shadow");
    setSize("100%", "100%");
    GwtUtil.setStyles(_panel, "position", "absolute", "top", "0px", "bottom", "0px", "left", "0px", "right", "0px");
    if (w!=null) setContent(w);
    WebEventManager.getAppEvManager().addListener(Name.WINDOW_RESIZE,
            new WebEventListener(){
                public void eventNotify(WebEvent ev) {
                    if (helpIcon != null) {
                        p.setWidgetPosition(helpIcon, p.getOffsetWidth()-23, 7);
                    }
                }
            });

}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:19,代碼來源:ShadowedPanel.java

示例9: scrollPanel

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
private Panel scrollPanel() {

        final Panel panel = mock(AbsolutePanel.class);
        final Element element = mock(Element.class);

        doReturn(SCROLL_LEFT).when(element).getScrollLeft();
        doReturn(SCROLL_TOP).when(element).getScrollTop();
        doReturn(SCROLL_WIDTH).when(element).getScrollWidth();
        doReturn(SCROLL_HEIGHT).when(element).getScrollHeight();
        doReturn(CLIENT_WIDTH).when(element).getClientWidth();
        doReturn(CLIENT_HEIGHT).when(element).getClientHeight();

        doReturn(element).when(panel).getElement();

        return panel;
    }
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:GridLienzoScrollBarsTest.java

示例10: emptyPanel

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
private Panel emptyPanel() {

        final Panel panel = mock(AbsolutePanel.class);
        final Element element = mock(Element.class);

        doReturn(0).when(element).getScrollLeft();
        doReturn(0).when(element).getScrollTop();
        doReturn(0).when(element).getScrollWidth();
        doReturn(0).when(element).getScrollHeight();
        doReturn(0).when(element).getClientWidth();
        doReturn(0).when(element).getClientHeight();

        doReturn(element).when(panel).getElement();

        return panel;
    }
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:GridLienzoScrollBarsTest.java

示例11: testSetupScrollBarSynchronization

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
@Test
public void testSetupScrollBarSynchronization() {

    final AbsolutePanel scrollPanel = mock(AbsolutePanel.class);
    final ScrollHandler scrollHandler = mock(ScrollHandler.class);

    doReturn(scrollHandler).when(gridLienzoScrollHandler).onScroll();
    doReturn(scrollPanel).when(gridLienzoScrollHandler).getScrollPanel();
    doNothing().when(gridLienzoScrollHandler).synchronizeScrollSize();

    gridLienzoScrollHandler.setupScrollBarSynchronization();

    verify(gridLienzoScrollHandler).synchronizeScrollSize();
    verify(scrollPanel).addDomHandler(scrollHandler,
                                      ScrollEvent.getType());
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:GridLienzoScrollHandlerTest.java

示例12: testSynchronizeScrollSize

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
@Test
public void testSynchronizeScrollSize() {

    final AbsolutePanel panel = mock(AbsolutePanel.class);
    final Integer internalScrollPanelWidth = 42;
    final Integer internalScrollPanelHeight = 58;

    doReturn(internalScrollPanelWidth).when(gridLienzoScrollHandler).calculateInternalScrollPanelWidth();
    doReturn(internalScrollPanelHeight).when(gridLienzoScrollHandler).calculateInternalScrollPanelHeight();
    doReturn(panel).when(gridLienzoScrollHandler).getInternalScrollPanel();

    gridLienzoScrollHandler.synchronizeScrollSize();

    verify(panel).setPixelSize(eq(internalScrollPanelWidth),
                               eq(internalScrollPanelHeight));
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:17,代碼來源:GridLienzoScrollHandlerTest.java

示例13: testScrollbarWidth

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
@Test
public void testScrollbarWidth() {

    final AbsolutePanel scrollPanel = mock(AbsolutePanel.class);
    final Element element = mock(Element.class);
    final Integer offsetWidth = 1014;
    final Integer clientWidth = 1000;

    doReturn(offsetWidth).when(element).getOffsetWidth();
    doReturn(clientWidth).when(element).getClientWidth();
    doReturn(element).when(scrollPanel).getElement();
    doReturn(scrollPanel).when(gridLienzoScrollHandler).getScrollPanel();

    final Integer expectedScrollbarWidth = offsetWidth - clientWidth;
    final Integer actualScrollbarWidth = gridLienzoScrollHandler.scrollbarWidth();

    assertEquals(expectedScrollbarWidth,
                 actualScrollbarWidth);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:20,代碼來源:GridLienzoScrollHandlerTest.java

示例14: testScrollbarHeight

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
@Test
public void testScrollbarHeight() {

    final AbsolutePanel scrollPanel = mock(AbsolutePanel.class);
    final Element element = mock(Element.class);
    final Integer offsetHeight = 1014;
    final Integer clientHeight = 1000;

    doReturn(offsetHeight).when(element).getOffsetHeight();
    doReturn(clientHeight).when(element).getClientHeight();
    doReturn(element).when(scrollPanel).getElement();
    doReturn(scrollPanel).when(gridLienzoScrollHandler).getScrollPanel();

    final Integer expectedScrollbarHeight = offsetHeight - clientHeight;
    final Integer actualScrollbarHeight = gridLienzoScrollHandler.scrollbarHeight();

    assertEquals(expectedScrollbarHeight,
                 actualScrollbarHeight);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:20,代碼來源:GridLienzoScrollHandlerTest.java

示例15: testSetupContextSwitcher

import com.google.gwt.user.client.ui.AbsolutePanel; //導入依賴的package包/類
@Test
public void testSetupContextSwitcher() {

    final AbsolutePanel domElementContainer = mock(AbsolutePanel.class);
    final LienzoPanel lienzoPanel = mock(LienzoPanel.class);
    final MouseWheelHandler wheelHandler = mock(MouseWheelHandler.class);
    final MouseMoveHandler moveHandler = mock(MouseMoveHandler.class);

    doReturn(domElementContainer).when(gridLienzoPanel).getDomElementContainer();
    doReturn(wheelHandler).when(gridLienzoScrollHandler).disablePointerEvents();
    doReturn(moveHandler).when(gridLienzoScrollHandler).enablePointerEvents();

    gridLienzoScrollHandler.setupContextSwitcher();

    verify(domElementContainer).addDomHandler(wheelHandler, MouseWheelEvent.getType());
    verify(gridLienzoPanel).addMouseMoveHandler(moveHandler);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:18,代碼來源:GridLienzoScrollHandlerTest.java


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