提交 575bb5aa 编写于 作者: C coleenp

Merge

...@@ -223,3 +223,4 @@ c4908732fef5235f1b98cafe0ce507771ef7892c jdk8-b98 ...@@ -223,3 +223,4 @@ c4908732fef5235f1b98cafe0ce507771ef7892c jdk8-b98
6a099a36589bd933957272ba63e5263bede29971 jdk8-b99 6a099a36589bd933957272ba63e5263bede29971 jdk8-b99
5be9c5bfcfe9b2a40412b4fb364377d49de014eb jdk8-b100 5be9c5bfcfe9b2a40412b4fb364377d49de014eb jdk8-b100
6901612328239fbd471d20823113c1cf3fdaebee jdk8-b101 6901612328239fbd471d20823113c1cf3fdaebee jdk8-b101
8ed8e2b4b90e0ac9aa5b3efef51cd576a9db96a9 jdk8-b102
...@@ -798,6 +798,16 @@ ifeq ($(OPENJDK_TARGET_OS),solaris) ...@@ -798,6 +798,16 @@ ifeq ($(OPENJDK_TARGET_OS),solaris)
LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15 LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
endif endif
ifeq ($(OPENJDK_TARGET_OS),linux)
ifndef OPENJDK
include $(JDK_TOPDIR)/make/closed/xawt.gmk
endif
ifeq ($(DISABLE_XRENDER),true)
LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
endif
endif
ifeq ($(MILESTONE),internal) ifeq ($(MILESTONE),internal)
LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD
endif endif
......
...@@ -1856,7 +1856,10 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing ...@@ -1856,7 +1856,10 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
// If we're not valid that means we will shortly be validated and // If we're not valid that means we will shortly be validated and
// painted, which means we don't have to do anything here. // painted, which means we don't have to do anything here.
if (!isRunsDirty && index >= 0 && index < tabPane.getTabCount()) { if (!isRunsDirty && index >= 0 && index < tabPane.getTabCount()) {
tabPane.repaint(getTabBounds(tabPane, index)); Rectangle rect = getTabBounds(tabPane, index);
if (rect != null) {
tabPane.repaint(rect);
}
} }
} }
......
...@@ -701,6 +701,20 @@ public class AquaTabbedPaneUI extends AquaTabbedPaneCopyFromBasicUI { ...@@ -701,6 +701,20 @@ public class AquaTabbedPaneUI extends AquaTabbedPaneCopyFromBasicUI {
return false; return false;
} }
/**
* Returns the bounds of the specified tab index. The bounds are
* with respect to the JTabbedPane's coordinate space. If the tab at this
* index is not currently visible in the UI, then returns null.
*/
@Override
public Rectangle getTabBounds(final JTabbedPane pane, final int i) {
if (visibleTabState.needsScrollTabs()
&& (visibleTabState.isBefore(i) || visibleTabState.isAfter(i))) {
return null;
}
return super.getTabBounds(pane, i);
}
/** /**
* Returns the tab index which intersects the specified point * Returns the tab index which intersects the specified point
* in the JTabbedPane's coordinate space. * in the JTabbedPane's coordinate space.
......
...@@ -830,18 +830,19 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo ...@@ -830,18 +830,19 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
// UTILITY METHODS // UTILITY METHODS
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
/* /**
* Find image to install into Title or into Application icon. * Find image to install into Title or into Application icon. First try
* First try icons installed for toplevel. If there is no icon * icons installed for toplevel. Null is returned, if there is no icon and
* use default Duke image. * default Duke image should be used.
* This method shouldn't return null.
*/ */
private CImage getImageForTarget() { private CImage getImageForTarget() {
List<Image> icons = target.getIconImages(); CImage icon = null;
if (icons == null || icons.size() == 0) { try {
return null; icon = CImage.getCreator().createFromImages(target.getIconImages());
} catch (Exception ignored) {
// Perhaps the icon passed into Java is broken. Skipping this icon.
} }
return CImage.getCreator().createFromImages(icons); return icon;
} }
/* /*
......
...@@ -42,7 +42,7 @@ import java.util.EventListener; ...@@ -42,7 +42,7 @@ import java.util.EventListener;
* Container events are provided for notification purposes ONLY; * Container events are provided for notification purposes ONLY;
* The AWT will automatically handle add and remove operations * The AWT will automatically handle add and remove operations
* internally so the program works properly regardless of * internally so the program works properly regardless of
* whether the program registers a <code>ComponentListener</code> or not. * whether the program registers a {@code ContainerListener} or not.
* *
* @see ContainerAdapter * @see ContainerAdapter
* @see ContainerEvent * @see ContainerEvent
......
...@@ -55,7 +55,7 @@ import java.awt.Image; ...@@ -55,7 +55,7 @@ import java.awt.Image;
* Alternatively, the contents of the back buffer can be copied, or * Alternatively, the contents of the back buffer can be copied, or
* <i>blitted</i> forward in a chain instead of moving the video pointer. * <i>blitted</i> forward in a chain instead of moving the video pointer.
* <p> * <p>
* <pre> * <pre>{@code
* Double buffering: * Double buffering:
* *
* *********** *********** * *********** ***********
...@@ -72,7 +72,7 @@ import java.awt.Image; ...@@ -72,7 +72,7 @@ import java.awt.Image;
* * * <------ * * <----- * * * * * <------ * * <----- * *
* *********** *********** *********** * *********** *********** ***********
* *
* </pre> * }</pre>
* <p> * <p>
* Here is an example of how buffer strategies can be created and used: * Here is an example of how buffer strategies can be created and used:
* <pre><code> * <pre><code>
......
...@@ -602,12 +602,12 @@ public class BufferedImage extends java.awt.Image ...@@ -602,12 +602,12 @@ public class BufferedImage extends java.awt.Image
* the raster has been premultiplied with alpha. * the raster has been premultiplied with alpha.
* @param properties <code>Hashtable</code> of * @param properties <code>Hashtable</code> of
* <code>String</code>/<code>Object</code> pairs. * <code>String</code>/<code>Object</code> pairs.
* @exception <code>RasterFormatException</code> if the number and * @exception RasterFormatException if the number and
* types of bands in the <code>SampleModel</code> of the * types of bands in the <code>SampleModel</code> of the
* <code>Raster</code> do not match the number and types required by * <code>Raster</code> do not match the number and types required by
* the <code>ColorModel</code> to represent its color and alpha * the <code>ColorModel</code> to represent its color and alpha
* components. * components.
* @exception <code>IllegalArgumentException</code> if * @exception IllegalArgumentException if
* <code>raster</code> is incompatible with <code>cm</code> * <code>raster</code> is incompatible with <code>cm</code>
* @see ColorModel * @see ColorModel
* @see Raster * @see Raster
...@@ -927,7 +927,7 @@ public class BufferedImage extends java.awt.Image ...@@ -927,7 +927,7 @@ public class BufferedImage extends java.awt.Image
* each color component in the returned data when * each color component in the returned data when
* using this method. With a specified coordinate (x,&nbsp;y) in the * using this method. With a specified coordinate (x,&nbsp;y) in the
* image, the ARGB pixel can be accessed in this way: * image, the ARGB pixel can be accessed in this way:
* </p> * <p>
* *
* <pre> * <pre>
* pixel = rgbArray[offset + (y-startY)*scansize + (x-startX)]; </pre> * pixel = rgbArray[offset + (y-startY)*scansize + (x-startX)]; </pre>
...@@ -1131,7 +1131,7 @@ public class BufferedImage extends java.awt.Image ...@@ -1131,7 +1131,7 @@ public class BufferedImage extends java.awt.Image
* @return an {@link Object} that is the property referred to by the * @return an {@link Object} that is the property referred to by the
* specified <code>name</code> or <code>null</code> if the * specified <code>name</code> or <code>null</code> if the
* properties of this image are not yet known. * properties of this image are not yet known.
* @throws <code>NullPointerException</code> if the property name is null. * @throws NullPointerException if the property name is null.
* @see ImageObserver * @see ImageObserver
* @see java.awt.Image#UndefinedProperty * @see java.awt.Image#UndefinedProperty
*/ */
...@@ -1144,7 +1144,7 @@ public class BufferedImage extends java.awt.Image ...@@ -1144,7 +1144,7 @@ public class BufferedImage extends java.awt.Image
* @param name the property name * @param name the property name
* @return an <code>Object</code> that is the property referred to by * @return an <code>Object</code> that is the property referred to by
* the specified <code>name</code>. * the specified <code>name</code>.
* @throws <code>NullPointerException</code> if the property name is null. * @throws NullPointerException if the property name is null.
*/ */
public Object getProperty(String name) { public Object getProperty(String name) {
if (name == null) { if (name == null) {
...@@ -1196,7 +1196,7 @@ public class BufferedImage extends java.awt.Image ...@@ -1196,7 +1196,7 @@ public class BufferedImage extends java.awt.Image
* @param h the height of the specified rectangular region * @param h the height of the specified rectangular region
* @return a <code>BufferedImage</code> that is the subimage of this * @return a <code>BufferedImage</code> that is the subimage of this
* <code>BufferedImage</code>. * <code>BufferedImage</code>.
* @exception <code>RasterFormatException</code> if the specified * @exception RasterFormatException if the specified
* area is not contained within this <code>BufferedImage</code>. * area is not contained within this <code>BufferedImage</code>.
*/ */
public BufferedImage getSubimage (int x, int y, int w, int h) { public BufferedImage getSubimage (int x, int y, int w, int h) {
...@@ -1388,7 +1388,7 @@ public class BufferedImage extends java.awt.Image ...@@ -1388,7 +1388,7 @@ public class BufferedImage extends java.awt.Image
* @param tileY the y index of the requested tile in the tile array * @param tileY the y index of the requested tile in the tile array
* @return a <code>Raster</code> that is the tile defined by the * @return a <code>Raster</code> that is the tile defined by the
* arguments <code>tileX</code> and <code>tileY</code>. * arguments <code>tileX</code> and <code>tileY</code>.
* @exception <code>ArrayIndexOutOfBoundsException</code> if both * @exception ArrayIndexOutOfBoundsException if both
* <code>tileX</code> and <code>tileY</code> are not * <code>tileX</code> and <code>tileY</code> are not
* equal to 0 * equal to 0
*/ */
...@@ -1558,7 +1558,7 @@ public class BufferedImage extends java.awt.Image ...@@ -1558,7 +1558,7 @@ public class BufferedImage extends java.awt.Image
* @return <code>true</code> if the tile specified by the specified * @return <code>true</code> if the tile specified by the specified
* indices is checked out for writing; <code>false</code> * indices is checked out for writing; <code>false</code>
* otherwise. * otherwise.
* @exception <code>ArrayIndexOutOfBoundsException</code> if both * @exception ArrayIndexOutOfBoundsException if both
* <code>tileX</code> and <code>tileY</code> are not equal * <code>tileX</code> and <code>tileY</code> are not equal
* to 0 * to 0
*/ */
......
...@@ -171,7 +171,7 @@ public class ByteLookupTable extends LookupTable { ...@@ -171,7 +171,7 @@ public class ByteLookupTable extends LookupTable {
* @exception ArrayIndexOutOfBoundsException if <code>src</code> is * @exception ArrayIndexOutOfBoundsException if <code>src</code> is
* longer than <code>dst</code> or if for any element * longer than <code>dst</code> or if for any element
* <code>i</code> of <code>src</code>, * <code>i</code> of <code>src</code>,
* <code>(src[i]&0xff)-offset</code> is either less than * {@code (src[i]&0xff)-offset} is either less than
* zero or greater than or equal to the length of the * zero or greater than or equal to the length of the
* lookup table for any band. * lookup table for any band.
*/ */
......
...@@ -692,12 +692,12 @@ public abstract class ColorModel implements Transparency{ ...@@ -692,12 +692,12 @@ public abstract class ColorModel implements Transparency{
* <code>DataBuffer.TYPE_INT</code>. * <code>DataBuffer.TYPE_INT</code>.
* @param inData an array of pixel values * @param inData an array of pixel values
* @return the value of the green component of the specified pixel. * @return the value of the green component of the specified pixel.
* @throws <code>ClassCastException</code> if <code>inData</code> * @throws ClassCastException if <code>inData</code>
* is not a primitive array of type <code>transferType</code> * is not a primitive array of type <code>transferType</code>
* @throws <code>ArrayIndexOutOfBoundsException</code> if * @throws ArrayIndexOutOfBoundsException if
* <code>inData</code> is not large enough to hold a pixel value * <code>inData</code> is not large enough to hold a pixel value
* for this <code>ColorModel</code> * for this <code>ColorModel</code>
* @throws <code>UnsupportedOperationException</code> if this * @throws UnsupportedOperationException if this
* <code>tranferType</code> is not supported by this * <code>tranferType</code> is not supported by this
* <code>ColorModel</code> * <code>ColorModel</code>
*/ */
......
...@@ -642,12 +642,12 @@ public class DirectColorModel extends PackedColorModel { ...@@ -642,12 +642,12 @@ public class DirectColorModel extends PackedColorModel {
* @param inData the specified pixel * @param inData the specified pixel
* @return the alpha component of the specified pixel, scaled from * @return the alpha component of the specified pixel, scaled from
* 0 to 255. * 0 to 255.
* @exception <code>ClassCastException</code> if <code>inData</code> * @exception ClassCastException if <code>inData</code>
* is not a primitive array of type <code>transferType</code> * is not a primitive array of type <code>transferType</code>
* @exception <code>ArrayIndexOutOfBoundsException</code> if * @exception ArrayIndexOutOfBoundsException if
* <code>inData</code> is not large enough to hold a pixel value * <code>inData</code> is not large enough to hold a pixel value
* for this <code>ColorModel</code> * for this <code>ColorModel</code>
* @exception <code>UnsupportedOperationException</code> if this * @exception UnsupportedOperationException if this
* <code>tranferType</code> is not supported by this * <code>tranferType</code> is not supported by this
* <code>ColorModel</code> * <code>ColorModel</code>
*/ */
...@@ -1055,7 +1055,7 @@ public class DirectColorModel extends PackedColorModel { ...@@ -1055,7 +1055,7 @@ public class DirectColorModel extends PackedColorModel {
* begin retrieving the color and alpha components * begin retrieving the color and alpha components
* @return an <code>int</code> pixel value in this * @return an <code>int</code> pixel value in this
* <code>ColorModel</code> corresponding to the specified components. * <code>ColorModel</code> corresponding to the specified components.
* @exception <code>ArrayIndexOutOfBoundsException</code> if * @exception ArrayIndexOutOfBoundsException if
* the <code>components</code> array is not large enough to * the <code>components</code> array is not large enough to
* hold all of the color and alpha components starting at * hold all of the color and alpha components starting at
* <code>offset</code> * <code>offset</code>
...@@ -1097,9 +1097,9 @@ public class DirectColorModel extends PackedColorModel { ...@@ -1097,9 +1097,9 @@ public class DirectColorModel extends PackedColorModel {
* and alpha components * and alpha components
* @return an <code>Object</code> representing an array of color and * @return an <code>Object</code> representing an array of color and
* alpha components. * alpha components.
* @exception <code>ClassCastException</code> if <code>obj</code> * @exception ClassCastException if <code>obj</code>
* is not a primitive array of type <code>transferType</code> * is not a primitive array of type <code>transferType</code>
* @exception <code>ArrayIndexOutOfBoundsException</code> if * @exception ArrayIndexOutOfBoundsException if
* <code>obj</code> is not large enough to hold a pixel value * <code>obj</code> is not large enough to hold a pixel value
* for this <code>ColorModel</code> or the <code>components</code> * for this <code>ColorModel</code> or the <code>components</code>
* array is not large enough to hold all of the color and alpha * array is not large enough to hold all of the color and alpha
......
...@@ -100,11 +100,11 @@ public interface ImageProducer { ...@@ -100,11 +100,11 @@ public interface ImageProducer {
* <code>ImageProducer</code> should respond by executing * <code>ImageProducer</code> should respond by executing
* the following minimum set of <code>ImageConsumer</code> * the following minimum set of <code>ImageConsumer</code>
* method calls: * method calls:
* <pre> * <pre>{@code
* ic.setHints(TOPDOWNLEFTRIGHT | < otherhints >); * ic.setHints(TOPDOWNLEFTRIGHT | < otherhints >);
* ic.setPixels(...); // As many times as needed * ic.setPixels(...); // As many times as needed
* ic.imageComplete(); * ic.imageComplete();
* </pre> * }</pre>
* @param ic the specified <code>ImageConsumer</code> * @param ic the specified <code>ImageConsumer</code>
* @see ImageConsumer#setHints * @see ImageConsumer#setHints
*/ */
......
...@@ -98,6 +98,7 @@ import java.math.BigInteger; ...@@ -98,6 +98,7 @@ import java.math.BigInteger;
* Index values greater than or equal to the map size, but less than * Index values greater than or equal to the map size, but less than
* 2<sup><em>n</em></sup>, are undefined and return 0 for all color and * 2<sup><em>n</em></sup>, are undefined and return 0 for all color and
* alpha components. * alpha components.
* </a>
* <p> * <p>
* For those methods that use a primitive array pixel representation of * For those methods that use a primitive array pixel representation of
* type <code>transferType</code>, the array length is always one. * type <code>transferType</code>, the array length is always one.
......
...@@ -37,7 +37,7 @@ import java.util.Enumeration; ...@@ -37,7 +37,7 @@ import java.util.Enumeration;
* uses an array to produce pixel values for an Image. Here is an example * uses an array to produce pixel values for an Image. Here is an example
* which calculates a 100x100 image representing a fade from black to blue * which calculates a 100x100 image representing a fade from black to blue
* along the X axis and a fade from black to red along the Y axis: * along the X axis and a fade from black to red along the Y axis:
* <pre> * <pre>{@code
* *
* int w = 100; * int w = 100;
* int h = 100; * int h = 100;
...@@ -52,12 +52,12 @@ import java.util.Enumeration; ...@@ -52,12 +52,12 @@ import java.util.Enumeration;
* } * }
* Image img = createImage(new MemoryImageSource(w, h, pix, 0, w)); * Image img = createImage(new MemoryImageSource(w, h, pix, 0, w));
* *
* </pre> * }</pre>
* The MemoryImageSource is also capable of managing a memory image which * The MemoryImageSource is also capable of managing a memory image which
* varies over time to allow animation or custom rendering. Here is an * varies over time to allow animation or custom rendering. Here is an
* example showing how to set up the animation source and signal changes * example showing how to set up the animation source and signal changes
* in the data (adapted from the MemoryAnimationSourceDemo by Garth Dickie): * in the data (adapted from the MemoryAnimationSourceDemo by Garth Dickie):
* <pre> * <pre>{@code
* *
* int pixels[]; * int pixels[];
* MemoryImageSource source; * MemoryImageSource source;
...@@ -96,7 +96,7 @@ import java.util.Enumeration; ...@@ -96,7 +96,7 @@ import java.util.Enumeration;
* } * }
* } * }
* *
* </pre> * }</pre>
* *
* @see ImageProducer * @see ImageProducer
* *
......
...@@ -52,14 +52,14 @@ package java.awt.image; ...@@ -52,14 +52,14 @@ package java.awt.image;
* <code>x,&nbsp;y</code> from <code>DataBuffer</code> <code>data</code> * <code>x,&nbsp;y</code> from <code>DataBuffer</code> <code>data</code>
* and storing the pixel data in data elements of type * and storing the pixel data in data elements of type
* <code>dataType</code>: * <code>dataType</code>:
* <pre> * <pre>{@code
* int dataElementSize = DataBuffer.getDataTypeSize(dataType); * int dataElementSize = DataBuffer.getDataTypeSize(dataType);
* int bitnum = dataBitOffset + x*pixelBitStride; * int bitnum = dataBitOffset + x*pixelBitStride;
* int element = data.getElem(y*scanlineStride + bitnum/dataElementSize); * int element = data.getElem(y*scanlineStride + bitnum/dataElementSize);
* int shift = dataElementSize - (bitnum & (dataElementSize-1)) * int shift = dataElementSize - (bitnum & (dataElementSize-1))
* - pixelBitStride; * - pixelBitStride;
* int pixel = (element >> shift) & ((1 << pixelBitStride) - 1); * int pixel = (element >> shift) & ((1 << pixelBitStride) - 1);
* </pre> * }</pre>
*/ */
public class MultiPixelPackedSampleModel extends SampleModel public class MultiPixelPackedSampleModel extends SampleModel
......
...@@ -35,7 +35,7 @@ import java.awt.Image; ...@@ -35,7 +35,7 @@ import java.awt.Image;
* The PixelGrabber class implements an ImageConsumer which can be attached * The PixelGrabber class implements an ImageConsumer which can be attached
* to an Image or ImageProducer object to retrieve a subset of the pixels * to an Image or ImageProducer object to retrieve a subset of the pixels
* in that image. Here is an example: * in that image. Here is an example:
* <pre> * <pre>{@code
* *
* public void handlesinglepixel(int x, int y, int pixel) { * public void handlesinglepixel(int x, int y, int pixel) {
* int alpha = (pixel >> 24) & 0xff; * int alpha = (pixel >> 24) & 0xff;
...@@ -65,7 +65,7 @@ import java.awt.Image; ...@@ -65,7 +65,7 @@ import java.awt.Image;
* } * }
* } * }
* *
* </pre> * }</pre>
* *
* @see ColorModel#getRGBdefault * @see ColorModel#getRGBdefault
* *
...@@ -165,8 +165,8 @@ public class PixelGrabber implements ImageConsumer { ...@@ -165,8 +165,8 @@ public class PixelGrabber implements ImageConsumer {
* accumulated in the default RGB ColorModel. If the forceRGB * accumulated in the default RGB ColorModel. If the forceRGB
* parameter is true, then the pixels will be accumulated in the * parameter is true, then the pixels will be accumulated in the
* default RGB ColorModel anyway. A buffer is allocated by the * default RGB ColorModel anyway. A buffer is allocated by the
* PixelGrabber to hold the pixels in either case. If (w < 0) or * PixelGrabber to hold the pixels in either case. If {@code (w < 0)} or
* (h < 0), then they will default to the remaining width and * {@code (h < 0)}, then they will default to the remaining width and
* height of the source data when that information is delivered. * height of the source data when that information is delivered.
* @param img the image to retrieve the image data from * @param img the image to retrieve the image data from
* @param x the x coordinate of the upper left corner of the rectangle * @param x the x coordinate of the upper left corner of the rectangle
...@@ -233,10 +233,10 @@ public class PixelGrabber implements ImageConsumer { ...@@ -233,10 +233,10 @@ public class PixelGrabber implements ImageConsumer {
* behaves in the following ways, depending on the value of * behaves in the following ways, depending on the value of
* <code>ms</code>: * <code>ms</code>:
* <ul> * <ul>
* <li> If <code>ms</code> == 0, waits until all pixels are delivered * <li> If {@code ms == 0}, waits until all pixels are delivered
* <li> If <code>ms</code> > 0, waits until all pixels are delivered * <li> If {@code ms > 0}, waits until all pixels are delivered
* as timeout expires. * as timeout expires.
* <li> If <code>ms</code> < 0, returns <code>true</code> if all pixels * <li> If {@code ms < 0}, returns <code>true</code> if all pixels
* are grabbed, <code>false</code> otherwise and does not wait. * are grabbed, <code>false</code> otherwise and does not wait.
* </ul> * </ul>
* @param ms the number of milliseconds to wait for the image pixels * @param ms the number of milliseconds to wait for the image pixels
......
...@@ -39,7 +39,7 @@ import java.awt.image.ColorModel; ...@@ -39,7 +39,7 @@ import java.awt.image.ColorModel;
* The only method which needs to be defined to create a useable image * The only method which needs to be defined to create a useable image
* filter is the filterRGB method. Here is an example of a definition * filter is the filterRGB method. Here is an example of a definition
* of a filter which swaps the red and blue components of an image: * of a filter which swaps the red and blue components of an image:
* <pre> * <pre>{@code
* *
* class RedBlueSwapFilter extends RGBImageFilter { * class RedBlueSwapFilter extends RGBImageFilter {
* public RedBlueSwapFilter() { * public RedBlueSwapFilter() {
...@@ -56,7 +56,7 @@ import java.awt.image.ColorModel; ...@@ -56,7 +56,7 @@ import java.awt.image.ColorModel;
* } * }
* } * }
* *
* </pre> * }</pre>
* *
* @see FilteredImageSource * @see FilteredImageSource
* @see ImageFilter * @see ImageFilter
......
...@@ -114,7 +114,7 @@ public class ShortLookupTable extends LookupTable { ...@@ -114,7 +114,7 @@ public class ShortLookupTable extends LookupTable {
* @exception ArrayIndexOutOfBoundsException if <code>src</code> is * @exception ArrayIndexOutOfBoundsException if <code>src</code> is
* longer than <code>dst</code> or if for any element * longer than <code>dst</code> or if for any element
* <code>i</code> of <code>src</code>, * <code>i</code> of <code>src</code>,
* <code>(src[i]&0xffff)-offset</code> is either less than * {@code (src[i]&0xffff)-offset} is either less than
* zero or greater than or equal to the length of the * zero or greater than or equal to the length of the
* lookup table for any band. * lookup table for any band.
*/ */
...@@ -165,7 +165,7 @@ public class ShortLookupTable extends LookupTable { ...@@ -165,7 +165,7 @@ public class ShortLookupTable extends LookupTable {
* @exception ArrayIndexOutOfBoundsException if <code>src</code> is * @exception ArrayIndexOutOfBoundsException if <code>src</code> is
* longer than <code>dst</code> or if for any element * longer than <code>dst</code> or if for any element
* <code>i</code> of <code>src</code>, * <code>i</code> of <code>src</code>,
* <code>(src[i]&0xffff)-offset</code> is either less than * {@code (src[i]&0xffff)-offset} is either less than
* zero or greater than or equal to the length of the * zero or greater than or equal to the length of the
* lookup table for any band. * lookup table for any band.
*/ */
......
...@@ -57,10 +57,10 @@ import java.util.Arrays; ...@@ -57,10 +57,10 @@ import java.util.Arrays;
* The following code illustrates extracting the bits of the sample * The following code illustrates extracting the bits of the sample
* representing band <code>b</code> for pixel <code>x,y</code> * representing band <code>b</code> for pixel <code>x,y</code>
* from DataBuffer <code>data</code>: * from DataBuffer <code>data</code>:
* <pre> * <pre>{@code
* int sample = data.getElem(y * scanlineStride + x); * int sample = data.getElem(y * scanlineStride + x);
* sample = (sample & bitMasks[b]) >>> bitOffsets[b]; * sample = (sample & bitMasks[b]) >>> bitOffsets[b];
* </pre> * }</pre>
*/ */
public class SinglePixelPackedSampleModel extends SampleModel public class SinglePixelPackedSampleModel extends SampleModel
......
...@@ -372,13 +372,13 @@ public class WritableRaster extends Raster { ...@@ -372,13 +372,13 @@ public class WritableRaster extends Raster {
* integral type and less than or equal to 32 bits in size, then calling * integral type and less than or equal to 32 bits in size, then calling
* this method is equivalent to executing the following code for all * this method is equivalent to executing the following code for all
* <code>x,y</code> addresses valid in both Rasters. * <code>x,y</code> addresses valid in both Rasters.
* <pre> * <pre>{@code
* Raster srcRaster; * Raster srcRaster;
* WritableRaster dstRaster; * WritableRaster dstRaster;
* for (int b = 0; b < srcRaster.getNumBands(); b++) { * for (int b = 0; b < srcRaster.getNumBands(); b++) {
* dstRaster.setSample(x, y, b, srcRaster.getSample(x, y, b)); * dstRaster.setSample(x, y, b, srcRaster.getSample(x, y, b));
* } * }
* </pre> * }</pre>
* Thus, when copying an integral type source to an integral type * Thus, when copying an integral type source to an integral type
* destination, if the source sample size is greater than the destination * destination, if the source sample size is greater than the destination
* sample size for a particular band, the high order bits of the source * sample size for a particular band, the high order bits of the source
......
...@@ -228,7 +228,7 @@ public final class ImageIO { ...@@ -228,7 +228,7 @@ public final class ImageIO {
* be used when creating <code>ImageInputStream</code>s and * be used when creating <code>ImageInputStream</code>s and
* <code>ImageOutputStream</code>s. * <code>ImageOutputStream</code>s.
* *
* <p> When reading from a standard <code>InputStream</code>>, it * <p> When reading from a standard <code>InputStream</code>, it
* may be necessary to save previously read information in a cache * may be necessary to save previously read information in a cache
* since the underlying stream does not allow data to be re-read. * since the underlying stream does not allow data to be re-read.
* Similarly, when writing to a standard * Similarly, when writing to a standard
......
...@@ -80,7 +80,7 @@ import java.awt.image.BufferedImage; ...@@ -80,7 +80,7 @@ import java.awt.image.BufferedImage;
* *
* <p> The resulting region is then subsampled according to the * <p> The resulting region is then subsampled according to the
* factors given in {@link IIOParam#setSourceSubsampling * factors given in {@link IIOParam#setSourceSubsampling
* <code>IIOParam.setSourceSubsampling</code>}. The first pixel, * IIOParam.setSourceSubsampling}. The first pixel,
* the number of pixels per row, and the number of rows all depend * the number of pixels per row, and the number of rows all depend
* on the subsampling settings. * on the subsampling settings.
* Call the minimum X and Y coordinates of the resulting rectangle * Call the minimum X and Y coordinates of the resulting rectangle
......
...@@ -230,8 +230,8 @@ public abstract class ImageReader { ...@@ -230,8 +230,8 @@ public abstract class ImageReader {
* increased as each image (or thumbnail, or image metadata) is * increased as each image (or thumbnail, or image metadata) is
* read. If <code>seekForwardOnly</code> is true, then a call to * read. If <code>seekForwardOnly</code> is true, then a call to
* <code>read(index)</code> will throw an * <code>read(index)</code> will throw an
* <code>IndexOutOfBoundsException</code> if <code>index &lt * <code>IndexOutOfBoundsException</code> if {@code index < this.minIndex};
* this.minIndex</code>; otherwise, the value of * otherwise, the value of
* <code>minIndex</code> will be set to <code>index</code>. If * <code>minIndex</code> will be set to <code>index</code>. If
* <code>seekForwardOnly</code> is <code>false</code>, the value of * <code>seekForwardOnly</code> is <code>false</code>, the value of
* <code>minIndex</code> will remain 0 regardless of any read * <code>minIndex</code> will remain 0 regardless of any read
...@@ -328,8 +328,8 @@ public abstract class ImageReader { ...@@ -328,8 +328,8 @@ public abstract class ImageReader {
* increased as each image (or thumbnail, or image metadata) is * increased as each image (or thumbnail, or image metadata) is
* read. If <code>seekForwardOnly</code> is true, then a call to * read. If <code>seekForwardOnly</code> is true, then a call to
* <code>read(index)</code> will throw an * <code>read(index)</code> will throw an
* <code>IndexOutOfBoundsException</code> if <code>index &lt * <code>IndexOutOfBoundsException</code> if {@code index < this.minIndex};
* this.minIndex</code>; otherwise, the value of * otherwise, the value of
* <code>minIndex</code> will be set to <code>index</code>. If * <code>minIndex</code> will be set to <code>index</code>. If
* <code>seekForwardOnly</code> is <code>false</code>, the value of * <code>seekForwardOnly</code> is <code>false</code>, the value of
* <code>minIndex</code> will remain 0 regardless of any read * <code>minIndex</code> will remain 0 regardless of any read
...@@ -600,8 +600,7 @@ public abstract class ImageReader { ...@@ -600,8 +600,7 @@ public abstract class ImageReader {
* <p> Note that formats that return <code>false</code> from * <p> Note that formats that return <code>false</code> from
* this method may nonetheless allow tiling (<i>e.g.</i> Restart * this method may nonetheless allow tiling (<i>e.g.</i> Restart
* Markers in JPEG), and random access will likely be reasonably * Markers in JPEG), and random access will likely be reasonably
* efficient on tiles. See {@link #isImageTiled * efficient on tiles. See {@link #isImageTiled isImageTiled}.
* <code>isImageTiled</code>}.
* *
* <p> A reader for which all images are guaranteed to support * <p> A reader for which all images are guaranteed to support
* easy random access, or are guaranteed not to support easy * easy random access, or are guaranteed not to support easy
...@@ -1212,11 +1211,10 @@ public abstract class ImageReader { ...@@ -1212,11 +1211,10 @@ public abstract class ImageReader {
/** /**
* Returns <code>true</code> if this plug-in supports reading * Returns <code>true</code> if this plug-in supports reading
* just a {@link java.awt.image.Raster <code>Raster</code>} of pixel data. * just a {@link java.awt.image.Raster Raster} of pixel data.
* If this method returns <code>false</code>, calls to * If this method returns <code>false</code>, calls to
* {@link #readRaster <code>readRaster</code>} or {@link #readTileRaster * {@link #readRaster readRaster} or {@link #readTileRaster readTileRaster}
* <code>readTileRaster</code>} will throw an * will throw an <code>UnsupportedOperationException</code>.
* <code>UnsupportedOperationException</code>.
* *
* <p> The default implementation returns <code>false</code>. * <p> The default implementation returns <code>false</code>.
* *
...@@ -1236,7 +1234,7 @@ public abstract class ImageReader { ...@@ -1236,7 +1234,7 @@ public abstract class ImageReader {
* application must determine how to interpret the pixel data by other * application must determine how to interpret the pixel data by other
* means. Any destination or image-type parameters in the supplied * means. Any destination or image-type parameters in the supplied
* <code>ImageReadParam</code> object are ignored, but all other * <code>ImageReadParam</code> object are ignored, but all other
* parameters are used exactly as in the {@link #read <code>read</code>} * parameters are used exactly as in the {@link #read read}
* method, except that any destination offset is used as a logical rather * method, except that any destination offset is used as a logical rather
* than a physical offset. The size of the returned <code>Raster</code> * than a physical offset. The size of the returned <code>Raster</code>
* will always be that of the source region clipped to the actual image. * will always be that of the source region clipped to the actual image.
...@@ -1249,10 +1247,9 @@ public abstract class ImageReader { ...@@ -1249,10 +1247,9 @@ public abstract class ImageReader {
* *
* <p> Any registered <code>readUpdateListener</code>s are ignored, as * <p> Any registered <code>readUpdateListener</code>s are ignored, as
* there is no <code>BufferedImage</code>, but all other listeners are * there is no <code>BufferedImage</code>, but all other listeners are
* called exactly as they are for the {@link #read <code>read</code>} * called exactly as they are for the {@link #read read} method.
* method.
* *
* <p> If {@link #canReadRaster <code>canReadRaster()</code>} returns * <p> If {@link #canReadRaster canReadRaster()} returns
* <code>false</code>, this method throws an * <code>false</code>, this method throws an
* <code>UnsupportedOperationException</code>. * <code>UnsupportedOperationException</code>.
* *
...@@ -1481,13 +1478,13 @@ public abstract class ImageReader { ...@@ -1481,13 +1478,13 @@ public abstract class ImageReader {
* The application must determine how to interpret the pixel data by other * The application must determine how to interpret the pixel data by other
* means. * means.
* *
* <p> If {@link #canReadRaster <code>canReadRaster()</code>} returns * <p> If {@link #canReadRaster canReadRaster()} returns
* <code>false</code>, this method throws an * <code>false</code>, this method throws an
* <code>UnsupportedOperationException</code>. * <code>UnsupportedOperationException</code>.
* *
* <p> The default implementation checks if reading * <p> The default implementation checks if reading
* <code>Raster</code>s is supported, and if so calls {@link * <code>Raster</code>s is supported, and if so calls {@link
* #readRaster <code>readRaster(imageIndex, null)</code>} if * #readRaster readRaster(imageIndex, null)} if
* <code>tileX</code> and <code>tileY</code> are 0, or throws an * <code>tileX</code> and <code>tileY</code> are 0, or throws an
* <code>IllegalArgumentException</code> otherwise. * <code>IllegalArgumentException</code> otherwise.
* *
...@@ -1548,8 +1545,8 @@ public abstract class ImageReader { ...@@ -1548,8 +1545,8 @@ public abstract class ImageReader {
* source render size or any format-specific settings), they will * source render size or any format-specific settings), they will
* be ignored. * be ignored.
* *
* <p> The default implementation just calls {@link #read * <p> The default implementation just calls
* <code>read(imageIndex, param)</code>}. * {@link #read read(imageIndex, param)}.
* *
* @param imageIndex the index of the image to be retrieved. * @param imageIndex the index of the image to be retrieved.
* @param param an <code>ImageReadParam</code> used to control * @param param an <code>ImageReadParam</code> used to control
...@@ -2544,9 +2541,8 @@ public abstract class ImageReader { ...@@ -2544,9 +2541,8 @@ public abstract class ImageReader {
* the supplied <code>ImageReadParam</code>. The actual * the supplied <code>ImageReadParam</code>. The actual
* subsampling factors, destination size, and destination offset * subsampling factors, destination size, and destination offset
* are <em>not</em> taken into consideration, thus further * are <em>not</em> taken into consideration, thus further
* clipping must take place. The {@link #computeRegions * clipping must take place. The {@link #computeRegions computeRegions}
* <code>computeRegions</code>} method performs all necessary * method performs all necessary clipping.
* clipping.
* *
* @param param the <code>ImageReadParam</code> being used, or * @param param the <code>ImageReadParam</code> being used, or
* <code>null</code>. * <code>null</code>.
...@@ -2601,7 +2597,7 @@ public abstract class ImageReader { ...@@ -2601,7 +2597,7 @@ public abstract class ImageReader {
* width or height of 0, an <code>IllegalArgumentException</code> * width or height of 0, an <code>IllegalArgumentException</code>
* is thrown. * is thrown.
* *
* <p> The {@link #getSourceRegion <code>getSourceRegion</code>} * <p> The {@link #getSourceRegion getSourceRegion>}
* method may be used if only source clipping is desired. * method may be used if only source clipping is desired.
* *
* @param param an <code>ImageReadParam</code>, or <code>null</code>. * @param param an <code>ImageReadParam</code>, or <code>null</code>.
......
...@@ -840,7 +840,7 @@ public class ImageTypeSpecifier { ...@@ -840,7 +840,7 @@ public class ImageTypeSpecifier {
* not one of 1, 2, 4, 8, or 16. * not one of 1, 2, 4, 8, or 16.
* @exception IllegalArgumentException if the * @exception IllegalArgumentException if the
* non-<code>null</code> LUT parameters do not have lengths of * non-<code>null</code> LUT parameters do not have lengths of
* exactly <code>1 << bits</code>. * exactly {@code 1 << bits}.
* @exception IllegalArgumentException if <code>dataType</code> is * @exception IllegalArgumentException if <code>dataType</code> is
* not one of <code>DataBuffer.TYPE_BYTE</code>, * not one of <code>DataBuffer.TYPE_BYTE</code>,
* <code>DataBuffer.TYPE_SHORT</code>, * <code>DataBuffer.TYPE_SHORT</code>,
......
...@@ -49,7 +49,7 @@ import java.util.Locale; ...@@ -49,7 +49,7 @@ import java.util.Locale;
* and include additional pixels within the intersected bounds * and include additional pixels within the intersected bounds
* according to the horizontal and vertical subsampling factors * according to the horizontal and vertical subsampling factors
* specified by {@link IIOParam#setSourceSubsampling * specified by {@link IIOParam#setSourceSubsampling
* <code>IIOParam.setSourceSubsampling</code>}. * IIOParam.setSourceSubsampling}.
* *
* <p> Individual features such as tiling, progressive encoding, and * <p> Individual features such as tiling, progressive encoding, and
* compression may be set in one of four modes. * compression may be set in one of four modes.
...@@ -462,9 +462,8 @@ public class ImageWriteParam extends IIOParam { ...@@ -462,9 +462,8 @@ public class ImageWriteParam extends IIOParam {
* <code>IllegalStateException</code>. * <code>IllegalStateException</code>.
* *
* <li><code>MODE_EXPLICIT</code> - The image will be tiled * <li><code>MODE_EXPLICIT</code> - The image will be tiled
* according to parameters given in the {@link #setTiling * according to parameters given in the {@link #setTiling setTiling}
* <code>setTiling</code>} method. Any previously set tiling * method. Any previously set tiling parameters are discarded.
* parameters are discarded.
* *
* <li><code>MODE_COPY_FROM_METADATA</code> - The image will * <li><code>MODE_COPY_FROM_METADATA</code> - The image will
* conform to the metadata object passed in to a write. * conform to the metadata object passed in to a write.
...@@ -1421,7 +1420,7 @@ public class ImageWriteParam extends IIOParam { ...@@ -1421,7 +1420,7 @@ public class ImageWriteParam extends IIOParam {
* with <code>getCompressionQualityDescriptions</code> as part of a user * with <code>getCompressionQualityDescriptions</code> as part of a user
* interface for setting or displaying the compression quality * interface for setting or displaying the compression quality
* level. See {@link #getCompressionQualityDescriptions * level. See {@link #getCompressionQualityDescriptions
* <code>getCompressionQualityDescriptions</code>} for more information. * getCompressionQualityDescriptions} for more information.
* *
* <p> If no descriptions are available, <code>null</code> is * <p> If no descriptions are available, <code>null</code> is
* returned. If <code>null</code> is returned from * returned. If <code>null</code> is returned from
......
...@@ -692,7 +692,7 @@ public abstract class ImageWriter implements ImageTranscoder { ...@@ -692,7 +692,7 @@ public abstract class ImageWriter implements ImageTranscoder {
* output prior to the current seek position may be flushed, and * output prior to the current seek position may be flushed, and
* need not be readable or writable, unless the plug-in needs to * need not be readable or writable, unless the plug-in needs to
* be able to patch up the header information when * be able to patch up the header information when
* <code>endWriteSequence</code> is called (<italic>e.g.</italic> TIFF). * <code>endWriteSequence</code> is called (<i>e.g.</i> TIFF).
* *
* <p> If <code>canWriteSequence</code> returns <code>false</code>, * <p> If <code>canWriteSequence</code> returns <code>false</code>,
* this method will throw an * this method will throw an
......
...@@ -729,6 +729,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { ...@@ -729,6 +729,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat {
* @param required <code>true</code> if an object value must be present. * @param required <code>true</code> if an object value must be present.
* @param defaultValue the default value for the * @param defaultValue the default value for the
* <code>Object</code> reference, or <code>null</code>. * <code>Object</code> reference, or <code>null</code>.
* @param <T> the type of the object.
* *
* @exception IllegalArgumentException if <code>elementName</code> * @exception IllegalArgumentException if <code>elementName</code>
* is <code>null</code>, or is not a legal element name for this format. * is <code>null</code>, or is not a legal element name for this format.
...@@ -765,6 +766,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { ...@@ -765,6 +766,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat {
* @param enumeratedValues a <code>List</code> of * @param enumeratedValues a <code>List</code> of
* <code>Object</code>s containing the legal values for the * <code>Object</code>s containing the legal values for the
* object reference. * object reference.
* @param <T> the type of the object.
* *
* @exception IllegalArgumentException if <code>elementName</code> * @exception IllegalArgumentException if <code>elementName</code>
* is <code>null</code>, or is not a legal element name for this format. * is <code>null</code>, or is not a legal element name for this format.
...@@ -836,6 +838,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat { ...@@ -836,6 +838,7 @@ public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat {
* is inclusive. * is inclusive.
* @param maxInclusive <code>true</code> if <code>maxValue</code> * @param maxInclusive <code>true</code> if <code>maxValue</code>
* is inclusive. * is inclusive.
* @param <T> the type of the object.
* *
* @exception IllegalArgumentException if <code>elementName</code> * @exception IllegalArgumentException if <code>elementName</code>
* is <code>null</code>, or is not a legal element name for this * is <code>null</code>, or is not a legal element name for this
......
...@@ -56,9 +56,9 @@ import com.sun.imageio.plugins.bmp.BMPConstants; ...@@ -56,9 +56,9 @@ import com.sun.imageio.plugins.bmp.BMPConstants;
* <p><table border=1> * <p><table border=1>
* <caption><b>Compression Types</b></caption> * <caption><b>Compression Types</b></caption>
* <tr><th>Type String</th> <th>Description</th> <th>Image Types</th></tr> * <tr><th>Type String</th> <th>Description</th> <th>Image Types</th></tr>
* <tr><td>BI_RGB</td> <td>Uncompressed RLE</td> <td><= 8-bits/sample</td></tr> * <tr><td>BI_RGB</td> <td>Uncompressed RLE</td> <td>{@literal <= } 8-bits/sample</td></tr>
* <tr><td>BI_RLE8</td> <td>8-bit Run Length Encoding</td> <td><= 8-bits/sample</td></tr> * <tr><td>BI_RLE8</td> <td>8-bit Run Length Encoding</td> <td>{@literal <=} 8-bits/sample</td></tr>
* <tr><td>BI_RLE4</td> <td>4-bit Run Length Encoding</td> <td><= 4-bits/sample</td></tr> * <tr><td>BI_RLE4</td> <td>4-bit Run Length Encoding</td> <td>{@literal <=} 4-bits/sample</td></tr>
* <tr><td>BI_BITFIELDS</td> <td>Packed data</td> <td> 16 or 32 bits/sample</td></tr> * <tr><td>BI_BITFIELDS</td> <td>Packed data</td> <td> 16 or 32 bits/sample</td></tr>
* </table> * </table>
*/ */
......
...@@ -46,16 +46,15 @@ import javax.imageio.ImageReadParam; ...@@ -46,16 +46,15 @@ import javax.imageio.ImageReadParam;
* This class allows the tables to be specified directly from client * This class allows the tables to be specified directly from client
* code. If no tables are specified either in the stream or in a * code. If no tables are specified either in the stream or in a
* <code>JPEGImageReadParam</code>, then the stream is presumed to use * <code>JPEGImageReadParam</code>, then the stream is presumed to use
* the "standard" visually lossless tables. See {@link JPEGQTable * the "standard" visually lossless tables. See {@link JPEGQTable JPEGQTable}
* <code>JPEGQTable</code>} and {@link JPEGHuffmanTable * and {@link JPEGHuffmanTable JPEGHuffmanTable} for more information
* <code>JPEGHuffmanTable</code>} for more information on the default * on the default tables.
* tables.
* *
* <p> The default <code>JPEGImageReadParam</code> returned by the * <p> The default <code>JPEGImageReadParam</code> returned by the
* <code>getDefaultReadParam</code> method of the builtin JPEG reader * <code>getDefaultReadParam</code> method of the builtin JPEG reader
* contains no tables. Default tables may be obtained from the table * contains no tables. Default tables may be obtained from the table
* classes {@link JPEGQTable <code>JPEGQTable</code>} and {@link * classes {@link JPEGQTable JPEGQTable} and
* JPEGHuffmanTable <code>JPEGHuffmanTable</code>}. * {@link JPEGHuffmanTable JPEGHuffmanTable}.
* *
* <p> If a stream does contain tables, the tables given in a * <p> If a stream does contain tables, the tables given in a
* <code>JPEGImageReadParam</code> are ignored. Furthermore, if the * <code>JPEGImageReadParam</code> are ignored. Furthermore, if the
...@@ -64,13 +63,12 @@ import javax.imageio.ImageReadParam; ...@@ -64,13 +63,12 @@ import javax.imageio.ImageReadParam;
* abbreviated images. Once tables have been read from a stream, they * abbreviated images. Once tables have been read from a stream, they
* can be overridden only by tables subsequently read from the same * can be overridden only by tables subsequently read from the same
* stream. In order to specify new tables, the {@link * stream. In order to specify new tables, the {@link
* javax.imageio.ImageReader#setInput <code>setInput</code>} method of * javax.imageio.ImageReader#setInput setInput} method of
* the reader must be called to change the stream. * the reader must be called to change the stream.
* *
* <p> Note that this class does not provide a means for obtaining the * <p> Note that this class does not provide a means for obtaining the
* tables found in a stream. These may be extracted from a stream by * tables found in a stream. These may be extracted from a stream by
* consulting the <code>IIOMetadata</code> object returned by the * consulting the IIOMetadata object returned by the reader.
* reader.
* *
* <p> * <p>
* For more information about the operation of the built-in JPEG plug-ins, * For more information about the operation of the built-in JPEG plug-ins,
......
...@@ -66,8 +66,8 @@ import com.sun.imageio.plugins.jpeg.JPEG; ...@@ -66,8 +66,8 @@ import com.sun.imageio.plugins.jpeg.JPEG;
* when an abbreviated stream must be written without writing any tables * when an abbreviated stream must be written without writing any tables
* to a stream first. In order to use this class, the metadata object * to a stream first. In order to use this class, the metadata object
* passed into the writer must contain no tables, and no stream metadata * passed into the writer must contain no tables, and no stream metadata
* must be provided. See {@link JPEGQTable <code>JPEGQTable</code>} and * must be provided. See {@link JPEGQTable JPEGQTable} and
* {@link JPEGHuffmanTable <code>JPEGHuffmanTable</code>} for more * {@link JPEGHuffmanTable JPEGHuffmanTable} for more
* information on the default tables. * information on the default tables.
* *
* <p> The default <code>JPEGImageWriteParam</code> returned by the * <p> The default <code>JPEGImageWriteParam</code> returned by the
...@@ -80,7 +80,7 @@ import com.sun.imageio.plugins.jpeg.JPEG; ...@@ -80,7 +80,7 @@ import com.sun.imageio.plugins.jpeg.JPEG;
* set of tables has been written, only tables in the metadata can * set of tables has been written, only tables in the metadata can
* override them for subsequent writes, whether to the same stream or * override them for subsequent writes, whether to the same stream or
* a different one. In order to specify new tables using this class, * a different one. In order to specify new tables using this class,
* the {@link javax.imageio.ImageWriter#reset <code>reset</code>} * the {@link javax.imageio.ImageWriter#reset reset}
* method of the writer must be called. * method of the writer must be called.
* *
* <p> * <p>
......
...@@ -78,7 +78,7 @@ public abstract class ImageReaderSpi extends ImageReaderWriterSpi { ...@@ -78,7 +78,7 @@ public abstract class ImageReaderSpi extends ImageReaderWriterSpi {
* <code>ImageInputStream.class</code>, to be returned from * <code>ImageInputStream.class</code>, to be returned from
* <code>getInputTypes</code>. * <code>getInputTypes</code>.
* @deprecated Instead of using this field, directly create * @deprecated Instead of using this field, directly create
* the equivalent array <code>{ ImageInputStream.class }<code>. * the equivalent array <code>{ ImageInputStream.class }</code>.
*/ */
@Deprecated @Deprecated
public static final Class[] STANDARD_INPUT_TYPE = public static final Class[] STANDARD_INPUT_TYPE =
......
...@@ -80,7 +80,7 @@ public abstract class ImageWriterSpi extends ImageReaderWriterSpi { ...@@ -80,7 +80,7 @@ public abstract class ImageWriterSpi extends ImageReaderWriterSpi {
* <code>ImageOutputStream.class</code>, to be returned from * <code>ImageOutputStream.class</code>, to be returned from
* <code>getOutputTypes</code>. * <code>getOutputTypes</code>.
* @deprecated Instead of using this field, directly create * @deprecated Instead of using this field, directly create
* the equivalent array <code>{ ImageOutputStream.class }<code>. * the equivalent array <code>{ ImageOutputStream.class }</code>.
*/ */
@Deprecated @Deprecated
public static final Class[] STANDARD_OUTPUT_TYPE = public static final Class[] STANDARD_OUTPUT_TYPE =
......
...@@ -157,6 +157,8 @@ public class ServiceRegistry { ...@@ -157,6 +157,8 @@ public class ServiceRegistry {
* or <code>null</code> if the system class loader (or, failing that * or <code>null</code> if the system class loader (or, failing that
* the bootstrap class loader) is to be used. * the bootstrap class loader) is to be used.
* *
* @param <T> the type of the providerClass.
*
* @return An <code>Iterator</code> that yields provider objects * @return An <code>Iterator</code> that yields provider objects
* for the given service, in some arbitrary order. The iterator * for the given service, in some arbitrary order. The iterator
* will throw an <code>Error</code> if a provider-configuration * will throw an <code>Error</code> if a provider-configuration
...@@ -188,6 +190,8 @@ public class ServiceRegistry { ...@@ -188,6 +190,8 @@ public class ServiceRegistry {
* @param providerClass a <code>Class</code>object indicating the * @param providerClass a <code>Class</code>object indicating the
* class or interface of the service providers being detected. * class or interface of the service providers being detected.
* *
* @param <T> the type of the providerClass.
*
* @return An <code>Iterator</code> that yields provider objects * @return An <code>Iterator</code> that yields provider objects
* for the given service, in some arbitrary order. The iterator * for the given service, in some arbitrary order. The iterator
* will throw an <code>Error</code> if a provider-configuration * will throw an <code>Error</code> if a provider-configuration
...@@ -247,6 +251,7 @@ public class ServiceRegistry { ...@@ -247,6 +251,7 @@ public class ServiceRegistry {
* @param provider the service provide object to be registered. * @param provider the service provide object to be registered.
* @param category the category under which to register the * @param category the category under which to register the
* provider. * provider.
* @param <T> the type of the provider.
* *
* @return true if no provider of the same class was previously * @return true if no provider of the same class was previously
* registered in the same category category. * registered in the same category category.
...@@ -348,6 +353,7 @@ public class ServiceRegistry { ...@@ -348,6 +353,7 @@ public class ServiceRegistry {
* @param provider the service provider object to be deregistered. * @param provider the service provider object to be deregistered.
* @param category the category from which to deregister the * @param category the category from which to deregister the
* provider. * provider.
* @param <T> the type of the provider.
* *
* @return <code>true</code> if the provider was previously * @return <code>true</code> if the provider was previously
* registered in the same category category, * registered in the same category category,
...@@ -435,6 +441,7 @@ public class ServiceRegistry { ...@@ -435,6 +441,7 @@ public class ServiceRegistry {
* @param category the category to be retrieved from. * @param category the category to be retrieved from.
* @param useOrdering <code>true</code> if pairwise orderings * @param useOrdering <code>true</code> if pairwise orderings
* should be taken account in ordering the returned objects. * should be taken account in ordering the returned objects.
* @param <T> the type of the category.
* *
* @return an <code>Iterator</code> containing service provider * @return an <code>Iterator</code> containing service provider
* objects from the given category, possibly in order. * objects from the given category, possibly in order.
...@@ -490,6 +497,7 @@ public class ServiceRegistry { ...@@ -490,6 +497,7 @@ public class ServiceRegistry {
* whose <code>filter</code> method will be invoked. * whose <code>filter</code> method will be invoked.
* @param useOrdering <code>true</code> if pairwise orderings * @param useOrdering <code>true</code> if pairwise orderings
* should be taken account in ordering the returned objects. * should be taken account in ordering the returned objects.
* @param <T> the type of the category.
* *
* @return an <code>Iterator</code> containing service provider * @return an <code>Iterator</code> containing service provider
* objects from the given category, possibly in order. * objects from the given category, possibly in order.
...@@ -517,6 +525,7 @@ public class ServiceRegistry { ...@@ -517,6 +525,7 @@ public class ServiceRegistry {
* *
* @param providerClass the <code>Class</code> of the desired * @param providerClass the <code>Class</code> of the desired
* service provider object. * service provider object.
* @param <T> the type of the provider.
* *
* @return a currently registered service provider object with the * @return a currently registered service provider object with the
* desired <code>Class</code>type, or <code>null</code> is none is * desired <code>Class</code>type, or <code>null</code> is none is
...@@ -561,6 +570,7 @@ public class ServiceRegistry { ...@@ -561,6 +570,7 @@ public class ServiceRegistry {
* @param firstProvider the preferred provider. * @param firstProvider the preferred provider.
* @param secondProvider the provider to which * @param secondProvider the provider to which
* <code>firstProvider</code> is preferred. * <code>firstProvider</code> is preferred.
* @param <T> the type of the category.
* *
* @return <code>true</code> if a previously unset ordering * @return <code>true</code> if a previously unset ordering
* was established. * was established.
...@@ -606,6 +616,7 @@ public class ServiceRegistry { ...@@ -606,6 +616,7 @@ public class ServiceRegistry {
* @param firstProvider the formerly preferred provider. * @param firstProvider the formerly preferred provider.
* @param secondProvider the provider to which * @param secondProvider the provider to which
* <code>firstProvider</code> was formerly preferred. * <code>firstProvider</code> was formerly preferred.
* @param <T> the type of the category.
* *
* @return <code>true</code> if a previously set ordering was * @return <code>true</code> if a previously set ordering was
* disestablished. * disestablished.
......
...@@ -183,7 +183,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -183,7 +183,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* *
* @return a boolean value from the stream. * @return a boolean value from the stream.
* *
* @exception EOFException if the end of the stream is reached. * @exception java.io.EOFException if the end of the stream is reached.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
boolean readBoolean() throws IOException; boolean readBoolean() throws IOException;
...@@ -201,7 +201,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -201,7 +201,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* *
* @return a signed byte value from the stream. * @return a signed byte value from the stream.
* *
* @exception EOFException if the end of the stream is reached. * @exception java.io.EOFException if the end of the stream is reached.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
byte readByte() throws IOException; byte readByte() throws IOException;
...@@ -225,7 +225,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -225,7 +225,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* *
* @return an unsigned byte value from the stream. * @return an unsigned byte value from the stream.
* *
* @exception EOFException if the end of the stream is reached. * @exception java.io.EOFException if the end of the stream is reached.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
int readUnsignedByte() throws IOException; int readUnsignedByte() throws IOException;
...@@ -240,7 +240,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -240,7 +240,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* *
* @return a signed short value from the stream. * @return a signed short value from the stream.
* *
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
* *
...@@ -261,7 +261,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -261,7 +261,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* *
* @return an unsigned short value from the stream, as an int. * @return an unsigned short value from the stream, as an int.
* *
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
* *
...@@ -278,7 +278,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -278,7 +278,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* *
* @return an unsigned char value from the stream. * @return an unsigned char value from the stream.
* *
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
* *
...@@ -296,7 +296,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -296,7 +296,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* *
* @return a signed int value from the stream. * @return a signed int value from the stream.
* *
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
* *
...@@ -316,7 +316,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -316,7 +316,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* *
* @return an unsigned int value from the stream, as a long. * @return an unsigned int value from the stream, as a long.
* *
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
* *
...@@ -334,7 +334,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -334,7 +334,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* *
* @return a signed long value from the stream. * @return a signed long value from the stream.
* *
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
* *
...@@ -352,7 +352,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -352,7 +352,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* *
* @return a float value from the stream. * @return a float value from the stream.
* *
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
* *
...@@ -370,7 +370,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -370,7 +370,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* *
* @return a double value from the stream. * @return a double value from the stream.
* *
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
* *
...@@ -469,7 +469,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -469,7 +469,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* then a <code>UTFDataFormatException</code> is thrown. * then a <code>UTFDataFormatException</code> is thrown.
* *
* <p> If end of file is encountered at any time during this * <p> If end of file is encountered at any time during this
* entire process, then an <code>EOFException</code> is thrown. * entire process, then an <code>java.io.EOFException</code> is thrown.
* *
* <p> After every group has been converted to a character by this * <p> After every group has been converted to a character by this
* process, the characters are gathered, in the same order in * process, the characters are gathered, in the same order in
...@@ -488,10 +488,10 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -488,10 +488,10 @@ public interface ImageInputStream extends DataInput, Closeable {
* *
* @return a String read from the stream. * @return a String read from the stream.
* *
* @exception EOFException if this stream reaches the end * @exception java.io.EOFException if this stream reaches the end
* before reading all the bytes. * before reading all the bytes.
* @exception UTFDataFormatException if the bytes do not represent a * @exception java.io.UTFDataFormatException if the bytes do not represent
* valid modified UTF-8 encoding of a string. * a valid modified UTF-8 encoding of a string.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
String readUTF() throws IOException; String readUTF() throws IOException;
...@@ -499,7 +499,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -499,7 +499,7 @@ public interface ImageInputStream extends DataInput, Closeable {
/** /**
* Reads <code>len</code> bytes from the stream, and stores them * Reads <code>len</code> bytes from the stream, and stores them
* into <code>b</code> starting at index <code>off</code>. * into <code>b</code> starting at index <code>off</code>.
* If the end of the stream is reached, an <code>EOFException</code> * If the end of the stream is reached, an <code>java.io.EOFException</code>
* will be thrown. * will be thrown.
* *
* <p> The bit offset within the stream is reset to zero before * <p> The bit offset within the stream is reset to zero before
...@@ -514,7 +514,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -514,7 +514,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* len</code> is greater than <code>b.length</code>. * len</code> is greater than <code>b.length</code>.
* @exception NullPointerException if <code>b</code> is * @exception NullPointerException if <code>b</code> is
* <code>null</code>. * <code>null</code>.
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
...@@ -523,7 +523,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -523,7 +523,7 @@ public interface ImageInputStream extends DataInput, Closeable {
/** /**
* Reads <code>b.length</code> bytes from the stream, and stores them * Reads <code>b.length</code> bytes from the stream, and stores them
* into <code>b</code> starting at index <code>0</code>. * into <code>b</code> starting at index <code>0</code>.
* If the end of the stream is reached, an <code>EOFException</code> * If the end of the stream is reached, an <code>java.io.EOFException</code>
* will be thrown. * will be thrown.
* *
* <p> The bit offset within the stream is reset to zero before * <p> The bit offset within the stream is reset to zero before
...@@ -533,7 +533,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -533,7 +533,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* *
* @exception NullPointerException if <code>b</code> is * @exception NullPointerException if <code>b</code> is
* <code>null</code>. * <code>null</code>.
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
...@@ -544,7 +544,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -544,7 +544,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* stream according to the current byte order, and * stream according to the current byte order, and
* stores them into <code>s</code> starting at index * stores them into <code>s</code> starting at index
* <code>off</code>. If the end of the stream is reached, an * <code>off</code>. If the end of the stream is reached, an
* <code>EOFException</code> will be thrown. * <code>java.io.EOFException</code> will be thrown.
* *
* <p> The bit offset within the stream is reset to zero before * <p> The bit offset within the stream is reset to zero before
* the read occurs. * the read occurs.
...@@ -558,7 +558,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -558,7 +558,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* len</code> is greater than <code>s.length</code>. * len</code> is greater than <code>s.length</code>.
* @exception NullPointerException if <code>s</code> is * @exception NullPointerException if <code>s</code> is
* <code>null</code>. * <code>null</code>.
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
...@@ -569,7 +569,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -569,7 +569,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* stream according to the current byte order, and * stream according to the current byte order, and
* stores them into <code>c</code> starting at index * stores them into <code>c</code> starting at index
* <code>off</code>. If the end of the stream is reached, an * <code>off</code>. If the end of the stream is reached, an
* <code>EOFException</code> will be thrown. * <code>java.io.EOFException</code> will be thrown.
* *
* <p> The bit offset within the stream is reset to zero before * <p> The bit offset within the stream is reset to zero before
* the read occurs. * the read occurs.
...@@ -583,7 +583,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -583,7 +583,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* len</code> is greater than <code>c.length</code>. * len</code> is greater than <code>c.length</code>.
* @exception NullPointerException if <code>c</code> is * @exception NullPointerException if <code>c</code> is
* <code>null</code>. * <code>null</code>.
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
...@@ -594,7 +594,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -594,7 +594,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* stream according to the current byte order, and * stream according to the current byte order, and
* stores them into <code>i</code> starting at index * stores them into <code>i</code> starting at index
* <code>off</code>. If the end of the stream is reached, an * <code>off</code>. If the end of the stream is reached, an
* <code>EOFException</code> will be thrown. * <code>java.io.EOFException</code> will be thrown.
* *
* <p> The bit offset within the stream is reset to zero before * <p> The bit offset within the stream is reset to zero before
* the read occurs. * the read occurs.
...@@ -608,7 +608,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -608,7 +608,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* len</code> is greater than <code>i.length</code>. * len</code> is greater than <code>i.length</code>.
* @exception NullPointerException if <code>i</code> is * @exception NullPointerException if <code>i</code> is
* <code>null</code>. * <code>null</code>.
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
...@@ -619,7 +619,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -619,7 +619,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* stream according to the current byte order, and * stream according to the current byte order, and
* stores them into <code>l</code> starting at index * stores them into <code>l</code> starting at index
* <code>off</code>. If the end of the stream is reached, an * <code>off</code>. If the end of the stream is reached, an
* <code>EOFException</code> will be thrown. * <code>java.io.EOFException</code> will be thrown.
* *
* <p> The bit offset within the stream is reset to zero before * <p> The bit offset within the stream is reset to zero before
* the read occurs. * the read occurs.
...@@ -633,7 +633,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -633,7 +633,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* len</code> is greater than <code>l.length</code>. * len</code> is greater than <code>l.length</code>.
* @exception NullPointerException if <code>l</code> is * @exception NullPointerException if <code>l</code> is
* <code>null</code>. * <code>null</code>.
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
...@@ -644,7 +644,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -644,7 +644,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* floats) from the stream according to the current byte order, * floats) from the stream according to the current byte order,
* and stores them into <code>f</code> starting at * and stores them into <code>f</code> starting at
* index <code>off</code>. If the end of the stream is reached, * index <code>off</code>. If the end of the stream is reached,
* an <code>EOFException</code> will be thrown. * an <code>java.io.EOFException</code> will be thrown.
* *
* <p> The bit offset within the stream is reset to zero before * <p> The bit offset within the stream is reset to zero before
* the read occurs. * the read occurs.
...@@ -658,7 +658,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -658,7 +658,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* len</code> is greater than <code>f.length</code>. * len</code> is greater than <code>f.length</code>.
* @exception NullPointerException if <code>f</code> is * @exception NullPointerException if <code>f</code> is
* <code>null</code>. * <code>null</code>.
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
...@@ -669,7 +669,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -669,7 +669,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* floats) from the stream according to the current byte order, * floats) from the stream according to the current byte order,
* and stores them into <code>d</code> starting at * and stores them into <code>d</code> starting at
* index <code>off</code>. If the end of the stream is reached, * index <code>off</code>. If the end of the stream is reached,
* an <code>EOFException</code> will be thrown. * an <code>java.io.EOFException</code> will be thrown.
* *
* <p> The bit offset within the stream is reset to zero before * <p> The bit offset within the stream is reset to zero before
* the read occurs. * the read occurs.
...@@ -683,7 +683,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -683,7 +683,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* len</code> is greater than <code>d.length</code>. * len</code> is greater than <code>d.length</code>.
* @exception NullPointerException if <code>d</code> is * @exception NullPointerException if <code>d</code> is
* <code>null</code>. * <code>null</code>.
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bytes. * reading all the bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
...@@ -748,7 +748,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -748,7 +748,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* @return an <code>int</code> containing the value <code>0</code> * @return an <code>int</code> containing the value <code>0</code>
* or <code>1</code>. * or <code>1</code>.
* *
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bits. * reading all the bits.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
...@@ -768,13 +768,13 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -768,13 +768,13 @@ public interface ImageInputStream extends DataInput, Closeable {
* the right side of the return value, as shown by the following * the right side of the return value, as shown by the following
* pseudo-code: * pseudo-code:
* *
* <pre> * <pre>{@code
* long accum = 0L; * long accum = 0L;
* for (int i = 0; i < numBits; i++) { * for (int i = 0; i < numBits; i++) {
* accum <<= 1; // Shift left one bit to make room * accum <<= 1; // Shift left one bit to make room
* accum |= readBit(); * accum |= readBit();
* } * }
* </pre> * }</pre>
* *
* Note that the result of <code>readBits(32)</code> may thus not * Note that the result of <code>readBits(32)</code> may thus not
* be equal to that of <code>readInt()</code> if a reverse network * be equal to that of <code>readInt()</code> if a reverse network
...@@ -782,7 +782,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -782,7 +782,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* false</code>). * false</code>).
* *
* <p> If the end of the stream is encountered before all the bits * <p> If the end of the stream is encountered before all the bits
* have been read, an <code>EOFException</code> is thrown. * have been read, an <code>java.io.EOFException</code> is thrown.
* *
* @param numBits the number of bits to read, as an <code>int</code> * @param numBits the number of bits to read, as an <code>int</code>
* between 0 and 64, inclusive. * between 0 and 64, inclusive.
...@@ -791,7 +791,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -791,7 +791,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* *
* @exception IllegalArgumentException if <code>numBits</code> * @exception IllegalArgumentException if <code>numBits</code>
* is not between 0 and 64, inclusive. * is not between 0 and 64, inclusive.
* @exception EOFException if the stream reaches the end before * @exception java.io.EOFException if the stream reaches the end before
* reading all the bits. * reading all the bits.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
...@@ -850,7 +850,7 @@ public interface ImageInputStream extends DataInput, Closeable { ...@@ -850,7 +850,7 @@ public interface ImageInputStream extends DataInput, Closeable {
* returned by <code>getflushedPosition</code>). * returned by <code>getflushedPosition</code>).
* *
* <p> It is legal to seek past the end of the file; an * <p> It is legal to seek past the end of the file; an
* <code>EOFException</code> will be thrown only if a read is * <code>java.io.EOFException</code> will be thrown only if a read is
* performed. * performed.
* *
* @param pos a <code>long</code> containing the desired file * @param pos a <code>long</code> containing the desired file
......
...@@ -88,7 +88,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream { ...@@ -88,7 +88,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream {
/** /**
* The position prior to which data may be discarded. Seeking * The position prior to which data may be discarded. Seeking
* to a smaller position is not allowed. <code>flushedPos</code> * to a smaller position is not allowed. <code>flushedPos</code>
* will always be >= 0. * will always be {@literal >= 0}.
*/ */
protected long flushedPos = 0; protected long flushedPos = 0;
......
...@@ -59,9 +59,9 @@ public interface ImageOutputStream extends ImageInputStream, DataOutput { ...@@ -59,9 +59,9 @@ public interface ImageOutputStream extends ImageInputStream, DataOutput {
* remainder of the current byte is padded with 0s * remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the * and written out first. The bit offset will be 0 after the
* write. Implementers can use the * write. Implementers can use the
* {@link ImageOutputStreamImpl#flushBits <code>flushBits</code>} * {@link ImageOutputStreamImpl#flushBits flushBits}
* method of {@link ImageOutputStreamImpl * method of {@link ImageOutputStreamImpl ImageOutputStreamImpl}
* <code>ImageOutputStreamImpl</code>} to guarantee this. * to guarantee this.
* *
* @param b an <code>int</code> whose lower 8 bits are to be * @param b an <code>int</code> whose lower 8 bits are to be
* written. * written.
...@@ -99,9 +99,9 @@ public interface ImageOutputStream extends ImageInputStream, DataOutput { ...@@ -99,9 +99,9 @@ public interface ImageOutputStream extends ImageInputStream, DataOutput {
* remainder of the current byte is padded with 0s * remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the * and written out first. The bit offset will be 0 after the
* write. Implementers can use the * write. Implementers can use the
* {@link ImageOutputStreamImpl#flushBits <code>flushBits</code>} * {@link ImageOutputStreamImpl#flushBits flushBits}
* method of {@link ImageOutputStreamImpl * method of {@link ImageOutputStreamImpl ImageOutputStreamImpl}
* <code>ImageOutputStreamImpl</code>} to guarantee this. * to guarantee this.
* *
* @param b an array of <code>byte</code>s to be written. * @param b an array of <code>byte</code>s to be written.
* @param off the start offset in the data. * @param off the start offset in the data.
...@@ -182,8 +182,7 @@ public interface ImageOutputStream extends ImageInputStream, DataOutput { ...@@ -182,8 +182,7 @@ public interface ImageOutputStream extends ImageInputStream, DataOutput {
void writeShort(int v) throws IOException; void writeShort(int v) throws IOException;
/** /**
* This method is a synonym for * This method is a synonym for {@link #writeShort writeShort}.
* {@link #writeShort <code>writeShort</code>}.
* *
* @param v an <code>int</code> containing the char (unsigned * @param v an <code>int</code> containing the char (unsigned
* short) value to be written. * short) value to be written.
...@@ -430,7 +429,7 @@ public interface ImageOutputStream extends ImageInputStream, DataOutput { ...@@ -430,7 +429,7 @@ public interface ImageOutputStream extends ImageInputStream, DataOutput {
* *
* @exception NullPointerException if <code>s</code> is * @exception NullPointerException if <code>s</code> is
* <code>null</code>. * <code>null</code>.
* @exception UTFDataFormatException if the modified UTF-8 * @exception java.io.UTFDataFormatException if the modified UTF-8
* representation of <code>s</code> requires more than 65536 bytes. * representation of <code>s</code> requires more than 65536 bytes.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
......
...@@ -286,7 +286,7 @@ import java.io.Serializable; ...@@ -286,7 +286,7 @@ import java.io.Serializable;
* "autosensing" works is implementation dependent. In general, preformatted * "autosensing" works is implementation dependent. In general, preformatted
* autosense print data is provided in a byte oriented representation class * autosense print data is provided in a byte oriented representation class
* (byte array, InputStream, URL). * (byte array, InputStream, URL).
* * </UL>
* <P> * <P>
* <HR> * <HR>
* <H3>Service Formatted Print Data</H3> * <H3>Service Formatted Print Data</H3>
...@@ -545,7 +545,7 @@ public class DocFlavor implements Serializable, Cloneable { ...@@ -545,7 +545,7 @@ public class DocFlavor implements Serializable, Cloneable {
* the match. * the match.
* @return String representing a mime parameter, or * @return String representing a mime parameter, or
* null if that parameter is not in the mime type string. * null if that parameter is not in the mime type string.
* @exception throws NullPointerException if paramName is null. * @exception NullPointerException if paramName is null.
*/ */
public String getParameter(String paramName) { public String getParameter(String paramName) {
return return
......
...@@ -47,7 +47,7 @@ public interface MultiDocPrintJob extends DocPrintJob { ...@@ -47,7 +47,7 @@ public interface MultiDocPrintJob extends DocPrintJob {
* PrintJobListener. * PrintJobListener.
* *
* @param multiDoc The documents to be printed. ALL must be a flavor * @param multiDoc The documents to be printed. ALL must be a flavor
* supported by the PrintJob & PrintService. * supported by the PrintJob {@literal &} PrintService.
* *
* @param attributes The job attributes to be applied to this print job. * @param attributes The job attributes to be applied to this print job.
* If this parameter is null then the default attributes are used. * If this parameter is null then the default attributes are used.
......
...@@ -40,7 +40,7 @@ import javax.print.event.PrintServiceAttributeListener; ...@@ -40,7 +40,7 @@ import javax.print.event.PrintServiceAttributeListener;
* a printer's supported attributes. * a printer's supported attributes.
* <P> * <P>
* Example: * Example:
* <PRE> * <PRE>{@code
* DocFlavor flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT; * DocFlavor flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
* PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); * PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
* aset.add(MediaSizeName.ISO_A4); * aset.add(MediaSizeName.ISO_A4);
...@@ -56,7 +56,7 @@ import javax.print.event.PrintServiceAttributeListener; ...@@ -56,7 +56,7 @@ import javax.print.event.PrintServiceAttributeListener;
* } catch (PrintException e) { * } catch (PrintException e) {
* } * }
* } * }
* </PRE> * }</PRE>
*/ */
public interface PrintService { public interface PrintService {
......
...@@ -118,7 +118,7 @@ public class ServiceUI { ...@@ -118,7 +118,7 @@ public class ServiceUI {
* any changes made by the user. * any changes made by the user.
* *
* A typical basic usage of this method may be : * A typical basic usage of this method may be :
* <pre> * <pre>{@code
* PrintService[] services = PrintServiceLookup.lookupPrintServices( * PrintService[] services = PrintServiceLookup.lookupPrintServices(
* DocFlavor.INPUT_STREAM.JPEG, null); * DocFlavor.INPUT_STREAM.JPEG, null);
* PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet(); * PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
...@@ -131,7 +131,7 @@ public class ServiceUI { ...@@ -131,7 +131,7 @@ public class ServiceUI {
* ... print ... * ... print ...
* } * }
* } * }
* </pre> * }</pre>
* <p> * <p>
* @param gc used to select screen. null means primary or default screen. * @param gc used to select screen. null means primary or default screen.
......
...@@ -39,8 +39,8 @@ package javax.print; ...@@ -39,8 +39,8 @@ package javax.print;
* initialize services only when needed without any API dependencies * initialize services only when needed without any API dependencies
* except in an environment in which they are used. * except in an environment in which they are used.
* <p> * <p>
* Swing UIs are preferred as they provide a more consistent L&F and * Swing UIs are preferred as they provide a more consistent {@literal L&F}
* can support accessibility APIs. * and can support accessibility APIs.
* <p> * <p>
* Example usage: * Example usage:
* <pre> * <pre>
......
...@@ -42,7 +42,7 @@ package javax.print.attribute; ...@@ -42,7 +42,7 @@ package javax.print.attribute;
* class rather than the attribute object's class itself. An attribute * class rather than the attribute object's class itself. An attribute
* object's * object's
* category is determined by calling the {@link Attribute#getCategory() * category is determined by calling the {@link Attribute#getCategory()
* <CODE>getCategory()</CODE>} method defined in interface {@link Attribute * getCategory()} method defined in interface {@link Attribute
* Attribute}. * Attribute}.
* <P> * <P>
* The interfaces of an AttributeSet resemble those of the Java Collections * The interfaces of an AttributeSet resemble those of the Java Collections
...@@ -217,7 +217,7 @@ public interface AttributeSet { ...@@ -217,7 +217,7 @@ public interface AttributeSet {
/** /**
* Adds all of the elements in the specified set to this attribute. * Adds all of the elements in the specified set to this attribute.
* The outcome is the same as if the = * The outcome is the same as if the =
* {@link #add(Attribute) <CODE>add(Attribute)</CODE>} * {@link #add(Attribute) add(Attribute)}
* operation had been applied to this attribute set successively with each * operation had been applied to this attribute set successively with each
* element from the specified set. * element from the specified set.
* The behavior of the <CODE>addAll(AttributeSet)</CODE> * The behavior of the <CODE>addAll(AttributeSet)</CODE>
...@@ -301,7 +301,7 @@ public interface AttributeSet { ...@@ -301,7 +301,7 @@ public interface AttributeSet {
* This ensures that <tt>t1.equals(t2)</tt> implies that * This ensures that <tt>t1.equals(t2)</tt> implies that
* <tt>t1.hashCode()==t2.hashCode()</tt> for any two attribute sets * <tt>t1.hashCode()==t2.hashCode()</tt> for any two attribute sets
* <tt>t1</tt> and <tt>t2</tt>, as required by the general contract of * <tt>t1</tt> and <tt>t2</tt>, as required by the general contract of
* {@link java.lang.Object#hashCode() <CODE>Object.hashCode()</CODE>}. * {@link java.lang.Object#hashCode() Object.hashCode()}.
* *
* @return The hash code value for this attribute set. * @return The hash code value for this attribute set.
*/ */
......
...@@ -36,9 +36,9 @@ import java.util.Date; ...@@ -36,9 +36,9 @@ import java.util.Date;
* <P> * <P>
* Under the hood, a date-time attribute is stored as a value of class <code> * Under the hood, a date-time attribute is stored as a value of class <code>
* java.util.Date</code>. You can get a date-time attribute's Date value by * java.util.Date</code>. You can get a date-time attribute's Date value by
* calling {@link #getValue() <CODE>getValue()</CODE>}. A date-time attribute's * calling {@link #getValue() getValue()}. A date-time attribute's
* Date value is established when it is constructed (see {@link * Date value is established when it is constructed (see {@link
* #DateTimeSyntax(Date) <CODE>DateTimeSyntax(Date)</CODE>}). Once * #DateTimeSyntax(Date) DateTimeSyntax(Date)}). Once
* constructed, a date-time attribute's value is immutable. * constructed, a date-time attribute's value is immutable.
* <P> * <P>
* To construct a date-time attribute from separate values of the year, month, * To construct a date-time attribute from separate values of the year, month,
......
...@@ -37,8 +37,8 @@ package javax.print.attribute; ...@@ -37,8 +37,8 @@ package javax.print.attribute;
* constructors and mutating operations guarantee an additional invariant, * constructors and mutating operations guarantee an additional invariant,
* namely that all attribute values in the DocAttributeSet must be instances * namely that all attribute values in the DocAttributeSet must be instances
* of interface {@link DocAttribute DocAttribute}. * of interface {@link DocAttribute DocAttribute}.
* The {@link #add(Attribute) <CODE>add(Attribute)</CODE>}, and * The {@link #add(Attribute) add(Attribute)}, and
* {@link #addAll(AttributeSet) <CODE>addAll(AttributeSet)</CODE>} operations * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
* are respecified below to guarantee this additional invariant. * are respecified below to guarantee this additional invariant.
* <P> * <P>
* *
...@@ -74,7 +74,7 @@ public interface DocAttributeSet extends AttributeSet { ...@@ -74,7 +74,7 @@ public interface DocAttributeSet extends AttributeSet {
/** /**
* Adds all of the elements in the specified set to this attribute. * Adds all of the elements in the specified set to this attribute.
* The outcome is the same as if the * The outcome is the same as if the
* {@link #add(Attribute) <CODE>add(Attribute)</CODE>} * {@link #add(Attribute) add(Attribute)}
* operation had been applied to this attribute set successively with * operation had been applied to this attribute set successively with
* each element from the specified set. If none of the categories in the * each element from the specified set. If none of the categories in the
* specified set are the same as any categories in this attribute set, * specified set are the same as any categories in this attribute set,
......
...@@ -81,15 +81,15 @@ import java.io.Serializable; ...@@ -81,15 +81,15 @@ import java.io.Serializable;
* for identical objects (<CODE>==</CODE>). * for identical objects (<CODE>==</CODE>).
* <P> * <P>
* You can convert an enumeration value to a string by calling {@link * You can convert an enumeration value to a string by calling {@link
* #toString() <CODE>toString()</CODE>}. The string is obtained from a table * #toString() toString()}. The string is obtained from a table
* supplied by the enumeration class. * supplied by the enumeration class.
* <P> * <P>
* Under the hood, an enumeration value is just an integer, a different integer * Under the hood, an enumeration value is just an integer, a different integer
* for each enumeration value within an enumeration class. You can get an * for each enumeration value within an enumeration class. You can get an
* enumeration value's integer value by calling {@link #getValue() * enumeration value's integer value by calling {@link #getValue()
* <CODE>getValue()</CODE>}. An enumeration value's integer value is established * getValue()}. An enumeration value's integer value is established
* when it is constructed (see {@link #EnumSyntax(int) * when it is constructed (see {@link #EnumSyntax(int)
* <CODE>EnumSyntax(int)</CODE>}). Since the constructor is protected, the only * EnumSyntax(int)}). Since the constructor is protected, the only
* possible enumeration values are the singleton objects declared in the * possible enumeration values are the singleton objects declared in the
* enumeration class; additional enumeration values cannot be created at run * enumeration class; additional enumeration values cannot be created at run
* time. * time.
...@@ -170,10 +170,10 @@ public abstract class EnumSyntax implements Serializable, Cloneable { ...@@ -170,10 +170,10 @@ public abstract class EnumSyntax implements Serializable, Cloneable {
* *
* @return The enumeration singleton value stored at index * @return The enumeration singleton value stored at index
* <I>i</I>-<I>L</I> in the enumeration value table returned by * <I>i</I>-<I>L</I> in the enumeration value table returned by
* {@link #getEnumValueTable() <CODE>getEnumValueTable()</CODE>}, * {@link #getEnumValueTable() getEnumValueTable()},
* where <I>i</I> is this enumeration value's integer value and * where <I>i</I> is this enumeration value's integer value and
* <I>L</I> is the value returned by {@link #getOffset() * <I>L</I> is the value returned by {@link #getOffset()
* <CODE>getOffset()</CODE>}. * getOffset()}.
* *
* @throws ObjectStreamException if the stream can't be deserialised * @throws ObjectStreamException if the stream can't be deserialised
* @throws InvalidObjectException * @throws InvalidObjectException
...@@ -220,18 +220,18 @@ public abstract class EnumSyntax implements Serializable, Cloneable { ...@@ -220,18 +220,18 @@ public abstract class EnumSyntax implements Serializable, Cloneable {
* Returns the string table for this enumeration value's enumeration class. * Returns the string table for this enumeration value's enumeration class.
* The enumeration class's integer values are assumed to lie in the range * The enumeration class's integer values are assumed to lie in the range
* <I>L</I>..<I>L</I>+<I>N</I>-1, where <I>L</I> is the value returned by * <I>L</I>..<I>L</I>+<I>N</I>-1, where <I>L</I> is the value returned by
* {@link #getOffset() <CODE>getOffset()</CODE>} and <I>N</I> is the length * {@link #getOffset() getOffset()} and <I>N</I> is the length
* of the string table. The element in the string table at index * of the string table. The element in the string table at index
* <I>i</I>-<I>L</I> is the value returned by {@link #toString() * <I>i</I>-<I>L</I> is the value returned by {@link #toString()
* <CODE>toString()</CODE>} for the enumeration value whose integer value * toString()} for the enumeration value whose integer value
* is <I>i</I>. If an integer within the above range is not used by any * is <I>i</I>. If an integer within the above range is not used by any
* enumeration value, leave the corresponding table element null. * enumeration value, leave the corresponding table element null.
* <P> * <P>
* The default implementation returns null. If the enumeration class (a * The default implementation returns null. If the enumeration class (a
* subclass of class EnumSyntax) does not override this method to return a * subclass of class EnumSyntax) does not override this method to return a
* non-null string table, and the subclass does not override the {@link * non-null string table, and the subclass does not override the {@link
* #toString() <CODE>toString()</CODE>} method, the base class {@link * #toString() toString()} method, the base class {@link
* #toString() <CODE>toString()</CODE>} method will return just a string * #toString() toString()} method will return just a string
* representation of this enumeration value's integer value. * representation of this enumeration value's integer value.
* @return the string table * @return the string table
*/ */
...@@ -243,11 +243,11 @@ public abstract class EnumSyntax implements Serializable, Cloneable { ...@@ -243,11 +243,11 @@ public abstract class EnumSyntax implements Serializable, Cloneable {
* Returns the enumeration value table for this enumeration value's * Returns the enumeration value table for this enumeration value's
* enumeration class. The enumeration class's integer values are assumed to * enumeration class. The enumeration class's integer values are assumed to
* lie in the range <I>L</I>..<I>L</I>+<I>N</I>-1, where <I>L</I> is the * lie in the range <I>L</I>..<I>L</I>+<I>N</I>-1, where <I>L</I> is the
* value returned by {@link #getOffset() <CODE>getOffset()</CODE>} and * value returned by {@link #getOffset() getOffset()} and
* <I>N</I> is the length of the enumeration value table. The element in the * <I>N</I> is the length of the enumeration value table. The element in the
* enumeration value table at index <I>i</I>-<I>L</I> is the enumeration * enumeration value table at index <I>i</I>-<I>L</I> is the enumeration
* value object whose integer value is <I>i</I>; the {@link #readResolve() * value object whose integer value is <I>i</I>; the {@link #readResolve()
* <CODE>readResolve()</CODE>} method needs this to preserve singleton * readResolve()} method needs this to preserve singleton
* semantics during deserialization of an enumeration instance. If an * semantics during deserialization of an enumeration instance. If an
* integer within the above range is not used by any enumeration value, * integer within the above range is not used by any enumeration value,
* leave the corresponding table element null. * leave the corresponding table element null.
...@@ -255,8 +255,8 @@ public abstract class EnumSyntax implements Serializable, Cloneable { ...@@ -255,8 +255,8 @@ public abstract class EnumSyntax implements Serializable, Cloneable {
* The default implementation returns null. If the enumeration class (a * The default implementation returns null. If the enumeration class (a
* subclass of class EnumSyntax) does not override this method to return * subclass of class EnumSyntax) does not override this method to return
* a non-null enumeration value table, and the subclass does not override * a non-null enumeration value table, and the subclass does not override
* the {@link #readResolve() <CODE>readResolve()</CODE>} method, the base * the {@link #readResolve() readResolve()} method, the base
* class {@link #readResolve() <CODE>readResolve()</CODE>} method will throw * class {@link #readResolve() readResolve()} method will throw
* an exception whenever an enumeration instance is deserialized from an * an exception whenever an enumeration instance is deserialized from an
* object input stream. * object input stream.
* @return the value table * @return the value table
......
...@@ -388,7 +388,7 @@ public class HashAttributeSet implements AttributeSet, Serializable { ...@@ -388,7 +388,7 @@ public class HashAttributeSet implements AttributeSet, Serializable {
/** /**
* Adds all of the elements in the specified set to this attribute. * Adds all of the elements in the specified set to this attribute.
* The outcome is the same as if the * The outcome is the same as if the
* {@link #add(Attribute) <CODE>add(Attribute)</CODE>} * {@link #add(Attribute) add(Attribute)}
* operation had been applied to this attribute set successively with * operation had been applied to this attribute set successively with
* each element from the specified set. * each element from the specified set.
* The behavior of the <CODE>addAll(AttributeSet)</CODE> * The behavior of the <CODE>addAll(AttributeSet)</CODE>
...@@ -512,7 +512,7 @@ public class HashAttributeSet implements AttributeSet, Serializable { ...@@ -512,7 +512,7 @@ public class HashAttributeSet implements AttributeSet, Serializable {
* This ensures that <tt>t1.equals(t2)</tt> implies that * This ensures that <tt>t1.equals(t2)</tt> implies that
* <tt>t1.hashCode()==t2.hashCode()</tt> for any two attribute sets * <tt>t1.hashCode()==t2.hashCode()</tt> for any two attribute sets
* <tt>t1</tt> and <tt>t2</tt>, as required by the general contract of * <tt>t1</tt> and <tt>t2</tt>, as required by the general contract of
* {@link java.lang.Object#hashCode() <CODE>Object.hashCode()</CODE>}. * {@link java.lang.Object#hashCode() Object.hashCode()}.
* *
* @return The hash code value for this attribute set. * @return The hash code value for this attribute set.
*/ */
......
...@@ -33,9 +33,9 @@ import java.io.Serializable; ...@@ -33,9 +33,9 @@ import java.io.Serializable;
* <P> * <P>
* Under the hood, an integer attribute is just an integer. You can get an * Under the hood, an integer attribute is just an integer. You can get an
* integer attribute's integer value by calling {@link #getValue() * integer attribute's integer value by calling {@link #getValue()
* <CODE>getValue()</CODE>}. An integer attribute's integer value is * getValue()}. An integer attribute's integer value is
* established when it is constructed (see {@link #IntegerSyntax(int) * established when it is constructed (see {@link #IntegerSyntax(int)
* <CODE>IntegerSyntax(int)</CODE>}). Once constructed, an integer attribute's * IntegerSyntax(int)}). Once constructed, an integer attribute's
* value is immutable. * value is immutable.
* <P> * <P>
* *
......
...@@ -36,8 +36,8 @@ package javax.print.attribute; ...@@ -36,8 +36,8 @@ package javax.print.attribute;
* constructors and mutating operations guarantee an additional invariant, * constructors and mutating operations guarantee an additional invariant,
* namely that all attribute values in the PrintJobAttributeSet must be * namely that all attribute values in the PrintJobAttributeSet must be
* instances of interface {@link PrintJobAttribute PrintJobAttribute}. * instances of interface {@link PrintJobAttribute PrintJobAttribute}.
* The {@link #add(Attribute) <CODE>add(Attribute)</CODE>}, and * The {@link #add(Attribute) add(Attribute)}, and
* {@link #addAll(AttributeSet) <CODE>addAll(AttributeSet)</CODE>} operations * {@link #addAll(AttributeSet) >addAll(AttributeSet)} operations
* are respecified below to guarantee this additional invariant. * are respecified below to guarantee this additional invariant.
* <P> * <P>
* *
...@@ -72,7 +72,7 @@ public interface PrintJobAttributeSet extends AttributeSet { ...@@ -72,7 +72,7 @@ public interface PrintJobAttributeSet extends AttributeSet {
/** /**
* Adds all of the elements in the specified set to this attribute. * Adds all of the elements in the specified set to this attribute.
* The outcome is the same as if the * The outcome is the same as if the
* {@link #add(Attribute) <CODE>add(Attribute)</CODE>} * {@link #add(Attribute) add(Attribute)}
* operation had been applied to this attribute set successively with * operation had been applied to this attribute set successively with
* each element from the specified set. If none of the categories in the * each element from the specified set. If none of the categories in the
* specified set are the same as any categories in this attribute set, * specified set are the same as any categories in this attribute set,
......
...@@ -37,8 +37,8 @@ package javax.print.attribute; ...@@ -37,8 +37,8 @@ package javax.print.attribute;
* constructors and mutating operations guarantee an additional invariant, * constructors and mutating operations guarantee an additional invariant,
* namely that all attribute values in the PrintRequestAttributeSet must be * namely that all attribute values in the PrintRequestAttributeSet must be
* instances of interface {@link PrintRequestAttribute PrintRequestAttribute}. * instances of interface {@link PrintRequestAttribute PrintRequestAttribute}.
* The {@link #add(Attribute) <CODE>add(Attribute)</CODE>}, and * The {@link #add(Attribute) add(Attribute)}, and
* {@link #addAll(AttributeSet) <CODE>addAll(AttributeSet)</CODE>} operations * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
* are respecified below to guarantee this additional invariant. * are respecified below to guarantee this additional invariant.
* <P> * <P>
* *
...@@ -73,7 +73,7 @@ public interface PrintRequestAttributeSet extends AttributeSet { ...@@ -73,7 +73,7 @@ public interface PrintRequestAttributeSet extends AttributeSet {
/** /**
* Adds all of the elements in the specified set to this attribute. * Adds all of the elements in the specified set to this attribute.
* The outcome is the same as if the * The outcome is the same as if the
* {@link #add(Attribute) <CODE>add(Attribute)</CODE>} * {@link #add(Attribute) add(Attribute)}
* operation had been applied to this attribute set successively with * operation had been applied to this attribute set successively with
* each element from the specified set. If none of the categories in the * each element from the specified set. If none of the categories in the
* specified set are the same as any categories in this attribute set, * specified set are the same as any categories in this attribute set,
......
...@@ -39,8 +39,8 @@ package javax.print.attribute; ...@@ -39,8 +39,8 @@ package javax.print.attribute;
* invariant, * invariant,
* namely that all attribute values in the PrintServiceAttributeSet must be * namely that all attribute values in the PrintServiceAttributeSet must be
* instances of interface {@link PrintServiceAttribute PrintServiceAttribute}. * instances of interface {@link PrintServiceAttribute PrintServiceAttribute}.
* The {@link #add(Attribute) <CODE>add(Attribute)</CODE>}, and * The {@link #add(Attribute) add(Attribute)}, and
* {@link #addAll(AttributeSet) <CODE>addAll(AttributeSet)</CODE>} operations * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations
* are respecified below to guarantee this additional invariant. * are respecified below to guarantee this additional invariant.
* <P> * <P>
* *
...@@ -77,7 +77,7 @@ public interface PrintServiceAttributeSet extends AttributeSet { ...@@ -77,7 +77,7 @@ public interface PrintServiceAttributeSet extends AttributeSet {
/** /**
* Adds all of the elements in the specified set to this attribute. * Adds all of the elements in the specified set to this attribute.
* The outcome is the same as if the * The outcome is the same as if the
* {@link #add(Attribute) <CODE>add(Attribute)</CODE>} * {@link #add(Attribute) add(Attribute)}
* operation had been applied to this attribute set successively with * operation had been applied to this attribute set successively with
* each element from the specified set. If none of the categories in the * each element from the specified set. If none of the categories in the
* specified set are the same as any categories in this attribute set, * specified set are the same as any categories in this attribute set,
......
...@@ -39,7 +39,7 @@ import java.io.Serializable; ...@@ -39,7 +39,7 @@ import java.io.Serializable;
* resolution attribute's values, indicating the units in which the values are * resolution attribute's values, indicating the units in which the values are
* to be returned. The two most common resolution units are dots per inch (dpi) * to be returned. The two most common resolution units are dots per inch (dpi)
* and dots per centimeter (dpcm), and exported constants {@link #DPI * and dots per centimeter (dpcm), and exported constants {@link #DPI
* <CODE>DPI</CODE>} and {@link #DPCM <CODE>DPCM</CODE>} are provided for * DPI} and {@link #DPCM DPCM} are provided for
* indicating those units. * indicating those units.
* <P> * <P>
* Once constructed, a resolution attribute's value is immutable. * Once constructed, a resolution attribute's value is immutable.
...@@ -68,9 +68,9 @@ import java.io.Serializable; ...@@ -68,9 +68,9 @@ import java.io.Serializable;
* done, which would not be guaranteed if a floating point representation were * done, which would not be guaranteed if a floating point representation were
* used. * used.
* <P> * <P>
* The exported constant {@link #DPI <CODE>DPI</CODE>} is actually the * The exported constant {@link #DPI DPI} is actually the
* conversion factor by which to multiply a value in dpi to get the value in * conversion factor by which to multiply a value in dpi to get the value in
* dphi. Likewise, the exported constant {@link #DPCM <CODE>DPCM</CODE>} is the * dphi. Likewise, the exported constant {@link #DPCM DPCM} is the
* conversion factor by which to multiply a value in dpcm to get the value in * conversion factor by which to multiply a value in dpcm to get the value in
* dphi. A client can specify a resolution value in units other than dpi or dpcm * dphi. A client can specify a resolution value in units other than dpi or dpcm
* by supplying its own conversion factor. However, since the internal units of * by supplying its own conversion factor. However, since the internal units of
...@@ -120,12 +120,12 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { ...@@ -120,12 +120,12 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable {
* @param feedResolution * @param feedResolution
* Feed direction resolution. * Feed direction resolution.
* @param units * @param units
* Unit conversion factor, e.g. {@link #DPI <CODE>DPI</CODE>} or * Unit conversion factor, e.g. {@link #DPI DPI} or
* {@link #DPCM <CODE>DPCM</CODE>}. * {@link #DPCM DPCM}.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>crossFeedResolution</CODE> < * (unchecked exception) Thrown if {@code crossFeedResolution < 1}
* 1 or <CODE>feedResolution</CODE> < 1 or <CODE>units</CODE> < 1. * or {@code feedResolution < 1} or {@code units < 1}.
*/ */
public ResolutionSyntax(int crossFeedResolution, int feedResolution, public ResolutionSyntax(int crossFeedResolution, int feedResolution,
int units) { int units) {
...@@ -172,14 +172,14 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { ...@@ -172,14 +172,14 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable {
* The values are rounded to the nearest integer. * The values are rounded to the nearest integer.
* *
* @param units * @param units
* Unit conversion factor, e.g. {@link #DPI <CODE>DPI</CODE>} or * Unit conversion factor, e.g. {@link #DPI DPI} or
* {@link #DPCM <CODE>DPCM</CODE>}. * {@link #DPCM DPCM}.
* *
* @return A two-element array with the cross feed direction resolution * @return A two-element array with the cross feed direction resolution
* at index 0 and the feed direction resolution at index 1. * at index 0 and the feed direction resolution at index 1.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>units</CODE> < 1. * (unchecked exception) Thrown if {@code units < 1}.
*/ */
public int[] getResolution(int units) { public int[] getResolution(int units) {
return new int[] { getCrossFeedResolution(units), return new int[] { getCrossFeedResolution(units),
...@@ -192,13 +192,13 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { ...@@ -192,13 +192,13 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable {
* the given units. The value is rounded to the nearest integer. * the given units. The value is rounded to the nearest integer.
* *
* @param units * @param units
* Unit conversion factor, e.g. {@link #DPI <CODE>DPI</CODE>} or * Unit conversion factor, e.g. {@link #DPI DPI} or
* {@link #DPCM <CODE>DPCM</CODE>}. * {@link #DPCM DPCM}.
* *
* @return Cross feed direction resolution. * @return Cross feed direction resolution.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>units</CODE> < 1. * (unchecked exception) Thrown if {@code units < 1}.
*/ */
public int getCrossFeedResolution(int units) { public int getCrossFeedResolution(int units) {
return convertFromDphi (crossFeedResolution, units); return convertFromDphi (crossFeedResolution, units);
...@@ -209,13 +209,13 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { ...@@ -209,13 +209,13 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable {
* given units. The value is rounded to the nearest integer. * given units. The value is rounded to the nearest integer.
* *
* @param units * @param units
* Unit conversion factor, e.g. {@link #DPI <CODE>DPI</CODE>} or {@link * Unit conversion factor, e.g. {@link #DPI DPI} or {@link
* #DPCM <CODE>DPCM</CODE>}. * #DPCM DPCM}.
* *
* @return Feed direction resolution. * @return Feed direction resolution.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>units</CODE> < 1. * (unchecked exception) Thrown if {@code units < 1}.
*/ */
public int getFeedResolution(int units) { public int getFeedResolution(int units) {
return convertFromDphi (feedResolution, units); return convertFromDphi (feedResolution, units);
...@@ -229,8 +229,8 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { ...@@ -229,8 +229,8 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable {
* rounded to the nearest integer. * rounded to the nearest integer.
* *
* @param units * @param units
* Unit conversion factor, e.g. {@link #DPI <CODE>DPI</CODE>} or {@link * Unit conversion factor, e.g. {@link #DPI CODE>DPI} or {@link
* #DPCM <CODE>DPCM</CODE>}. * #DPCM DPCM}.
* @param unitsName * @param unitsName
* Units name string, e.g. <CODE>"dpi"</CODE> or <CODE>"dpcm"</CODE>. If * Units name string, e.g. <CODE>"dpi"</CODE> or <CODE>"dpcm"</CODE>. If
* null, no units name is appended to the result. * null, no units name is appended to the result.
...@@ -238,7 +238,7 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { ...@@ -238,7 +238,7 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable {
* @return String version of this resolution attribute. * @return String version of this resolution attribute.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>units</CODE> < 1. * (unchecked exception) Thrown if {@code units < 1}.
*/ */
public String toString(int units, String unitsName) { public String toString(int units, String unitsName) {
StringBuffer result = new StringBuffer(); StringBuffer result = new StringBuffer();
......
...@@ -38,8 +38,8 @@ import java.io.Serializable; ...@@ -38,8 +38,8 @@ import java.io.Serializable;
* values are measured. Methods are provided to return a two-dimensional size * values are measured. Methods are provided to return a two-dimensional size
* attribute's values, indicating the units in which the values are to be * attribute's values, indicating the units in which the values are to be
* returned. The two most common size units are inches (in) and millimeters * returned. The two most common size units are inches (in) and millimeters
* (mm), and exported constants {@link #INCH <CODE>INCH</CODE>} and {@link #MM * (mm), and exported constants {@link #INCH INCH} and {@link #MM
* <CODE>MM</CODE>} are provided for indicating those units. * MM} are provided for indicating those units.
* <P> * <P>
* Once constructed, a two-dimensional size attribute's value is immutable. * Once constructed, a two-dimensional size attribute's value is immutable.
* <P> * <P>
...@@ -66,9 +66,9 @@ import java.io.Serializable; ...@@ -66,9 +66,9 @@ import java.io.Serializable;
* units, you have to search for a media size of 215.9 x 279.4 mm; rounding off * units, you have to search for a media size of 215.9 x 279.4 mm; rounding off
* to an integral 216 x 279 mm will not match. * to an integral 216 x 279 mm will not match.
* <P> * <P>
* The exported constant {@link #INCH <CODE>INCH</CODE>} is actually the * The exported constant {@link #INCH INCH} is actually the
* conversion factor by which to multiply a value in inches to get the value in * conversion factor by which to multiply a value in inches to get the value in
* &#181;m. Likewise, the exported constant {@link #MM <CODE>MM</CODE>} is the * &#181;m. Likewise, the exported constant {@link #MM MM} is the
* conversion factor by which to multiply a value in mm to get the value in * conversion factor by which to multiply a value in mm to get the value in
* &#181;m. A client can specify a resolution value in units other than inches * &#181;m. A client can specify a resolution value in units other than inches
* or mm by supplying its own conversion factor. However, since the internal * or mm by supplying its own conversion factor. However, since the internal
...@@ -117,12 +117,12 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { ...@@ -117,12 +117,12 @@ public abstract class Size2DSyntax implements Serializable, Cloneable {
* @param x X dimension. * @param x X dimension.
* @param y Y dimension. * @param y Y dimension.
* @param units * @param units
* Unit conversion factor, e.g. {@link #INCH <CODE>INCH</CODE>} or * Unit conversion factor, e.g. {@link #INCH INCH} or
* {@link #MM <CODE>MM</CODE>}. * {@link #MM MM}.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE> * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
* < 0 or <CODE>units</CODE> < 1. * {@code units < 1}.
*/ */
protected Size2DSyntax(float x, float y, int units) { protected Size2DSyntax(float x, float y, int units) {
if (x < 0.0f) { if (x < 0.0f) {
...@@ -145,12 +145,12 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { ...@@ -145,12 +145,12 @@ public abstract class Size2DSyntax implements Serializable, Cloneable {
* @param x X dimension. * @param x X dimension.
* @param y Y dimension. * @param y Y dimension.
* @param units * @param units
* Unit conversion factor, e.g. {@link #INCH <CODE>INCH</CODE>} or * Unit conversion factor, e.g. {@link #INCH INCH} or
* {@link #MM <CODE>MM</CODE>}. * {@link #MM MM}.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE> * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0}
* < 0 or <CODE>units</CODE> < 1. * or {@code units < 1}.
*/ */
protected Size2DSyntax(int x, int y, int units) { protected Size2DSyntax(int x, int y, int units) {
if (x < 0) { if (x < 0) {
...@@ -193,14 +193,13 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { ...@@ -193,14 +193,13 @@ public abstract class Size2DSyntax implements Serializable, Cloneable {
* as floating-point values. * as floating-point values.
* *
* @param units * @param units
* Unit conversion factor, e.g. {@link #INCH <CODE>INCH</CODE>} or * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
* {@link #MM <CODE>MM</CODE>}.
* *
* @return A two-element array with the X dimension at index 0 and the Y * @return A two-element array with the X dimension at index 0 and the Y
* dimension at index 1. * dimension at index 1.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>units</CODE> < 1. * (unchecked exception) Thrown if {@code units < 1}.
*/ */
public float[] getSize(int units) { public float[] getSize(int units) {
return new float[] {getX(units), getY(units)}; return new float[] {getX(units), getY(units)};
...@@ -211,13 +210,12 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { ...@@ -211,13 +210,12 @@ public abstract class Size2DSyntax implements Serializable, Cloneable {
* units as a floating-point value. * units as a floating-point value.
* *
* @param units * @param units
* Unit conversion factor, e.g. {@link #INCH <CODE>INCH</CODE>} or * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
* {@link #MM <CODE>MM</CODE>}.
* *
* @return X dimension. * @return X dimension.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>units</CODE> < 1. * (unchecked exception) Thrown if {@code units < 1}.
*/ */
public float getX(int units) { public float getX(int units) {
return convertFromMicrometers(x, units); return convertFromMicrometers(x, units);
...@@ -228,13 +226,12 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { ...@@ -228,13 +226,12 @@ public abstract class Size2DSyntax implements Serializable, Cloneable {
* units as a floating-point value. * units as a floating-point value.
* *
* @param units * @param units
* Unit conversion factor, e.g. {@link #INCH <CODE>INCH</CODE>} or * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
* {@link #MM <CODE>MM</CODE>}.
* *
* @return Y dimension. * @return Y dimension.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>units</CODE> < 1. * (unchecked exception) Thrown if {@code units < 1}.
*/ */
public float getY(int units) { public float getY(int units) {
return convertFromMicrometers(y, units); return convertFromMicrometers(y, units);
...@@ -248,16 +245,16 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { ...@@ -248,16 +245,16 @@ public abstract class Size2DSyntax implements Serializable, Cloneable {
* floating point. * floating point.
* *
* @param units * @param units
* Unit conversion factor, e.g. {@link #INCH <CODE>INCH</CODE>} or * Unit conversion factor, e.g. {@link #INCH INCH} or {@link #MM MM}.
* {@link #MM <CODE>MM</CODE>}. *
* @param unitsName * @param unitsName
* Units name string, e.g. <CODE>"in"</CODE> or <CODE>"mm"</CODE>. If * Units name string, e.g. {@code in} or {@code mm}. If
* null, no units name is appended to the result. * null, no units name is appended to the result.
* *
* @return String version of this two-dimensional size attribute. * @return String version of this two-dimensional size attribute.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>units</CODE> < 1. * (unchecked exception) Thrown if {@code units < 1}.
*/ */
public String toString(int units, String unitsName) { public String toString(int units, String unitsName) {
StringBuffer result = new StringBuffer(); StringBuffer result = new StringBuffer();
......
...@@ -40,11 +40,11 @@ import javax.print.attribute.PrintJobAttribute; ...@@ -40,11 +40,11 @@ import javax.print.attribute.PrintJobAttribute;
* can be verified to support color printing. * can be verified to support color printing.
* <P> * <P>
* The table below shows the effects of specifying a Chromaticity attribute of * The table below shows the effects of specifying a Chromaticity attribute of
* {@link #MONOCHROME <CODE>MONOCHROME</CODE>} or {@link #COLOR * {@link #MONOCHROME MONOCHROME} or {@link #COLOR COLOR}
* <CODE>COLOR</CODE>} for a monochrome or color document. * for a monochrome or color document.
* <P> * <P>
* <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Shows effects of specifying MONOCHROME or COLOR Chromaticity attributes"> * <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Shows effects of specifying MONOCHROME or COLOR Chromaticity attributes">
* <TR BGCOLOR="#E5E5E5"> * <TR>
* <TH> * <TH>
* Chromaticity<BR>Attribute * Chromaticity<BR>Attribute
* </TH> * </TH>
...@@ -57,7 +57,7 @@ import javax.print.attribute.PrintJobAttribute; ...@@ -57,7 +57,7 @@ import javax.print.attribute.PrintJobAttribute;
* </TR> * </TR>
* <TR> * <TR>
* <TD> * <TD>
* {@link #MONOCHROME <CODE>MONOCHROME</CODE>} * {@link #MONOCHROME MONOCHROME}
* </TD> * </TD>
* <TD> * <TD>
* Printed as is, in monochrome * Printed as is, in monochrome
...@@ -68,7 +68,7 @@ import javax.print.attribute.PrintJobAttribute; ...@@ -68,7 +68,7 @@ import javax.print.attribute.PrintJobAttribute;
* </TR> * </TR>
* <TR> * <TR>
* <TD> * <TD>
* {@link #COLOR <CODE>COLOR</CODE>} * {@link #COLOR COLOR}
* </TD> * </TD>
* <TD> * <TD>
* Printed as is, in monochrome * Printed as is, in monochrome
......
...@@ -34,7 +34,7 @@ import javax.print.attribute.DocAttribute; ...@@ -34,7 +34,7 @@ import javax.print.attribute.DocAttribute;
* print data (the doc), not of the Print Job. If a Compression attribute is not * print data (the doc), not of the Print Job. If a Compression attribute is not
* specified for a doc, the printer assumes the doc's print data is uncompressed * specified for a doc, the printer assumes the doc's print data is uncompressed
* (i.e., the default Compression value is always {@link #NONE * (i.e., the default Compression value is always {@link #NONE
* <CODE>NONE</CODE>}). * NONE}).
* <P> * <P>
* <B>IPP Compatibility:</B> The category name returned by * <B>IPP Compatibility:</B> The category name returned by
* <CODE>getName()</CODE> is the IPP attribute name. The enumeration's * <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
......
...@@ -46,13 +46,13 @@ import javax.print.attribute.PrintJobAttribute; ...@@ -46,13 +46,13 @@ import javax.print.attribute.PrintJobAttribute;
* &nbsp; * &nbsp;
* </TD> * </TD>
* <TD WIDTH=27%> * <TD WIDTH=27%>
* {@link #NONE <CODE>NONE</CODE>} * {@link #NONE NONE}
* </TD> * </TD>
* <TD WIDTH=27%> * <TD WIDTH=27%>
* {@link #STAPLE <CODE>STAPLE</CODE>} * {@link #STAPLE STAPLE}
* </TD> * </TD>
* <TD WIDTH=36%> * <TD WIDTH=36%>
* {@link #EDGE_STITCH <CODE>EDGE_STITCH</CODE>} * {@link #EDGE_STITCH EDGE_STITCH}
* </TD> * </TD>
* </TR> * </TR>
* <TR> * <TR>
...@@ -60,13 +60,13 @@ import javax.print.attribute.PrintJobAttribute; ...@@ -60,13 +60,13 @@ import javax.print.attribute.PrintJobAttribute;
* &nbsp; * &nbsp;
* </TD> * </TD>
* <TD> * <TD>
* {@link #BIND <CODE>BIND</CODE>} * {@link #BIND BIND}
* </TD> * </TD>
* <TD> * <TD>
* {@link #SADDLE_STITCH <CODE>SADDLE_STITCH</CODE>} * {@link #SADDLE_STITCH SADDLE_STITCH}
* </TD> * </TD>
* <TD> * <TD>
* {@link #COVER <CODE>COVER</CODE>} * {@link #COVER COVER}
* </TD> * </TD>
* <TD> * <TD>
* &nbsp; * &nbsp;
...@@ -82,13 +82,13 @@ import javax.print.attribute.PrintJobAttribute; ...@@ -82,13 +82,13 @@ import javax.print.attribute.PrintJobAttribute;
* &nbsp; * &nbsp;
* </TD> * </TD>
* <TD WIDTH=27%> * <TD WIDTH=27%>
* {@link #STAPLE_TOP_LEFT <CODE>STAPLE_TOP_LEFT</CODE>} * {@link #STAPLE_TOP_LEFT STAPLE_TOP_LEFT}
* </TD> * </TD>
* <TD WIDTH=27%> * <TD WIDTH=27%>
* {@link #EDGE_STITCH_LEFT <CODE>EDGE_STITCH_LEFT</CODE>} * {@link #EDGE_STITCH_LEFT EDGE_STITCH_LEFT}
* </TD> * </TD>
* <TD WIDTH=27%> * <TD WIDTH=27%>
* {@link #STAPLE_DUAL_LEFT <CODE>STAPLE_DUAL_LEFT</CODE>} * {@link #STAPLE_DUAL_LEFT STAPLE_DUAL_LEFT}
* </TD> * </TD>
* <TD WIDTH=9%> * <TD WIDTH=9%>
* &nbsp; * &nbsp;
...@@ -99,13 +99,13 @@ import javax.print.attribute.PrintJobAttribute; ...@@ -99,13 +99,13 @@ import javax.print.attribute.PrintJobAttribute;
* &nbsp; * &nbsp;
* </TD> * </TD>
* <TD WIDTH=27%> * <TD WIDTH=27%>
* {@link #STAPLE_BOTTOM_LEFT <CODE>STAPLE_BOTTOM_LEFT</CODE>} * {@link #STAPLE_BOTTOM_LEFT STAPLE_BOTTOM_LEFT}
* </TD> * </TD>
* <TD WIDTH=27%> * <TD WIDTH=27%>
* {@link #EDGE_STITCH_TOP <CODE>EDGE_STITCH_TOP</CODE>} * {@link #EDGE_STITCH_TOP EDGE_STITCH_TOP}
* </TD> * </TD>
* <TD WIDTH=27%> * <TD WIDTH=27%>
* {@link #STAPLE_DUAL_TOP <CODE>STAPLE_DUAL_TOP</CODE>} * {@link #STAPLE_DUAL_TOP STAPLE_DUAL_TOP}
* </TD> * </TD>
* <TD WIDTH=9%> * <TD WIDTH=9%>
* &nbsp; * &nbsp;
...@@ -116,13 +116,13 @@ import javax.print.attribute.PrintJobAttribute; ...@@ -116,13 +116,13 @@ import javax.print.attribute.PrintJobAttribute;
* &nbsp; * &nbsp;
* </TD> * </TD>
* <TD WIDTH=27%> * <TD WIDTH=27%>
* {@link #STAPLE_TOP_RIGHT <CODE>STAPLE_TOP_RIGHT</CODE>} * {@link #STAPLE_TOP_RIGHT STAPLE_TOP_RIGHT}
* </TD> * </TD>
* <TD WIDTH=27%> * <TD WIDTH=27%>
* {@link #EDGE_STITCH_RIGHT <CODE>EDGE_STITCH_RIGHT</CODE>} * {@link #EDGE_STITCH_RIGHT EDGE_STITCH_RIGHT}
* </TD> * </TD>
* <TD WIDTH=27%> * <TD WIDTH=27%>
* {@link #STAPLE_DUAL_RIGHT <CODE>STAPLE_DUAL_RIGHT</CODE>} * {@link #STAPLE_DUAL_RIGHT STAPLE_DUAL_RIGHT}
* </TD> * </TD>
* <TD WIDTH=9%> * <TD WIDTH=9%>
* &nbsp; * &nbsp;
...@@ -133,13 +133,13 @@ import javax.print.attribute.PrintJobAttribute; ...@@ -133,13 +133,13 @@ import javax.print.attribute.PrintJobAttribute;
* &nbsp; * &nbsp;
* </TD> * </TD>
* <TD WIDTH=27%> * <TD WIDTH=27%>
* {@link #STAPLE_BOTTOM_RIGHT <CODE>STAPLE_BOTTOM_RIGHT</CODE>} * {@link #STAPLE_BOTTOM_RIGHT STAPLE_BOTTOM_RIGHT}
* </TD> * </TD>
* <TD WIDTH=27%> * <TD WIDTH=27%>
* {@link #EDGE_STITCH_BOTTOM <CODE>EDGE_STITCH_BOTTOM</CODE>} * {@link #EDGE_STITCH_BOTTOM EDGE_STITCH_BOTTOM}
* </TD> * </TD>
* <TD WIDTH=27%> * <TD WIDTH=27%>
* {@link #STAPLE_DUAL_BOTTOM <CODE>STAPLE_DUAL_BOTTOM</CODE>} * {@link #STAPLE_DUAL_BOTTOM STAPLE_DUAL_BOTTOM}
* </TD> * </TD>
* <TD WIDTH=9%> * <TD WIDTH=9%>
* &nbsp; * &nbsp;
...@@ -147,16 +147,16 @@ import javax.print.attribute.PrintJobAttribute; ...@@ -147,16 +147,16 @@ import javax.print.attribute.PrintJobAttribute;
* </TR> * </TR>
* </TABLE> * </TABLE>
* <P> * <P>
* The <CODE>STAPLE_<I>XXX</I></CODE> values are specified with respect to the * The STAPLE_<I>XXX</I> values are specified with respect to the
* document as if the document were a portrait document. If the document is * document as if the document were a portrait document. If the document is
* actually a landscape or a reverse-landscape document, the client supplies the * actually a landscape or a reverse-landscape document, the client supplies the
* appropriate transformed value. For example, to position a staple in the upper * appropriate transformed value. For example, to position a staple in the upper
* left hand corner of a landscape document when held for reading, the client * left hand corner of a landscape document when held for reading, the client
* supplies the <CODE>STAPLE_BOTTOM_LEFT</CODE> value (since landscape is * supplies the STAPLE_BOTTOM_LEFT value (since landscape is
* defined as a +90 degree rotation from portrait, i.e., anti-clockwise). On the * defined as a +90 degree rotation from portrait, i.e., anti-clockwise). On the
* other hand, to position a staple in the upper left hand corner of a * other hand, to position a staple in the upper left hand corner of a
* reverse-landscape document when held for reading, the client supplies the * reverse-landscape document when held for reading, the client supplies the
* <CODE>STAPLE_TOP_RIGHT</CODE> value (since reverse-landscape is defined as a * STAPLE_TOP_RIGHT value (since reverse-landscape is defined as a
* -90 degree rotation from portrait, i.e., clockwise). * -90 degree rotation from portrait, i.e., clockwise).
* <P> * <P>
* The angle (vertical, horizontal, angled) of each staple with respect to the * The angle (vertical, horizontal, angled) of each staple with respect to the
......
...@@ -67,7 +67,7 @@ import javax.print.attribute.PrintJobAttribute; ...@@ -67,7 +67,7 @@ import javax.print.attribute.PrintJobAttribute;
* shown in the table below. * shown in the table below.
* <P> * <P>
* <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Table showing computation of doc sizes"> * <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Table showing computation of doc sizes">
* <TR BGCOLOR="#E5E5E5"> * <TR>
* <TH>Representation Class</TH> * <TH>Representation Class</TH>
* <TH>Document Size</TH> * <TH>Document Size</TH>
* </TR> * </TR>
......
...@@ -62,7 +62,7 @@ import javax.print.attribute.PrintRequestAttribute; ...@@ -62,7 +62,7 @@ import javax.print.attribute.PrintRequestAttribute;
* The (x,y) origin is positioned at the top-left of the paper in portrait * The (x,y) origin is positioned at the top-left of the paper in portrait
* mode regardless of the orientation specified in the requesting context. * mode regardless of the orientation specified in the requesting context.
* For example a printable area for A4 paper in portrait or landscape * For example a printable area for A4 paper in portrait or landscape
* orientation will have height > width. * orientation will have height {@literal >} width.
* <p> * <p>
* A printable area attribute's values are stored * A printable area attribute's values are stored
* internally as integers in units of micrometers (&#181;m), where 1 micrometer * internally as integers in units of micrometers (&#181;m), where 1 micrometer
...@@ -107,9 +107,9 @@ public final class MediaPrintableArea ...@@ -107,9 +107,9 @@ public final class MediaPrintableArea
* @param units in which the values are expressed. * @param units in which the values are expressed.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE> < 0 * Thrown if {@code x < 0} or {@code y < 0}
* or <CODE>w</CODE> <= 0 or <CODE>h</CODE> <= 0 or * or {@code w <= 0} or {@code h <= 0} or
* <CODE>units</CODE> < 1. * {@code units < 1}.
*/ */
public MediaPrintableArea(float x, float y, float w, float h, int units) { public MediaPrintableArea(float x, float y, float w, float h, int units) {
if ((x < 0.0) || (y < 0.0) || (w <= 0.0) || (h <= 0.0) || if ((x < 0.0) || (y < 0.0) || (w <= 0.0) || (h <= 0.0) ||
...@@ -133,9 +133,9 @@ public final class MediaPrintableArea ...@@ -133,9 +133,9 @@ public final class MediaPrintableArea
* @param units in which the values are expressed. * @param units in which the values are expressed.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE> < 0 * Thrown if {@code x < 0} or {@code y < 0}
* or <CODE>w</CODE> <= 0 or <CODE>h</CODE> <= 0 or * or {@code w <= 0} or {@code h <= 0} or
* <CODE>units</CODE> < 1. * {@code units < 1}.
*/ */
public MediaPrintableArea(int x, int y, int w, int h, int units) { public MediaPrintableArea(int x, int y, int w, int h, int units) {
if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) || if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) ||
...@@ -159,7 +159,7 @@ public final class MediaPrintableArea ...@@ -159,7 +159,7 @@ public final class MediaPrintableArea
* @return printable area as array of x, y, w, h in the specified units. * @return printable area as array of x, y, w, h in the specified units.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>units</CODE> < 1. * (unchecked exception) Thrown if {@code units < 1}.
*/ */
public float[] getPrintableArea(int units) { public float[] getPrintableArea(int units) {
return new float[] { getX(units), getY(units), return new float[] { getX(units), getY(units),
...@@ -177,7 +177,7 @@ public final class MediaPrintableArea ...@@ -177,7 +177,7 @@ public final class MediaPrintableArea
* specified units. * specified units.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>units</CODE> < 1. * (unchecked exception) Thrown if {@code units < 1}.
*/ */
public float getX(int units) { public float getX(int units) {
return convertFromMicrometers(x, units); return convertFromMicrometers(x, units);
...@@ -194,7 +194,7 @@ public final class MediaPrintableArea ...@@ -194,7 +194,7 @@ public final class MediaPrintableArea
* specified units. * specified units.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>units</CODE> < 1. * (unchecked exception) Thrown if {@code units < 1}.
*/ */
public float getY(int units) { public float getY(int units) {
return convertFromMicrometers(y, units); return convertFromMicrometers(y, units);
...@@ -209,7 +209,7 @@ public final class MediaPrintableArea ...@@ -209,7 +209,7 @@ public final class MediaPrintableArea
* @return width of the printable area in the specified units. * @return width of the printable area in the specified units.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>units</CODE> < 1. * (unchecked exception) Thrown if {@code units < 1}.
*/ */
public float getWidth(int units) { public float getWidth(int units) {
return convertFromMicrometers(w, units); return convertFromMicrometers(w, units);
...@@ -224,7 +224,7 @@ public final class MediaPrintableArea ...@@ -224,7 +224,7 @@ public final class MediaPrintableArea
* @return height of the printable area in the specified units. * @return height of the printable area in the specified units.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>units</CODE> < 1. * (unchecked exception) Thrown if {@code units < 1}.
*/ */
public float getHeight(int units) { public float getHeight(int units) {
return convertFromMicrometers(h, units); return convertFromMicrometers(h, units);
...@@ -301,7 +301,7 @@ public final class MediaPrintableArea ...@@ -301,7 +301,7 @@ public final class MediaPrintableArea
* @return String version of this two-dimensional size attribute. * @return String version of this two-dimensional size attribute.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>units</CODE> < 1. * (unchecked exception) Thrown if {@code units < 1}.
*/ */
public String toString(int units, String unitsName) { public String toString(int units, String unitsName) {
if (unitsName == null) { if (unitsName == null) {
......
...@@ -45,7 +45,7 @@ import javax.print.attribute.Attribute; ...@@ -45,7 +45,7 @@ import javax.print.attribute.Attribute;
* <code>MediaSize.getMediaSizeForName(MediaSizeName)</code> * <code>MediaSize.getMediaSizeForName(MediaSizeName)</code>
* to find the physical dimensions of the MediaSizeName instances * to find the physical dimensions of the MediaSizeName instances
* enumerated in this API. This is useful for clients which need this * enumerated in this API. This is useful for clients which need this
* information to format & paginate printing. * information to format {@literal &} paginate printing.
* <P> * <P>
* *
* @author Phil Race, Alan Kaminsky * @author Phil Race, Alan Kaminsky
...@@ -71,8 +71,8 @@ public class MediaSize extends Size2DSyntax implements Attribute { ...@@ -71,8 +71,8 @@ public class MediaSize extends Size2DSyntax implements Attribute {
* <CODE>Size2DSyntax.MM</CODE>. * <CODE>Size2DSyntax.MM</CODE>.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE> * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
* < 0 or <CODE>units</CODE> < 1 or <CODE>x</CODE> > <CODE>y</CODE>. * {@code units < 1} or {@code x > y}.
*/ */
public MediaSize(float x, float y,int units) { public MediaSize(float x, float y,int units) {
super (x, y, units); super (x, y, units);
...@@ -92,8 +92,8 @@ public class MediaSize extends Size2DSyntax implements Attribute { ...@@ -92,8 +92,8 @@ public class MediaSize extends Size2DSyntax implements Attribute {
* <CODE>Size2DSyntax.MM</CODE>. * <CODE>Size2DSyntax.MM</CODE>.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE> * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
* < 0 or <CODE>units</CODE> < 1 or <CODE>x</CODE> > <CODE>y</CODE>. * {@code units < 1} or {@code x > y}.
*/ */
public MediaSize(int x, int y,int units) { public MediaSize(int x, int y,int units) {
super (x, y, units); super (x, y, units);
...@@ -115,8 +115,8 @@ public class MediaSize extends Size2DSyntax implements Attribute { ...@@ -115,8 +115,8 @@ public class MediaSize extends Size2DSyntax implements Attribute {
* @param media a media name to associate with this MediaSize * @param media a media name to associate with this MediaSize
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE> * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
* < 0 or <CODE>units</CODE> < 1 or <CODE>x</CODE> > <CODE>y</CODE>. * {@code units < 1} or {@code x > y}.
*/ */
public MediaSize(float x, float y,int units, MediaSizeName media) { public MediaSize(float x, float y,int units, MediaSizeName media) {
super (x, y, units); super (x, y, units);
...@@ -141,8 +141,8 @@ public class MediaSize extends Size2DSyntax implements Attribute { ...@@ -141,8 +141,8 @@ public class MediaSize extends Size2DSyntax implements Attribute {
* @param media a media name to associate with this MediaSize * @param media a media name to associate with this MediaSize
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (Unchecked exception) Thrown if <CODE>x</CODE> < 0 or <CODE>y</CODE> * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or
* < 0 or <CODE>units</CODE> < 1 or <CODE>x</CODE> > <CODE>y</CODE>. * {@code units < 1} or {@code x > y}.
*/ */
public MediaSize(int x, int y,int units, MediaSizeName media) { public MediaSize(int x, int y,int units, MediaSizeName media) {
super (x, y, units); super (x, y, units);
...@@ -194,7 +194,8 @@ public class MediaSize extends Size2DSyntax implements Attribute { ...@@ -194,7 +194,8 @@ public class MediaSize extends Size2DSyntax implements Attribute {
* Unit conversion factor, e.g. <CODE>Size2DSyntax.INCH</CODE> or * Unit conversion factor, e.g. <CODE>Size2DSyntax.INCH</CODE> or
* <CODE>Size2DSyntax.MM</CODE> * <CODE>Size2DSyntax.MM</CODE>
* @return MediaSizeName matching these dimensions, or null. * @return MediaSizeName matching these dimensions, or null.
* @exception IllegalArgumentException if x <= 0, y <= 0, or units < 1 * @exception IllegalArgumentException if {@code x <= 0},
* {@code y <= 0}, or {@code units < 1}.
* *
*/ */
public static MediaSizeName findMedia(float x, float y, int units) { public static MediaSizeName findMedia(float x, float y, int units) {
......
...@@ -56,56 +56,56 @@ public final class PresentationDirection extends EnumSyntax ...@@ -56,56 +56,56 @@ public final class PresentationDirection extends EnumSyntax
/** /**
* Pages are laid out in columns starting at the top left, * Pages are laid out in columns starting at the top left,
* proceeeding towards the bottom & right. * proceeeding towards the bottom {@literal &} right.
*/ */
public static final PresentationDirection TOBOTTOM_TORIGHT = public static final PresentationDirection TOBOTTOM_TORIGHT =
new PresentationDirection(0); new PresentationDirection(0);
/** /**
* Pages are laid out in columns starting at the top right, * Pages are laid out in columns starting at the top right,
* proceeeding towards the bottom & left. * proceeeding towards the bottom {@literal &} left.
*/ */
public static final PresentationDirection TOBOTTOM_TOLEFT = public static final PresentationDirection TOBOTTOM_TOLEFT =
new PresentationDirection(1); new PresentationDirection(1);
/** /**
* Pages are laid out in columns starting at the bottom left, * Pages are laid out in columns starting at the bottom left,
* proceeeding towards the top & right. * proceeeding towards the top {@literal &} right.
*/ */
public static final PresentationDirection TOTOP_TORIGHT = public static final PresentationDirection TOTOP_TORIGHT =
new PresentationDirection(2); new PresentationDirection(2);
/** /**
* Pages are laid out in columns starting at the bottom right, * Pages are laid out in columns starting at the bottom right,
* proceeeding towards the top & left. * proceeeding towards the top {@literal &} left.
*/ */
public static final PresentationDirection TOTOP_TOLEFT = public static final PresentationDirection TOTOP_TOLEFT =
new PresentationDirection(3); new PresentationDirection(3);
/** /**
* Pages are laid out in rows starting at the top left, * Pages are laid out in rows starting at the top left,
* proceeeding towards the right & bottom. * proceeeding towards the right {@literal &} bottom.
*/ */
public static final PresentationDirection TORIGHT_TOBOTTOM = public static final PresentationDirection TORIGHT_TOBOTTOM =
new PresentationDirection(4); new PresentationDirection(4);
/** /**
* Pages are laid out in rows starting at the bottom left, * Pages are laid out in rows starting at the bottom left,
* proceeeding towards the right & top. * proceeeding towards the right {@literal &} top.
*/ */
public static final PresentationDirection TORIGHT_TOTOP = public static final PresentationDirection TORIGHT_TOTOP =
new PresentationDirection(5); new PresentationDirection(5);
/** /**
* Pages are laid out in rows starting at the top right, * Pages are laid out in rows starting at the top right,
* proceeeding towards the left & bottom. * proceeeding towards the left {@literal &} bottom.
*/ */
public static final PresentationDirection TOLEFT_TOBOTTOM = public static final PresentationDirection TOLEFT_TOBOTTOM =
new PresentationDirection(6); new PresentationDirection(6);
/** /**
* Pages are laid out in rows starting at the bottom right, * Pages are laid out in rows starting at the bottom right,
* proceeeding towards the left & top. * proceeeding towards the left {@literal &} top.
*/ */
public static final PresentationDirection TOLEFT_TOTOP = public static final PresentationDirection TOLEFT_TOTOP =
new PresentationDirection(7); new PresentationDirection(7);
......
...@@ -40,7 +40,7 @@ import javax.print.attribute.PrintServiceAttribute; ...@@ -40,7 +40,7 @@ import javax.print.attribute.PrintServiceAttribute;
* details on color support). The information is intended to be germane to * details on color support). The information is intended to be germane to
* this kind of printer without regard to site specific modifications or * this kind of printer without regard to site specific modifications or
* services. * services.
* <P * <P>
* In contrast, the {@link PrinterMoreInfo PrinterMoreInfo} attribute is used * In contrast, the {@link PrinterMoreInfo PrinterMoreInfo} attribute is used
* to find out more information about this specific printer rather than this * to find out more information about this specific printer rather than this
* general kind of printer. * general kind of printer.
......
...@@ -84,11 +84,11 @@ public final class PrinterResolution extends ResolutionSyntax ...@@ -84,11 +84,11 @@ public final class PrinterResolution extends ResolutionSyntax
* Feed direction resolution. * Feed direction resolution.
* @param units * @param units
* Unit conversion factor, e.g. <code>ResolutionSyntax.DPI</CODE> * Unit conversion factor, e.g. <code>ResolutionSyntax.DPI</CODE>
* or <code>ResolutionSyntax.>DPCM</CODE>. * or <code>ResolutionSyntax.DPCM</CODE>.
* *
* @exception IllegalArgumentException * @exception IllegalArgumentException
* (unchecked exception) Thrown if <CODE>crossFeedResolution</CODE> < * (unchecked exception) Thrown if {@code crossFeedResolution < 1} or
* 1 or <CODE>feedResolution</CODE> < 1 or <CODE>units</CODE> < 1. * {@code feedResolution < 1} or {@code units < 1}.
*/ */
public PrinterResolution(int crossFeedResolution, int feedResolution, public PrinterResolution(int crossFeedResolution, int feedResolution,
int units) { int units) {
......
/* /*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -514,7 +514,7 @@ public class GlyphView extends View implements TabableView, Cloneable { ...@@ -514,7 +514,7 @@ public class GlyphView extends View implements TabableView, Cloneable {
int x1 = x0 + (int) painter.getSpan(this, p0, p1, getTabExpander(), x0); int x1 = x0 + (int) painter.getSpan(this, p0, p1, getTabExpander(), x0);
// calculate y coordinate // calculate y coordinate
int y = alloc.y + alloc.height - (int) painter.getDescent(this); int y = alloc.y + (int)(painter.getHeight(this) - painter.getDescent(this));
if (underline) { if (underline) {
int yTmp = y + 1; int yTmp = y + 1;
g.drawLine(x0, yTmp, x1, yTmp); g.drawLine(x0, yTmp, x1, yTmp);
......
...@@ -310,11 +310,13 @@ public final class AppContext { ...@@ -310,11 +310,13 @@ public final class AppContext {
// and excludes applets because by the time applet starts // and excludes applets because by the time applet starts
// a number of contexts have already been created by the plugin. // a number of contexts have already been created by the plugin.
if (numAppContexts.get() == 0) { if (numAppContexts.get() == 0) {
// This check is not necessary, its purpose is to help
// Plugin devs to catch all the cases of main AC creation.
if (System.getProperty("javaplugin.version") == null && if (System.getProperty("javaplugin.version") == null &&
System.getProperty("javawebstart.version") == null) { System.getProperty("javawebstart.version") == null) {
initMainAppContext(); initMainAppContext();
} else if (System.getProperty("javafx.version") != null &&
threadGroup.getParent() != null) {
// Swing inside JavaFX case
SunToolkit.createNewAppContext();
} }
} }
......
...@@ -334,6 +334,10 @@ public class UnixPrintJob implements CancelablePrintJob { ...@@ -334,6 +334,10 @@ public class UnixPrintJob implements CancelablePrintJob {
throw new PrintException("can't get print data: " + e.toString()); throw new PrintException("can't get print data: " + e.toString());
} }
if (data == null) {
throw new PrintException("Null print data.");
}
if (flavor == null || (!service.isDocFlavorSupported(flavor))) { if (flavor == null || (!service.isDocFlavorSupported(flavor))) {
notifyEvent(PrintJobEvent.JOB_FAILED); notifyEvent(PrintJobEvent.JOB_FAILED);
throw new PrintJobFlavorException("invalid flavor", flavor); throw new PrintJobFlavorException("invalid flavor", flavor);
......
...@@ -794,6 +794,7 @@ gboolean gtk2_load() ...@@ -794,6 +794,7 @@ gboolean gtk2_load()
} }
putenv (new_env); putenv (new_env);
free (new_env); free (new_env);
free (tmp_env);
} }
} }
......
...@@ -269,6 +269,13 @@ Java_sun_awt_X11GraphicsEnvironment_initXRender ...@@ -269,6 +269,13 @@ Java_sun_awt_X11GraphicsEnvironment_initXRender
static jboolean firstTime = JNI_TRUE; static jboolean firstTime = JNI_TRUE;
if (firstTime) { if (firstTime) {
#ifdef DISABLE_XRENDER_BY_DEFAULT
if (verbose == JNI_FALSE) {
xrenderAvailable = JNI_FALSE;
firstTime = JNI_FALSE;
return xrenderAvailable;
}
#endif
AWT_LOCK(); AWT_LOCK();
xrenderAvailable = IsXRenderAvailable(verbose); xrenderAvailable = IsXRenderAvailable(verbose);
AWT_UNLOCK(); AWT_UNLOCK();
......
...@@ -340,6 +340,10 @@ public class Win32PrintJob implements CancelablePrintJob { ...@@ -340,6 +340,10 @@ public class Win32PrintJob implements CancelablePrintJob {
throw new PrintException("can't get print data: " + e.toString()); throw new PrintException("can't get print data: " + e.toString());
} }
if (data == null) {
throw new PrintException("Null print data.");
}
if (flavor == null || (!service.isDocFlavorSupported(flavor))) { if (flavor == null || (!service.isDocFlavorSupported(flavor))) {
notifyEvent(PrintJobEvent.JOB_FAILED); notifyEvent(PrintJobEvent.JOB_FAILED);
throw new PrintJobFlavorException("invalid flavor", flavor); throw new PrintJobFlavorException("invalid flavor", flavor);
......
...@@ -3528,8 +3528,12 @@ UINT AwtComponent::WindowsKeyToJavaChar(UINT wkey, UINT modifiers, TransOps ops, ...@@ -3528,8 +3528,12 @@ UINT AwtComponent::WindowsKeyToJavaChar(UINT wkey, UINT modifiers, TransOps ops,
if (ops == SAVE) { if (ops == SAVE) {
transTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)), transTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)),
reinterpret_cast<void*>(static_cast<INT_PTR>(translation))); reinterpret_cast<void*>(static_cast<INT_PTR>(translation)));
deadKeyFlagTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)), if (deadKeyFlag) {
reinterpret_cast<void*>(static_cast<INT_PTR>(deadKeyFlag))); deadKeyFlagTable.put(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)),
reinterpret_cast<void*>(static_cast<INT_PTR>(deadKeyFlag)));
} else {
deadKeyFlagTable.remove(reinterpret_cast<void*>(static_cast<INT_PTR>(wkey)));
}
} }
isDeadKey = deadKeyFlag; isDeadKey = deadKeyFlag;
......
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8007267
* @summary [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
* @author leonid.romanov@oracle.com
* @run main DefaultMenuBarTest
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import sun.awt.*;
import java.lang.reflect.Method;
public class DefaultMenuBarTest {
static KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.META_MASK);
static volatile int listenerCallCounter = 0;
public static void main(String[] args) throws Exception {
if (sun.awt.OSInfo.getOSType() != sun.awt.OSInfo.OSType.MACOSX) {
System.out.println("This test is for MacOS only. Automatically passed on other platforms.");
return;
}
System.setProperty("apple.laf.useScreenMenuBar", "true");
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
createAndShowGUI();
}
});
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
Robot robot = new Robot();
robot.setAutoDelay(100);
robot.keyPress(KeyEvent.VK_META);
robot.keyPress(ks.getKeyCode());
robot.keyRelease(ks.getKeyCode());
robot.keyRelease(KeyEvent.VK_META);
toolkit.realSync();
if (listenerCallCounter != 1) {
throw new Exception("Test failed: ActionListener either wasn't called or was called more than once");
}
}
private static void createAndShowGUI() {
JMenu menu = new JMenu("File");
JMenuItem newItem = new JMenuItem("Open");
newItem.setAccelerator(ks);
newItem.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e) {
listenerCallCounter++;
}
}
);
menu.add(newItem);
JMenuBar defaultMenu = new JMenuBar();
defaultMenu.add(menu);
// Application.getApplication().setDefaultMenuBar(defaultMenu);
try {
Class appClass = Class.forName("com.apple.eawt.Application");
if (appClass != null) {
Method method = appClass.getMethod("getApplication");
if (method != null) {
Object app = method.invoke(null, new Object[]{});
if (app != null) {
method = appClass.getMethod("setDefaultMenuBar", new Class[]{JMenuBar.class});
if (method != null) {
method.invoke(app, new Object[]{defaultMenu});
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
/* /*
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -49,6 +49,8 @@ public class LoopRobustness { ...@@ -49,6 +49,8 @@ public class LoopRobustness {
public static volatile boolean otherExceptionsCaught = false; public static volatile boolean otherExceptionsCaught = false;
public static void main(String [] args) throws Exception { public static void main(String [] args) throws Exception {
SunToolkit.createNewAppContext();
ThreadGroup mainThreadGroup = Thread.currentThread().getThreadGroup(); ThreadGroup mainThreadGroup = Thread.currentThread().getThreadGroup();
long at; long at;
......
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.awt.Frame;
import java.awt.Robot;
import java.awt.TextField;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import sun.awt.SunToolkit;
/*
* @test
* @bug 8013849
* @summary Awt assert on Hashtable.cpp:124
* @author alexandr.scherbatiy area=awt.event
* @run main/timeout=5 DeadKeySystemAssertionDialog
*/
public class DeadKeySystemAssertionDialog {
public static void main(String[] args) throws Exception {
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
Frame frame = new Frame();
frame.setSize(300, 200);
TextField textField = new TextField();
frame.add(textField);
frame.setVisible(true);
toolkit.realSync();
textField.requestFocus();
toolkit.realSync();
// Check that the system assertion dialog does not block Java
Robot robot = new Robot();
robot.setAutoDelay(50);
robot.keyPress(KeyEvent.VK_A);
robot.keyRelease(KeyEvent.VK_A);
toolkit.realSync();
frame.setVisible(false);
frame.dispose();
}
}
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/* /*
* @test * @test
* @bug 4468109 * @bug 4468109 8021583
* @summary Test for printing AUTOSENSE DocFlavor. No exception should be thrown. * @summary Test for printing AUTOSENSE DocFlavor. No exception should be thrown.
* @run main PrintAutoSenseData * @run main PrintAutoSenseData
*/ */
......
This is a program for testing AutoSense data.
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import sun.awt.SunToolkit;
/*
* @test
* @bug 4361477
* @summary JTabbedPane throws ArrayOutOfBoundsException
* @author Oleg Mokhovikov
* @run main bug4361477
*/
public class bug4361477 {
static JTabbedPane tabbedPane;
volatile static boolean bStateChanged = false;
volatile static Rectangle bounds;
public static void main(String args[]) throws Exception {
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
Robot robot = new Robot();
robot.setAutoDelay(50);
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
createAndShowUI();
}
});
toolkit.realSync();
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
bounds = tabbedPane.getUI().getTabBounds(tabbedPane, 0);
}
});
Point location = bounds.getLocation();
SwingUtilities.convertPointToScreen(location, tabbedPane);
robot.mouseMove(location.x + 1, location.y + 1);
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
if (!bStateChanged) {
throw new RuntimeException("Tabbed pane state is not changed");
}
}
static void createAndShowUI() {
final JFrame frame = new JFrame();
tabbedPane = new JTabbedPane();
tabbedPane.add("Tab0", new JPanel());
tabbedPane.add("Tab1", new JPanel());
tabbedPane.add("Tab2", new JPanel());
tabbedPane.setSelectedIndex(2);
tabbedPane.addChangeListener(new ChangeListener() {
public void stateChanged(final ChangeEvent pick) {
bStateChanged = true;
if (tabbedPane.getTabCount() == 3) {
tabbedPane.remove(2);
}
}
});
frame.getContentPane().add(tabbedPane);
frame.setSize(300, 200);
frame.setVisible(true);
}
}
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import javax.swing.*;
import java.awt.*;
import sun.awt.SunToolkit;
/*
* @test
* @bug 6495408
* @summary REGRESSION: JTabbedPane throws ArrayIndexOutOfBoundsException
* @author Alexander Potochkin
* @run main bug6495408
*/
public class bug6495408 {
static JTabbedPane tabbedPane;
public static void main(String[] args) throws Exception {
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
final Robot robot = new Robot();
robot.setAutoDelay(50);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
tabbedPane = new JTabbedPane();
tabbedPane.setTabPlacement(JTabbedPane.LEFT);
tabbedPane.addTab("Hello", null);
frame.add(tabbedPane);
frame.setSize(400, 400);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
});
toolkit.realSync();
final Rectangle d = new Rectangle();
final Point p = new Point();
for (int i = 0; i < 7; i++) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
int tab = tabbedPane.getTabCount() - 1;
Rectangle bounds = tabbedPane.getBoundsAt(tab);
if (bounds != null) {
d.setBounds(bounds);
p.setLocation(d.x + d.width / 2, d.y + d.height / 2);
SwingUtilities.convertPointToScreen(p, tabbedPane);
robot.mouseMove(p.x, p.y + d.height);
tabbedPane.addTab("Hello", null);
}
}
});
}
}
}
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import sun.awt.SunToolkit;
/**
* @test
* @bug 7161568
* @author Alexander Scherbatiy
* @summary Tests that navigating tabs in the JTAbbedPane does not throw NPE
* @run main bug7161568
*/
public class bug7161568 {
private static final int N = 50;
private static JTabbedPane tabbedPane;
public static void main(String[] args) throws Exception {
UIManager.put("TabbedPane.selectionFollowsFocus", Boolean.FALSE);
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
Robot robot = new Robot();
robot.setAutoDelay(50);
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
createAndShowUI();
}
});
toolkit.realSync();
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
tabbedPane.requestFocus();
}
});
toolkit.realSync();
for (int i = 0; i < N; i++) {
robot.keyPress(KeyEvent.VK_LEFT);
robot.keyRelease(KeyEvent.VK_LEFT);
toolkit.realSync();
}
}
static void createAndShowUI() {
JFrame frame = new JFrame("Test");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(100, 100);
tabbedPane = new JTabbedPane();
for (int i = 0; i < N; i++) {
tabbedPane.addTab("Tab: " + i, new JLabel("Test"));
}
tabbedPane.setSelectedIndex(0);
frame.getContentPane().add(tabbedPane);
frame.setVisible(true);
}
}
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
@bug 8016833
@summary underlines and strikethroughs should be painted at the correct
positions for different kind of text styles: normal, superscript and subscript
@author Anton Nashatyrev
@run main bug8016833
*/
import javax.swing.*;
import javax.swing.text.BadLocationException;
import javax.swing.text.Style;
import javax.swing.text.StyleConstants;
import javax.swing.text.StyledDocument;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.lang.reflect.InvocationTargetException;
public class bug8016833 {
void drawText(final Graphics g, final boolean underline, final boolean strikethrough, final boolean background) {
drawText(g, "mama", underline, strikethrough, background);
}
void drawText(final Graphics g, final String text, final boolean underline, final boolean strikethrough, final boolean background) {
try {
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
final JTextPane comp = new JTextPane();
final StyledDocument doc = comp.getStyledDocument();
Style style = comp.addStyle("superscript", null);
setNormalStyle(style);
if (underline) {
StyleConstants.setUnderline(style, true);
}
if (strikethrough) {
StyleConstants.setStrikeThrough(style, true);
}
if (background) {
StyleConstants.setBackground(style, Color.BLUE);
}
try {
doc.insertString(doc.getLength(), "mama", style);
} catch (BadLocationException e) {
throw new RuntimeException(e);
}
comp.setSize(200, 100);
comp.paint(g);
}
});
} catch (InterruptedException e) {
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
}
}
void setNormalStyle(Style style) {
StyleConstants.setSuperscript(style, true);
}
int getEmptyPixel() {
return 0xFFFFFFFF;
}
boolean isPixelEmpty(int argb) {
return (argb & 0x00FFFFFF) == (getEmptyPixel() & 0x00FFFFFF);
}
boolean isLineEmpty(BufferedImage img, int coord, boolean isHorizontal) {
int len = isHorizontal ? img.getWidth() : img.getHeight();
for (int i = 0; i < len; i++) {
int pixel = isHorizontal ? img.getRGB(i, coord) : img.getRGB(coord, i);
if (!isPixelEmpty(pixel)) {
return false;
}
}
return true;
}
Rectangle getPixelsOutline(BufferedImage img) {
int x1 = 0;
while (x1 < img.getWidth() && isLineEmpty(img, x1, false)) {
x1++;
}
int x2 = img.getWidth() - 1;
while (x2 >= 0 && isLineEmpty(img, x2, false)) {
x2--;
}
int y1 = 0;
while (y1 < img.getHeight() && isLineEmpty(img, y1, true)) {
y1++;
}
int y2 = img.getHeight() - 1;
while (y2 >= 0 && isLineEmpty(img, y2, true)) {
y2--;
}
return new Rectangle(x1, y1, x2 - x1 + 1, y2 - y1 + 1);
}
BufferedImage createImage() {
final BufferedImage img = new BufferedImage(200, 100, BufferedImage.TYPE_INT_ARGB);
try {
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
Graphics g = img.getGraphics();
g.setColor(new Color(getEmptyPixel()));
g.fillRect(0, 0, 10000, 10000);
}
});
} catch (InterruptedException e) {
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
}
return img;
}
int subPixels(int pix1, int pix2) {
if (pix1 == pix2) {
return getEmptyPixel();
}
return pix1;
}
/**
* Subtracts img2 from img1
*/
BufferedImage subImages(BufferedImage img1, BufferedImage img2) {
if (img1.getHeight() != img2.getHeight() ||
img1.getWidth() != img2.getWidth()) {
throw new RuntimeException("Different sizes");
}
BufferedImage ret = new BufferedImage(img1.getWidth(), img1.getHeight(), img1.getType());
for (int x = 0; x < ret.getWidth(); x++) {
for (int y = 0; y < ret.getHeight(); y++) {
ret.setRGB(x, y, subPixels(img1.getRGB(x, y), img2.getRGB(x, y)));
}
}
return ret;
}
void testUnderline() {
System.out.println(" testUnderline()");
final BufferedImage img1 = createImage();
drawText(img1.getGraphics(), true, false, false);
final Rectangle out1 = getPixelsOutline(img1);
System.out.println(" Underlined: " + out1);
final BufferedImage img2 = createImage();
drawText(img2.getGraphics(), false, false, false);
final Rectangle out2 = getPixelsOutline(img2);
System.out.println(" Normal: " + out2);
final BufferedImage img3 = subImages(img1, img2);
final Rectangle out3 = getPixelsOutline(img3);
System.out.println(" Sub: " + out3);
// underline is not too thick
assertTrue(out3.getHeight() <= 2);
// not too wide
assertTrue(out3.getWidth() * 0.8 < out2.getWidth());
// not too low
assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 3);
// not too high
assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) > 0);
}
void testStrikthrough() {
System.out.println(" testStrikthrough()");
final BufferedImage img1 = createImage();
drawText(img1.getGraphics(), false, true, false);
final Rectangle out1 = getPixelsOutline(img1);
System.out.println(" Striked: " + out1);
final BufferedImage img2 = createImage();
drawText(img2.getGraphics(), false, false, false);
final Rectangle out2 = getPixelsOutline(img2);
System.out.println(" Normal: " + out2);
final BufferedImage img3 = subImages(img1, img2);
final Rectangle out3 = getPixelsOutline(img3);
System.out.println(" Sub: " + out3);
// strikethrough is not too thick
assertTrue(out3.getHeight() <= 2);
// not too wide
assertTrue(out3.getWidth() * 0.8 < out2.getWidth());
// not too low
assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 0);
// not too high
assertTrue(out3.getY() - out1.getY() > 1);
}
void assertTrue(boolean b) {
if (!b) {
throw new RuntimeException("Assertion failed");
}
}
static void testSuperScript() {
System.out.println("testSuperScript()");
bug8016833 b = new bug8016833() {
@Override
void setNormalStyle(Style style) {
StyleConstants.setSuperscript(style, true);
}
};
b.testUnderline();
b.testStrikthrough();
}
static void testSubScript() {
System.out.println("testSubScript()");
bug8016833 b = new bug8016833() {
@Override
void setNormalStyle(Style style) {
StyleConstants.setSubscript(style, true);
}
};
b.testUnderline();
b.testStrikthrough();
}
static void testNormalScript() {
System.out.println("testNormalScript()");
bug8016833 b = new bug8016833() {
@Override
void setNormalStyle(Style style) {
}
};
b.testUnderline();
b.testStrikthrough();
}
public static void main(String[] args) {
testSubScript();
testSuperScript();
testNormalScript();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册