Revision 640

View differences:

org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.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.chart.app</artifactId>
6
	<packaging>pom</packaging>
7
	<name>org.gvsig.chart.app</name>
8
	<description>Chart plugins</description>
9
	<parent>
10
        <groupId>org.gvsig</groupId>
11
        <artifactId>org.gvsig.chart</artifactId>
12
		<version>1.0.115</version>
13
	</parent>
14

  
15
	<modules>
16
		<module>org.gvsig.chart.app.mainplugin</module>
17
		<module>org.gvsig.chart.app.layoutplugin</module>
18
		<module>org.gvsig.chart.app.legendplugin</module>
19
	</modules>
20

  
21
</project>
0 22

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.layoutplugin/buildNumber.properties
1
#Mon Sep 28 21:52:10 CEST 2020
2
buildNumber=130
0 3

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.layoutplugin/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.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.layoutplugin/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.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.layoutplugin/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
  </dependencySets>
27

  
28
</assembly>
0 29

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.layoutplugin/src/main/java/org/gvsig/app/chart/layoutplugin/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 gvSIG extension</p>
11
	
12
	<p>
13
	Shows LandRegistryViewer into gvSIG.
14
	</p>
15

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

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.layoutplugin/src/main/java/org/gvsig/app/chart/layoutplugin/LayoutAddChartExtension.java
1
package org.gvsig.app.chart.layoutplugin;
2

  
3
import java.util.Hashtable;
4

  
5
import org.gvsig.andami.IconThemeHelper;
6
import org.gvsig.andami.PluginServices;
7
import org.gvsig.andami.plugins.Extension;
8
import org.gvsig.andami.ui.mdiManager.IWindow;
9
import org.gvsig.app.project.ProjectManager;
10
import org.gvsig.app.project.documents.layout.DefaultLayoutManager;
11
import org.gvsig.app.project.documents.layout.gui.LayoutPanel;
12
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutRectangleBehavior;
13
import org.gvsig.project.documents.layout.frames.FFrameChart;
14
import org.gvsig.project.documents.layout.frames.FFrameChartFactory;
15
import org.gvsig.project.documents.layout.frames.gui.dialogs.FFrameChartDialog;
16
import org.gvsig.project.documents.layout.tools.LayoutAddChartListenerImpl;
17

  
18
public class LayoutAddChartExtension extends Extension {
19

  
20
    private LayoutPanel layout = null;
21
    private Hashtable<LayoutPanel, LayoutAddChartListenerImpl> tools = new Hashtable<LayoutPanel, LayoutAddChartListenerImpl>();
22

  
23
    public void initialize() {
24
        // TODO Auto-generated method stub
25
        registerIcons();
26
    }
27
    
28
	private void registerFFrames() {
29
		DefaultLayoutManager layoutManager = (DefaultLayoutManager) ProjectManager
30
				.getInstance()
31
				.getDocumentManager(DefaultLayoutManager.TYPENAME);
32

  
33
		// Register Frames
34
		layoutManager.registerFrameFactory(new FFrameChartFactory());
35

  
36
		FFrameChart.registerPersistent();
37

  
38
		// Register FFrameDialogs forms
39
		layoutManager.registerFFrameDialog(
40
				FFrameChart.PERSISTENCE_DEFINITION_NAME,
41
				FFrameChartDialog.class);
42

  
43
	}
44

  
45

  
46
    @Override
47
	public void postInitialize() {
48
    	registerFFrames();
49
	}
50

  
51
	private void registerIcons() {
52
    	IconThemeHelper.registerIcon("icons", "addChart", this.getClass());
53
        PluginServices.getIconTheme().registerDefault("images","icons",
54
            "layout-insert-chart", null,
55
            this.getClass().getClassLoader()
56
                .getResource("images/icons/addChart.png"));
57

  
58
    }
59

  
60
	public void execute(String s) {
61
        layout = (LayoutPanel) PluginServices.getMDIManager().getActiveWindow();
62
        
63
        
64

  
65
        if (s.equals("SELECT")) {
66
            layout.getLayoutControl().setTool("layoutselect");
67
        } else
68
            if (s.equals("RECTANGLECHART")) {
69
            	if (!tools.contains(layout)) {
70
            		LayoutAddChartListenerImpl lapl =
71
            			new LayoutAddChartListenerImpl(layout);
72
            		layout.getLayoutControl().addLayoutTool("layoutaddchart",
73
                		new LayoutRectangleBehavior(lapl));
74
            		tools.put(layout, lapl);
75
            	}
76

  
77
                layout.getLayoutControl().setTool("layoutaddchart");
78
            }
79

  
80
		
81
	}
82

  
83
	public boolean isEnabled() {
84
        IWindow f = PluginServices.getMDIManager().getActiveWindow();
85

  
86
        if (f == null) {
87
            return false;
88
        }
89

  
90
        if (f instanceof LayoutPanel) {
91
            return ((LayoutPanel) f).getLayoutContext().isEditable();
92
        }
93

  
94
        return false;
95
	}
96

  
97
	public boolean isVisible() {
98
        IWindow f = PluginServices.getMDIManager().getActiveWindow();
99

  
100
        if (f == null) {
101
            return false;
102
        }
103

  
104
        if (f instanceof LayoutPanel) {
105
            return true;
106
        } else {
107
            return false;
108
        }
109

  
110
	}
111

  
112
}
0 113

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.layoutplugin/src/main/java/org/gvsig/project/documents/layout/frames/FFrameChart.java
1
package org.gvsig.project.documents.layout.frames;
2

  
3
import java.awt.Font;
4
import java.awt.Graphics2D;
5
import java.awt.font.FontRenderContext;
6
import java.awt.geom.AffineTransform;
7
import java.awt.geom.Rectangle2D;
8
import java.awt.image.BufferedImage;
9

  
10
import org.gvsig.andami.PluginServices;
11
import org.gvsig.app.project.documents.chart.ChartDocument;
12
import org.gvsig.app.project.documents.layout.fframes.FFrame;
13
import org.gvsig.app.project.documents.layout.fframes.FFramePicture;
14
import org.gvsig.chart.ChartService;
15
import org.gvsig.compat.print.PrintAttributes;
16
import org.gvsig.fmap.geom.Geometry;
17
import org.gvsig.tools.ToolsLocator;
18
import org.gvsig.tools.dynobject.DynStruct;
19
import org.gvsig.tools.persistence.PersistenceManager;
20
import org.gvsig.tools.persistence.PersistentState;
21
import org.gvsig.tools.persistence.exception.PersistenceException;
22

  
23
public class FFrameChart extends FFrame {
24
	
25
	public static final String PERSISTENCE_DEFINITION_NAME = "FFrameChart";
26
	
27
	private static final String ASSOCIATED_CHART = "assoc_chart";
28
	
29
	protected ChartDocument chartDoc = null;
30

  
31
	private boolean legendVisible;
32

  
33
	private boolean axisLabels;
34
	
35
    public ChartDocument getChartDoc() {
36
		return chartDoc;
37
	}
38

  
39

  
40
	public static void registerPersistent() {
41
        PersistenceManager manager = ToolsLocator.getPersistenceManager();
42
        if (manager.getDefinition(PERSISTENCE_DEFINITION_NAME) == null) {
43
            DynStruct definition =
44
                manager.addDefinition(FFrameChart.class,
45
                    PERSISTENCE_DEFINITION_NAME,
46
                    "FFrameChart persistence definition", null, null);
47

  
48
            definition.extend(manager
49
                .getDefinition(FFrame.PERSISTENCE_DEFINITION_NAME));
50

  
51
            definition.addDynFieldObject(ASSOCIATED_CHART).setClassOfValue(ChartDocument.class).setMandatory(true);
52
        }
53
    }
54

  
55

  
56
	public String getName() {
57
		return PERSISTENCE_DEFINITION_NAME;
58
	}
59

  
60
	public String getNameFFrame() {
61
		return PluginServices.getText(this, "chart") + num;
62
	}
63

  
64
	public void print(Graphics2D g, AffineTransform at, Geometry shape,
65
			PrintAttributes properties) {
66
		draw(g, at, null, null);		
67
	}
68

  
69
	@Override
70
	public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv,
71
			BufferedImage imgBase) {
72
		if (chartDoc == null)
73
			return;
74
			ChartService chS = ((ChartService) chartDoc.getChartService()).clone();
75
			if (chS != null) {
76
				chS.getChartProperties().setIsLegendVisible(this.getLegendVisible());
77

  
78
				int axisCount = chS.getDomainAxis().size();
79
				for(int i=0; i<axisCount; i++){
80
					chS.getDomainAxis().get(i).setIsChartAxisTitleVisible(false);
81
				}
82
				axisCount = chS.getRangeAxis().size();
83
				for(int i=0; i<axisCount; i++){
84
					chS.getRangeAxis().get(i).setIsChartAxisTitleVisible(false);
85
				}
86
				
87
				//chS.setAxisVisibles(false);
88
				
89
		        Rectangle2D.Double r = getBoundingBox(at);
90
		        g.rotate(Math.toRadians(getRotation()), r.x + (r.width / 2), r.y
91
		            + (r.height / 2));
92
		        double x = r.getMinX();
93
		        double y = r.getMinY();
94
		        double w = r.getWidth();
95
		        double h = r.getHeight();
96

  
97
		        if (intersects(rv, r) || w != 0 || h != 0) { // comprueba que no cae fuera de la pantalla
98
		        	// Ajustamos el tama?o del texto.
99
	                FontRenderContext frc = g.getFontRenderContext();
100
	                int scaledFontSize;
101

  
102
	                // TODO myScale es la escala sobre la que se extraen todos los
103
	                // escalados. Esto
104
	                // funciona bien tal cual est? si la ratio de aspecto
105
	                // (alto/ancho) del folio es constante
106
	                // porque se toma como medidas el ancho del folio real y el
107
	                // ancho del folio en pantalla.
108
	                // No se que pasar? si la ratio cambia, por ejemplo si se usan
109
	                // USLetter en lugar de DIN A4
110
	                double myScale = at.getScaleX() * 0.0234; // FLayoutUtilities.fromSheetDistance(folio.getAncho(),at)/rv.getWidth();
111
	                if(rv != null){
112
	                	myScale = r.getWidth()/rv.getWidth();
113
	                }
114
	                    // Aqu? se ajusta a partir de las caracter?sticas de la
115
	                    // fuente, una nueva fuente con el tama?o ajustado.
116
                    
117
	                chS.draw(g, r.getBounds());
118
	                chS.scaleFonts(myScale);
119

  
120
		        	chS.draw(g, r.getBounds());
121
		        	
122
		        	// restauramos
123
		        	//chS.scaleFonts(myScale);
124
		        }
125
			}
126
	}
