本文整理汇总了Java中org.openstreetmap.josm.gui.util.GuiHelper类的典型用法代码示例。如果您正苦于以下问题:Java GuiHelper类的具体用法?Java GuiHelper怎么用?Java GuiHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GuiHelper类属于org.openstreetmap.josm.gui.util包,在下文中一共展示了GuiHelper类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: importData
import org.openstreetmap.josm.gui.util.GuiHelper; //导入依赖的package包/类
@Override
public void importData(final File file, final ProgressMonitor progressMonitor) {
progressMonitor.beginTask(tr("Loading json file..."));
progressMonitor.setTicksCount(2);
Logging.info("Parsing GeoJSON: " + file.getAbsolutePath());
try {
final ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
final GeoJsonObject object = mapper.readValue(file, GeoJsonObject.class);
progressMonitor.worked(1);
final BoundedDataSet data = new DataSetBuilder().build(object);
final Layer layer = new GeoJsonLayer(tr("Data Layer from GeoJSON: ") + file.getName(), data);
MainApplication.getLayerManager().addLayer(layer);
} catch (final Exception e) {
Logging.error("Error while reading json file!");
Logging.error(e);
GuiHelper.runInEDT(() -> JOptionPane.showMessageDialog(
null, tr("Error loading geojson file {0}", file.getAbsolutePath()), tr("Error"), JOptionPane.WARNING_MESSAGE));
} finally {
progressMonitor.finishTask();
}
}
示例2: readPreferences
import org.openstreetmap.josm.gui.util.GuiHelper; //导入依赖的package包/类
private void readPreferences() {
guideColor = Main.pref.getColor(marktr("improve way accuracy helper line"), null);
if (guideColor == null) guideColor = PaintColors.HIGHLIGHT.get();
turnColor = Main.pref.getColor(marktr("improve way accuracy helper turn angle text"), new Color(240, 240, 240, 200));
distanceColor = Main.pref.getColor(marktr("improve way accuracy helper distance text"), new Color(240, 240, 240, 120));
arcFillColor = Main.pref.getColor(marktr("improve way accuracy helper arc fill"), new Color(200, 200, 200, 50));
arcStrokeColor = Main.pref.getColor(marktr("improve way accuracy helper arc stroke"), new Color(240, 240, 240, 150));
perpendicularLineColor = Main.pref.getColor(marktr("improve way accuracy helper perpendicular line"), new Color(240, 240, 240, 150));
equalAngleCircleColor = Main.pref.getColor(marktr("improve way accuracy helper equal angle circle"), new Color(240, 240, 240, 150));
selectTargetWayStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.select-target", "2"));
moveNodeStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.move-node", "1 6"));
moveNodeIntersectingStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.move-node-intersecting", "1 2 6"));
addNodeStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.add-node", "1"));
deleteNodeStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.delete-node", "1"));
arcStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.helper-arc", "1"));
perpendicularLineStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.helper-perpendicular-line", "1 6"));
equalAngleCircleStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.helper-eual-angle-circle", "1"));
dotSize = Main.pref.getInteger("improvewayaccuracy.dot-size", 6);
arcRadiusPixels = Main.pref.getInteger("improvewayaccuracy.helper-arc-radius", 200);
perpendicularLengthPixels = Main.pref.getInteger("improvewayaccuracy.helper-perpendicular-line-length", 100);
turnTextDistance = Main.pref.getInteger("improvewayaccuracy.helper-turn-text-distance", 15);
distanceTextDistance = Main.pref.getInteger("improvewayaccuracy.helper-distance-text-distance", 15);
equalAngleCircleRadius = Main.pref.getInteger("improvewayaccuracy.helper-equal-angle-circle-radius", 15);
longKeypressTime = Main.pref.getInteger("improvewayaccuracy.long-keypress-time", 250);
}
示例3: importData
import org.openstreetmap.josm.gui.util.GuiHelper; //导入依赖的package包/类
@Override
public void importData(final File file, ProgressMonitor progressMonitor) throws IOException, IllegalDataException {
if (MainApplication.getLayerManager().getEditLayer() == null) {
GuiHelper.runInEDT(() -> new Notification(tr("Please open or create data layer before importing")).show());
return;
}
GuiHelper.runInEDTAndWait(() -> {
ImportDialog dlg = new ImportDialog();
if (dlg.getValue() != 1) return;
dlg.saveSettings();
MainApplication.worker.submit(new DxfImportTask(file));
});
}
示例4: displayError
import org.openstreetmap.josm.gui.util.GuiHelper; //导入依赖的package包/类
private static void displayError(String error) {
GuiHelper.runInEDT(() -> new Notification(error).setIcon(JOptionPane.ERROR_MESSAGE).show());
}