Revision 23976
tags/tmp_build/applications/appgvSIG/.project | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<projectDescription> |
|
3 |
<name>appgvSIG</name> |
|
4 |
<comment></comment> |
|
5 |
<projects> |
|
6 |
</projects> |
|
7 |
<buildSpec> |
|
8 |
<buildCommand> |
|
9 |
<name>org.eclipse.jdt.core.javabuilder</name> |
|
10 |
<arguments> |
|
11 |
</arguments> |
|
12 |
</buildCommand> |
|
13 |
<buildCommand> |
|
14 |
<name>de.loskutov.FileSync.FSBuilder</name> |
|
15 |
<arguments> |
|
16 |
</arguments> |
|
17 |
</buildCommand> |
|
18 |
</buildSpec> |
|
19 |
<natures> |
|
20 |
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature> |
|
21 |
<nature>org.eclipse.jdt.core.javanature</nature> |
|
22 |
<nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature> |
|
23 |
</natures> |
|
24 |
</projectDescription> |
|
0 | 25 |
tags/tmp_build/applications/appgvSIG/build.number | ||
---|---|---|
1 |
#Build Number for ANT. Do not edit! |
|
2 |
#Wed Jun 11 09:31:43 CEST 2008 |
|
3 |
build.number=1211 |
|
0 | 4 |
tags/tmp_build/applications/appgvSIG/src/com/iver/cit/gvsig/PrintProperties.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 19-may-2004 |
|
3 |
* |
|
4 |
* To change the template for this generated file go to |
|
5 |
* Window>Preferences>Java>Code Generation>Code and Comments |
|
6 |
*/ |
|
7 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
8 |
* |
|
9 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
10 |
* |
|
11 |
* This program is free software; you can redistribute it and/or |
|
12 |
* modify it under the terms of the GNU General Public License |
|
13 |
* as published by the Free Software Foundation; either version 2 |
|
14 |
* of the License, or (at your option) any later version. |
|
15 |
* |
|
16 |
* This program is distributed in the hope that it will be useful, |
|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
19 |
* GNU General Public License for more details. |
|
20 |
* |
|
21 |
* You should have received a copy of the GNU General Public License |
|
22 |
* along with this program; if not, write to the Free Software |
|
23 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
24 |
* |
|
25 |
* For more information, contact: |
|
26 |
* |
|
27 |
* Generalitat Valenciana |
|
28 |
* Conselleria d'Infraestructures i Transport |
|
29 |
* Av. Blasco Ib??ez, 50 |
|
30 |
* 46010 VALENCIA |
|
31 |
* SPAIN |
|
32 |
* |
|
33 |
* +34 963862235 |
|
34 |
* gvsig@gva.es |
|
35 |
* www.gvsig.gva.es |
|
36 |
* |
|
37 |
* or |
|
38 |
* |
|
39 |
* IVER T.I. S.A |
|
40 |
* Salamanca 50 |
|
41 |
* 46005 Valencia |
|
42 |
* Spain |
|
43 |
* |
|
44 |
* +34 963163400 |
|
45 |
* dac@iver.es |
|
46 |
*/ |
|
47 |
package com.iver.cit.gvsig; |
|
48 |
|
|
49 |
/** |
|
50 |
*/ |
|
51 |
import java.awt.geom.Rectangle2D; |
|
52 |
|
|
53 |
import com.iver.andami.PluginServices; |
|
54 |
import com.iver.andami.plugins.Extension; |
|
55 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
56 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
|
57 |
|
|
58 |
|
|
59 |
/** |
|
60 |
* DOCUMENT ME! |
|
61 |
* |
|
62 |
* @author vcn |
|
63 |
*/ |
|
64 |
public class PrintProperties extends Extension /*implements IPreferenceExtension*/ { |
|
65 |
private Layout l; |
|
66 |
// private static final IPreference printPropertiesPage = new PrintPropertiesPage(); |
|
67 |
// private Paper paper; |
|
68 |
Rectangle2D.Double aux = null; |
|
69 |
|
|
70 |
/** |
|
71 |
* DOCUMENT ME! |
|
72 |
* |
|
73 |
* @param s DOCUMENT ME! |
|
74 |
*/ |
|
75 |
public void execute(String s) { |
|
76 |
l = (Layout) PluginServices.getMDIManager().getActiveWindow(); |
|
77 |
l.showFConfig(); |
|
78 |
//l.showPagePropertiesWindow(Print.printerJob); |
|
79 |
} |
|
80 |
|
|
81 |
/** |
|
82 |
* DOCUMENT ME! |
|
83 |
* |
|
84 |
* @return DOCUMENT ME! |
|
85 |
*/ |
|
86 |
public boolean isVisible() { |
|
87 |
IWindow f = PluginServices.getMDIManager().getActiveWindow(); |
|
88 |
|
|
89 |
if (f == null) { |
|
90 |
return false; |
|
91 |
} |
|
92 |
|
|
93 |
return (f instanceof Layout); |
|
94 |
} |
|
95 |
|
|
96 |
/** |
|
97 |
* @see com.iver.mdiApp.plugins.IExtension#isEnabled() |
|
98 |
*/ |
|
99 |
public boolean isEnabled() { |
|
100 |
Layout f = (Layout) PluginServices.getMDIManager().getActiveWindow(); |
|
101 |
|
|
102 |
if (f == null || !f.getLayoutContext().isEditable()) { |
|
103 |
return false; |
|
104 |
} |
|
105 |
|
|
106 |
return true; |
|
107 |
} |
|
108 |
|
|
109 |
/** |
|
110 |
* @see com.iver.andami.plugins.IExtension#initialize() |
|
111 |
*/ |
|
112 |
public void initialize() { |
|
113 |
registerIcons(); |
|
114 |
} |
|
115 |
|
|
116 |
private void registerIcons(){ |
|
117 |
PluginServices.getIconTheme().registerDefault( |
|
118 |
"layout-page-setup", |
|
119 |
this.getClass().getClassLoader().getResource("images/Frame.gif") |
|
120 |
); |
|
121 |
PluginServices.getIconTheme().registerDefault( |
|
122 |
"prepare-page-icon", |
|
123 |
this.getClass().getClassLoader().getResource("images/prepare-page.png") |
|
124 |
); |
|
125 |
PluginServices.getIconTheme().registerDefault( |
|
126 |
"portrait-page-setup", |
|
127 |
this.getClass().getClassLoader().getResource("images/portrait-page.png") |
|
128 |
); |
|
129 |
PluginServices.getIconTheme().registerDefault( |
|
130 |
"landscape-page-setup", |
|
131 |
this.getClass().getClassLoader().getResource("images/landscape-page.png") |
|
132 |
); |
|
133 |
} |
|
134 |
|
|
135 |
// public IPreference getPreferencesPage() { |
|
136 |
// return printPropertiesPage; |
|
137 |
// } |
|
138 |
} |
|
0 | 139 |
tags/tmp_build/applications/appgvSIG/src/com/iver/cit/gvsig/ExportLayoutExtension.java | ||
---|---|---|
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$ |
|
45 |
* $Log$ |
|
46 |
* Revision 1.2 2006-12-20 14:40:37 caballero |
|
47 |
* Remodelado Layout |
|
48 |
* |
|
49 |
* Revision 1.1 2006/11/06 15:14:52 jaume |
|
50 |
* new extension for pdf and ps |
|
51 |
* |
|
52 |
* |
|
53 |
*/ |
|
54 |
package com.iver.cit.gvsig; |
|
55 |
|
|
56 |
import com.iver.andami.PluginServices; |
|
57 |
import com.iver.andami.plugins.Extension; |
|
58 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
59 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
|
60 |
/** |
|
61 |
* Extension for exporting the layout to PDF or PostScript. |
|
62 |
* |
|
63 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
64 |
*/ |
|
65 |
public class ExportLayoutExtension extends Extension { |
|
66 |
|
|
67 |
private Layout layout; |
|
68 |
|
|
69 |
public void initialize() { |
|
70 |
// TODO Auto-generated method stub |
|
71 |
registerIcons(); |
|
72 |
} |
|
73 |
|
|
74 |
private void registerIcons(){ |
|
75 |
PluginServices.getIconTheme().registerDefault( |
|
76 |
"layout-export-pdf", |
|
77 |
this.getClass().getClassLoader().getResource("images/pdf.png") |
|
78 |
); |
|
79 |
|
|
80 |
PluginServices.getIconTheme().registerDefault( |
|
81 |
"layout-export-ps", |
|
82 |
this.getClass().getClassLoader().getResource("images/ps.png") |
|
83 |
); |
|
84 |
} |
|
85 |
|
|
86 |
/** |
|
87 |
* @see com.iver.andami.plugins.IExtension#execute(java.lang.String) |
|
88 |
*/ |
|
89 |
public void execute(String s) { |
|
90 |
layout = (Layout) PluginServices.getMDIManager().getActiveWindow(); |
|
91 |
if (s.equals("PDF")){ |
|
92 |
layout.layoutToPDF(); |
|
93 |
} else if (s.equals("PS")){ |
|
94 |
layout.layoutToPS(); |
|
95 |
} |
|
96 |
} |
|
97 |
|
|
98 |
public boolean isEnabled() { |
|
99 |
return true; |
|
100 |
} |
|
101 |
|
|
102 |
public boolean isVisible() { |
|
103 |
IWindow f = PluginServices.getMDIManager().getActiveWindow(); |
|
104 |
|
|
105 |
if (f == null) { |
|
106 |
return false; |
|
107 |
} |
|
108 |
|
|
109 |
if (f instanceof Layout) { |
|
110 |
// Layout layout = (Layout) f; |
|
111 |
|
|
112 |
return true; //layout.m_Display.getMapControl().getMapContext().getLayers().layerCount() > 0; |
|
113 |
} else { |
|
114 |
return false; |
|
115 |
} |
|
116 |
} |
|
117 |
|
|
118 |
} |
|
0 | 119 |
tags/tmp_build/applications/appgvSIG/src/com/iver/cit/gvsig/InitialWarningExtension.java | ||
---|---|---|
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$ |
|
45 |
* $Log$ |
|
46 |
* Revision 1.4 2006-10-02 13:52:34 jaume |
|
47 |
* organize impots |
|
48 |
* |
|
49 |
* Revision 1.3 2006/08/29 07:56:27 cesar |
|
50 |
* Rename the *View* family of classes to *Window* (ie: SingletonView to SingletonWindow, ViewInfo to WindowInfo, etc) |
|
51 |
* |
|
52 |
* Revision 1.2 2006/08/29 07:13:53 cesar |
|
53 |
* Rename class com.iver.andami.ui.mdiManager.View to com.iver.andami.ui.mdiManager.IWindow |
|
54 |
* |
|
55 |
* Revision 1.1 2006/05/25 16:27:21 jaume |
|
56 |
* *** empty log message *** |
|
57 |
* |
|
58 |
* |
|
59 |
*/ |
|
60 |
package com.iver.cit.gvsig; |
|
61 |
|
|
62 |
import java.awt.Color; |
|
63 |
import java.awt.Component; |
|
64 |
import java.awt.Window; |
|
65 |
|
|
66 |
import javax.swing.JButton; |
|
67 |
import javax.swing.JCheckBox; |
|
68 |
import javax.swing.JLabel; |
|
69 |
import javax.swing.JPanel; |
|
70 |
import javax.swing.JWindow; |
|
71 |
import javax.swing.border.TitledBorder; |
|
72 |
|
|
73 |
import com.iver.andami.PluginServices; |
|
74 |
import com.iver.andami.plugins.Extension; |
|
75 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
76 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
|
77 |
|
|
78 |
public class InitialWarningExtension extends Extension { |
|
79 |
// public static Preferences fPrefs = Preferences.userRoot().node( "gvsig.initial_warkning" ); |
|
80 |
// private boolean show = fPrefs.getBoolean( "show_panel", true); |
|
81 |
private DlgWaring dlgWarning; |
|
82 |
/** |
|
83 |
* @see com.iver.andami.plugins.IExtension#isEnabled() |
|
84 |
*/ |
|
85 |
public boolean isEnabled() { |
|
86 |
return true; |
|
87 |
} |
|
88 |
|
|
89 |
/** |
|
90 |
* @see com.iver.mdiApp.plugins.IExtension#isVisible() |
|
91 |
*/ |
|
92 |
public boolean isVisible() { |
|
93 |
return true; |
|
94 |
} |
|
95 |
|
|
96 |
/** |
|
97 |
* @see com.iver.andami.plugins.IExtension#initialize() |
|
98 |
*/ |
|
99 |
public void initialize() { |
|
100 |
// if (show) { |
|
101 |
dlgWarning = new DlgWaring(); |
|
102 |
dlgWarning.setText(PluginServices.getText(this, "initial_warning")); |
|
103 |
dlgWarning.setVisible(true); |
|
104 |
// PluginServices.getMDIManager().addWindow(dlgWarning); |
|
105 |
// } |
|
106 |
|
|
107 |
} |
|
108 |
|
|
109 |
/** |
|
110 |
* @see com.iver.andami.plugins.IExtension#execute(java.lang.String) |
|
111 |
*/ |
|
112 |
public void execute(String actionCommand) { |
|
113 |
|
|
114 |
} |
|
115 |
|
|
116 |
private class DlgWaring extends JWindow{ |
|
117 |
|
|
118 |
private JButton btnOk = null; |
|
119 |
private JCheckBox chkBoxShowAgain = null; |
|
120 |
private JLabel lblText = null; |
|
121 |
private JPanel panel=null; |
|
122 |
private JPanel panel2; |
|
123 |
/** |
|
124 |
* This is the default constructor |
|
125 |
*/ |
|
126 |
public DlgWaring() { |
|
127 |
super((Window)PluginServices.getMainFrame()); |
|
128 |
Window window=(Window)PluginServices.getMainFrame(); |
|
129 |
setLocation(window.getWidth()/2+window.getX()-150,window.getHeight()/2+window.getY()-150); |
|
130 |
initialize(); |
|
131 |
this.setAlwaysOnTop(true); |
|
132 |
} |
|
133 |
|
|
134 |
public void setText(String string) { |
|
135 |
lblText.setText(string); |
|
136 |
} |
|
137 |
|
|
138 |
/** |
|
139 |
* This method initializes this |
|
140 |
* |
|
141 |
* @return void |
|
142 |
*/ |
|
143 |
private void initialize() { |
|
144 |
panel=new JPanel(); |
|
145 |
panel.setBackground(Color.black); |
|
146 |
panel.setLayout(null); |
|
147 |
panel.setBounds(0,0,300,300); |
|
148 |
panel2=new JPanel(); |
|
149 |
panel2.setLayout(null); |
|
150 |
panel2.setBounds(2,2,298,298); |
|
151 |
lblText = new JLabel(); |
|
152 |
lblText.setBounds(15, 15, 271, 200); |
|
153 |
lblText.setText("JLabel"); |
|
154 |
lblText.setBorder(new TitledBorder(PluginServices.getText(this, "warning"))); |
|
155 |
panel2.add(lblText); |
|
156 |
panel2.setSize((int)(panel.getSize().getWidth()-4),(int)(panel.getSize().getHeight()-4)); |
|
157 |
panel.add(panel2); |
|
158 |
this.setLayout(null); |
|
159 |
this.setSize(300, 300); |
|
160 |
this.add(getBtnOk(), null); |
|
161 |
// this.add(getChkBoxShowAgain(), null); |
|
162 |
this.add(panel, null); |
|
163 |
} |
|
164 |
|
|
165 |
/** |
|
166 |
* This method initializes btnOk |
|
167 |
* |
|
168 |
* @return javax.swing.JButton |
|
169 |
*/ |
|
170 |
private JButton getBtnOk() { |
|
171 |
if (btnOk == null) { |
|
172 |
btnOk = new JButton(); |
|
173 |
btnOk.setBounds(100, 250, 100, 20); |
|
174 |
btnOk.setText(PluginServices.getText(this, "aceptar")); |
|
175 |
btnOk.addActionListener(new java.awt.event.ActionListener() { |
|
176 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
177 |
dlgWarning.setVisible(false); |
|
178 |
dlgWarning.dispose(); |
|
179 |
// PluginServices.getMDIManager().closeWindow(dlgWarning); |
|
180 |
} |
|
181 |
}); |
|
182 |
} |
|
183 |
return btnOk; |
|
184 |
} |
|
185 |
|
|
186 |
/** |
|
187 |
* This method initializes chkBoxShowAgain |
|
188 |
* |
|
189 |
* @return javax.swing.JCheckBox |
|
190 |
*/ |
|
191 |
// private JCheckBox getChkBoxShowAgain() { |
|
192 |
// if (chkBoxShowAgain == null) { |
|
193 |
// chkBoxShowAgain = new JCheckBox(); |
|
194 |
// chkBoxShowAgain.setBounds(44, 116, 241, 21); |
|
195 |
// chkBoxShowAgain.setSelected(true); |
|
196 |
// chkBoxShowAgain.setText(PluginServices.getText(this, "show_this_dialog_next_startup")); |
|
197 |
// } |
|
198 |
// return chkBoxShowAgain; |
|
199 |
// } |
|
200 |
|
|
201 |
public WindowInfo getWindowInfo() { |
|
202 |
WindowInfo vi = new WindowInfo(WindowInfo.MODALDIALOG); |
|
203 |
vi.setWidth(300+8); |
|
204 |
vi.setHeight(250); |
|
205 |
vi.setTitle(PluginServices.getText(this, "warning")); |
|
206 |
return vi; |
|
207 |
} |
|
208 |
|
|
209 |
} // @jve:decl-index=0:visual-constraint="10,10" |
|
210 |
|
|
211 |
} |
|
0 | 212 |
tags/tmp_build/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutEditVertexExtension.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 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 |
package com.iver.cit.gvsig; |
|
42 |
|
|
43 |
import org.apache.log4j.Logger; |
|
44 |
|
|
45 |
import com.iver.andami.PluginServices; |
|
46 |
import com.iver.andami.plugins.Extension; |
|
47 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
48 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
|
49 |
|
|
50 |
|
|
51 |
/** |
|
52 |
* Extensi?n que contiene todas las herramientas de edici?n. |
|
53 |
* |
|
54 |
* @author Vicente Caballero Navarro |
|
55 |
*/ |
|
56 |
public class LayoutEditVertexExtension extends Extension { |
|
57 |
private static Logger logger = Logger.getLogger(LayoutEditVertexExtension.class.getName()); |
|
58 |
private Layout layout = null; |
|
59 |
|
|
60 |
/** |
|
61 |
* DOCUMENT ME! |
|
62 |
*/ |
|
63 |
public void initialize() { |
|
64 |
// TODO Auto-generated method stub |
|
65 |
registerIcons(); |
|
66 |
} |
|
67 |
|
|
68 |
private void registerIcons(){ |
|
69 |
PluginServices.getIconTheme().registerDefault( |
|
70 |
"layout-edit-vertex", |
|
71 |
this.getClass().getClassLoader().getResource("images/Select1.png") |
|
72 |
); |
|
73 |
} |
|
74 |
|
|
75 |
/** |
|
76 |
* DOCUMENT ME! |
|
77 |
* |
|
78 |
* @param s DOCUMENT ME! |
|
79 |
*/ |
|
80 |
public void execute(String s) { |
|
81 |
layout = (Layout) PluginServices.getMDIManager().getActiveWindow(); |
|
82 |
|
|
83 |
logger.debug("Comand : " + s); |
|
84 |
if (s.compareTo("VERTEX") == 0) { |
|
85 |
layout.getLayoutControl().setTool("layoutedit"); |
|
86 |
layout.getModel().setModified(true); |
|
87 |
} |
|
88 |
} |
|
89 |
|
|
90 |
/** |
|
91 |
* DOCUMENT ME! |
|
92 |
* |
|
93 |
* @return DOCUMENT ME! |
|
94 |
*/ |
|
95 |
public boolean isEnabled() { |
|
96 |
IWindow f = PluginServices.getMDIManager().getActiveWindow(); |
|
97 |
|
|
98 |
if (f == null) { |
|
99 |
return false; |
|
100 |
} |
|
101 |
|
|
102 |
if (f instanceof Layout) { |
|
103 |
Layout layout=(Layout)f; |
|
104 |
if (layout.getLayoutContext().isEditable()){ |
|
105 |
return true; |
|
106 |
// IFFrame[] fframes = layout.getFFrames(); |
|
107 |
// for (int i = 0; i < fframes.length; i++) { |
|
108 |
// if (fframes[i].getSelected() != IFFrame.NOSELECT |
|
109 |
// && fframes[i] instanceof IFFrameEditableVertex) { |
|
110 |
// return true; |
|
111 |
// } |
|
112 |
// } |
|
113 |
} |
|
114 |
} |
|
115 |
return false; |
|
116 |
} |
|
117 |
|
|
118 |
/** |
|
119 |
* DOCUMENT ME! |
|
120 |
* |
|
121 |
* @return DOCUMENT ME! |
|
122 |
*/ |
|
123 |
public boolean isVisible() { |
|
124 |
IWindow f = PluginServices.getMDIManager().getActiveWindow(); |
|
125 |
|
|
126 |
if (f == null) { |
|
127 |
return false; |
|
128 |
} |
|
129 |
|
|
130 |
if (f instanceof Layout) { |
|
131 |
// Layout layout = (Layout) f; |
|
132 |
return true; //layout.m_Display.getMapControl().getMapContext().getLayers().layerCount() > 0; |
|
133 |
} else { |
|
134 |
return false; |
|
135 |
} |
|
136 |
} |
|
137 |
} |
|
0 | 138 |
tags/tmp_build/applications/appgvSIG/src/com/iver/cit/gvsig/RemoveTableUnion.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig; |
|
2 |
|
|
3 |
import com.hardcode.driverManager.DriverLoadException; |
|
4 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
5 |
import com.iver.andami.PluginServices; |
|
6 |
import com.iver.andami.messages.NotificationManager; |
|
7 |
import com.iver.andami.plugins.Extension; |
|
8 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
9 |
import com.iver.cit.gvsig.project.documents.table.ProjectTable; |
|
10 |
import com.iver.cit.gvsig.project.documents.table.gui.Table; |
|
11 |
|
|
12 |
/** |
|
13 |
* @author Fernando Gonz?lez Cort?s |
|
14 |
*/ |
|
15 |
public class RemoveTableUnion extends Extension{ |
|
16 |
|
|
17 |
/** |
|
18 |
* @see com.iver.andami.plugins.IExtension#initialize() |
|
19 |
*/ |
|
20 |
public void initialize() { |
|
21 |
// TODO Auto-generated method stub |
|
22 |
|
|
23 |
} |
|
24 |
|
|
25 |
/** |
|
26 |
* @see com.iver.andami.plugins.IExtension#execute(java.lang.String) |
|
27 |
*/ |
|
28 |
public void execute(String actionCommand) { |
|
29 |
Table t = (Table) PluginServices.getMDIManager().getActiveWindow(); |
|
30 |
ProjectTable pt = t.getModel(); |
|
31 |
try { |
|
32 |
pt.restoreDataSource(); |
|
33 |
// Por si acaso ten?amos seleccionado un campo |
|
34 |
// de los de la uni?n, no seleccionamos |
|
35 |
// ning?n campo. |
|
36 |
t.clearSelectedFields(); |
|
37 |
|
|
38 |
} catch (ReadDriverException e) { |
|
39 |
NotificationManager.addError(e.getMessage(), e); |
|
40 |
} catch (DriverLoadException e) { |
|
41 |
// TODO Auto-generated catch block |
|
42 |
e.printStackTrace(); |
|
43 |
} |
|
44 |
t.getModel().setModified(true); |
|
45 |
} |
|
46 |
|
|
47 |
/** |
|
48 |
* @see com.iver.andami.plugins.IExtension#isEnabled() |
|
49 |
*/ |
|
50 |
public boolean isEnabled() { |
|
51 |
IWindow v = PluginServices.getMDIManager().getActiveWindow(); |
|
52 |
|
|
53 |
if (v == null) { |
|
54 |
return false; |
|
55 |
} |
|
56 |
|
|
57 |
if (v.getClass() == Table.class) { |
|
58 |
Table t = (Table) v; |
|
59 |
if (t.getModel().getOriginal() != null){ |
|
60 |
return true; |
|
61 |
} |
|
62 |
} |
|
63 |
return false; |
|
64 |
} |
|
65 |
|
|
66 |
/** |
|
67 |
* @see com.iver.andami.plugins.IExtension#isVisible() |
|
68 |
*/ |
|
69 |
public boolean isVisible() { |
|
70 |
IWindow v = PluginServices.getMDIManager().getActiveWindow(); |
|
71 |
|
|
72 |
if (v == null) { |
|
73 |
return false; |
|
74 |
} |
|
75 |
|
|
76 |
if (v instanceof Table) { |
|
77 |
return true; |
|
78 |
} else { |
|
79 |
return false; |
|
80 |
} |
|
81 |
|
|
82 |
} |
|
83 |
|
|
84 |
} |
|
0 | 85 |
tags/tmp_build/applications/appgvSIG/src/com/iver/cit/gvsig/TableNumericFieldOperations.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig; |
|
2 |
|
|
3 |
import java.math.BigDecimal; |
|
4 |
import java.sql.Types; |
|
5 |
import java.util.BitSet; |
|
6 |
|
|
7 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
8 |
import com.hardcode.gdbms.engine.values.NullValue; |
|
9 |
import com.hardcode.gdbms.engine.values.NumericValue; |
|
10 |
import com.iver.andami.PluginServices; |
|
11 |
import com.iver.andami.messages.NotificationManager; |
|
12 |
import com.iver.andami.plugins.Extension; |
|
13 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
14 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
|
15 |
import com.iver.cit.gvsig.project.documents.table.gui.Statistics; |
|
16 |
import com.iver.cit.gvsig.project.documents.table.gui.Table; |
|
17 |
|
|
18 |
/** |
|
19 |
* @author Fernando Gonz?lez Cort?s |
|
20 |
*/ |
|
21 |
public class TableNumericFieldOperations extends Extension{ |
|
22 |
|
|
23 |
/** |
|
24 |
* @see com.iver.andami.plugins.IExtension#initialize() |
|
25 |
*/ |
|
26 |
public void initialize() { |
|
27 |
registerIcons(); |
|
28 |
} |
|
29 |
|
|
30 |
private void registerIcons(){ |
|
31 |
PluginServices.getIconTheme().registerDefault( |
|
32 |
"table-statistics", |
|
33 |
this.getClass().getClassLoader().getResource("images/statistics.png") |
|
34 |
); |
|
35 |
} |
|
36 |
|
|
37 |
/** |
|
38 |
* @see com.iver.andami.plugins.IExtension#execute(java.lang.String) |
|
39 |
*/ |
|
40 |
public void execute(String actionCommand) { |
|
41 |
IWindow v = PluginServices.getMDIManager().getActiveWindow(); |
|
42 |
|
|
43 |
if (v != null) { |
|
44 |
if (v.getClass() == Table.class) { |
|
45 |
|
|
46 |
Table table = (Table) v; |
|
47 |
|
|
48 |
doExecute(table); |
|
49 |
} |
|
50 |
} |
|
51 |
} |
|
52 |
/** |
|
53 |
* "execute" method acction |
|
54 |
* @param actionCommand |
|
55 |
* The acction command that executes this method |
|
56 |
* @param table |
|
57 |
* Table to operate |
|
58 |
*/ |
|
59 |
|
|
60 |
protected void doExecute(Table table){ |
|
61 |
int fieldIndex = table.getSelectedFieldIndices().nextSetBit(0); |
|
62 |
int numRows=0; |
|
63 |
SelectableDataSource ds=null; |
|
64 |
try { |
|
65 |
ds = table.getModel().getModelo().getRecordset(); |
|
66 |
} catch (ReadDriverException e) { |
|
67 |
e.printStackTrace(); |
|
68 |
} |
|
69 |
BitSet selectedRows = (BitSet)ds.getSelection().clone(); |
|
70 |
try { |
|
71 |
int rc = (int) ds.getRowCount(); |
|
72 |
//Si no hay selecci?n se usan todos los registros |
|
73 |
if (selectedRows.cardinality() == 0){ |
|
74 |
selectedRows.set(0, rc); |
|
75 |
}else{ |
|
76 |
rc = selectedRows.cardinality(); |
|
77 |
} |
|
78 |
BigDecimal suma = new BigDecimal(0); |
|
79 |
BigDecimal min = new BigDecimal(Double.MAX_VALUE); |
|
80 |
BigDecimal max = new BigDecimal(-Double.MAX_VALUE); |
|
81 |
for(int i=selectedRows.nextSetBit(0); i>=0; i=selectedRows.nextSetBit(i+1)) { |
|
82 |
if (ds.getFieldValue(i, fieldIndex) instanceof NullValue) |
|
83 |
continue; |
|
84 |
numRows++; |
|
85 |
double d = ((NumericValue) ds.getFieldValue(i, fieldIndex)).doubleValue(); |
|
86 |
suma = suma.add(new BigDecimal(d)); |
|
87 |
if (d < min.doubleValue()) min = new BigDecimal(d); |
|
88 |
if (d > max.doubleValue()) max = new BigDecimal(d); |
|
89 |
} |
|
90 |
Statistics st = new Statistics(); |
|
91 |
BigDecimal media = new BigDecimal(0); |
|
92 |
BigDecimal varianza = new BigDecimal(0); |
|
93 |
double desviacion = 0; |
|
94 |
if (numRows==0) { |
|
95 |
suma = new BigDecimal(0); |
|
96 |
min = new BigDecimal(0); |
|
97 |
max = new BigDecimal(0); |
|
98 |
}else { |
|
99 |
media = suma.divide(new BigDecimal(numRows), BigDecimal.ROUND_HALF_DOWN); |
|
100 |
varianza = new BigDecimal(0); |
|
101 |
for(int i=selectedRows.nextSetBit(0); i>=0; i=selectedRows.nextSetBit(i+1)) { |
|
102 |
if (ds.getFieldValue(i, fieldIndex) instanceof NullValue) |
|
103 |
continue; |
|
104 |
double d = ((NumericValue) ds.getFieldValue(i, fieldIndex)).doubleValue(); |
|
105 |
BigDecimal dif = new BigDecimal(d).subtract(media); |
|
106 |
varianza = dif.multiply(dif).add(varianza); |
|
107 |
} |
|
108 |
varianza = varianza.divide(new BigDecimal(numRows), BigDecimal.ROUND_HALF_DOWN); |
|
109 |
desviacion = Math.sqrt(varianza.doubleValue()); |
|
110 |
} |
|
111 |
|
|
112 |
st.setStatistics(media.doubleValue(), max.doubleValue(), min.doubleValue(), varianza.doubleValue(), desviacion, numRows, new BigDecimal(max.doubleValue()).subtract(min).doubleValue(), suma.doubleValue()); |
|
113 |
PluginServices.getMDIManager().addWindow(st); |
|
114 |
|
|
115 |
} catch (ReadDriverException e) { |
|
116 |
NotificationManager.addError("No se pudo acceder a los datos", e); |
|
117 |
} |
|
118 |
} |
|
119 |
|
|
120 |
/** |
|
121 |
* @see com.iver.andami.plugins.IExtension#isEnabled() |
|
122 |
*/ |
|
123 |
public boolean isEnabled() { |
|
124 |
IWindow v = PluginServices.getMDIManager().getActiveWindow(); |
|
125 |
|
|
126 |
if (v == null) { |
|
127 |
return false; |
|
128 |
} |
|
129 |
|
|
130 |
if (v instanceof Table) { |
|
131 |
Table table = (Table) v; |
|
132 |
return doIsEnabled(table); |
|
133 |
} |
|
134 |
return false; |
|
135 |
} |
|
136 |
|
|
137 |
protected boolean doIsEnabled(Table table){ |
|
138 |
BitSet indices = table.getSelectedFieldIndices(); |
|
139 |
// System.out.println("TableNumericFieldOperations.isEnabled: Tabla: " + table.getModel().getModelo().getRecordset().getName() ); |
|
140 |
if (indices.cardinality() == 1){ |
|
141 |
try { |
|
142 |
int index=indices.nextSetBit(0); |
|
143 |
if (table.getModel().getModelo().getRecordset().getFieldCount()<index+1) |
|
144 |
return false; |
|
145 |
int type = table.getModel().getModelo().getRecordset().getFieldType(index); |
|
146 |
if ((type == Types.BIGINT) || |
|
147 |
(type == Types.DECIMAL) || |
|
148 |
(type == Types.DOUBLE) || |
|
149 |
(type == Types.FLOAT) || |
|
150 |
(type == Types.INTEGER) || |
|
151 |
(type == Types.SMALLINT) || |
|
152 |
(type == Types.TINYINT) || |
|
153 |
(type == Types.REAL) || |
|
154 |
(type == Types.NUMERIC)){ |
|
155 |
return true; |
|
156 |
} |
|
157 |
} catch (ReadDriverException e) { |
|
158 |
return false; |
|
159 |
} |
|
160 |
} |
|
161 |
return false; |
|
162 |
} |
|
163 |
|
|
164 |
|
|
165 |
/** |
|
166 |
* @see com.iver.andami.plugins.IExtension#isVisible() |
|
167 |
*/ |
|
168 |
public boolean isVisible() { |
|
169 |
IWindow v = PluginServices.getMDIManager().getActiveWindow(); |
|
170 |
|
|
171 |
if (v == null) { |
|
172 |
return false; |
|
173 |
} |
|
174 |
|
|
175 |
if (v instanceof Table) { |
|
176 |
return true; |
|
177 |
} |
|
178 |
return false; |
|
179 |
} |
|
180 |
|
|
181 |
} |
|
0 | 182 |
tags/tmp_build/applications/appgvSIG/src/com/iver/cit/gvsig/ExtDB_Spatial.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2006 Prodevelop 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 |
* Prodevelop Integraci?n de Tecnolog?as SL |
|
34 |
* Conde Salvatierra de ?lava , 34-10 |
|
35 |
* 46004 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963 510 612 |
|
39 |
* +34 963 510 968 |
|
40 |
* gis@prodevelop.es |
|
41 |
* http://www.prodevelop.es |
|
42 |
*/ |
|
43 |
package com.iver.cit.gvsig; |
|
44 |
|
|
45 |
import java.security.KeyException; |
|
46 |
|
|
47 |
import org.apache.log4j.Logger; |
|
48 |
|
|
49 |
import com.iver.andami.plugins.Extension; |
|
50 |
import com.iver.cit.gvsig.fmap.layers.FLayerVectorialDB; |
|
51 |
import com.iver.utiles.extensionPoints.ExtensionPoint; |
|
52 |
import com.iver.utiles.extensionPoints.ExtensionPoints; |
|
53 |
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton; |
|
54 |
import com.prodevelop.cit.gvsig.vectorialdb.wizard.WizardVectorialDB; |
|
55 |
|
|
56 |
|
|
57 |
/** |
|
58 |
* This extension adds the export-to-oracle button. |
|
59 |
* |
|
60 |
* @author jldominguez |
|
61 |
* |
|
62 |
*/ |
|
63 |
public class ExtDB_Spatial extends Extension { |
|
64 |
private static Logger logger = Logger.getLogger(ExtDB_Spatial.class.getName()); |
|
65 |
|
|
66 |
public void initialize() { |
|
67 |
|
|
68 |
// System.out.println("A?ado WizardVectorialDB."); |
|
69 |
AddLayer.addWizard(WizardVectorialDB.class); |
|
70 |
|
|
71 |
ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance(); |
|
72 |
|
|
73 |
extensionPoints.add("Layers", FLayerVectorialDB.class.getName(), |
|
74 |
FLayerVectorialDB.class); |
|
75 |
|
|
76 |
try { |
|
77 |
((ExtensionPoint) extensionPoints.get("Layers")).addAlias(FLayerVectorialDB.class.getName(), |
|
78 |
"VectorialDB"); |
|
79 |
} |
|
80 |
catch (KeyException e) { |
|
81 |
// TODO Auto-generated catch block |
|
82 |
e.printStackTrace(); |
|
83 |
} |
|
84 |
} |
|
85 |
|
|
86 |
public void execute(String actionCommand) { |
|
87 |
} |
|
88 |
|
|
89 |
public boolean isEnabled() { |
|
90 |
return isVisible(); |
|
91 |
|
|
92 |
// return true; |
|
93 |
} |
|
94 |
|
|
95 |
/** |
|
96 |
* Is visible when there is one vector layer selected |
|
97 |
*/ |
|
98 |
public boolean isVisible() { |
|
99 |
return false; |
|
100 |
} |
|
101 |
} |
|
0 | 102 |
tags/tmp_build/applications/appgvSIG/src/com/iver/cit/gvsig/RemoveTableLink.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2004 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 |
package com.iver.cit.gvsig; |
|
42 |
|
|
43 |
import com.iver.andami.PluginServices; |
|
44 |
import com.iver.andami.plugins.Extension; |
|
45 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
46 |
import com.iver.cit.gvsig.project.documents.table.ProjectTable; |
|
47 |
import com.iver.cit.gvsig.project.documents.table.gui.Table; |
|
48 |
|
|
49 |
|
|
50 |
/** |
|
51 |
* Extensi?n para borrar los link existentes entre tablas. |
|
52 |
* |
|
53 |
* @author Vicente Caballero Navarro |
|
54 |
*/ |
|
55 |
public class RemoveTableLink extends Extension { |
|
56 |
/** |
|
57 |
* @see com.iver.andami.plugins.IExtension#initialize() |
|
58 |
*/ |
|
59 |
public void initialize() { |
|
60 |
// TODO Auto-generated method stub |
|
61 |
} |
|
62 |
|
|
63 |
/** |
|
64 |
* @see com.iver.andami.plugins.IExtension#execute(java.lang.String) |
|
65 |
*/ |
|
66 |
public void execute(String actionCommand) { |
|
67 |
Table t = (Table) PluginServices.getMDIManager().getActiveWindow(); |
|
68 |
ProjectTable pt = t.getModel(); |
|
69 |
pt.removeLinkTable();//restoreDataSource(); |
|
70 |
t.getModel().setModified(true); |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* @see com.iver.andami.plugins.IExtension#isEnabled() |
|
75 |
*/ |
|
76 |
public boolean isEnabled() { |
|
77 |
IWindow v = PluginServices.getMDIManager().getActiveWindow(); |
|
78 |
|
|
79 |
if (v == null) { |
|
80 |
return false; |
|
81 |
} |
|
82 |
|
|
83 |
if (v.getClass() == Table.class) { |
|
84 |
Table t = (Table) v; |
|
85 |
|
|
86 |
if (t.getModel().getLinkTable() != null) { |
|
87 |
return true; |
|
88 |
} |
|
89 |
} |
|
90 |
|
|
91 |
return false; |
|
92 |
} |
|
93 |
|
|
94 |
/** |
|
95 |
* @see com.iver.andami.plugins.IExtension#isVisible() |
|
96 |
*/ |
|
97 |
public boolean isVisible() { |
|
98 |
IWindow v = PluginServices.getMDIManager().getActiveWindow(); |
|
99 |
|
|
100 |
if (v == null) { |
|
101 |
return false; |
|
102 |
} |
|
103 |
|
|
104 |
if (v instanceof Table) { |
|
105 |
return true; |
|
106 |
} else { |
|
107 |
return false; |
|
108 |
} |
|
109 |
} |
|
110 |
} |
|
0 | 111 |
tags/tmp_build/applications/appgvSIG/src/com/iver/cit/gvsig/BasicSymbologyExtension.java | ||
---|---|---|
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: AdvancedSymbologyExtension.java 16205 2007-11-08 16:33:35Z jdominguez $ |
|
45 |
* $Log: AdvancedSymbologyExtension.java,v $ |
|
46 |
* Revision 1.12 2007/09/19 15:34:59 jaume |
|
47 |
* removed unnecessary imports |
|
48 |
* |
|
49 |
* Revision 1.11 2007/09/17 09:11:28 jaume |
|
50 |
* order of the elements inverted |
|
51 |
* |
|
52 |
* Revision 1.10 2007/09/13 11:37:09 jvidal |
|
53 |
* *** empty log message *** |
|
54 |
* |
|
55 |
* Revision 1.9 2007/09/04 10:53:10 caballero |
|
56 |
* show page |
|
57 |
* |
|
58 |
* Revision 1.8 2007/08/09 10:39:04 jaume |
|
59 |
* first round of found bugs fixed |
|
60 |
* |
|
61 |
* Revision 1.7 2007/08/01 13:03:31 jaume |
|
62 |
* plugable symbol editor |
|
63 |
* |
|
64 |
* Revision 1.6 2007/05/22 12:17:12 jaume |
|
65 |
* *** empty log message *** |
|
66 |
* |
|
67 |
* Revision 1.5 2007/05/17 09:32:37 jaume |
|
68 |
* *** empty log message *** |
|
69 |
* |
|
70 |
* Revision 1.4 2007/03/21 08:03:03 jaume |
|
71 |
* refactored to use ISymbol instead of FSymbol |
|
72 |
* |
|
73 |
* Revision 1.3 2007/03/13 16:57:35 jaume |
|
74 |
* Added MultiVariable legend |
|
75 |
* |
|
76 |
* Revision 1.2 2007/03/09 11:25:00 jaume |
|
77 |
* Advanced symbology (start committing) |
|
78 |
* |
|
79 |
* Revision 1.1.2.4 2007/02/21 07:35:14 jaume |
|
80 |
* *** empty log message *** |
|
81 |
* |
|
82 |
* Revision 1.1.2.3 2007/02/12 15:14:41 jaume |
|
83 |
* refactored interval legend and added graduated symbol legend |
|
84 |
* |
|
85 |
* Revision 1.1.2.2 2007/02/01 17:47:12 jaume |
|
86 |
* *** empty log message *** |
|
87 |
* |
|
88 |
* Revision 1.1.2.1 2007/02/01 12:12:41 jaume |
|
89 |
* theme manager window and all its components are now dynamic |
|
90 |
* |
|
91 |
*/ |
|
92 |
package com.iver.cit.gvsig; |
|
93 |
|
|
94 |
import com.iver.andami.PluginServices; |
|
95 |
import com.iver.andami.plugins.Extension; |
|
96 |
import com.iver.andami.preferences.IPreference; |
|
97 |
import com.iver.andami.preferences.IPreferenceExtension; |
|
98 |
import com.iver.cit.gvsig.fmap.core.FShape; |
|
99 |
import com.iver.cit.gvsig.fmap.drivers.gvl.FMapGVLDriver; |
|
100 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
|
101 |
import com.iver.cit.gvsig.gui.preferencespage.CartographicSupportPage; |
|
102 |
import com.iver.cit.gvsig.gui.preferencespage.SymbologyPage; |
|
103 |
import com.iver.cit.gvsig.gui.styling.SimpleFill; |
|
104 |
import com.iver.cit.gvsig.gui.styling.SimpleLine; |
|
105 |
import com.iver.cit.gvsig.gui.styling.SimpleMarker; |
|
106 |
import com.iver.cit.gvsig.gui.styling.SimpleText; |
|
107 |
import com.iver.cit.gvsig.gui.styling.SymbolEditor; |
|
108 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.AttrInTableLabeling; |
|
109 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.Categories; |
|
110 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.Features; |
|
111 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.General; |
|
112 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.LabelingManager; |
|
113 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.LegendManager; |
|
114 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.MultipleAttributes; |
|
115 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.Quantities; |
|
116 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.SingleSymbol; |
|
117 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.ThemeManagerWindow; |
|
118 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.VectorialInterval; |
|
119 |
import com.iver.cit.gvsig.project.documents.view.legend.gui.VectorialUniqueValue; |
|
120 |
/** |
|
121 |
* Extension for enable the symbology. It only installs the core symbology. |
|
122 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
|
123 |
* |
|
124 |
*/ |
|
125 |
public class BasicSymbologyExtension extends Extension implements IPreferenceExtension{ |
|
126 |
|
|
127 |
public void initialize() { |
|
128 |
// Install required features |
|
129 |
|
|
130 |
// modules for symbol editor |
|
131 |
SymbolEditor.addSymbolEditorPanel(SimpleFill.class, FShape.POLYGON); |
|
132 |
SymbolEditor.addSymbolEditorPanel(SimpleMarker.class, FShape.POINT); |
|
133 |
SymbolEditor.addSymbolEditorPanel(SimpleLine.class, FShape.LINE); |
|
134 |
SymbolEditor.addSymbolEditorPanel(SimpleText.class, FShape.TEXT); |
|
135 |
|
|
136 |
// pages |
|
137 |
ThemeManagerWindow.addPage(General.class); |
|
138 |
ThemeManagerWindow.addPage(LegendManager.class); |
|
139 |
ThemeManagerWindow.addPage(LabelingManager.class); |
|
140 |
|
|
141 |
ThemeManagerWindow.setTabEnabledForLayer(General.class, FLyrVect.class, true); |
|
142 |
ThemeManagerWindow.setTabEnabledForLayer(LegendManager.class, FLyrVect.class, true); |
|
143 |
ThemeManagerWindow.setTabEnabledForLayer(LabelingManager.class, FLyrVect.class, true); |
|
144 |
// labeling strategies (inverse order to the wanted to be shown) |
|
145 |
LabelingManager.addLabelingStrategy(AttrInTableLabeling.class); |
|
146 |
|
|
147 |
|
|
148 |
// legends available in the legend page |
|
149 |
LegendManager.addLegendPage(Quantities.class); |
|
150 |
LegendManager.addLegendPage(Features.class); |
|
151 |
LegendManager.addLegendPage(Categories.class); |
|
152 |
LegendManager.addLegendPage(MultipleAttributes.class); |
|
153 |
|
|
154 |
|
|
155 |
LegendManager.addLegendPage(SingleSymbol.class); |
|
156 |
LegendManager.addLegendPage(VectorialInterval.class); |
|
157 |
LegendManager.addLegendPage(VectorialUniqueValue.class); |
|
158 |
|
|
159 |
LegendManager.addLegendDriver(FMapGVLDriver.class); |
|
160 |
registerIcons(); |
|
161 |
} |
|
162 |
|
|
163 |
private void registerIcons(){ |
|
164 |
PluginServices.getIconTheme().registerDefault( |
|
165 |
"chain", |
|
166 |
this.getClass().getClassLoader().getResource("images/chain.png") |
|
167 |
); |
|
168 |
PluginServices.getIconTheme().registerDefault( |
|
169 |
"broken-chain", |
|
170 |
this.getClass().getClassLoader().getResource("images/broken-chain.png") |
|
171 |
); |
|
172 |
PluginServices.getIconTheme().registerDefault( |
|
173 |
"underline-icon", |
|
174 |
this.getClass().getClassLoader().getResource("images/underlined.png") |
|
175 |
); |
|
176 |
PluginServices.getIconTheme().registerDefault( |
|
177 |
"italic-icon", |
|
178 |
this.getClass().getClassLoader().getResource("images/italic.png") |
|
179 |
); |
|
180 |
PluginServices.getIconTheme().registerDefault( |
|
181 |
"bold-icon", |
|
182 |
this.getClass().getClassLoader().getResource("images/bold.png") |
|
183 |
); |
|
184 |
PluginServices.getIconTheme().registerDefault( |
|
185 |
"symbol-pref", |
|
186 |
this.getClass().getClassLoader().getResource("images/symbols1.png")); |
|
187 |
|
|
188 |
} |
|
189 |
|
|
190 |
public void execute(String actionCommand) { |
|
191 |
|
|
192 |
} |
|
193 |
|
|
194 |
public boolean isEnabled() { |
|
195 |
return true; // or whatever |
|
196 |
} |
|
197 |
|
|
198 |
public boolean isVisible() { |
|
199 |
return true; // or whatever |
|
200 |
} |
|
201 |
|
|
202 |
public IPreference[] getPreferencesPages() { |
|
203 |
return new IPreference[] { |
|
204 |
new CartographicSupportPage(), new SymbologyPage() |
|
205 |
}; |
|
206 |
} |
|
207 |
} |
tags/tmp_build/applications/appgvSIG/src/com/iver/cit/gvsig/ZoomToSelectExtension.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 31-may-2004 |
|
3 |
* |
|
4 |
* To change the template for this generated file go to |
|
5 |
* Window>Preferences>Java>Code Generation>Code and Comments |
|
6 |
*/ |
|
7 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
8 |
* |
|
9 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
10 |
* |
|
11 |
* This program is free software; you can redistribute it and/or |
|
12 |
* modify it under the terms of the GNU General Public License |
|
13 |
* as published by the Free Software Foundation; either version 2 |
|
14 |
* of the License, or (at your option) any later version. |
|
15 |
* |
|
16 |
* This program is distributed in the hope that it will be useful, |
|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
19 |
* GNU General Public License for more details. |
|
20 |
* |
|
21 |
* You should have received a copy of the GNU General Public License |
|
22 |
* along with this program; if not, write to the Free Software |
|
23 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
24 |
* |
|
25 |
* For more information, contact: |
|
26 |
* |
|
27 |
* Generalitat Valenciana |
|
28 |
* Conselleria d'Infraestructures i Transport |
|
29 |
* Av. Blasco Ib??ez, 50 |
|
30 |
* 46010 VALENCIA |
|
31 |
* SPAIN |
|
32 |
* |
|
33 |
* +34 963862235 |
|
34 |
* gvsig@gva.es |
|
35 |
* www.gvsig.gva.es |
|
36 |
* |
|
37 |
* or |
|
38 |
* |
|
39 |
* IVER T.I. S.A |
|
40 |
* Salamanca 50 |
|
41 |
* 46005 Valencia |
|
42 |
* Spain |
|
43 |
* |
|
44 |
* +34 963163400 |
|
45 |
* dac@iver.es |
|
46 |
*/ |
|
47 |
package com.iver.cit.gvsig; |
|
48 |
|
Also available in: Unified diff