Changeset 27966 in osm
- Timestamp:
- 2012-03-01T20:36:21+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/junctionchecking
- Files:
-
- 3 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckDialog.java
r27852 r27966 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.BorderLayout;7 6 import java.awt.GridLayout; 8 7 import java.awt.event.ActionEvent; 9 import java.awt.event.ActionListener;10 8 import java.awt.event.KeyEvent; 11 9 import java.util.Arrays; 12 10 import java.util.Collection; 13 11 12 import javax.swing.AbstractAction; 14 13 import javax.swing.BoxLayout; 15 14 import javax.swing.JCheckBox; … … 25 24 import org.openstreetmap.josm.gui.SideButton; 26 25 import org.openstreetmap.josm.gui.dialogs.ToggleDialog; 26 import org.openstreetmap.josm.tools.ImageProvider; 27 27 import org.openstreetmap.josm.tools.Shortcut; 28 28 … … 30 30 * @author joerg 31 31 */ 32 public class JunctionCheckDialog extends ToggleDialog implements ActionListener,SelectionChangedListener{32 public class JunctionCheckDialog extends ToggleDialog implements SelectionChangedListener{ 33 33 34 34 private final JunctionCheckerPlugin plugin; … … 88 88 89 89 // ButtonPanel 90 createDigraphButton = new SideButton(marktr("Create"), "digraphcreation", tr ("start the channel digraph creation"), 91 tr("create the channel digraph"), this); 92 checkJunctionButton = new SideButton(marktr("Check "), "junctioncheck", tr("check a marked subset if it is a junction"), 93 tr("check the subust for junction properties"), this); 90 createDigraphButton = new SideButton(new AbstractAction() { 91 { 92 putValue(NAME, marktr("Create")); 93 putValue(SHORT_DESCRIPTION, tr("create the channel digraph")); 94 putValue(SMALL_ICON, ImageProvider.get("dialogs", "digraphcreation")); 95 } 96 @Override 97 public void actionPerformed(ActionEvent e) { 98 DigraphCreationTask dct = new DigraphCreationTask(plugin, digraphsealcb.isSelected(), sccCB.isSelected()); 99 Main.worker.submit(dct); 100 setActivateJunctionCheckOrSearch(true); 101 } 102 }); 103 checkJunctionButton = new SideButton(new AbstractAction() { 104 { 105 putValue(NAME, marktr("Check ")); 106 putValue(SHORT_DESCRIPTION, tr("check the subust for junction properties")); 107 putValue(SMALL_ICON, ImageProvider.get("dialogs", "junctioncheck")); 108 } 109 @Override 110 public void actionPerformed(ActionEvent e) { 111 PrepareJunctionCheckorSearch pjc = new PrepareJunctionCheckorSearch(plugin, smodel.getNumber().intValue(), produceRelation.isSelected()); 112 pjc.prepareJunctionCheck(); 113 } 114 }); 94 115 checkJunctionButton.setEnabled(false); 95 searchJunctionButton = new SideButton(marktr("Search "), "junctionsearch", tr ("search for junctions into a subset of channels"), 96 tr("search for junctions in the channel subset"), this); 116 searchJunctionButton = new SideButton(new AbstractAction() { 117 { 118 putValue(NAME, marktr("Search ")); 119 putValue(SHORT_DESCRIPTION, tr("search for junctions in the channel subset")); 120 putValue(SMALL_ICON, ImageProvider.get("dialogs", "junctionsearch")); 121 } 122 @Override 123 public void actionPerformed(ActionEvent e) { 124 PrepareJunctionCheckorSearch pjc = new PrepareJunctionCheckorSearch(plugin, smodel.getNumber().intValue(), produceRelation.isSelected()); 125 pjc.prepareJunctionSearch(); 126 } 127 }); 97 128 searchJunctionButton.setEnabled(false); 98 129 … … 102 133 } 103 134 104 105 public void actionPerformed(ActionEvent e) {106 String actionCommand = e.getActionCommand();107 if (actionCommand.equals("Create")) {108 DigraphCreationTask dct = new DigraphCreationTask(plugin, digraphsealcb.isSelected(), sccCB.isSelected());109 Main.worker.submit(dct);110 setActivateJunctionCheckOrSearch(true);111 }112 else if (actionCommand.equals("Check ")) {113 PrepareJunctionCheckorSearch pjc = new PrepareJunctionCheckorSearch(plugin, smodel.getNumber().intValue(), produceRelation.isSelected());114 pjc.prepareJunctionCheck();115 116 }117 else if (actionCommand.equals("Search ")) {118 PrepareJunctionCheckorSearch pjc = new PrepareJunctionCheckorSearch(plugin, smodel.getNumber().intValue(), produceRelation.isSelected());119 pjc.prepareJunctionSearch();120 }121 }122 135 123 136 /** … … 143 156 } 144 157 158 @Override 145 159 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 146 160
Note:
See TracChangeset
for help on using the changeset viewer.