Changeset 29535 in osm for applications/editors/josm
- Timestamp:
- 2013-04-23T13:43:26+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/reltoolbox
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/ChosenRelationComponent.java
r25695 r29535 1 1 package relcontext; 2 2 3 import java.awt.Color;4 3 import javax.swing.JLabel; 5 import javax.swing.border.BevelBorder; 6 import javax.swing.border.LineBorder; 4 7 5 import org.openstreetmap.josm.data.osm.Relation; 8 6 … … 16 14 public class ChosenRelationComponent extends JLabel implements ChosenRelationListener { 17 15 18 private ChosenRelation chRel;16 //private ChosenRelation chRel; 19 17 20 18 public ChosenRelationComponent(ChosenRelation rel) { … … 23 21 setOpaque(true); 24 22 setBorder(new LineBorder(Color.black, 1, true));*/ 25 this.chRel = rel;23 //this.chRel = rel; 26 24 rel.addChosenRelationListener(this); 27 25 } -
applications/editors/josm/plugins/reltoolbox/src/relcontext/RelContextDialog.java
r28857 r29535 1 1 package relcontext; 2 2 3 import org.openstreetmap.josm.actions.JosmAction; 4 import org.openstreetmap.josm.command.SequenceCommand; 5 import org.openstreetmap.josm.command.Command; 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 5 import java.awt.BorderLayout; 6 import java.awt.Color; 7 import java.awt.Component; 8 import java.awt.Dialog.ModalityType; 9 import java.awt.Dimension; 10 import java.awt.GridBagLayout; 11 import java.awt.Point; 12 import java.awt.event.ActionEvent; 13 import java.awt.event.ActionListener; 14 import java.awt.event.ItemEvent; 15 import java.awt.event.ItemListener; 16 import java.awt.event.KeyEvent; 17 import java.awt.event.MouseAdapter; 18 import java.awt.event.MouseEvent; 19 import java.awt.event.MouseListener; 20 import java.beans.PropertyChangeEvent; 21 import java.beans.PropertyChangeListener; 6 22 import java.io.BufferedReader; 7 23 import java.io.InputStream; 8 24 import java.io.InputStreamReader; 9 import java.awt.Point; 10 import java.awt.Component; 11 import java.awt.Dimension; 12 import org.openstreetmap.josm.tools.ImageProvider; 13 import org.openstreetmap.josm.gui.DefaultNameFormatter; 25 import java.util.ArrayList; 26 import java.util.Collection; 27 import java.util.Collections; 28 import java.util.HashMap; 29 import java.util.List; 30 import java.util.Map; 31 import java.util.Set; 32 import java.util.StringTokenizer; 33 import java.util.TreeSet; 34 35 import javax.swing.AbstractListModel; 36 import javax.swing.Action; 37 import javax.swing.Box; 38 import javax.swing.ComboBoxModel; 39 import javax.swing.JButton; 40 import javax.swing.JCheckBoxMenuItem; 41 import javax.swing.JComboBox; 42 import javax.swing.JComponent; 43 import javax.swing.JDialog; 44 import javax.swing.JLabel; 45 import javax.swing.JOptionPane; 46 import javax.swing.JPanel; 47 import javax.swing.JPopupMenu; 48 import javax.swing.JScrollPane; 49 import javax.swing.JTable; 50 import javax.swing.ListSelectionModel; 51 import javax.swing.SwingUtilities; 14 52 import javax.swing.event.ListSelectionEvent; 15 import javax.swing.table.TableColumnModel;16 import javax.swing.table.DefaultTableModel;17 import java.awt.event.*;18 import java.util.*;19 import javax.swing.*;20 import relcontext.actions.*;21 22 import java.awt.BorderLayout;23 import java.awt.Color;24 import java.awt.Dialog.ModalityType;25 import java.awt.GridBagLayout;26 import java.beans.PropertyChangeEvent;27 import java.beans.PropertyChangeListener;28 53 import javax.swing.event.ListSelectionListener; 29 54 import javax.swing.table.DefaultTableCellRenderer; 55 import javax.swing.table.DefaultTableModel; 56 import javax.swing.table.TableColumnModel; 30 57 31 58 import org.openstreetmap.josm.Main; 59 import org.openstreetmap.josm.actions.JosmAction; 60 import org.openstreetmap.josm.command.ChangeRelationMemberRoleCommand; 61 import org.openstreetmap.josm.command.Command; 62 import org.openstreetmap.josm.command.SequenceCommand; 32 63 import org.openstreetmap.josm.data.SelectionChangedListener; 64 import org.openstreetmap.josm.data.osm.OsmPrimitive; 33 65 import org.openstreetmap.josm.data.osm.Relation; 66 import org.openstreetmap.josm.data.osm.RelationMember; 67 import org.openstreetmap.josm.data.osm.event.DatasetEventManager; 34 68 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode; 35 69 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; 36 import org.openstreetmap.josm.data.osm.OsmPrimitive; 37 import org.openstreetmap.josm.data.osm.RelationMember; 38 import org.openstreetmap.josm.data.osm.event.DatasetEventManager; 39 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 70 import org.openstreetmap.josm.gui.DefaultNameFormatter; 40 71 import org.openstreetmap.josm.gui.MapView; 41 72 import org.openstreetmap.josm.gui.MapView.EditLayerChangeListener; 42 73 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; 43 74 import org.openstreetmap.josm.gui.dialogs.ToggleDialog; 75 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 76 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingComboBox; 77 import org.openstreetmap.josm.tools.GBC; 44 78 import org.openstreetmap.josm.tools.Shortcut; 45 import org.openstreetmap.josm.tools.GBC; 46 import org.openstreetmap.josm.command.ChangeRelationMemberRoleCommand; 47 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingComboBox; 48 import static org.openstreetmap.josm.tools.I18n.tr; 79 80 import relcontext.actions.AddRemoveMemberAction; 81 import relcontext.actions.ClearChosenRelationAction; 82 import relcontext.actions.CreateMultipolygonAction; 83 import relcontext.actions.CreateRelationAction; 84 import relcontext.actions.DeleteChosenRelationAction; 85 import relcontext.actions.DownloadChosenRelationAction; 86 import relcontext.actions.DownloadParentsAction; 87 import relcontext.actions.DuplicateChosenRelationAction; 88 import relcontext.actions.EditChosenRelationAction; 89 import relcontext.actions.FindRelationAction; 90 import relcontext.actions.ReconstructPolygonAction; 91 import relcontext.actions.RelationHelpAction; 92 import relcontext.actions.SelectInRelationPanelAction; 93 import relcontext.actions.SelectMembersAction; 94 import relcontext.actions.SelectRelationAction; 95 import relcontext.actions.SortAndFixAction; 49 96 50 97 /** … … 508 555 } 509 556 } 510 557 /* 511 558 private class MultipolygonSettingsAction extends AbstractAction { 512 559 public MultipolygonSettingsAction() { … … 518 565 public void actionPerformed( ActionEvent e ) { 519 566 Component c = e.getSource() instanceof Component ? (Component)e.getSource() : Main.parent; 520 Point p = getMousePosition();521 567 multiPopupMenu.show(c, 0, 0); 522 568 } 523 } 569 }*/ 524 570 525 571 private class MultipolygonSettingsPopup extends JPopupMenu implements ActionListener { -
applications/editors/josm/plugins/reltoolbox/src/relcontext/RelContextPlugin.java
r27927 r29535 1 1 package relcontext; 2 2 3 import org.openstreetmap.josm.Main;4 3 import org.openstreetmap.josm.gui.DefaultNameFormatter; 5 4 import org.openstreetmap.josm.gui.MapFrame; -
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/DownloadParentsAction.java
r26509 r29535 2 2 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.awt.event.ActionEvent; 5 6 import java.util.ArrayList; … … 8 9 import java.util.List; 9 10 import java.util.Set; 11 10 12 import javax.swing.AbstractAction; 13 11 14 import org.openstreetmap.josm.Main; 12 15 import org.openstreetmap.josm.actions.downloadtasks.DownloadReferrersTask; 13 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; 14 17 import org.openstreetmap.josm.data.osm.Relation; 15 import org.openstreetmap.josm.data.osm.RelationMember;16 18 import org.openstreetmap.josm.gui.dialogs.relation.DownloadRelationMemberTask; 17 19 import org.openstreetmap.josm.gui.dialogs.relation.DownloadRelationTask; 18 20 import org.openstreetmap.josm.tools.ImageProvider; 21 19 22 import relcontext.ChosenRelation; 20 23 import relcontext.ChosenRelationListener; -
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/ReconstructPolygonAction.java
r28813 r29535 107 107 Way tmp = w; 108 108 w = candidateWay; 109 candidateWay = w;109 candidateWay = tmp; 110 110 } 111 111 commands.add(new DeleteCommand(w)); -
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/TheRing.java
r29459 r29535 1 1 package relcontext.actions; 2 2 3 import java.util.*; 3 import java.util.ArrayList; 4 import java.util.Collection; 5 import java.util.HashMap; 6 import java.util.List; 7 import java.util.Map; 8 4 9 import javax.swing.JOptionPane; 10 5 11 import org.openstreetmap.josm.Main; 6 import org.openstreetmap.josm.command.*; 7 import org.openstreetmap.josm.data.coor.EastNorth; 8 import org.openstreetmap.josm.data.osm.*; 12 import org.openstreetmap.josm.command.AddCommand; 13 import org.openstreetmap.josm.command.ChangeCommand; 14 import org.openstreetmap.josm.command.Command; 15 import org.openstreetmap.josm.command.DeleteCommand; 16 import org.openstreetmap.josm.data.osm.Node; 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; 18 import org.openstreetmap.josm.data.osm.Relation; 19 import org.openstreetmap.josm.data.osm.RelationMember; 20 import org.openstreetmap.josm.data.osm.Way; 9 21 import org.openstreetmap.josm.tools.Geometry; 10 22 import org.openstreetmap.josm.tools.Geometry.PolygonIntersection; … … 326 338 } 327 339 } 328 // todo: когда два кольца меняют одно и то же отношение, в список команд добавляется329 // изменение базового отношения на новое, а не предыдущего330 // поэтому сохраняется только первое изменение340 // todo: когда два кольца менÑ�ÑŽÑ‚ одно и то же отношение, в Ñ�пиÑ�ок команд добавлÑ�етÑ�Ñ� 341 // изменение базового отношениÑ� на новое, а не предыдущего 342 // поÑ�тому Ñ�охранÑ�етÑ�Ñ� только первое изменение 331 343 332 344 List<Command> commands = new ArrayList<Command>(); … … 389 401 * Appends "append" to "base" so the closed polygon forms. 390 402 */ 391 private static void closePolygon( List<Node> base, List<Node> append ) {403 /*private static void closePolygon( List<Node> base, List<Node> append ) { 392 404 if( append.get(0).equals(base.get(0)) && append.get(append.size() - 1).equals(base.get(base.size() - 1)) ) { 393 405 List<Node> ap2 = new ArrayList<Node>(append); … … 397 409 base.remove(base.size() - 1); 398 410 base.addAll(append); 399 } 411 }*/ 400 412 401 413 /** 402 414 * Checks if a middle point between two nodes is inside a polygon. Useful to check if the way is inside. 403 415 */ 404 private static boolean segmentInsidePolygon( Node n1, Node n2, List<Node> polygon ) {416 /*private static boolean segmentInsidePolygon( Node n1, Node n2, List<Node> polygon ) { 405 417 EastNorth en1 = n1.getEastNorth(); 406 418 EastNorth en2 = n2.getEastNorth(); 407 419 Node testNode = new Node(new EastNorth((en1.east() + en2.east()) / 2.0, (en1.north() + en2.north()) / 2.0)); 408 420 return Geometry.nodeInsidePolygon(testNode, polygon); 409 } 421 }*/ 410 422 411 423 private static void log( String s ) { … … 420 432 private boolean isRing; 421 433 422 private RingSegment() {423 } 434 /*private RingSegment() { 435 }*/ 424 436 425 437 public RingSegment( Way w ) { … … 435 447 } 436 448 437 public RingSegment( RingSegment ref ) {449 /*public RingSegment( RingSegment ref ) { 438 450 this.nodes = null; 439 451 this.references = ref; 440 } 452 }*/ 441 453 442 454 /** … … 559 571 * @return true if ways are equals, or one references another. 560 572 */ 561 public boolean isReferencingEqual( RingSegment other ) {573 /*public boolean isReferencingEqual( RingSegment other ) { 562 574 return this.equals(other) || (other.isReference() && other.references == this) || (isReference() && references == other); 563 } 575 }*/ 564 576 565 577 @Override
Note:
See TracChangeset
for help on using the changeset viewer.