Revision 9657

View differences:

org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/pom.xml
1
<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">
2
  <modelVersion>4.0.0</modelVersion>
3
  <parent>
4
    <groupId>org.gvsig</groupId>
5
    <artifactId>org.gvsig.report</artifactId>
6
    <version>1.0.178</version>
7
  </parent>
8
  <artifactId>org.gvsig.report.lib</artifactId>
9
  <packaging>pom</packaging>
10
  <name>${project.artifactId}</name>
11
  <modules>
12
  	<module>${project.artifactId}.api</module>
13
  	<module>${project.artifactId}.impl</module>
14
  </modules>
15
</project>
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.report.lib.api.ReportLibrary
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/ReportException.java
1
package org.gvsig.report.lib.api;
2

  
3
import org.gvsig.tools.exception.BaseException;
4

  
5
/**
6
 *
7
 * @author jjdelcerro
8
 */
9
public class ReportException extends BaseException {
10

  
11
    public ReportException(String msg) {
12
        super("_JasperReportsException", msg, 0);
13
    }
14

  
15
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/ReportViewCapture.java
1
package org.gvsig.report.lib.api;
2

  
3
import java.awt.Dimension;
4
import org.gvsig.expressionevaluator.Expression;
5

  
6
/**
7
 *
8
 * @author jjdelcerro
9
 */
10
public interface ReportViewCapture {
11

  
12
    public interface ReportViewCaptureFilter {
13

  
14
        public String getDataSet();
15

  
16
        public Expression getExpression();
17

  
18
        public void setDataSet(String dataset);
19

  
20
        public void setDataSet(ReportDataSet dataset);
21

  
22
        public void setExpression(Expression expression);
23

  
24
        public boolean isEmpty();
25
        
26
    }
27

  
28
    public String getName();
29

  
30
    public void setName(String name);
31

  
32
    public String getView();
33

  
34
    public void setView(String view);
35

  
36
    public ReportViewCaptureFilter getZoomFilter();
37

  
38
    public ReportViewCaptureFilter getCenterFilter();
39

  
40
    public ReportViewCaptureFilter getSelectionFilter();
41
    
42
    public int getMargins();
43

  
44
    public void setMargins(int margins);
45

  
46
    public boolean getClearSelection();
47
    
48
    public void setClearSelection(boolean clearSelection);
49
    
50
    public String getFullURLPath();
51

  
52
    public boolean isEmpty();
53

  
54
    public boolean hasDimensions();
55
    
56
    public Dimension getDimensions();
57
    
58
    public int getResolution();
59
    
60
    public void setResolution(int dpi);
61

  
62
    public String getReportDataSet();
63

  
64
    public void setReportDataSet(String dataset);
65

  
66
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/Report.java
1
package org.gvsig.report.lib.api;
2

  
3
import java.io.File;
4
import org.gvsig.expressionevaluator.Expression;
5
import org.gvsig.fmap.dal.feature.Feature;
6
import org.gvsig.tools.task.SimpleTaskStatus;
7
import org.gvsig.tools.util.UnmodifiableBasicList64;
8

  
9
/**
10
 *
11
 * @author jjdelcerro
12
 */
13
public interface Report {
14

  
15
  public ReportConfig getConfig();
16

  
17
  public String getName();
18
  
19
  public Expression getPreparedFilter(Expression filter);
20
  
21
  public Object generateReport(SimpleTaskStatus status, Expression filter);
22
  
23
  public Object generateReport(final SimpleTaskStatus status, UnmodifiableBasicList64<Feature>features);
24

  
25
  public File generatePDF(SimpleTaskStatus status, Expression filter, File pdf);
26
  
27
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/ReportRuntimeException.java
1
package org.gvsig.report.lib.api;
2

  
3
import org.gvsig.tools.exception.BaseRuntimeException;
4

  
5
/**
6
 *
7
 * @author jjdelcerro
8
 */
9
public class ReportRuntimeException extends BaseRuntimeException {
10

  
11
    public ReportRuntimeException(String msg) {
12
        super("_JasperReportsRuntimeException", msg, 0);
13
    }
14

  
15
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/ReportLocator.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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 3
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.report.lib.api;
25

  
26
import org.gvsig.tools.locator.AbstractLocator;
27
import org.gvsig.tools.locator.Locator;
28
import org.gvsig.tools.locator.LocatorException;
29

  
30
@SuppressWarnings("rawtypes")
31
public class ReportLocator extends AbstractLocator {
32

  
33
	private static final String LOCATOR_NAME = "ReportLocator";
34
	
35
	public static final String REPORT_MANAGER_NAME =
36
			"org.gvsig.report.manager";
37

  
38
	private static final String REPORT_MANAGER_DESCRIPTION =
39
			"Report Manager of gvSIG";
40
	
41
	private static final ReportLocator instance = new ReportLocator();
42

  
43
	private ReportLocator() {
44

  
45
	}
46

  
47
	/**
48
	 * Return the singleton instance.
49
	 * 
50
	 * @return the singleton instance
51
	 */
52
	public static ReportLocator getInstance() {
53
		return instance;
54
	}
55

  
56
        @Override
57
	public String getLocatorName() {
58
		return LOCATOR_NAME;
59
	}
60

  
61
	/**
62
	 * Return a reference to ReportManager.
63
	 * 
64
	 * @return a reference to ReportManager
65
	 * @throws LocatorException
66
	 *             if there is no access to the class or the class cannot be
67
	 *             instantiated
68
	 * @see Locator#get(String)
69
	 */
70
	public static ReportManager getReportManager()
71
			throws LocatorException {
72
		return (ReportManager) getInstance().get(REPORT_MANAGER_NAME);
73
	}
74

  
75
	/**
76
	 * Registers the Class implementing the ReportManager interface.
77
	 * 
78
	 * @param clazz
79
	 *            implementing the ReportManager interface
80
	 */
81
	public static void registerReportManager(Class clazz) {
82
		getInstance().register(REPORT_MANAGER_NAME,
83
				REPORT_MANAGER_DESCRIPTION, clazz);
84
	}
85

  
86
	public static void registerDefaultReportManager(Class clazz) {
87
		getInstance().registerDefault(REPORT_MANAGER_NAME,
88
				REPORT_MANAGER_DESCRIPTION, clazz);
89
	}
90

  
91

  
92
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/ReportServices.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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 3
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.report.lib.api;
25

  
26
import java.awt.Dimension;
27
import java.awt.image.BufferedImage;
28
import java.io.File;
29
import java.util.List;
30
import org.gvsig.fmap.dal.feature.FeatureStore;
31
import org.gvsig.fmap.geom.primitive.Envelope;
32

  
33
/**
34
 *
35
 * @author jjdelcerro
36
 */
37
public interface ReportServices {
38

  
39
    public FeatureStore getFeatureStore(ReportDataSet dataSet);
40

  
41
    public BufferedImage getViewImage(String viewName, Dimension dimension, Envelope envelope);
42

  
43
    public List<String> getViewNames();
44

  
45
    public File relativizeFile(File file);
46

  
47
    public File derelativizeFile(File file);
48
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/ReportLibrary.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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 3
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.report.lib.api;
25

  
26
import org.gvsig.fmap.dal.DALLibrary;
27
import org.gvsig.fmap.geom.GeometryLibrary;
28
import org.gvsig.tools.ToolsLibrary;
29
import org.gvsig.tools.library.AbstractLibrary;
30
import org.gvsig.tools.library.LibraryException;
31

  
32
/**
33
 *
34
 * @author jjdelcerro
35
 */
36
public class ReportLibrary extends AbstractLibrary {
37

  
38
    @Override
39
    public void doRegistration() {
40
        super.doRegistration();
41
        registerAsAPI(ReportLibrary.class);
42
        this.require(ToolsLibrary.class);
43
        this.require(DALLibrary.class);
44
    }
45

  
46
    @Override
47
    protected void doInitialize() throws LibraryException {
48
    }
49

  
50
    @Override
51
    protected void doPostInitialize() throws LibraryException {
52
    }
53

  
54
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/ReportConfig.java
1
package org.gvsig.report.lib.api;
2

  
3
import java.io.InputStream;
4
import java.net.URL;
5
import javax.json.JsonObject;
6
import org.apache.commons.lang3.mutable.MutableObject;
7
import org.gvsig.tools.resourcesstorage.ResourcesStorage;
8

  
9
/**
10
 *
11
 * @author jjdelcerro
12
 */
13
public interface ReportConfig {
14

  
15
  public JsonObject toJSON();
16

  
17
  public void fromJSON(JsonObject json);
18

  
19
  public String getName();
20

  
21
  public void setName(String name);
22
  
23
  public int getLayoutManager();
24
  
25
  public void setLayoutManager(int layout);
26

  
27
  public String getReportTemplateName();
28

  
29
  public void setReportTemplate(String templateName);
30
  
31
  public void setReportResourcesStorage(ResourcesStorage storage);
32

  
33
  public String getDataSetName();
34

  
35
  public void setDataSetName(String name);
36

  
37
  public String getFilterFieldPrefix();
38
  
39
  public String getFilterFieldTable();
40
  
41
  public boolean hasDataSet();
42

  
43
  public ReportDataSet getDataSet();
44

  
45
  public ResourcesStorage getResources();
46

  
47
  public ResourcesStorage.Resource getReportTemplateAsResource();
48

  
49
  public URL getReportTemplateAsURL();
50

  
51
  public InputStream getReportTemplateAsStream();
52

  
53
  public void setDataSet(ReportDataSet dataset);
54

  
55
  public Report createReport();
56
  
57
  public boolean isValid(MutableObject<String> message);
58
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/ReportDataSet.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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 3
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.report.lib.api;
25

  
26
import java.util.Iterator;
27
import org.gvsig.expressionevaluator.Expression;
28
import org.gvsig.fmap.dal.feature.Feature;
29
import org.gvsig.fmap.dal.feature.FeatureQuery;
30
import org.gvsig.fmap.dal.feature.FeatureReference;
31
import org.gvsig.fmap.dal.feature.FeatureStore;
32
import org.gvsig.fmap.dal.feature.FeatureType;
33
import org.gvsig.tools.util.UnmodifiableBasicList64;
34
import org.gvsig.tools.visitor.Visitable;
35
import org.gvsig.tools.visitor.Visitor;
36

  
37
/**
38
 *
39
 * @author jjdelcerro
40
 */
41
public interface ReportDataSet {
42

  
43
    public interface SelectionOfFeatures extends UnmodifiableBasicList64<Feature>, Visitable {
44

  
45
        void add(Feature feature);
46

  
47
        void add(FeatureReference reference);
48

  
49
        void add(String referenceCode);
50

  
51
        void addAll(Iterator<Feature> features);
52

  
53
        void addAll(Visitable features);
54

  
55
        void addStoreSelection();
56

  
57
        void clear();
58

  
59
    }
60

  
61
    public void setName(String name);
62

  
63
    public String getName();
64

  
65
    public FeatureStore getStore();
66
   
67
    public FeatureType getFeatureType();
68

  
69
    public int getLimit();
70

  
71
    public Expression getFilter();
72

  
73
    public boolean hasThisStore(FeatureStore featureStore);
74

  
75
    public void accept(Visitor visitor);
76

  
77
    public void accept(Visitor visitor, Expression filter);
78

  
79
    public void accept(Visitor visitor, String filter, String sortfields, boolean ascending);
80

  
81
    public void accept(Visitor visitor, Expression filter, String sortfields, boolean ascending);
82

  
83
    public void setLimit(int limit);
84

  
85
    public void setFilter(Expression filter);
86

  
87
    public boolean getExposeGeometry();
88

  
89
    public void setExposeGeometry(boolean selected);
90

  
91
    public FeatureQuery getQuery();
92

  
93
    public UnmodifiableBasicList64<Feature> getFeatures();
94

  
95
    public UnmodifiableBasicList64<Feature> getFeatures(Expression filter);
96

  
97
    public SelectionOfFeatures getSelectionOfFeatures();
98
    
99
    public String getURLPath();
100
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/commands/AbstractCommandFactory.java
1

  
2
package org.gvsig.report.lib.api.commands;
3

  
4
import org.apache.commons.lang3.Range;
5
import org.gvsig.report.lib.api.ReportServer;
6
import org.gvsig.report.lib.api.ReportServices;
7

  
8
/**
9
 *
10
 * @author jjdelcerro
11
 */
12
public abstract class AbstractCommandFactory implements CommandFactory {
13
        
14
    private final String name;
15
    private final Range nargs;
16
    private final String mimetype;
17
    private final String description;
18

  
19
    protected AbstractCommandFactory(String name, Range nargs, String mimetype, String description) {
20
        this.name = name;
21
        this.nargs = nargs;
22
        this.mimetype = mimetype;
23
        this.description = description;
24
    }
25

  
26
    @Override
27
    public String getDescription() {
28
        return this.description;
29
    }
30
    
31
    @Override
32
    public String getName() {
33
        return this.name;
34
    }
35

  
36
    @Override
37
    public Range getNumArgs() {
38
        return this.nargs;
39
    }
40

  
41
    @Override
42
    public String getMimeType() {
43
        return this.mimetype;
44
    }
45
    
46
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/commands/Command.java
1
package org.gvsig.report.lib.api.commands;
2

  
3
import org.apache.commons.lang3.Range;
4
import org.gvsig.report.lib.api.ReportServer;
5

  
6
/**
7
 *
8
 * @author jjdelcerro
9
 */
10
public interface Command {
11

  
12
    Object call(int argc, String[] args) throws Exception;
13

  
14
    String getMimeType();
15

  
16
    String getName();
17

  
18
    Range getNumArgs();
19
    
20
    String getDescription();
21
    
22
    ReportServer getServer();
23
    
24
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/commands/AbstractCommand.java
1
package org.gvsig.report.lib.api.commands;
2

  
3
import org.apache.commons.lang3.Range;
4
import org.gvsig.report.lib.api.ReportServer;
5
import org.gvsig.report.lib.api.ReportServerConfig;
6
import org.gvsig.report.lib.api.ReportServices;
7
import org.slf4j.Logger;
8
import org.slf4j.LoggerFactory;
9

  
10
/**
11
 *
12
 * @author jjdelcerro
13
 */
14
public abstract class AbstractCommand implements Command {
15
    
16
    protected static final Logger LOG = LoggerFactory.getLogger(AbstractCommand.class);
17
    
18
    private final ReportServer server;
19
    private final CommandFactory factory;
20

  
21
    public AbstractCommand(CommandFactory factory, ReportServer server) {
22
        this.server = server;
23
        this.factory = factory;
24
    }
25

  
26
    protected ReportServices getServices() {
27
        return this.server.getServices();
28
    }
29

  
30
    protected ReportServerConfig getConfig() {
31
        return this.server.getConfig();
32
    }
33
    
34
    @Override
35
    public ReportServer getServer() {
36
        return this.server;
37
    }
38

  
39
    @Override
40
    public String getDescription() {
41
        return this.factory.getDescription().replace("${host}", this.server.getHost());
42
    }
43

  
44
    @Override
45
    public String getName() {
46
        return this.factory.getName();
47
    }
48

  
49
    @Override
50
    public Range getNumArgs() {
51
        return this.factory.getNumArgs();
52
    }
53

  
54
    @Override
55
    public String getMimeType() {
56
        return this.factory.getMimeType();
57
    }
58

  
59
    
60
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/commands/CommandFactory.java
1

  
2
package org.gvsig.report.lib.api.commands;
3

  
4
import org.apache.commons.lang3.Range;
5
import org.gvsig.report.lib.api.ReportServer;
6

  
7
/**
8
 *
9
 * @author jjdelcerro
10
 */
11
public interface CommandFactory {
12

  
13
    String getMimeType();
14

  
15
    String getName();
16

  
17
    Range getNumArgs();
18
    
19
    String getDescription();
20
    
21
    public Command create(ReportServer server);
22
    
23
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/ReportBuilder.java
1
package org.gvsig.report.lib.api;
2

  
3
import java.awt.Color;
4
import java.util.List;
5
import org.gvsig.expressionevaluator.Expression;
6
import org.gvsig.tools.dataTypes.DataType;
7
import org.gvsig.tools.persistence.Persistent;
8

  
9
/**
10
 *
11
 * @author jjdelcerro
12
 */
13
public interface ReportBuilder extends Persistent, org.gvsig.tools.lang.Cloneable {
14

  
15
    public final static int LAYOUT_CLASSIC = 0;
16
    public final static int LAYOUT_LIST = 1;
17
    public final static int LAYOUT_EXTENDEDLIST = 2;
18

  
19
    public final static int PAGE_A4_PORTRAIT = 0;
20
    public final static int PAGE_A4_LANDSCAPE = 1;
21
    public final static int PAGE_LEGAL_PORTRAIT = 2;
22
    public final static int PAGE_LEGAL_LANDSCAPE = 3;
23
    public final static int PAGE_LETTER_PORTRAIT = 4;
24
    public final static int PAGE_LETTER_LANDSCAPE = 5;
25

  
26
    public final static int GROUPBY_OPERATION_AVERAGE = 0;
27
    public final static int GROUPBY_OPERATION_COUNT = 1;
28
    public final static int GROUPBY_OPERATION_FIRST = 2;
29
    public final static int GROUPBY_OPERATION_HIGHEST = 3;
30
    public final static int GROUPBY_OPERATION_LOWEST = 4;
31
    public final static int GROUPBY_OPERATION_NOTHING = 5;
32
    public final static int GROUPBY_OPERATION_STANDARD_DEVIATION = 6;
33
    public final static int GROUPBY_OPERATION_SUM = 7;
34
    public final static int GROUPBY_OPERATION_SYSTEM = 8;
35
    public final static int GROUPBY_OPERATION_VARIANCE = 9;
36

  
37
    public interface BorderBuilder extends Persistent, org.gvsig.tools.lang.Cloneable {
38

  
39
        public final static int STYLE_SOLID = 1;
40
        public final static int STYLE_DASHED = 2;
41
        public final static int STYLE_DOTTED = 3;
42
        public final static int STYLE_DOUBLE = 4;
43

  
44
        public final static int WIDTH_NONE = 0;
45
        public final static int WIDTH_1POINT = 1;
46
        public final static int WIDTH_2POINT = 2;
47
        public final static int WIDTH_4POINT = 3;
48
        public final static int WIDTH_THIN = 4;
49

  
50
        public Color getColor();
51

  
52
        public BorderBuilder color(Color color);
53

  
54
        public int getWidth();
55

  
56
        public BorderBuilder width(int width);
57

  
58
        public int getLineStyle();
59

  
60
        public BorderBuilder lineStyle(int lineStyle);
61

  
62
        @Override
63
        public BorderBuilder clone() throws CloneNotSupportedException;
64

  
65
        public void copyFrom(BorderBuilder other);
66

  
67
    }
68

  
69
    public interface StyleBuilder extends Persistent, org.gvsig.tools.lang.Cloneable {
70

  
71
        public static final int ROTATION_NONE = 0;
72
        public static final int ROTATION_LEFT = 1;
73
        public static final int ROTATION_RIGHT = 2;
74

  
75
        public static final int STRETCHING_NO_STRETCH = 0;
76
        public static final int STRETCHING_RELATIVE_TO_BAND_HEIGHT = 1;
77
        public static final int STRETCHING_RELATIVE_TO_TALLEST_OBJECT = 2;
78

  
79
        public static final int HORIZONTALALIGN_LEFT = 0;
80
        public static final int HORIZONTALALIGN_CENTER = 1;
81
        public static final int HORIZONTALALIGN_JUSTIFY = 2;
82
        public static final int HORIZONTALALIGN_RIGHT = 3;
83

  
84
        public static final int VERTICALALIGN_MIDDLE = 0;
85
        public static final int VERTICALALIGN_BOTTOM = 1;
86
        public static final int VERTICALALIGN_JUSTIFIED = 2;
87
        public static final int VERTICALALIGN_TOP = 4;
88

  
89
        public static final int FONT_ARIAL = 0;
90
        public static final int FONT_COMIC_SANS = 1;
91
        public static final int FONT_COURIER_NEW = 2;
92
        public static final int FONT_GEORGIA = 3;
93
        public static final int FONT_MONOSPACED = 4;
94
        public static final int FONT_TIME_NEW_ROMAN = 5;
95
        public static final int FONT_VERDANA = 6;
96
        
97
        public static final int TRANSPARENCY_OPAQUE = 0;
98
        public static final int TRANSPARENCY_TRANSPARENT = 1;
99

  
100
        public Color getTextColor();
101

  
102
        public StyleBuilder textColor(Color textColor);
103

  
104
        public Color getBackgroundColor();
105

  
106
        public StyleBuilder backgroundColor(Color backgroundColor);
107

  
108
        public int getRotation();
109

  
110
        public StyleBuilder rotation(int rotation);
111

  
112
        public int getStretching();
113

  
114
        public StyleBuilder stretching(int stretching);
115

  
116
        public boolean getStretchingWithOverflow();
117

  
118
        public StyleBuilder stretchingWithOverflow(boolean stretchingWithOverflow);
119

  
120
        public ReportBuilder.StyleBuilder transparency(int transparency);
121

  
122
        public int getTransparency();
123

  
124
        public boolean getTransparent();
125

  
126
        public StyleBuilder transparent(boolean transparent);
127

  
128
        public int getVerticalAlign();
129

  
130
        public StyleBuilder verticalAlign(int verticalAlign);
131

  
132
        public int getHorizontalAlign();
133

  
134
        public StyleBuilder horizontalAlign(int horizontalAlign);
135

  
136
        public BorderBuilder getBorderTop();
137

  
138
        public StyleBuilder borderTop(BorderBuilder border);
139

  
140
        public BorderBuilder getBorderBottom();
141

  
142
        public StyleBuilder borderBottom(BorderBuilder border);
143

  
144
        public BorderBuilder getBorderLeft();
145

  
146
        public StyleBuilder borderLeft(BorderBuilder border);
147

  
148
        public BorderBuilder getBorderRight();
149

  
150
        public StyleBuilder borderRight(BorderBuilder border);
151

  
152
        public int getPaddingTop();
153

  
154
        public StyleBuilder paddingTop(int padding);
155

  
156
        public int getPaddingBottom();
157

  
158
        public StyleBuilder paddingBottom(int padding);
159

  
160
        public int getPaddingLeft();
161

  
162
        public StyleBuilder paddingLeft(int padding);
163

  
164
        public int getPaddingRight();
165

  
166
        public StyleBuilder paddingRight(int padding);
167

  
168
        public int getFont();
169

  
170
        public StyleBuilder font(int font);
171

  
172
        public int getFontSize();
173

  
174
        public StyleBuilder fontSize(int fontSize);
175

  
176
        @Override
177
        public StyleBuilder clone() throws CloneNotSupportedException;
178

  
179
        public void copyFrom(StyleBuilder other);
180

  
181
    }
182

  
183
    public interface ColumnBuilder extends Persistent, org.gvsig.tools.lang.Cloneable {
184

  
185
        public String getColumnName();
186

  
187
        public ColumnBuilder columnName(String columnName);
188

  
189
        public String getTitle();
190

  
191
        public StyleBuilder titleStyle();
192

  
193
        public ColumnBuilder title(String title);
194

  
195
        public String getField();
196

  
197
        public StyleBuilder fieldStyle();
198

  
199
        public ColumnBuilder field(String field);
200

  
201
        public Expression getExpression();
202

  
203
        public StyleBuilder expressionStyle();
204

  
205
        public ColumnBuilder expression(Expression expression);
206

  
207
        public DataType getDataType();
208

  
209
        public ColumnBuilder dataType(DataType dataType);
210

  
211
        public int getWidth();
212

  
213
        public ColumnBuilder width(int width);
214

  
215
        public boolean getFixedWidth();
216

  
217
        public ColumnBuilder fixedWidth(boolean fixedWidth);
218

  
219
        public String getPattern();
220

  
221
        public ColumnBuilder pattern(String pattern);
222

  
223
        public String getTruncateSuffix();
224

  
225
        public ColumnBuilder truncateSuffix(String truncateSuffix);
226

  
227
        public boolean showGroupByField();
228

  
229
        public void groupByField(boolean groupByField);
230

  
231
        public int getGroupByOperation();
232

  
233
        public void groupByOperation(int operation);
234

  
235
        @Override
236
        public ColumnBuilder clone() throws CloneNotSupportedException;
237

  
238
        public void copyFrom(ColumnBuilder other);
239

  
240
    }
241

  
242
    public interface Margins extends Persistent, org.gvsig.tools.lang.Cloneable {
243

  
244
        public int getTop();
245

  
246
        public int getBottom();
247

  
248
        public int getLeft();
249

  
250
        public int getRight();
251

  
252
        public Margins set(int top, int bottom, int left, int right);
253

  
254
        public Margins top(int top);
255

  
256
        public Margins bottom(int bottom);
257

  
258
        public Margins left(int left);
259

  
260
        public Margins right(int right);
261

  
262
        @Override
263
        public Margins clone() throws CloneNotSupportedException;
264

  
265
        public void copyFrom(Margins other);
266

  
267
    }
268

  
269
    public interface GroupBuilder extends Persistent, org.gvsig.tools.lang.Cloneable {
270

  
271
        public static final int GROUP_LAYOUT_DEFAULT = 0;
272
        public static final int GROUP_LAYOUT_DEFAULT_WITH_HEADER = 1;
273
        public static final int GROUP_LAYOUT_EMPTY = 2;
274
        public static final int GROUP_LAYOUT_VALUE_FOR_EACH = 3;
275
        public static final int GROUP_LAYOUT_VALUE_FOR_EACH_WITH_HEADERS = 4;
276
        public static final int GROUP_LAYOUT_VALUE_IN_HEADER = 5;
277
        public static final int GROUP_LAYOUT_VALUE_IN_HEADER_AND_FOR_EACH = 6;
278
        public static final int GROUP_LAYOUT_VALUE_IN_HEADER_AND_FOR_EACH_WITH_HEADERS = 7;
279
        public static final int GROUP_LAYOUT_VALUE_IN_HEADER_WITH_HEADERS = 8;
280
        public static final int GROUP_LAYOUT_VALUE_IN_HEADER_WITH_HEADERS_AND_COLUMN_NAME = 9;
281

  
282
        public ColumnBuilder getColumnBuilder();
283

  
284
        public int getGroupLayout();
285

  
286
        public void groupLayout(int groupLayout);
287

  
288
        public boolean getStartInNewColumn();
289

  
290
        public void startInNewColumn(boolean startInNewColumn);
291

  
292
        public boolean getStartInNewPage();
293

  
294
        public void startInNewPage(boolean startInNewPage);
295

  
296
        @Override
297
        public GroupBuilder clone() throws CloneNotSupportedException;
298

  
299
        public void copyFrom(GroupBuilder other);
300
    }
301

  
302
    public Margins createMargins();
303

  
304
    public ColumnBuilder createColumn();
305

  
306
    public StyleBuilder createStyle();
307

  
308
    public BorderBuilder createBorder();
309

  
310
    public GroupBuilder createGroup(ColumnBuilder columnBuilder);
311

  
312
    public int getLayout();
313

  
314
    public String getTitle();
315

  
316
    public String getSubtitle();
317

  
318
    public boolean getPrintBackgroundOnOddRows();
319

  
320
    public boolean getPrintColumnNames();
321

  
322
    public boolean getUseFullPageWith();
323

  
324
    public boolean getShowDetailBand();
325

  
326
    public int getDetailHeight();
327

  
328
    public int getColumnsPerPage();
329

  
330
    public Margins getMargins();
331

  
332
    public int getPageFormat();
333

  
334
    public List<ColumnBuilder> getColumns();
335
    
336
    public List<GroupBuilder> getGroups();
337

  
338
    public StyleBuilder titleStyle();
339

  
340
    public StyleBuilder subtitleStyle();
341

  
342
    public ReportBuilder title(String title);
343

  
344
    public ReportBuilder subtitle(String subtitle);
345

  
346
    public ReportBuilder printBackgroundOnOddRows(boolean printBackgroundOnOddRows);
347

  
348
    public ReportBuilder useFullPageWith(boolean useFullPageWith);
349

  
350
    public ReportBuilder showDetailBand(boolean showDetailBand);
351

  
352
    public ReportBuilder detailHeight(int detailHeight);
353

  
354
    public ReportBuilder columnsPerPage(int columnsPerPage);
355

  
356
    public ReportBuilder margins(int top, int bottom, int left, int right);
357

  
358
    public ReportBuilder printColumnNames(boolean printColumnNames);
359

  
360
    public ReportBuilder layout(int layout);
361

  
362
    public ReportBuilder pageFormat(int pageformat);
363

  
364
    public ColumnBuilder add_column();
365

  
366
    public GroupBuilder add_group(ColumnBuilder columnBuilder);
367

  
368
    @Override
369
    public ReportBuilder clone() throws CloneNotSupportedException;
370

  
371
    public void copyFrom(ReportBuilder other);
372

  
373
    public Report toReport(ReportDataSet store);
374
    
375
    public void clean();
376
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/ReportServer.java
1

  
2
package org.gvsig.report.lib.api;
3

  
4
import java.net.URL;
5
import java.util.Map;
6
import org.gvsig.report.lib.api.commands.Command;
7

  
8
public interface ReportServer {
9
    
10
    public static int INFO = 0;
11
    public static int WARN = 1;
12
    public static int DEBUG = 2;
13

  
14
    public interface LoggerListener {
15
        public void log(int level, String message);
16
    }
17
    
18
    public ReportServerConfig getConfig();
19
    
20
    public ReportServices getServices();
21
    
22
    public void start();
23
    
24
    public void stop();
25
    
26
    public void reload();
27
    
28
    public boolean isStarted();
29
    
30
    public void addLogListener(LoggerListener logger);
31
    
32
    public void removeLogListener(LoggerListener logger);
33
    
34
    public URL getURL(String path);
35
    
36
//    public URL getURL(ReportDataSet dataset);
37
    
38
    public String getHost();
39
    
40
    public void log(int level, String message);
41
    
42
    public Map<String, Command> getCommands();
43

  
44
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/ReportDataSets.java
1
package org.gvsig.report.lib.api;
2

  
3
import java.beans.PropertyChangeListener;
4
import java.util.List;
5
import org.gvsig.fmap.dal.feature.FeatureStore;
6

  
7
/**
8
 *
9
 * @author jjdelcerro
10
 */
11
public interface ReportDataSets extends List<ReportDataSet> {
12

  
13
    public ReportDataSet get(String name);
14
    
15
    public void add(String name, FeatureStore store);
16
    
17
    public void remove(String name);
18
    
19
    public boolean contains(FeatureStore store);
20
    
21
    public boolean contains(String name);
22
    
23
    public String getValidName(String name);
24
    
25
    public boolean isValidName(String name);
26
    
27
    public String getUniqueName(String name);
28
    
29
    public void addPropertyChangeListener(PropertyChangeListener listener);
30

  
31
    public void removePropertyChangeListener(PropertyChangeListener listener);
32
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/ReportManager.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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 3
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.report.lib.api;
25

  
26
import java.util.Collection;
27
import org.gvsig.expressionevaluator.SymbolTable;
28
import org.gvsig.fmap.dal.feature.FeatureQuery;
29
import org.gvsig.fmap.dal.feature.FeatureStore;
30
import org.gvsig.report.lib.api.commands.CommandFactory;
31
import org.gvsig.tools.bookmarksandhistory.Bookmarks;
32
import org.gvsig.tools.bookmarksandhistory.History;
33

  
34
/**
35
 *
36
 * @author jjdelcerro
37
 */
38
public interface ReportManager {
39
    
40
    public static final String FUNCTION_REPORT_VALUE = "REPORT_VALUE";
41
    
42
    public void setDefaultServer(ReportServer server);
43

  
44
    public ReportServer getDefaultServer();
45
    
46
    public ReportServer createServer(ReportServerConfig config);
47

  
48
    public ReportServerConfig createServerConfig(ReportServices services);
49

  
50
    public ReportServerConfig createServerConfig(ReportServices services, String jsonConfig);
51

  
52
    public ReportDataSet createDataSet(ReportServices services, String name, FeatureStore store);
53
    
54
    public ReportDataSet createDataSet(FeatureStore store);
55
    
56
    public ReportDataSet createDataSet(FeatureStore store, FeatureQuery query);
57
    
58
    public ReportViewCapture createViewCapture(ReportServerConfig config); 
59
    
60
    public Report createReport(ReportConfig config);
61
    
62
    public ReportConfig createReportConfig();
63
    
64
    public Collection<CommandFactory> getCommandFactories();
65
    
66
    public void registerCommandFactory(CommandFactory factory);
67
    
68
    public SymbolTable createReportSymbolTable();
69

  
70
    public ReportBuilder createReportBuilder();
71

  
72
    public  Bookmarks<ReportBuilder> getUserDefinedReportBookmarks();
73
    
74
    public void setUserDefinedReportBookmarks(Bookmarks<ReportBuilder> bookmarks);
75
    
76
    public  History<ReportBuilder> getUserDefinedReportHistory();
77
    
78
    public  void setUserDefinedReportHistory(History<ReportBuilder> history);
79

  
80
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/src/main/java/org/gvsig/report/lib/api/ReportServerConfig.java
1

  
2
package org.gvsig.report.lib.api;
3

  
4
import java.beans.PropertyChangeListener;
5
import java.util.List;
6

  
7
/**
8
 *
9
 * @author jjdelcerro
10
 */
11
public interface ReportServerConfig  {
12
    
13
    public int getPort();
14
    
15
    public int getTimeout();
16

  
17
    public String getServerInfo();
18
    
19
    public ReportDataSets getDatasets();
20
    
21
    public ReportDataSet getDataset(String name);
22
    
23
    public String toJSON();
24

  
25
    public ReportServerConfig setPort(int port);
26
    
27
    public ReportServerConfig setTimeout(int timeout);
28
    
29
    public ReportServerConfig setServerInfo(String serverInfo);
30
    
31
    public List<ReportViewCapture> getViewCaptures();
32
    
33
    public ReportViewCapture getViewCapture(String name);
34
    
35
    public void addPropertyChangeListener(PropertyChangeListener listener);
36

  
37
    public void removePropertyChangeListener(PropertyChangeListener listener);
38
    
39
    public ReportServices getServices();
40
    
41
    public boolean getAutostart();
42
    
43
    public void setAutostart(boolean enabled);
44
    
45
}
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.api/pom.xml
1
<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">
2
  <modelVersion>4.0.0</modelVersion>
3
  <parent>
4
    <groupId>org.gvsig</groupId>
5
    <artifactId>org.gvsig.report.lib</artifactId>
6
    <version>1.0.178</version>
7
  </parent>
8
  <artifactId>org.gvsig.report.lib.api</artifactId>
9
  <name>${project.artifactId}</name>
10
  <dependencies>
11
    <dependency>
12
      <groupId>org.gvsig</groupId>
13
      <artifactId>org.gvsig.tools.lib</artifactId>
14
      <scope>compile</scope>
15
    </dependency>
16
    <dependency>
17
      <groupId>org.gvsig</groupId>
18
      <artifactId>org.gvsig.fmap.dal.api</artifactId>
19
      <scope>compile</scope>
20
    </dependency>
21
  </dependencies>
22

  
23
</project>
0 24

  
org.gvsig.report/tags/org.gvsig.report-1.0.178/org.gvsig.report.lib/org.gvsig.report.lib.impl/src/main/java/org/gvsig/report/lib/impl/UnmodifiableBasicList64ToListAdapter.java
1
package org.gvsig.report.lib.impl;
2

  
3
import java.util.Collection;
4
import java.util.Iterator;
5
import java.util.List;
6
import java.util.ListIterator;
7
import java.util.NoSuchElementException;
8
import org.gvsig.tools.util.UnmodifiableBasicList64;
9

  
10
/**
11
 *
12
 * @author jjdelcerro
13
 * @param <T>
14
 */
15
public class UnmodifiableBasicList64ToListAdapter<T> implements List<T> {
16

  
17
    private final UnmodifiableBasicList64<T> basiclist;
18

  
19
    public UnmodifiableBasicList64ToListAdapter(UnmodifiableBasicList64<T> basiclist) {
20
        this.basiclist = basiclist;
21
    }
22
    
23
    @Override
24
    public int size() {
25
        return (int) this.basiclist.size64();
26
    }
27

  
28
    @Override
29
    public boolean isEmpty() {
30
        return this.basiclist.isEmpty();
31
    }
32

  
33
    @Override
34
    public boolean contains(Object o) {
35
        return indexOf(o) >= 0;
36
    }
37

  
38
    @Override
39
    public Iterator<T> iterator() {
40
        return this.basiclist.iterator();
41
    }
42

  
43
    @Override
44
    public Object[] toArray() {
45
        int size = this.size();
46
        Object[] result = new Object[size];
47
        int i = 0;
48
        for (int j = 0; j < size; j++) {
49
            result[i++] = this.get(j);
50
        }
51
        return result;
52
    }
53

  
54
    @Override
55
    public <T> T[] toArray(T[] a) {
56
        int size = this.size();
57
        if (a.length < size)
58
            a = (T[])java.lang.reflect.Array.newInstance(
59
                a.getClass().getComponentType(), size
60
            );
61
        int i = 0;
62
        Object[] result = a;
63
        for (int j = 0; j < size; j++) {
64
            result[i++] = this.get(j);
65
        }
66
        if (a.length > size)
67
            a[size] = null;
68
        return a;
69
    }
70

  
71
    @Override
72
    public boolean add(T e) {
73
        throw new UnsupportedOperationException("Not supported yet."); 
74
    }
75

  
76
    @Override
77
    public boolean remove(Object o) {
78
        throw new UnsupportedOperationException("Not supported yet."); 
79
    }
80

  
81
    @Override
82
    public boolean containsAll(Collection<?> c) {
83
        for (Object e : c)
84
            if (!contains(e))
85
                return false;
86
        return true;
87
    }
88

  
89
    @Override
90
    public boolean addAll(Collection<? extends T> c) {
91
        throw new UnsupportedOperationException("Not supported yet."); 
92
    }
93

  
94
    @Override
95
    public boolean addAll(int index, Collection<? extends T> c) {
96
        throw new UnsupportedOperationException("Not supported yet."); 
97
    }
98

  
99
    @Override
100
    public boolean removeAll(Collection<?> c) {
101
        throw new UnsupportedOperationException("Not supported yet."); 
102
    }
103

  
104
    @Override
105
    public boolean retainAll(Collection<?> c) {
106
        throw new UnsupportedOperationException("Not supported yet."); 
107
    }
108

  
109
    @Override
110
    public void clear() {
111
        throw new UnsupportedOperationException("Not supported yet."); 
112
    }
113

  
114
    @Override
115
    public T get(int index) {
116
        return this.basiclist.get64(index);
117
    }
118

  
119
    @Override
120
    public T set(int index, T element) {
121
        throw new UnsupportedOperationException("Not supported yet."); 
122
    }
123

  
124
    @Override
125
    public void add(int index, T element) {
126
        throw new UnsupportedOperationException("Not supported yet."); 
127
    }
128

  
129
    @Override
130
    public T remove(int index) {
131
        throw new UnsupportedOperationException("Not supported yet."); 
132
    }
133

  
134
    @Override
135
    public int indexOf(Object o) {
136
        int size = (int) this.basiclist.size64();
137
        if (o == null) {
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff