Imported GNU Classpath 0.19 + gcj-import-20051115.

* sources.am: Regenerated.
       * Makefile.in: Likewise.
       * scripts/makemake.tcl: Use glob -nocomplain.

From-SVN: r107049
This commit is contained in:
Mark Wielaard
2005-11-15 23:20:01 +00:00
parent 02e549bfaa
commit 8f523f3a10
1241 changed files with 97711 additions and 25284 deletions
+120 -10
View File
@@ -38,6 +38,7 @@ exception statement from your version. */
package java.awt;
/**
* This class implements a layout manager that positions components
* in certain sectors of the parent container.
@@ -229,6 +230,12 @@ public class BorderLayout implements LayoutManager2, java.io.Serializable
private int vgap;
// Some constants for use with calcSize().
private static final int MIN = 0;
private static final int MAX = 1;
private static final int PREF = 2;
/**
* Initializes a new instance of <code>BorderLayout</code> with no
* horiztonal or vertical gaps between components.
@@ -423,7 +430,7 @@ public class BorderLayout implements LayoutManager2, java.io.Serializable
*/
public float getLayoutAlignmentX(Container parent)
{
return(parent.getAlignmentX());
return 0.5F;
}
/**
@@ -438,7 +445,7 @@ public class BorderLayout implements LayoutManager2, java.io.Serializable
*/
public float getLayoutAlignmentY(Container parent)
{
return(parent.getAlignmentY());
return 0.5F;
}
/**
@@ -449,7 +456,7 @@ public class BorderLayout implements LayoutManager2, java.io.Serializable
*/
public void invalidateLayout(Container parent)
{
// FIXME: Implement this properly!
// Nothing to do here.
}
/**
@@ -560,7 +567,8 @@ public class BorderLayout implements LayoutManager2, java.io.Serializable
}
/**
* FIXME: Document me!
* This is a convenience method to set the bounds on a component.
* If the indicated component is null, nothing is done.
*/
private void setBounds(Component comp, int x, int y, int w, int h)
{
@@ -569,12 +577,6 @@ public class BorderLayout implements LayoutManager2, java.io.Serializable
comp.setBounds(x, y, w, h);
}
// FIXME: Maybe move to top of file.
// Some constants for use with calcSize().
private static final int MIN = 0;
private static final int MAX = 1;
private static final int PREF = 2;
private Dimension calcCompSize(Component comp, int what)
{
if (comp == null || !comp.isVisible())
@@ -660,4 +662,112 @@ public class BorderLayout implements LayoutManager2, java.io.Serializable
return(new Dimension(width, height));
}
}
/**
* Return the component at the indicated location, or null if no component
* is at that location. The constraints argument must be one of the
* location constants specified by this class.
* @param constraints the location
* @return the component at that location, or null
* @throws IllegalArgumentException if the constraints argument is not
* recognized
* @since 1.5
*/
public Component getLayoutComponent(Object constraints)
{
if (constraints == CENTER)
return center;
if (constraints == NORTH)
return north;
if (constraints == EAST)
return east;
if (constraints == SOUTH)
return south;
if (constraints == WEST)
return west;
if (constraints == PAGE_START)
return firstLine;
if (constraints == PAGE_END)
return lastLine;
if (constraints == LINE_START)
return firstItem;
if (constraints == LINE_END)
return lastItem;
throw new IllegalArgumentException("constraint " + constraints
+ " is not recognized");
}
/**
* Return the component at the specified location, which must be one
* of the absolute constants such as CENTER or SOUTH. The container's
* orientation is used to map this location to the correct corresponding
* component, so for instance in a right-to-left container, a request
* for the EAST component could return the LINE_END component. This will
* return null if no component is available at the given location.
* @param container the container whose orientation is used
* @param constraints the absolute location of the component
* @return the component at the location, or null
* @throws IllegalArgumentException if the constraint is not recognized
*/
public Component getLayoutComponent(Container container, Object constraints)
{
ComponentOrientation orient = container.getComponentOrientation();
if (constraints == CENTER)
return center;
// Note that we don't support vertical layouts.
if (constraints == NORTH)
return north;
if (constraints == SOUTH)
return south;
if (constraints == WEST)
{
// Note that relative layout takes precedence.
if (orient.isLeftToRight())
return firstItem == null ? west : firstItem;
return lastItem == null ? west : lastItem;
}
if (constraints == EAST)
{
// Note that relative layout takes precedence.
if (orient.isLeftToRight())
return lastItem == null ? east : lastItem;
return firstItem == null ? east : firstItem;
}
throw new IllegalArgumentException("constraint " + constraints
+ " is not recognized");
}
/**
* Return the constraint corresponding to a component in this layout.
* If the component is null, or is not in this layout, returns null.
* Otherwise, this will return one of the constraint constants defined
* in this class.
* @param c the component
* @return the constraint, or null
* @since 1.5
*/
public Object getConstraints(Component c)
{
if (c == null)
return null;
if (c == center)
return CENTER;
if (c == north)
return NORTH;
if (c == east)
return EAST;
if (c == south)
return SOUTH;
if (c == west)
return WEST;
if (c == firstLine)
return PAGE_START;
if (c == lastLine)
return PAGE_END;
if (c == firstItem)
return LINE_START;
if (c == lastItem)
return LINE_END;
return null;
}
}
+2
View File
@@ -98,6 +98,8 @@ private transient ActionListener action_listeners;
protected class AccessibleAWTButton extends AccessibleAWTComponent
implements AccessibleAction, AccessibleValue
{
public static final long serialVersionUID = -5932203980244017102L;
protected AccessibleAWTButton()
{
// Do nothing here.
+3 -11
View File
@@ -292,8 +292,8 @@ public class Canvas
*
* @since 1.4
*/
public void createBufferStrategy(int numBuffers,
BufferCapabilities caps)
public void createBufferStrategy(int numBuffers, BufferCapabilities caps)
throws AWTException
{
if (numBuffers < 1)
throw new IllegalArgumentException("Canvas.createBufferStrategy: number"
@@ -305,15 +305,7 @@ public class Canvas
// a flipping strategy was requested
if (caps.isPageFlipping())
{
try
{
bufferStrategy = new CanvasFlipBufferStrategy(numBuffers);
}
catch (AWTException e)
{
}
}
bufferStrategy = new CanvasFlipBufferStrategy(numBuffers);
else
bufferStrategy = new CanvasBltBufferStrategy(numBuffers, true);
}
+9 -2
View File
@@ -392,6 +392,11 @@ Checkbox(String label, boolean state, CheckboxGroup group)
this.label = label;
this.state = state;
this.group = group;
if ( state && group != null )
{
group.setSelectedCheckbox(this);
}
}
/*************************************************************************/
@@ -610,8 +615,10 @@ dispatchEventImpl(AWTEvent e)
protected String
paramString()
{
return ("label=" + label + ",state=" + state + ",group=" + group
+ "," + super.paramString());
// Note: We cannot add the checkbox group information here because this
// would trigger infinite recursion when CheckboxGroup.toString() is
// called and the box is in its selected state.
return ("label=" + label + ",state=" + state + "," + super.paramString());
}
/**
@@ -335,6 +335,8 @@ paramString()
implements AccessibleAction, AccessibleValue
{
// I think the base class provides the necessary implementation
private static final long serialVersionUID = -1122642964303476L;
}
/**
+4
View File
@@ -565,6 +565,10 @@ processEvent(AWTEvent event)
protected void
processItemEvent(ItemEvent event)
{
int index = pItems.indexOf((String) event.getItem());
// Don't call back into the peers when selecting index here
if (event.getStateChange() == ItemEvent.SELECTED)
this.selectedIndex = index;
if (item_listeners != null)
item_listeners.itemStateChanged(event);
}
+1 -1
View File
@@ -762,7 +762,7 @@ public class Color implements Paint, Serializable
if (max == 0)
array[1] = 0;
else
array[1] = (max - min) / max;
array[1] = ((float) (max - min)) / ((float) max);
// Calculate hue.
if (array[1] == 0)
array[0] = 0;
@@ -63,7 +63,7 @@ class ColorPaintContext implements PaintContext
/**
* Create the context for a given color.
*
* @param c The solid color to use.
* @param colorRGB The solid color to use.
*/
ColorPaintContext(int colorRGB)
{
@@ -74,7 +74,7 @@ class ColorPaintContext implements PaintContext
* Create the context for a given color.
*
* @param cm The color model of this context.
* @param c The solid color to use.
* @param colorRGB The solid color to use.
*/
ColorPaintContext(ColorModel cm,int colorRGB)
{
+49 -40
View File
@@ -587,6 +587,7 @@ public abstract class Component
*/
protected Component()
{
// Nothing to do here.
}
/**
@@ -720,8 +721,9 @@ public abstract class Component
/**
* Tests if the component is displayable. It must be connected to a native
* screen resource, and all its ancestors must be displayable. A containment
* hierarchy is made displayable when a window is packed or made visible.
* screen resource. This reduces to checking that peer is not null. A
* containment hierarchy is made displayable when a window is packed or
* made visible.
*
* @return true if the component is displayable
* @see Container#add(Component)
@@ -733,9 +735,7 @@ public abstract class Component
*/
public boolean isDisplayable()
{
if (parent != null)
return parent.isDisplayable();
return false;
return peer != null;
}
/**
@@ -763,7 +763,7 @@ public abstract class Component
if (! visible || peer == null)
return false;
return parent == null ? true : parent.isShowing();
return parent == null ? false : parent.isShowing();
}
/**
@@ -902,15 +902,16 @@ public abstract class Component
if (currentPeer != null)
currentPeer.setVisible(true);
// The JDK repaints the component before invalidating the parent.
// So do we.
if (isShowing())
repaint();
// Invalidate the parent if we have one. The component itself must
// not be invalidated. We also avoid NullPointerException with
// a local reference here.
Container currentParent = parent;
if (currentParent != null)
{
currentParent.invalidate();
currentParent.repaint();
}
currentParent.invalidate();
ComponentEvent ce =
new ComponentEvent(this,ComponentEvent.COMPONENT_SHOWN);
@@ -946,18 +947,19 @@ public abstract class Component
ComponentPeer currentPeer=peer;
if (currentPeer != null)
currentPeer.setVisible(false);
boolean wasShowing = isShowing();
this.visible = false;
// The JDK repaints the component before invalidating the parent.
// So do we.
if (wasShowing)
repaint();
// Invalidate the parent if we have one. The component itself must
// not be invalidated. We also avoid NullPointerException with
// a local reference here.
Container currentParent = parent;
if (currentParent != null)
{
currentParent.invalidate();
currentParent.repaint();
}
currentParent.invalidate();
ComponentEvent ce =
new ComponentEvent(this,ComponentEvent.COMPONENT_HIDDEN);
@@ -976,7 +978,7 @@ public abstract class Component
{
if (foreground != null)
return foreground;
return parent == null ? SystemColor.windowText : parent.getForeground();
return parent == null ? null : parent.getForeground();
}
/**
@@ -1075,8 +1077,9 @@ public abstract class Component
Component p = parent;
if (p != null)
return p.getFont();
else
return new Font("Dialog", Font.PLAIN, 12);
if (peer != null)
return peer.getGraphics().getFont();
return null;
}
/**
@@ -1402,17 +1405,14 @@ public abstract class Component
peer.setBounds (x, y, width, height);
// Erase old bounds and repaint new bounds for lightweights.
if (isLightweight() && isShowing ())
if (isLightweight() && isShowing())
{
if (parent != null)
{
Rectangle parentBounds = parent.getBounds();
Rectangle oldBounds = new Rectangle(parent.getX() + oldx,
parent.getY() + oldy,
oldwidth, oldheight);
Rectangle newBounds = new Rectangle(parent.getX() + x,
parent.getY() + y,
width, height);
Rectangle oldBounds = new Rectangle(oldx, oldy, oldwidth,
oldheight);
Rectangle newBounds = new Rectangle(x, y, width, height);
Rectangle destroyed = oldBounds.union(newBounds);
if (!destroyed.isEmpty())
parent.repaint(0, destroyed.x, destroyed.y, destroyed.width,
@@ -1646,7 +1646,7 @@ public abstract class Component
*/
public Dimension getMaximumSize()
{
return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
return new Dimension(Short.MAX_VALUE, Short.MAX_VALUE);
}
/**
@@ -1720,7 +1720,7 @@ public abstract class Component
valid = false;
prefSize = null;
minSize = null;
if (parent != null && parent.valid)
if (parent != null && parent.isValid())
parent.invalidate();
}
@@ -1736,11 +1736,8 @@ public abstract class Component
if (peer != null)
{
Graphics gfx = peer.getGraphics();
if (gfx != null)
return gfx;
// create graphics for lightweight:
Container parent = getParent();
if (parent != null)
// Create peer for lightweights.
if (gfx == null && parent != null)
{
gfx = parent.getGraphics();
Rectangle bounds = getBounds();
@@ -1748,6 +1745,8 @@ public abstract class Component
gfx.translate(bounds.x, bounds.y);
return gfx;
}
gfx.setFont(font);
return gfx;
}
return null;
}
@@ -1887,7 +1886,7 @@ public abstract class Component
* @see #repaint(long, int, int, int, int)
*/
public void repaint()
{
{
if(!isShowing())
{
Component p = parent;
@@ -3481,7 +3480,10 @@ public abstract class Component
ComponentPeer tmp = peer;
peer = null;
if (tmp != null)
tmp.dispose();
{
tmp.hide();
tmp.dispose();
}
}
/**
@@ -3807,13 +3809,16 @@ public abstract class Component
{
synchronized (getTreeLock ())
{
// Find this Component's top-level ancestor.
Container parent = getParent ();
// Find this Component's top-level ancestor.
Container parent = (this instanceof Container) ? (Container) this
: getParent();
while (parent != null
&& !(parent instanceof Window))
parent = parent.getParent ();
if (parent == null)
return;
Window toplevel = (Window) parent;
if (toplevel.isFocusableWindow ())
{
@@ -4241,9 +4246,9 @@ public abstract class Component
if (isDoubleBuffered())
param.append(",doublebuffered");
if (parent == null)
param.append(",parent==null");
param.append(",parent=null");
else
param.append(",parent==").append(parent.getName());
param.append(",parent=").append(parent.getName());
return param.toString();
}
@@ -5567,6 +5572,7 @@ p * <li>the set of backward traversal keys
*/
protected AccessibleAWTComponentHandler()
{
// Nothing to do here.
}
/**
@@ -5598,6 +5604,7 @@ p * <li>the set of backward traversal keys
*/
public void componentMoved(ComponentEvent e)
{
// Nothing to do here.
}
/**
@@ -5607,6 +5614,7 @@ p * <li>the set of backward traversal keys
*/
public void componentResized(ComponentEvent e)
{
// Nothing to do here.
}
} // class AccessibleAWTComponentHandler
@@ -5624,6 +5632,7 @@ p * <li>the set of backward traversal keys
*/
protected AccessibleAWTFocusHandler()
{
// Nothing to do here.
}
/**
+115 -15
View File
@@ -38,6 +38,7 @@ exception statement from your version. */
package java.awt;
import java.awt.event.ComponentListener;
import java.awt.event.ContainerEvent;
import java.awt.event.ContainerListener;
import java.awt.event.KeyEvent;
@@ -394,17 +395,20 @@ public class Container extends Component
layoutMgr.addLayoutComponent(null, comp);
}
if (isShowing ())
{
// Post event to notify of adding the component.
ContainerEvent ce = new ContainerEvent(this,
ContainerEvent.COMPONENT_ADDED,
comp);
getToolkit().getSystemEventQueue().postEvent(ce);
// We previously only sent an event when this container is showing.
// Also, the event was posted to the event queue. A Mauve test shows
// that this event is not delivered using the event queue and it is
// also sent when the container is not showing.
ContainerEvent ce = new ContainerEvent(this,
ContainerEvent.COMPONENT_ADDED,
comp);
ContainerListener[] listeners = getContainerListeners();
for (int i = 0; i < listeners.length; i++)
listeners[i].componentAdded(ce);
// Repaint this container.
repaint();
}
// Repaint this container.
repaint(comp.getX(), comp.getY(), comp.getWidth(),
comp.getHeight());
}
}
@@ -419,6 +423,10 @@ public class Container extends Component
{
Component r = component[index];
ComponentListener[] list = r.getComponentListeners();
for (int j = 0; j < list.length; j++)
r.removeComponentListener(list[j]);
r.removeNotify();
System.arraycopy(component, index + 1, component, index,
@@ -730,7 +738,16 @@ public class Container extends Component
*/
public float getAlignmentX()
{
return super.getAlignmentX();
LayoutManager layout = getLayout();
float alignmentX = 0.0F;
if (layout != null && layout instanceof LayoutManager2)
{
LayoutManager2 lm2 = (LayoutManager2) layout;
alignmentX = lm2.getLayoutAlignmentX(this);
}
else
alignmentX = super.getAlignmentX();
return alignmentX;
}
/**
@@ -742,7 +759,16 @@ public class Container extends Component
*/
public float getAlignmentY()
{
return super.getAlignmentY();
LayoutManager layout = getLayout();
float alignmentY = 0.0F;
if (layout != null && layout instanceof LayoutManager2)
{
LayoutManager2 lm2 = (LayoutManager2) layout;
alignmentY = lm2.getLayoutAlignmentY(this);
}
else
alignmentY = super.getAlignmentY();
return alignmentY;
}
/**
@@ -1047,6 +1073,53 @@ public class Container extends Component
return this;
}
}
/**
* Finds the visible child component that contains the specified position.
* The top-most child is returned in the case where there is overlap.
* If the top-most child is transparent and has no MouseListeners attached,
* we discard it and return the next top-most component containing the
* specified position.
* @param x the x coordinate
* @param y the y coordinate
* @return null if the <code>this</code> does not contain the position,
* otherwise the top-most component (out of this container itself and
* its descendants) meeting the criteria above.
*/
Component findComponentForMouseEventAt(int x, int y)
{
synchronized (getTreeLock())
{
if (!contains(x, y))
return null;
for (int i = 0; i < ncomponents; ++i)
{
// Ignore invisible children...
if (!component[i].isVisible())
continue;
int x2 = x - component[i].x;
int y2 = y - component[i].y;
// We don't do the contains() check right away because
// findComponentAt would redundantly do it first thing.
if (component[i] instanceof Container)
{
Container k = (Container) component[i];
Component r = k.findComponentForMouseEventAt(x2, y2);
if (r != null)
return r;
}
else if (component[i].contains(x2, y2))
return component[i];
}
//don't return transparent components with no MouseListeners
if (this.getMouseListeners().length == 0)
return null;
return this;
}
}
public Component findComponentAt(Point p)
{
@@ -1955,6 +2028,30 @@ class LightweightDispatcher implements Serializable
eventMask |= l;
}
/**
* Returns the deepest visible descendent of parent that contains the
* specified location and that is not transparent and MouseListener-less.
* @param parent the root component to begin the search
* @param x the x coordinate
* @param y the y coordinate
* @return null if <code>parent</code> doesn't contain the location,
* parent if parent is not a container or has no child that contains the
* location, otherwise the appropriate component from the conditions
* above.
*/
Component getDeepestComponentForMouseEventAt (
Component parent, int x, int y)
{
if (parent == null || (! parent.contains(x, y)))
return null;
if (! (parent instanceof Container))
return parent;
Container c = (Container) parent;
return c.findComponentForMouseEventAt(x, y);
}
Component acquireComponentForMouseEvent(MouseEvent me)
{
int x = me.getX ();
@@ -1968,7 +2065,7 @@ class LightweightDispatcher implements Serializable
while (candidate == null && parent != null)
{
candidate =
AWTUtilities.getDeepestComponentAt(parent, p.x, p.y);
getDeepestComponentForMouseEventAt(parent, p.x, p.y);
if (candidate == null || (candidate.eventMask & me.getID()) == 0)
{
candidate = null;
@@ -2069,7 +2166,10 @@ class LightweightDispatcher implements Serializable
// Don't dispatch CLICKED events whose target is not the same as the
// target for the original PRESSED event.
if (candidate != pressedComponent)
mouseEventTarget = null;
{
mouseEventTarget = null;
pressCount = 0;
}
else if (pressCount == 0)
pressedComponent = null;
}
@@ -2107,7 +2207,7 @@ class LightweightDispatcher implements Serializable
pressedComponent = null;
break;
}
MouseEvent newEvt =
AWTUtilities.convertMouseEvent(nativeContainer, me,
mouseEventTarget);
@@ -146,8 +146,8 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager
*/
private AWTKeyStroke waitForKeyStroke = null;
/** The {@link java.util.SortedSet} of current {@link
#EventDelayRequest}s. */
/** The {@link java.util.SortedSet} of current
* {@link EventDelayRequest}s. */
private SortedSet delayRequests = new TreeSet ();
public DefaultKeyboardFocusManager ()
+2
View File
@@ -519,6 +519,8 @@ paramString()
protected class AccessibleAWTDialog extends AccessibleAWTWindow
{
private static final long serialVersionUID = 4837230331833941201L;
public AccessibleRole getAccessibleRole()
{
return AccessibleRole.DIALOG;
@@ -42,7 +42,6 @@ import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
import java.awt.event.InputMethodEvent;
import java.awt.event.InvocationEvent;
import java.awt.event.WindowEvent;
import java.lang.reflect.InvocationTargetException;
import java.util.EmptyStackException;
File diff suppressed because it is too large Load Diff
@@ -362,6 +362,18 @@ public abstract class FontMetrics implements java.io.Serializable
rc = gRC;
return font.getLineMetrics(chars, begin, limit, rc);
}
/**
* Returns the bounds of the largest character in a Graphics context.
* @param context the Graphics context object.
* @return a <code>Rectangle2D</code> representing the bounds
*/
public Rectangle2D getMaxCharBounds(Graphics context)
{
if( context instanceof Graphics2D )
return font.getMaxCharBounds(((Graphics2D)context).getFontRenderContext());
return font.getMaxCharBounds( gRC );
}
/**
* Returns a {@link LineMetrics} object constructed with the
@@ -424,4 +436,13 @@ public abstract class FontMetrics implements java.io.Serializable
return gRC;
}
/**
* Returns if the font has uniform line metrics.
* @see Font#hasUniformLineMetrics()
*/
public boolean hasUniformLineMetrics()
{
return font.hasUniformLineMetrics();
}
}
+2
View File
@@ -591,6 +591,8 @@ public static Frame[] getFrames()
protected class AccessibleAWTFrame extends AccessibleAWTWindow
{
private static final long serialVersionUID = -6172960752956030250L;
public AccessibleRole getAccessibleRole()
{
return AccessibleRole.FRAME;
File diff suppressed because it is too large Load Diff
@@ -130,11 +130,10 @@ public abstract class GraphicsConfiguration
* with the given transparency. Because the buffer is volatile, it
* can be optimized by native graphics accelerators.
*
* @param w the width of the buffer
* @param h the height of the buffer
* @param width the width of the buffer
* @param height the height of the buffer
* @param transparency the transparency value for the buffer
* @return the buffered image, or null if none is supported
* @throws AWTException if the capabilities cannot be met
* @since 1.5
*/
public abstract VolatileImage createCompatibleVolatileImage(int width,
+13 -10
View File
@@ -705,17 +705,20 @@ public class GridBagLayout
if (lastInCol.containsKey(new Integer(x)))
{
Component lastComponent = (Component) lastInRow.get(new Integer(x));
GridBagConstraints lastConstraints = lookupInternalConstraints(lastComponent);
if (lastConstraints.gridheight == GridBagConstraints.RELATIVE)
if (lastComponent != null)
{
constraints.gridy = max_y - 1;
break;
}
else
{
constraints.gridy = Math.max (constraints.gridy,
lastConstraints.gridy + Math.max (1, lastConstraints.gridheight));
GridBagConstraints lastConstraints = lookupInternalConstraints(lastComponent);
if (lastConstraints.gridheight == GridBagConstraints.RELATIVE)
{
constraints.gridy = max_y - 1;
break;
}
else
{
constraints.gridy = Math.max (constraints.gridy,
lastConstraints.gridy + Math.max (1, lastConstraints.gridheight));
}
}
}
}
+13 -7
View File
@@ -38,7 +38,9 @@ exception statement from your version. */
package java.awt;
import java.awt.image.AreaAveragingScaleFilter;
import java.awt.image.FilteredImageSource;
import java.awt.image.ImageFilter;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
import java.awt.image.ReplicateScaleFilter;
@@ -141,7 +143,6 @@ public abstract class Image
* This method is only valid for off-screen objects.
*
* @return a graphics context object for an off-screen object
* @see Graphics#getcreateImage(int, int)
*/
public abstract Graphics getGraphics();
@@ -179,20 +180,25 @@ public abstract class Image
*/
public Image getScaledInstance(int width, int height, int flags)
{
ImageFilter filter;
switch (flags)
{
case SCALE_DEFAULT:
case SCALE_FAST:
case SCALE_REPLICATE:
ImageProducer producer =
new FilteredImageSource(this.getSource(),
new ReplicateScaleFilter(width, height));
return Toolkit.getDefaultToolkit().createImage(producer);
case SCALE_SMOOTH:
filter = new ReplicateScaleFilter(width, height);
break;
case SCALE_AREA_AVERAGING:
filter = new AreaAveragingScaleFilter(width, height);
break;
case SCALE_SMOOTH:
throw new Error("SCALE_SMOOTH: not implemented");
default:
throw new Error("not implemented");
throw new Error("Unknown flag or not implemented: " + flags);
}
ImageProducer producer = new FilteredImageSource(getSource(), filter);
return Toolkit.getDefaultToolkit().createImage(producer);
}
/**
@@ -39,6 +39,7 @@ exception statement from your version. */
package java.awt;
import java.applet.Applet;
import java.awt.FocusTraversalPolicy;
import java.awt.event.FocusEvent;
import java.awt.event.KeyEvent;
import java.awt.event.WindowEvent;
@@ -213,7 +214,7 @@ public abstract class KeyboardFocusManager
currentFocusOwners */
private static Map currentFocusCycleRoots = new HashMap ();
/** The default {@link FocusTraveralPolicy} that focus-managing
/** The default {@link FocusTraversalPolicy} that focus-managing
{@link Container}s will use to define their initial focus
traversal policy. */
private FocusTraversalPolicy defaultPolicy;
@@ -287,53 +288,13 @@ public abstract class KeyboardFocusManager
KeyboardFocusManager manager;
if (m == null)
manager = createFocusManager();
manager = new DefaultKeyboardFocusManager();
else
manager = m;
currentKeyboardFocusManagers.put (currentGroup, manager);
}
/**
* Creates a KeyboardFocusManager. The exact class is determined by the
* system property 'gnu.java.awt.FocusManager'. If this is not set,
* we default to DefaultKeyboardFocusManager.
*/
private static KeyboardFocusManager createFocusManager()
{
String fmClassName = System.getProperty("gnu.java.awt.FocusManager",
"java.awt.DefaultKeyboardFocusManager");
try
{
Class fmClass = Class.forName(fmClassName);
KeyboardFocusManager fm = (KeyboardFocusManager) fmClass.newInstance();
return fm;
}
catch (ClassNotFoundException ex)
{
System.err.println("The class " + fmClassName + " cannot be found.");
System.err.println("Check the setting of the system property");
System.err.println("gnu.java.awt.FocusManager");
return null;
}
catch (InstantiationException ex)
{
System.err.println("The class " + fmClassName + " cannot be");
System.err.println("instantiated.");
System.err.println("Check the setting of the system property");
System.err.println("gnu.java.awt.FocusManager");
return null;
}
catch (IllegalAccessException ex)
{
System.err.println("The class " + fmClassName + " cannot be");
System.err.println("accessed.");
System.err.println("Check the setting of the system property");
System.err.println("gnu.java.awt.FocusManager");
return null;
}
}
/**
* Retrieve the {@link Component} that has the keyboard focus, or
* null if the focus owner was not set by a thread in the current
@@ -1364,11 +1325,11 @@ public abstract class KeyboardFocusManager
*
* @return a global object set by the current ThreadGroup, or null
*
* @see getFocusOwner
* @see getPermanentFocusOwner
* @see getFocusedWindow
* @see getActiveWindow
* @see getCurrentFocusCycleRoot
* @see #getFocusOwner()
* @see #getPermanentFocusOwner()
* @see #getFocusedWindow()
* @see #getActiveWindow()
* @see #getCurrentFocusCycleRoot()
*/
private Object getObject (Map globalMap)
{
@@ -1388,11 +1349,11 @@ public abstract class KeyboardFocusManager
* @throws SecurityException if this is not the keyboard focus
* manager associated with the current {@link java.lang.ThreadGroup}
*
* @see getGlobalFocusOwner
* @see getGlobalPermanentFocusOwner
* @see getGlobalFocusedWindow
* @see getGlobalActiveWindow
* @see getGlobalCurrentFocusCycleRoot
* @see #getGlobalFocusOwner()
* @see #getGlobalPermanentFocusOwner()
* @see #getGlobalFocusedWindow()
* @see #getGlobalActiveWindow()
* @see #getGlobalCurrentFocusCycleRoot()
*/
private Object getGlobalObject (Map globalMap)
{
@@ -1432,11 +1393,11 @@ public abstract class KeyboardFocusManager
* @param newObject the object to set
* @param property the property that will change
*
* @see setGlobalFocusOwner
* @see setGlobalPermanentFocusOwner
* @see setGlobalFocusedWindow
* @see setGlobalActiveWindow
* @see setGlobalCurrentFocusCycleRoot
* @see #setGlobalFocusOwner(Component)
* @see #setGlobalPermanentFocusOwner(Component)
* @see #setGlobalFocusedWindow(Window)
* @see #setGlobalActiveWindow(Window)
* @see #setGlobalCurrentFocusCycleRoot(Container)
*/
private void setGlobalObject (Map globalMap,
Object newObject,
+10 -5
View File
@@ -1088,18 +1088,23 @@ paramString()
protected class AccessibleAWTList extends AccessibleAWTComponent
implements AccessibleSelection, ItemListener, ActionListener
{
private static final long serialVersionUID = 7924617370136012829L;
protected class AccessibleAWTListChild extends AccessibleAWTComponent
implements Accessible
{
private int index;
private static final long serialVersionUID = 4412022926028300317L;
// Field names are fixed by serialization spec.
private List parent;
private int indexInParent;
public AccessibleAWTListChild(List parent, int indexInParent)
{
this.parent = parent;
index = indexInParent;
this.indexInParent = indexInParent;
if (parent == null)
index = -1;
this.indexInParent = -1;
}
/* (non-Javadoc)
@@ -1118,14 +1123,14 @@ paramString()
public AccessibleStateSet getAccessibleStateSet()
{
AccessibleStateSet states = super.getAccessibleStateSet();
if (parent.isIndexSelected(index))
if (parent.isIndexSelected(indexInParent))
states.add(AccessibleState.SELECTED);
return states;
}
public int getAccessibleIndexInParent()
{
return index;
return indexInParent;
}
}
+2
View File
@@ -441,6 +441,8 @@ paramString()
*/
protected class AccessibleAWTMenu extends AccessibleAWTMenuItem
{
private static final long serialVersionUID = 5228160894980069094L;
protected AccessibleAWTMenu()
{
}
@@ -1157,7 +1157,7 @@ protected abstract class AccessibleAWTMenuComponent
* the appropriate information.
*
* @param color the new color to use for the background.
* @see getBackground()
* @see #getBackground()
*/
public void setBackground(Color color)
{
@@ -1217,7 +1217,7 @@ protected abstract class AccessibleAWTMenuComponent
*
* @param enabled true if the component should be enabled,
* false otherwise.
* @see #getEnabled()
* @see #isEnabled()
*/
public void setEnabled(boolean enabled)
{
+2
View File
@@ -108,6 +108,8 @@ private transient ActionListener action_listeners;
extends MenuComponent.AccessibleAWTMenuComponent
implements AccessibleAction, AccessibleValue
{
private static final long serialVersionUID = -217847831945965825L;
/** Constructor */
public AccessibleAWTMenuItem()
{
+4
View File
@@ -226,6 +226,10 @@ public class Point extends Point2D implements Serializable
*/
public boolean equals(Object obj)
{
// NOTE: No special hashCode() method is required for this class,
// as this equals() implementation is functionally equivalent to
// super.equals(), which does define a proper hashCode().
if (! (obj instanceof Point2D))
return false;
Point2D p = (Point2D) obj;
-1
View File
@@ -544,7 +544,6 @@ public class Polygon implements Shape, Serializable
* the positive X, or Y axis, within a given interval.
*
* @return the winding number.
* @see #condensed
* @see #contains(double, double)
*/
private int evaluateCrossings(double x, double y, boolean useYaxis,
@@ -140,6 +140,8 @@ show(Component component, int x, int y)
protected class AccessibleAWTPopupMenu extends AccessibleAWTMenu
{
private static final long serialVersionUID = -4282044795947239955L;
protected AccessibleAWTPopupMenu()
{
}
@@ -727,6 +727,10 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public boolean equals(Object obj)
{
// NOTE: No special hashCode() method is required for this class,
// as this equals() implementation is functionally equivalent to
// super.equals(), which does define a proper hashCode().
if (! (obj instanceof Rectangle2D))
return false;
Rectangle2D r = (Rectangle2D) obj;
+3 -1
View File
@@ -401,7 +401,7 @@ setScrollPosition(int x, int y)
public void
addNotify()
{
if (!isDisplayable ())
if (peer != null)
return;
setPeer((ComponentPeer)getToolkit().createScrollPane(this));
@@ -592,6 +592,8 @@ paramString()
protected class AccessibleAWTScrollPane extends AccessibleAWTContainer
{
private static final long serialVersionUID = 6100703663886637L;
public AccessibleRole getAccessibleRole()
{
return AccessibleRole.SCROLL_PANE;
@@ -87,12 +87,16 @@ public class ScrollPaneAdjustable
public void addAdjustmentListener (AdjustmentListener listener)
{
AWTEventMulticaster.add (adjustmentListener, listener);
if (listener == null)
return;
adjustmentListener = AWTEventMulticaster.add (adjustmentListener, listener);
}
public void removeAdjustmentListener (AdjustmentListener listener)
{
AWTEventMulticaster.remove (adjustmentListener, listener);
if (listener == null)
return;
adjustmentListener = AWTEventMulticaster.remove (adjustmentListener, listener);
}
public AdjustmentListener[] getAdjustmentListeners ()
+2
View File
@@ -603,6 +603,8 @@ public class TextArea extends TextComponent implements java.io.Serializable
protected class AccessibleAWTTextArea extends AccessibleAWTTextComponent
{
private static final long serialVersionUID = 3472827823632144419L;
protected AccessibleAWTTextArea()
{
}
@@ -107,6 +107,8 @@ protected transient TextListener textListener;
extends AccessibleAWTComponent
implements AccessibleText, TextListener
{
private static final long serialVersionUID = 3631432373506317811L;
// Constructor
// Adds a listener for tracking caret changes
public AccessibleAWTTextComponent()
@@ -523,6 +523,8 @@ paramString()
protected class AccessibleAWTTextField extends AccessibleAWTTextComponent
{
private static final long serialVersionUID = 6219164359235943158L;
protected AccessibleAWTTextField()
{
}
+79 -31
View File
@@ -101,6 +101,8 @@ public class Window extends Container implements Accessible
protected class AccessibleAWTWindow extends AccessibleAWTContainer
{
private static final long serialVersionUID = 4215068635060671780L;
public AccessibleRole getAccessibleRole()
{
return AccessibleRole.WINDOW;
@@ -278,14 +280,14 @@ public class Window extends Container implements Accessible
*/
public void show()
{
synchronized (getTreeLock())
{
if (parent != null && !parent.isDisplayable())
parent.addNotify();
if (peer == null)
addNotify();
// Show visible owned windows.
synchronized (getTreeLock())
{
Iterator e = ownedWindows.iterator();
while(e.hasNext())
{
@@ -302,14 +304,13 @@ public class Window extends Container implements Accessible
// synchronous access to ownedWindows there.
e.remove();
}
}
validate();
super.show();
toFront();
KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
manager.setGlobalFocusedWindow (this);
if (!shown)
{
FocusTraversalPolicy policy = getFocusTraversalPolicy ();
@@ -323,6 +324,7 @@ public class Window extends Container implements Accessible
shown = true;
}
}
}
public void hide()
@@ -346,13 +348,6 @@ public class Window extends Container implements Accessible
super.hide();
}
public boolean isDisplayable()
{
if (super.isDisplayable())
return true;
return peer != null;
}
/**
* Destroys any resources associated with this window. This includes
* all components in the window and all owned top-level windows.
@@ -808,20 +803,81 @@ public class Window extends Container implements Accessible
return isVisible();
}
public void setLocationRelativeTo (Component c)
public void setLocationRelativeTo(Component c)
{
if (c == null || !c.isShowing ())
int x = 0;
int y = 0;
if (c == null || !c.isShowing())
{
int x = 0;
int y = 0;
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment ();
Point center = ge.getCenterPoint ();
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
Point center = ge.getCenterPoint();
x = center.x - (width / 2);
y = center.y - (height / 2);
setLocation (x, y);
}
// FIXME: handle case where component is non-null.
else
{
int cWidth = c.getWidth();
int cHeight = c.getHeight();
Dimension screenSize = getToolkit().getScreenSize();
x = c.getLocationOnScreen().x;
y = c.getLocationOnScreen().y;
// If bottom of component is cut off, window placed
// on the left or the right side of component
if ((y + cHeight) > screenSize.height)
{
// If the right side of the component is closer to the center
if ((screenSize.width / 2 - x) <= 0)
{
if ((x - width) >= 0)
x -= width;
else
x = 0;
}
else
{
if ((x + cWidth + width) <= screenSize.width)
x += cWidth;
else
x = screenSize.width - width;
}
y = screenSize.height - height;
}
else if (cWidth > width || cHeight > height)
{
// If right side of component is cut off
if ((x + width) > screenSize.width)
x = screenSize.width - width;
// If left side of component is cut off
else if (x < 0)
x = 0;
else
x += (cWidth - width) / 2;
y += (cHeight - height) / 2;
}
else
{
// If right side of component is cut off
if ((x + width) > screenSize.width)
x = screenSize.width - width;
// If left side of component is cut off
else if (x < 0 || (x - (width - cWidth) / 2) < 0)
x = 0;
else
x -= (width - cWidth) / 2;
if ((y - (height - cHeight) / 2) > 0)
y -= (height - cHeight) / 2;
else
y = 0;
}
}
setLocation(x, y);
}
/**
@@ -938,8 +994,8 @@ public class Window extends Container implements Accessible
*
* @since 1.4
*/
public void createBufferStrategy(int numBuffers,
BufferCapabilities caps)
public void createBufferStrategy(int numBuffers, BufferCapabilities caps)
throws AWTException
{
if (numBuffers < 1)
throw new IllegalArgumentException("Window.createBufferStrategy: number"
@@ -951,15 +1007,7 @@ public class Window extends Container implements Accessible
// a flipping strategy was requested
if (caps.isPageFlipping())
{
try
{
bufferStrategy = new WindowFlipBufferStrategy(numBuffers);
}
catch (AWTException e)
{
}
}
bufferStrategy = new WindowFlipBufferStrategy(numBuffers);
else
bufferStrategy = new WindowBltBufferStrategy(numBuffers, true);
}
@@ -324,11 +324,11 @@ public class ICC_Profile implements Serializable
* An instance of the specialized classes ICC_ProfileRGB or ICC_ProfileGray
* may be returned if appropriate.
*
* @throws IllegalArgumentException if the profile data is an invalid
* v2 profile.
*
* @param data - the profile data
* @return An ICC_Profile object
*
* @throws IllegalArgumentException if the profile data is an invalid
* v2 profile.
*/
public static ICC_Profile getInstance(byte[] data)
{
@@ -373,12 +373,12 @@ public class ICC_Profile implements Serializable
* An instance of the specialized classes ICC_ProfileRGB or ICC_ProfileGray
* may be returned if appropriate.
*
* @param filename - the file name of the profile file.
* @return An ICC_Profile object
*
* @throws IllegalArgumentException if the profile data is an invalid
* v2 profile.
* @throws IOException if the file could not be read.
*
* @param filename - the file name of the profile file.
* @return An ICC_Profile object
*/
public static ICC_Profile getInstance(String filename)
throws IOException
@@ -400,12 +400,12 @@ public class ICC_Profile implements Serializable
* An instance of the specialized classes ICC_ProfileRGB or ICC_ProfileGray
* may be returned if appropriate.
*
* @param in - the input stream to read the profile from.
* @return An ICC_Profile object
*
* @throws IllegalArgumentException if the profile data is an invalid
* v2 profile.
* @throws IOException if the stream could not be read.
*
* @param in - the input stream to read the profile from.
* @return An ICC_Profile object
*/
public static ICC_Profile getInstance(InputStream in)
throws IOException
@@ -197,16 +197,27 @@ public abstract class InputEvent extends ComponentEvent
private final long when;
/**
* The modifiers in effect for this event. Package visible for use by
* subclasses. The old style (bitmask 0x3f) should not be mixed with the
* new style (bitmasks 0xffffffc0).
* The old-style modifiers in effect for this event. Package visible
* for use by subclasses. The old style (bitmask 0x3f) should not be
* mixed with the new style (bitmasks 0xffffffc0).
*
* @see #getModifiers()
* @see MouseEvent
* @serial the modifier state, stored in the new style
* @serial the modifier state, stored in the old style
*/
int modifiers;
/**
* The new-style modifiers in effect for this event. Package visible
* for use by subclasses. The old style (bitmask 0x3f) should not be
* mixed with the new style (bitmasks 0xffffffc0).
*
* @see #getModifiersEx()
* @see MouseEvent
* @serial the modifier state, stored in the new style
*/
int modifiersEx;
/**
* Initializes a new instance of <code>InputEvent</code> with the specified
* source, id, timestamp, and modifiers. Note that an invalid id leads to
@@ -222,7 +233,8 @@ public abstract class InputEvent extends ComponentEvent
{
super(source, id);
this.when = when;
this.modifiers = EventModifier.extend(modifiers);
this.modifiers = modifiers & EventModifier.OLD_MASK;
this.modifiersEx = modifiers & EventModifier.NEW_MASK;
}
/**
@@ -232,7 +244,8 @@ public abstract class InputEvent extends ComponentEvent
*/
public boolean isShiftDown()
{
return (modifiers & SHIFT_DOWN_MASK) != 0;
return ((modifiers & SHIFT_MASK) != 0)
|| ((modifiersEx & SHIFT_DOWN_MASK) != 0);
}
/**
@@ -243,7 +256,8 @@ public abstract class InputEvent extends ComponentEvent
*/
public boolean isControlDown()
{
return (modifiers & CTRL_DOWN_MASK) != 0;
return ((modifiers & CTRL_MASK) != 0)
|| ((modifiersEx & CTRL_DOWN_MASK) != 0);
}
/**
@@ -253,7 +267,8 @@ public abstract class InputEvent extends ComponentEvent
*/
public boolean isMetaDown()
{
return (modifiers & META_DOWN_MASK) != 0;
return ((modifiers & META_MASK) != 0)
|| ((modifiersEx & META_DOWN_MASK) != 0);
}
/**
@@ -263,7 +278,8 @@ public abstract class InputEvent extends ComponentEvent
*/
public boolean isAltDown()
{
return (modifiers & ALT_DOWN_MASK) != 0;
return ((modifiers & ALT_MASK) != 0)
|| ((modifiersEx & ALT_DOWN_MASK) != 0);
}
/**
@@ -274,7 +290,8 @@ public abstract class InputEvent extends ComponentEvent
*/
public boolean isAltGraphDown()
{
return (modifiers & ALT_GRAPH_DOWN_MASK) != 0;
return ((modifiers & ALT_GRAPH_MASK) != 0)
|| ((modifiersEx & ALT_GRAPH_DOWN_MASK) != 0);
}
/**
@@ -300,7 +317,7 @@ public abstract class InputEvent extends ComponentEvent
*/
public int getModifiers()
{
return EventModifier.revert(modifiers);
return modifiers;
}
/**
@@ -321,7 +338,7 @@ public abstract class InputEvent extends ComponentEvent
*/
public int getModifiersEx()
{
return modifiers;
return modifiersEx;
}
/**
@@ -106,6 +106,13 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent
*/
private Exception exception;
/**
* This is the caught Throwable thrown in the <code>run()</code> method.
* It is null if throwables are ignored, the run method hasn't completed,
* or there were no throwables thrown.
*/
private Throwable throwable;
/**
* The timestamp when this event was created.
*
@@ -183,9 +190,11 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent
{
runnable.run();
}
catch (Exception e)
catch (Throwable t)
{
exception = e;
throwable = t;
if (t instanceof Exception)
exception = (Exception)t;
}
else
runnable.run();
@@ -210,6 +219,18 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent
return exception;
}
/**
* Returns a throwable caught while executing the Runnable's run() method.
* Null if none was thrown or if this InvocationEvent doesn't catch
* throwables.
* @return the caught Throwable
* @since 1.5
*/
public Throwable getThrowable()
{
return throwable;
}
/**
* Gets the timestamp of when this event was created.
*
@@ -1735,6 +1735,6 @@ public class KeyEvent extends InputEvent
throws IOException, ClassNotFoundException
{
s.defaultReadObject();
modifiers = EventModifier.extend(modifiers);
modifiersEx = EventModifier.extend(modifiers) & EventModifier.NEW_MASK;
}
} // class KeyEvent
@@ -42,6 +42,7 @@ import gnu.java.awt.EventModifier;
import java.awt.Component;
import java.awt.Point;
import java.awt.PopupMenu;
import java.io.IOException;
import java.io.ObjectInputStream;
@@ -227,6 +228,12 @@ public class MouseEvent extends InputEvent
else if ((modifiers & BUTTON3_MASK) != 0)
this.button = BUTTON3;
}
// clear the mouse button modifier masks if this is a button
// release event.
if (id == MOUSE_RELEASED)
this.modifiersEx &= ~(BUTTON1_DOWN_MASK
| BUTTON2_DOWN_MASK
| BUTTON3_DOWN_MASK);
}
/**
@@ -392,17 +399,9 @@ public class MouseEvent extends InputEvent
s.append("unknown type,(");
}
s.append(x).append(',').append(y).append("),button=").append(button);
if ((modifiers & EventModifier.NEW_MASK) != 0)
{
int mod = modifiers;
if ((mod & (ALT_DOWN_MASK | BUTTON2_DOWN_MASK)) != 0)
mod |= ALT_DOWN_MASK | BUTTON2_DOWN_MASK;
if ((mod & (META_DOWN_MASK | BUTTON3_DOWN_MASK)) != 0)
mod |= META_DOWN_MASK | BUTTON3_DOWN_MASK;
s.append(",modifiers=").append(getModifiersExText(mod));
}
if (modifiers != 0)
s.append(",extModifiers=").append(getModifiersExText(modifiers));
// FIXME: need a mauve test for this method
if (modifiersEx != 0)
s.append(",extModifiers=").append(getModifiersExText(modifiersEx));
return s.append(",clickCount=").append(clickCount).toString();
}
@@ -426,7 +425,7 @@ public class MouseEvent extends InputEvent
button = BUTTON2;
else if ((modifiers & BUTTON3_MASK) != 0)
button = BUTTON3;
modifiers = EventModifier.extend(modifiers);
modifiersEx = EventModifier.extend(modifiers) & EventModifier.NEW_MASK;
}
}
} // class MouseEvent
+1 -1
View File
@@ -1215,7 +1215,7 @@ public class Area implements Shape, Cloneable
* @param t1 - global parametric value of the first curve's starting point
* @param t2 - global parametric value of the second curve's starting point
* @param w1 - global parametric length of curve 1
* @param c1 - global parametric length of curve 2
* @param w2 - global parametric length of curve 2
*
* The final four parameters are for keeping track of the parametric
* value of the curve. For a full curve t = 0, w = 1, w is halved with
@@ -558,7 +558,8 @@ public final class GeneralPath implements Shape, Cloneable
* Constructs a new iterator for enumerating the segments of a
* GeneralPath.
*
* @param at an affine transformation for projecting the returned
* @param path the path to enumerate
* @param transform an affine transformation for projecting the returned
* points, or <code>null</code> to return the original points
* without any mapping.
*/
@@ -49,6 +49,7 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.text.AttributedCharacterIterator.Attribute;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
@@ -334,7 +335,7 @@ public class InputContext
/**
* Starts a reconversion operation in the current input method. The input
* method gets theh text to reconvert from the client component, using
* method gets the text to reconvert from the client component, using
* {@link InputMethodRequests#getSelectedText(Attribute[])}. Then the
* composed and committed text produced by the operation is sent back to
* the client using a sequence of InputMethodRequests.
@@ -37,6 +37,9 @@ exception statement from your version. */
package java.awt.im;
import java.awt.Toolkit;
import java.text.Annotation;
import java.text.AttributedCharacterIterator;
import java.util.Map;
/**
@@ -53,7 +56,7 @@ import java.util.Map;
* text segments.
*
* @author Eric Blake (ebb9@email.byu.edu)
* @see AttributedCharacterIterators
* @see AttributedCharacterIterator
* @see Annotation
* @since 1.2
* @status updated to 1.4
@@ -37,8 +37,10 @@ exception statement from your version. */
package java.awt.im;
import java.awt.Component;
import java.awt.Rectangle;
import java.awt.font.TextHitInfo;
import java.awt.event.InputMethodListener;
import java.text.AttributedCharacterIterator;
import java.text.AttributedCharacterIterator.Attribute;
@@ -38,7 +38,11 @@ exception statement from your version. */
package java.awt.im.spi;
import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.Rectangle;
import java.awt.im.InputContext;
import java.awt.im.InputMethodRequests;
import java.text.AttributedCharacterIterator.Attribute;
import java.util.Locale;
/**
@@ -152,8 +156,8 @@ public interface InputMethod
* Notify this input method of changes in the client window. This is called
* when notifications are enabled (see {@link
* InputMethodContext#enableClientWindowNotification(InputMethod, boolean)},
* if {@link #removeNotify(Component)} has not been called. The following
* situations trigger a notification:<ul>
* if {@link InputContext#removeNotify(Component)} has not been called.
* The following situations trigger a notification:<ul>
* <li>The client window changes in location, size, visibility,
* iconification, or is closed.</li>
* <li>When enabling client notification (or on the first activation after
@@ -202,7 +206,7 @@ public interface InputMethod
/**
* Notify the input method that a client component has been removed from its
* hierarchy, or that input method support has been disabled. This is
* called by {@link InputContext#removeNotify()}, and only when the input
* called by {@link InputContext#removeNotify(Component)}, and only when the input
* method is inactive.
*/
void removeNotify();
@@ -38,6 +38,8 @@ exception statement from your version. */
package java.awt.im.spi;
import java.awt.HeadlessException;
import java.awt.Rectangle;
import java.awt.Window;
import java.awt.font.TextHitInfo;
import java.awt.im.InputMethodRequests;
@@ -113,7 +115,7 @@ public interface InputMethodContext extends InputMethodRequests
/**
* Sets whether notification of the client window's location and state should
* be enabled for the input method. When enabled, the input method's
* {@link #notifyClientWindowChange(Rectangle)} method is called.
* {@link InputMethod#notifyClientWindowChange(Rectangle)} method is called.
* Notification is automatically disabled when the input method is disposed.
*
* @param inputMethod the method to change status of
@@ -39,6 +39,7 @@ package java.awt.im.spi;
import java.awt.AWTException;
import java.awt.Image;
import java.awt.im.InputContext;
import java.util.Locale;
/**
@@ -57,7 +58,7 @@ public interface InputMethodDescriptor
* also by country and variant), via
* {@link InputContext#selectInputMethod(Locale)}. The returned list should
* ignore pass-through locales, so it is usually a subset of locales for
* which {@link InputMethod#setContext(Locale)} returns true. If
* which {@link InputMethod#setLocale(Locale)} returns true. If
* {@link #hasDynamicLocaleList()} returns true, this is called each time
* information is needed, allowing dynamic addition or removal of supported
* locales.
@@ -45,7 +45,7 @@ package java.awt.image;
* points should give the desired results although Sun does not
* specify what the exact algorithm should be.
* <br>
* Currently this filter does nothing and needs to be implemented.
* FIXME: Currently this filter does nothing and needs to be implemented.
*
* @author C. Brian Jones (cbj@gnu.org)
*/
@@ -1,5 +1,5 @@
/* BufferedImage.java --
Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation
This file is part of GNU Classpath.
@@ -48,9 +48,7 @@ import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Transparency;
import java.awt.color.ColorSpace;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Vector;
/**
@@ -64,7 +62,7 @@ import java.util.Vector;
* @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
*/
public class BufferedImage extends Image
implements WritableRenderedImage
implements WritableRenderedImage, Transparency
{
public static final int TYPE_CUSTOM = 0,
TYPE_INT_RGB = 1,
@@ -690,4 +688,16 @@ public class BufferedImage extends Image
observers.remove (to);
}
/**
* Return the transparency type.
*
* @return One of {@link #OPAQUE}, {@link #BITMASK}, or {@link #TRANSLUCENT}.
* @see Transparency#getTransparency()
* @since 1.5
*/
public int getTransparency()
{
return colorModel.getTransparency();
}
}
@@ -609,7 +609,7 @@ public abstract class ColorModel implements Transparency
* @param obj Array of TransferType or null.
*
* @return pixel value encoded according to the color model.
* @throws ArrayIndexOutOfBounds
* @throws ArrayIndexOutOfBoundsException
* @throws ClassCastException
* @since 1.4
*/
@@ -63,8 +63,11 @@ public class ComponentSampleModel extends SampleModel
protected int[] bandOffsets;
protected int[] bankIndices;
// FIXME: Should we really shadow the numBands in the superclass?
//protected int numBands;
/**
* Number of bands in the image described.
* @specnote This field shadows the protected numBands in SampleModel.
*/
protected int numBands;
/** Used when creating data buffers. */
protected int numBanks;
@@ -100,6 +103,7 @@ public class ComponentSampleModel extends SampleModel
this.bandOffsets = bandOffsets;
this.bankIndices = bankIndices;
this.numBands = bandOffsets.length;
this.numBanks = 0;
for (int b=0; b<bankIndices.length; b++)
@@ -75,7 +75,7 @@ public interface ImageConsumer
* most one call to <code>setPixels</code> for any single pixel.
*
* @see #setHints
* @see #setPixels
* @see #setPixels(int, int, int, int, ColorModel, int[], int, int)
*/
int SINGLEPASS = 8;
@@ -90,11 +90,7 @@ public abstract class PackedColorModel extends ColorModel
return bitsPerComponent;
}
/** Initializes the masks.
*
* @return an array containing the number of bits per color
* component.
*/
/** Initializes the masks. */
private void initMasks(int[] colorMaskArray, int alphaMask)
{
int numComponents = colorMaskArray.length;
@@ -47,7 +47,8 @@ public abstract class SampleModel
/** Height of image described. */
protected int height;
/** Number of bands in the image described. */
/** Number of bands in the image described. Package-private here,
shadowed by ComponentSampleModel. */
protected int numBands;
/**
@@ -169,8 +169,11 @@ public abstract class PrinterJob
/**
* Prints the page with given attributes.
*/
public abstract void print (PrintRequestAttributeSet attributes)
throws PrinterException;
public void print (PrintRequestAttributeSet attributes)
throws PrinterException
{
print ();
}
/**
* Displays a dialog box to the user which allows the print job