Methods Summary |
---|
public static javax.swing.JFrame | getFrame(java.awt.Container target)
if(target instanceof JFrame) {
return (JFrame)target;
}
return getFrame(target.getParent());
|
java.awt.Point | getScreenLocation(java.awt.event.MouseEvent e)
Point cursor = e.getPoint();
Point target_location = this.target.getLocationOnScreen();
return new Point(
(int)(target_location.getX()+cursor.getX()),
(int)(target_location.getY()+cursor.getY()));
|
public void | mouseClicked(java.awt.event.MouseEvent e)
|
public void | mouseDragged(java.awt.event.MouseEvent e)
Point current = this.getScreenLocation(e);
Point offset = new Point(
(int)current.getX()-(int)start_drag.getX(),
(int)current.getY()-(int)start_drag.getY());
JFrame frame = this.getFrame(target);
Point new_location = new Point(
(int)(this.start_loc.getX()+offset.getX()),
(int)(this.start_loc.getY()+offset.getY()));
frame.setLocation(new_location);
|
public void | mouseEntered(java.awt.event.MouseEvent e)
|
public void | mouseExited(java.awt.event.MouseEvent e)
|
public void | mouseMoved(java.awt.event.MouseEvent e)
|
public void | mousePressed(java.awt.event.MouseEvent e)
this.start_drag = this.getScreenLocation(e);
this.start_loc = this.getFrame(this.target).getLocation();
|
public void | mouseReleased(java.awt.event.MouseEvent e)
|