Search in sources :

Example 1 with TriangulatedIrregularNetworkReadFactory

use of com.revolsys.elevation.tin.TriangulatedIrregularNetworkReadFactory in project com.revolsys.open by revolsys.

the class TriangulatedIrregularNetworkLayer method newPropertiesTabGeneralPanelSource.

@Override
protected ValueField newPropertiesTabGeneralPanelSource(final BasePanel parent) {
    final ValueField panel = super.newPropertiesTabGeneralPanelSource(parent);
    if (this.url.startsWith("file:")) {
        final String fileName = this.url.replaceFirst("file:(//)?", "");
        SwingUtil.addLabelledReadOnlyTextField(panel, "File", fileName);
    } else {
        SwingUtil.addLabelledReadOnlyTextField(panel, "URL", this.url);
    }
    final String fileNameExtension = FileUtil.getFileNameExtension(this.url);
    if (Property.hasValue(fileNameExtension)) {
        SwingUtil.addLabelledReadOnlyTextField(panel, "File Extension", fileNameExtension);
        final TriangulatedIrregularNetworkReadFactory factory = IoFactory.factoryByFileExtension(TriangulatedIrregularNetworkReadFactory.class, fileNameExtension);
        if (factory != null) {
            SwingUtil.addLabelledReadOnlyTextField(panel, "File Type", factory.getName());
        }
    }
    GroupLayouts.makeColumns(panel, 2, true);
    return panel;
}
Also used : TriangulatedIrregularNetworkReadFactory(com.revolsys.elevation.tin.TriangulatedIrregularNetworkReadFactory) ValueField(com.revolsys.swing.component.ValueField)

Aggregations

TriangulatedIrregularNetworkReadFactory (com.revolsys.elevation.tin.TriangulatedIrregularNetworkReadFactory)1 ValueField (com.revolsys.swing.component.ValueField)1