Changeset 27857 in osm for applications/editors/josm/plugins
- Timestamp:
- 2012-02-18T15:10:01+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/osmarender/build.xml
r27243 r27857 34 34 <property name="xslt" location="./xslt"/> 35 35 <property name="commit.message" value="Fixed #4360 - osmarender plugin does not load"/> 36 <property name="plugin.main.version" value="4 645"/>36 <property name="plugin.main.version" value="4968"/> 37 37 <target name="init"> 38 38 <mkdir dir="${plugin.build.dir}"/> -
applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java
r27243 r27857 34 34 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 35 35 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 36 import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting; 37 import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting; 36 38 import org.openstreetmap.josm.io.OsmWriter; 37 39 import org.openstreetmap.josm.io.OsmWriterFactory; … … 142 144 143 145 @Override public PreferenceSetting getPreferenceSetting() { 144 return new PreferenceSetting(){ 145 private JTextField firefox = new JTextField(10); 146 public void addGui(PreferenceTabbedPane gui) { 147 final JPanel panel = new JPanel(new GridBagLayout()); 148 panel.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0 )); 149 150 panel.add(new JLabel(tr("Firefox executable")), GBC.std().insets(10,5,5,0)); 151 panel.add(firefox, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL)); 152 panel.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH)); 153 firefox.setText(Main.pref.get("osmarender.firefox")); 154 gui.mapcontent.addTab(tr("Osmarender"), panel); 155 } 156 public boolean ok() { 157 Main.pref.put("osmarender.firefox", firefox.getText()); 158 return false; 159 } 160 }; 146 return new OsmarenderPreferenceSetting(); 147 } 148 149 private class OsmarenderPreferenceSetting implements SubPreferenceSetting { 150 151 private JTextField firefox = new JTextField(10); 152 153 @Override 154 public void addGui(PreferenceTabbedPane gui) { 155 final JPanel panel = new JPanel(new GridBagLayout()); 156 panel.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0 )); 157 158 panel.add(new JLabel(tr("Firefox executable")), GBC.std().insets(10,5,5,0)); 159 panel.add(firefox, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL)); 160 panel.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH)); 161 firefox.setText(Main.pref.get("osmarender.firefox")); 162 gui.getMapPreference().mapcontent.addTab(tr("Osmarender"), panel); 163 } 164 165 @Override 166 public boolean ok() { 167 Main.pref.put("osmarender.firefox", firefox.getText()); 168 return false; 169 } 170 171 @Override 172 public boolean isExpert() { 173 return false; 174 } 175 176 @Override 177 public TabPreferenceSetting getTabPreferenceSetting(final PreferenceTabbedPane gui) { 178 return gui.getMapPreference(); 179 } 180 161 181 } 162 182 -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingPreferenceDialog.java
r23561 r27857 55 55 import org.apache.log4j.Logger; 56 56 import org.openstreetmap.josm.Main; 57 import org.openstreetmap.josm.gui.preferences. PreferenceSetting;57 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 58 58 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 59 59 import org.openstreetmap.josm.tools.GBC; … … 61 61 import com.innovant.josm.jrt.osm.OsmWayTypes; 62 62 63 public class RoutingPreferenceDialog implementsPreferenceSetting {63 public class RoutingPreferenceDialog extends DefaultTabPreferenceSetting { 64 64 65 65 /** … … 75 75 */ 76 76 public RoutingPreferenceDialog() { 77 super( );77 super("routing", tr("Routing Plugin Preferences"), tr("Configure routing preferences.")); 78 78 readPreferences(); 79 79 } … … 81 81 public void addGui(final PreferenceTabbedPane gui) { 82 82 83 JPanel principal = gui.createPreferenceTab("routing", 84 tr("Routing Plugin Preferences"), tr("Configure routing preferences.")); 83 JPanel principal = gui.createPreferenceTab(this); 85 84 86 85 JPanel p = new JPanel(); -
applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaPreferenceSetting.java
r25883 r27857 9 9 10 10 import org.openstreetmap.josm.Main; 11 import org.openstreetmap.josm.gui.preferences. PreferenceSetting;11 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 12 12 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 13 13 import org.openstreetmap.josm.tools.GBC; 14 14 15 public class SimplifyAreaPreferenceSetting implementsPreferenceSetting {15 public class SimplifyAreaPreferenceSetting extends DefaultTabPreferenceSetting { 16 16 17 17 static final String DIST_FACTOR = "simplify-area.dist.factor"; … … 31 31 private final JTextField distanceFactor = new JTextField(8); 32 32 33 public SimplifyAreaPreferenceSetting() { 34 super("simplifyArea", "Simplify Area", "Node of the way (area) is removed if all of <u>Angle Weight</u>, <u>Area Weight</u> and <u>Distance Weight</u> are greater than 1. " + 35 "<u>Weight</u> is computed as <u>Value</u> / <u>Threshold</u>, where <u>Value</u> is one of <u>Angle</u>, <u>Area</u> and <u>Distance</u> " + 36 "computed from every three adjanced points of the way." + 37 "<ul><li><u>Value</u> of <u>Angle</u> is angle in degrees on the second node</li>" + 38 "<li><u>Value</u> of <u>Area</u> is area formed by triangle</li>" + 39 "<li><u>Value</u> of the <u>Distance</u> is Cross Track Error Distance</li></ul>" + 40 "All three <u>Weight</u>s multiplied by its <u>Factor</u>s are summed and node of the lowest sum is removed first. " + 41 "Removal continues until there is no node to remove." + 42 "Merge Nearby Nodes is another step of the simplification that merges adjanced nodes that are closer than <u>Threshold</u> meters."); 43 } 33 44 34 45 @Override 35 46 public void addGui(final PreferenceTabbedPane gui) { 36 final JPanel tab = gui.createPreferenceTab("simplifyArea", "Simplify Area", "Node of the way (area) is removed if all of <u>Angle Weight</u>, <u>Area Weight</u> and <u>Distance Weight</u> are greater than 1. " + 37 "<u>Weight</u> is computed as <u>Value</u> / <u>Threshold</u>, where <u>Value</u> is one of <u>Angle</u>, <u>Area</u> and <u>Distance</u> " + 38 "computed from every three adjanced points of the way." + 39 "<ul><li><u>Value</u> of <u>Angle</u> is angle in degrees on the second node</li>" + 40 "<li><u>Value</u> of <u>Area</u> is area formed by triangle</li>" + 41 "<li><u>Value</u> of the <u>Distance</u> is Cross Track Error Distance</li></ul>" + 42 "All three <u>Weight</u>s multiplied by its <u>Factor</u>s are summed and node of the lowest sum is removed first. " + 43 "Removal continues until there is no node to remove." + 44 "Merge Nearby Nodes is another step of the simplification that merges adjanced nodes that are closer than <u>Threshold</u> meters."); 47 final JPanel tab = gui.createPreferenceTab(this); 45 48 46 49 angleThreshold.setText(Main.pref.get(ANGLE_THRESHOLD, "10")); -
applications/editors/josm/plugins/tag2link/build.xml
r26990 r27857 32 32 <property name="commit.message" value="Commit message"/> 33 33 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 34 <property name="plugin.main.version" value="4 549"/>34 <property name="plugin.main.version" value="4968"/> 35 35 <!-- should not be necessary to change the following properties --> 36 36 <property name="josm" location="../../core/dist/josm-custom.jar"/> … … 149 149 </target> 150 150 <!-- 151 ************************** Publishing the plugin *********************************** 152 --> 153 <!-- 154 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 151 ************************** Publishing the plugin *********************************** 152 --> 153 <!-- 154 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 155 155 ** property ${coreversion.info.entry.revision} 156 156 --> … … 196 196 <echo> 197 197 ***** Properties of published ${plugin.jar} ***** 198 Commit message : '${commit.message}' 198 Commit message : '${commit.message}' 199 199 Plugin-Mainversion: ${plugin.main.version} 200 200 JOSM build version: ${coreversion.info.entry.revision} 201 201 Plugin-Version : ${version.entry.commit.revision} 202 ***** / Properties of published ${plugin.jar} ***** 203 202 ***** / Properties of published ${plugin.jar} ***** 203 204 204 Now commiting ${plugin.jar} ... 205 205 </echo> -
applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/Tag2LinkPlugin.java
r27305 r27857 42 42 public class Tag2LinkPlugin extends Plugin { 43 43 44 private Tag2LinkPreferenceSetting preferenceSetting;45 44 // private Tag2LinkPreferenceSetting preferenceSetting; TODO 45 46 46 /** 47 47 * Initializes the plugin. … … 50 50 public Tag2LinkPlugin(PluginInformation info) { 51 51 super(info); 52 this.preferenceSetting = new Tag2LinkPreferenceSetting();52 // this.preferenceSetting = new Tag2LinkPreferenceSetting(); 53 53 Tag2LinkRuleChecker.init(); 54 54 } … … 57 57 * @see org.openstreetmap.josm.plugins.Plugin#getPreferenceSetting() 58 58 */ 59 @Override60 public PreferenceSetting getPreferenceSetting() {61 return this.preferenceSetting;62 }63 59 // @Override 60 // public PreferenceSetting getPreferenceSetting() { 61 // return this.preferenceSetting; 62 // } 63 64 64 /* (non-Javadoc) 65 65 * @see org.openstreetmap.josm.plugins.Plugin#mapFrameInitialized(org.openstreetmap.josm.gui.MapFrame, org.openstreetmap.josm.gui.MapFrame) … … 68 68 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { 69 69 if (newFrame != null) { 70 // Initialize dialogs listeners only after the main frame is created 70 // Initialize dialogs listeners only after the main frame is created 71 71 newFrame.selectionListDialog.addPopupMenuListener(new SelectionPopupListener(newFrame)); 72 72 newFrame.propertiesDialog.addMembershipPopupMenuListener(new MembershipPopupListener(newFrame)); -
applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/Tag2LinkPreferenceSetting.java
r26922 r27857 16 16 package org.openstreetmap.josm.plugins.tag2link; 17 17 18 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 18 import static org.openstreetmap.josm.tools.I18n.tr; 19 20 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 19 21 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 20 22 21 public class Tag2LinkPreferenceSetting implements PreferenceSetting, Tag2LinkConstants { 23 public class Tag2LinkPreferenceSetting extends DefaultTabPreferenceSetting implements Tag2LinkConstants { 24 25 public Tag2LinkPreferenceSetting() { 26 super(ICON_48, tr("Tag2Link Preferences"), tr("Tag2Link Preferences")); 27 } 22 28 23 29 @Override -
applications/editors/josm/plugins/turnrestrictions/build.xml
r27352 r27857 32 32 <property name="commit.message" value="Adapt to JOSM core change (DefaultNameFormatter)"/> 33 33 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 34 <property name="plugin.main.version" value="4 549"/>34 <property name="plugin.main.version" value="4968"/> 35 35 <!-- 36 36 ************************************************ -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferenceEditor.java
r23192 r27857 19 19 20 20 import org.openstreetmap.josm.Main; 21 import org.openstreetmap.josm.gui.preferences. PreferenceSetting;21 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 22 22 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 23 23 import org.openstreetmap.josm.gui.widgets.HtmlPanel; … … 30 30 * 31 31 */ 32 public class PreferenceEditor extends JPanel implements PreferenceSetting{33 32 public class PreferenceEditor extends DefaultTabPreferenceSetting { 33 34 34 private PreferencesPanel pnlIconPreferences; 35 private JPanel mainPanel; 36 37 public PreferenceEditor() { 38 super("turnrestrictions", tr("Turn Restrictions"), tr("An OSM plugin for editing turn restrictions.")); 39 build(); 40 } 35 41 36 42 /** 37 * builds the panel with the sponsoring information 38 * 43 * builds the panel with the sponsoring information 44 * 39 45 * @return 40 46 */ … … 50 56 pnl.add(lbl, gc); 51 57 lbl.setIcon(ImageProvider.get("skobbler-logo")); 52 58 53 59 gc.gridx = 1; 54 60 gc.weightx = 1.0; 55 61 HtmlPanel msg =new HtmlPanel(); 56 62 msg.setText("<html><body>" 57 + tr("Development of the turn restriction plugin was sponsored " 63 + tr("Development of the turn restriction plugin was sponsored " 58 64 + "by <a href=\"http://www.skobbler.de\">skobbler GmbH</a>.") 59 65 +"</body></html>"); 60 66 pnl.add(msg, gc); 61 62 // filler - grab remaining space 67 68 // filler - grab remaining space 63 69 gc.gridy = 1; 64 70 gc.gridx = 0; … … 67 73 gc.weighty = 1.0; 68 74 pnl.add(new JPanel(), gc); 69 75 70 76 SkobblerUrlLauncher urlLauncher = new SkobblerUrlLauncher(); 71 77 msg.getEditorPane().addHyperlinkListener(urlLauncher); … … 76 82 protected JPanel buildIconPreferencePanel() { 77 83 JPanel pnl = new JPanel(new BorderLayout()); 78 84 79 85 pnlIconPreferences = new PreferencesPanel(); 80 86 pnlIconPreferences.initFromPreferences(Main.pref); 81 87 82 88 JScrollPane sp = new JScrollPane(pnlIconPreferences); 83 89 sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); 84 90 sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); 85 91 86 92 pnl.add(sp, BorderLayout.CENTER); 87 93 return pnl; 88 94 } 89 95 90 96 protected void build() { 91 setLayout(new BorderLayout()); 97 mainPanel = new JPanel(); 98 mainPanel.setLayout(new BorderLayout()); 92 99 JTabbedPane tp = new JTabbedPane(); 93 100 tp.add(buildIconPreferencePanel()); 94 tp.add(buildCreditPanel()); 101 tp.add(buildCreditPanel()); 95 102 tp.setTitleAt(0, tr("Preferences")); 96 103 tp.setToolTipTextAt(0,tr("Configure the preferences for the turnrestrictions plugin")); 97 104 tp.setTitleAt(1, tr("Sponsor")); 98 add(tp, BorderLayout.CENTER);105 mainPanel.add(tp, BorderLayout.CENTER); 99 106 } 100 101 public PreferenceEditor() { 102 build(); 103 } 104 107 105 108 public void addGui(PreferenceTabbedPane gui) { 106 String description = tr("An OSM plugin for editing turn restrictions."); 107 JPanel tab = gui.createPreferenceTab("turnrestrictions", tr("Turn Restrictions"), description); 108 tab.add(this, GBC.eol().fill(GBC.BOTH)); 109 JPanel tab = gui.createPreferenceTab(this); 110 tab.add(mainPanel, GBC.eol().fill(GBC.BOTH)); 109 111 } 110 112 … … 113 115 return false; 114 116 } 115 117 116 118 /** 117 * Launches an external browser with the sponsors home page 119 * Launches an external browser with the sponsors home page 118 120 */ 119 121 class SkobblerUrlLauncher extends MouseAdapter implements HyperlinkListener { … … 121 123 OpenBrowser.displayUrl("http://www.skobbler.de"); 122 124 } 123 125 124 126 public void hyperlinkUpdate(HyperlinkEvent e) { 125 127 if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) { -
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/customurl/UtilsPluginPreferences.java
r27543 r27857 1 /* 2 * To change this template, choose Tools | Templates 3 * and open the template in the editor. 4 */ 1 // License: GPL. For details, see LICENSE file. 5 2 package utilsplugin2.customurl; 6 3 … … 22 19 import javax.swing.event.TableModelListener; 23 20 import javax.swing.table.DefaultTableModel; 24 import org.openstreetmap.josm.gui.preferences. PreferenceSetting;21 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 25 22 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 26 23 import org.openstreetmap.josm.tools.GBC; … … 28 25 import static org.openstreetmap.josm.tools.I18n.*; 29 26 30 public class UtilsPluginPreferences implementsPreferenceSetting {27 public class UtilsPluginPreferences extends DefaultTabPreferenceSetting { 31 28 HistoryComboBox combo1=new HistoryComboBox(); 32 29 JTable table; … … 35 32 JButton saveButton; 36 33 34 public UtilsPluginPreferences() { 35 super("utils", tr("Utilsplugin2 settings [TESTING]"), tr("Here you can change some preferences of Utilsplugin2 functions")); 36 } 37 37 38 @Override 38 39 public void addGui(PreferenceTabbedPane gui) { 39 JPanel pp = gui.createPreferenceTab("utils", tr("Utilsplugin2 settings [TESTING]"), 40 tr("Here you can change some preferences of Utilsplugin2 functions")); 40 JPanel pp = gui.createPreferenceTab(this); 41 41 JPanel all = new JPanel(); 42 42 GridBagLayout layout = new GridBagLayout(); 43 43 all.setLayout(layout); 44 44 45 45 // FIXME: get rid of hardcoded URLS 46 46 47 47 String addr = URLList.getSelectedURL(); 48 48 table=new JTable(new DefaultTableModel(null,new String[]{"Title","URL"})); 49 49 50 50 List<String> items = URLList.getURLList(); 51 //System.out.println("pref:"+addr); 52 51 53 52 resetButton = new JButton(tr("Reset")); 54 53 resetButton.addActionListener(new ActionListener() { … … 57 56 } 58 57 }); 59 58 60 59 saveButton = new JButton(tr("Save to file")); 61 60 saveButton.addActionListener(new ActionListener() { … … 64 63 } 65 64 }); 66 65 67 66 loadButton = new JButton(tr("Load from file")); 68 67 loadButton.addActionListener(new ActionListener() { … … 71 70 } 72 71 }); 73 72 74 73 fillRows(items); 75 74 76 75 HtmlPanel help = new HtmlPanel(tr("Please edit custom URLs and select one row to use with the tool<br/>" 77 76 + " <b>{key}</b> is replaced with the tag value<br/>" … … 80 79 + " <b>{#lat} , {#lon}</b> is replaced with map center latitude/longitude <br/>" 81 80 + " Your can manually load settings from file <b>customurl.txt</b> in JOSM folder")); 82 81 83 82 all.add(new JLabel(tr("Custom URL configuration")),GBC.std().insets(5,10,0,0)); 84 83 all.add(resetButton,GBC.std().insets(25,10,0,0)); … … 86 85 all.add(saveButton,GBC.eol().insets(25,10,0,0)); 87 86 all.add(help,GBC.eop().insets(5,10,0,0)); 88 87 89 88 table.getColumnModel().getColumn(0).setPreferredWidth(150); 90 89 table.getColumnModel().getColumn(0).setMaxWidth(300); … … 99 98 if (row<0 || column<0) return; 100 99 String data = (String)model.getValueAt(row, column); 101 if (data!=null && data.length()>0 && row==model.getRowCount()-1) 100 if (data!=null && data.length()>0 && row==model.getRowCount()-1) 102 101 model.addRow(new String[]{"",""}); 103 102 } 104 103 }); 105 104 all.add(table,GBC.eop().fill()); 106 105 107 106 pp.add(all, GBC.eol().fill(GridBagConstraints.BOTH)); 108 107 } … … 135 134 List<String> lst = readItemsFromTable(); 136 135 URLList.updateURLList(lst); 137 136 138 137 return false; 139 138 } 140 141 142 143 139 144 140 private List<String> readItemsFromTable() {
Note:
See TracChangeset
for help on using the changeset viewer.