/** * Link a emitter configurable range to a value panel * * @param range The configurable range from the emitter * @param panel The component to link against */ private void link(Range range, MinMaxPanel panel) { controlToData.put(panel, range); panel.setMax((int) range.getMax()); panel.setMin((int) range.getMin()); panel.setEnabledValue(range.isEnabled()); }
/** * @see org.newdawn.slick.tools.peditor.InputPanelListener#minMaxUpdated(org.newdawn.slick.tools.peditor.MinMaxPanel) */ public void minMaxUpdated(MinMaxPanel source) { if (emitter == null) { return; } Range range = (Range) controlToData.get(source); if (range != null) { range.setMax(source.getMax()); range.setMin(source.getMin()); range.setEnabled(source.getEnabled()); } else { throw new RuntimeException("No data set specified for the GUI source"); } }
/** * Link a emitter configurable range to a named component * * @param range The configurable range from the emitter * @param name The name of the component to link to */ protected void link(Range range, String name) { link(range, (MinMaxPanel) named.get(name)); }