Revision 2237

View differences:

org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.swing/org.gvsig.complexlegend.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.complexlegend.swing.ComplexLegendSwingLibrary
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.swing/org.gvsig.complexlegend.swing.api/src/main/java/org/gvsig/complexlegend/swing/ComplexLegendSwingLibrary.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.complexlegend.swing;
23

  
24
import org.gvsig.app.project.documents.view.legend.gui.LegendManager;
25
import org.gvsig.complexlegend.ComplexLegendLibrary;
26
import org.gvsig.tools.library.AbstractLibrary;
27
import org.gvsig.tools.library.LibraryException;
28

  
29
/**
30
 * Library for Swing API initialization and configuration.
31
 * 
32
 * @author gvSIG team
33
 * @version $Id$
34
 */
35
public class ComplexLegendSwingLibrary extends AbstractLibrary {
36

  
37
	@Override
38
	public void doRegistration() {
39
		registerAsAPI(ComplexLegendSwingLibrary.class);
40
	    this.require(ComplexLegendLibrary.class);
41
	}
42

  
43
	@Override
44
    protected void doInitialize() throws LibraryException {
45
        // Do nothing
46
    }
47

  
48
    @Override
49
    protected void doPostInitialize() throws LibraryException {
50
//    		IconThemeHelper.registerIcon("legend",
51
//                "legend-overview-dot-density", this);
52
//            IconThemeHelper.registerIcon("legend",
53
//                "legend-dot-density-low-density-sample", this);
54
//            IconThemeHelper.registerIcon("legend",
55
//                "legend-dot-density-medium-density-sample", this);
56
//            IconThemeHelper.registerIcon("legend",
57
//                "legend-dot-density-high-density-sample", this);
58
    }
59

  
60
}
0 61

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.swing/org.gvsig.complexlegend.swing.api/src/main/java/org/gvsig/complexlegend/swing/ComplexLegendPanel.java
1
package org.gvsig.complexlegend.swing;
2

  
3
import javax.swing.ImageIcon;
4
import javax.swing.JPanel;
5

  
6
import org.gvsig.app.project.documents.view.legend.gui.ILegendPanel;
7
import org.gvsig.fmap.mapcontext.layers.FLayer;
8
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend;
9

  
10
public interface ComplexLegendPanel extends ILegendPanel{
11

  
12

  
13
}
0 14

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.swing/org.gvsig.complexlegend.swing.api/src/main/java/package.html
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head>
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
<title>org.gvsig.landregistryviewer package documentation</title>
7
</head>
8
<body>
9

  
10
	<p>LandRegistryViewer swing library API.</p>
11
	
12
	<p>
13
	It allows to get swing panels to show LandRegistryViewer, and to include them in windows.
14
	</p>
15

  
16
</body>
17
</html>
0 18

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.swing/org.gvsig.complexlegend.swing.api/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
	<modelVersion>4.0.0</modelVersion>
4
	<artifactId>org.gvsig.complexlegend.swing.api</artifactId>
5
	<packaging>jar</packaging>
6
	<name>org.gvsig.complexlegend.swing.api</name>
7
	<parent>
8
		<groupId>org.gvsig</groupId>
9
		<artifactId>org.gvsig.complexlegend.swing</artifactId>
10
		<version>1.0.71</version>
11
	</parent>
12
	<build>
13
		<plugins>
14
			<plugin>
15
				<groupId>org.apache.maven.plugins</groupId>
16
				<artifactId>maven-jar-plugin</artifactId>
17
				<configuration>
18
				</configuration>
19
				<executions>
20
				<!--
21
				Generates a jar file only with the test classes
22
				-->
23
					<execution>
24
						<goals>
25
							<goal>test-jar</goal>
26
						</goals>
27
					</execution>
28
				</executions>
29
			</plugin>
30
		</plugins>
31
	</build>
32
	<dependencies>
33
		<dependency>
34
			<groupId>org.gvsig</groupId>
35
			<artifactId>org.gvsig.complexlegend.lib.api</artifactId>
36
		</dependency>
37
		<dependency>
38
			<groupId>org.gvsig</groupId>
39
			<artifactId>org.gvsig.app.mainplugin</artifactId>
40
		</dependency>
41
	</dependencies>
42
</project>
0 43

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.swing/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3

  
4
	<modelVersion>4.0.0</modelVersion>
5
	<artifactId>org.gvsig.complexlegend.swing</artifactId>
6
	<packaging>pom</packaging>
7
	<name>org.gvsig.complexlegend.swing</name>
8
	<parent>
9
		<groupId>org.gvsig</groupId>
10
		<artifactId>org.gvsig.complexlegend</artifactId>
11
		<version>1.0.71</version>
12
	</parent>
13

  
14
	<modules>
15
		<module>org.gvsig.complexlegend.swing.api</module>
16
		<module>org.gvsig.complexlegend.swing.impl</module>
17
	</modules>
18
</project>
19

  
0 20

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.swing/org.gvsig.complexlegend.swing.impl/src/main/java/package.html
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head>
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
<title>org.gvsig.landregistryviewer package documentation</title>
7
</head>
8
<body>
9

  
10
	<p>LandRegistryViewer swing library API default implementation.</p>
