本文整理汇总了Java中org.opengis.filter.sort.SortBy类的典型用法代码示例。如果您正苦于以下问题:Java SortBy类的具体用法?Java SortBy怎么用?Java SortBy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SortBy类属于org.opengis.filter.sort包,在下文中一共展示了SortBy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setValueAt
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
@Override
public void setValueAt(Object aValue, int row, int column) {
SortBy obj = dataList.get(row);
switch (column) {
case 0:
break;
case COL_SORT_ORDER: {
Boolean b = (Boolean) aValue;
SortOrder sortOrder = b.booleanValue() ? SortOrder.ASCENDING : SortOrder.DESCENDING;
((SortByImpl) obj).setSortOrder(sortOrder);
fireTableCellUpdated(row, column);
if (parentObj != null) {
parentObj.sortOrderUpdated();
}
break;
}
default:
break;
}
}
示例2: removeSelected
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
* Removes the selected properties from the destination table and returns a list so it can be
* added to the source list.
*
* @param table the table
* @return the list of removed property names
*/
public List<String> removeSelected(JTable table) {
List<String> itemsRemovedList = new ArrayList<String>();
int[] selectedRows = table.getSelectedRows();
if (selectedRows.length > 0) {
for (int i = selectedRows.length - 1; i >= 0; i--) {
SortBy obj = dataList.get(selectedRows[i]);
itemsRemovedList.add(0, obj.getPropertyName().getPropertyName());
dataList.remove(selectedRows[i]);
}
}
this.fireTableDataChanged();
if (parentObj != null) {
parentObj.sortOrderUpdated();
}
return itemsRemovedList;
}
示例3: setText
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
* Sets the text.
*
* @param value the new text
*/
public void setText(String value) {
Map<String, String> options = new HashMap<String, String>();
ListSelectionModel model = destinationTable.getSelectionModel();
model.clearSelection();
SortBy[] sortArray = null;
if (!value.isEmpty()) {
options.put(FeatureTypeStyle.SORT_BY, value);
sortArray = SLDStyleFactory.getSortBy(options);
}
destinationModel.populate(sortArray);
updateLists();
btnMoveDown.setEnabled(false);
btnMoveUp.setEnabled(false);
btnDestToSrcButton.setEnabled(false);
btnSrcToDestButton.setEnabled(false);
}
示例4: getQueryCapabilities
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
public QueryCapabilities getQueryCapabilities() {
// we can do both sorting and offset locally if necessary
return new QueryCapabilitiesDecorator(source.getQueryCapabilities()) {
@Override
public boolean isOffsetSupported() {
return true;
}
@Override
public boolean supportsSorting(SortBy[] sortAttributes) {
return true;
}
};
}
示例5: validateSortBy
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
void validateSortBy(List<SortBy> sortBys, FeatureTypeInfo meta, final GetFeatureRequest3D request)
throws IOException {
FeatureType featureType = meta.getFeatureType();
for (SortBy sortBy : sortBys) {
PropertyName name = sortBy.getPropertyName();
if (name.evaluate(featureType) == null) {
throw new WFSException(request, "Illegal property name: " + name.getPropertyName()
+ " for feature type " + meta.prefixedName(), "InvalidParameterValue");
}
}
}
示例6: getValueAt
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
@Override
public Object getValueAt(int row, int column) {
SortBy obj = dataList.get(row);
switch (column) {
case 0:
return obj.getPropertyName().getPropertyName();
case COL_SORT_ORDER:
return isAscendingSortOrder(obj);
default:
break;
}
return null;
}
示例7: populate
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
* Populate.
*
* @param sortArray the sort array
*/
public void populate(SortBy[] sortArray) {
dataList.clear();
if (sortArray != null) {
for (SortBy sortBy : sortArray) {
dataList.add(sortBy);
}
}
// Using fireTableStructureChanged rather than fireTableDataChanged so that the checkbox
// editors work with undo/redo
this.fireTableStructureChanged();
}
示例8: getEncodedString
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
* Gets the encoded string.
*
* @return the encoded string
*/
public String getEncodedString() {
List<String> list = new ArrayList<String>();
for (SortBy sortBy : dataList) {
String string = String.format("%s %s", sortBy.getPropertyName().getPropertyName(),
sortBy.getSortOrder().identifier().substring(0, 1));
list.add(string);
}
return String.join(", ", list);
}
示例9: containsProperty
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
* Check to see if list contains property name.
*
* @param item the item
* @return true, if successful
*/
public boolean containsProperty(String item) {
for (SortBy sortBy : dataList) {
if (sortBy.getPropertyName().getPropertyName().equals(item)) {
return true;
}
}
return false;
}
示例10: moveRowDown
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
* Move row down.
*
* @param index the index
*/
public void moveRowDown(int index) {
SortBy sortBy = dataList.remove(index);
dataList.add(index + 1, sortBy);
this.fireTableDataChanged();
if (parentObj != null) {
parentObj.sortOrderUpdated();
}
}
示例11: moveRowUp
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
/**
* Move row up.
*
* @param index the index
*/
public void moveRowUp(int index) {
SortBy sortBy = dataList.remove(index);
dataList.add(index - 1, sortBy);
this.fireTableDataChanged();
if (parentObj != null) {
parentObj.sortOrderUpdated();
}
}
示例12: secondaryIndexExample
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
static void secondaryIndexExample(String simpleFeatureTypeName,
DataStore dataStore,
String[] attributeFields,
String attributesQuery,
int maxFeatures,
String sortByField)
throws CQLException, IOException {
// construct a (E)CQL filter from the search parameters,
// and use that as the basis for the query
Filter cqlFilter = CQL.toFilter(attributesQuery);
Query query = new Query(simpleFeatureTypeName, cqlFilter);
query.setPropertyNames(attributeFields);
query.setMaxFeatures(maxFeatures);
if (!sortByField.equals("")) {
FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
SortBy[] sort = new SortBy[]{ff.sort(sortByField, SortOrder.DESCENDING)};
query.setSortBy(sort);
}
// submit the query, and get back an iterator over matching features
FeatureSource featureSource = dataStore.getFeatureSource(simpleFeatureTypeName);
FeatureIterator featureItr = featureSource.getFeatures(query).features();
// loop through all results
int n = 0;
while (featureItr.hasNext()) {
Feature feature = featureItr.next();
StringBuilder sb = new StringBuilder();
sb.append("Feature ID ").append(feature.getIdentifier());
for (String field : attributeFields) {
sb.append(" | ").append(field).append(": ").append(feature.getProperty(field).getValue());
}
System.out.println(sb.toString());
}
featureItr.close();
}
示例13: secondaryIndexExample
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
static void secondaryIndexExample(String simpleFeatureTypeName,
DataStore dataStore,
String[] attributeFields,
String attributesQuery,
int maxFeatures,
String sortByField)
throws CQLException, IOException {
// construct a (E)CQL filter from the search parameters,
// and use that as the basis for the query
Filter cqlFilter = CQL.toFilter(attributesQuery);
Query query = new Query(simpleFeatureTypeName, cqlFilter);
query.setPropertyNames(attributeFields);
query.setMaxFeatures(maxFeatures);
if (!sortByField.equals("")) {
FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
SortBy[] sort = new SortBy[]{ff.sort(sortByField, SortOrder.DESCENDING)};
query.setSortBy(sort);
}
// submit the query, and get back an iterator over matching features
FeatureSource featureSource = dataStore.getFeatureSource(simpleFeatureTypeName);
FeatureIterator featureItr = featureSource.getFeatures(query).features();
// loop through all results
while (featureItr.hasNext()) {
Feature feature = featureItr.next();
StringBuilder sb = new StringBuilder();
sb.append("Feature ID ").append(feature.getIdentifier());
for (String field : attributeFields) {
sb.append(" | ").append(field).append(": ").append(feature.getProperty(field).getValue());
}
System.out.println(sb.toString());
}
featureItr.close();
}
示例14: testNaturalSortingAsc
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
@Test
public void testNaturalSortingAsc() throws Exception {
init();
Query q = new Query(featureSource.getSchema().getTypeName());
q.setSortBy(new SortBy[] { SortBy.NATURAL_ORDER });
SimpleFeatureIterator features = featureSource.getFeatures(q).features();
String prevId = null;
while (features.hasNext()) {
String currId = features.next().getID();
if (prevId != null)
assertTrue(prevId.compareTo(currId) <= 0);
prevId = currId;
}
features.close();
}
示例15: testNaturalSortingDesc
import org.opengis.filter.sort.SortBy; //导入依赖的package包/类
@Test
public void testNaturalSortingDesc() throws Exception {
init();
Query q = new Query(featureSource.getSchema().getTypeName());
q.setSortBy(new SortBy[] { SortBy.REVERSE_ORDER });
SimpleFeatureIterator features = featureSource.getFeatures(q).features();
String prevId = null;
while (features.hasNext()) {
String currId = features.next().getID();
if (prevId != null)
assertTrue(prevId.compareTo(currId) >= 0);
prevId = currId;
}
features.close();
}