List of usage examples for javax.swing JButton getX
@BeanProperty(bound = false) public int getX()
From source file:org.rdv.ui.TimeSlider.java
/** * Called when the mouse is dragged. This deals dragging the time value and * range controls.// w ww . ja v a2 s . c om * * @param me the mosue event that triggered this */ public void mouseDragged(MouseEvent me) { if (!isEnabled()) { return; } JButton button = (JButton) me.getSource(); int x = me.getX(); if (button == startButton) { x += endButton.getWidth() - clickStart; } else if (button == valueButton) { x += Math.round(valueButton.getWidth() / 2d) - clickStart; } else if (button == endButton) { x -= clickStart; } double time = getTimeFromX(button.getX() + x); if (button == startButton) { if (time < minimum) { time = minimum; } else if (time >= end) { time = end; } setStart(time); } else if (button == valueButton) { if (rangeChangeable) { if (time < start) { time = start; } else if (time > end) { time = end; } } else { if (time < minimum) { time = minimum; } else if (time > maximum) { time = maximum; } } setValue(time); } else if (button == endButton) { if (time < start) { time = start; } else if (time > maximum) { time = maximum; } setEnd(time); } }