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
88
libjava/javax/swing/plaf/ComponentUI.java
Normal file
88
libjava/javax/swing/plaf/ComponentUI.java
Normal file
|
@ -0,0 +1,88 @@
|
|||
package javax.swing.plaf;
|
||||
|
||||
import java.awt.*;
|
||||
import javax.swing.border.*;
|
||||
import javax.swing.*;
|
||||
|
||||
import javax.accessibility.*;
|
||||
|
||||
public abstract class ComponentUI
|
||||
implements UIResource // ??
|
||||
{
|
||||
boolean contains(JComponent c, int x, int y)
|
||||
{
|
||||
return c.inside(x,y);
|
||||
}
|
||||
|
||||
// this SHOULD thow an error:
|
||||
public static ComponentUI createUI(JComponent c)
|
||||
{
|
||||
Exception e = new Exception("createUI from ComponentUI should never be called");
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
return null;
|
||||
}
|
||||
|
||||
public Accessible getAccessibleChild(JComponent c, int i)
|
||||
{
|
||||
//Return the nth Accessible child of the object.
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getAccessibleChildrenCount(JComponent c)
|
||||
{
|
||||
//Returns the number of accessible children in the object.
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Dimension getMaximumSize(JComponent c)
|
||||
{
|
||||
return getPreferredSize(c);
|
||||
}
|
||||
|
||||
public Dimension getMinimumSize(JComponent c)
|
||||
{
|
||||
return getPreferredSize(c);
|
||||
}
|
||||
|
||||
public Dimension getPreferredSize(JComponent c)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void installUI(JComponent c)
|
||||
{
|
||||
String id = c.getUIClassID() + ".border";
|
||||
|
||||
Border s = UIManager.getBorder( id );
|
||||
|
||||
if (s != null)
|
||||
{
|
||||
c.setBorder( s );
|
||||
//System.out.println("OK-INSTALL: " + this + ", ID=" + id + ",B="+s);
|
||||
}
|
||||
else
|
||||
{
|
||||
///System.out.println("FAIL-INSTALL: " + this + ", " + id);
|
||||
}
|
||||
}
|
||||
|
||||
public void paint(Graphics g, JComponent c)
|
||||
{
|
||||
// System.out.println("UI-COMPONENT-> unimplemented paint: " + c + ", UI="+this);
|
||||
}
|
||||
|
||||
public void uninstallUI(JComponent c)
|
||||
{
|
||||
}
|
||||
|
||||
public void update(Graphics g, JComponent c) {
|
||||
if (c.isOpaque()) {
|
||||
g.setColor(c.getBackground());
|
||||
g.fillRect(0, 0, c.getWidth(),c.getHeight());
|
||||
}
|
||||
paint(g, c);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue