AWT/Swing merge from GNU Classpath.
From-SVN: r56147
This commit is contained in:
parent
097684ce62
commit
7bde45b2eb
490 changed files with 86038 additions and 9753 deletions
64
libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
Normal file
64
libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
Normal file
|
@ -0,0 +1,64 @@
|
|||
package javax.swing.plaf.basic;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import javax.swing.plaf.*;
|
||||
|
||||
public class BasicTabbedPaneUI extends TabbedPaneUI
|
||||
{
|
||||
public static ComponentUI createUI(final JComponent c)
|
||||
{
|
||||
return new BasicTabbedPaneUI();
|
||||
}
|
||||
|
||||
public void installUI(final JComponent c)
|
||||
{
|
||||
super.installUI(c);
|
||||
}
|
||||
|
||||
public Dimension getPreferredSize(JComponent c)
|
||||
{
|
||||
JTabbedPane p = (JTabbedPane) c;
|
||||
|
||||
Dimension d = new Dimension(50,50);
|
||||
|
||||
for (int i=0;i<p.getTabCount();i++)
|
||||
{
|
||||
Component comp = p.getComponentAt(i);
|
||||
|
||||
Dimension pr = comp.getPreferredSize();
|
||||
|
||||
d.width = Math.max(d.width, comp.getWidth());
|
||||
d.height = Math.max(d.height, comp.getHeight());
|
||||
}
|
||||
|
||||
Insets i = p.getInsets();
|
||||
|
||||
d.width += i.left + i.right;
|
||||
d.height += i.top + i.bottom;
|
||||
|
||||
int height_of_tabs = 25;
|
||||
|
||||
d.height += height_of_tabs;
|
||||
|
||||
// FIXME: should be max of panes in p
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
public Rectangle getTabBounds(JTabbedPane pane, int index)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getTabRunCount(JTabbedPane pane)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int tabForCoordinate(JTabbedPane pane, int x, int y)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue