+
+ /**
+ * Returns the singleton instance of the Conservation slider within current
+ * application scope, or null if there is none
+ *
+ * @return
+ */
+ private static JInternalFrame getConservationSlider()
+ {
+ return Desktop.getInstance().conservationSlider;
+ }
+
+ /**
+ * Returns the singleton instance of the PID slider within current application
+ * scope, or null if there is none
+ *
+ * @return
+ */
+ private static JInternalFrame getPIDSlider()
+ {
+ return Desktop.getInstance().PIDSlider;
+ }
+
+ /**
+ * Returns the current value of the Conservation slider, or zero if there is
+ * no such slider
+ *
+ * @param slider
+ * @return
+ */
+ public static int getConservationValue()
+ {
+ return getValue(getConservationSlider());
+ }
+
+ /**
+ * Returns the current value of the PID slider, or zero if there is no such
+ * slider
+ *
+ * @param slider
+ * @return
+ */
+ public static int getPIDValue()
+ {
+ return getValue(getPIDSlider());
+ }
+
+ /**
+ * Returns the current value of the given slider, or zero if {@code slider} is
+ * null
+ *
+ * @param slider
+ * @return
+ */
+ static int getValue(JInternalFrame slider)
+ {
+ return slider == null ? 0
+ : ((SliderPanel) slider.getContentPane()).getValue();
+ }