11

  
12
</body>
13
</html>
0 14

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.swing/org.gvsig.complexlegend.swing.impl/src/main/java/org/gvsig/complexlegend/swing/impl/DefaultComplexLegendPanel.java
1
package org.gvsig.complexlegend.swing.impl;
2

  
3
import java.awt.BorderLayout;
4
import java.awt.Dimension;
5
import java.awt.FlowLayout;
6
import java.awt.event.ActionEvent;
7
import java.awt.event.ActionListener;
8
import java.util.Iterator;
9
import java.util.List;
10

  
11
import javax.swing.BorderFactory;
12
import javax.swing.DefaultComboBoxModel;
13
import javax.swing.ImageIcon;
14
import javax.swing.JButton;
15
import javax.swing.JComboBox;
16
import javax.swing.JDialog;
17
import javax.swing.JLabel;
18
import javax.swing.JPanel;
19
import javax.swing.event.ListDataEvent;
20
import javax.swing.event.ListDataListener;
21

  
22
import org.gvsig.andami.IconThemeHelper;
23
import org.gvsig.andami.PluginServices;
24
import org.gvsig.app.project.documents.view.legend.gui.AbstractParentPanel;
25
import org.gvsig.app.project.documents.view.legend.gui.Features;
26
import org.gvsig.app.project.documents.view.legend.gui.ILegendPanel;
27
import org.gvsig.complexlegend.ComplexLegendItem;
28
import org.gvsig.complexlegend.VectorComplexLegend;
29
import org.gvsig.complexlegend.impl.DefaultVectorComplexLegend;
30
import org.gvsig.complexlegend.swing.ComplexLegendPanel;
31
import org.gvsig.fmap.mapcontext.MapContextLocator;
32
import org.gvsig.fmap.mapcontext.layers.FLayer;
33
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
34
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend;
35
import org.gvsig.symbology.swing.SymbologySwingLocator;
36
import org.gvsig.tools.ToolsLocator;
37
import org.gvsig.tools.i18n.I18nManager;
38
import org.gvsig.tools.observer.Observable;
39
import org.gvsig.tools.observer.Observer;
40
import org.slf4j.Logger;
41
import org.slf4j.LoggerFactory;
42

  
43
public class DefaultComplexLegendPanel extends JPanel implements ComplexLegendPanel, Observer{
44

  
45
	/**
46
	 * 
47
	 */
48
	private static final long serialVersionUID = -312336406359200569L;
49
	private static Logger logger = LoggerFactory.getLogger(DefaultComplexLegendPanel.class);
50
	private VectorComplexLegend auxLegend;
51
	private FLayer layer;
52
	private JComboBox cmbValue;
53
	private JPanel symbolPanel;
54
	private JButton addButton;
55
	private JButton removeButton;
56
	private DefaultComboBoxModel model;
57
	private ILegendPanel legendPanel;
58
	private JDialog dlg;
59
	private ComplexLegendItem currentItem;
60
	private I18nManager i18nManager;
61
	private int currentIndex;
62
	
63
	public DefaultComplexLegendPanel(){
64
		super();
65
		initialize();
66
		refreshButtons();
67
	}
68
	
69
	private void initialize() {
70
		this.i18nManager = ToolsLocator.getI18nManager();
71
		
72
		setLayout(new BorderLayout());
73
		JPanel aux = new JPanel(new BorderLayout());
74

  
75
		JPanel fieldsPanel = new JPanel(new FlowLayout());
76
		fieldsPanel.setBorder(BorderFactory.createTitledBorder(null,
77
				     i18nManager.getTranslation("select_scale")));
78
		fieldsPanel.setPreferredSize(new Dimension(300,60));
79

  
80
		fieldsPanel.add(new JLabel());
81
		fieldsPanel.add(getComboBox());
82
		fieldsPanel.add(getAddButton());
83
		fieldsPanel.add(getRemoveButton());
84

  
85
		symbolPanel = new JPanel();
86
		symbolPanel.setBorder(BorderFactory.createTitledBorder(null,
87
				     i18nManager.getTranslation("legend_definition")));
88

  
89

  
90
		aux.add(fieldsPanel, BorderLayout.NORTH);
91
		aux.add(symbolPanel, BorderLayout.CENTER);
92

  
93
		this.add(aux, BorderLayout.CENTER);
94
	}
95

  
96
	private JComboBox getComboBox() {
97
		if(cmbValue == null){
98
			cmbValue = new JComboBox(getComboBoxModel());
99
			cmbValue.setPreferredSize(new Dimension(350, 20));
100
			cmbValue.addActionListener(new ActionListener() {
101
				public void actionPerformed(ActionEvent e) {
102
					refreshLegendPanel();
103
				}
104
			});
105
		}
106
		return cmbValue;
107
	}
108
	
109
	private DefaultComboBoxModel getComboBoxModel(){
110
		if(this.model == null){
111
			this.model = new DefaultComboBoxModel();
112
			this.model.addListDataListener(new ListDataListener() {
113
				public void intervalRemoved(ListDataEvent arg0) {
114
				}
115
				
116
				public void intervalAdded(ListDataEvent arg0) {
117
				}
118
				
119
				public void contentsChanged(ListDataEvent arg0) {
120
					refreshButtons();
121
				}
122
			});
123
		}
124
		return this.model;
125
	}
126
	
127
	protected void refreshButtons() {
128
		boolean status = (getComboBoxModel().getSize() != 0);
129
		getComboBox().setEnabled(status);
130
		getRemoveButton().setEnabled(status);
131
		if(legendPanel != null){
132
			legendPanel.getPanel().setVisible(status);
133
		}
134
	}
135

  
136
	private JButton getAddButton() {
137
		if(addButton == null){
138
			addButton = new JButton();
139
			addButton.setIcon(PluginServices.getIconTheme().get("legend-add"));
140
			addButton.addActionListener(new ActionListener() {
141
				public void actionPerformed(ActionEvent arg0) {
142
					createComplexLegendItemWindow();
143
				}
144
			});
145
		}
146
		return addButton;
147
	}
148
	
149
	private JButton getRemoveButton() {
150
		if(removeButton == null){
151
			removeButton = new JButton();
152
			removeButton.setIcon(PluginServices.getIconTheme().get("legend-delete"));
153
			removeButton.addActionListener(new ActionListener() {
154
				public void actionPerformed(ActionEvent arg0) {
155
					removeComplexLegendItem();
156
				}
157
			});
158
		}
159
		return removeButton;
160
	}
161

  
162
	protected void removeComplexLegendItem() {
163
		ComplexLegendItem item = (ComplexLegendItem) getComboBox().getSelectedItem();
164
		int index = auxLegend.getLegends().indexOf(item);
165
		if(index != -1){
166
			auxLegend.remove(item);
167
			getComboBoxModel().removeElementAt(index);
168
		}
169
		refreshButtons();
170
	}
171

  
172
	protected void createComplexLegendItemWindow() {
173
		if(layer != null){
174
			ComplexLegendItemPanel legendItemPanel = 
175
					new ComplexLegendItemPanel(layer, (VectorComplexLegend) getLegend());
176
			legendItemPanel.addObserver(this);
177
			
178
			dlg = new JDialog();
179
			dlg.setTitle( i18nManager.getTranslation("SelectItem"));
180
			dlg.setResizable(true);
181
			//legendItemPanel.setParentDialog(dlg);
182
			dlg.getContentPane().add(legendItemPanel);
183
			dlg.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
184
			
185
			dlg.setSize(510, 510);
186
			dlg.setModal(true);
187
			dlg.pack();
188
			dlg.setLocationRelativeTo(null);
189
			dlg.setVisible(true);
190
		}
191
	}
192

  
193
	public String getDescription() {
194
		return  i18nManager.getTranslation(
195
			    "legend_by_scale");
196
	}
197

  
198
	public ImageIcon getIcon() {
199
		 return IconThemeHelper.getImageIcon(
200
			        "scaled-symbols");
201
	}
202

  
203
	public ILegend getLegend() {
204
		if (auxLegend == null) {
205
			auxLegend = (VectorComplexLegend) MapContextLocator.getMapContextManager()
206
				.createLegend(DefaultVectorComplexLegend.COMPLEX_LEGEND_NAME);
207
		}
208
		saveCurrentPanel();
209
		
210
//		DefaultComplexLegendItem scaleLegend1 = new DefaultComplexLegendItem();
211
//		
212
//		SimpleFillSymbol fillsymbol1 = new SimpleFillSymbol();
213
//		fillsymbol1.setFillColor(Color.WHITE);
214
//		SingleSymbolLegend legend1 = new SingleSymbolLegend(fillsymbol1);
215
//		scaleLegend1.setLegend(legend1);
216
//		scaleLegend1.setMinScale(10000000);
217
//		scaleLegend1.setMaxScale(20000000);
218
//		
219
//		DefaultComplexLegendItem scaleLegend2 = new DefaultComplexLegendItem();
220
//		SimpleFillSymbol fillsymbol2 = new SimpleFillSymbol();
221
//		fillsymbol2.setFillColor(Color.BLACK);
222
//		SingleSymbolLegend legend2 = new SingleSymbolLegend(fillsymbol2);
223
//		scaleLegend2.setLegend(legend2);
224
//		scaleLegend2.setMinScale(0);
225
//		scaleLegend2.setMaxScale(9999999);
226
//		
227
//		auxLegend.add(scaleLegend2);
228
//		auxLegend.add(scaleLegend1);
229
		
230
		return (VectorComplexLegend) auxLegend;
231
	}
232

  
233
	public Class getLegendClass() {
234
		return DefaultVectorComplexLegend.class;
235
	}
236

  
237
	public JPanel getPanel() {
238
		return this;
239
	}
240

  
241
	public Class getParentClass() {
242
		return Features.class;
243
	}
244

  
245
	public String getTitle() {
246
		return  i18nManager.getTranslation("complex_symbology");
247
	}
248

  
249
	public boolean isSuitableFor(FLayer layer) {
250
		return (layer instanceof FLyrVect);
251
	}
252

  
253
	public void setData(FLayer layer, ILegend data) {
254
		this.layer = layer;
255
		if(data instanceof DefaultVectorComplexLegend){
256
			auxLegend = (DefaultVectorComplexLegend) data;
257
			updateComboModel();
258
		}
259
	}
260
	
261
	private void saveCurrentPanel(){
262
		if(legendPanel != null && currentItem != null){
263
			currentItem.setLegend(legendPanel.getLegend());
264
		}
265
	}
266
	
267
	
268
	public void refreshLegendPanel(){
269
		ComplexLegendItem item = (ComplexLegendItem) getComboBox().getSelectedItem();
270
		if(item != null){
271
			ILegendPanel aux = getLegendPanel(item.getLegend()); 
272
			if(aux != null){
273
				saveCurrentPanel();
274
				
275
				symbolPanel.removeAll();
276
				legendPanel = aux;
277
				legendPanel.setData(layer, item.getLegend());
278
				symbolPanel.add(legendPanel.getPanel());
279
				symbolPanel.repaint();
280
				symbolPanel.revalidate();
281
				
282
				currentItem = item;
283
				currentIndex = getComboBox().getSelectedIndex();
284
			}
285
		}
286
	}
287

  
288
	private ILegendPanel getLegendPanel(ILegend legend){
289
		List panels = SymbologySwingLocator.getSwingManager().getLegendEditorClasses();
290
		Iterator it = panels.iterator();
291
		while(it.hasNext()){
292
			Class panelClass = (Class) it.next();
293
			ILegendPanel panel;
294
			try {
295
				panel = (ILegendPanel) panelClass.newInstance();
296
				if(!(panel instanceof AbstractParentPanel)){
297
					if(panel.getLegendClass().equals(legend.getClass())){
298
						panel.setData(layer, legend);
299
						return panel;
300
					}
301
				}
302
			} catch (Exception e) {
303
				logger.warn("Error creating ILegendPanel. ", e);
304
				return null;
305
			}
306
		}
307
		return null;
308
	}
309
	
310
	
311

  
312
	public void update(Observable observable, Object isAccepted) {
313
		if(observable instanceof ComplexLegendItemPanel && isAccepted instanceof Boolean){
314
			ComplexLegendItemPanel itemPanel = (ComplexLegendItemPanel) observable;
315
			boolean acceptForm = (Boolean) isAccepted;
316
			if(!acceptForm){
317
				/* Si se ha pinchado en cancelar, se cierra sin m?s */
318
				dlg.dispose();
319
			}else{
320
				if(itemPanel.validateValues()){
321
					ComplexLegendItem item = itemPanel.getLegendItem();
322

  
323
					/* Guardo el panel actual*/
324
					saveCurrentPanel();
325

  
326
					/* A?ado y ordeno la nueva entrada */
327
					auxLegend.add(item);
328
					updateComboModel();
329

  
330
					/* Cargo el nuevo panel */
331
					symbolPanel.removeAll();
332
					legendPanel = itemPanel.getLegendPanel();
333
					legendPanel.setData(layer, item.getLegend());
334
					symbolPanel.add(legendPanel.getPanel());
335
					symbolPanel.repaint();
336
					
337
					/* Selecciono la nueva entrada */
338
					currentItem = item;
339
					getComboBox().setSelectedItem(item);
340
					currentIndex = getComboBox().getSelectedIndex();
341
					
342
					/* Cierro el di?logo */
343
					dlg.dispose();
344
				}
345
			}
346
		}
347
	}
348

  
349
	private void updateComboModel() {
350
		getComboBoxModel().removeAllElements();
351
		if(auxLegend != null){
352
			Iterator<ComplexLegendItem> it = auxLegend.getLegends().iterator();
353
			while(it.hasNext()){
354
				ComplexLegendItem item = (ComplexLegendItem) it.next();
355
				getComboBoxModel().addElement(item);
356
			}
357
					
358
		}
359
	}
360

  
361
}
0 362

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.swing/org.gvsig.complexlegend.swing.impl/src/main/java/org/gvsig/complexlegend/swing/impl/ComplexLegendItemPanel.java
1
package org.gvsig.complexlegend.swing.impl;
2

  
3
import java.awt.BorderLayout;
4
import java.awt.Dimension;
5
import java.awt.GridBagConstraints;
6
import java.awt.GridBagLayout;
7
import java.awt.Insets;
8
import java.awt.event.ActionEvent;
9
import java.awt.event.ActionListener;
10
import java.util.ArrayList;
11
import java.util.Iterator;
12
import java.util.List;
13

  
14
import javax.swing.ComboBoxModel;
15
import javax.swing.DefaultComboBoxModel;
16
import javax.swing.JButton;
17
import javax.swing.JCheckBox;
18
import javax.swing.JComboBox;
19
import javax.swing.JLabel;
20
import javax.swing.JOptionPane;
21
import javax.swing.JPanel;
22
import javax.swing.JSpinner;
23
import javax.swing.SpinnerModel;
24
import javax.swing.SpinnerNumberModel;
25

  
26
import org.gvsig.app.project.documents.view.legend.gui.AbstractParentPanel;
27
import org.gvsig.app.project.documents.view.legend.gui.ILegendPanel;
28
import org.gvsig.complexlegend.ComplexLegendItem;
29
import org.gvsig.complexlegend.VectorComplexLegend;
30
import org.gvsig.complexlegend.impl.DefaultComplexLegendItem;
31
import org.gvsig.fmap.mapcontext.layers.FLayer;
32
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
33
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend;
34
import org.gvsig.symbology.swing.SymbologySwingLocator;
35
import org.gvsig.tools.ToolsLocator;
36
import org.gvsig.tools.i18n.I18nManager;
37
import org.gvsig.tools.observer.Observable;
38
import org.gvsig.tools.observer.Observer;
39

  
40
public class ComplexLegendItemPanel extends JPanel implements Observable{
41

  
42
	/**
43
	 * 
44
	 */
45
	private static final long serialVersionUID = 8565120915575756286L;
46
	private ComplexLegendItem complexItem;
47
	private JSpinner maxScaleTXT;
48
	private JSpinner minScaleTXT;
49
	private VectorComplexLegend complexLegend;
50
	private JComboBox legendTypeCB;
51
	private FLayer layer;
52
	private DefaultComboBoxModel model;
53
	private JButton cancelButton;
54
	private JButton acceptButton;
55
	private List<Observer> observers;
56
	private I18nManager i18nManager;
57
	private JCheckBox minScaleCk;
58
	private JCheckBox maxScaleCk;
59

  
60
	
61
	public ComplexLegendItemPanel(FLayer layer, VectorComplexLegend vcl){
62
		this.i18nManager = ToolsLocator.getI18nManager();
63
		this.observers = new ArrayList<Observer>();
64
		this.layer = layer;
65
		this.complexLegend = vcl;
66
		initialize();
67
	}
68
	
69
	public ComplexLegendItemPanel(FLayer layer, VectorComplexLegend vcl, ComplexLegendItem cli) {
70
		this(layer, vcl);
71
		this.complexItem = cli;
72
		setData(cli);
73
	}
74

  
75
	private void initialize() {
76
		setPreferredSize(new Dimension(450, 225));
77

  
78
		JPanel mainPanel = new JPanel(new BorderLayout());
79
		mainPanel.setPreferredSize(new Dimension(440, 175));
80

  
81
		JPanel mainDataPanel = new JPanel();
82
		mainDataPanel.setPreferredSize(new Dimension(200, 100));
83
		GridBagLayout gridBagLayout2 = new GridBagLayout();
84
		gridBagLayout2.columnWidths = new int[] { 150, 180, 70 };
85
		gridBagLayout2.rowHeights = new int[] { 0, 0, 0, 0, 0, 0 };
86
		mainDataPanel.setLayout(gridBagLayout2);
87
		//mainDataPanel.setBorder(new TitledBorder( i18nManager.getTranslation("Connection_configuration") + ":"));
88

  
89
		GridBagConstraints c = new GridBagConstraints();
90
		c.fill = GridBagConstraints.HORIZONTAL;
91
		c.anchor = GridBagConstraints.WEST;
92
		c.insets = new Insets(3, 0, 3, 0);
93
		c.ipadx = 10;
94
		c.gridx = 0;
95
		c.gridy = 0;
96
		JLabel labelURL = new JLabel( i18nManager.getTranslation("MinScale")+":");
97
		mainDataPanel.add(labelURL, c);
98

  
99
		c.gridx = 1;
100
		c.gridwidth =2;
101
		mainDataPanel.add(getMinScaleField(), c);
102
		c.gridy = 1;
103
		mainDataPanel.add(getWithoutMinScale(), c);
104

  
105
		c.gridx = 0;
106
		c.gridy = 2;
107
		c.gridwidth =1;
108
		JLabel labelUser = new JLabel( i18nManager.getTranslation("MaxScale")+":");
109
		mainDataPanel.add(labelUser, c);
110

  
111
		c.gridx = 1;
112
		c.gridwidth =2;
113
		mainDataPanel.add(getMaxScaleField(), c);
114
		c.gridy = 3;
115
		mainDataPanel.add(getWithoutMaxScale(), c);
116

  
117
		c.gridx = 0;
118
		c.gridy = 4;
119
		c.gridwidth =1;
120
		JLabel labelPassword = new JLabel( i18nManager.getTranslation("LegendType")+":");
121
		mainDataPanel.add(labelPassword, c);
122

  
123
		c.gridx = 1;
124
		c.gridwidth =2;
125
		mainDataPanel.add(getLegendTypes(), c);
126

  
127
		mainPanel.add(mainDataPanel, BorderLayout.CENTER);
128
		add(mainPanel, BorderLayout.CENTER);
129
		
130
		add(getButtons(), BorderLayout.SOUTH);
131
	}
132
	
133
	private JCheckBox getWithoutMinScale() {
134
		if(minScaleCk == null){
135
			minScaleCk = new JCheckBox(i18nManager.getTranslation("without_min_scale"));
136
			minScaleCk.addActionListener(new ActionListener() {
137
				public void actionPerformed(ActionEvent arg0) {
138
					getMinScaleField().setEnabled(!minScaleCk.isSelected());
139
				}
140
			});
141
		}
142
		return minScaleCk;
143
	}
144
	
145
	private JCheckBox getWithoutMaxScale() {
146
		if(maxScaleCk == null){
147
			maxScaleCk = new JCheckBox(i18nManager.getTranslation("without_max_scale"));
148
			maxScaleCk.addActionListener(new ActionListener() {
149
				public void actionPerformed(ActionEvent arg0) {
150
					getMaxScaleField().setEnabled(!maxScaleCk.isSelected());
151
				}
152
			});
153
		}
154
		return maxScaleCk;
155
	}
156

  
157
	private JPanel getButtons() {
158
		JPanel buttons = new JPanel();
159
		buttons.add(getAcceptButton());
160
		buttons.add(getCancelButton());
161
		JPanel aux =new JPanel(new BorderLayout());
162
		aux.add(buttons, BorderLayout.EAST);
163
		return aux;
164
	}
165

  
166
	private JButton getAcceptButton() {
167
		if(this.acceptButton == null){
168
			this.acceptButton = new JButton( i18nManager.getTranslation("accept"));
169
			this.acceptButton.addActionListener(new ActionListener() {
170
				public void actionPerformed(ActionEvent arg0) {
171
					acceptWindow();
172
				}
173
			});
174
		}
175
		return this.acceptButton;
176
	}
177

  
178
	protected void acceptWindow() {
179
		if(validateValues()){
180
			notifyObservers(this, true);
181
		}
182
	}
183

  
184
	private JButton getCancelButton() {
185
		if(this.cancelButton == null){
186
			this.cancelButton = new JButton( i18nManager.getTranslation("cancel"));
187
			this.cancelButton.addActionListener(new ActionListener() {
188
				public void actionPerformed(ActionEvent arg0) {
189
					hideWindow();
190
				}
191
			});
192
		}
193
		return this.cancelButton;
194
	}
195

  
196
	protected void hideWindow() {
197
		notifyObservers(this, false);
198
	}
199

  
200
	private JSpinner getMaxScaleField() {
201
		if(maxScaleTXT == null){
202
			SpinnerModel model =
203
			        new SpinnerNumberModel(0, 0, 1000000000, 1000000);  
204
			maxScaleTXT = new JSpinner(model);
205
		}
206
		return maxScaleTXT;
207
	}
208

  
209
	private JSpinner getMinScaleField() {
210
		if(minScaleTXT == null){
211
			SpinnerModel model =
212
			        new SpinnerNumberModel(0, 0, 1000000000, 1000000);  
213
			minScaleTXT = new JSpinner(model);
214
		}
215
		return minScaleTXT;
216
	}
217
	
218
	private ComboBoxModel getModel(){
219
		if(model == null){
220
			model = new DefaultComboBoxModel();
221
			List<ILegendPanel> legendPanels = 
222
					SymbologySwingLocator.getSwingManager().getLegendEditors(layer);
223
			Iterator<ILegendPanel> it = legendPanels.iterator();
224
			while(it.hasNext()){
225
				ILegendPanel legPanel = (ILegendPanel) it.next();
226
				if(!((legPanel instanceof AbstractParentPanel) ||
227
						(legPanel instanceof DefaultComplexLegendPanel))){
228
					model.addElement(new LegendPanelCombo(legPanel));
229
				}
230
			}
231
			
232
		}
233
		return model;
234
	}
235
	
236
	public class LegendPanelCombo{
237
		
238
		private ILegendPanel legendPanel;
239

  
240
		public LegendPanelCombo(ILegendPanel panel){
241
			this.legendPanel = panel;
242
		}
243
		
244
		public ILegendPanel getLegendPanel(){
245
			return legendPanel;
246
		}
247
		
248
		public String toString(){
249
			return this.legendPanel.getTitle();
250
		}
251
		
252
	}
253
	
254
	private JComboBox getLegendTypes() {
255
		if(legendTypeCB == null){
256
			legendTypeCB = new JComboBox(getModel());
257
			legendTypeCB.setEditable(false);
258
			legendTypeCB.addActionListener(new ActionListener() {
259
				public void actionPerformed(ActionEvent arg0) {
260
					getLegendPanel();
261
				}
262
			});
263
		}
264
		return legendTypeCB;
265
	}
266

  
267
	public ILegendPanel getLegendPanel() {
268
		LegendPanelCombo legPanel = (LegendPanelCombo) getLegendTypes().getSelectedItem();
269
		return legPanel.getLegendPanel();
270
	}
271
	
272
	
273
	private void setData(ComplexLegendItem cli) {
274
		// TODO Auto-generated method stub
275
		
276
	}
277
	
278
	public boolean validateValues(){
279
		ComplexLegendItem auxLeg = getLegendItem();
280
		if(getLegendPanel() == null){
281
			createErrorDialog("panel_error_title", "panel_error");
282
			return false;
283
		}
284
		
285
		if(getMinScaleField().getValue() == null ||
286
				getMaxScaleField().getValue() == null ){
287
			createErrorDialog("min_max_error_title", "min_max_error");
288
			return false;
289
		}
290
		
291
		if(auxLeg.getMinScale() > auxLeg.getMaxScale()){
292
			if(auxLeg.getMaxScale() >= 0){
293
				createErrorDialog("min_greather_than_max_error_title", "min_greather_than_max_error");
294
				return false;
295
			}
296
		}
297
		
298
		if(complexLegend.isOverlapped(auxLeg)){
299
			createErrorDialog("overlaping_error_title", "overlaping_error");
300
			return false;
301
		}
302
		
303
		return true;
304
	}
305
	
306
	private void createErrorDialog(String title, String text){
307
		JOptionPane.showMessageDialog(null,
308
			    i18nManager.getTranslation(text),
309
			    i18nManager.getTranslation(title),
310
			    JOptionPane.ERROR_MESSAGE);
311
	}
312
	
313
	
314
	
315
	public ComplexLegendItem getLegendItem(){
316
		if(complexItem == null){
317
			complexItem = new DefaultComplexLegendItem();
318
		}
319
		
320
		ILegendPanel panelLegend = getLegendPanel();
321
		ILegend leg;
322
		try {
323
			leg = ((FLyrVect) layer).getLegend();
324
			panelLegend.setData(layer, leg);
325
			ILegend leg2 =panelLegend.getLegend();
326
			if(leg2 != null){
327
				complexItem.setLegend(leg2);
328
			}
329
		} catch (Exception e) {
330
			e.printStackTrace();
331
		}
332
		
333
		//complexItem.setLegend(getLegendPanel().getLegend());
334
		if(getMinScaleField().getValue() != null && !getWithoutMinScale().isSelected()){
335
			double min = Double.parseDouble(getMinScaleField().getValue().toString());
336
			complexItem.setMinScale(min);
337
		}else{
338
			complexItem.setMinScale(-1);
339
		}
340
		if(getMaxScaleField().getValue() != null && !getWithoutMaxScale().isSelected()){
341
			double max = Double.parseDouble(getMaxScaleField().getValue().toString());
342
			complexItem.setMaxScale(max);
343
		}else{
344
			complexItem.setMaxScale(-1);
345
		}
346
		return complexItem;
347
	}
348

  
349
	
350
	public void addObserver(Observer o) {
351
		observers.add(o);
352
	}
353

  
354
	public void deleteObserver(Observer o) {
355
		observers.remove(o);
356
	}
357

  
358
	public void deleteObservers() {
359
		observers.clear();
360
	}
361
	
362
	public synchronized void notifyObservers(Observable observable, Object tableName) {
363
		for(int i =0; i<this.observers.size(); i++ ) {
364
			Observer o = (Observer) this.observers.get(i);
365
			o.update(this, tableName);
366
		}
367
	}
368

  
369
	
370
	
371
}
0 372

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.swing/org.gvsig.complexlegend.swing.impl/src/main/java/org/gvsig/complexlegend/swing/impl/DefaultComplexLegendSwingLibrary.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.complexlegend.swing.impl;
23

  
24
import org.gvsig.andami.IconThemeHelper;
25
import org.gvsig.app.project.documents.view.legend.gui.LegendManager;
26
import org.gvsig.complexlegend.swing.ComplexLegendPanel;
27
import org.gvsig.complexlegend.swing.ComplexLegendSwingLibrary;
28
import org.gvsig.symbology.swing.SymbologySwingLocator;
29
import org.gvsig.tools.library.AbstractLibrary;
30
import org.gvsig.tools.library.LibraryException;
31

  
32
/**
33
 * Library for default swing implementation initialization and configuration.
34
 * 
35
 * @author gvSIG team
36
 * @version $Id$
37
 */