127
	
128
    @Override
129
    public void loadFromState(PersistentState state)
130
        throws PersistenceException {
131
        super.loadFromState(state);
132
        chartDoc = (ChartDocument) state.get(ASSOCIATED_CHART);
133
    }
134

  
135
    @Override
136
    public void saveToState(PersistentState state) throws PersistenceException {
137
        super.saveToState(state);
138
        state.set(ASSOCIATED_CHART, chartDoc);
139
    }
140

  
141

  
142
	public void setChartDoc(ChartDocument chartSelected) {
143
		this.chartDoc = chartSelected;
144
	}
145

  
146

  
147
	public void setLegendVisible(boolean selected) {
148
		this.legendVisible = selected;
149
	}
150
	
151
	public boolean getLegendVisible(){
152
		return this.legendVisible;
153
	}
154

  
155

  
156
	public void setAxisLabels(boolean selected) {
157
		this.axisLabels = selected;
158
	}
159
	
160
	public boolean getAxisLabels(){
161
		return this.axisLabels;
162
	}
163

  
164
}
0 165

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.layoutplugin/src/main/java/org/gvsig/project/documents/layout/frames/gui/dialogs/FFrameChartDialog.java
1
package org.gvsig.project.documents.layout.frames.gui.dialogs;
2

  
3
import java.awt.event.ActionEvent;
4
import java.awt.event.ActionListener;
5
import java.awt.geom.Rectangle2D;
6
import java.util.List;
7

  
8
import javax.swing.JButton;
9
import javax.swing.JCheckBox;
10
import javax.swing.JComboBox;
11
import javax.swing.JLabel;
12

  
13
import org.gvsig.andami.PluginServices;
14
import org.gvsig.andami.ui.mdiManager.WindowInfo;
15
import org.gvsig.app.ApplicationLocator;
16
import org.gvsig.app.ApplicationManager;
17
import org.gvsig.app.project.Project;
18
import org.gvsig.app.project.documents.Document;
19
import org.gvsig.app.project.documents.chart.ChartDocument;
20
import org.gvsig.app.project.documents.chart.ChartDocumentManager;
21
import org.gvsig.app.project.documents.layout.LayoutContext;
22
import org.gvsig.app.project.documents.layout.fframes.IFFrame;
23
import org.gvsig.app.project.documents.layout.fframes.gui.JPRotation;
24
import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.AbstractFFrameDialog;
25
import org.gvsig.app.project.documents.layout.gui.LayoutPanel;
26
import org.gvsig.chart.swing.ChartSwingLocator;
27
import org.gvsig.chart.swing.ChartSwingManager;
28
import org.gvsig.project.documents.layout.frames.FFrameChart;
29

  
30
public class FFrameChartDialog extends AbstractFFrameDialog {
31

  
32
	/**
33
	 * 
34
	 */
35
	private static final long serialVersionUID = 8488799048881180876L;
36
	private FFrameChart fframechart;
37
	private Rectangle2D rect = new Rectangle2D.Double();
38
	private JPRotation pRotation;
39
	protected JComboBox cboChartDoc;
40
	private JCheckBox cboChartLegendVisible;
41
	private JCheckBox cboChartAxisLabelsVisible;
42
	private ChartSwingManager swingManager;
43

  
44
	public FFrameChartDialog(LayoutPanel layoutPanel, IFFrame frame) {
45
        super(layoutPanel, frame);
46
        fframechart = (FFrameChart) frame;
47
        swingManager = ChartSwingLocator.getSwingManager().getChartSwingManager();
48
        initialize();
49
		
50
	}
51
	
52

  
53
	public FFrameChart getFFChart(){
54
		return fframechart;
55
	}
56

  
57
	private void initialize() {
58
        this.setLayout(null);
59
        this.setSize(505, 142);
60
        
61
        JLabel lblSelectChartDocument = new JLabel(this.swingManager.getTranslation("Select_Chart_Document")+":");
62
        lblSelectChartDocument.setBounds(10, 42, 159, 14);
63
        add(lblSelectChartDocument);
64
        
65
        cboChartDoc = new JComboBox();
66
		ApplicationManager appManager = ApplicationLocator.getManager();
67
		Project project = appManager.getCurrentProject();
68
		
69
        List<Document> chartDocuments = project.getDocuments(ChartDocumentManager.TYPENAME);
70
//        ChartDocument[] pts = chartDocuments.toArray(new ChartDocument[chartDocuments.size()]);
71
        
72
        for (Document t : chartDocuments) {
73
        	cboChartDoc.addItem(t);
74
        }
75
        
76
        cboChartDoc.setBounds(175, 40, 164, 20);
77
        add(cboChartDoc);
78
        
79
        cboChartLegendVisible = new JCheckBox(this.swingManager.getTranslation("legend_visible"));
80
        cboChartLegendVisible.setSelected(true);
81
        cboChartLegendVisible.setBounds(175, 70, 164, 20);
82
        add(cboChartLegendVisible);
83
        
84
//        cboChartAxisLabelsVisible = new JCheckBox("label axis visible");
85
//        cboChartAxisLabelsVisible.setSelected(true);
86
//        cboChartAxisLabelsVisible.setBounds(175, 70, 164, 20);
87
//        add(cboChartAxisLabelsVisible);
88
        
89
        JButton btnOk = new JButton(this.swingManager.getTranslation("OK"));
90
        btnOk.addActionListener(new ActionListener() {
91
        	public void actionPerformed(ActionEvent e) {
92
        		ChartDocument chartSelected = (ChartDocument) cboChartDoc.getSelectedItem();
93
        		if (chartSelected != null){
94
//        			getFFChart().setChartDoc(chartSelected);
95
//        			getFFChart().setLegendVisible(cboChartLegendVisible.isSelected());
96
//        			getFFChart().setRotation(getPRotation().getRotation());
97
        			//fframechart.setAxisLabels(cboChartAxisLabelsVisible.isSelected());
98
        			
99
        			
100
        			LayoutPanel layout = (LayoutPanel) PluginServices.getMDIManager().getActiveWindow();
101
        		    	
102
                    getFFChart().setChartDoc(chartSelected);
103
                    LayoutContext lctxt = layout.getLayoutContext();
104
                    getFFChart().setLegendVisible(cboChartLegendVisible.isSelected());
105
        			getFFChart().setRotation(getPRotation().getRotation());
106
        			
107
                	lctxt.addFFrame(getFFChart(), true, true);
108
                	layout.getDocument().setModified(true);
109
                	layout.getLayoutControl().refresh();
110
        		}
111
                PluginServices.getMDIManager().closeWindow(FFrameChartDialog.this);
112

  
113
        	}
114
        });
115
        btnOk.setBounds(130, 108, 89, 23);
116
        add(btnOk);
117
        
118
        JButton btnCancel = new JButton(this.swingManager.getTranslation("Cancel"));
119
        btnCancel.addActionListener(new ActionListener() {
120
        	public void actionPerformed(ActionEvent e) {
121
                PluginServices.getMDIManager().closeWindow(FFrameChartDialog.this);
122
        	}
123
        });
124
        btnCancel.setBounds(250, 108, 89, 23);
125
        add(btnCancel);
126
        
127
        add(getPRotation());
128
        
129
        getPRotation().setRotation(fframechart.getRotation());
130
        
131
        
132

  
133
		
134
	}
135
	
136
    /**
137
     * This method initializes pRotation
138
     * 
139
     * @return javax.swing.JPanel
140
     */
141
    private JPRotation getPRotation() {
142
        if (pRotation == null) {
143
            pRotation = new JPRotation();
144
            pRotation.setBounds(373, 14, 120, 120);
145
        }
146
        return pRotation;
147
    }
148

  
149

  
150
	public void setRectangle(Rectangle2D r) {
151
		rect .setRect(r);		
152
	}
153

  
154
	public WindowInfo getWindowInfo() {
155
        WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
156
        m_viewinfo.setTitle(PluginServices.getText(this,
157
            "propiedades_marco_chart"));
158

  
159
        return m_viewinfo;
160

  
161
	}
162

  
163
	public boolean getIsAcepted() {
164
		// TODO Auto-generated method stub
165
		return false;
166
	}
167

  
168
	public IFFrame getFFrame() {
169
        return fframechart;
170
	}
171

  
172
	public Object getWindowProfile() {
173
		// TODO Auto-generated method stub
174
		return null;
175
	}
176
}
0 177

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.layoutplugin/src/main/java/org/gvsig/project/documents/layout/frames/FFrameChartFactory.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.project.documents.layout.frames;
23

  
24
import org.gvsig.andami.PluginServices;
25
import org.gvsig.app.project.documents.layout.fframes.FrameFactory;
26
import org.gvsig.app.project.documents.layout.fframes.IFFrame;
27

  
28
/**
29
 * Factory of FFramePicture.
30
 * 
31
 */
