Changeset 27863 in osm for applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap
- Timestamp:
- 2012-02-18T18:03:10+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/XmlBoundsPreferenceSetting.java
r27015 r27863 18 18 import javax.swing.JButton; 19 19 20 import org.openstreetmap.josm.gui.preferences.ImageryPreference; 21 import org.openstreetmap.josm.gui.preferences.ImageryPreference.ImageryProvidersPanel; 22 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 20 import org.openstreetmap.josm.gui.preferences.imagery.ImageryPreference; 21 import org.openstreetmap.josm.gui.preferences.imagery.ImageryPreference.ImageryProvidersPanel; 22 import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting; 23 import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting; 23 24 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 24 25 import org.openstreetmap.josm.plugins.imageryxmlbounds.actions.EditEntriesAction; 25 26 26 27 /** 27 * 28 * 28 29 * @author Don-vip 29 30 * 30 31 */ 31 public class XmlBoundsPreferenceSetting implements PreferenceSetting {32 public class XmlBoundsPreferenceSetting implements SubPreferenceSetting { 32 33 33 @Override 34 public void addGui(PreferenceTabbedPane gui) { 35 for (PreferenceSetting ps : gui.getSettings()) { 36 if (ps instanceof ImageryPreference) { 37 ImageryProvidersPanel ipp = ((ImageryPreference) ps).getProvidersPanel(); 38 EditEntriesAction action = new EditEntriesAction(ipp.defaultTable, ipp.defaultModel); 39 ipp.middleToolbar.add(new JButton(action)); 40 // TODO 41 break; 42 } 43 } 44 } 34 @Override 35 public void addGui(PreferenceTabbedPane gui) { 36 ImageryProvidersPanel ipp = gui.getImageryPreference().getProvidersPanel(); 37 EditEntriesAction action = new EditEntriesAction(ipp.defaultTable, ipp.defaultModel); 38 ipp.middleToolbar.add(new JButton(action)); 39 } 45 40 46 @Override 47 public boolean ok() { 48 return false; 49 } 41 @Override 42 public boolean ok() { 43 return false; 44 } 45 46 @Override 47 public boolean isExpert() { 48 return false; 49 } 50 51 public TabPreferenceSetting getTabPreferenceSetting(final PreferenceTabbedPane gui) { 52 return gui.getImageryPreference(); 53 } 54 50 55 } -
applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/EditEntriesAction.java
r27015 r27863 30 30 import org.openstreetmap.josm.actions.JosmAction; 31 31 import org.openstreetmap.josm.data.imagery.ImageryInfo; 32 import org.openstreetmap.josm.gui.preferences. ImageryPreference.ImageryProvidersPanel.ImageryDefaultLayerTableModel;32 import org.openstreetmap.josm.gui.preferences.imagery.ImageryPreference.ImageryProvidersPanel.ImageryDefaultLayerTableModel; 33 33 import org.openstreetmap.josm.plugins.imageryxmlbounds.XmlBoundsConstants; 34 34 import org.openstreetmap.josm.plugins.imageryxmlbounds.XmlBoundsLayer; … … 39 39 40 40 protected static final String ACTION_NAME = tr("Edit"); 41 41 42 42 private final JTable defaultTable; 43 43 private final ImageryDefaultLayerTableModel defaultModel; 44 44 45 45 private final List<ImageryInfo> entries; 46 46 47 47 public EditEntriesAction(JTable defaultTable, ImageryDefaultLayerTableModel defaultModel) { 48 48 putValue(SHORT_DESCRIPTION, tr("edit bounds for selected defaults")); … … 59 59 setEnabled(false); 60 60 } 61 61 62 62 @Override 63 63 public void actionPerformed(ActionEvent e) { … … 83 83 entries.clear(); 84 84 for (int row : defaultTable.getSelectedRows()) { 85 ImageryInfo info = defaultModel.getRow(row); 85 ImageryInfo info = defaultModel.getRow(row); 86 86 if (info != null && info.getBounds() != null) { 87 87 entries.add(info);
Note:
See TracChangeset
for help on using the changeset viewer.