Imported GNU Classpath 0.90

Imported GNU Classpath 0.90
       * scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore.
       * gnu/classpath/jdwp/VMFrame.java (SIZE): New constant.
       * java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5.
       * java/lang/Math.java: New override file.
       * java/lang/Character.java: Merged from Classpath.
       (start, end): Now 'int's.
       (canonicalName): New field.
       (CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants.
       (UnicodeBlock): Added argument.
       (of): New overload.
       (forName): New method.
       Updated unicode blocks.
       (sets): Updated.
       * sources.am: Regenerated.
       * Makefile.in: Likewise.

From-SVN: r111942
This commit is contained in:
Mark Wielaard 2006-03-10 21:46:48 +00:00
parent 27079765d0
commit 8aa540d2f7
1367 changed files with 188789 additions and 22762 deletions

View file

@ -1,5 +1,5 @@
/* GtkMenuItemPeer.java -- Implements MenuItemPeer with GTK+
Copyright (C) 1999, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@ -49,70 +49,71 @@ import java.awt.peer.MenuPeer;
public class GtkMenuItemPeer extends GtkMenuComponentPeer
implements MenuItemPeer
{
native void create (String label);
native void connectSignals ();
native void gtkWidgetModifyFont (String name, int style, int size);
/**
* Creates the associated gtk+ widget and stores it in the nsa table
* for this peer. Called by the create() method with the label name
* of the associated MenuItem. Needs to be overridden my subclasses
* that want to create a different gtk+ widget.
*/
protected native void create (String label);
void create ()
/**
* Called from constructor to enable signals from an item. If a
* subclass needs different (or no) signals connected this method
* should be overridden.
*/
protected native void connectSignals ();
/**
* Overridden to set font on menu item label.
*/
protected native void gtkWidgetModifyFont(String name, int style, int size);
/**
* Creates the associated gtk+ widget and stores it in the nsa table
* for this peer. Called by the (super class) constructor.
* Overridden to get the label if the assiociated MenuItem and to
* call create(String).
*/
protected void create()
{
create (((MenuItem) awtWidget).getLabel());
}
public GtkMenuItemPeer (MenuItem item)
/**
* Creates a new GtkMenuItemPeer associated with the given MenuItem.
* It will call create(), setFont(), setEnabled() and
* connectSignals() in that order.
*/
public GtkMenuItemPeer(MenuItem item)
{
super (item);
setEnabled (item.isEnabled ());
setParent (item);
if (item.getParent() instanceof Menu && ! (item instanceof Menu))
connectSignals();
super(item);
setEnabled (item.isEnabled());
connectSignals();
}
void setFont ()
/**
* Calls setEnabled(false).
*/
public void disable()
{
MenuComponent mc = ((MenuComponent) awtWidget);
Font f = mc.getFont ();
if (f == null)
{
MenuComponent parent = (MenuComponent) mc.getParent ();
Font pf = parent.getFont ();
gtkWidgetModifyFont (pf.getName (), pf.getStyle (), pf.getSize ());
}
else
gtkWidgetModifyFont(f.getName(), f.getStyle(), f.getSize());
setEnabled(false);
}
void setParent (MenuItem item)
/**
* Calls setEnabled(true).
*/
public void enable()
{
// add ourself differently, based on what type of parent we have
// yes, the typecasting here is nasty.
Object parent = item.getParent ();
if (parent instanceof MenuBar)
{
((GtkMenuBarPeer)((MenuBar)parent).getPeer ()).addMenu ((MenuPeer) this);
}
else // parent instanceof Menu
{
((GtkMenuPeer)((Menu)parent).getPeer ()).addItem (this,
item.getShortcut ());
}
}
public void disable ()
{
setEnabled (false);
}
public void enable ()
{
setEnabled (true);
setEnabled(true);
}
public native void setEnabled(boolean b);
public native void setLabel(String label);
/**
* Callback setup through connectSignals().
*/
protected void postMenuActionEvent ()
{
postActionEvent (((MenuItem)awtWidget).getActionCommand (), 0);