Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libUIComponent / src / org / gvsig / gui / beans / graphic / listeners / GraphicListener.java @ 10741

History | View | Annotate | Download (2.57 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
import javax.swing.event.TableModelEvent;
29

    
30
import org.gvsig.gui.beans.graphic.GraphicContainer;
31
import org.jfree.chart.ChartPanel;
32

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

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

    
59
                //System.out.println(cp.getScaleX());
60
                
61
        }
62

    
63
        public void mousePressed(MouseEvent e) {
64
                move = true;
65
        }
66

    
67
        public void mouseReleased(MouseEvent e) {
68
                move = false;                
69
        }
70
        
71
        public void setLabels(JLabel left, JLabel right){
72
                this.left = left;
73
                this.right = right;        
74
        }
75
        
76
        public void mouseMoved(MouseEvent e) {
77
                        
78
        }
79

    
80
        private void initialize(){
81

    
82
        }
83
        
84
        public void actionPerformed(ActionEvent e) {
85
                
86
        }
87

    
88
        public void tableChanged(TableModelEvent e) {
89
                                
90
        }
91

    
92
        public void mouseClicked(MouseEvent e) {
93
                
94
        }
95

    
96
        public void mouseEntered(MouseEvent e) {
97
                                
98
        }
99

    
100
        public void mouseExited(MouseEvent e) {
101
                                
102
        }
103

    
104

    
105

    
106
}