Statistics
| Revision:

gvsig-raster / org.gvsig.raster.cache / trunk / org.gvsig.raster.cache / org.gvsig.raster.cache.lib.impl / src / main / java / org / gvsig / raster / cache / buffer / impl / PxTileImpl.java @ 992

History | View | Annotate | Download (2.09 KB)

1
package org.gvsig.raster.cache.buffer.impl;
2

    
3
import java.awt.geom.Rectangle2D;
4

    
5
import org.gvsig.raster.cache.buffer.BufferDataSource;
6
import org.gvsig.raster.cache.buffer.PxTile;
7

    
8
/**
9
 * Class with the information about a tile of data.
10
 * 
11
 * @author Nacho Brodin (nachobrodin@gmail.com)
12
 */
13
public class PxTileImpl extends PxTile {
14
        private static final long    serialVersionUID = 1L;
15
        private String               reference        = null;
16
        private Rectangle2D          selection        = null;
17
        private BufferDataSource    dataSource       = null;
18
        
19
        /**
20
         * Set size and position values
21
         * @param  x
22
         *         Upper left X position 
23
         * @param  y
24
         *         Upper left X position
25
         * @param  w
26
         *         Width
27
         * @param  h
28
         *         Height
29
         */
30
        public PxTileImpl(int x, int y, int w, int h) {
31
                super(x, y, w, h);
32
        }
33
        
34
        /**
35
         * Set size, position values and a file reference
36
         * @param  x
37
         *         Upper left X position 
38
         * @param  y
39
         *         Upper left X position
40
         * @param  w
41
         *         Width
42
         * @param  h
43
         *         Height
44
         * @param  ref
45
         *         file reference
46
         */
47
        public PxTileImpl(int x, int y, int w, int h, String ref) {
48
                super(x, y, w, h);
49
                this.reference = ref;
50
        }
51
        
52
        /**
53
         * Get a interest area
54
         * @return Rectangle2D
55
         */
56
        public Rectangle2D getAreaOfInterest() {
57
                return selection;
58
        }
59
        
60
        /**
61
         * Set a interest area
62
         * @param selection
63
         */
64
        public void setAreaOfInterest(Rectangle2D selection) {
65
                this.selection = selection;
66
        }
67
        
68
        /**
69
         * Get the file reference
70
         * @return
71
         */
72
        public String getReference() {
73
                return reference;
74
        }
75
        
76
        /**
77
         * Set the file reference
78
         * @param ref
79
         */
80
        public void setReference(String ref) {
81
                this.reference = ref;
82
        }
83
        
84
        /**
85
         * Set the data source
86
         * @param dataSource
87
         */
88
        public void setDataSource(BufferDataSource dataSource) {
89
                this.dataSource = dataSource;
90
        }
91

    
92
        /**
93
         * Get the data source
94
         * @return
95
         */
96
        public BufferDataSource getDataSource() {
97
                return dataSource;
98
        }
99
        
100
        /**
101
         * Show information for debug
102
         */
103
        public void show() {
104
                System.out.println("X:" + getX() + " Y:" + getY() + " W:" + getWidth() + " H:" + getHeight());
105
        }
106
}