32
public class FFrameChartFactory extends FrameFactory {
33

  
34
    /**
35
     * Create a new IFFrame.
36
     * 
37
     * @return IFFrame.
38
     */
39
    public IFFrame createFrame() {
40
        FFrameChart chart = new FFrameChart();
41
        chart.setFrameFactory(this);
42
        return chart;
43
    }
44

  
45
    /**
46
     * Returns the name of registration in the point of extension.
47
     * 
48
     * @return Name of registration
49
     */
50
    public String getRegisterName() {
51
        return FFrameChart.PERSISTENCE_DEFINITION_NAME;
52
    }
53

  
54
    /**
55
     * Returns the name of IFFrame.
56
     * 
57
     * @return Name of IFFrame.
58
     */
59
    public String getNameType() {
60
        return PluginServices.getText(this, "FFrameChart");
61
    }
62
}
0 63

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.layoutplugin/src/main/java/org/gvsig/project/documents/layout/tools/LayoutAddChartListenerImpl.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.project.documents.layout.tools;
23

  
24
import java.awt.Image;
25

  
26
import org.gvsig.andami.PluginServices;
27
import org.gvsig.app.project.documents.layout.gui.LayoutPanel;
28
import org.gvsig.app.project.documents.layout.tools.listener.LayoutAddRectangleWithDialogListener;
29
import org.gvsig.project.documents.layout.frames.FFrameChart;
30

  
31
public class LayoutAddChartListenerImpl extends
32
    LayoutAddRectangleWithDialogListener {
33

  
34
    private final Image img = PluginServices.getIconTheme()
35
    	.get("cursor-selection-by-rectangle").getImage();
36

  
37

  
38
    /**
39
     * Crea un nuevo LayoutAddRectangleListener.
40
     * 
41
     * @param l
42
     *            Layout.
43
     */
44
    public LayoutAddChartListenerImpl(LayoutPanel l) {
45
        super(l);
46
    }
47

  
48
    /**
49
     * @see org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener#getCursor()
50
     */
51
    public Image getImageCursor() {
52
        return img;
53
    }
54

  
55
    /**
56
     * @see org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener#cancelDrawing()
57
     */
58
    public boolean cancelDrawing() {
59
        return false;
60
    }
61

  
62
    @Override
63
    public String getFFrameName() {
64
        return FFrameChart.PERSISTENCE_DEFINITION_NAME;
65
    }
66
}
0 67

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.layoutplugin/src/main/resources-plugin/i18n/text_en.properties
1
#Translations for language [en]
2
#Tue May 12 10:57:38 CEST 2009
3
Charts=Charts
4
Chart_preview=Chart preview
5
Advanced_configurations=Advanced configuration
6
Chart_variables=Chart variables
7
Visible=Is visible?
8
Chart_Name=Variable name
9
Chart_Type=Chart type
10
Render_type=Renderer type
11
Table_name=Data Table name
12
Type_Chart=Chart type
13
Data_Chart=Data origin
14
Format_Chart=Chart format
15
Cancel=Cancel
16
accept=Accept
17
Data_origin=Choose the data origin
18
Table=Table
19
Chart_Data_Definition=Chart data definition
20
use_selected_rows=Use only selected rows
21
Edit_Series_Values=Edit field values
22
Symbol=Symbol
23
Series_name=Series name
24
Format_configurations=Format configuration
25
Series=Series
26
Chart_Area=Chart area
27
Plot_Area=Plot area
28
Axis=Axis
29
Plot=Plot
30
Legend=Legend
31
Title=Title
32
Chart_Title=Chart title
33

  
34
Default=Default
35
Category=Category
36
Numerical=Numerical
37

  
38
Name=Name
39
Units=Units
40
Description=Description
41
Chart_Renderer_types=Chart rederer types
42
Drawing_options=Drawing options
43
Dimension= Dimension:
44
Output_Format=Output format:
45
Domain_Axis_type=Domain axis type:
46
Series_Type=Serie type:
47
Orientation=Orientation
48
Flip_Axis=Flip axis
49
legend=legend
50
tooltip=tooltip
51
urls=urls
52

  
53
Axis_Panel=Axis
54
Background=Background
55
alpha=Alpha
56
Chart_Visibility=Chart visibility
57
Hide_chart_if_no_data=Hide chart if there isn't data
58
Show_message=Show an empty chart with the following message: 
59
Text=Text
60
Font=Font
61
Type=Type:
62
Format=Format
63
Labels=Labels
64
Outline=Outline:
65

  
66
Is_category_Axis=Category axis
67
Combine_axis=Combine with another axis
68

  
69
LEFT=LEFT
70
RIGHT=RIGHT
71
CENTER=CENTER
72
TOP=TOP
73
BOTTOM=BOTTOM
74

  
75
Previous=Previous
76
Next=Next
77
Accept=Accept
78

  
79
Legend_visible=Legend visibility
80
Legend_position=Legend position
81
Choose_Font_Color=Choose font color
82
Use_default=Default
83
Coordinates=Coordinates
84
(pixels)=(pixels)
85

  
86
Default_size=Size by default
87
Width=Width:
88
Height=Height:
89

  
90
Pick_Color=Choose a color...
91
propiedades_grafico=Chart properties
92
General_options=Main options
93
Add_new_variable=Add a new variable
94
Edit_a_variable=Edit a variable
95

  
96
bar_legend=Bar legend
97
pie_legend=Pie legend
98
linked_chart=Linked chart 
99

  
100
origin_linked_table=Origin table data
101
destination_linked_table=Linked table data
102
table_origin=Layer origin
103
field_origin=Linked field
104
only_selected=Only rows selected
105
only_selection=Only rows selected
106
table_destination=Table to link
107
field_destination=Linked with
108
bars_chart=Bars
109
pie_chart=Pie
110
time_field=Temporal axis
111
desconocido_nulo=unknown/null
112
grouped_options=Null data policy
113

  
114
display_3d=3D display
115
color_schema=Color schema
116
background_symbol=Background symbol
117

  
118
ignore_null_groups=Ignore null values
119
add_null_in_special_category=Group null values in a category
120

  
121
ordered_field=Order axis alphanumerically
122
draw_bar_chart_for_each_feature=Draw a chart for each feature
123
choose_chart_type=Choose the chart type
124

  
125
chart_data_limit_exceeded=The data to be drawn in the chart exceeded the limit.
126
chart_data_more_info=For more information check the manual.
127
chart_data_using_selected_rows=The selected document exceeded the limit. Using only the selected rows.
128
chart_data_operation_seconds=This operation could take a few seconds. 
129
chart_data_no_rows_selected=The only selected rows option is checked but there isn't any row selected in the current document.
130
Is_title_Visible=is title visible?
131
Background=Background
132
Title_color=Title color
133
Choose_Background_Color=Choose background color...
134
Default_title=Default title
135
Empty_document_message=Message for an empty
136
No_charts_yet=No charts yet. Please, add some variables.
137
No_data_available=No data available for this chart. Please, define the data origins.
138
propiedades_marco_chart=Choose chart document
139

  
140
Angle=Label rotation
141
SavePDF=Export Chart Document to PDF
142
PDF_Image_Files=PDF Documents
143
Document_exported=Chart Document exported successfully
144

  
145
Labelling=Value labels
146
Is_Visible=Show values in chart
147
LabelFont=Label font
148
Data_shown=Information shown
149
NumericValues=Category values
150
CategoryNames=Category names
151
Horizontal=Horizontal
152
90?=90?
153
-90?=-90?
154

  
155
_create_plot=Create plot
156
_create_new_plot=Create a new plot
157
_edit_plot= Edit plot
158
_edit_current_plot=Edit current plot
159
_export_png= Export to PNG
160
_export_chart_png= Export current chart to PNG
161
_export_pdf= Export to PDF
162
_export_chart_pdf= Export current chart to PDF
163

  
164
PieChart=Pie chart
165
BarsChart_=Bars chart
166
XYPlotChart= XY Chart
167

  
168
Chart_area=Chart area
169
is_transparent=transparent
170
groupedBy=Grouped by
171
labels=Labels
172
values=Numeric values
173
optional=optional
174

  
175
Active_mouse_zoom-pan=Activate mouse zoom/pan
176
Deactive_mouse_zoom-pan=Deactivate mouse zoom/pan
177
Expand_chart=Expand chart
178

  
179
X-Axis=X-Axis
180
Y-Axis=Y-Axis
181
Z-Axis=Z-Axis
182
Horizontal=Horizontal
183

  
184
Select_Chart_Document=Select chart document
185
legend_visible=Show legend
186
Cancel=Cancel
0 187

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.layoutplugin/src/main/resources-plugin/i18n/text.properties
1
#Translations for language [es]
2
#Tue May 12 10:57:39 CEST 2009
3
Select_Chart_Document=Selecciona documento
4
legend_visible=Mostrar leyenda
5
Cancel=Cancelar
0 6

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.layoutplugin/src/main/resources-plugin/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="org.gvsig.app.mainplugin" />
4
	<depends plugin-name="org.gvsig.chart.app.mainplugin" />
