Ticket #7190: DrawingOptions.patch
File DrawingOptions.patch, 7.3 KB (added by , 14 years ago) |
---|
-
src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
164 164 selectionManager = new SelectionManager(this, false, mv); 165 165 initialMoveDelay = Main.pref.getInteger("edit.initial-move-delay", 200); 166 166 initialMoveThreshold = Main.pref.getInteger("edit.initial-move-threshold", 5); 167 drawTargetHighlight = Main.pref.getBoolean("draw.target-highlight", true);168 167 } 169 168 170 169 @Override … … 174 173 mv.addMouseMotionListener(this); 175 174 mv.setVirtualNodesEnabled( 176 175 Main.pref.getInteger("mappaint.node.virtual-size", 8) != 0); 176 drawTargetHighlight = Main.pref.getBoolean("draw.target-highlight", true); 177 177 // This is required to update the cursors when ctrl/shift/alt is pressed 178 178 try { 179 179 Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK); -
src/org/openstreetmap/josm/gui/preferences/DrawingPreference.java
11 11 import javax.swing.BorderFactory; 12 12 import javax.swing.Box; 13 13 import javax.swing.JCheckBox; 14 import javax.swing.JLabel; 14 15 import javax.swing.JPanel; 15 16 import javax.swing.JScrollPane; 16 17 … … 33 34 private JCheckBox sourceBounds = new JCheckBox(tr("Draw boundaries of downloaded data")); 34 35 private JCheckBox virtualNodes = new JCheckBox(tr("Draw virtual nodes in select mode")); 35 36 private JCheckBox inactive = new JCheckBox(tr("Draw inactive layers in other color")); 37 38 // Options that affect performance 39 private JCheckBox useHighlighting = new JCheckBox(tr("Highlight target ways and nodes")); 40 private JCheckBox drawHelperLine = new JCheckBox(tr("Draw rubber-band helper line")); 36 41 private JCheckBox useAntialiasing = new JCheckBox(tr("Smooth map graphics (antialiasing)")); 37 42 private JCheckBox outlineOnly = new JCheckBox(tr("Draw only outlines of areas")); 38 43 39 44 public void addGui(PreferenceTabbedPane gui) { 40 45 gui.display.setPreferredSize(new Dimension(400,600)); 41 46 gpxPanel = new GPXSettingsPanel(); … … 79 84 segmentOrderNumber.setSelected(Main.pref.getBoolean("draw.segment.order_number", false)); 80 85 panel.add(segmentOrderNumber, GBC.eop().insets(20,0,0,0)); 81 86 82 // antialiasing83 useAntialiasing.setToolTipText(tr("Apply antialiasing to the map view resulting in a smoother appearance."));84 useAntialiasing.setSelected(Main.pref.getBoolean("mappaint.use-antialiasing", true));85 panel.add(useAntialiasing, GBC.eop().insets(20,0,0,0));86 87 87 // downloaded area 88 88 sourceBounds.setToolTipText(tr("Draw the boundaries of data loaded from the server.")); 89 89 sourceBounds.setSelected(Main.pref.getBoolean("draw.data.downloaded_area", true)); … … 99 99 inactive.setSelected(Main.pref.getBoolean("draw.data.inactive_color", true)); 100 100 panel.add(inactive, GBC.eop().insets(20,0,0,0)); 101 101 102 panel.add(new JLabel(tr("Options that affect drawing performance")),GBC.eop().insets(5,10,0,0)); 103 // antialiasing 104 useAntialiasing.setToolTipText(tr("Apply antialiasing to the map view resulting in a smoother appearance.")); 105 useAntialiasing.setSelected(Main.pref.getBoolean("mappaint.use-antialiasing", true)); 106 panel.add(useAntialiasing, GBC.eop().insets(20,5,0,0)); 107 108 // highlighting 109 useHighlighting.setToolTipText(tr("Hightlight target nodes and ways while drawing or selecting")); 110 useHighlighting.setSelected(Main.pref.getBoolean("draw.target-highlight", true)); 111 panel.add(useHighlighting, GBC.eop().insets(20,0,0,0)); 112 113 drawHelperLine.setToolTipText(tr("Draw rubber-band helper line")); 114 drawHelperLine.setSelected(Main.pref.getBoolean("draw.helper-line", true)); 115 panel.add(drawHelperLine, GBC.eop().insets(20, 0, 0, 0)); 116 102 117 // outlineOnly 103 118 outlineOnly.setSelected(Main.pref.getBoolean("draw.data.area_outline_only", false)); 104 119 outlineOnly.setToolTipText(tr("This option suppresses the filling of areas, overriding anything specified in the selected style.")); … … 120 135 Main.pref.put("draw.data.downloaded_area", sourceBounds.isSelected()); 121 136 Main.pref.put("draw.data.inactive_color", inactive.isSelected()); 122 137 Main.pref.put("mappaint.use-antialiasing", useAntialiasing.isSelected()); 138 Main.pref.put("draw.target-highlight", useHighlighting.isSelected()); 139 Main.pref.put("draw.helper-line", drawHelperLine.isSelected()); 123 140 int vn = Main.pref.getInteger("mappaint.node.virtual-size", 8); 124 141 if (virtualNodes.isSelected()) { 125 142 if (vn < 1) { -
src/org/openstreetmap/josm/gui/preferences/LafPreference.java
38 38 private JCheckBox showSplashScreen = new JCheckBox(tr("Show splash screen at startup")); 39 39 private JCheckBox showID = new JCheckBox(tr("Show object ID in selection lists")); 40 40 private JCheckBox showLocalizedName = new JCheckBox(tr("Show localized name in selection lists")); 41 private JCheckBox drawHelperLine = new JCheckBox(tr("Draw rubber-band helper line"));42 41 private JCheckBox modeless = new JCheckBox(tr("Modeless working (Potlatch style)")); 43 42 private JCheckBox expert = new JCheckBox(tr("Expert mode")); 44 43 private JCheckBox dynamicButtons = new JCheckBox(tr("Dynamic buttons in side menus")); … … 90 89 showLocalizedName.setToolTipText(tr("Show localized name in selection lists, if available")); 91 90 showLocalizedName.setSelected(Main.pref.getBoolean("osm-primitives.localize-name", true)); 92 91 93 drawHelperLine.setToolTipText(tr("Draw rubber-band helper line"));94 drawHelperLine.setSelected(Main.pref.getBoolean("draw.helper-line", true));95 92 96 93 modeless.setToolTipText(tr("Do not require to switch modes (potlatch style workflow)")); 97 94 modeless.setSelected(Main.pref.getBoolean("modeless", false)); … … 99 96 if (Main.pref.getBoolean("expert", false)) { 100 97 panel.add(showID, GBC.eop().insets(20, 0, 0, 0)); 101 98 panel.add(showLocalizedName, GBC.eop().insets(20, 0, 0, 0)); 102 panel.add(drawHelperLine, GBC.eop().insets(20, 0, 0, 0));103 99 panel.add(modeless, GBC.eop().insets(20, 0, 0, 0)); 104 100 } 105 101 … … 127 123 Main.pref.put("draw.splashscreen", showSplashScreen.isSelected()); 128 124 Main.pref.put("osm-primitives.showid", showID.isSelected()); 129 125 Main.pref.put("osm-primitives.localize-name", showLocalizedName.isSelected()); 130 Main.pref.put("draw.helper-line", drawHelperLine.isSelected());131 126 Main.pref.put("modeless", modeless.isSelected()); 132 127 if(Main.pref.put("expert", expert.isSelected())) 133 128 mod = true;