38
public class DefaultComplexLegendSwingLibrary extends AbstractLibrary {
39

  
40

  
41
	@Override
42
	public void doRegistration() {
43
		registerAsImplementationOf(ComplexLegendSwingLibrary.class);
44
	}
45
	
46
    @Override
47
    protected void doInitialize() throws LibraryException {
48
    }
49

  
50
    @Override
51
    protected void doPostInitialize() throws LibraryException {
52
//    	IconThemeHelper.registerIcon("chart", "chart-edit-add", this);
53
    	IconThemeHelper.registerIcon("legend", "scaled-symbols", this);
54
    	IconThemeHelper.registerIcon("legend", "legend-add", this);
55
    	IconThemeHelper.registerIcon("legend", "legend-delete", this);
56
    	
57
    }
58

  
59
}
0 60

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.swing/org.gvsig.complexlegend.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.complexlegend.swing.impl.DefaultComplexLegendSwingLibrary
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.swing/org.gvsig.complexlegend.swing.impl/src/test/resources/README.txt
1
Put into this folder the resources needed by your test classes.
2

  
3
This folder is added to the Tests classpath, so you can load any resources 
4
through the ClassLoader.
5

  
6
By default, in this folder you can find an example of log4j configuration,
7
prepared to log messages through the console, so logging works when you
8
run your tests classes.
0 9

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.swing/org.gvsig.complexlegend.swing.impl/src/test/resources/log4j.xml
1
<?xml version="1.0" encoding="ISO-8859-1" ?>
2
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3

  
4
<!-- 
5
Log4J configuration file for unit tests execution.
6
 -->