5
	<depends plugin-name="org.gvsig.app.document.layout.app.mainplugin" />
6
	<resourceBundle name="text"/>
7
	<libraries library-dir="lib"/>
8
	<extensions>
9
		<extension class-name="org.gvsig.app.chart.layoutplugin.LayoutAddChartExtension"
10
			description="Add Chart to Layout."
11
			active="true">
12
			<menu text="Mapa/Insertar/Gr?fico" position="5007047" action-command="RECTANGLECHART" tooltip="insert_chart" icon="layout-insert-chart"/>
13

  
14
			<tool-bar name="Layout_Tools_Insert_Simple" position="530">
15
				<selectable-tool icon="layout-insert-chart" action-command="RECTANGLECHART"  tooltip="insert_chart" position="3"/>
16
			</tool-bar>
17

  
18
		</extension>
19

  
20
	</extensions>
21
</plugin-config>
0 22

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.layoutplugin/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
	<packaging>jar</packaging>
5
	<artifactId>org.gvsig.chart.app.layoutplugin</artifactId>
6
	<name>${project.artifactId}</name>
7

  
8
	<description>
9
This package adds to the layout the ability to insert chart documents.
10
</description>	
11
	<parent>
12
		<groupId>org.gvsig</groupId>
13
		<artifactId>org.gvsig.chart.app</artifactId>
