root / trunk / libraries / libUIComponent / src / org / gvsig / gui / beans / graphic / listeners / GraphicListener.java @ 11004
History | View | Annotate | Download (2.46 KB)
1 | 10741 | nacho | /* 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 | 10962 | bsanchez | import org.gvsig.gui.beans.graphic.GraphicContainer; |
30 | |||
31 | 10741 | nacho | /**
|
32 | *
|
||
33 | * @author Nacho Brodin <brodin_ign@gva.es>
|
||
34 | *
|
||
35 | */
|
||
36 | public class GraphicListener implements MouseListener, ActionListener, MouseMotionListener{ |
||
37 | private boolean move = false; |
||
38 | private JLabel left = null; |
||
39 | private JLabel right = null; |
||
40 | |||
41 | 11004 | bsanchez | public GraphicListener() {
|
42 | 10962 | bsanchez | } |
43 | |||
44 | 10741 | nacho | public void mouseDragged(MouseEvent e) { |
45 | if(move){
|
||
46 | if(e.getSource() == left)
|
||
47 | left.setLocation(left.getLocation().x + e.getX(), left.getLocation().y); |
||
48 | |||
49 | if(e.getSource() == right)
|
||
50 | right.setLocation(right.getLocation().x + e.getX(), right.getLocation().y); |
||
51 | } |
||
52 | 10885 | bsanchez | //ChartPanel cp = graphicContainer.getPGraphic().getChart();
|
53 | 10741 | nacho | |
54 | //System.out.println(cp.getScaleX());
|
||
55 | |||
56 | } |
||
57 | |||
58 | public void mousePressed(MouseEvent e) { |
||
59 | move = true;
|
||
60 | } |
||
61 | |||
62 | public void mouseReleased(MouseEvent e) { |
||
63 | move = false;
|
||
64 | } |
||
65 | |||
66 | public void setLabels(JLabel left, JLabel right){ |
||
67 | this.left = left;
|
||
68 | this.right = right;
|
||
69 | } |
||
70 | |||
71 | public void mouseClicked(MouseEvent e) { |
||
72 | 10885 | bsanchez | // TODO Auto-generated method stub
|
73 | 10741 | nacho | |
74 | } |
||
75 | |||
76 | public void mouseEntered(MouseEvent e) { |
||
77 | 10885 | bsanchez | // TODO Auto-generated method stub
|
78 | |||
79 | 10741 | nacho | } |
80 | |||
81 | public void mouseExited(MouseEvent e) { |
||
82 | 10885 | bsanchez | // TODO Auto-generated method stub
|
83 | |||
84 | 10741 | nacho | } |
85 | |||
86 | 10885 | bsanchez | public void actionPerformed(ActionEvent e) { |
87 | // TODO Auto-generated method stub
|
||
88 | |||
89 | } |
||
90 | 10741 | nacho | |
91 | 10885 | bsanchez | public void mouseMoved(MouseEvent e) { |
92 | // TODO Auto-generated method stub
|
||
93 | |||
94 | } |
||
95 | } |