1
2 package hoplugins.teamAnalyzer.ui.controller;
3
4 import hoplugins.teamAnalyzer.dao.DividerDAO;
5
6 import java.beans.PropertyChangeEvent;
7 import java.beans.PropertyChangeListener;
8
9
10 /***
11 * Properry listener for the divider of the JSPlitPanes
12 *
13 * @author <a href=mailto:draghetto@users.sourceforge.net>Massimiliano Amato</a>
14 */
15 public class DividerListener implements PropertyChangeListener {
16
17
18 private String key = "";
19
20
21
22 /***
23 * Creates a new DividerListener object.
24 *
25 * @param _key the key to be used for storing
26 */
27 public DividerListener(String _key) {
28 key = _key;
29 }
30
31
32
33 /***
34 * Action performed event listener, store the key in the Database
35 *
36 * @param e the event
37 */
38 public void propertyChange(PropertyChangeEvent e) {
39 Number value = (Number) e.getNewValue();
40 int newDivLoc = value.intValue();
41
42 DividerDAO.setDividerPosition(key, newDivLoc);
43 }
44 }