Example #1
0
  public void paint(final Graphics g) {
    if (myTabs.isDropTarget(myInfo)) return;

    if (myTabs.getSelectedInfo() != myInfo) {
      doPaint(g);
    }
  }
Example #2
0
 void setSideTabsLimit(int sideTabsLimit) {
   if (mySideTabsLimit != sideTabsLimit) {
     mySideTabsLimit = sideTabsLimit;
     //      UIUtil.putClientProperty(myTabs, JBTabsImpl.SIDE_TABS_SIZE_LIMIT_KEY,
     // mySideTabsLimit);
     myTabs.resetLayout(true);
     myTabs.doLayout();
     myTabs.repaint();
     TabInfo info = myTabs.getSelectedInfo();
     JComponent page = info != null ? info.getComponent() : null;
     if (page != null) {
       page.revalidate();
       page.repaint();
     }
   }
 }
Example #3
0
  public void doTranslate(PairConsumer<Integer, Integer> consumer) {
    final JBTabsPosition pos = myTabs.getTabsPosition();

    int dX = 0;
    int dXs = 0;
    int dY = 0;
    int dYs = 0;
    int selected = getSelectedOffset();
    int plain = getNonSelectedOffset();

    switch (pos) {
      case bottom:
        dY = -plain;
        dYs = -selected;
        break;
      case left:
        dX = plain;
        dXs = selected;
        break;
      case right:
        dX = -plain;
        dXs = -selected;
        break;
      case top:
        dY = plain;
        dYs = selected;
        break;
    }

    if (!myTabs.isDropTarget(myInfo)) {
      if (myTabs.getSelectedInfo() != myInfo) {
        consumer.consume(dX, dY);
      } else {
        consumer.consume(dXs, dYs);
      }
    }
  }