14
		<version>1.0.115</version>
15
	</parent>
16
	<dependencies>
17
		<dependency>
18
			<groupId>org.gvsig</groupId>
19
			<artifactId>org.gvsig.app.mainplugin</artifactId>
20
			<scope>compile</scope>
21
		</dependency>
22
		<dependency>
23
			<groupId>org.gvsig</groupId>
24
			<artifactId>org.gvsig.compat.api</artifactId>
25
			<scope>compile</scope>
26
		</dependency>
27
		<dependency>
28
			<groupId>org.gvsig</groupId>
29
			<artifactId>org.gvsig.ui</artifactId>
30
            <scope>compile</scope>
31
		</dependency>
32
		
33
		<dependency>
34
			<groupId>org.gvsig</groupId>
35
			<artifactId>org.gvsig.app.document.table.app.mainplugin</artifactId>
36
			<scope>compile</scope>
37
		</dependency>
38
		<dependency>
39
			<groupId>org.gvsig</groupId>
40
			<artifactId>org.gvsig.app.document.layout2.app.mainplugin</artifactId>
41
			<scope>compile</scope>
42
		</dependency>		
43
		<dependency>
44
			<groupId>org.gvsig</groupId>
45
			<artifactId>org.gvsig.chart.lib.api</artifactId>
