Warning: session_start(): open(/var/lib/php/sessions/sess_kkq55up13k9c88a2sng1s5ljbo, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
// This class uses the border of the component that caught
// the mouse event to determine the drag direction.
sclass WindowResizeDragger extends MouseAdapter {
int cornerSize = 10; // how big do we assume the corners are
MouseEvent mouseDownEvent;
JComponent src;
Window window;
Rect originalPosition;
int xDrag, yDrag; // -1, 0 or 1 depending on what we are dragging
*(MouseEvent *mouseDownEvent) {
if (mouseDownEvent == null) ret;
src = optCast JComponent(mouseDownEvent.getComponent());
if (src == null) ret;
window = getWindow(src);
if (window == null) ret;
srcBounds = toRect(boundsOnScreen(src));
originalPosition = toRect(getBounds(window));
Pt mouse = pt(mouseDownEvent.getXOnScreen(), mouseDownEvent.getYOnScreen());
if (distance(mouse.y, srcBounds.y2()) <= cornerSize)
dragY = 1;
else if (distance(mouse.y, srcBounds.y1()) <= cornerSize)
dragY = -1;
if (distance(mouse.x, srcBounds.x2()) <= cornerSize)
dragX = 1;
else if (distance(mouse.x, srcBounds.x1()) <= cornerSize)
dragX = -1;
addMouseAndMotionListener(src, this);
}
public void mouseDragged(MouseEvent e) {
updatePosition(e);
}
public void mouseReleased(MouseEvent e) {
if (e.getButton() != mouseDownEvent.getButton()) ret;
updatePosition(e);
removeMouseAdapter(window, this);
dragDone();
}
void updatePosition(MouseEvent e) {
Rect w = toRect(window.getBounds());
Pt a = topLeftCorner(w), b = bottomRightCorner(w);
Pt mouse = pt(mouseDownEvent.getXOnScreen(), mouseDownEvent.getYOnScreen());
if (dragX < 0)
a.x = mouse.x + originalPosition.x - mouseDownEvent.getXOnScreen();
else
b.x = mouse.x + originalPosition.x2() - mouseDownEvent.getXOnScreen();
if (dragY < 0)
a.y = mouse.y + originalPosition.y - mouseDownEvent.getYOnScreen();
else
b.y = mouse.y + originalPosition.y2() - mouseDownEvent.getYOnScreen();
window.setBounds(toRectangle(rectFromPoints(a, b)));
}
void dragDone {}
}