use of org.geotools.styling.Extent in project sldeditor by robward-scisys.
the class ExtentModel method populate.
/**
* Populate.
*
* @param extentArray the extent array
*/
public void populate(Extent[] extentArray) {
this.extentList.clear();
if (extentArray != null) {
for (Extent extent : extentArray) {
Extent newExtent = styleFactory.createExtent(extent.getName(), extent.getValue());
this.extentList.add(newExtent);
}
}
this.fireTableDataChanged();
}
use of org.geotools.styling.Extent in project sldeditor by robward-scisys.
the class ExtentModel method addNewEntry.
/**
* Adds the new entry.
*/
public void addNewEntry() {
Extent extent = styleFactory.createExtent(DEFAULT_NEW_EXTENT_NAME, "0 0 0 0");
extentList.add(extent);
this.fireTableDataChanged();
if (parentObj != null) {
parentObj.extentUpdated();
}
}
use of org.geotools.styling.Extent in project sldeditor by robward-scisys.
the class ExtentModelTest method testUpdateExtent.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.ExtentModel#updateExtent(org.geotools.styling.FeatureTypeConstraint)}.
*/
@Test
public void testUpdateExtent() {
ExtentModel model = new ExtentModel(null);
Extent[] extentArray = null;
model.populate(extentArray);
extentArray = new Extent[2];
StyleFactoryImpl styleFactory = (StyleFactoryImpl) CommonFactoryFinder.getStyleFactory();
extentArray[0] = styleFactory.createExtent("extent 1", "1 1 1 1");
extentArray[1] = styleFactory.createExtent("extent 2", "2 2 2 2");
model.populate(extentArray);
FeatureTypeConstraint ftc = styleFactory.createFeatureTypeConstraint("feature type name", Filter.INCLUDE, null);
model.updateExtent(null);
model.updateExtent(ftc);
assertNotNull(ftc.getExtents());
assertEquals(2, ftc.getExtents().length);
}
Aggregations