- return new jalview.io.JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
- { "eps" }, new String[]
- { "Encapsulated Postscript" }, "Encapsulated Postscript");
+ if (scaleS == null && widthS == null && heightS == null)
+ {
+ // if all items are null (i.e. not provided) we use the dynamic
+ // preferences set BIS
+ return BitmapImageSizing.defaultBitmapImageSizing();
+ }
+
+ float scale = 0.0f;
+ int width = 0;
+ int height = 0;
+
+ if (scaleS != null)
+ {
+ try
+ {
+ scale = Float.parseFloat(scaleS);
+ } catch (NumberFormatException e)
+ {
+ Console.warn("Did not understand scale '" + scaleS
+ + "', won't be used.");
+ }
+ }
+ if (widthS != null)
+ {
+ try
+ {
+ width = Integer.parseInt(widthS);
+ } catch (NumberFormatException e)
+ {
+ Console.warn("Did not understand width '" + widthS
+ + "', won't be used.");
+ }
+ }
+ if (heightS != null)
+ {
+ try
+ {
+ height = Integer.parseInt(heightS);
+ } catch (NumberFormatException e)
+ {
+ Console.warn("Did not understand height '" + heightS
+ + "', won't be used.");
+ }
+ }
+
+ return new BitmapImageSizing(scale, width, height, false);