Statistics
| Revision:

root / trunk / libraries / libUIComponent / src / org / gvsig / gui / beans / graphic / listeners / GraphicListener.java @ 11042

History | View | Annotate | Download (2.4 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
*/
19
package org.gvsig.gui.beans.graphic.listeners;
20

    
21
import java.awt.event.ActionEvent;
22
import java.awt.event.ActionListener;
23
import java.awt.event.MouseEvent;
24
import java.awt.event.MouseListener;
25
import java.awt.event.MouseMotionListener;
26

    
27
import javax.swing.JLabel;
28

    
29
/**
30
 * 
31
 * @author Nacho Brodin <brodin_ign@gva.es>
32
 *
33
 */
34
public class GraphicListener implements MouseListener, ActionListener, MouseMotionListener{
35
        private boolean                                        move = false;
36
        private JLabel                                        left = null;
37
        private JLabel                                        right = null;
38
        
39
        public GraphicListener() {
40
        }
41
        
42
        public void mouseDragged(MouseEvent e) {
43
                if(move){
44
                        if(e.getSource() == left)        
45
                                left.setLocation(left.getLocation().x + e.getX(), left.getLocation().y);
46
                        
47
                        if(e.getSource() == right)
48
                                right.setLocation(right.getLocation().x + e.getX(), right.getLocation().y);
49
                }        
50
                //ChartPanel cp = graphicContainer.getPGraphic().getChart();
51

    
52
                //System.out.println(cp.getScaleX());
53
                
54
        }
55

    
56
        public void mousePressed(MouseEvent e) {
57
                move = true;
58
        }
59

    
60
        public void mouseReleased(MouseEvent e) {
61
                move = false;                
62
        }
63
        
64
        public void setLabels(JLabel left, JLabel right){
65
                this.left = left;
66
                this.right = right;        
67
        }
68

    
69
        public void mouseClicked(MouseEvent e) {
70
                // TODO Auto-generated method stub
71
                
72
        }
73

    
74
        public void mouseEntered(MouseEvent e) {
75
                // TODO Auto-generated method stub
76
                
77
        }
78

    
79
        public void mouseExited(MouseEvent e) {
80
                // TODO Auto-generated method stub
81
                
82
        }
83

    
84
        public void actionPerformed(ActionEvent e) {
85
                // TODO Auto-generated method stub
86
                
87
        }
88

    
89
        public void mouseMoved(MouseEvent e) {
90
                // TODO Auto-generated method stub
91
                
92
        }
93
}