Ejemplo n.º 1
0
    /** Uninstall our custom defaults. */
    protected void uninstallDefaults() {
      super.uninstallDefaults();

      bgColor = null;
      bgActiveColor = null;
      bgHoverColor = null;
    }
Ejemplo n.º 2
0
 @Override
 protected void installDefaults() {
   super.installDefaults();
   // TO DO needs code to compenstae for applications name
   tabAreaInsets.left = 140;
   tabInsets = new Insets(10, 20, 0, 20);
   tabAreaInsets.top = 5;
 }
 @Override
 protected void installDefaults() {
   UIManager.put("TabbedPane.selected", Color.BLACK);
   UIManager.put("TabbedPane.tabsOverlapBorder", true);
   super.installDefaults();
   tabInsets = new Insets(0, 0, 0, 0);
   contentBorderInsets = new Insets(0, 0, 0, 0);
   tabAreaInsets = new Insets(0, 0, 0, 0);
   selectedTabPadInsets = new Insets(0, 0, 0, 0);
 }
Ejemplo n.º 4
0
    /** Fill the background with white. */
    protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) {
      g.setColor(Color.white);

      g.fillRect(
          0,
          0,
          tabPane.getBounds().width,
          calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight));

      super.paintTabArea(g, tabPlacement, selectedIndex);
    }
Ejemplo n.º 5
0
    /** Initialization of default values. */
    protected void installDefaults() {
      super.installDefaults();
      tabAreaInsets = new Insets(0, 15, 0, 15);
      contentBorderInsets = new Insets(3, 3, 3, 3);
      tabInsets = new Insets(10, 10, 10, 10);
      selectedTabPadInsets = new Insets(0, 0, 0, 0);

      bgColor = Color.white;
      bgActiveColor = new Color(193, 210, 238);
      bgHoverColor = new Color(224, 232, 246);
    }
Ejemplo n.º 6
0
 @Override
 protected void paintText(
     Graphics g,
     int tabPlacement,
     Font font,
     FontMetrics metrics,
     int tabIndex,
     String title,
     Rectangle textRect,
     boolean isSelected) {
   super.paintText(g, tabPlacement, font, metrics, tabIndex, title, textRect, isSelected);
 }
Ejemplo n.º 7
0
  // overrided to add more space each side of the tab title and spacing between tabs.
  protected void installDefaults() {
    super.installDefaults();

    // changed to add more space each side of the tab title.
    tabInsets.left = tabInsets.left + ADDED_TAB_WIDTH;
    tabInsets.right = tabInsets.right + ADDED_TAB_WIDTH;
    tabInsets.top = tabInsets.top + ADDED_TAB_HEIGTH;
    tabInsets.bottom = tabInsets.bottom + ADDED_TAB_HEIGTH;

    // changed to define the spacing between tabs.
    selectedTabPadInsets.left = SPACE_BETWEEN_TAB;
    selectedTabPadInsets.right = SPACE_BETWEEN_TAB;
  }
    protected void paintTab(
        Graphics g,
        int tabPlacement,
        Rectangle[] rects,
        int tabIndex,
        Rectangle iconRect,
        Rectangle textRect) {

      super.paintTab(g, tabPlacement, rects, tabIndex, iconRect, textRect);
      Rectangle rect = rects[tabIndex];
      g.setColor(Color.black);
      g.drawRect(rect.x + 5, rect.y + 5, 10, 10);
      g.drawLine(rect.x + 5, rect.y + 5, rect.x + 15, rect.y + 15);
      g.drawLine(rect.x + 15, rect.y + 5, rect.x + 5, rect.y + 15);
    }
Ejemplo n.º 9
0
 @Override
 protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) {
   Graphics2D g2d = (Graphics2D) g;
   LinearGradientPaint paint =
       new LinearGradientPaint(
           0,
           0,
           0,
           HEIGHT,
           new float[] {0.0f, 0.49f, 0.5f, 1.0f},
           new Color[] {
             new Color(0x787b7d), new Color(0x35393d), new Color(0x000000), new Color(0x0c0c0c)
           });
   g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
   g2d.setPaint(paint);
   g2d.fillRect(0, 0, tabPane.getWidth(), HEIGHT);
   super.paintTabArea(g, tabPlacement, selectedIndex);
 }
Ejemplo n.º 10
0
    protected void paintTabBackground(
        Graphics g,
        int tabPlacement,
        int tabIndex,
        int x,
        int y,
        int w,
        int h,
        boolean isSelected) {
      super.paintTabBackground(g, tabPlacement, tabIndex, x, y, w, h, isSelected);

      Color darker = tabPane.getBackgroundAt(tabIndex).darker();
      g.setColor(darker);

      long currentTime = System.currentTimeMillis();
      Progressor p = (Progressor) tabPane.getComponentAt(tabIndex);
      double percent = p.calculatePercentage(currentTime);
      if (percent > 1) percent = 1.0;
      g.fillRect(x + 1, y + 1, (int) ((w - 3) * percent), h - 1);
    }
Ejemplo n.º 11
0
 protected void installDefaults() {
   super.installDefaults();
   tabAreaInsets = contentBorderInsets = new Insets(0, 0, 0, 0);
 }
Ejemplo n.º 12
0
 @Override
 protected void installDefaults() {
   super.installDefaults();
 }
Ejemplo n.º 13
0
 @Override
 protected void uninstallListeners() {
   super.uninstallListeners();
   this.tabPane.removeMouseListener(this.mouseListener);
   this.tabPane.removeMouseMotionListener(this.mouseListener);
 }
Ejemplo n.º 14
0
 @Override
 protected void installListeners() {
   super.installListeners();
   this.tabPane.addMouseListener(this.mouseListener);
   this.tabPane.addMouseMotionListener(this.mouseListener);
 }
Ejemplo n.º 15
0
 /** Repaint the tabbed pane if the mouse is hovering a new tab. */
 protected void setRolloverTab(int index) {
   if (getRolloverTab() != index) {
     super.setRolloverTab(index);
     repaint();
   }
 }