FSF GCC merge 02/23/03
[official-gcc.git] / libjava / javax / swing / plaf / basic / BasicTabbedPaneUI.java
blob49328d26740e4b2a13e060ee3ae4a10d7171e5a8
1 package javax.swing.plaf.basic;
3 import javax.swing.*;
4 import java.awt.*;
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)
16 super.installUI(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
45 return d;
49 public Rectangle getTabBounds(JTabbedPane pane, int index)
51 return null;
54 public int getTabRunCount(JTabbedPane pane)
56 return 0;
59 public int tabForCoordinate(JTabbedPane pane, int x, int y)
61 return 0;