模块 java.desktop

类 BasicSplitPaneDivider.DragController

java.lang.Object
javax.swing.plaf.basic.BasicSplitPaneDivider.DragController
已知子类:
BasicSplitPaneDivider.VerticalDragController
封闭类:
BasicSplitPaneDivider

protected class BasicSplitPaneDivider.DragController extends Object
在面向 HORIZONTAL_SPLIT 的拆分窗格的拖动会话期间处理事件。这会不断地向 dragDividerTo 发送消息,然后在完成后向 finishDraggingTo 发送消息。创建实例时,应使用 isValid 向其发送消息,以确保可以进行拖动(如果无法调整两个视图的大小,则不允许拖动)。

Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans 包中。请参阅 XMLEncoder

  • 构造方法详细信息

    • DragController

      protected DragController(MouseEvent  e)
      构造一个 DragController 新实例
      参数:
      e - 鼠标事件
  • 方法详情

    • isValid

      protected boolean isValid()
      如果拖动会话有效,则返回 true
      返回:
      true 如果拖动会话有效
    • positionForMouseEvent

      protected int positionForMouseEvent(MouseEvent  e)
      根据传入的 MouseEvent 返回放置分隔线的新位置。
      参数:
      e - 鼠标事件
      返回:
      新职位
    • getNeededLocation

      protected int getNeededLocation(int x, int y)
      返回 x 参数,因为它用于水平分割。
      参数:
      x - X 坐标
      y - Y 坐标
      返回:
      X 参数
    • continueDrag

      protected void continueDrag(int newX, int newY)
      使用鼠标事件的新位置向 dragDividerTo 发送消息。
      参数:
      newX - X 坐标
      newY - Y 坐标
    • continueDrag

      protected void continueDrag(MouseEvent  e)
      使用鼠标事件的新位置向 dragDividerTo 发送消息。
      参数:
      e - 鼠标事件
    • completeDrag

      protected void completeDrag(int x, int y)
      带有鼠标事件新位置的消息 finishDraggingTo。
      参数:
      x - X 坐标
      y - Y 坐标
    • completeDrag

      protected void completeDrag(MouseEvent  e)
      带有鼠标事件新位置的消息 finishDraggingTo。
      参数:
      e - 鼠标事件