7
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
8

  
9
	<!-- Appender configuration to show logging messages through the console -->
10
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
11
		<layout class="org.apache.log4j.PatternLayout">
12
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
13
		</layout>
14
	</appender>
15

  
16
	<!-- 
17
	Activate logging messages of DEBUG level of higher only for the
18
	org.gvsig.tools packages.
19
	You can put full classes names or packages instead, to configure
20
	logging for all the classes and subpackages of the package.
21
	-->
22
	<category name="org.gvsig.tools">
23
		<priority value="DEBUG" />
24
	</category>
25
	<category name="org.gvsig.chart">
26
		<priority value="DEBUG" />
27
	</category>
28

  
29
	<!-- 
30
	By default, show only logging messages of INFO level or higher, 
31
	through the previously configured CONSOLE appender. 
32
	-->
33
	<root>
34
		<priority value="INFO" />
35
		<appender-ref ref="CONSOLE" />
36
	</root>
37
</log4j:configuration>
0 38

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.swing/org.gvsig.complexlegend.swing.impl/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
	<modelVersion>4.0.0</modelVersion>
4
	<artifactId>org.gvsig.complexlegend.swing.impl</artifactId>
5
	<packaging>jar</packaging>
6
	<name>org.gvsig.complexlegend.swing.impl</name>
