|
|
@ -54,6 +54,7 @@ public class UIEastResizableContainer extends JPanel { |
|
|
|
|
|
|
|
|
|
|
|
private static final int DRAG_GAP_SIZE = 10; |
|
|
|
private static final int DRAG_GAP_SIZE = 10; |
|
|
|
private Point dragPoint; |
|
|
|
private Point dragPoint; |
|
|
|
|
|
|
|
private boolean dragging; |
|
|
|
|
|
|
|
|
|
|
|
public UIEastResizableContainer() { |
|
|
|
public UIEastResizableContainer() { |
|
|
|
this(new JPanel(), new JPanel()); |
|
|
|
this(new JPanel(), new JPanel()); |
|
|
@ -71,13 +72,21 @@ public class UIEastResizableContainer extends JPanel { |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
if (isEnableDrag(e)) { |
|
|
|
if (isEnableDrag(e)) { |
|
|
|
dragPoint = e.getPoint(); |
|
|
|
dragPoint = e.getPoint(); |
|
|
|
|
|
|
|
dragging = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void mouseDragged(MouseEvent e) { |
|
|
|
public void mouseDragged(MouseEvent e) { |
|
|
|
|
|
|
|
if (dragging) { |
|
|
|
resizePanel(e); |
|
|
|
resizePanel(e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void mouseReleased(MouseEvent e) { |
|
|
|
|
|
|
|
dragging = false; |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
addMouseListener(mouseAdapter); |
|
|
|
addMouseListener(mouseAdapter); |
|
|
|