- Timestamp:
- 2010-03-08T09:24:03+01:00 (15 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java
r3083 r3095 7 7 import java.util.ArrayList; 8 8 import java.util.Collection; 9 import java.util.LinkedList;10 9 import java.util.List; 11 10 … … 19 18 public class Multipolygon { 20 19 20 public static class JoinedWay { 21 private final List<Node> nodes; 22 private final boolean selected; 23 24 public JoinedWay(List<Node> nodes, boolean selected) { 25 this.nodes = nodes; 26 this.selected = selected; 27 } 28 29 public List<Node> getNodes() { 30 return nodes; 31 } 32 33 public boolean isSelected() { 34 return selected; 35 } 36 37 public boolean isClosed() { 38 return nodes.isEmpty() || nodes.get(nodes.size() - 1).equals(nodes.get(0)); 39 } 40 } 41 21 42 public static class PolyData { 22 43 public enum Intersection {INSIDE, OUTSIDE, CROSSING} … … 26 47 private Point lastP; 27 48 private Rectangle bounds; 49 50 public PolyData(NavigatableComponent nc, JoinedWay joinedWay) { 51 this(nc, joinedWay.getNodes(), joinedWay.isSelected()); 52 } 28 53 29 54 public PolyData(NavigatableComponent nc, List<Node> nodes, boolean selected) { … … 92 117 private final List<PolyData> outerPolygons = new ArrayList<PolyData>(); 93 118 private final List<PolyData> combinedPolygons = new ArrayList<PolyData>(); 94 private boolean hasNonClosedWays;95 119 96 120 public Multipolygon(NavigatableComponent nc) { … … 137 161 } 138 162 139 result.addAll(joinWays(waysToJoin)); 140 } 141 142 public Collection<PolyData> joinWays(Collection<Way> join) 163 for (JoinedWay jw: joinWays(waysToJoin)) { 164 result.add(new PolyData(nc, jw)); 165 } 166 } 167 168 public static Collection<JoinedWay> joinWays(Collection<Way> join) 143 169 { 144 Collection< PolyData> res = new LinkedList<PolyData>();170 Collection<JoinedWay> res = new ArrayList<JoinedWay>(); 145 171 Way[] joinArray = join.toArray(new Way[join.size()]); 146 172 int left = join.size(); … … 230 256 } 231 257 232 if(!n.isEmpty() && !n.get(n.size() - 1).equals(n.get(0))) { 233 hasNonClosedWays = true; 234 } 235 PolyData pd = new PolyData(nc, n, selected); 236 res.add(pd); 258 res.add(new JoinedWay(n, selected)); 237 259 } /* while(left != 0) */ 238 260 … … 323 345 } 324 346 325 public boolean hasNonClosedWays() {326 return hasNonClosedWays;327 }328 329 347 } -
trunk/src/org/openstreetmap/josm/gui/MultiSplitLayout.java
r3083 r3095 42 42 import java.util.ListIterator; 43 43 import java.util.Map; 44 44 45 import javax.swing.UIManager; 45 46 … … 141 142 */ 142 143 public void setModel(Node model) { 143 if ((model == null) || (model instanceof Divider)) {144 if ((model == null) || (model instanceof Divider)) 144 145 throw new IllegalArgumentException("invalid model"); 145 }146 146 Node oldModel = model; 147 147 this.model = model; … … 168 168 */ 169 169 public void setDividerSize(int dividerSize) { 170 if (dividerSize < 0) {170 if (dividerSize < 0) 171 171 throw new IllegalArgumentException("invalid dividerSize"); 172 }173 172 int oldDividerSize = this.dividerSize; 174 173 this.dividerSize = dividerSize; … … 212 211 */ 213 212 public void addLayoutComponent(String name, Component child) { 214 if (name == null) {213 if (name == null) 215 214 throw new IllegalArgumentException("name not specified"); 216 }217 215 childMap.put(name, child); 218 216 } … … 253 251 254 252 private Dimension preferredNodeSize(Node root) { 255 if (root instanceof Leaf) {253 if (root instanceof Leaf) 256 254 return preferredComponentSize(root); 257 }258 255 else if (root instanceof Divider) { 259 256 int dividerSize = getDividerSize(); … … 363 360 Rectangle splitBounds = split.getBounds(); 364 361 ListIterator<Node> splitChildren = split.getChildren().listIterator(); 365 Node lastWeightedChild = split.lastWeightedChild();366 362 367 363 if (split.isRowLayout()) { … … 385 381 (totalWeightedWidth - minWeightedWidth) > extraWidth; 386 382 387 while(splitChildren.hasNext()) {388 Node splitChild = splitChildren.next();389 Rectangle splitChildBounds = splitChild.getBounds();390 double minSplitChildWidth = minimumNodeSize(splitChild).getWidth();391 double splitChildWeight = (onlyShrinkWeightedComponents)383 while(splitChildren.hasNext()) { 384 Node splitChild = splitChildren.next(); 385 Rectangle splitChildBounds = splitChild.getBounds(); 386 double minSplitChildWidth = minimumNodeSize(splitChild).getWidth(); 387 double splitChildWeight = (onlyShrinkWeightedComponents) 392 388 ? splitChild.getWeight() 393 : (splitChildBounds.getWidth() / (double)totalWidth);394 395 if (!splitChildren.hasNext()) {396 double newWidth = Math.max(minSplitChildWidth, bounds.getMaxX() - x);397 Rectangle newSplitChildBounds = boundsWithXandWidth(bounds, x, newWidth);398 layout2(splitChild, newSplitChildBounds);399 }400 else if ((availableWidth > 0.0) && (splitChildWeight > 0.0)) {401 double allocatedWidth = Math.rint(splitChildWeight * extraWidth);402 double oldWidth = splitChildBounds.getWidth();403 double newWidth = Math.max(minSplitChildWidth, oldWidth - allocatedWidth);404 Rectangle newSplitChildBounds = boundsWithXandWidth(bounds, x, newWidth);405 layout2(splitChild, newSplitChildBounds);406 availableWidth -= (oldWidth - splitChild.getBounds().getWidth());407 }408 else {409 double existingWidth = splitChildBounds.getWidth();410 Rectangle newSplitChildBounds = boundsWithXandWidth(bounds, x, existingWidth);411 layout2(splitChild, newSplitChildBounds);412 }413 x = splitChild.getBounds().getMaxX();414 }389 : (splitChildBounds.getWidth() / totalWidth); 390 391 if (!splitChildren.hasNext()) { 392 double newWidth = Math.max(minSplitChildWidth, bounds.getMaxX() - x); 393 Rectangle newSplitChildBounds = boundsWithXandWidth(bounds, x, newWidth); 394 layout2(splitChild, newSplitChildBounds); 395 } 396 else if ((availableWidth > 0.0) && (splitChildWeight > 0.0)) { 397 double allocatedWidth = Math.rint(splitChildWeight * extraWidth); 398 double oldWidth = splitChildBounds.getWidth(); 399 double newWidth = Math.max(minSplitChildWidth, oldWidth - allocatedWidth); 400 Rectangle newSplitChildBounds = boundsWithXandWidth(bounds, x, newWidth); 401 layout2(splitChild, newSplitChildBounds); 402 availableWidth -= (oldWidth - splitChild.getBounds().getWidth()); 403 } 404 else { 405 double existingWidth = splitChildBounds.getWidth(); 406 Rectangle newSplitChildBounds = boundsWithXandWidth(bounds, x, existingWidth); 407 layout2(splitChild, newSplitChildBounds); 408 } 409 x = splitChild.getBounds().getMaxX(); 410 } 415 411 } 416 412 … … 435 431 (totalWeightedHeight - minWeightedHeight) > extraHeight; 436 432 437 while(splitChildren.hasNext()) {438 Node splitChild = splitChildren.next();439 Rectangle splitChildBounds = splitChild.getBounds();440 double minSplitChildHeight = minimumNodeSize(splitChild).getHeight();441 double splitChildWeight = (onlyShrinkWeightedComponents)433 while(splitChildren.hasNext()) { 434 Node splitChild = splitChildren.next(); 435 Rectangle splitChildBounds = splitChild.getBounds(); 436 double minSplitChildHeight = minimumNodeSize(splitChild).getHeight(); 437 double splitChildWeight = (onlyShrinkWeightedComponents) 442 438 ? splitChild.getWeight() 443 : (splitChildBounds.getHeight() / (double)totalHeight);444 445 if (!splitChildren.hasNext()) {446 double oldHeight = splitChildBounds.getHeight();447 double newHeight = Math.max(minSplitChildHeight, bounds.getMaxY() - y);448 Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, newHeight);449 layout2(splitChild, newSplitChildBounds);450 availableHeight -= (oldHeight - splitChild.getBounds().getHeight());451 }452 else if ((availableHeight > 0.0) && (splitChildWeight > 0.0)) {453 double allocatedHeight = Math.rint(splitChildWeight * extraHeight);454 double oldHeight = splitChildBounds.getHeight();455 double newHeight = Math.max(minSplitChildHeight, oldHeight - allocatedHeight);456 Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, newHeight);457 layout2(splitChild, newSplitChildBounds);458 availableHeight -= (oldHeight - splitChild.getBounds().getHeight());459 }460 else {461 double existingHeight = splitChildBounds.getHeight();462 Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, existingHeight);463 layout2(splitChild, newSplitChildBounds);464 }465 y = splitChild.getBounds().getMaxY();466 }439 : (splitChildBounds.getHeight() / totalHeight); 440 441 if (!splitChildren.hasNext()) { 442 double oldHeight = splitChildBounds.getHeight(); 443 double newHeight = Math.max(minSplitChildHeight, bounds.getMaxY() - y); 444 Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, newHeight); 445 layout2(splitChild, newSplitChildBounds); 446 availableHeight -= (oldHeight - splitChild.getBounds().getHeight()); 447 } 448 else if ((availableHeight > 0.0) && (splitChildWeight > 0.0)) { 449 double allocatedHeight = Math.rint(splitChildWeight * extraHeight); 450 double oldHeight = splitChildBounds.getHeight(); 451 double newHeight = Math.max(minSplitChildHeight, oldHeight - allocatedHeight); 452 Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, newHeight); 453 layout2(splitChild, newSplitChildBounds); 454 availableHeight -= (oldHeight - splitChild.getBounds().getHeight()); 455 } 456 else { 457 double existingHeight = splitChildBounds.getHeight(); 458 Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, existingHeight); 459 layout2(splitChild, newSplitChildBounds); 460 } 461 y = splitChild.getBounds().getMaxY(); 462 } 467 463 } 468 464 … … 508 504 else if ((availableWidth > 0.0) && (splitChildWeight > 0.0)) { 509 505 double allocatedWidth = (splitChild.equals(lastWeightedChild)) 510 511 : Math.rint(splitChildWeight * extraWidth);506 ? availableWidth 507 : Math.rint(splitChildWeight * extraWidth); 512 508 double newWidth = splitChildBounds.getWidth() + allocatedWidth; 513 509 Rectangle newSplitChildBounds = boundsWithXandWidth(bounds, x, newWidth); … … 550 546 else if ((availableHeight > 0.0) && (splitChildWeight > 0.0)) { 551 547 double allocatedHeight = (splitChild.equals(lastWeightedChild)) 552 553 : Math.rint(splitChildWeight * extraHeight);548 ? availableHeight 549 : Math.rint(splitChildWeight * extraHeight); 554 550 double newHeight = splitChildBounds.getHeight() + allocatedHeight; 555 551 Rectangle newSplitChildBounds = boundsWithYandHeight(bounds, y, newHeight); … … 570 566 * as needed. 571 567 */ 572 private void layout2(Node root, Rectangle bounds) {568 private void layout2(Node root, Rectangle bounds) { 573 569 if (root instanceof Leaf) { 574 570 Component child = childForNode(root); … … 584 580 Split split = (Split)root; 585 581 boolean grow = split.isRowLayout() 586 587 : (split.getBounds().height <= bounds.height);582 ? (split.getBounds().width <= bounds.width) 583 : (split.getBounds().height <= bounds.height); 588 584 if (grow) { 589 585 layoutGrow(split, bounds); … … 635 631 (splitChildren.hasNext()) ? (Divider)(splitChildren.next()) : null; 636 632 637 double childWidth = 0.0; 638 if (getFloatingDividers()) { 639 childWidth = preferredNodeSize(splitChild).getWidth(); 640 } 641 else { 642 if (dividerChild != null) { 643 childWidth = dividerChild.getBounds().getX() - x; 633 double childWidth = 0.0; 634 if (getFloatingDividers()) { 635 childWidth = preferredNodeSize(splitChild).getWidth(); 644 636 } 645 637 else { 646 childWidth = split.getBounds().getMaxX() - x; 638 if (dividerChild != null) { 639 childWidth = dividerChild.getBounds().getX() - x; 640 } 641 else { 642 childWidth = split.getBounds().getMaxX() - x; 643 } 647 644 } 648 } 649 childBounds = boundsWithXandWidth(bounds, x, childWidth); 650 layout1(splitChild, childBounds); 651 652 if (getFloatingDividers() && (dividerChild != null)) { 653 double dividerX = childBounds.getMaxX(); 654 Rectangle dividerBounds = boundsWithXandWidth(bounds, dividerX, dividerSize); 655 dividerChild.setBounds(dividerBounds); 656 } 657 if (dividerChild != null) { 658 x = dividerChild.getBounds().getMaxX(); 659 } 645 childBounds = boundsWithXandWidth(bounds, x, childWidth); 646 layout1(splitChild, childBounds); 647 648 if (getFloatingDividers() && (dividerChild != null)) { 649 double dividerX = childBounds.getMaxX(); 650 Rectangle dividerBounds = boundsWithXandWidth(bounds, dividerX, dividerSize); 651 dividerChild.setBounds(dividerBounds); 652 } 653 if (dividerChild != null) { 654 x = dividerChild.getBounds().getMaxX(); 655 } 660 656 } 661 657 } … … 673 669 (splitChildren.hasNext()) ? (Divider)(splitChildren.next()) : null; 674 670 675 double childHeight = 0.0; 676 if (getFloatingDividers()) { 677 childHeight = preferredNodeSize(splitChild).getHeight(); 678 } 679 else { 680 if (dividerChild != null) { 681 childHeight = dividerChild.getBounds().getY() - y; 671 double childHeight = 0.0; 672 if (getFloatingDividers()) { 673 childHeight = preferredNodeSize(splitChild).getHeight(); 682 674 } 683 675 else { 684 childHeight = split.getBounds().getMaxY() - y; 676 if (dividerChild != null) { 677 childHeight = dividerChild.getBounds().getY() - y; 678 } 679 else { 680 childHeight = split.getBounds().getMaxY() - y; 681 } 685 682 } 686 } 687 childBounds = boundsWithYandHeight(bounds, y, childHeight); 688 layout1(splitChild, childBounds); 689 690 if (getFloatingDividers() && (dividerChild != null)) { 691 double dividerY = childBounds.getMaxY(); 692 Rectangle dividerBounds = boundsWithYandHeight(bounds, dividerY, dividerSize); 693 dividerChild.setBounds(dividerBounds); 694 } 695 if (dividerChild != null) { 696 y = dividerChild.getBounds().getMaxY(); 697 } 683 childBounds = boundsWithYandHeight(bounds, y, childHeight); 684 layout1(splitChild, childBounds); 685 686 if (getFloatingDividers() && (dividerChild != null)) { 687 double dividerY = childBounds.getMaxY(); 688 Rectangle dividerBounds = boundsWithYandHeight(bounds, dividerY, dividerSize); 689 dividerChild.setBounds(dividerBounds); 690 } 691 if (dividerChild != null) { 692 y = dividerChild.getBounds().getMaxY(); 693 } 698 694 } 699 695 } … … 781 777 Split split = (Split)root; 782 778 for(Node child : split.getChildren()) { 783 if (child.getBounds().contains(x, y)) {779 if (child.getBounds().contains(x, y)) 784 780 return dividerAt(child, x, y); 785 }786 781 } 787 782 } … … 804 799 Rectangle r1 = node.getBounds(); 805 800 return 806 807 801 (r1.x <= (r2.x + r2.width)) && ((r1.x + r1.width) >= r2.x) && 802 (r1.y <= (r2.y + r2.height)) && ((r1.y + r1.height) >= r2.y); 808 803 } 809 804 … … 822 817 } 823 818 return dividers; 824 } 825 else { 819 } else 826 820 return Collections.emptyList(); 827 }828 821 } 829 822 … … 837 830 */ 838 831 public List<Divider> dividersThatOverlap(Rectangle r) { 839 if (r == null) {832 if (r == null) 840 833 throw new IllegalArgumentException("null Rectangle"); 841 }842 834 return dividersThatOverlap(getModel(), r); 843 835 } … … 890 882 */ 891 883 public void setBounds(Rectangle bounds) { 892 if (bounds == null) {884 if (bounds == null) 893 885 throw new IllegalArgumentException("null bounds"); 894 }895 886 this.bounds = new Rectangle(bounds); 896 887 } … … 921 912 */ 922 913 public void setWeight(double weight) { 923 if ((weight < 0.0)|| (weight > 1.0)) {914 if ((weight < 0.0)|| (weight > 1.0)) 924 915 throw new IllegalArgumentException("invalid weight"); 925 }926 916 this.weight = weight; 927 917 } … … 929 919 private Node siblingAtOffset(int offset) { 930 920 Split parent = getParent(); 931 if (parent == null) { return null; } 921 if (parent == null) 922 return null; 932 923 List<Node> siblings = parent.getChildren(); 933 924 int index = siblings.indexOf(this); 934 if (index == -1) { return null; } 925 if (index == -1) 926 return null; 935 927 index += offset; 936 928 return ((index > -1) && (index < siblings.size())) ? siblings.get(index) : null; … … 1020 1012 */ 1021 1013 public void setChildren(List<Node> children) { 1022 if (children == null) {1014 if (children == null) 1023 1015 throw new IllegalArgumentException("children must be a non-null List"); 1024 }1025 1016 for(Node child : this.children) { 1026 1017 child.setParent(null); … … 1051 1042 } 1052 1043 1044 @Override 1053 1045 public String toString() { 1054 1046 int nChildren = getChildren().size(); … … 1081 1073 */ 1082 1074 public Leaf(String name) { 1083 if (name == null) {1075 if (name == null) 1084 1076 throw new IllegalArgumentException("name is null"); 1085 }1086 1077 this.name = name; 1087 1078 } … … 1102 1093 */ 1103 1094 public void setName(String name) { 1104 if (name == null) {1095 if (name == null) 1105 1096 throw new IllegalArgumentException("name is null"); 1106 }1107 1097 this.name = name; 1108 1098 } 1109 1099 1100 @Override 1110 1101 public String toString() { 1111 1102 StringBuffer sb = new StringBuffer("MultiSplitLayout.Leaf"); … … 1142 1133 * @throws UnsupportedOperationException 1143 1134 */ 1135 @Override 1144 1136 public void setWeight(double weight) { 1145 1137 throw new UnsupportedOperationException(); 1146 1138 } 1147 1139 1140 @Override 1148 1141 public String toString() { 1149 1142 return "MultiSplitLayout.Divider " + getBounds().toString(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r3072 r3095 118 118 // 119 119 memberTableModel = new MemberTableModel(getLayer()); 120 DataSet.selListeners.add(memberTableModel); 121 getLayer().data.addDataSetListener(memberTableModel); 120 memberTableModel.register(); 122 121 selectionTableModel = new SelectionTableModel(getLayer()); 123 DataSet.selListeners.add(selectionTableModel);122 selectionTableModel.register(); 124 123 referrerModel = new ReferringRelationsBrowserModel(relation); 125 124 … … 553 552 // 554 553 selectionTableModel.unregister(); 555 DataSet.selListeners.remove(memberTableModel); 556 DataSet.selListeners.remove(selectionTableModel); 557 getLayer().data.removeDataSetListener(memberTableModel); 554 memberTableModel.unregister(); 558 555 memberTable.unlinkAsListener(); 559 556 dispose(); … … 1054 1051 1055 1052 /** 1056 * Apply the updates for an existing relation which has notbeen changed1053 * Apply the updates for an existing relation which has been changed 1057 1054 * outside of the relation editor. 1058 1055 * … … 1067 1064 1068 1065 /** 1069 * Apply the updates for an existing relation which has been changed1066 * Apply the updates for an existing relation which has not been changed 1070 1067 * outside of the relation editor. 1071 1068 * -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r2985 r3095 28 28 import org.openstreetmap.josm.data.SelectionChangedListener; 29 29 import org.openstreetmap.josm.data.coor.EastNorth; 30 import org.openstreetmap.josm.data.osm.DataSet; 30 31 import org.openstreetmap.josm.data.osm.Node; 31 32 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 50 51 * data of the table model: The list of members and the cached WayConnectionType of each member. 51 52 **/ 52 private ArrayList<RelationMember> members;53 private ArrayList<WayConnectionType> connectionType = null;53 private List<RelationMember> members; 54 private List<WayConnectionType> connectionType = null; 54 55 55 56 private DefaultListSelectionModel listSelectionModel; … … 69 70 public OsmDataLayer getLayer() { 70 71 return layer; 72 } 73 74 public void register() { 75 DataSet.selListeners.add(this); 76 getLayer().data.addDataSetListener(this); 77 } 78 79 public void unregister() { 80 DataSet.selListeners.remove(this); 81 getLayer().data.removeDataSetListener(this); 71 82 } 72 83 … … 695 706 * @return sorted collection of relation members 696 707 */ 697 private ArrayList<RelationMember> sortMembers(ArrayList<RelationMember> relationMembers) {708 private List<RelationMember> sortMembers(List<RelationMember> relationMembers) { 698 709 RelationNodeMap map = new RelationNodeMap(relationMembers); 699 710 // List of groups of linked members … … 744 755 */ 745 756 void sort() { 746 ArrayList<RelationMember> selectedMembers = new ArrayList<RelationMember>(getSelectedMembers());747 ArrayList<RelationMember> sortedMembers = null;748 ArrayList<RelationMember> newMembers;757 List<RelationMember> selectedMembers = new ArrayList<RelationMember>(getSelectedMembers()); 758 List<RelationMember> sortedMembers = null; 759 List<RelationMember> newMembers; 749 760 if (selectedMembers.size() <= 1) { 750 761 newMembers = sortMembers(members); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationNodeMap.java
r2886 r3095 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.dialogs.relation; 3 4 import static org.openstreetmap.josm.gui.dialogs.relation.WayConnectionType.Direction.NONE; 3 5 4 6 import java.util.ArrayList; … … 12 14 import org.openstreetmap.josm.data.osm.RelationMember; 13 15 import org.openstreetmap.josm.data.osm.Way; 14 15 import static org.openstreetmap.josm.gui.dialogs.relation.WayConnectionType.Direction.*;16 16 17 17 /** … … 31 31 public class RelationNodeMap { 32 32 /* 33 * read only list of all relation members34 */35 private final List<RelationMember> members;36 /*37 33 * the maps. (Need TreeMap for efficiency.) 38 34 */ … … 49 45 private List<Integer> notSortable = new ArrayList<Integer>(); 50 46 51 RelationNodeMap(ArrayList<RelationMember> members) { 52 this.members = members; 53 47 RelationNodeMap(List<RelationMember> members) { 54 48 nodesMap = new TreeMap<Node, TreeSet<Integer>>(); 55 49 waysMap = new TreeMap<Integer, TreeSet<Node>>(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableModel.java
r3083 r3095 32 32 this.layer = layer; 33 33 cache = new ArrayList<OsmPrimitive>(); 34 populateSelectedPrimitives(layer); 35 } 36 37 public void register() { 38 DataSet.selListeners.add(this); 34 39 MapView.addLayerChangeListener(this); 35 populateSelectedPrimitives(layer);36 40 } 37 41 -
trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
r3083 r3095 47 47 /** 48 48 * Creates a new authorisation client with default OAuth parameters 49 * 49 * 50 50 */ 51 51 public OsmOAuthAuthorizationClient() { … … 57 57 /** 58 58 * Creates a new authorisation client with the parameters <code>parameters</code>. 59 * 59 * 60 60 * @param parameters the OAuth parameters. Must not be null. 61 61 * @throws IllegalArgumentException thrown if parameters is null … … 71 71 * Creates a new authorisation client with the parameters <code>parameters</code> 72 72 * and an already known Request Token. 73 * 73 * 74 74 * @param parameters the OAuth parameters. Must not be null. 75 75 * @param requestToken the request token. Must not be null. … … 117 117 * Submits a request for a Request Token to the Request Token Endpoint Url of the OAuth Service 118 118 * Provider and replies the request token. 119 * 119 * 120 120 * @param monitor a progress monitor. Defaults to {@see NullProgressMonitor#INSTANCE} if null 121 121 * @return the OAuth Request Token … … 147 147 * Submits a request for an Access Token to the Access Token Endpoint Url of the OAuth Service 148 148 * Provider and replies the request token. 149 * 149 * 150 150 * You must have requested a Request Token using {@see #getRequestToken(ProgressMonitor)} first. 151 * 151 * 152 152 * @param monitor a progress monitor. Defaults to {@see NullProgressMonitor#INSTANCE} if null 153 153 * @return the OAuth Access Token … … 180 180 * Builds the authorise URL for a given Request Token. Users can be redirected to this URL. 181 181 * There they can login to OSM and authorise the request. 182 * 182 * 183 183 * @param requestToken the request token 184 184 * @return the authorise URL for this request … … 241 241 /** 242 242 * Derives the OSM login URL from the OAuth Authorization Website URL 243 * 243 * 244 244 * @return the OSM login URL 245 245 * @throws OsmOAuthAuthorizationException thrown if something went wrong, in particular if the … … 261 261 /** 262 262 * Derives the OSM logout URL from the OAuth Authorization Website URL 263 * 263 * 264 264 * @return the OSM logout URL 265 265 * @throws OsmOAuthAuthorizationException thrown if something went wrong, in particular if the … … 279 279 * Submits a request to the OSM website for a login form. The OSM website replies a session ID in 280 280 * a cookie. 281 * 281 * 282 282 * @return the session ID 283 283 * @throws OsmOAuthAuthorizationException thrown if something went wrong … … 460 460 /** 461 461 * Automatically authorises a request token for a set of privileges. 462 * 462 * 463 463 * @param requestToken the request token. Must not be null. 464 464 * @param osmUserName the OSM user name. Must not be null. -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagMergeModelTest.java
r3025 r3095 201 201 public void decideMultiple() { 202 202 203 TagMergeItem item = new TagMergeItem("key", "myvalue", "theirvalue");204 203 TagMergeModel model = new TagMergeModel(); 205 204 for (int i=0; i < 10; i++) { … … 216 215 model.decide(new int[] {0, 3, 5}, MergeDecisionType.KEEP_MINE); 217 216 for (int i = 0; i< 10; i++) { 218 item = list.get(i);217 TagMergeItem item = list.get(i); 219 218 if (i == 0 || i == 3 || i == 5) { 220 219 assertEquals(MergeDecisionType.KEEP_MINE, item.getMergeDecision());
Note:
See TracChangeset
for help on using the changeset viewer.