Class RadianceRootPaneUI.MouseInputHandler
java.lang.Object
org.pushingpixels.radiance.theming.internal.ui.RadianceRootPaneUI.MouseInputHandler
- All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener, MouseInputListener
- Enclosing class:
RadianceRootPaneUI
MouseInputHandler is responsible for handling resize/moving of the Window. It sets the cursor
directly on the Window when then mouse moves over a hot spot.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate RadianceRootPaneUI.CursorStateprivate intUsed to determine the corner the resize is occurring from.private intHeight of the window when the drag started.private intX location the mouse went down on for a drag operation.private intY location the mouse went down on for a drag operation.private intWidth of the window when the drag started.private booleanprivate booleanSet to true if the drag operation is moving the window. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidAdjusts the bounds.private intcalculateCorner(Window w, int x, int y) Returns the corner that contains the pointx,y, or -1 if the position doesn't match a corner.private intcalculatePosition(int spot, int width) Returns an integer indicating the position ofspotinwidth.private intgetCursor(int corner) Returns the Cursor to render for the specified corner.voidvoidvoidvoidvoidmouseMoved(MouseEvent ev) voidvoid
-
Field Details
-
isMovingWindow
private boolean isMovingWindowSet to true if the drag operation is moving the window. -
isMousePressed
private boolean isMousePressed -
dragCursor
private int dragCursorUsed to determine the corner the resize is occurring from. -
dragOffsetX
private int dragOffsetXX location the mouse went down on for a drag operation. -
dragOffsetY
private int dragOffsetYY location the mouse went down on for a drag operation. -
dragWidth
private int dragWidthWidth of the window when the drag started. -
dragHeight
private int dragHeightHeight of the window when the drag started. -
cursorState
-
-
Constructor Details
-
MouseInputHandler
private MouseInputHandler()
-
-
Method Details
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
adjust
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
calculateCorner
Returns the corner that contains the pointx,y, or -1 if the position doesn't match a corner.- Parameters:
w- Window.x- X coordinate.y- Y coordinate.- Returns:
- Corner that contains the specified point.
-
getCursor
private int getCursor(int corner) Returns the Cursor to render for the specified corner. This returns 0 if the corner doesn't map to a valid Cursor- Parameters:
corner- Corner- Returns:
- Cursor to render for the specified corner.
-
calculatePosition
private int calculatePosition(int spot, int width) Returns an integer indicating the position ofspotinwidth. The return value will be: 0 if invalid input: '<' BORDER_DRAG_THICKNESS 1 if invalid input: '<' CORNER_DRAG_WIDTH 2 if >= CORNER_DRAG_WIDTH invalid input: '&'invalid input: '&' invalid input: '<' width - BORDER_DRAG_THICKNESS 3 if >= width - CORNER_DRAG_WIDTH 4 if >= width - BORDER_DRAG_THICKNESS 5 otherwise- Parameters:
spot- Spot.width- Width.- Returns:
- The position of spot in width.
-