1 package javax
.swing
.plaf
.basic
;
5 import javax
.swing
.plaf
.*;
7 public class BasicTabbedPaneUI
extends TabbedPaneUI
9 public static ComponentUI
createUI(final JComponent c
)
11 return new BasicTabbedPaneUI();
14 public void installUI(final JComponent c
)
19 public Dimension
getPreferredSize(JComponent c
)
21 JTabbedPane p
= (JTabbedPane
) c
;
23 Dimension d
= new Dimension(50,50);
25 for (int i
=0;i
<p
.getTabCount();i
++)
27 Component comp
= p
.getComponentAt(i
);
29 Dimension pr
= comp
.getPreferredSize();
31 d
.width
= Math
.max(d
.width
, comp
.getWidth());
32 d
.height
= Math
.max(d
.height
, comp
.getHeight());
35 Insets i
= p
.getInsets();
37 d
.width
+= i
.left
+ i
.right
;
38 d
.height
+= i
.top
+ i
.bottom
;
40 int height_of_tabs
= 25;
42 d
.height
+= height_of_tabs
;
44 // FIXME: should be max of panes in p
49 public Rectangle
getTabBounds(JTabbedPane pane
, int index
)
54 public int getTabRunCount(JTabbedPane pane
)
59 public int tabForCoordinate(JTabbedPane pane
, int x
, int y
)