当前位置: 首页>>代码示例>>Java>>正文


Java FeatureTypeConstraint类代码示例

本文整理汇总了Java中org.geotools.styling.FeatureTypeConstraint的典型用法代码示例。如果您正苦于以下问题:Java FeatureTypeConstraint类的具体用法?Java FeatureTypeConstraint怎么用?Java FeatureTypeConstraint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FeatureTypeConstraint类属于org.geotools.styling包,在下文中一共展示了FeatureTypeConstraint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: populate

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
@Override
public void populate(SelectedSymbol selectedSymbol) {

    if (selectedSymbol != null) {
        StyledLayer styledLayer = selectedSymbol.getStyledLayer();
        if (styledLayer instanceof NamedLayerImpl) {
            NamedLayerImpl namedLayer = (NamedLayerImpl) styledLayer;

            fieldConfigVisitor.populateTextField(FieldIdEnum.NAME, namedLayer.getName());

            // Feature layer constraint
            List<FeatureTypeConstraint> ftcList = namedLayer.layerFeatureConstraints();

            fieldConfigVisitor.populateFieldTypeConstraint(
                    FieldIdEnum.LAYER_FEATURE_CONSTRAINTS, ftcList);
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:19,代码来源:NamedLayerDetails.java

示例2: populateField

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
/**
 * Populate field.
 *
 * @param valueList the value list
 */
@Override
public void populateField(List<FeatureTypeConstraint> valueList) {
    if (filterModel != null) {
        if (valueList != null) {
            filterModel.populate(valueList);

            UndoManager.getInstance()
                    .addUndoEvent(new UndoEvent(this, getFieldId(), oldValueObj, valueList));

            oldValueObj = valueList;

            valueUpdated();
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:21,代码来源:FieldConfigFeatureTypeConstraint.java

示例3: updateExtent

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
/**
 * Update extents of a feature type constraint.
 *
 * @param ftc the feature type constraint to update
 */
public void updateExtent(FeatureTypeConstraint ftc) {
    if (ftc == null) {
        return;
    }

    if (!extentList.isEmpty()) {
        Extent[] extentArray = new Extent[extentList.size()];
        int index = 0;
        for (Extent extent : extentList) {
            Extent newExtent = styleFactory.createExtent(extent.getName(), extent.getValue());

            extentArray[index] = newExtent;

            index++;
        }

        ftc.setExtents(extentArray);
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:25,代码来源:ExtentModel.java

示例4: getValueAt

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
    if ((rowIndex < 0) || (rowIndex >= getRowCount())) {
        return null;
    }

    if ((columnIndex < 0) || (columnIndex >= getColumnCount())) {
        return null;
    }

    FeatureTypeConstraint ftc = ftcList.get(rowIndex);

    switch (columnIndex) {
    case COL_NAME:
        return ftc.getFeatureTypeName();
    case COL_FILTER:
        if (ftc.getFilter() != null) {
            return ftc.getFilter().toString();
        }
        break;
    default:
        break;
    }
    return null;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:26,代码来源:FeatureTypeConstraintModel.java

示例5: testUpdateExtent

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:27,代码来源:ExtentModelTest.java

示例6: updateSymbol

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
/**
 * Update symbol.
 */
private void updateSymbol() {
    if (!Controller.getInstance().isPopulating()) {
        String name = fieldConfigVisitor.getText(FieldIdEnum.NAME);
        NamedLayer namedLayer = getStyleFactory().createNamedLayer();
        namedLayer.setName(name);

        // Feature type constraints
        List<FeatureTypeConstraint> ftcList = fieldConfigVisitor
                .getFeatureTypeConstraint(FieldIdEnum.LAYER_FEATURE_CONSTRAINTS);
        if ((ftcList != null) && !ftcList.isEmpty()) {
            FeatureTypeConstraint[] ftcArray = new FeatureTypeConstraint[ftcList.size()];
            namedLayer.setLayerFeatureConstraints(ftcList.toArray(ftcArray));
        }

        StyledLayer existingStyledLayer = SelectedSymbol.getInstance().getStyledLayer();
        if (existingStyledLayer instanceof NamedLayerImpl) {
            NamedLayerImpl existingNamedLayer = (NamedLayerImpl) existingStyledLayer;

            for (Style style : existingNamedLayer.styles()) {
                namedLayer.addStyle(style);
            }
        }
        SelectedSymbol.getInstance().replaceStyledLayer(namedLayer);

        this.fireUpdateSymbol();
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:31,代码来源:NamedLayerDetails.java

示例7: undoAction

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
/**
 * Undo action.
 *
 * @param undoRedoObject the undo/redo object
 */
@Override
public void undoAction(UndoInterface undoRedoObject) {
    if ((filterTable != null) && (undoRedoObject != null)) {
        try {
            @SuppressWarnings("unchecked")
            List<FeatureTypeConstraint> oldValue = (List<FeatureTypeConstraint>) undoRedoObject
                    .getOldValue();

            populateField(oldValue);
        } catch (ClassCastException e) {
            // Ignore
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:20,代码来源:FieldConfigFeatureTypeConstraint.java

示例8: redoAction

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
/**
 * Redo action.
 *
 * @param undoRedoObject the undo/redo object
 */
@Override
public void redoAction(UndoInterface undoRedoObject) {
    if ((filterTable != null) && (undoRedoObject != null)) {
        try {
            @SuppressWarnings("unchecked")
            List<FeatureTypeConstraint> newValue = (List<FeatureTypeConstraint>) undoRedoObject
                    .getNewValue();

            populateField(newValue);
        } catch (ClassCastException e) {
            // Ignore
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:20,代码来源:FieldConfigFeatureTypeConstraint.java

示例9: extentUpdated

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
@Override
public void extentUpdated() {
    if (filterTable != null) {
        FeatureTypeConstraint ftc = filterModel
                .getFeatureTypeConstraint(filterTable.getSelectedRow());
        if (ftc != null) {
            extentModel.updateExtent(ftc);
        }

        featureTypeConstraintUpdated();
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:13,代码来源:FieldConfigFeatureTypeConstraint.java

示例10: addNewEntry

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
/**
 * Adds the new entry.
 */
public void addNewEntry() {

    FeatureTypeConstraint ftc = styleFactory.createFeatureTypeConstraint(DEFAULT_NAME,
            Filter.INCLUDE, new Extent[0]);
    ftcList.add(ftc);

    this.fireTableDataChanged();

    if (parentObj != null) {
        parentObj.featureTypeConstraintUpdated();
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:16,代码来源:FeatureTypeConstraintModel.java

示例11: setValueAt

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
/**
 * Sets the value at.
 *
 * @param aValue the a value
 * @param rowIndex the row index
 * @param columnIndex the column index
 */
@Override
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
    if ((rowIndex < 0) || (rowIndex >= getRowCount())) {
        return;
    }

    if ((columnIndex < 0) || (columnIndex >= getColumnCount())) {
        return;
    }

    FeatureTypeConstraint ftc = ftcList.get(rowIndex);

    switch (columnIndex) {
    case COL_NAME: {
        String name = (String) aValue;
        ftc.setFeatureTypeName(name);
    }
        break;
    case COL_FILTER:
        break;
    default:
        break;
    }

    this.fireTableDataChanged();

    if (parentObj != null) {
        parentObj.featureTypeConstraintUpdated();
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:38,代码来源:FeatureTypeConstraintModel.java

示例12: populate

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
/**
 * Populate.
 *
 * @param ftcList the ftc list
 */
public void populate(List<FeatureTypeConstraint> ftcList) {
    this.ftcList.clear();

    if (ftcList != null) {
        for (FeatureTypeConstraint ftc : ftcList) {
            FeatureTypeConstraint newFTC = styleFactory.createFeatureTypeConstraint(
                    ftc.getFeatureTypeName(), ftc.getFilter(), new Extent[0]);

            this.ftcList.add(newFTC);
        }
    }
    this.fireTableDataChanged();
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:19,代码来源:FeatureTypeConstraintModel.java

示例13: getFeatureTypeConstraint

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
/**
 * Gets the feature type constraint.
 *
 * @param row the row
 * @return the feature type constraint
 */
public FeatureTypeConstraint getFeatureTypeConstraint(int row) {
    if ((row >= 0) && (row < ftcList.size())) {
        FeatureTypeConstraint ftc = ftcList.get(row);

        return ftc;
    }
    return null;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:15,代码来源:FeatureTypeConstraintModel.java

示例14: populateFieldTypeConstraint

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
/**
 * Populate feature type constraint field.
 *
 * @param fieldId the field id
 * @param ftcList the ftc list
 */
public void populateFieldTypeConstraint(FieldIdEnum fieldId,
        List<FeatureTypeConstraint> ftcList) {
    if (fieldConfigManager == null) {
        return;
    }
    FieldConfigBase fieldConfig = fieldConfigManager.get(fieldId);
    if (fieldConfig != null) {
        fieldConfig.populateField(ftcList);
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:17,代码来源:FieldConfigPopulation.java

示例15: getFeatureTypeConstraint

import org.geotools.styling.FeatureTypeConstraint; //导入依赖的package包/类
/**
 * Gets the list of feature type constraints.
 *
 * @param fieldId the field id
 * @return the list of feature type constraints
 */
public List<FeatureTypeConstraint> getFeatureTypeConstraint(FieldIdEnum fieldId) {
    if (fieldConfigManager != null) {
        FieldConfigValuePopulateInterface fieldConfig = fieldConfigManager.get(fieldId);

        if (fieldConfig != null) {
            return fieldConfig.getFeatureTypeConstraint();
        }
    }
    return null;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:17,代码来源:FieldConfigPopulation.java


注:本文中的org.geotools.styling.FeatureTypeConstraint类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。