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();
}
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;
}
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;
}
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();
}
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();
}
Aggregations