Revision 6333
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.fmap.dal.raster/org.gvsig.fmap.dal.raster.spi/src/main/java/org/gvsig/fmap/dal/raster/spi/RasterStoreProviderServices.java | ||
---|---|---|
45 | 45 |
* @param data |
46 | 46 |
*/ |
47 | 47 |
public void notifyChange(String notification, ResourceProvider data); |
48 |
|
|
48 |
|
|
49 | 49 |
/** |
50 | 50 |
* Call this to send a notification to observers of this store relative to |
51 | 51 |
* Resources |
52 | 52 |
* |
53 | 53 |
* @param notification |
54 |
* @param resource
|
|
54 |
* @param resource |
|
55 | 55 |
*/ |
56 | 56 |
public void notifyChange(String notification, Resource resource); |
57 | 57 |
|
... | ... | |
74 | 74 |
* @return Returns current FeatureStore name. |
75 | 75 |
*/ |
76 | 76 |
public String getName(); |
77 |
|
|
77 |
|
|
78 | 78 |
/** |
79 | 79 |
* Creates a {@link BandDescriptor} object. |
80 |
*
|
|
80 |
* |
|
81 | 81 |
* @param band |
82 | 82 |
* BandDescriptor band |
83 | 83 |
* @param attributes |
... | ... | |
88 | 88 |
|
89 | 89 |
/** |
90 | 90 |
* Creates a {@link BandAttributeDescriptor}. |
91 |
*
|
|
91 |
* |
|
92 | 92 |
* @param band |
93 | 93 |
* Band of attribute descriptor. |
94 | 94 |
* @param name |
... | ... | |
101 | 101 |
*/ |
102 | 102 |
public BandAttributeDescriptor createBandAttributeDescriptor(int band, String name, |
103 | 103 |
String description, List<Object> values); |
104 |
|
|
105 |
/** |
|
106 |
* Creates a {@link BandAttributeDescriptor}. |
|
107 |
* |
|
108 |
* @param band |
|
109 |
* Band of attribute descriptor. |
|
110 |
* @param name |
|
111 |
* Name of attribute |
|
112 |
* @param description |
|
113 |
* Descriptor of attribute |
|
114 |
* @param values |
|
115 |
* Values of band attribute descriptor |
|
116 |
* @param units |
|
117 |
* String units |
|
118 |
* @return A new {@link BandAttributeDescriptor} |
|
119 |
*/ |
|
120 |
public BandAttributeDescriptor createBandAttributeDescriptor(int band, String name, |
|
121 |
String description, List<Object> values, String units); |
|
104 | 122 |
} |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.fmap.dal.raster/org.gvsig.fmap.dal.raster.impl/src/main/java/org/gvsig/fmap/dal/raster/impl/DefaultBandAttributeDescriptor.java | ||
---|---|---|
37 | 37 |
|
38 | 38 |
/** |
39 | 39 |
* Default implementation of {@link BandAttributeDescriptor}. |
40 |
*
|
|
40 |
* |
|
41 | 41 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
42 | 42 |
* |
43 | 43 |
*/ |
44 | 44 |
public class DefaultBandAttributeDescriptor implements BandAttributeDescriptor { |
45 |
|
|
45 |
|
|
46 | 46 |
private static final String PERSISTENCE_NAME = "BandAttributeDescriptor"; |
47 | 47 |
private static final String PERSISTENCE_DESCRIPTION = ""; |
48 |
|
|
48 |
|
|
49 | 49 |
private static final String BAND_FIELD_NAME = "band"; |
50 | 50 |
private static final String NAME_FIELD_NAME = "name"; |
51 | 51 |
private static final String DESCRIPTION_FIELD_NAME = "description"; |
52 | 52 |
private static final String VALUES_FIELD_NAME = "values"; |
53 |
private static final String UNITS_FIELD_NAME = "units"; |
|
53 | 54 |
|
54 | 55 |
private int band; |
55 | 56 |
private String name; |
56 | 57 |
private String description; |
57 | 58 |
private List<Object> values; |
59 |
private String units; |
|
58 | 60 |
|
59 | 61 |
/** |
60 |
*
|
|
62 |
* |
|
61 | 63 |
* @param band |
62 | 64 |
* @param name |
63 | 65 |
* @param description |
64 |
* @param values
|
|
66 |
* @param values |
|
65 | 67 |
*/ |
66 | 68 |
public DefaultBandAttributeDescriptor(int band, String name, String description, |
67 | 69 |
List<Object> values) { |
... | ... | |
70 | 72 |
this.name = name; |
71 | 73 |
this.values = values; |
72 | 74 |
this.description = description; |
75 |
this.units = ""; |
|
73 | 76 |
} |
74 | 77 |
|
78 |
/** |
|
79 |
* |
|
80 |
* @param band |
|
81 |
* @param name |
|
82 |
* @param description |
|
83 |
* @param values |
|
84 |
* @param units |
|
85 |
*/ |
|
86 |
public DefaultBandAttributeDescriptor(int band, String name, String description, |
|
87 |
List<Object> values, String units) { |
|
88 |
super(); |
|
89 |
this.band = band; |
|
90 |
this.name = name; |
|
91 |
this.values = values; |
|
92 |
this.description = description; |
|
93 |
this.units = units; |
|
94 |
} |
|
95 |
|
|
75 | 96 |
@Override |
76 | 97 |
public int getBand() { |
77 | 98 |
return this.band; |
... | ... | |
91 | 112 |
public List<Object> getValues() { |
92 | 113 |
return Collections.unmodifiableList(this.values); |
93 | 114 |
} |
94 |
|
|
115 |
|
|
95 | 116 |
public static void registerPersitenceDefinition() { |
96 | 117 |
|
97 | 118 |
PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager(); |
... | ... | |
105 | 126 |
definition.addDynFieldString(NAME_FIELD_NAME); |
106 | 127 |
definition.addDynFieldString(DESCRIPTION_FIELD_NAME); |
107 | 128 |
definition.addDynFieldList(VALUES_FIELD_NAME).setClassOfItems(Object.class); |
129 |
definition.addDynFieldString(UNITS_FIELD_NAME); |
|
108 | 130 |
} |
109 | 131 |
} |
110 | 132 |
|
... | ... | |
114 | 136 |
state.set(NAME_FIELD_NAME, this.getName()); |
115 | 137 |
state.set(DESCRIPTION_FIELD_NAME, this.getDescription()); |
116 | 138 |
state.set(VALUES_FIELD_NAME, this.getValues()); |
139 |
state.set(UNITS_FIELD_NAME, this.getUnits()); |
|
117 | 140 |
} |
118 | 141 |
|
119 | 142 |
@Override |
... | ... | |
122 | 145 |
this.name = state.getString(NAME_FIELD_NAME); |
123 | 146 |
this.description = state.getString(DESCRIPTION_FIELD_NAME); |
124 | 147 |
this.values = new ArrayList<Object>(state.getList(VALUES_FIELD_NAME)); |
148 |
this.units = state.getString(UNITS_FIELD_NAME); |
|
125 | 149 |
} |
126 |
|
|
150 |
|
|
127 | 151 |
@Override |
128 | 152 |
public Object clone() throws CloneNotSupportedException { |
129 | 153 |
List<Object> newValues = new ArrayList<Object>(); |
... | ... | |
134 | 158 |
newValues.add(object); |
135 | 159 |
} |
136 | 160 |
} |
137 |
return new DefaultBandAttributeDescriptor(this.band, this.name, this.description, newValues); |
|
161 |
return new DefaultBandAttributeDescriptor(this.band, this.name, this.description, newValues, units);
|
|
138 | 162 |
} |
163 |
|
|
164 |
@Override |
|
165 |
public String getUnits() { |
|
166 |
return this.units; |
|
167 |
} |
|
139 | 168 |
} |
org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.fmap.dal.raster/org.gvsig.fmap.dal.raster.api/src/main/java/org/gvsig/fmap/dal/raster/api/BandAttributeDescriptor.java | ||
---|---|---|
31 | 31 |
/** |
32 | 32 |
* This class describes an attribute of band. This attribute is defined by a |
33 | 33 |
* name, description and a list with the available values. |
34 |
*
|
|
34 |
* |
|
35 | 35 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
36 | 36 |
* |
37 | 37 |
*/ |
... | ... | |
39 | 39 |
|
40 | 40 |
/** |
41 | 41 |
* Gets band of this attribute descriptor |
42 |
*
|
|
42 |
* |
|
43 | 43 |
* @return band Attribute descriptor band |
44 | 44 |
*/ |
45 | 45 |
public int getBand(); |
46 | 46 |
|
47 | 47 |
/** |
48 | 48 |
* Name of attribute |
49 |
*
|
|
49 |
* |
|
50 | 50 |
* @return Attribute name |
51 | 51 |
*/ |
52 | 52 |
public String getName(); |
53 | 53 |
|
54 | 54 |
/** |
55 | 55 |
* Description of attribute |
56 |
*
|
|
56 |
* |
|
57 | 57 |
* @return Attribute description |
58 | 58 |
*/ |
59 | 59 |
public String getDescription(); |
60 | 60 |
|
61 | 61 |
/** |
62 | 62 |
* Available values of this attribute band |
63 |
*
|
|
63 |
* |
|
64 | 64 |
* @return values A list with attribute band values |
65 | 65 |
*/ |
66 | 66 |
public List<Object> getValues(); |
67 |
|
|
68 |
/** |
|
69 |
* String units of the levels |
|
70 |
*/ |
|
71 |
public String getUnits(); |
|
67 | 72 |
} |
Also available in: Unified diff