Changeset 26373 in osm for applications
- Timestamp:
- 2011-07-20T01:07:59+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/licensechange/src/org/openstreetmap/josm/plugins/licensechange
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/licensechange/src/org/openstreetmap/josm/plugins/licensechange/Check.java
r25955 r26373 90 90 this.progressMonitor = progressMonitor; 91 91 } 92 this.progressMonitor.beginTask(tr("Running test {0}", name));93 92 errors = new ArrayList<LicenseProblem>(30); 94 93 } -
applications/editors/josm/plugins/licensechange/src/org/openstreetmap/josm/plugins/licensechange/CheckAction.java
r25955 r26373 55 55 public void doCheck(ActionEvent ev) 56 56 { 57 if (plugin. validateAction == null || Main.map == null || !Main.map.isVisible())57 if (plugin.checkAction == null || Main.map == null || !Main.map.isVisible()) 58 58 return; 59 59 … … 99 99 public CheckTask(Collection<OsmPrimitive> validatedPrimitives, Collection<OsmPrimitive> formerValidatedPrimitives) 100 100 { 101 super(tr("Loading from Quick History Service"), false /*don't ignore exceptions */); 101 super(tr("Loading"), false /*don't ignore exceptions */); 102 102 103 this.validatedPrimitives = validatedPrimitives; 103 104 this.formerValidatedPrimitives = formerValidatedPrimitives; … … 120 121 Runnable r = new Runnable() { 121 122 public void run() { 122 plugin. validationDialog.tree.setErrors(problems);123 plugin. validationDialog.setVisible(true);123 plugin.problemDialog.tree.setErrors(problems); 124 plugin.problemDialog.setVisible(true); 124 125 Main.main.getCurrentDataSet().fireSelectionChanged(); 125 126 } … … 139 140 OsmTransferException 140 141 { 142 getProgressMonitor().indeterminateSubTask(tr("Loading from Quick History Service...")); 141 143 plugin.loadDataFromQuickHistoryService(validatedPrimitives); 142 144 problems = new ArrayList<LicenseProblem>(200); 143 getProgressMonitor().setTicksCount(validatedPrimitives.size());144 145 int testCounter = 0; 145 getProgressMonitor().setCustomText(tr("Analyzing")); 146 licenseCheck.startCheck(getProgressMonitor().createSubTaskMonitor(validatedPrimitives.size(), false)); 146 getProgressMonitor().indeterminateSubTask(tr("Analyzing...")); 147 //licenseCheck.startCheck(getProgressMonitor().createSubTaskMonitor(validatedPrimitives.size(), false)); 148 licenseCheck.startCheck(getProgressMonitor()); 147 149 licenseCheck.visit(validatedPrimitives); 148 150 licenseCheck.endCheck(); -
applications/editors/josm/plugins/licensechange/src/org/openstreetmap/josm/plugins/licensechange/LicenseChangeDialog.java
r26260 r26373 36 36 import org.openstreetmap.josm.actions.AutoScaleAction; 37 37 import org.openstreetmap.josm.command.Command; 38 import org.openstreetmap.josm.data.SelectionChangedListener;39 38 import org.openstreetmap.josm.data.osm.DataSet; 40 39 import org.openstreetmap.josm.data.osm.Node; … … 55 54 * the list while single click will make the clicked entry the only selection. 56 55 */ 57 public class LicenseChangeDialog extends ToggleDialog implements ActionListener , SelectionChangedListener{56 public class LicenseChangeDialog extends ToggleDialog implements ActionListener { 58 57 private LicenseChangePlugin plugin; 59 58 … … 77 76 super(tr("Relicensing problems"), "licensechange", tr("Open the relicensing window."), 78 77 Shortcut.registerShortcut("subwindow:licensechange", tr("Toggle: {0}", tr("Relicensing problems")), 79 KeyEvent.VK_ V, Shortcut.GROUP_LAYER, Shortcut.SHIFT_DEFAULT), 150);78 KeyEvent.VK_L, Shortcut.GROUP_LAYER, Shortcut.SHIFT_DEFAULT), 150); 80 79 81 80 this.plugin = plugin; … … 102 101 selectButton.setEnabled(false); 103 102 buttonPanel.add(selectButton); 104 buttonPanel.add(new SideButton(plugin. validateAction), "refresh");103 buttonPanel.add(new SideButton(plugin.checkAction), "refresh"); 105 104 add(buttonPanel, BorderLayout.SOUTH); 106 105 … … 110 109 public void showNotify() 111 110 { 112 DataSet.addSelectionListener(this);113 111 DataSet ds = Main.main.getCurrentDataSet(); 114 112 if (ds != null) { 115 113 updateSelection(ds.getSelected()); 116 114 } 117 }118 119 @Override120 public void hideNotify()121 {122 DataSet.removeSelectionListener(this);123 115 } 124 116 … … 321 313 } 322 314 323 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection)324 {325 updateSelection(newSelection);326 }327 315 } -
applications/editors/josm/plugins/licensechange/src/org/openstreetmap/josm/plugins/licensechange/LicenseChangePlugin.java
r25955 r26373 65 65 66 66 /** The validate action */ 67 CheckAction validateAction = new CheckAction(this);67 CheckAction checkAction = new CheckAction(this); 68 68 69 69 /** The validation dialog */ 70 LicenseChangeDialog validationDialog;70 LicenseChangeDialog problemDialog; 71 71 72 72 /** The list of errors per layer*/ … … 95 95 if (newFrame != null) 96 96 { 97 validationDialog = new LicenseChangeDialog(this);98 newFrame.addToggleDialog( validationDialog);97 problemDialog = new LicenseChangeDialog(this); 98 newFrame.addToggleDialog(problemDialog); 99 99 initializeProblemLayer(); 100 100 MapView.addLayerChangeListener(this); … … 123 123 if (newLayer instanceof OsmDataLayer) { 124 124 List<LicenseProblem> errors = layerProblems.get(newLayer); 125 validationDialog.tree.setErrorList(errors);125 problemDialog.tree.setErrorList(errors); 126 126 Main.map.repaint(); 127 127 } -
applications/editors/josm/plugins/licensechange/src/org/openstreetmap/josm/plugins/licensechange/ProblemLayer.java
r25955 r26373 61 61 public void paint(final Graphics2D g, final MapView mv, Bounds bounds) 62 62 { 63 updateCount = plugin. validationDialog.tree.getUpdateCount();64 DefaultMutableTreeNode root = plugin. validationDialog.tree.getRoot();63 updateCount = plugin.problemDialog.tree.getUpdateCount(); 64 DefaultMutableTreeNode root = plugin.problemDialog.tree.getRoot(); 65 65 if (root == null || root.getChildCount() == 0) 66 66 return; … … 86 86 { 87 87 Bag<Severity, LicenseProblem> problemTree = new Bag<Severity, LicenseProblem>(); 88 List<LicenseProblem> problems = plugin. validationDialog.tree.getErrors();88 List<LicenseProblem> problems = plugin.problemDialog.tree.getErrors(); 89 89 for (LicenseProblem e : problems) { 90 90 problemTree.add(e.getSeverity(), e); … … 118 118 public boolean isChanged() 119 119 { 120 return updateCount != plugin. validationDialog.tree.getUpdateCount();120 return updateCount != plugin.problemDialog.tree.getUpdateCount(); 121 121 } 122 122 -
applications/editors/josm/plugins/licensechange/src/org/openstreetmap/josm/plugins/licensechange/Severity.java
r26198 r26373 14 14 /** Error messages */ 15 15 DATA_LOSS(tr("Data loss"), "error.gif", 16 Main.pref.getColor(marktr("license validationerror"), Color.RED)),16 Main.pref.getColor(marktr("license check error"), Color.RED)), 17 17 18 18 /** Warning messages */ 19 19 POSSIBLE_DATA_LOSS(tr("Possible data loss"), "warning.gif", 20 Main.pref.getColor(marktr("license validationwarning"), Color.ORANGE)),20 Main.pref.getColor(marktr("license check warning"), Color.ORANGE)), 21 21 22 22 /** Other messages */ 23 23 DATA_REDUCTION(tr("Data reduction"), "other.gif", 24 Main.pref.getColor(marktr("license validation other"), Color.YELLOW));24 Main.pref.getColor(marktr("license check notice"), Color.YELLOW)); 25 25 26 26 /** Description of the severity code */
Note:
See TracChangeset
for help on using the changeset viewer.