Browse Source

Negative image export size check.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@451 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 18 years ago
parent
commit
29a0a556b2
  1. 6
      prism/src/userinterface/graph/GUIImageExportDialog.java

6
prism/src/userinterface/graph/GUIImageExportDialog.java

@ -154,10 +154,10 @@ public class GUIImageExportDialog extends JDialog implements DocumentListener
allPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
bottomPanel.setLayout(new java.awt.BorderLayout());
warningLabel.setText("Please enter positive integers");
warningLabel.setText("Please enter positive integers for width and height.");
warningLabel.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 5, 0, 0));
bottomPanel.add(warningLabel, java.awt.BorderLayout.CENTER);
warningLabel.getAccessibleContext().setAccessibleName("Please enter a positive integer for both width and height");
warningLabel.getAccessibleContext().setAccessibleName("Please enter a positive integer for both width and height.");
buttonPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
@ -285,7 +285,9 @@ public class GUIImageExportDialog extends JDialog implements DocumentListener
try
{
exportWidth = Integer.parseInt(widthInputField.getText());
if (exportWidth <= 0) throw new NumberFormatException();
exportHeight = Integer.parseInt(heightInputField.getText());
if (exportHeight <= 0) throw new NumberFormatException();
GUIImageExportDialog.this.warningLabel.setVisible(false);
GUIImageExportDialog.this.okayButton.setEnabled(true);
}

Loading…
Cancel
Save