MemoryImageSource.java, [...]: New versions from classpath.
2003-07-14 Michael Koch <konqueror@gmx.de> * java/awt/image/MemoryImageSource.java, java/beans/PropertyEditorManager.java, javax/naming/CompoundName.java, javax/naming/spi/NamingManager.java, javax/swing/AbstractButton.java, javax/swing/ButtonModel.java, javax/swing/SwingUtilities.java, javax/swing/UIManager.java, javax/swing/colorchooser/DefaultColorSelectionModel.java, javax/swing/event/AncestorEvent.java, javax/swing/event/InternalFrameEvent.java, java/util/zip/ZipFile.java: New versions from classpath. From-SVN: r69321
This commit is contained in:
parent
6e98504002
commit
6a71677713
13 changed files with 1095 additions and 1077 deletions
|
@ -58,70 +58,71 @@ import javax.accessibility.AccessibleStateSet;
|
|||
public class SwingUtilities implements SwingConstants
|
||||
{
|
||||
public static FontMetrics getFontMetrics (Font font)
|
||||
{
|
||||
return Toolkit.getDefaultToolkit().getFontMetrics(font);
|
||||
}
|
||||
{
|
||||
return Toolkit.getDefaultToolkit ().getFontMetrics (font);
|
||||
}
|
||||
|
||||
public static JRootPane getRootPane (Component a)
|
||||
{
|
||||
if (a instanceof JRootPane)
|
||||
return (JRootPane) a;
|
||||
{
|
||||
if (a instanceof JRootPane)
|
||||
return (JRootPane) a;
|
||||
|
||||
a = a.getParent();
|
||||
a = a.getParent();
|
||||
|
||||
if (a != null)
|
||||
{
|
||||
return getRootPane(a);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
if (a != null)
|
||||
{
|
||||
return getRootPane(a);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void updateComponentTreeUI(JFrame comp)
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
public static String layoutCompoundLabel(JComponent c,
|
||||
FontMetrics fm,
|
||||
String text,
|
||||
Icon i,
|
||||
int vert_a,
|
||||
int hor_i,
|
||||
int vert_text_pos,
|
||||
int hor_text_pos,
|
||||
Rectangle vr,
|
||||
Rectangle ir,
|
||||
Rectangle tr,
|
||||
int gap)
|
||||
{
|
||||
// view rect 'vr' already ok,
|
||||
// we need to compute ir (icon rect) and tr (text-rect)
|
||||
FontMetrics fm,
|
||||
String text,
|
||||
Icon i,
|
||||
int vert_a,
|
||||
int hor_i,
|
||||
int vert_text_pos,
|
||||
int hor_text_pos,
|
||||
Rectangle vr,
|
||||
Rectangle ir,
|
||||
Rectangle tr,
|
||||
int gap)
|
||||
{
|
||||
// view rect 'vr' already ok,
|
||||
// we need to compute ir (icon rect) and tr (text-rect)
|
||||
|
||||
int next_x = 0;//vr.x;
|
||||
int next_y = 0;//vr.y;
|
||||
int next_x = 0;//vr.x;
|
||||
int next_y = 0;//vr.y;
|
||||
|
||||
ir.height = ir.width = ir.y = ir.x = 0;
|
||||
ir.height = ir.width = ir.y = ir.x = 0;
|
||||
|
||||
if (i != null)
|
||||
{
|
||||
ir.x = vr.x;
|
||||
ir.y = vr.y;
|
||||
ir.width = i.getIconWidth();
|
||||
ir.height = i.getIconWidth();
|
||||
if (i != null)
|
||||
{
|
||||
ir.x = vr.x;
|
||||
ir.y = vr.y;
|
||||
ir.width = i.getIconWidth();
|
||||
ir.height = i.getIconWidth();
|
||||
|
||||
|
||||
next_x += gap + i.getIconWidth();
|
||||
next_y += gap + i.getIconHeight();
|
||||
}
|
||||
next_x += gap + i.getIconWidth();
|
||||
next_y += gap + i.getIconHeight();
|
||||
}
|
||||
|
||||
tr.x = next_x;
|
||||
tr.y = vr.y + (vr.height/2);
|
||||
tr.x = next_x;
|
||||
tr.y = vr.y + (vr.height/2);
|
||||
|
||||
tr.width = fm.stringWidth(text);
|
||||
tr.height = fm.getHeight() + fm.getAscent()/2;
|
||||
tr.width = fm.stringWidth(text);
|
||||
tr.height = fm.getHeight() + fm.getAscent()/2;
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue