diff --git a/plugins/ScreenPanel4.java b/plugins/ScreenPanel4.java index 0ff161e..171873f 100644 --- a/plugins/ScreenPanel4.java +++ b/plugins/ScreenPanel4.java @@ -170,13 +170,20 @@ public class ScreenPanel4 extends Panel { public double colormapMax; public Colormap colormap; public boolean colormapLogarithmic; + + String getFile() { + if (camera == null) { + return null; + } + return getContext().getSetup().expandPath("{context}/screen_panel/" + cameraName + ".properties"); + } } void loadCameraState() { if (persistCameraState) { try { CameraState state = new CameraState(); - state.load(getCameraConfigFile()); + state.load(state.getFile()); if (state.valid) { buttonSidePanel.setSelected(state.showSidePanel); buttonSidePanelActionPerformed(null); @@ -229,7 +236,7 @@ public class ScreenPanel4 extends Panel { state.showScale = buttonScale.isSelected(); state.showTitle = buttonTitle.isSelected(); - state.save(getCameraConfigFile()); + state.save(state.getFile()); } catch (Exception ex) { ex.printStackTrace(); } @@ -742,13 +749,6 @@ public class ScreenPanel4 extends Panel { super.onStop(); } - String getCameraConfigFile() { - if (camera == null) { - return null; - } - return getContext().getSetup().expandPath("{context}/screen_panel/" + camera.getName() + ".properties"); - } - //Overridable callbacks @Override public void onInitialize(int runCount) {