/** * Simple constructor. * * @param slider * The associated slider. */ public TrackableSlider(JSlider slider, ButtonModel transitionModel) { this.slider = slider; this.transitionModel = transitionModel; SliderUI sliderUI = slider.getUI(); if (sliderUI instanceof BasicSliderUI) { try { this.thumbRectField = BasicSliderUI.class .getDeclaredField("thumbRect"); this.thumbRectField.setAccessible(true); } catch (Exception exc) { this.thumbRectField = null; } } this.stateTransitionTracker = new StateTransitionTracker( this.slider, this.transitionModel); }
private static Rectangle getThumbRectField() { try { SliderUI ui = slider.getUI(); Field field = BasicSliderUI.class.getDeclaredField("thumbRect"); field.setAccessible(true); return (Rectangle) field.get(ui); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Maps {@code JSlider.getUI()} through queue */ public SliderUI getUI() { return (runMapping(new MapAction<SliderUI>("getUI") { @Override public SliderUI map() { return ((JSlider) getSource()).getUI(); } })); }
/** * Maps {@code JSlider.setUI(SliderUI)} through queue */ public void setUI(final SliderUI sliderUI) { runMapping(new MapVoidAction("setUI") { @Override public void map() { ((JSlider) getSource()).setUI(sliderUI); } }); }
public SliderUI getUI() { AndroidClassUtil.callEmptyMethod(); return (SliderUI) null; }
public void setUI(SliderUI ui) { AndroidClassUtil.callEmptyMethod(); }
/** * Sets this slider's UI delegate to the default (obtained from the * {@link UIManager}) for the current look and feel. */ public void updateUI() { updateLabelUIs(); setUI((SliderUI) UIManager.getUI(this)); }
public SliderUI getUI() { return (SliderUI)ui; }
public void setUI(final SliderUI ui) { super.setUI(ui); }
public void updateUI() { setUI((SliderUI)UIManager.getUI(this)); }
/** * Returns the slider's UI delegate. * * @return The slider's UI delegate. */ public SliderUI getUI() { return (SliderUI) ui; }
/** * Sets the slider's UI delegate. * * @param ui the UI delegate. */ public void setUI(SliderUI ui) { super.setUI(ui); }