Revision 2669 branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/px/gml/Geometry.java

View differences:

Geometry.java
1 1
/*
2 2
 * Cresques Mapping Suite. Graphic Library for constructing mapping applications.
3
 * 
4
 * Copyright (C) 2004-5. 
5 3
 *
4
 * Copyright (C) 2004-5.
5
 *
6 6
 * This program is free software; you can redistribute it and/or
7 7
 * modify it under the terms of the GNU General Public License
8 8
 * as published by the Free Software Foundation; either version 2
......
18 18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19 19
 *
20 20
 * For more information, contact:
21
 * 
21
 *
22 22
 * cresques@gmail.com
23 23
 */
24 24
package org.cresques.px.gml;
25 25

  
26
import java.util.Vector;
27

  
28
import java.awt.geom.Point2D;
29

  
30
import java.awt.Graphics2D;
31

  
32 26
import org.cresques.cts.ICoordTrans;
33 27
import org.cresques.cts.IProjection;
28

  
34 29
import org.cresques.geo.Projected;
35 30
import org.cresques.geo.ViewPortData;
31

  
36 32
import org.cresques.px.Extent;
37 33
import org.cresques.px.PxObj;
38 34

  
35
import java.awt.Graphics2D;
36
import java.awt.geom.Point2D;
37

  
38
import java.util.Vector;
39

  
40

  
39 41
/**
40 42
 * Clase base para geometr?as.
41 43
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
42 44
 */
45
abstract public class Geometry extends PxObj implements Projected {
46
    protected IProjection proj;
43 47

  
44
abstract public class Geometry extends PxObj implements Projected {
45
	protected IProjection proj;
46
//	protected Extent extent = null;
47
	Vector data = null;
48
	
49
	public Geometry() {
50
		extent = new Extent();
51
		data = new Vector();
52
	}
53
	public void add(Point2D pt) {
54
		extent.add(pt);
55
		data.add(pt);
56
	}
57
	public Point2D get(int i) {
58
		return (Point2D)data.get(i);
59
	}
60
	public int pointNr() {
61
		return data.size();
62
	}
63
	public Vector getData() {
64
		return data;
65
	}
66
	public Extent getExtent() { return extent; }
67
	
68
	abstract public IProjection getProjection();
69
	abstract public void reProject(ICoordTrans rp);
70
	
71
	public void draw(Graphics2D g, ViewPortData vp) {
72
	}
48
    //	protected Extent extent = null;
49
    Vector data = null;
50

  
51
    public Geometry() {
52
        extent = new Extent();
53
        data = new Vector();
54
    }
55

  
56
    public void add(Point2D pt) {
57
        extent.add(pt);
58
        data.add(pt);
59
    }
60

  
61
    public Point2D get(int i) {
62
        return (Point2D) data.get(i);
63
    }
64

  
65
    public int pointNr() {
66
        return data.size();
67
    }
68

  
69
    public Vector getData() {
70
        return data;
71
    }
72

  
73
    public Extent getExtent() {
74
        return extent;
75
    }
76

  
77
    abstract public IProjection getProjection();
78

  
79
    abstract public void reProject(ICoordTrans rp);
80

  
81
    public void draw(Graphics2D g, ViewPortData vp) {
82
    }
73 83
}

Also available in: Unified diff