7
	<parent>
8
		<groupId>org.gvsig</groupId>
9
		<artifactId>org.gvsig.complexlegend.swing</artifactId>
10
		<version>1.0.71</version>
11
	</parent>
12
	<dependencies>
13
		<dependency>
14
			<groupId>org.gvsig</groupId>
15
			<artifactId> org.gvsig.app.mainplugin</artifactId>
16
			<scope>compile</scope>
17
		</dependency>
18
		<dependency>
19
			<groupId>org.gvsig</groupId>
20
			<artifactId> org.gvsig.andami</artifactId>
21
			<scope>compile</scope>
22
		</dependency>
23
		<dependency>
24
			<groupId>org.gvsig</groupId>
25
			<artifactId>org.gvsig.fmap.geometry.api</artifactId>
26
			<scope>compile</scope>
27
		</dependency>
28
		<dependency>
29
			<groupId>org.gvsig</groupId>
30
			<artifactId>org.gvsig.complexlegend.lib.api</artifactId>
31
		</dependency>
32
		<dependency>
33
			<groupId>org.gvsig</groupId>
34
			<artifactId>org.gvsig.complexlegend.lib.impl</artifactId>
35
			<scope>compile</scope>
36
		</dependency>
37
		<dependency>
38
			<groupId>org.gvsig</groupId>
39
			<artifactId>org.gvsig.complexlegend.swing.api</artifactId>
40
			<scope>compile</scope>
41
		</dependency>
42
		<dependency>
43
            <groupId>org.gvsig</groupId>
44
            <artifactId>org.gvsig.tools.swing.api</artifactId>
45
            <scope>compile</scope>
46
        </dependency>
47
        <dependency>
48
            <groupId>org.gvsig</groupId>
49
            <artifactId>org.gvsig.app.mainplugin</artifactId>
50
            <scope>compile</scope>
51
        </dependency>
52
		<dependency>
53
            <groupId>org.gvsig</groupId>
54
            <artifactId>org.gvsig.symbology.swing.api</artifactId>
55
            <scope>compile</scope>
56
        </dependency>
57
        <dependency>
58
            <groupId>org.gvsig</groupId>
59
            <artifactId>org.gvsig.symbology.swing.impl</artifactId>
60
            <scope>compile</scope>
61
        </dependency>
62
	</dependencies>
63
</project>
0 64

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.app/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2

  
3
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
	<modelVersion>4.0.0</modelVersion>
5
	<artifactId>org.gvsig.complexlegend.app</artifactId>
6
	<packaging>pom</packaging>
7
	<name>org.gvsig.complexlegend.app</name>
8
	<description>complex legend extension</description>
