Statistics
| Revision:

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

History | View | Annotate | Download (2.58 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
import org.gvsig.gui.beans.graphic.GraphicContainer;
30

    
31
/**
32
 * 
33
 * @author Nacho Brodin <brodin_ign@gva.es>
34
 *
35
 */
36
public class GraphicListener implements MouseListener, ActionListener, MouseMotionListener{
37

    
38
        private GraphicContainer                graphicContainer = null;
39
        private boolean                                        move = false;
40
        private JLabel                                        left = null;
41
        private JLabel                                        right = null;
42
        
43
        public GraphicListener(GraphicContainer graphicContainer){
44
                this.graphicContainer = graphicContainer;
45
        }
46
        
47
        public void mouseDragged(MouseEvent e) {
48
                if(move){
49
                        if(e.getSource() == left)        
50
                                left.setLocation(left.getLocation().x + e.getX(), left.getLocation().y);
51
                        
52
                        if(e.getSource() == right)
53
                                right.setLocation(right.getLocation().x + e.getX(), right.getLocation().y);
54
                }        
55
                //ChartPanel cp = graphicContainer.getPGraphic().getChart();
56

    
57
                //System.out.println(cp.getScaleX());
58
                
59
        }
60

    
61
        public void mousePressed(MouseEvent e) {
62
                move = true;
63
        }
64

    
65
        public void mouseReleased(MouseEvent e) {
66
                move = false;                
67
        }
68
        
69
        public void setLabels(JLabel left, JLabel right){
70
                this.left = left;
71
                this.right = right;        
72
        }
73

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

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

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

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

    
94
        public void mouseMoved(MouseEvent e) {
95
                // TODO Auto-generated method stub
96
                
97
        }
98
}