/** * Gets the panel's offset width in pixels. Calls to {@link #setWidth(String)} * before the panel's child widget is set will not influence the offset width. * * @return the object's offset width */ @Override public int getOffsetWidth() { return super.getOffsetWidth(); }
/** * Gets the panel's offset width in pixels. Calls to {@link #setWidth(String)} * before the panel's child widget is set will not influence the offset width. * * @return the object's offset width */ @Override public int getOffsetWidth() { return super.getOffsetWidth(); }
/** * Gets the panel's offset width in pixels. Calls to {@link #setWidth(String)} * before the panel's child widget is set will not influence the offset width. * * @return the object's offset width */ @Override public int getOffsetWidth() { return super.getOffsetWidth(); }
private void adjustmentsForCollapsedState() { int hoverBarWidth = hoverBar.getOffsetWidth(); int aboutHalf = (hoverBarWidth / 2) + 1; int newWidth = width + aboutHalf; maxOffshift = newWidth; // Width is now hoverBarWidth. master.setWidth(hoverBarWidth + "px"); // clean up state. currentOffshift = width; }
private void updatePosition(int position) { if (position > 0) { position = 0; } if (position < -menu.getOffsetWidth()) { position = -menu.getOffsetWidth(); } CssUtil.translate(wrap.getElement(), position, 0); this.position = position; }
private void updatePosition(int position) { if (position > 0) { position = 0; } if (position < -menu.getOffsetWidth()) { position = -menu.getOffsetWidth(); } CssUtil.translate(wrap.getElement(), position, 0); }
private void handleTap(TapEvent event) { if (state == STATE.OPEN) { if (event.getStartX() > menu.getOffsetWidth()) { closeMenuWithAnimation(200); } } }
private void handleTap(TapEvent event) { if (state == STATE.OPEN) { if (event.getStartX() > menu.getOffsetWidth()) { closeMenuWithAnimation(200); } } }
@Before public void setup() throws Exception { this.parent = GWT.create(SimplePanel.class); this.editorPanel = GWT.create(ResizeFlowPanel.class); this.tested = spy(new ProjectDiagramEditorView(editorPanel)); when(tested.getParent()).thenReturn(parent); when(parent.getOffsetWidth()).thenReturn(WIDTH); when(parent.getOffsetHeight()).thenReturn(HEIGHT); parent.setWidget(tested); }
private void handleSwipeStart(SwipeStartEvent event) { if (state == STATE.CLOSED && event.getDirection() == DIRECTION.LEFT_TO_RIGHT) { // ignore? if (event.getTouch().getPageX() > 40) { return; } currentDirection = DIRECTION.LEFT_TO_RIGHT; maxDistance = event.getDistance(); state = STATE.SWIPING_TO_OPEN; updatePosition(-menu.getOffsetWidth() + event.getDistance()); } if (state == STATE.OPEN && event.getDirection() == DIRECTION.RIGHT_TO_LEFT) { state = STATE.SWIPING_TO_CLOSE; currentDirection = DIRECTION.RIGHT_TO_LEFT; startX = event.getTouch().getPageX(); maxDistance = event.getDistance(); updatePosition(-event.getDistance()); } }
private void handleSwipeStart(SwipeStartEvent event) { if (state == STATE.CLOSED && event.getDirection() == DIRECTION.LEFT_TO_RIGHT) { // ignore? if (event.getTouch().getPageX() > 40) { return; } currentDirection = DIRECTION.LEFT_TO_RIGHT; maxDistance = event.getDistance(); state = STATE.SWIPING_TO_OPEN; updatePosition(-menu.getOffsetWidth() + event.getDistance()); } if (state == STATE.OPEN && event.getDirection() == DIRECTION.RIGHT_TO_LEFT) { state = STATE.SWIPING_TO_CLOSE; currentDirection = DIRECTION.RIGHT_TO_LEFT; startX = event.getTouch().getPageX(); maxDistance = event.getDistance(); updatePosition(-event.getDistance()); } }
updatePosition(-menu.getOffsetWidth() + event.getDistance());
updatePosition(-menu.getOffsetWidth() + event.getDistance());