- Timestamp:
- 2014-01-04T06:39:00+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r6608 r6623 211 211 return null; 212 212 // try to zoom to the first selected layer 213 //214 213 Layer l = getFirstSelectedLayer(); 215 214 if (l == null) return null; … … 245 244 // ensure reasonable zoom level when zooming onto single nodes. 246 245 v.enlargeToMinDegrees(0.0005); 247 } 248 else if (mode.equals("download")) { 246 } else if (mode.equals("download")) { 249 247 Bounds bounds = DownloadDialog.getSavedDownloadBounds(); 250 248 if (bounds != null) { -
trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
r6622 r6623 61 61 /** 62 62 * Constructs a new {@code CreateMultipolygonAction}. 63 * @param update {@code true} if the multipolygon must be updated, {@code false} if it must be created 63 64 */ 64 65 public CreateMultipolygonAction(final boolean update) { 65 66 super(getName(update), "multipoly_create", getName(update), 66 update 67 ? null 67 update ? null 68 68 : Shortcut.registerShortcut("tools:multipoly", tr("Tool: {0}", getName(false)), KeyEvent.VK_A, Shortcut.ALT_CTRL), 69 69 true, update ? "multipoly_update" : "multipoly_create", true); … … 73 73 private static String getName(boolean update) { 74 74 return update ? tr("Update multipolygon") : tr("Create multipolygon"); 75 } 76 77 private class CreateUpdateMultipolygonTask implements Runnable { 78 private final Collection<Way> selectedWays; 79 private final Relation multipolygonRelation; 80 81 public CreateUpdateMultipolygonTask(Collection<Way> selectedWays, Relation multipolygonRelation) { 82 this.selectedWays = selectedWays; 83 this.multipolygonRelation = multipolygonRelation; 84 } 85 86 @Override 87 public void run() { 88 final Pair<SequenceCommand, Relation> commandAndRelation = createMultipolygonCommand(selectedWays, multipolygonRelation); 89 if (commandAndRelation == null) { 90 return; 91 } 92 final Command command = commandAndRelation.a; 93 final Relation relation = commandAndRelation.b; 94 95 96 // to avoid EDT violations 97 SwingUtilities.invokeLater(new Runnable() { 98 @Override 99 public void run() { 100 Main.main.undoRedo.add(command); 101 } 102 }); 103 104 // Use 'SwingUtilities.invokeLater' to make sure the relationListDialog 105 // knows about the new relation before we try to select it. 106 // (Yes, we are already in event dispatch thread. But DatasetEventManager 107 // uses 'SwingUtilities.invokeLater' to fire events so we have to do 108 // the same.) 109 SwingUtilities.invokeLater(new Runnable() { 110 @Override 111 public void run() { 112 Main.map.relationListDialog.selectRelation(relation); 113 if (Main.pref.getBoolean("multipoly.show-relation-editor", false)) { 114 //Open relation edit window, if set up in preferences 115 RelationEditor editor = RelationEditor.getEditor(Main.main.getEditLayer(), relation, null); 116 117 editor.setModal(true); 118 editor.setVisible(true); 119 } 120 } 121 }); 122 } 75 123 } 76 124 … … 109 157 : null; 110 158 111 // runnable to create/update multipolygon relation112 final Runnable createOrUpdateMultipolygonTask = new Runnable() {113 @Override114 public void run() {115 final Pair<SequenceCommand, Relation> commandAndRelation = createMultipolygonCommand(selectedWays, multipolygonRelation);116 if (commandAndRelation == null) {117 return;118 }119 final Command command = commandAndRelation.a;120 final Relation relation = commandAndRelation.b;121 122 123 // to avoid EDT violations124 SwingUtilities.invokeLater(new Runnable() {125 @Override126 public void run() {127 Main.main.undoRedo.add(command);128 }129 });130 131 // Use 'SwingUtilities.invokeLater' to make sure the relationListDialog132 // knows about the new relation before we try to select it.133 // (Yes, we are already in event dispatch thread. But DatasetEventManager134 // uses 'SwingUtilities.invokeLater' to fire events so we have to do135 // the same.)136 SwingUtilities.invokeLater(new Runnable() {137 @Override138 public void run() {139 Main.map.relationListDialog.selectRelation(relation);140 if (Main.pref.getBoolean("multipoly.show-relation-editor", false)) {141 //Open relation edit window, if set up in preferences142 RelationEditor editor = RelationEditor.getEditor(Main.main.getEditLayer(), relation, null);143 144 editor.setModal(true);145 editor.setVisible(true);146 }147 }148 });149 }150 };151 152 159 // download incomplete relation if necessary 153 160 if (multipolygonRelation != null && (multipolygonRelation.isIncomplete() || multipolygonRelation.hasIncompleteMembers())) { … … 155 162 } 156 163 // create/update multipolygon relation 157 Main.worker.submit( createOrUpdateMultipolygonTask);164 Main.worker.submit(new CreateUpdateMultipolygonTask(selectedWays, multipolygonRelation)); 158 165 159 166 } … … 181 188 182 189 // add ways of existing relation to include them in polygon analysis 183 selectedWays = new HashSet<Way>(selectedWays);184 selectedWays.addAll(selectedMultipolygonRelation.getMemberPrimitives(Way.class));185 186 final MultipolygonCreate polygon = analyzeWays( selectedWays, true);190 Set<Way> ways = new HashSet<Way>(selectedWays); 191 ways.addAll(selectedMultipolygonRelation.getMemberPrimitives(Way.class)); 192 193 final MultipolygonCreate polygon = analyzeWays(ways, true); 187 194 if (polygon == null) { 188 195 return null; //could not make multipolygon. … … 206 213 207 214 /** 208 * Returns a pairof a multipolygon creating/modifying {@link Command} as well as the multipolygon {@link Relation}.215 * Returns a {@link Pair} of a multipolygon creating/modifying {@link Command} as well as the multipolygon {@link Relation}. 209 216 */ 210 217 public static Pair<SequenceCommand, Relation> createMultipolygonCommand(Collection<Way> selectedWays, Relation selectedMultipolygonRelation) { … … 309 316 } 310 317 311 static public final List<String> DEFAULT_LINEAR_TAGS = Arrays.asList(new String[] {"barrier", "source"});318 public static final List<String> DEFAULT_LINEAR_TAGS = Arrays.asList(new String[] {"barrier", "source"}); 312 319 313 320 /** -
trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java
r6603 r6623 4 4 import java.util.Collection; 5 5 import java.util.LinkedList; 6 import java.util.Set; 6 7 import java.util.TreeSet; 7 8 … … 20 21 * outer endpoints of selected ways 21 22 */ 22 TreeSet<Node> outerNodes;23 Set<Node> outerNodes; 23 24 /** 24 25 * endpoints of selected ways 25 26 */ 26 TreeSet<Node> nodes;27 Set<Node> nodes; 27 28 28 29 /** -
trunk/src/org/openstreetmap/josm/data/osm/history/History.java
r6316 r6623 209 209 } 210 210 211 public HistoryOsmPrimitive get(int idx) {211 public HistoryOsmPrimitive get(int idx) throws IndexOutOfBoundsException { 212 212 if (idx < 0 || idx >= versions.size()) 213 213 throw new IndexOutOfBoundsException(MessageFormat.format("Parameter ''{0}'' in range 0..{1} expected. Got ''{2}''.", "idx", versions.size()-1, idx)); … … 231 231 } 232 232 233 public boolean isEmpty() { 233 /** 234 * Returns true if this history contains no version. 235 * @return {@code true} if this history contains no version, {@code false} otherwise 236 */ 237 public final boolean isEmpty() { 234 238 return versions.isEmpty(); 235 239 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r6608 r6623 156 156 double enlargeEast = Math.min(maxEnlargePercent - 10*Math.log(diffEast), 1)/100; 157 157 double enlargeNorth = Math.min(maxEnlargePercent - 10*Math.log(diffNorth), 1)/100; 158 System.out.println(enlargeEast);159 158 160 159 visit(bounds.getMin().add(-enlargeEast/2, -enlargeNorth/2)); 161 160 visit(bounds.getMax().add(+enlargeEast/2, +enlargeNorth/2)); 162 161 } 163 164 162 165 163 /** -
trunk/src/org/openstreetmap/josm/data/validation/Test.java
r6591 r6623 34 34 * @author frsantos 35 35 */ 36 public class Test extends AbstractVisitor 37 { 36 public class Test extends AbstractVisitor { 37 38 38 /** Name of the test */ 39 39 protected final String name; … … 90 90 * A test that forwards all primitives to {@link #check(OsmPrimitive)}. 91 91 */ 92 public static abstract class TagTest extends Test { 92 public abstract static class TagTest extends Test { 93 /** 94 * Constructs a new {@code TagTest} with given name and description. 95 * @param name The test name 96 * @param description The test description 97 */ 93 98 public TagTest(String name, String description) { 94 99 super(name, description); 95 100 } 96 101 102 /** 103 * Constructs a new {@code TagTest} with given name. 104 * @param name The test name 105 */ 97 106 public TagTest(String name) { 98 107 super(name); 99 108 } 100 109 110 /** 111 * Checks the tags of the given primitive. 112 * @param p The primitive to test 113 */ 101 114 public abstract void check(final OsmPrimitive p); 102 115 … … 163 176 * actions and destroy the used structures. 164 177 * <p> 165 * If you override this method, don't forget to cleanup {@ link #progressMonitor}178 * If you override this method, don't forget to cleanup {@code progressMonitor} 166 179 * (most overrides call {@code super.endTest()} to do this). 167 180 */ … … 191 204 } 192 205 206 /** 207 * Determines if the primitive is usable for tests. 208 * @param p The primitive 209 * @return {@code true} if the primitive can be tested, {@code false} otherwise 210 */ 193 211 public boolean isPrimitiveUsable(OsmPrimitive p) { 194 212 return p.isUsable() && (!(p instanceof Way) || (((Way) p).getNodesCount() > 1)); // test only Ways with at least 2 nodes … … 222 240 /** 223 241 * Called when the used submits the preferences 242 * @return {@code true} if restart is required, {@code false} otherwise 224 243 */ 225 244 public boolean ok() { … … 265 284 } 266 285 286 /** 287 * Returns the test name. 288 * @return The test name 289 */ 267 290 public String getName() { 268 291 return name; 269 292 } 270 293 294 /** 295 * Determines if the test has been canceled. 296 * @return {@code true} if the test has been canceled, {@code false} otherwise 297 */ 271 298 public boolean isCanceled() { 272 299 return progressMonitor.isCanceled(); -
trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
r6581 r6623 33 33 public abstract class CrossingWays extends Test { 34 34 protected static final int CROSSING_WAYS = 601; 35 36 private static final String HIGHWAY = "highway"; 37 private static final String RAILWAY = "railway"; 38 private static final String WATERWAY = "waterway"; 35 39 36 40 /** All way segments, grouped by cells */ … … 47 51 return super.isPrimitiveUsable(w) 48 52 && !isProposedOrAbandoned(w) 49 && (w.hasKey( "highway")50 || w.hasKey( "waterway")51 || (w.hasKey( "railway") && !isSubwayOrTram(w))53 && (w.hasKey(HIGHWAY) 54 || w.hasKey(WATERWAY) 55 || (w.hasKey(RAILWAY) && !isSubwayOrTram(w)) 52 56 || isCoastline(w) 53 57 || isBuilding(w)); … … 59 63 return true; 60 64 } 61 if (w1.hasKey( "highway") && w2.hasKey("highway") && !Utils.equal(w1.get("level"), w2.get("level"))) {65 if (w1.hasKey(HIGHWAY) && w2.hasKey(HIGHWAY) && !Utils.equal(w1.get("level"), w2.get("level"))) { 62 66 return true; 63 67 } … … 68 72 return true; 69 73 } 70 if ((w1.hasTag( "waterway", "river") && w2.hasTag("waterway", "riverbank"))71 || (w2.hasTag( "waterway", "river") && w1.hasTag("waterway", "riverbank"))) {74 if ((w1.hasTag(WATERWAY, "river") && w2.hasTag(WATERWAY, "riverbank")) 75 || (w2.hasTag(WATERWAY, "river") && w1.hasTag(WATERWAY, "riverbank"))) { 72 76 return true; 73 77 } … … 82 86 if (isBuilding(w1)) { 83 87 return ("Crossing buildings"); 84 } else if (w1.hasKey( "waterway") && w2.hasKey("waterway")) {88 } else if (w1.hasKey(WATERWAY) && w2.hasKey(WATERWAY)) { 85 89 return tr("Crossing waterways"); 86 } else if ((w1.hasKey( "highway") && w2.hasKey("waterway"))87 || (w2.hasKey( "highway") && w1.hasKey("waterway"))) {90 } else if ((w1.hasKey(HIGHWAY) && w2.hasKey(WATERWAY)) 91 || (w2.hasKey(HIGHWAY) && w1.hasKey(WATERWAY))) { 88 92 return tr("Crossing waterway/highway"); 89 93 } else { … … 207 211 208 212 static boolean isSubwayOrTram(OsmPrimitive w) { 209 return w.hasTag( "railway", "subway", "tram");213 return w.hasTag(RAILWAY, "subway", "tram"); 210 214 } 211 215 212 216 static boolean isProposedOrAbandoned(OsmPrimitive w) { 213 return w.hasTag( "highway", "proposed") || w.hasTag("railway", "proposed", "abandoned");217 return w.hasTag(HIGHWAY, "proposed") || w.hasTag(RAILWAY, "proposed", "abandoned"); 214 218 } 215 219 -
trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java
r6605 r6623 17 17 import org.openstreetmap.josm.Main; 18 18 import org.openstreetmap.josm.command.ChangePropertyCommand; 19 import org.openstreetmap.josm.data.osm.Node;20 19 import org.openstreetmap.josm.data.osm.OsmPrimitive; 21 import org.openstreetmap.josm.data.osm.Relation;22 import org.openstreetmap.josm.data.osm.Way;23 20 import org.openstreetmap.josm.data.validation.FixableTestError; 24 21 import org.openstreetmap.josm.data.validation.Severity; … … 194 191 return Collections.emptyList(); 195 192 } 193 final List<OpeningHoursTestError> errors = new ArrayList<OpeningHoursTestError>(); 196 194 try { 197 195 final Object r = parse(value, mode); 198 final List<OpeningHoursTestError> errors = new ArrayList<OpeningHoursTestError>();199 196 String prettifiedValue = null; 200 197 try { … … 212 209 errors.add(new OpeningHoursTestError(tr("opening_hours value can be prettified"), Severity.OTHER, prettifiedValue)); 213 210 } 214 return errors; 215 } catch (final Exception ex) { 216 throw new RuntimeException(ex); 217 } 211 } catch (ScriptException ex) { 212 Main.error(ex); 213 } catch (NoSuchMethodException ex) { 214 Main.error(ex); 215 } 216 return errors; 218 217 } 219 218 -
trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java
r6595 r6623 33 33 */ 34 34 public final class ConditionalOptionPaneUtil { 35 static public final int DIALOG_DISABLED_OPTION = Integer.MIN_VALUE;35 public static final int DIALOG_DISABLED_OPTION = Integer.MIN_VALUE; 36 36 37 37 /** (preference key => return value) mappings valid for the current operation (no, those two maps cannot be combined) */ -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellRenderer.java
r6616 r6623 14 14 import javax.swing.table.TableCellRenderer; 15 15 16 import org.openstreetmap.josm.Main; 16 17 import org.openstreetmap.josm.gui.conflict.ConflictColors; 17 18 import org.openstreetmap.josm.gui.widgets.JosmComboBox; … … 64 65 setBackground(ConflictColors.BGCOLOR_TAG_KEEP_ALL.get()); 65 66 break; 67 default: 68 Main.error("Unknown decision type: "+decision.getDecisionType()); 66 69 } 67 70 } else { … … 143 146 144 147 MultiValueResolutionDecision decision = (MultiValueResolutionDecision)value; 145 TagConflictResolverModel model = (TagConflictResolverModel) table.getModel();146 boolean conflict = model.getKeysWithConflicts().contains(model.getKey(row));148 TagConflictResolverModel tagModel = (TagConflictResolverModel) table.getModel(); 149 boolean conflict = tagModel.getKeysWithConflicts().contains(tagModel.getKey(row)); 147 150 renderColors(decision, isSelected, conflict); 148 151 renderToolTipText(decision); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverColumnModel.java
r6616 r6623 18 18 public class RelationMemberConflictResolverColumnModel extends DefaultTableColumnModel { 19 19 20 private final DefaultTableCellRenderer defaultTableCellRenderer = new DefaultTableCellRenderer(); 21 22 private final OsmPrimitivRenderer primitiveRenderer = new OsmPrimitivRenderer() { 23 @Override 24 public Component getTableCellRendererComponent(JTable table, 25 Object value, boolean isSelected, boolean hasFocus, int row, int column) { 26 return setColors(super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column), 27 table, isSelected, row); 28 } 29 }; 30 31 private final TableCellRenderer tableRenderer = new TableCellRenderer() { 32 @Override 33 public Component getTableCellRendererComponent(JTable table, Object value, 34 boolean isSelected, boolean hasFocus, int row, int column) { 35 return setColors(defaultTableCellRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column), 36 table, isSelected, row); 37 } 38 }; 39 20 40 private static Component setColors(Component comp, JTable table, boolean isSelected, int row) { 21 41 RelationMemberConflictResolverModel model = (RelationMemberConflictResolverModel) table.getModel(); … … 40 60 } 41 61 42 protected void createColumns() { 43 final DefaultTableCellRenderer defaultTableCellRenderer = new DefaultTableCellRenderer(); 44 45 OsmPrimitivRenderer primitiveRenderer = new OsmPrimitivRenderer() { 46 @Override 47 public Component getTableCellRendererComponent(JTable table, 48 Object value, boolean isSelected, boolean hasFocus, int row, int column) { 49 return setColors(super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column), 50 table, isSelected, row); 51 } 52 }; 53 54 TableCellRenderer tableRenderer = new TableCellRenderer() { 55 @Override 56 public Component getTableCellRendererComponent(JTable table, Object value, 57 boolean isSelected, boolean hasFocus, int row, int column) { 58 return setColors(defaultTableCellRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column), 59 table, isSelected, row); 60 } 61 }; 62 protected final void createColumns() { 62 63 63 64 AutoCompletingTextField roleEditor = new AutoCompletingTextField(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r6595 r6623 560 560 } 561 561 562 // Discardparameter as we do not want to operate always on real selection here, especially in draw mode563 newSelection= Main.main.getInProgressSelection();564 if (newSel ection== null) {565 newSel ection= Collections.<OsmPrimitive>emptyList();562 // Ignore parameter as we do not want to operate always on real selection here, especially in draw mode 563 Collection<OsmPrimitive> newSel = Main.main.getInProgressSelection(); 564 if (newSel == null) { 565 newSel = Collections.<OsmPrimitive>emptyList(); 566 566 } 567 567 … … 584 584 valueCount.clear(); 585 585 EnumSet<TaggingPresetType> types = EnumSet.noneOf(TaggingPresetType.class); 586 for (OsmPrimitive osm : newSel ection) {586 for (OsmPrimitive osm : newSel) { 587 587 types.add(TaggingPresetType.forPrimitive(osm)); 588 588 for (String key : osm.keySet()) { … … 606 606 count += e1.getValue(); 607 607 } 608 if (count < newSel ection.size()) {609 e.getValue().put("", newSel ection.size() - count);608 if (count < newSel.size()) { 609 e.getValue().put("", newSel.size() - count); 610 610 } 611 611 tagData.addRow(new Object[]{e.getKey(), e.getValue()}); … … 617 617 618 618 Map<Relation, MemberInfo> roles = new HashMap<Relation, MemberInfo>(); 619 for (OsmPrimitive primitive: newSel ection) {619 for (OsmPrimitive primitive: newSel) { 620 620 for (OsmPrimitive ref: primitive.getReferrers()) { 621 621 if (ref instanceof Relation && !ref.isIncomplete() && !ref.isDeleted()) { … … 657 657 membershipTable.setVisible(membershipData.getRowCount() > 0); 658 658 659 boolean hasSelection = !newSel ection.isEmpty();659 boolean hasSelection = !newSel.isEmpty(); 660 660 boolean hasTags = hasSelection && tagData.getRowCount() > 0; 661 661 boolean hasMemberships = hasSelection && membershipData.getRowCount() > 0; -
trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java
r6520 r6623 31 31 import org.openstreetmap.josm.Main; 32 32 import org.openstreetmap.josm.actions.AbstractInfoAction; 33 import org.openstreetmap.josm.data.osm.history.History; 33 34 import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive; 34 35 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher; … … 58 59 public void keyReleased(KeyEvent e) { 59 60 // navigate history down/up using the corresponding arrow keys. 60 try { 61 final HistoryOsmPrimitive ref = model.getReferencePointInTime(); 62 final HistoryOsmPrimitive cur = model.getCurrentPointInTime(); 63 if (e.getKeyCode() == KeyEvent.VK_DOWN) { 64 // compute both values first and set them afterwards such that nothing is changed in case of an exception (e.g., reached top/bottom) 65 final HistoryOsmPrimitive refNext = model.getHistory().from(ref.getVersion()).sortAscending().get(1); 66 final HistoryOsmPrimitive curNext = model.getHistory().from(cur.getVersion()).sortAscending().get(1); 67 model.setReferencePointInTime(refNext); 68 model.setCurrentPointInTime(curNext); 69 } else if (e.getKeyCode() == KeyEvent.VK_UP) { 70 // compute both values first and set them afterwards such that nothing is changed in case of an exception (e.g., reached top/bottom) 71 final HistoryOsmPrimitive refNext = model.getHistory().until(ref.getVersion()).sortDescending().get(1); 72 final HistoryOsmPrimitive curNext = model.getHistory().until(cur.getVersion()).sortDescending().get(1); 73 model.setReferencePointInTime(refNext); 74 model.setCurrentPointInTime(curNext); 61 long ref = model.getReferencePointInTime().getVersion(); 62 long cur = model.getCurrentPointInTime().getVersion(); 63 if (e.getKeyCode() == KeyEvent.VK_DOWN) { 64 History refNext = model.getHistory().from(ref); 65 History curNext = model.getHistory().from(cur); 66 if (refNext.getNumVersions() > 1 && curNext.getNumVersions() > 1) { 67 model.setReferencePointInTime(refNext.sortAscending().get(1)); 68 model.setCurrentPointInTime(curNext.sortAscending().get(1)); 75 69 } 76 } catch (NullPointerException ignore) { 77 } catch (IndexOutOfBoundsException ignore) { 70 } else if (e.getKeyCode() == KeyEvent.VK_UP) { 71 History refNext = model.getHistory().until(ref); 72 History curNext = model.getHistory().until(cur); 73 if (refNext.getNumVersions() > 1 && curNext.getNumVersions() > 1) { 74 model.setReferencePointInTime(refNext.sortDescending().get(1)); 75 model.setCurrentPointInTime(curNext.sortDescending().get(1)); 76 } 78 77 } 79 78 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/LabelCompositionStrategy.java
r6603 r6623 153 153 * The list of default name tags from which a label candidate is derived. 154 154 */ 155 p ublicstatic final String[] DEFAULT_NAME_TAGS = {155 private static final String[] DEFAULT_NAME_TAGS = { 156 156 "name:" + LanguageInfo.getJOSMLocaleCode(), 157 157 "name", … … 165 165 /** 166 166 * The list of default name complement tags from which a label candidate is derived. 167 * @since 6541 168 */ 169 public static final String[] DEFAULT_NAME_COMPLEMENT_TAGS = { 167 */ 168 private static final String[] DEFAULT_NAME_COMPLEMENT_TAGS = { 170 169 "capacity" 171 170 }; -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r6613 r6623 181 181 } 182 182 183 private class CrossingFinder extends AbstractFinder {183 private final class CrossingFinder extends AbstractFinder { 184 184 private CrossingFinder(Environment e) { 185 185 super(e); … … 197 197 } 198 198 199 private class ContainsFinder extends AbstractFinder {199 private final class ContainsFinder extends AbstractFinder { 200 200 private ContainsFinder(Environment e) { 201 201 super(e); -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r6603 r6623 13 13 import java.awt.event.ComponentAdapter; 14 14 import java.awt.event.ComponentEvent; 15 import java.lang.reflect.InvocationTargetException; 15 16 import java.util.ArrayList; 16 17 import java.util.Collection; … … 138 139 gc.gridx = 1; 139 140 gc.weightx = 1.0; 140 pnl.add(tfFilter = new JosmTextField(), gc); 141 tfFilter = new JosmTextField(); 142 pnl.add(tfFilter, gc); 141 143 tfFilter.setToolTipText(tr("Enter a search expression")); 142 144 SelectAllOnFocusGainedDecorator.decorate(tfFilter); … … 158 160 pnl.add(buildSearchFieldPanel(), BorderLayout.NORTH); 159 161 model = new PluginPreferencesModel(); 160 spPluginPreferences = new JScrollPane(pnlPluginPreferences = new PluginListPanel(model)); 162 pnlPluginPreferences = new PluginListPanel(model); 163 spPluginPreferences = new JScrollPane(pnlPluginPreferences); 161 164 spPluginPreferences.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); 162 165 spPluginPreferences.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); … … 181 184 protected JTabbedPane buildContentPane() { 182 185 JTabbedPane pane = getTabPane(); 186 pnlPluginUpdatePolicy = new PluginUpdatePolicyPanel(); 183 187 pane.addTab(tr("Plugins"), buildPluginListPanel()); 184 pane.addTab(tr("Plugin update policy"), pnlPluginUpdatePolicy = new PluginUpdatePolicyPanel());188 pane.addTab(tr("Plugin update policy"), pnlPluginUpdatePolicy); 185 189 return pane; 186 190 } … … 363 367 } 364 368 }); 365 } catch (Exception e) { 366 e.printStackTrace(); 369 } catch (InterruptedException e) { 370 Main.error(e); 371 } catch (InvocationTargetException e) { 372 Main.error(e); 367 373 } 368 374 } … … 482 488 private DefaultListModel model; 483 489 484 protected void build() {490 protected final void build() { 485 491 setLayout(new GridBagLayout()); 486 492 add(new JLabel(tr("Add JOSM Plugin description URL.")), GBC.eol()); -
trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java
r6529 r6623 79 79 remote.add(portLabel, GBC.eol().insets(5, 5, 0, 10).fill(GBC.HORIZONTAL)); 80 80 81 remote.add(enableRemoteControl = new JCheckBox(tr("Enable remote control"), RemoteControl.PROP_REMOTECONTROL_ENABLED.get()), GBC.eol()); 81 enableRemoteControl = new JCheckBox(tr("Enable remote control"), RemoteControl.PROP_REMOTECONTROL_ENABLED.get()); 82 remote.add(enableRemoteControl, GBC.eol()); 82 83 83 84 final JPanel wrapper = new JPanel(); … … 88 89 89 90 wrapper.add(new JLabel(tr("Permitted actions:")), GBC.eol()); 90 int INDENT = 15;91 91 for (JCheckBox p : prefs.values()) { 92 wrapper.add(p, GBC.eol().insets( INDENT, 5, 0, 0).fill(GBC.HORIZONTAL));92 wrapper.add(p, GBC.eol().insets(15, 5, 0, 0).fill(GBC.HORIZONTAL)); 93 93 } 94 94 -
trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreference.java
r6529 r6623 14 14 * @since 6523 15 15 */ 16 public class AuthenticationPreference implements SubPreferenceSetting {16 public final class AuthenticationPreference implements SubPreferenceSetting { 17 17 18 18 /** -
trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
r6525 r6623 113 113 * Initializes the panel from preferences 114 114 */ 115 public void initFromPreferences() {115 public final void initFromPreferences() { 116 116 String authMethod = Main.pref.get("osm-server.auth-method", "basic"); 117 117 if (authMethod.equals("basic")) { … … 131 131 * Saves the current values to preferences 132 132 */ 133 public void saveToPreferences() {133 public final void saveToPreferences() { 134 134 // save the authentication method 135 135 String authMethod; -
trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreference.java
r6529 r6623 17 17 * @since 6523 18 18 */ 19 public class ProxyPreference implements SubPreferenceSetting {19 public final class ProxyPreference implements SubPreferenceSetting { 20 20 21 21 /** -
trunk/src/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreference.java
r6529 r6623 80 80 gc.weightx = 1.0; 81 81 gc.insets = new Insets(0,0,0,0); 82 pnl.add(pnlApiUrlPreferences = new OsmApiUrlInputPanel(), gc); 82 pnlApiUrlPreferences = new OsmApiUrlInputPanel(); 83 pnl.add(pnlApiUrlPreferences, gc); 83 84 84 85 // the remaining access properties -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r6617 r6623 887 887 * a subclass of <code>klass</code>. The casted value otherwise. 888 888 */ 889 @SuppressWarnings("unchecked") 889 890 public static <T> T cast(Object o, Class<T> klass) { 890 891 if (klass.isInstance(o)) { 891 @SuppressWarnings("unchecked") 892 T ret = (T) o; 893 return ret; 892 return (T) o; 894 893 } 895 894 return null;
Note:
See TracChangeset
for help on using the changeset viewer.