/** * Checks to see if the given mouse position is inside of this element. */ private boolean isInside(@Nonnull final NiftyMouseInputEvent inputEvent) { return isMouseInsideElement(inputEvent.getMouseX(), inputEvent.getMouseY()); }
public boolean isInsideFalloff(final int x, final int y) { if (falloff != null && falloff.getFalloffConstraint() != HoverFalloffConstraint.none) { return falloff.isInside(element, x, y); } else { return element.isMouseInsideElement(x, y); } }
private boolean isCursorOnGUI() { int height = app.getContext().getSettings().getHeight(); if (view.isVisible() && view.isMouseInsideElement((int) mousePosition.x, height - (int) mousePosition.y)) { for (Element e : view.getChildren()) { if (e.isVisible() && e.isMouseInsideElement((int) mousePosition.x, height - (int) mousePosition.y)) { return true; } } return false; } return true; }
boolean mouseInsideAndVisible = element.isVisibleWithParent() && element.isMouseInsideElement(x, y); if (mouseInsideAndVisible && isDroppable(element)) {
boolean mouseInsideAndVisible = element.isVisibleWithParent() && element.isMouseInsideElement(x, y); if (mouseInsideAndVisible && isDroppable(element)) {
/** * Called by the dragging function to start a dragging operation. * * @param mouseX mouse x * @param mouseY mouse y */ private void dragStart(final int mouseX, final int mouseY) { if (dragged || triedDragging) { return; } triedDragging = true; Element draggable = getElement(); if (draggable == null) { return; } originalParent = draggable.getParent(); originalPositionX = draggable.getX(); originalPositionY = draggable.getY(); originalConstraintX = draggable.getConstraintX(); originalConstraintY = draggable.getConstraintY(); dragStartX = mouseX; dragStartY = mouseY; if (handle != null && handle.isMouseInsideElement(mouseX, mouseY)) { moveDraggableToPopup(); dragged = true; notifyObserversDragStarted(); } else { moveToFront(); } }
/** * Called by the dragging function to start a dragging operation. * * @param mouseX mouse x * @param mouseY mouse y */ private void dragStart(final int mouseX, final int mouseY) { if (dragged || triedDragging) { return; } triedDragging = true; Element draggable = getElement(); if (draggable == null) { return; } originalParent = draggable.getParent(); originalPositionX = draggable.getX(); originalPositionY = draggable.getY(); originalConstraintX = draggable.getConstraintX(); originalConstraintY = draggable.getConstraintY(); dragStartX = mouseX; dragStartY = mouseY; if (handle != null && handle.isMouseInsideElement(mouseX, mouseY)) { moveDraggableToPopup(); dragged = true; notifyObserversDragStarted(); } else { moveToFront(); } }