当前位置: 首页>>代码示例>>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;未经允许,请勿转载。