Author: pmouawad Date: Thu Dec 7 21:36:17 2017 New Revision: 1817427 URL: http://svn.apache.org/viewvc?rev=1817427&view=rev Log: Fixed about dialog position on first view Contributed by Graham Russell This closes #351 Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/AboutCommand.java jmeter/trunk/xdocs/changes.xml Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/AboutCommand.java URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/action/AboutCommand.java?rev=1817427&r1=1817426&r2=1817427&view=diff ============================================================================== --- jmeter/trunk/src/core/org/apache/jmeter/gui/action/AboutCommand.java (original) +++ jmeter/trunk/src/core/org/apache/jmeter/gui/action/AboutCommand.java Thu Dec 7 21:36:17 2017 @@ -82,7 +82,7 @@ public class AboutCommand extends Abstra * the product image and the copyright notice. The dialog box is centered * over the MainFrame. */ - void about() { + private void about() { JFrame mainFrame = GuiPackage.getInstance().getMainFrame(); JDialog dialog = initDialog(mainFrame); @@ -91,7 +91,6 @@ public class AboutCommand extends Abstra Dimension d1 = mainFrame.getSize(); Dimension d2 = dialog.getSize(); dialog.setLocation(p.x + (d1.width - d2.width) / 2, p.y + (d1.height - d2.height) / 2); - dialog.pack(); dialog.setVisible(true); } @@ -99,44 +98,46 @@ public class AboutCommand extends Abstra * @param mainFrame {@link JFrame} * @return {@link JDialog} initializing it if necessary */ - private static final JDialog initDialog(JFrame mainFrame) { - if (about == null) { - about = new EscapeDialog(mainFrame, "About Apache JMeter...", false); - about.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - about.setVisible(false); - } - }); + private JDialog initDialog(JFrame mainFrame) { + if (about != null) { + return about; + } + about = new EscapeDialog(mainFrame, "About Apache JMeter", false); + about.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + about.setVisible(false); + } + }); - JLabel jmeter = new JLabel(JMeterUtils.getImage("jmeter.png")); - JLabel copyright = new JLabel(JMeterUtils.getJMeterCopyright(), SwingConstants.CENTER); - JLabel rights = new JLabel("All Rights Reserved.", SwingConstants.CENTER); - JLabel version = new JLabel("Apache JMeter Version " + JMeterUtils.getJMeterVersion(), SwingConstants.CENTER); - JLabel releaseNotes = new JLabel("Release notes", SwingConstants.CENTER); - releaseNotes.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - if (e.getClickCount() > 0) { - ActionRouter.getInstance().doActionNow( - new ActionEvent(e.getSource(), e.getID(), ActionNames.LINK_RELEASE_NOTES)); - } + JLabel jmeterLogo = new JLabel(JMeterUtils.getImage("jmeter.png")); + JLabel copyright = new JLabel(JMeterUtils.getJMeterCopyright(), SwingConstants.CENTER); + JLabel rights = new JLabel("All Rights Reserved.", SwingConstants.CENTER); + JLabel version = new JLabel("Apache JMeter Version " + JMeterUtils.getJMeterVersion(), SwingConstants.CENTER); + JLabel releaseNotes = new JLabel("Release notes", SwingConstants.CENTER); + releaseNotes.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + if (e.getClickCount() > 0) { + ActionRouter.getInstance().doActionNow( + new ActionEvent(e.getSource(), e.getID(), ActionNames.LINK_RELEASE_NOTES)); } - }); - JPanel infos = new JPanel(); - infos.setOpaque(false); - infos.setLayout(new GridLayout(0, 1)); - infos.setBorder(new EmptyBorder(5, 5, 5, 5)); - infos.add(copyright); - infos.add(rights); - infos.add(version); - infos.add(releaseNotes); - Container panel = about.getContentPane(); - panel.setLayout(new BorderLayout()); - panel.setBackground(Color.white); - panel.add(jmeter, BorderLayout.NORTH); - panel.add(infos, BorderLayout.SOUTH); - } + } + }); + JPanel infos = new JPanel(); + infos.setOpaque(false); + infos.setLayout(new GridLayout(0, 1)); + infos.setBorder(new EmptyBorder(5, 5, 5, 5)); + infos.add(copyright); + infos.add(rights); + infos.add(version); + infos.add(releaseNotes); + Container panel = about.getContentPane(); + panel.setLayout(new BorderLayout()); + panel.setBackground(Color.white); + panel.add(jmeterLogo, BorderLayout.NORTH); + panel.add(infos, BorderLayout.SOUTH); + about.pack(); return about; } } Modified: jmeter/trunk/xdocs/changes.xml URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1817427&r1=1817426&r2=1817427&view=diff ============================================================================== --- jmeter/trunk/xdocs/changes.xml [utf-8] (original) +++ jmeter/trunk/xdocs/changes.xml [utf-8] Thu Dec 7 21:36:17 2017 @@ -181,7 +181,8 @@ Summary
  • 61785Add HelpUseful links to create issues and download nightly build
  • 61808Fix main frame position. Implemented by Artem Fedorov (artem at blazemeter.com) and contributed by BlazeMeter Ltd.
  • 61802Loop / ForEach Controller should expose a variable for current iteration. Contributed by Ubik Load Pack (support at ubikloadpack.com)
  • -
  • 349Add i18n resouces(zh_CN). Contributed by Helly Guo (https://github.com/hellyguo)
  • +
  • 349 Add i18n resouces(zh_CN). Contributed by Helly Guo (https://github.com/hellyguo)
  • +
  • 351 Fixed about dialog position on first view. Contributed by Graham Russell (graham at ham1.co.uk)
  • Non-functional changes @@ -202,7 +203,7 @@ Summary
  • 334Enable running of JUnit tests from within IntelliJ with default config. Contributed by Graham Russell (graham at ham1.co.uk)
  • 335Removed functions.util.* as they don't seem to be used (for many years). Contributed by Graham Russell (graham at ham1.co.uk)
  • 61867345Updated to latest checkstyle (v8.5), Added many more rules to checkstyle, Included checking of test files and more file types. Contributed by Graham Russell (graham at ham1.co.uk)
  • -
  • 350 Parallelised unit tests
  • +
  • 350 Parallelised unit tests. Contributed by Graham Russell (graham at ham1.co.uk)