9
	<parent>
10
        <groupId>org.gvsig</groupId>
11
        <artifactId>org.gvsig.complexlegend</artifactId>
12
		<version>1.0.71</version>
13
	</parent>
14
	<dependencyManagement>
15
		<dependencies>
16
		</dependencies>
17
	</dependencyManagement>
18

  
19
	<modules>
20
		<module>org.gvsig.complexlegend.app.mainplugin</module>
21
	</modules>
22

  
23
</project>
0 24

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.app/org.gvsig.complexlegend.app.mainplugin/buildNumber.properties
1
#Mon Feb 19 13:53:56 CET 2018
2
buildNumber=78
0 3

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.app/org.gvsig.complexlegend.app.mainplugin/src/main/resources-plugin/i18n/text.properties
1
#Translations for language [es]
2
#Tue May 12 10:57:39 CEST 2009
3
panel_error_title=Error en el panel
4
panel_error=Error en la creaci?n del panel
5
min_max_error_title=Valores de escala por definir
6
min_max_error=Se debe definir correctamente la escala m?nima y m?xima
7
min_greather_than_max_error_title=Datos inv?lidos
8
min_greather_than_max_error=Escala m?nima no puede ser mayor que escala m?xima
9
overlaping_error_title=Rango superpuesto
10
overlaping_error=El rango definido se superpone con otro ya existente
11
MinScale=Escala m?nima
12
MaxScale=Escala m?xima
13
LegendType=Tipo de leyenda
14
accept=Aceptar
15
cancel=Cancelar
16
SelectItem=Define un rango
17
legend_by_scale=Permite la edici?n de distintas leyendas en funci?n de la escala
18
complex_symbology=S?mbolo complejo
19
select_scale=Rangos definidos
20
legend_definition=Definici?n de la leyenda
21
without_min_scale=Sin rango inferior
22
without_max_scale=Sin rango superior
23

  
24
complex_label_class_properties=Definici?n de la etiqueta
25
Label_definition=Definici?n de la etiqueta
26
Label_scale_definition=Definici?n de la escala
0 27

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.app/org.gvsig.complexlegend.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties
1
#Translations for language [en]
2
#Tue May 12 10:57:38 CEST 2009
3
panel_error_title=Panel error
4
panel_error=Error creating the panel
5
min_max_error_title=Scale values not defined
6
min_max_error=Scales are not defined correctly
7
min_greather_than_max_error_title=Invalid data
8
min_greather_than_max_error=Min scale can't be greater than max scale
9
overlaping_error_title=Overlap range
10
overlaping_error=This range overlaps another one defined
11
MinScale=Min scale
12
MaxScale=Max scale
13
LegendType=Legend type
14
accept=Accept
15
cancel=Cancel
16
SelectItem=Define a range
17
legend_by_scale=Allow edit different legends by scale
18
complex_symbology=Complex symbology
19
select_scale=Defined ranges
20
legend_definition=Legend definition
21
without_min_scale=Without min scale
22
without_max_scale=Without max scale
23

  
24
complex_label_class_properties=Label definition
25
Label_definition=Label definition
26
Label_scale_definition=Scale definition
0 27

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.app/org.gvsig.complexlegend.app.mainplugin/src/main/resources-plugin/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<libraries library-dir="lib">
4
	</libraries>