46
			<scope>compile</scope>
47
		</dependency>
48
		<dependency>
49
			<groupId>org.gvsig</groupId>
50
			<artifactId>org.gvsig.chart.swing.api</artifactId>
51
			<scope>compile</scope>
52
		</dependency>
53
		<dependency>
54
			<groupId>org.gvsig</groupId>
55
			<artifactId>org.gvsig.chart.lib.impl</artifactId>
56
			<scope>runtime</scope>
57
		</dependency>
58
		<dependency>
59
			<groupId>org.gvsig</groupId>
60
			<artifactId>org.gvsig.chart.lib.base</artifactId>
61
			<scope>runtime</scope>
62
		</dependency>
63
		<dependency>
64
			<groupId>org.gvsig</groupId>
65
			<artifactId>org.gvsig.chart.swing.impl</artifactId>
66
			<scope>runtime</scope>
67
		</dependency>
68
		<dependency>
69
			<groupId>org.gvsig</groupId>
70
			<artifactId>org.gvsig.chart.swing.base</artifactId>
71
			<scope>runtime</scope>
72
		</dependency>
73
		<dependency>
74
			<groupId>org.gvsig</groupId>
75
			<artifactId>org.gvsig.symbology.swing.api</artifactId>
76
			<scope>compile</scope>
