Class TabDndController


  • public class TabDndController
    extends java.lang.Object
    • Field Detail

      • dragTabIndex

        protected int dragTabIndex
      • drawGhost

        protected boolean drawGhost
      • paintScrollTriggerAreas

        protected boolean paintScrollTriggerAreas
      • rectBackward

        protected java.awt.Rectangle rectBackward
      • rectForward

        protected java.awt.Rectangle rectForward
    • Method Detail

      • isHorizontalTabPlacement

        public static boolean isHorizontalTabPlacement​(int tabPlacement)
      • scrollIfNeeded

        public void scrollIfNeeded​(java.awt.Point glassPt)
        Check if dragging near edges and scroll to according direction through programmatically clicking system's scroll buttons.
        Parameters:
        glassPt - Cursor position in TabbedPane coordinates.
      • getTargetTabIndex

        protected int getTargetTabIndex​(java.awt.Point glassPt)
        Finds the tab index by cursor position. If tabs first half contains the point, then its index is returned. Second half means inserting at next index.
        Parameters:
        glassPt - Cursor position in TabbedPane coordinates.
        Returns:
        Tab index.
      • swapTabs

        protected void swapTabs​(int oldIdx,
                                int newIdx)
      • updateTargetMark

        protected void updateTargetMark​(int tabIdx)
      • initGlassPane

        protected void initGlassPane​(java.awt.Point tabPt)
      • getTabAreaBounds

        protected java.awt.Rectangle getTabAreaBounds()
      • onPaintGlassPane

        public void onPaintGlassPane​(java.awt.Graphics2D g)
      • onStartDrag

        public boolean onStartDrag​(java.awt.Point pt)
      • loadSettings

        public void loadSettings()
      • isDragging

        public boolean isDragging()
      • setDragging

        public void setDragging​(boolean dragging)