Search in sources :

Example 1 with ValueField

use of com.revolsys.swing.component.ValueField in project com.revolsys.open by revolsys.

the class WebMercatorTileCache method actionAddLayer.

static void actionAddLayer(final BaseMapLayerGroup parent) {
    final ValueField dialog = new ValueField();
    dialog.setTitle("Add Web Mercator Tile Cache Layer");
    SwingUtil.addLabel(dialog, "URL");
    final TextField urlField = new TextField("url", 50);
    dialog.add(urlField);
    GroupLayouts.makeColumns(dialog, 2, true, true);
    dialog.setSaveAction(() -> {
        final String url = urlField.getText();
        if (Property.hasValue(url)) {
            final WebMercatorTileCacheLayer layer = new WebMercatorTileCacheLayer();
            layer.setUrl(url);
            layer.setVisible(true);
            parent.addLayer(layer);
        }
    });
    dialog.showDialog();
}
Also used : TextField(com.revolsys.swing.field.TextField) ValueField(com.revolsys.swing.component.ValueField)

Example 2 with ValueField

use of com.revolsys.swing.component.ValueField 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)

Example 3 with ValueField

use of com.revolsys.swing.component.ValueField in project com.revolsys.open by revolsys.

the class FileRecordLayer method newPropertiesTabGeneralPanelSource.

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

Example 4 with ValueField

use of com.revolsys.swing.component.ValueField in project com.revolsys.open by revolsys.

the class ArcGisRestServer method actionAddTileCacheLayer.

static void actionAddTileCacheLayer(final BaseMapLayerGroup parent) {
    final ValueField dialog = new ValueField();
    dialog.setTitle("Add ArcGIS Tile Cache");
    SwingUtil.addLabel(dialog, "URL");
    final TextField urlField = new TextField("url", 50);
    dialog.add(urlField);
    GroupLayouts.makeColumns(dialog, 2, true, true);
    dialog.setSaveAction(() -> {
        final String url = urlField.getText();
        if (Property.hasValue(url)) {
            final ArcGisRestServerTileCacheLayer layer = new ArcGisRestServerTileCacheLayer();
            layer.setUrl(url);
            layer.setVisible(true);
            parent.addLayer(layer);
        }
    });
    dialog.showDialog();
}
Also used : TextField(com.revolsys.swing.field.TextField) ValueField(com.revolsys.swing.component.ValueField)

Example 5 with ValueField

use of com.revolsys.swing.component.ValueField in project com.revolsys.open by revolsys.

the class Bing method actionAddLayer.

static void actionAddLayer(final BaseMapLayerGroup parent) {
    final ValueField dialog = new ValueField();
    dialog.setTitle("Add Bing Layer");
    dialog.setIconImage("bing");
    SwingUtil.addLabel(dialog, "Imagery Set");
    final ComboBox<ImagerySet> imagerySetField = ComboBox.newComboBox("imagerySet", ImagerySet.Road, ImagerySet.Aerial, ImagerySet.AerialWithLabels, ImagerySet.CollinsBart, ImagerySet.OrdnanceSurvey);
    dialog.add(imagerySetField);
    GroupLayouts.makeColumns(dialog, 2, true, true);
    dialog.setSaveAction(() -> {
        final BingLayer layer = new BingLayer();
        final ImagerySet imagerySet = imagerySetField.getSelectedItem();
        layer.setImagerySet(imagerySet);
        layer.setVisible(true);
        parent.addLayer(layer);
    });
    dialog.showDialog();
}
Also used : ValueField(com.revolsys.swing.component.ValueField)

Aggregations

ValueField (com.revolsys.swing.component.ValueField)24 TextField (com.revolsys.swing.field.TextField)7 Path (java.nio.file.Path)3 JLabel (javax.swing.JLabel)3 LinkedHashMapEx (com.revolsys.collection.map.LinkedHashMapEx)2 MapEx (com.revolsys.collection.map.MapEx)2 GriddedElevationModelReadFactory (com.revolsys.elevation.gridded.GriddedElevationModelReadFactory)2 BasePanel (com.revolsys.swing.component.BasePanel)2 PasswordField (com.revolsys.swing.field.PasswordField)2 ArrayList (java.util.ArrayList)2 TriangulatedIrregularNetworkReadFactory (com.revolsys.elevation.tin.TriangulatedIrregularNetworkReadFactory)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1 LineString (com.revolsys.geometry.model.LineString)1 Point (com.revolsys.geometry.model.Point)1 FolderConnectionRegistry (com.revolsys.io.file.FolderConnectionRegistry)1 GeoreferencedImageReadFactory (com.revolsys.raster.GeoreferencedImageReadFactory)1 RecordReaderFactory (com.revolsys.record.io.RecordReaderFactory)1 RecordStoreConnectionRegistry (com.revolsys.record.io.RecordStoreConnectionRegistry)1 RecordStore (com.revolsys.record.schema.RecordStore)1 Field (com.revolsys.swing.field.Field)1