77
		</dependency>
78
		<dependency>
79
			<groupId>org.gvsig</groupId>
80
			<artifactId>org.gvsig.chart.app.mainplugin</artifactId>
81
			<scope>compile</scope>
82
		</dependency>
83
		
84
	</dependencies>
85

  
86

  
87
  
88
	<properties>
89
        <!-- Package info property values -->
90
        <!-- Default values in org.gvsig.desktop -->
91
        <gvsig.package.info.state>testing</gvsig.package.info.state>
92
        <gvsig.package.info.official>true</gvsig.package.info.official>
93
        <gvsig.package.info.name>Layout: insert charts</gvsig.package.info.name>
94
        <gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2.1.0-A, required: org.gvsig.chart.app.mainplugin -ge 1.0.0-A</gvsig.package.info.dependencies>
95
        <gvsig.package.info.categories>Layout, Chart</gvsig.package.info.categories>
96
        <gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-chart/pool/</gvsig.package.info.poolURL>
97
    </properties>
98

  
99
</project>
0 100

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.legendplugin/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.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.legendplugin/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.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.legendplugin/src/main/resources-plugin/i18n/text.properties
1
#Translations for language [es]
2
#Tue May 12 10:57:39 CEST 2009
3
Chart_preview=Previsualizaci\u00f3n del gr\u00e1fico
4
Advanced_configurations=Configuraci\u00f3n avanzada
5
Chart_variables=Variables del gr\u00e1fico
6
Visible=\u00bfEs visible?
7
Chart_Name=Nombre de la variable
8
Chart_Type=Tipo de gr\u00e1fico
9
Render_type=Tipo de renderer
10
Table_name=Tabla origen de datos
11
Type_Chart=Tipo de gr\u00e1fico
12
Data_Chart=Origen de datos
13
Format_Chart=Formato del gr\u00e1fico
14
Cancel=Cancelar
15
accept=Aceptar
16
Data_origin=Elegir fuente de datos
17
Table=Tabla
18
Chart_Data_Definition=Campos de datos del gr\u00e1fico
19
use_selected_rows=Usar s\u00f3lo campos seleccionados
20
Edit_Series_Values=Editar valores de campos
21
Symbol=S\u00edmbolo
22
Series_name=Nombre de la serie
23
Format_configurations=Configuraci\u00f3n
24
Series=Series
25
Chart_Area=\u00c1rea del gr\u00e1fico
26
Plot_Area=\u00c1rea de datos
27
Axis=Ejes
28
Plot=Gr\u00e1fico
29
Legend=Leyenda
30
Title=T\u00edtulo
31
Chart_Title=T\u00edtulo del gr\u00e1fico
32

  
33
Default=Por defecto
34
Category=Categorizado
35
Numerical=Num\u00e9rico
36

  
37
Name=Nombre
38
Units=Unidades
39
Description=Descripci\u00f3n
40
Chart_Renderer_types=Tipos de renderer
41
Drawing_options=Opciones de pintado
42
Dimension= Dimensi\u00f3n: 
43
Output_Format=Formato salida:
44
Domain_Axis_type=Eje de dominio:
45
Series_Type=Tipo de series:
46
Orientation=Orientaci\u00f3n
47
Flip_Axis=Invertir ejes
48
legend=leyenda
49
tooltip=tooltip
50
urls=urls
51

  
52
Axis_Panel=Ejes
53
alpha=Alfa
54
Chart_Visibility=Visibilidad del gr\u00e1fico
55
Hide_chart_if_no_data=Ocultar el gr\u00e1fico si no hay datos
56
Show_message=Mostrar el gr\u00e1fico vac\u00edo con el mensaje siguiente:
57
Text=Texto
58
Font=Fuente
59
Type=Tipo:
60
Format=Formato
61
Labels=Etiquetas
62
Outline=Contorno:
63

  
64
Is_category_Axis=Eje de categorias
65
Combine_axis=Combinar con otro eje
66

  
67
LEFT=IZQUIERDA
68
RIGHT=DERECHA
69
CENTER=CENTRO
70
TOP=ARRIBA
71
BOTTOM=ABAJO
72

  
73
Previous=Anterior
74
Next=Siguiente
75
Accept=Aceptar
76

  
77
Legend_visible=Leyenda visible
78
Legend_position=Posici\u00f3n
79
Choose_Font_Color=Color de la fuente
80
Use_default=Por defecto
81
Coordinates=Coordenadas
82
(pixels)=(p\u00edxeles)
83

  
84
Default_size=Tama\u00f1o por defecto
85
Width=Ancho:
86
Height=Alto:
87

  
88
Pick_Color=Elige un color...
89
propiedades_grafico=Propiedades del Gr\u00e1fico
90
General_options=Opciones generales
91
Add_new_variable=A\u00f1ade nueva variable
92
Edit_a_variable=Edita una variable
93

  
94
bar_legend=Barras
95
pie_legend=Tartas
96

  
97
configure_size=Configurar tama\u00f1o de los s\u00edmbolos
98
fixed_size=Tama\u00f1o fijo
99
sum_field_values_size=Tama\u00f1o variable de la suma de los valores representados
100
field_size=Tama\u00f1o por campo
101
normalize=normalizado por
102
limits=L\u00edmites
103
active_limits=Activar l\u00edmites
104
show_axis=Mostrar ejes del gr\u00e1fico
0 105

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.legendplugin/src/main/resources-plugin/i18n/text_en.properties
1
#Translations for language [en]
2
#Tue May 12 10:57:38 CEST 2009
3
Chart_preview=Chart preview
4
Advanced_configurations=Advanced configuration
5
Chart_variables=Chart variables
6
Visible=Is visible?
7
Chart_Name=Variable name
8
Chart_Type=Chart type
9
Render_type=Renderer type
10
Table_name=Data Table name
11
Previous=Previous
12
Next=Next
13
Accept=Accept
14
show_axis=Show chart axis
0 15

  
org.gvsig.chart/tags/org.gvsig.chart-1.0.115/org.gvsig.chart.app/org.gvsig.chart.app.legendplugin/src/main/resources-plugin/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="org.gvsig.app.mainplugin" />
4
	<depends plugin-name="org.gvsig.chart.app.mainplugin" />
5
	<depends plugin-name="org.gvsig.app.document.table.app.mainplugin" />
6
	<resourceBundle name="text"/>
7
	<libraries library-dir="lib"/>
8
	<extensions>
9
		<extension class-name="org.gvsig.app.chart.legendplugin.ChartLegendExtension"
10
			description=""
11
			active="true"
12
			priority="1">
13
		</extension>	
14
	</extensions>
15
</plugin-config>
0 16

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

Also available in: Unified diff