Changeset 34734 in osm for applications/editors/josm
- Timestamp:
- 2018-11-22T00:21:27+01:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/indoorhelper/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/indoorhelper/src/controller/IndoorHelperController.java
r34522 r34734 82 82 private DrawAction drawAction; 83 83 private SelectAction selectAction; 84 private SpaceAction SpaceAction;85 private transient Shortcut SpaceShortcut;86 private EnterAction EnterAction;87 private transient Shortcut EnterShortcut;88 private boolean OuterHelp, InnerHelp, LevelHelp;84 private SpaceAction spaceAction; 85 private transient Shortcut spaceShortcut; 86 private EnterAction enterAction; 87 private transient Shortcut enterShortcut; 88 private boolean outerHelp, innerHelp, levelHelp; 89 89 private Collection<OsmPrimitive> innerRelation; 90 90 private LevelSelectorView selectorView; … … 115 115 116 116 // Shortcuts 117 SpaceShortcut = Shortcut.registerShortcut("mapmode:space",117 spaceShortcut = Shortcut.registerShortcut("mapmode:space", 118 118 "ConfirmObjectDrawing", KeyEvent.VK_SPACE, Shortcut.DIRECT); 119 this. SpaceAction = new SpaceAction();120 MainApplication.registerActionShortcut( SpaceAction, SpaceShortcut);121 122 EnterShortcut = Shortcut.registerShortcut("mapmode:enter",119 this.spaceAction = new SpaceAction(); 120 MainApplication.registerActionShortcut(spaceAction, spaceShortcut); 121 122 enterShortcut = Shortcut.registerShortcut("mapmode:enter", 123 123 "ConfirmMultipolygonSelection", KeyEvent.VK_ENTER, Shortcut.DIRECT); 124 this. EnterAction = new EnterAction();125 MainApplication.registerActionShortcut( EnterAction, EnterShortcut);124 this.enterAction = new EnterAction(); 125 MainApplication.registerActionShortcut(enterAction, enterShortcut); 126 126 127 127 // Helper 128 OuterHelp = false;129 InnerHelp = false;130 LevelHelp = false;128 outerHelp = false; 129 innerHelp = false; 130 levelHelp = false; 131 131 innerRelation = null; 132 132 levelValue = new String(); … … 328 328 329 329 // For space shortcut to add the relation after spacebar got pushed {@link SpaceAction} 330 OuterHelp = true;331 InnerHelp = false;330 outerHelp = true; 331 innerHelp = false; 332 332 } 333 333 } … … 345 345 346 346 // For space shortcut to edit the relation after enter got pushed {@link SpaceAction}{@link EnterAction} 347 InnerHelp = true;348 OuterHelp = false;347 innerHelp = true; 348 outerHelp = false; 349 349 350 350 } … … 419 419 @Override 420 420 public void actionPerformed(ActionEvent e) { 421 LevelHelp = true;421 levelHelp = true; 422 422 423 423 // Get insert level number out of SelectorView … … 510 510 @Override 511 511 public void actionPerformed(ActionEvent e) { 512 if ( OuterHelp) {512 if (outerHelp) { 513 513 514 514 //Create new relation and add the currently drawn object to it 515 515 model.addRelation("outer"); 516 516 map.selectMapMode(selectAction); 517 OuterHelp = false;517 outerHelp = false; 518 518 519 519 //Clear currently selection 520 520 MainApplication.getLayerManager().getEditDataSet().clearSelection(); 521 } else if ( InnerHelp) {521 } else if (innerHelp) { 522 522 523 523 //Save new drawn relation for adding … … 527 527 //Clear currently selection 528 528 MainApplication.getLayerManager().getEditDataSet().clearSelection(); 529 } else if ( LevelHelp) {529 } else if (levelHelp) { 530 530 531 531 List<Tag> tags = new ArrayList<>(); … … 537 537 //Change action 538 538 map.selectMapMode(selectAction); 539 LevelHelp = false;539 levelHelp = false; 540 540 } 541 541 } … … 552 552 @Override 553 553 public void actionPerformed(ActionEvent e) { 554 if ( InnerHelp && !OuterHelp) {554 if (innerHelp && !outerHelp) { 555 555 // Edit the new drawn relation member to selected relation 556 556 model.editRelation("inner", innerRelation); 557 InnerHelp = false;558 } else if (( InnerHelp && OuterHelp) || (OuterHelp && !InnerHelp)) {557 innerHelp = false; 558 } else if ((innerHelp && outerHelp) || (outerHelp && !innerHelp)) { 559 559 JOptionPane.showMessageDialog(null, 560 560 tr("Please press spacebar first to add \"outer\" object to relation."), tr("Relation-Error"), JOptionPane.ERROR_MESSAGE); … … 617 617 */ 618 618 private void resetHelper() { 619 InnerHelp = false;620 OuterHelp = false;619 innerHelp = false; 620 outerHelp = false; 621 621 } 622 622 -
applications/editors/josm/plugins/indoorhelper/src/model/IndoorLevel.java
r34309 r34734 122 122 //Extract values 123 123 if (val.indexOf("-") == 0) { 124 firstVal = (Integer.parseInt(val.split("-", 2)[1].split("-", 2)[0]))*-1;124 firstVal = Integer.parseInt(val.split("-", 2)[1].split("-", 2)[0])*-1; 125 125 secVal = Integer.parseInt(val.split("-", 2)[1].split("-", 2)[1]); 126 126 } else if (val.contains("-")) { -
applications/editors/josm/plugins/indoorhelper/src/views/ToolBoxView.java
r34179 r34734 26 26 import java.awt.GridBagLayout; 27 27 import java.awt.Insets; 28 import java.awt.TextField;29 28 import java.awt.event.ActionListener; 30 29 import java.awt.event.FocusEvent; … … 470 469 if (getLevelCheckBoxStatus() == false) { 471 470 if (!levelTag.equals("")) { 472 this.levelLabel.setText( (tr("Working level: {0}", levelTag)));471 this.levelLabel.setText(tr("Working level: {0}", levelTag)); 473 472 } else { 474 this.levelLabel.setText( (tr("Working level: NONE")));473 this.levelLabel.setText(tr("Working level: NONE")); 475 474 } 476 475 } else { 477 this.levelLabel.setText( (tr("Working level: NONE")));476 this.levelLabel.setText(tr("Working level: NONE")); 478 477 } 479 478 } … … 505 504 } 506 505 507 506 508 507 /** 509 508 * Clears the text boxes and sets an empty String.
Note:
See TracChangeset
for help on using the changeset viewer.