本文整理了Java中com.google.gwt.user.client.Element.getAbsoluteRight()
方法的一些代码示例,展示了Element.getAbsoluteRight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getAbsoluteRight()
方法的具体详情如下:
包路径:com.google.gwt.user.client.Element
类名称:Element
方法名:getAbsoluteRight
暂无
代码示例来源:origin: stackoverflow.com
public static boolean isVisible(Element e)
{
//vp = viewPort, b = bottom, l = left, t = top, r = right
int vpWidth = Window.getClientWidth();
int vpHeight = Window.getClientHeight();
boolean tViz = ( e.getAbsoluteTop() >= 0 && e.getAbsoluteTop()< vpHeight);
boolean bViz = (e.getAbsoluteBottom() > 0 && e.getAbsoluteBottom() <= vpHeight);
boolean lViz = (e.getAbsoluteLeft() >= 0 && e.getAbsoluteLeft() < vpWidth);
boolean rViz = (e.getAbsoluteRight() > 0 && e.getAbsoluteRight() <= vpWidth);
boolean vVisible = tViz && bViz;
boolean hVisible = lViz && rViz;
return hVisible && vVisible;
}
代码示例来源:origin: fr.lteconsulting/hexa.core
void resize()
{
if( fakeDiv == null )
{
fakeDiv = DOM.createDiv();
fakeDiv.getStyle().setPosition( Position.FIXED );
fakeDiv.getStyle().setLeft( -10000, Unit.PX );
getElement().getParentElement().insertAfter( fakeDiv, getElement() );
applyStyle( fakeDiv );
}
int width = getElement().getAbsoluteRight() - getElement().getAbsoluteLeft();
fakeDiv.getStyle().setWidth( width - 10 - 2, Unit.PX );
fakeDiv.setInnerText( getText() );
int height = getElement().getClientHeight();
int newHeight = fakeDiv.getClientHeight() + 25;
if( height < newHeight )
getElement().getStyle().setHeight( newHeight, Unit.PX );
}
代码示例来源:origin: ltearno/hexa.tools
void resize()
{
if( fakeDiv == null )
{
fakeDiv = DOM.createDiv();
fakeDiv.getStyle().setPosition( Position.FIXED );
fakeDiv.getStyle().setLeft( -10000, Unit.PX );
getElement().getParentElement().insertAfter( fakeDiv, getElement() );
applyStyle( fakeDiv );
}
int width = getElement().getAbsoluteRight() - getElement().getAbsoluteLeft();
fakeDiv.getStyle().setWidth( width - 10 - 2, Unit.PX );
fakeDiv.setInnerText( getText() );
int height = getElement().getClientHeight();
int newHeight = fakeDiv.getClientHeight() + 25;
if( height < newHeight )
getElement().getStyle().setHeight( newHeight, Unit.PX );
}
代码示例来源:origin: oVirt/ovirt-engine
private void attachAutoCloseHandler() {
removeAutoCloseHandler();
autoCloseHandler = RootPanel.get().addDomHandler(e -> {
if (isVisible()) {
int top = content.asWidget().getElement().getAbsoluteTop();
int left = content.asWidget().getElement().getAbsoluteLeft();
int right = content.asWidget().getElement().getAbsoluteRight();
int bottom = content.asWidget().getElement().getAbsoluteBottom();
if (e.getY() < top || e.getY() > bottom || e.getX() < left || e.getX() > right) {
hide();
}
}
}, ClickEvent.getType());
}
代码示例来源:origin: kiegroup/appformer
private void show(final DragContext context) {
//Get centre of DropTarget
final Widget dropTargetParent = context.dropController.getDropTarget();
int cxmin = dropTargetParent.getElement().getAbsoluteLeft();
int cymin = dropTargetParent.getElement().getAbsoluteTop();
int cxmax = dropTargetParent.getElement().getAbsoluteRight();
int cymax = dropTargetParent.getElement().getAbsoluteBottom();
final CoordinateArea ca = new CoordinateArea(cxmin,
cymin,
cxmax,
cymax);
//Display Compass if not already visible
if (!popup.isAttached()) {
popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
@Override
public void setPosition(int offsetWidth,
int offsetHeight) {
popup.setPopupPosition(ca.getCenter().getLeft() - (offsetWidth / 2),
ca.getCenter().getTop() - (offsetHeight / 2));
}
});
} else {
popup.setPopupPosition(ca.getCenter().getLeft() - (popup.getOffsetWidth() / 2),
ca.getCenter().getTop() - (popup.getOffsetHeight() / 2));
}
}
代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-bs2
private void show( final DragContext context ) {
//Get centre of DropTarget
final Widget dropTargetParent = context.dropController.getDropTarget();
int cxmin = dropTargetParent.getElement().getAbsoluteLeft();
int cymin = dropTargetParent.getElement().getAbsoluteTop();
int cxmax = dropTargetParent.getElement().getAbsoluteRight();
int cymax = dropTargetParent.getElement().getAbsoluteBottom();
final CoordinateArea ca = new CoordinateArea( cxmin,
cymin,
cxmax,
cymax );
//Display Compass if not already visible
if ( !isAttached() ) {
setPopupPositionAndShow( new PositionCallback() {
@Override
public void setPosition( int offsetWidth,
int offsetHeight ) {
setPopupPosition( ca.getCenter().getLeft() - ( offsetWidth / 2 ),
ca.getCenter().getTop() - ( offsetHeight / 2 ) );
}
} );
} else {
setPopupPosition( ca.getCenter().getLeft() - ( getOffsetWidth() / 2 ),
ca.getCenter().getTop() - ( getOffsetHeight() / 2 ) );
}
}
代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly
private void show(final DragContext context) {
//Get centre of DropTarget
final Widget dropTargetParent = context.dropController.getDropTarget();
int cxmin = dropTargetParent.getElement().getAbsoluteLeft();
int cymin = dropTargetParent.getElement().getAbsoluteTop();
int cxmax = dropTargetParent.getElement().getAbsoluteRight();
int cymax = dropTargetParent.getElement().getAbsoluteBottom();
final CoordinateArea ca = new CoordinateArea(cxmin,
cymin,
cxmax,
cymax);
//Display Compass if not already visible
if (!popup.isAttached()) {
popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
@Override
public void setPosition(int offsetWidth,
int offsetHeight) {
popup.setPopupPosition(ca.getCenter().getLeft() - (offsetWidth / 2),
ca.getCenter().getTop() - (offsetHeight / 2));
}
});
} else {
popup.setPopupPosition(ca.getCenter().getLeft() - (popup.getOffsetWidth() / 2),
ca.getCenter().getTop() - (popup.getOffsetHeight() / 2));
}
}
内容来源于网络,如有侵权,请联系作者删除!