5
	<depends plugin-name="org.gvsig.app.mainplugin"/>
6
	<depends plugin-name="org.gvsig.labeling.app.mainplugin"/>
7
		<resourceBundle name="text"/>
8
	<extensions>
9
		<extension class-name="org.gvsig.complexlegend.app.mainplugin.ComplexLegendExtension"
10
			description="Complex legend extension"
11
			active="true">
12
		</extension>
13
	</extensions>
14
</plugin-config>
0 15

  
org.gvsig.complexlegend/tags/org.gvsig.complexlegend-1.0.71/org.gvsig.complexlegend/org.gvsig.complexlegend.app/org.gvsig.complexlegend.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml
1
<assembly>
2
  <id>gvsig-plugin-package</id>
3
  <formats>
4
    <format>zip</format>
5
  </formats>
6
  <baseDirectory>${project.artifactId}</baseDirectory>
7
  <includeBaseDirectory>true</includeBaseDirectory>
8
  <files>
9
    <file>
10
      <source>target/${project.artifactId}-${project.version}.jar</source>
11
      <outputDirectory>lib</outputDirectory>
12
    </file>
13
    <file>
14
      <source>target/package.info</source>
15
    </file>
16
  </files>
17

  
18
  <fileSets>
19
    <fileSet>
20
      <directory>src/main/resources-plugin</directory>
21
      <outputDirectory>.</outputDirectory>
22
    </fileSet>
23
  </fileSets>
24

  
25
  <dependencySets>
26
    <dependencySet>
27
      <useProjectArtifact>false</useProjectArtifact>
28
      <useTransitiveDependencies>false</useTransitiveDependencies>
29
      <outputDirectory>lib</outputDirectory>
30
      <includes>
31
        <include>org.gvsig:org.gvsig.complexlegend.lib.api</include>
32
        <include>org.gvsig:org.gvsig.complexlegend.swing.api</include>
33
        <include>org.gvsig:org.gvsig.complexlegend.lib.impl</include>
34
        <include>org.gvsig:org.gvsig.complexlegend.swing.impl</include>
35
      </includes>
36
    </dependencySet>
37
  </dependencySets>
38

  
39
</assembly>
0 40

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff