jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From milam...@apache.org
Subject svn commit: r1656219 - in /jmeter/trunk: ./ bin/ docs/images/screenshots/ src/core/org/apache/jmeter/gui/util/ src/core/org/apache/jmeter/images/toolbar/ src/core/org/apache/jmeter/images/toolbar/22x22/ src/core/org/apache/jmeter/images/toolbar/32x32/ ...
Date Sat, 31 Jan 2015 17:43:55 GMT
Author: milamber
Date: Sat Jan 31 17:43:54 2015
New Revision: 1656219

URL: http://svn.apache.org/r1656219
Log:
Icons for toolbar with several sizes
Bugzilla Id: 57518

Added:
    jmeter/trunk/docs/images/screenshots/icons-22x22.jpg   (with props)
    jmeter/trunk/docs/images/screenshots/icons-32x32.jpg   (with props)
    jmeter/trunk/docs/images/screenshots/icons-48x48.jpg   (with props)
    jmeter/trunk/src/core/org/apache/jmeter/images/toolbar/22x22/
    jmeter/trunk/src/core/org/apache/jmeter/images/toolbar/32x32/
    jmeter/trunk/src/core/org/apache/jmeter/images/toolbar/48x48/
    jmeter/trunk/src/core/org/apache/jmeter/images/toolbar/icons-custom/
    jmeter/trunk/xdocs/images/screenshots/icons-22x22.jpg   (with props)
    jmeter/trunk/xdocs/images/screenshots/icons-32x32.jpg   (with props)
    jmeter/trunk/xdocs/images/screenshots/icons-48x48.jpg   (with props)
Modified:
    jmeter/trunk/bin/jmeter.properties
    jmeter/trunk/build.xml
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/IconToolbarBean.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterToolBar.java
    jmeter/trunk/src/core/org/apache/jmeter/images/toolbar/icons-toolbar.properties
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/usermanual/hints_and_tips.xml

Modified: jmeter/trunk/bin/jmeter.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/jmeter.properties?rev=1656219&r1=1656218&r2=1656219&view=diff
==============================================================================
--- jmeter/trunk/bin/jmeter.properties (original)
+++ jmeter/trunk/bin/jmeter.properties Sat Jan 31 17:43:54 2015
@@ -150,6 +150,8 @@ jmeter.laf.mac=System
 #jmeter.toolbar.icons=org/apache/jmeter/images/toolbar/icons-toolbar.properties
 # Toolbar list
 #jmeter.toolbar=new,open,close,save,save_as_testplan,|,cut,copy,paste,|,expand,collapse,toggle,|,test_start,test_stop,test_shutdown,|,test_start_remote_all,test_stop_remote_all,test_shutdown_remote_all,|,test_clear,test_clear_all,|,search,search_reset,|,function_helper,help
+# Toolbar icons default size: 22x22. Available sizes are: 22x22, 32x33, 48x48
+#jmeter.toolbar.icons.size=22x22
 
 # Icon definitions
 # default:

Modified: jmeter/trunk/build.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/build.xml?rev=1656219&r1=1656218&r2=1656219&view=diff
==============================================================================
--- jmeter/trunk/build.xml (original)
+++ jmeter/trunk/build.xml Sat Jan 31 17:43:54 2015
@@ -965,7 +965,7 @@ run JMeter unless all the JMeter jars ar
       <fileset dir="${build.core}" includes="**/*.class"
         excludes="**/BeanShellClient*.class,**/NewDriver*,**/DynamicClassLoader*"/>
       <fileset dir="${src.core}" includes="org/apache/jmeter/images/**"
-        excludes="**/*.properties"/>
+        excludes="**/*.properties,org/apache/jmeter/images/toolbar/icons-custom/**"/>
       <fileset dir="${src.core}" includes="**/*.properties">
         <exclude name="*eucJP*"/>
       </fileset>

Added: jmeter/trunk/docs/images/screenshots/icons-22x22.jpg
URL: http://svn.apache.org/viewvc/jmeter/trunk/docs/images/screenshots/icons-22x22.jpg?rev=1656219&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jmeter/trunk/docs/images/screenshots/icons-22x22.jpg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Added: jmeter/trunk/docs/images/screenshots/icons-32x32.jpg
URL: http://svn.apache.org/viewvc/jmeter/trunk/docs/images/screenshots/icons-32x32.jpg?rev=1656219&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jmeter/trunk/docs/images/screenshots/icons-32x32.jpg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Added: jmeter/trunk/docs/images/screenshots/icons-48x48.jpg
URL: http://svn.apache.org/viewvc/jmeter/trunk/docs/images/screenshots/icons-48x48.jpg?rev=1656219&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jmeter/trunk/docs/images/screenshots/icons-48x48.jpg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/util/IconToolbarBean.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/util/IconToolbarBean.java?rev=1656219&r1=1656218&r2=1656219&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/util/IconToolbarBean.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/util/IconToolbarBean.java Sat Jan 31 17:43:54
2015
@@ -42,7 +42,7 @@ public final class IconToolbarBean {
      * @param strToSplit - the line value (i18n key, ActionNames ID, icon path, optional
icon pressed path)
      * @throws JMeterException if error in parsing.
      */
-    IconToolbarBean(final String strToSplit) throws IllegalArgumentException {
+    IconToolbarBean(final String strToSplit, final String iconSize) throws IllegalArgumentException
{
         if (strToSplit == null) {
             throw new IllegalArgumentException("Icon definition must not be null"); //$NON-NLS-1$
         }
@@ -50,8 +50,8 @@ public final class IconToolbarBean {
         if (tmp.length > 2) {
             this.i18nKey = tmp[0];
             this.actionName = tmp[1];
-            this.iconPath = tmp[2];
-            this.iconPathPressed = (tmp.length > 3) ? tmp[3] : tmp[2];
+            this.iconPath = tmp[2].replace("<SIZE>", iconSize); //$NON-NLS-1$
+            this.iconPathPressed = (tmp.length > 3) ? tmp[3].replace("<SIZE>", iconSize)
: this.iconPath; //$NON-NLS-1$
         } else {
             throw new IllegalArgumentException("Incorrect argument format - expected at least
2 fields separated by " + ICON_FIELD_SEP);
         }

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterToolBar.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterToolBar.java?rev=1656219&r1=1656218&r2=1656219&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterToolBar.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterToolBar.java Sat Jan 31 17:43:54
2015
@@ -61,6 +61,10 @@ public class JMeterToolBar extends JTool
     protected static final String DEFAULT_TOOLBAR_PROPERTY_FILE = "org/apache/jmeter/images/toolbar/icons-toolbar.properties";
//$NON-NLS-1$
 
     protected static final String USER_DEFINED_TOOLBAR_PROPERTY_FILE = "jmeter.toolbar.icons";
//$NON-NLS-1$
+
+    protected static final String TOOLBAR_ICON_SIZE = "jmeter.toolbar.icons.size"; //$NON-NLS-1$
+
+    protected static final String DEFAULT_TOOLBAR_ICON_SIZE = "22x22"; //$NON-NLS-1$
     
     private static final String TOOLBAR_LIST = "jmeter.toolbar";
     
@@ -93,7 +97,11 @@ public class JMeterToolBar extends JTool
                 if (iconToolbarBean == null) {
                     toolBar.addSeparator();
                 } else {
-                    toolBar.add(makeButtonItemRes(iconToolbarBean));
+                    try {
+                        toolBar.add(makeButtonItemRes(iconToolbarBean));
+                    } catch (Exception e) {
+                        log.warn(e.getMessage());
+                    }
                 }
             }
             toolBar.initButtonsState();
@@ -105,8 +113,11 @@ public class JMeterToolBar extends JTool
      * @param iconBean contains I18N key, ActionNames, icon path, optional icon path pressed
      * @return a button for toolbar
      */
-    private static JButton makeButtonItemRes(IconToolbarBean iconBean) {
+    private static JButton makeButtonItemRes(IconToolbarBean iconBean) throws Exception {
         final URL imageURL = JMeterUtils.class.getClassLoader().getResource(iconBean.getIconPath());
+        if (imageURL == null) {
+            throw new Exception("No icon for: " + iconBean.getActionName());
+        }
         JButton button = new JButton(new ImageIcon(imageURL));
         button.setToolTipText(JMeterUtils.getResString(iconBean.getI18nKey()));
         final URL imageURLPressed = JMeterUtils.class.getClassLoader().getResource(iconBean.getIconPathPressed());
@@ -150,6 +161,8 @@ public class JMeterToolBar extends JTool
         }
 
         String[] oList = order.split(TOOLBAR_ENTRY_SEP);
+        
+        String iconSize = JMeterUtils.getPropDefault(TOOLBAR_ICON_SIZE, DEFAULT_TOOLBAR_ICON_SIZE);

 
         List<IconToolbarBean> listIcons = new ArrayList<IconToolbarBean>();
         for (String key : oList) {
@@ -163,7 +176,7 @@ public class JMeterToolBar extends JTool
                     log.warn("No definition for toolbar entry: " + key);
                 } else {
                     try {
-                        IconToolbarBean itb = new IconToolbarBean(property);
+                        IconToolbarBean itb = new IconToolbarBean(property, iconSize);
                         listIcons.add(itb);
                     } catch (IllegalArgumentException e) {
                         // already reported by IconToolbarBean

Modified: jmeter/trunk/src/core/org/apache/jmeter/images/toolbar/icons-toolbar.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/images/toolbar/icons-toolbar.properties?rev=1656219&r1=1656218&r2=1656219&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/images/toolbar/icons-toolbar.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/images/toolbar/icons-toolbar.properties Sat Jan
31 17:43:54 2015
@@ -19,30 +19,31 @@ toolbar=new,templates,open,close,save,sa
 # Icon / action definition file.
 # Key:      button names
 # Value:    I18N key in messages.properties, ActionNames key field, icon path, optionally
followed by comma and then the pressed icon name
-new=new,CLOSE,org/apache/jmeter/images/toolbar/new.png
-templates=template_menu,TEMPLATES,org/apache/jmeter/images/toolbar/templates.png
-open=menu_open,OPEN,org/apache/jmeter/images/toolbar/open.png
-close=menu_close,CLOSE,org/apache/jmeter/images/toolbar/close.png
-save=save,SAVE,org/apache/jmeter/images/toolbar/save.png
-save_as_testplan=save_as,SAVE_AS,org/apache/jmeter/images/toolbar/saveastp.png
-cut=cut,CUT,org/apache/jmeter/images/toolbar/cut.png
-copy=copy,COPY,org/apache/jmeter/images/toolbar/copy.png
-paste=paste,PASTE,org/apache/jmeter/images/toolbar/paste.png
-test_start=start,ACTION_START,org/apache/jmeter/images/toolbar/start.png
-test_start_notimers=start_no_timers,ACTION_START_NO_TIMERS,org/apache/jmeter/images/toolbar/startnotimers.png
-test_stop=stop,ACTION_STOP,org/apache/jmeter/images/toolbar/stop.png
-test_shutdown=shutdown,ACTION_SHUTDOWN,org/apache/jmeter/images/toolbar/shutdown.png
-test_start_remote_all=remote_start_all,REMOTE_START_ALL,org/apache/jmeter/images/toolbar/startremoteall.png
-test_stop_remote_all=remote_stop_all,REMOTE_STOP_ALL,org/apache/jmeter/images/toolbar/stopremoteall.png
-test_shutdown_remote_all=remote_shut_all,REMOTE_SHUT_ALL,org/apache/jmeter/images/toolbar/shutdownremoteall.png
-test_clear=clear,CLEAR,org/apache/jmeter/images/toolbar/clear.png
-test_clear_all=clear_all,CLEAR_ALL,org/apache/jmeter/images/toolbar/clearall.png
-toggle=toggle,TOGGLE,org/apache/jmeter/images/toolbar/toggle.png
-expand=menu_expand_all,EXPAND_ALL,org/apache/jmeter/images/toolbar/expand.png
-collapse=menu_collapse_all,COLLAPSE_ALL,org/apache/jmeter/images/toolbar/collapse.png
-search=menu_search,SEARCH_TREE,org/apache/jmeter/images/toolbar/search.png
-search_reset=menu_search_reset,SEARCH_RESET,org/apache/jmeter/images/toolbar/searchreset.png
-function_helper=function_dialog_menu_item,FUNCTIONS,org/apache/jmeter/images/toolbar/function.png
-help=help,HELP,org/apache/jmeter/images/toolbar/help.png
-undo=undo,UNDO,org/apache/jmeter/images/toolbar/undo.png
-redo=redo,REDO,org/apache/jmeter/images/toolbar/redo.png
\ No newline at end of file
+# Special keyword "<SIZE>" for the different size of the same icon (Available sizes
are: 22x22, 32x32, 48x48)
+new=new,CLOSE,org/apache/jmeter/images/toolbar/<SIZE>/document-new-4.png
+templates=template_menu,TEMPLATES,org/apache/jmeter/images/toolbar/<SIZE>/applications-office.png
+open=menu_open,OPEN,org/apache/jmeter/images/toolbar/<SIZE>/document-open-2.png
+close=menu_close,CLOSE,org/apache/jmeter/images/toolbar/<SIZE>/document-close-4.png
+save=save,SAVE,org/apache/jmeter/images/toolbar/<SIZE>/document-save-5.png
+save_as_testplan=save_as,SAVE_AS,org/apache/jmeter/images/toolbar/<SIZE>/document-save-as-5.png
+cut=cut,CUT,org/apache/jmeter/images/toolbar/<SIZE>/edit-cut-4.png
+copy=copy,COPY,org/apache/jmeter/images/toolbar/<SIZE>/edit-copy-4.png
+paste=paste,PASTE,org/apache/jmeter/images/toolbar/<SIZE>/edit-paste-4.png
+test_start=start,ACTION_START,org/apache/jmeter/images/toolbar/<SIZE>/arrow-right-3.png
+test_start_notimers=start_no_timers,ACTION_START_NO_TIMERS,org/apache/jmeter/images/toolbar/<SIZE>/arrow-right-3-notimer.png
+test_stop=stop,ACTION_STOP,org/apache/jmeter/images/toolbar/<SIZE>/road-sign-us-stop.png
+test_shutdown=shutdown,ACTION_SHUTDOWN,org/apache/jmeter/images/toolbar/<SIZE>/process-stop-7.png
+test_start_remote_all=remote_start_all,REMOTE_START_ALL,org/apache/jmeter/images/toolbar/<SIZE>/arrow-right-3-startremoteall.png
+test_stop_remote_all=remote_stop_all,REMOTE_STOP_ALL,org/apache/jmeter/images/toolbar/<SIZE>/road-sign-us-stop-stopremoteall.png
+test_shutdown_remote_all=remote_shut_all,REMOTE_SHUT_ALL,org/apache/jmeter/images/toolbar/<SIZE>/process-stop-7-shutdownremoteall.png
+test_clear=clear,CLEAR,org/apache/jmeter/images/toolbar/<SIZE>/run-build-clean.png
+test_clear_all=clear_all,CLEAR_ALL,org/apache/jmeter/images/toolbar/<SIZE>/run-build-prune.png
+toggle=toggle,TOGGLE,org/apache/jmeter/images/toolbar/<SIZE>/color-picker-toggle.png
+expand=menu_expand_all,EXPAND_ALL,org/apache/jmeter/images/toolbar/<SIZE>/list-add-3.png
+collapse=menu_collapse_all,COLLAPSE_ALL,org/apache/jmeter/images/toolbar/<SIZE>/list-remove-3.png
+search=menu_search,SEARCH_TREE,org/apache/jmeter/images/toolbar/<SIZE>/edit-find-7.png
+search_reset=menu_search_reset,SEARCH_RESET,org/apache/jmeter/images/toolbar/<SIZE>/edit-clear-3.png
+function_helper=function_dialog_menu_item,FUNCTIONS,org/apache/jmeter/images/toolbar/<SIZE>/documentation.png
+help=help,HELP,org/apache/jmeter/images/toolbar/<SIZE>/help-contents-5.png
+undo=undo,UNDO,org/apache/jmeter/images/toolbar/<SIZE>/edit-undo-7.png
+redo=redo,REDO,org/apache/jmeter/images/toolbar/<SIZE>/edit-redo-7.png
\ No newline at end of file

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1656219&r1=1656218&r2=1656219&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sat Jan 31 17:43:54 2015
@@ -223,6 +223,7 @@ See  <bugzilla>56357</bugzilla> for deta
 
 <h3>General</h3>
 <ul>
+<li><bug>57518</bug>Icons for toolbar with several sizes</li>
 </ul>
 <ch_section>Non-functional changes</ch_section>
 <ul>

Added: jmeter/trunk/xdocs/images/screenshots/icons-22x22.jpg
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/images/screenshots/icons-22x22.jpg?rev=1656219&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jmeter/trunk/xdocs/images/screenshots/icons-22x22.jpg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Added: jmeter/trunk/xdocs/images/screenshots/icons-32x32.jpg
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/images/screenshots/icons-32x32.jpg?rev=1656219&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jmeter/trunk/xdocs/images/screenshots/icons-32x32.jpg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Added: jmeter/trunk/xdocs/images/screenshots/icons-48x48.jpg
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/images/screenshots/icons-48x48.jpg?rev=1656219&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jmeter/trunk/xdocs/images/screenshots/icons-48x48.jpg
------------------------------------------------------------------------------
    svn:mime-type = image/jpeg

Modified: jmeter/trunk/xdocs/usermanual/hints_and_tips.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/hints_and_tips.xml?rev=1656219&r1=1656218&r2=1656219&view=diff
==============================================================================
--- jmeter/trunk/xdocs/usermanual/hints_and_tips.xml (original)
+++ jmeter/trunk/xdocs/usermanual/hints_and_tips.xml Sat Jan 31 17:43:54 2015
@@ -100,7 +100,19 @@ It provides search with following option
 <figure width="596" height="328" image="searching/regexp-search-result.png">Figure
4 - Result in TreeView</figure>
 
 </subsection>
+
+<subsection name="&sect-num;.4 Toolbar icons size" anchor="toolbar">
+<description>
+    <p>
+You can change the size of icons in the toolbar using the property <pre>jmeter.toolbar.icons.size</pre>
with these values: 22x22 (default size), 32x32 or 48x48.
+    </p>
+</description>
+<figure width="296" height="95" image="icons-22x22.jpg">Icons with the size 22x22.</figure>
+<figure width="300" height="106" image="icons-32x32.jpg">Icons with the size 32x32.</figure>
+<figure width="365" height="120" image="icons-48x48.jpg">Icons with the size 48x48.</figure>
+</subsection>
 </section>
 
+
 </body>
 </document>



Mime
View raw message