Statistics
| Revision:

root / trunk / extensions / extGraph_predes / src / com / iver / cit / gvsig / graph / preferences / RoutePage.java @ 8432

History | View | Annotate | Download (4.01 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
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41

    
42
/* CVS MESSAGES:
43
 *
44
 * $Id: RoutePage.java 8432 2006-10-30 19:30:35Z jaume $
45
 * $Log$
46
 * Revision 1.7  2006-10-30 19:30:35  jaume
47
 * *** empty log message ***
48
 *
49
 * Revision 1.6  2006/10/26 16:31:21  jaume
50
 * GUI
51
 *
52
 * Revision 1.5  2006/10/26 07:46:58  jaume
53
 * *** empty log message ***
54
 *
55
 * Revision 1.4  2006/10/25 10:50:41  jaume
56
 * movement of classes and gui stuff
57
 *
58
 * Revision 1.3  2006/10/24 16:31:40  jaume
59
 * *** empty log message ***
60
 *
61
 * Revision 1.2  2006/10/23 16:00:20  jaume
62
 * *** empty log message ***
63
 *
64
 * Revision 1.1  2006/10/23 08:05:39  jaume
65
 * GUI
66
 *
67
 *
68
 */
69
package com.iver.cit.gvsig.graph.preferences;
70

    
71
import java.awt.Dimension;
72
import java.awt.event.ActionEvent;
73
import java.awt.event.ActionListener;
74

    
75
import javax.swing.BorderFactory;
76
import javax.swing.ImageIcon;
77
import javax.swing.JPanel;
78

    
79
import org.gvsig.gui.beans.swing.JButton;
80

    
81
import com.iver.andami.PluginServices;
82
import com.iver.andami.preferences.AbstractPreferencePage;
83
import com.iver.andami.preferences.StoreException;
84
import com.iver.cit.gvsig.fmap.core.FShape;
85
import com.iver.cit.gvsig.fmap.core.ISymbol;
86
import com.iver.cit.gvsig.gvsig.gui.styling.SymbolPreview;
87
import com.iver.cit.gvsig.gvsig.gui.styling.SymbolSelector;
88

    
89
public class RoutePage extends AbstractPreferencePage {
90
        private ImageIcon icon;
91
        private SymbolPreview symbolPreview;
92
        private JButton btnChangeSymbol;
93

    
94
        public RoutePage() {
95
                icon = new ImageIcon(this.getClass().getClassLoader().getResource(
96
                                "images/net-analyst-icon.png"));
97
                symbolPreview = new SymbolPreview();
98
                symbolPreview.setPreferredSize(new Dimension(100, 100));
99
                symbolPreview.setBorder(BorderFactory.createBevelBorder(1));
100

    
101
                JPanel aux = new JPanel();
102
                aux.add(symbolPreview);
103
                addComponent(PluginServices.getText(this, "use_symbol") +":", aux);
104
                aux = new JPanel();
105
                aux.add(btnChangeSymbol = new JButton(PluginServices.getText(this, "change")));
106
                btnChangeSymbol.addActionListener(new ActionListener() {
107
                        public void actionPerformed(ActionEvent e) {
108
                                SymbolSelector symbSelec = new SymbolSelector(null, FShape.POLYGON);
109
                                PluginServices.getMDIManager().addWindow(symbSelec);
110
                                ISymbol sym = symbSelec.getSymbol();
111
                                if (sym!=null)
112
                                        symbolPreview.setSymbol(sym);
113
                        }
114
                });
115
                addComponent("", aux);
116
        }
117

    
118
        public void storeValues() throws StoreException {
119
                // TODO Auto-generated method stub
120

    
121
        }
122

    
123
        public void setChangesApplied() {
124
                // TODO Auto-generated method stub
125

    
126
        }
127

    
128
        public String getID() {
129
                return getClass().getName();
130
        }
131

    
132
        public String getTitle() {
133
                return PluginServices.getText(this, "net_analyst");
134
        }
135

    
136
        public JPanel getPanel() {
137
                return this;
138
        }
139

    
140
        public void initializeValues() {
141
                // TODO Auto-generated method stub
142

    
143
        }
144

    
145
        public void initializeDefaults() {
146
                // TODO Auto-generated method stub
147

    
148
        }
149

    
150
        public ImageIcon getIcon() {
151
                return icon;
152
        }
153

    
154
        public boolean isValueChanged() {
155
                // TODO Auto-generated method stub
156
                return false;
157
        }
158

    
159
}