当前位置: 首页>>代码示例>>Java>>正文


Java GuiHelper类代码示例

本文整理汇总了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();
    }
}
 
开发者ID:JOSM,项目名称:geojson,代码行数:27,代码来源:GeoJsonFileImporter.java

示例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);
}
 
开发者ID:kolesar-andras,项目名称:josm-plugin-improve-way,代码行数:29,代码来源:ImproveWayAccuracyAction.java

示例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));
    });
}
 
开发者ID:JOSM,项目名称:Dxf-Import,代码行数:14,代码来源:DxfImporter.java

示例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());
}
 
开发者ID:JOSM,项目名称:Dxf-Import,代码行数:4,代码来源:DxfImportTask.java


注:本文中的org.openstreetmap.josm.gui.util.GuiHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。