Revision 10627 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/VectorialIntervalLegend.java
VectorialIntervalLegend.java | ||
---|---|---|
45 | 45 |
import java.util.Comparator; |
46 | 46 |
import java.util.TreeMap; |
47 | 47 |
|
48 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
48 | 49 |
import com.hardcode.gdbms.engine.data.DataSource; |
49 | 50 |
import com.hardcode.gdbms.engine.instruction.FieldNotFoundException; |
50 | 51 |
import com.hardcode.gdbms.engine.values.Value; |
51 |
import com.iver.cit.gvsig.fmap.DriverException; |
|
52 | 52 |
import com.iver.cit.gvsig.fmap.core.FShape; |
53 | 53 |
import com.iver.cit.gvsig.fmap.core.IFeature; |
54 | 54 |
import com.iver.cit.gvsig.fmap.core.ISLDCompatible; |
... | ... | |
173 | 173 |
/** |
174 | 174 |
* @see com.iver.cit.gvsig.fmap.rendering.VectorialLegend#getSymbol(int) |
175 | 175 |
*/ |
176 |
public ISymbol getSymbol(int recordIndex) throws DriverException { |
|
177 |
try { |
|
178 |
Value val = dataSource.getFieldValue(recordIndex, fieldId); |
|
179 |
IInterval interval = getInterval(val); |
|
180 |
FSymbol theSymbol = getSymbolByInterval(interval); |
|
176 |
public ISymbol getSymbol(int recordIndex) throws ReadDriverException { |
|
177 |
Value val = dataSource.getFieldValue(recordIndex, fieldId); |
|
178 |
IInterval interval = getInterval(val); |
|
179 |
FSymbol theSymbol = getSymbolByInterval(interval); |
|
181 | 180 |
|
182 |
if (theSymbol != null) {
|
|
183 |
return theSymbol;
|
|
184 |
} else if (useDefaultSymbol) {
|
|
185 |
return getDefaultSymbol();
|
|
186 |
}
|
|
181 |
if (theSymbol != null) { |
|
182 |
return theSymbol; |
|
183 |
} else if (useDefaultSymbol) { |
|
184 |
return getDefaultSymbol(); |
|
185 |
} |
|
187 | 186 |
|
188 |
return null; |
|
189 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) { |
|
190 |
throw new DriverException(e); |
|
191 |
} |
|
187 |
return null; |
|
192 | 188 |
} |
193 | 189 |
|
194 | 190 |
/** |
... | ... | |
560 | 556 |
* @see com.iver.cit.gvsig.fmap.rendering.VectorialLegend#setDataSource(com.hardcode.gdbms.engine.data.DataSource) |
561 | 557 |
*/ |
562 | 558 |
public void setDataSource(DataSource ds) |
563 |
throws FieldNotFoundException, DriverException { |
|
564 |
try { |
|
565 |
dataSource = ds; |
|
566 |
ds.start(); |
|
567 |
fieldId = ds.getFieldIndexByName(fieldName); |
|
568 |
ds.stop(); |
|
569 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) { |
|
570 |
throw new DriverException(e); |
|
571 |
} |
|
559 |
throws FieldNotFoundException, ReadDriverException { |
|
560 |
dataSource = ds; |
|
561 |
ds.start(); |
|
562 |
fieldId = ds.getFieldIndexByName(fieldName); |
|
563 |
ds.stop(); |
|
572 | 564 |
} |
573 | 565 |
|
574 | 566 |
/** |
Also available in: Unified diff