/** * If dragger is not null it is messaged with completeDrag. */ @Override public void mouseReleased(MouseEvent e) { if (_dragger != null) { if (e.getSource() == _jideSplitPane) { _dragger.completeDrag(e.getX(), e.getY()); } else if (e.getSource() == JideSplitPaneDivider.this) { Point ourLoc = getLocation(); _dragger.completeDrag(e.getX() + ourLoc.x, e.getY() + ourLoc.y); } _dragger = null; e.consume(); } }
/** * If dragger is not null it is messaged with continueDrag. */ @Override public void mouseDragged(MouseEvent e) { if (_dragger != null) { if (e.getSource() == _jideSplitPane) { _dragger.continueDrag(e.getX(), e.getY()); } else if (e.getSource() == JideSplitPaneDivider.this) { Point ourLoc = getLocation(); _dragger.continueDrag(e.getX() + ourLoc.x, e.getY() + ourLoc.y); } e.consume(); } } }
/** * Starts the dragging session by creating the appropriate instance of DragController. */ @Override public void mousePressed(MouseEvent e) { if ((e.getSource() == JideSplitPaneDivider.this/*|| e.getSource() == _jideSplitPane*/) && _dragger == null && _jideSplitPane.isEnabled() && _jideSplitPane.isDragResizable()) { if (getFirstComponent(true) != null && getSecondComponent(true) != null) { if (_orientation == JideSplitPane.HORIZONTAL_SPLIT) { _dragger = new DragController(e); } else { _dragger = new VerticalDragController(e); } if (!_dragger.isValid()) { _dragger = null; } else { prepareForDragging(); _dragger.continueDrag(e); } } e.consume(); } }
protected void completeDrag(int x, int y) { finishDraggingTo(getNeededLocation(x, y)); }
protected void continueDrag(int newX, int newY) { dragDividerTo(getNeededLocation(newX, newY)); }
/** * Messages finishDraggingTo with the new location for the mouse event. * * @param e the mouse event. */ protected void completeDrag(MouseEvent e) { finishDraggingTo(positionForMouseEvent(e)); } } // End of BasicJideSplitPaneDivider.DragController
/** * Messages dragDividerTo with the new location for the mouse event. * * @param e the mouse event. */ protected void continueDrag(MouseEvent e) { dragDividerTo(positionForMouseEvent(e)); }