|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.plaf.metal.MetalRootPaneUI.MouseInputHandler
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 | |
private int |
dragCursor
Used to determine the corner the resize is occuring from. |
private int |
dragHeight
Height of the window when the drag started. |
private int |
dragOffsetX
X location the mouse went down on for a drag operation. |
private int |
dragOffsetY
Y location the mouse went down on for a drag operation. |
private int |
dragWidth
Width of the window when the drag started. |
private boolean |
isMovingWindow
Set to true if the drag operation is moving the window. |
Constructor Summary | |
private |
MetalRootPaneUI.MouseInputHandler()
|
Method Summary | |
private void |
adjust(Rectangle bounds,
Dimension min,
int deltaX,
int deltaY,
int deltaWidth,
int deltaHeight)
|
private int |
calculateCorner(Component c,
int x,
int y)
Returns the corner that contains the point x ,
y , or -1 if the position doesn't match a corner. |
private int |
calculatePosition(int spot,
int width)
Returns an integer indicating the position of spot
in width . |
private int |
getCursor(int corner)
Returns the Cursor to render for the specified corner. |
void |
mouseClicked(MouseEvent ev)
Invoked when the mouse button has been clicked (pressed and released) on a component. |
void |
mouseDragged(MouseEvent ev)
Invoked when a mouse button is pressed on a component and then dragged. |
void |
mouseEntered(MouseEvent ev)
Invoked when the mouse enters a component. |
void |
mouseExited(MouseEvent ev)
Invoked when the mouse exits a component. |
void |
mouseMoved(MouseEvent ev)
Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed. |
void |
mousePressed(MouseEvent ev)
Invoked when a mouse button has been pressed on a component. |
void |
mouseReleased(MouseEvent ev)
Invoked when a mouse button has been released on a component. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean isMovingWindow
private int dragCursor
private int dragOffsetX
private int dragOffsetY
private int dragWidth
private int dragHeight
Constructor Detail |
private MetalRootPaneUI.MouseInputHandler()
Method Detail |
public void mousePressed(MouseEvent ev)
MouseListener
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent ev)
MouseListener
mouseReleased
in interface MouseListener
public void mouseMoved(MouseEvent ev)
MouseMotionListener
mouseMoved
in interface MouseMotionListener
private void adjust(Rectangle bounds, Dimension min, int deltaX, int deltaY, int deltaWidth, int deltaHeight)
public void mouseDragged(MouseEvent ev)
MouseMotionListener
MOUSE_DRAGGED
events will continue to be
delivered to the component where the drag originated until the
mouse button is released (regardless of whether the mouse position
is within the bounds of the component).
Due to platform-dependent Drag&Drop implementations,
MOUSE_DRAGGED
events may not be delivered during a native
Drag&Drop operation.
mouseDragged
in interface MouseMotionListener
public void mouseEntered(MouseEvent ev)
MouseListener
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent ev)
MouseListener
mouseExited
in interface MouseListener
public void mouseClicked(MouseEvent ev)
MouseListener
mouseClicked
in interface MouseListener
private int calculateCorner(Component c, int x, int y)
x
,
y
, or -1 if the position doesn't match a corner.
private int getCursor(int corner)
private int calculatePosition(int spot, int width)
spot
in width
. The return value will be:
0 if < BORDER_DRAG_THICKNESS
1 if < CORNER_DRAG_WIDTH
2 if >= CORNER_DRAG_WIDTH && < width - BORDER_DRAG_THICKNESS
3 if >= width - CORNER_DRAG_WIDTH
4 if >= width - BORDER_DRAG_THICKNESS
5 otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |