Changeset 27863 in osm


Ignore:
Timestamp:
2012-02-18T18:03:10+01:00 (13 years ago)
Author:
bastik
Message:

update because of core api change: 2nd part (preferences - rev. 4968)

Location:
applications/editors/josm/plugins
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/colorscheme/build.xml

    r26605 r27863  
    1818**
    1919** To build against the core in ../../core, create a correct manifest and deploy to
    20 ** SVN, 
     20** SVN,
    2121**    set the properties commit.message and plugin.main.version
    2222** and run
     
    2727<project name="colorscheme" default="dist" basedir=".">
    2828    <property name="commit.message" value="Uses new constructor for Plugin"/>
    29     <property name="plugin.main.version" value="4394"/>
     29    <property name="plugin.main.version" value="4968"/>
    3030    <property name="josm" location="../../core/dist/josm-custom.jar"/>
    3131    <property name="plugin.dist.dir" value="../../dist"/>
     
    8787    </target>
    8888    <!--
    89      ************************** Publishing the plugin *********************************** 
     89     ************************** Publishing the plugin ***********************************
    9090    -->
    9191    <!--
    92     ** extracts the JOSM release for the JOSM version in ../core and saves it in the 
     92    ** extracts the JOSM release for the JOSM version in ../core and saves it in the
    9393    ** property ${coreversion.info.entry.revision}
    9494    **
     
    136136    </target>
    137137    <!--
    138     ** commits the plugin.jar 
     138    ** commits the plugin.jar
    139139    -->
    140140    <target name="commit-dist">
    141141        <echo>
    142142***** Properties of published ${plugin.jar} *****
    143 Commit message    : '${commit.message}'                 
     143Commit message    : '${commit.message}'
    144144Plugin-Mainversion: ${plugin.main.version}
    145145JOSM build version: ${coreversion.info.entry.revision}
    146146Plugin-Version    : ${version.entry.commit.revision}
    147 ***** / Properties of published ${plugin.jar} *****                 
    148                    
     147***** / Properties of published ${plugin.jar} *****
     148
    149149Now commiting ${plugin.jar} ...
    150150</echo>
  • applications/editors/josm/plugins/colorscheme/src/at/dallermassl/josm/plugin/colorscheme/ColorSchemePreference.java

    r21563 r27863  
    2828
    2929import org.openstreetmap.josm.Main;
    30 import org.openstreetmap.josm.gui.preferences.ColorPreference;
     30import org.openstreetmap.josm.gui.preferences.display.ColorPreference;
    3131import org.openstreetmap.josm.gui.preferences.PreferenceDialog;
    3232import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
    3333import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     34import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting;
     35import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting;
    3436import org.openstreetmap.josm.tools.GBC;
    3537
    36 public class ColorSchemePreference implements PreferenceSetting {
     38public class ColorSchemePreference implements SubPreferenceSetting {
    3739    private static final String PREF_KEY_SCHEMES_PREFIX = "colorschemes.";
    3840    private static final String PREF_KEY_SCHEMES_NAMES = PREF_KEY_SCHEMES_PREFIX + "names";
     
    5355     * @see org.openstreetmap.josm.gui.preferences.PreferenceSetting#addGui(org.openstreetmap.josm.gui.preferences.PreferenceDialog)
    5456     */
     57    @Override
    5558    public void addGui(final PreferenceTabbedPane gui) {
    5659        JPanel panel = new JPanel(new GridBagLayout());
     
    125128        JScrollPane scrollpane = new JScrollPane(panel);
    126129        scrollpane.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0 ));
    127         gui.displaycontent.addTab(tr("Color Schemes"), scrollpane);
     130        gui.getDisplayPreference().displaycontent.addTab(tr("Color Schemes"), scrollpane);
     131    }
     132
     133    @Override
     134    public TabPreferenceSetting getTabPreferenceSetting(final PreferenceTabbedPane gui) {
     135        return gui.getDisplayPreference();
    128136    }
    129137
     
    141149    }
    142150
     151    @Override
    143152    public boolean ok() {
    144153        return false;// nothing to do
     154    }
     155
     156    @Override
     157    public boolean isExpert() {
     158        return false;
    145159    }
    146160
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/Preferences.java

    r19347 r27863  
    55
    66import org.openstreetmap.josm.Main;
    7 import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
     7import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
    88import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    99/**
     
    1111 * @author radek
    1212 */
    13 public class Preferences extends javax.swing.JPanel implements PreferenceSetting {
     13public class Preferences extends DefaultTabPreferenceSetting {
     14
     15    public JPanel thisPanel;
    1416
    1517    public int optimize;
     
    3840    /** Creates new form Preferences */
    3941    private Preferences() {
     42        super("czech_flag",
     43                "Nastavení CzechAddressPlugin",
     44                "Nastavení pluginu pro úpravu a zadávání adres na území ČR.");
     45        thisPanel = new JPanel();
    4046        initComponents();
    4147        addBuildingTag = Main.pref.getBoolean(KEY_BUILDINGTAG,    buildingCheckBox.isSelected());
     
    7379        buildingCheckBox = new javax.swing.JCheckBox();
    7480
    75         setLayout(new java.awt.GridLayout(1, 0));
     81        thisPanel.setLayout(new java.awt.GridLayout(1, 0));
    7682
    7783        addNewTagCheckBox.setText("Novým primitivám přidávat tag:");
     
    153159        );
    154160
    155         add(mainPanel);
     161        thisPanel.add(mainPanel);
    156162    }// </editor-fold>//GEN-END:initComponents
    157163
     
    174180
    175181    public void addGui(PreferenceTabbedPane gui) {
    176         JPanel p = gui.createPreferenceTab("czech_flag",
    177                 "Nastavení CzechAddressPlugin",
    178                 "Nastavení pluginu pro úpravu a zadávání adres na území ČR.");
     182        JPanel p = gui.createPreferenceTab(this);
    179183        p.add(mainPanel);
    180184        reloadSettings();
  • applications/editors/josm/plugins/ext_tools/src/ext_tools/preferences/ExtToolsPreference.java

    r21930 r27863  
    88import javax.swing.JScrollPane;
    99
    10 import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
     10import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
    1111import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    1212import org.openstreetmap.josm.tools.GBC;
     
    1414import ext_tools.ExtToolsPlugin;
    1515
    16 public class ExtToolsPreference implements PreferenceSetting {
     16public class ExtToolsPreference extends DefaultTabPreferenceSetting {
    1717
    1818    ExtToolsPlugin plugin;
    1919
    2020    public ExtToolsPreference(ExtToolsPlugin plugin) {
     21        super("ext", tr("External tools"), tr("Use external scripts in JOSM"));
    2122        this.plugin = plugin;
    2223    }
     
    2425    @Override
    2526    public void addGui(PreferenceTabbedPane gui) {
    26         JPanel p = gui.createPreferenceTab("ext", tr("External tools"),
    27                 tr("Use external scripts in JOSM"));
     27        JPanel p = gui.createPreferenceTab(this);
    2828        MyToolsPanel tp = new MyToolsPanel(plugin.myTools);
    2929        tp.refresh();
  • applications/editors/josm/plugins/graphview/build.xml

    r26990 r27863  
    2727<project name="graphview" default="dist" basedir=".">
    2828    <property name="commit.message" value="option to change graph colors; closes ticket 5523 in JOSM Trac"/>
    29     <property name="plugin.main.version" value="4549"/>
     29    <property name="plugin.main.version" value="4968"/>
    3030    <property name="josm" location="../../core/dist/josm-custom.jar"/>
    3131    <property name="plugin.build.dir" value="build"/>
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewPreferenceEditor.java

    r26481 r27863  
    3636import javax.swing.event.ChangeListener;
    3737
    38 import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
     38import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
    3939import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    4040import org.openstreetmap.josm.plugins.graphview.plugin.dialogs.AccessParameterDialog.BookmarkAction;
     
    4545import org.openstreetmap.josm.tools.GBC;
    4646
    47 public class GraphViewPreferenceEditor implements PreferenceSetting {
     47public class GraphViewPreferenceEditor extends DefaultTabPreferenceSetting {
    4848
    4949    private File rulesetFolder;
     
    7171    private JPanel arrowPreviewPanel;
    7272
     73    public GraphViewPreferenceEditor() {
     74        super("graphview", tr("Graphview"),
     75                tr("Settings for the Graphview plugin that visualizes routing graphs."));
     76    }
     77
    7378    public void addGui(PreferenceTabbedPane gui) {
    7479
    7580        readPreferences();
    7681
    77         preferencePanel = gui.createPreferenceTab("graphview", tr("Graphview"),
    78         tr("Settings for the Graphview plugin that visualizes routing graphs."));
     82        preferencePanel = gui.createPreferenceTab(this);
    7983
    8084        JPanel mainPanel = createMainPanel();
  • applications/editors/josm/plugins/imagery-xml-bounds/build.xml

    r27015 r27863  
    3232    <property name="commit.message" value="Commit message"/>
    3333    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    34     <property name="plugin.main.version" value="4577"/>
     34    <property name="plugin.main.version" value="4987"/>
    3535    <!-- should not be necessary to change the following properties -->
    3636    <property name="josm" location="../../core/dist/josm-custom.jar"/>
     
    150150    </target>
    151151    <!--
    152     ************************** Publishing the plugin *********************************** 
    153     -->
    154     <!--
    155     ** extracts the JOSM release for the JOSM version in ../core and saves it in the 
     152    ************************** Publishing the plugin ***********************************
     153    -->
     154    <!--
     155    ** extracts the JOSM release for the JOSM version in ../core and saves it in the
    156156    ** property ${coreversion.info.entry.revision}
    157157    -->
     
    197197        <echo>
    198198    ***** Properties of published ${plugin.jar} *****
    199     Commit message    : '${commit.message}'                   
     199    Commit message    : '${commit.message}'
    200200    Plugin-Mainversion: ${plugin.main.version}
    201201    JOSM build version: ${coreversion.info.entry.revision}
    202202    Plugin-Version    : ${version.entry.commit.revision}
    203     ***** / Properties of published ${plugin.jar} *****                   
    204                        
     203    ***** / Properties of published ${plugin.jar} *****
     204
    205205    Now commiting ${plugin.jar} ...
    206206    </echo>
  • applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/XmlBoundsPreferenceSetting.java

    r27015 r27863  
    1818import javax.swing.JButton;
    1919
    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;
     20import org.openstreetmap.josm.gui.preferences.imagery.ImageryPreference;
     21import org.openstreetmap.josm.gui.preferences.imagery.ImageryPreference.ImageryProvidersPanel;
     22import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting;
     23import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting;
    2324import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    2425import org.openstreetmap.josm.plugins.imageryxmlbounds.actions.EditEntriesAction;
    2526
    2627/**
    27  * 
     28 *
    2829 * @author Don-vip
    2930 *
    3031 */
    31 public class XmlBoundsPreferenceSetting implements PreferenceSetting {
     32public class XmlBoundsPreferenceSetting implements SubPreferenceSetting {
    3233
    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    }
    4540
    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
    5055}
  • applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/EditEntriesAction.java

    r27015 r27863  
    3030import org.openstreetmap.josm.actions.JosmAction;
    3131import org.openstreetmap.josm.data.imagery.ImageryInfo;
    32 import org.openstreetmap.josm.gui.preferences.ImageryPreference.ImageryProvidersPanel.ImageryDefaultLayerTableModel;
     32import org.openstreetmap.josm.gui.preferences.imagery.ImageryPreference.ImageryProvidersPanel.ImageryDefaultLayerTableModel;
    3333import org.openstreetmap.josm.plugins.imageryxmlbounds.XmlBoundsConstants;
    3434import org.openstreetmap.josm.plugins.imageryxmlbounds.XmlBoundsLayer;
     
    3939
    4040        protected static final String ACTION_NAME = tr("Edit");
    41        
     41
    4242        private final JTable defaultTable;
    4343        private final ImageryDefaultLayerTableModel defaultModel;
    44        
     44
    4545        private final List<ImageryInfo> entries;
    46        
     46
    4747        public EditEntriesAction(JTable defaultTable, ImageryDefaultLayerTableModel defaultModel) {
    4848        putValue(SHORT_DESCRIPTION, tr("edit bounds for selected defaults"));
     
    5959        setEnabled(false);
    6060        }
    61        
     61
    6262        @Override
    6363        public void actionPerformed(ActionEvent e) {
     
    8383                        entries.clear();
    8484                        for (int row : defaultTable.getSelectedRows()) {
    85                                 ImageryInfo info = defaultModel.getRow(row); 
     85                                ImageryInfo info = defaultModel.getRow(row);
    8686                                if (info != null && info.getBounds() != null) {
    8787                                        entries.add(info);
  • applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPreferences.java

    r19624 r27863  
    1111
    1212import org.openstreetmap.josm.Main;
    13 import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
     13import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
    1414import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    1515import org.openstreetmap.josm.tools.GBC;
    1616import org.openstreetmap.josm.tools.I18n;
    1717
    18 public class LakewalkerPreferences implements PreferenceSetting {
     18public class LakewalkerPreferences extends DefaultTabPreferenceSetting {
    1919    public static final String[] DIRECTIONS = new String[]
    2020    {marktr("east"), marktr("northeast"), marktr("north"), marktr("northwest"),
     
    6868    protected JLabel sourceLabel = new JLabel(tr("Source text"));
    6969
     70    public LakewalkerPreferences() {
     71        super("lakewalker.png", I18n.tr("Lakewalker Plugin Preferences"), tr("A plugin to trace water bodies on Landsat imagery."));
     72    }
     73
    7074    public void addGui(PreferenceTabbedPane gui) {
    7175        maxSegsConfig.setToolTipText(tr("Maximum number of segments allowed in each generated way. Default 250."));
     
    8589
    8690        String description = tr("A plugin to trace water bodies on Landsat imagery.");
    87         JPanel prefPanel = gui.createPreferenceTab("lakewalker.png", I18n.tr("Lakewalker Plugin Preferences"), description);
     91        JPanel prefPanel = gui.createPreferenceTab(this);
    8892        buildPreferences(prefPanel);
    8993
Note: See TracChangeset for help on using the changeset viewer.