Search in sources :

Example 1 with GeoreferencedImageReadFactory

use of com.revolsys.raster.GeoreferencedImageReadFactory in project com.revolsys.open by revolsys.

the class GeoreferencedImageLayer 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 GeoreferencedImageReadFactory factory = IoFactory.factoryByFileExtension(GeoreferencedImageReadFactory.class, fileNameExtension);
        if (factory != null) {
            SwingUtil.addLabelledReadOnlyTextField(panel, "File Type", factory.getName());
        }
    }
    GroupLayouts.makeColumns(panel, 2, true);
    return panel;
}
Also used : GeoreferencedImageReadFactory(com.revolsys.raster.GeoreferencedImageReadFactory) LineString(com.revolsys.geometry.model.LineString) ValueField(com.revolsys.swing.component.ValueField)

Aggregations

LineString (com.revolsys.geometry.model.LineString)1 GeoreferencedImageReadFactory (com.revolsys.raster.GeoreferencedImageReadFactory)1 ValueField (com.revolsys.swing.component.ValueField)1