Class CompiereTabbedPaneUI

  • All Implemented Interfaces:
    SwingConstants

    public class CompiereTabbedPaneUI
    extends MetalTabbedPaneUI
    Same implementation detail as in AdempierePanelUI. Additional handling of dwawing tabs.
    Version:
    $Id: AdempiereTabbedPaneUI.java,v 1.3 2006/07/30 00:52:23 jjanke Exp $
    Author:
    Jorg Janke
    See Also:
    CompierePanelUI
    • Constructor Detail

      • CompiereTabbedPaneUI

        public CompiereTabbedPaneUI()
    • Method Detail

      • createUI

        public static ComponentUI createUI​(JComponent c)
        Static Create UI
        Parameters:
        c - Component
        Returns:
        Adempiere TabbedPaneUI
      • paintTabBackground

        protected void paintTabBackground​(Graphics g,
                                          int tabPlacement,
                                          int tabIndex,
                                          int x,
                                          int y,
                                          int w,
                                          int h,
                                          boolean isSelected)
        Paint the actual Tab Background. Called from Basic.PaintTab (<- Basic.paintTabArea <- Basic.paint)

        Based on MetalTabbedPaneUI.paintTabBackground: Differences: - Color based on primary Background of Tab - Selected Tab is painted

                  selected    not sel
          top     //////////  //////////  (lighter)
                              ++++++++++  (flat/darker)
        
          bottom              //////////  (flat/lighter)
                  ++++++++++  ++++++++++  (darker)
        
          sides               //////////  (flat/ligher)
                              ++++++++++  (flat/darker)
          
        Overrides:
        paintTabBackground in class MetalTabbedPaneUI
        Parameters:
        g - graphics
        tabPlacement - tab placement
        tabIndex - tab index
        x - x
        y - y
        w - width
        h - height
        isSelected - selected
      • paintContentBorder

        protected void paintContentBorder​(Graphics g,
                                          int tabPlacement,
                                          int selectedIndex)
        Paint Content Border (overwriting BasicTabbedPanelUI) Uses Color from actual Tab (not from TabbedPane)
        Overrides:
        paintContentBorder in class BasicTabbedPaneUI
        Parameters:
        g - graphics
        tabPlacement - tab placement
        selectedIndex - index
      • paintContentBorderLeftEdge

        protected void paintContentBorderLeftEdge​(Graphics g,
                                                  int tabPlacement,
                                                  int selectedIndex,
                                                  int x,
                                                  int y,
                                                  int w,
                                                  int h)
        Paint left content border edge
        Overrides:
        paintContentBorderLeftEdge in class MetalTabbedPaneUI
        Parameters:
        g - graphics
        tabPlacement - tab placement
        selectedIndex - index
        x - x
        y - y
        w - width
        h - height
      • paintContentBorderBottomEdge

        protected void paintContentBorderBottomEdge​(Graphics g,
                                                    int tabPlacement,
                                                    int selectedIndex,
                                                    int x,
                                                    int y,
                                                    int w,
                                                    int h)
        Paint bottom content area edge
        Overrides:
        paintContentBorderBottomEdge in class MetalTabbedPaneUI
        Parameters:
        g - graphics
        tabPlacement - tab placement
        selectedIndex - index
        x - x
        y - y
        w - width
        h - height
      • paintContentBorderRightEdge

        protected void paintContentBorderRightEdge​(Graphics g,
                                                   int tabPlacement,
                                                   int selectedIndex,
                                                   int x,
                                                   int y,
                                                   int w,
                                                   int h)
        Paint right Contenr border edge
        Overrides:
        paintContentBorderRightEdge in class MetalTabbedPaneUI
        Parameters:
        g - graphics
        tabPlacement - tab placement
        selectedIndex - index
        x - x
        y - y
        w - width
        h - height
      • shouldFillGap

        protected boolean shouldFillGap​(int currentRun,
                                        int tabIndex,
                                        int x,
                                        int y)
        Fill Tab gap triangle (no)
        Overrides:
        shouldFillGap in class MetalTabbedPaneUI
        Parameters:
        currentRun - current run
        tabIndex - tab index
        x - x
        y - y
        Returns:
        false
      • paintTopTabBorder

        protected void paintTopTabBorder​(int tabIndex,
                                         Graphics g,
                                         int x,
                                         int y,
                                         int w,
                                         int h,
                                         int btm,
                                         int rght,
                                         boolean isSelected)
        Paint Top Tab Border
        Overrides:
        paintTopTabBorder in class MetalTabbedPaneUI
        Parameters:
        tabIndex - index
        g - graphics
        x - x
        y - y
        w - width
        h - height
        btm - bottom
        rght - right
        isSelected - selected
      • paintLeftTabBorder

        protected void paintLeftTabBorder​(int tabIndex,
                                          Graphics g,
                                          int x,
                                          int y,
                                          int w,
                                          int h,
                                          int btm,
                                          int rght,
                                          boolean isSelected)
        Paint Border of Left Tab. Does not fill triangle
        Overrides:
        paintLeftTabBorder in class MetalTabbedPaneUI
        Parameters:
        tabIndex - index
        g - graphics
        x - x
        y - y
        w - width
        h - height
        btm - bottom
        rght - right
        isSelected - selected
      • paintRightTabBorder

        protected void paintRightTabBorder​(int tabIndex,
                                           Graphics g,
                                           int x,
                                           int y,
                                           int w,
                                           int h,
                                           int btm,
                                           int rght,
                                           boolean isSelected)
        Paint Border of Right Tab. Does not fill triangle
        Overrides:
        paintRightTabBorder in class MetalTabbedPaneUI
        Parameters:
        tabIndex - index
        g - graphics
        x - x
        y - y
        w - width
        h - height
        btm - bottom
        rght - right
        isSelected - selected
      • calculateTabWidth

        protected int calculateTabWidth​(int tabPlacement,
                                        int tabIndex,
                                        FontMetrics metrics)
        Calculate Tab Width. We may have to overwrite to adjust width for TabHirarchyLevel
        Overrides:
        calculateTabWidth in class BasicTabbedPaneUI
        Parameters:
        tabPlacement - tab placement
        tabIndex - tab index
        metrics - metcics
        Returns:
        tab width
      • calculateTabHeight

        protected int calculateTabHeight​(int tabPlacement,
                                         int tabIndex,
                                         int fontHeight)
        Calculate TabHeight
        Overrides:
        calculateTabHeight in class BasicTabbedPaneUI
        Parameters:
        tabPlacement - tab placement
        tabIndex - tab index
        fontHeight - font height
        Returns:
        tab height
      • layoutLabel

        protected void layoutLabel​(int tabPlacement,
                                   FontMetrics metrics,
                                   int tabIndex,
                                   String title,
                                   Icon icon,
                                   Rectangle tabRect,
                                   Rectangle iconRect,
                                   Rectangle textRect,
                                   boolean isSelected)
        Layout Label
        Overrides:
        layoutLabel in class BasicTabbedPaneUI
        Parameters:
        tabPlacement - tab placement
        metrics - fint metrics
        tabIndex - tab index
        title - title
        icon - icon
        tabRect - tab bounds
        iconRect - icon bounds
        textRect - text bounds
        isSelected - selected
      • paintText

        protected void paintText​(Graphics g,
                                 int tabPlacement,
                                 Font font,
                                 FontMetrics metrics,
                                 int tabIndex,
                                 String title,
                                 Rectangle textRect,
                                 boolean isSelected)
        Paint Tab
        Overrides:
        paintText in class BasicTabbedPaneUI
        Parameters:
        g - graphics
        tabPlacement - tab placement
        font - font
        metrics - font metrics
        tabIndex - tab index
        title - title
        textRect - text bounds
        isSelected - selected