本文整理汇总了Python中pyjamas.ui.RootPanel.RootPanel.get方法的典型用法代码示例。如果您正苦于以下问题:Python RootPanel.get方法的具体用法?Python RootPanel.get怎么用?Python RootPanel.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.RootPanel.RootPanel
的用法示例。
在下文中一共展示了RootPanel.get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: newPositioner
# 需要导入模块: from pyjamas.ui.RootPanel import RootPanel [as 别名]
# 或者: from pyjamas.ui.RootPanel.RootPanel import get [as 别名]
def newPositioner(self, context):
# Use two widgets so that setPixelSize() consistently affects dimensions
outer = SimplePanel()
outer.addStyleName(CSS_DRAGDROP_POSITIONER)
# place off screen for border calculation
RootPanel.get().add(outer, -500, -500)
# Ensure IE quirks mode returns valid outer.offsetHeight, and thus valid
outer.setWidget(self.DUMMY_LABEL_IE_QUIRKS_MODE_OFFSET_HEIGHT)
width = 0
height = 0
if isinstance(self.dropTarget,HorizontalPanel):
for widget in context.selectedWidgets:
width += widget.getOffsetWidth()
height = Math.max(height, widget.getOffsetHeight())
else:
for widget in context.selectedWidgets:
width = Math.max(width, widget.getOffsetWidth())
height += widget.getOffsetHeight()
inner = SimplePanel()
inner.setPixelSize(
width - DOMUtil.getHorizontalBorders(outer), height - DOMUtil.getVerticalBorders(outer))
outer.setWidget(inner)
return outer
示例2: makePositioner
# 需要导入模块: from pyjamas.ui.RootPanel import RootPanel [as 别名]
# 或者: from pyjamas.ui.RootPanel.RootPanel import get [as 别名]
def makePositioner(self, reference):
outer = SimplePanel() # Use two widgets so that setPixelSize() consistently affects dimensions
outer.addStyleName(CSS_DRAGDROP_POSITIONER)
outer.getElement().getStyle().setProperty("margin", "0px")
RootPanel.get().add(outer, -500, -500) # place off screen for border calculation
outer.setWidget(DUMMY_LABEL_IE_QUIRKS_MODE_OFFSET_HEIGHT) # Ensure IE quirks mode returns valid outer.offsetHeight, and thus valid
inner = SimplePanel()
inner.getElement().getStyle().setProperty("margin", "0px")
inner.getElement().getStyle().setProperty("border", "none")
offsetWidth = reference.getOffsetWidth() - DOMUtil.getHorizontalBorders(outer)
offsetHeight = reference.getOffsetHeight() - DOMUtil.getVerticalBorders(outer)
inner.setPixelSize(offsetWidth, offsetHeight)
outer.setWidget(inner)
return outer
示例3: newPositioner
# 需要导入模块: from pyjamas.ui.RootPanel import RootPanel [as 别名]
# 或者: from pyjamas.ui.RootPanel.RootPanel import get [as 别名]
def newPositioner(self, context):
# Use two widgets so that setPixelSize() consistently affects dimensions
# excluding positioner border in quirks and strict modes
SimplePanel outer = SimplePanel()
outer.addStyleName(CSS_DRAGDROP_POSITIONER)
# place off screen for border calculation
RootPanel.get().add(outer, -500, -500)
# Ensure IE quirks mode returns valid outer.offsetHeight, and thus valid
# DOMUtil.getVerticalBorders(outer)
outer.setWidget(DUMMY_LABEL_IE_QUIRKS_MODE_OFFSET_HEIGHT)
int width = 0
int height = 0
if dropTarget instanceof HorizontalPanel:
for Iterator iterator = context.selectedWidgets.iterator(); iterator.hasNext();:
示例4: internalSetWidget
# 需要导入模块: from pyjamas.ui.RootPanel import RootPanel [as 别名]
# 或者: from pyjamas.ui.RootPanel.RootPanel import get [as 别名]
def internalSetWidget(self, widget):
# this.widget = widget;
if widget == None or widget == RootPanel.get():
self.widgetLeft = 0
self.widgetTop = 0
else:
self.widgetLeft = widget.getAbsoluteLeft() - widget.getElement().getScrollLeft()
self.widgetTop = widget.getAbsoluteTop() - widget.getElement().getScrollTop()
示例5: internalSetReference
# 需要导入模块: from pyjamas.ui.RootPanel import RootPanel [as 别名]
# 或者: from pyjamas.ui.RootPanel.RootPanel import get [as 别名]
def internalSetReference(self, reference):
# this.reference = reference;
if reference == None or reference == RootPanel.get():
self.referenceAdjustLeft = 0
self.referenceAdjustTop = 0
else:
self.referenceAdjustLeft = \
reference.getAbsoluteLeft() + DOMUtil.getBorderLeft(reference.getElement())
self.referenceAdjustTop = \
reference.getAbsoluteTop() + DOMUtil.getBorderTop(reference.getElement())