diff options
Diffstat (limited to 'src/cppcheckplus/outlookpanel/MyOutlookSplitListener.java')
-rw-r--r-- | src/cppcheckplus/outlookpanel/MyOutlookSplitListener.java | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/src/cppcheckplus/outlookpanel/MyOutlookSplitListener.java b/src/cppcheckplus/outlookpanel/MyOutlookSplitListener.java index b65e706..c78b1c5 100644 --- a/src/cppcheckplus/outlookpanel/MyOutlookSplitListener.java +++ b/src/cppcheckplus/outlookpanel/MyOutlookSplitListener.java | |||
@@ -1,33 +1,27 @@ | |||
1 | |||
2 | package cppcheckplus.outlookpanel; | 1 | package cppcheckplus.outlookpanel; |
3 | 2 | ||
3 | import cppcheckplus.control.MyHeader; | ||
4 | import cppcheckplus.control.MyListSplitListener; | ||
4 | import java.awt.Dimension; | 5 | import java.awt.Dimension; |
5 | import java.awt.Point; | 6 | import java.awt.Point; |
6 | import java.awt.event.MouseEvent; | 7 | import java.awt.event.MouseEvent; |
7 | import javax.swing.JComponent; | 8 | import javax.swing.JComponent; |
8 | 9 | ||
9 | import cppcheckplus.control.MyHeader; | 10 | public class MyOutlookSplitListener extends MyListSplitListener { |
10 | import cppcheckplus.control.MyListSplitListener; | 11 | public MyOutlookSplitListener(MyHeader header) { |
11 | 12 | super(header); | |
12 | public class MyOutlookSplitListener extends MyListSplitListener | 13 | } |
13 | { | ||
14 | public MyOutlookSplitListener(MyHeader header) | ||
15 | { | ||
16 | super(header); | ||
17 | } | ||
18 | 14 | ||
19 | public void mouseDragged(MouseEvent e) | 15 | public void mouseDragged(MouseEvent e) { |
20 | { | 16 | if (!header.isShrinked() && lastPoint != null) { |
21 | if (!header.isShrinked() && lastPoint != null) | 17 | JComponent parent = (JComponent) header.getParent(); |
22 | { | 18 | Dimension size = parent.getPreferredSize(); |
23 | JComponent parent = (JComponent)header.getParent(); | 19 | Point thisPoint = e.getPoint(); |
24 | Dimension size = parent.getPreferredSize(); | 20 | int xMovement = thisPoint.x - lastPoint.x; |
25 | Point thisPoint = e.getPoint(); | 21 | size.width += xMovement; |
26 | int xMovement = thisPoint.x - lastPoint.x; | 22 | size.width = Math.max(size.width, 37); |
27 | size.width += xMovement; | 23 | parent.setPreferredSize(size); |
28 | size.width = Math.max(size.width, 37); | 24 | header.revalidateParent(); |
29 | parent.setPreferredSize(size); | 25 | } |
30 | header.revalidateParent(); | 26 | } |
31 | } | ||
32 | } | ||
33 | } | 27 | } |