Java Code Examples for java.awt.Point#clone()

The following examples show how to use java.awt.Point#clone() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TimeMenuPanel.java    From LGoodDatePicker with MIT License 5 votes vote down vote up
public void mouseDraggedFromToggleButton() {
    Point mousePositionRelativeToScreen = MouseInfo.getPointerInfo().getLocation();
    Rectangle timeListBounds = timeList.getBounds();
    timeListBounds.setLocation(timeList.getLocationOnScreen());
    if (timeListBounds.contains(mousePositionRelativeToScreen)) {
        SwingUtilities.convertPointFromScreen(mousePositionRelativeToScreen, timeList);
        Point mousePositionRelativeToComponent = (Point) mousePositionRelativeToScreen.clone();
        int index = timeList.locationToIndex(mousePositionRelativeToComponent);
        if ((index != -1) && (index != timeList.getSelectedIndex())) {
            timeList.setSelectedIndex(index);
        }
    }
}
 
Example 2
Source File: AbstractPatchedTransferHandler.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
private void showPopupAtMousePosition() {
	// StaticDebug.debug("DND POPUP: Show popup at Mouse position");
	// get mouse location
	Point screenLocation = MouseInfo.getPointerInfo().getLocation();
	screenLocation.x += 26;
	screenLocation.y += 10;

	// if tooltip is shown
	if (tipWindow != null) {
		// StaticDebug.debug("DND POPUP: Popup is already shown");

		// check if mouse has moved
		if (mouseX != screenLocation.x || mouseY != screenLocation.y) {
			// StaticDebug.debug("DND POPUP: old position x = "+mouseX);
			// StaticDebug.debug("DND POPUP: old position y = "+mouseY);
			// StaticDebug.debug("DND POPUP: new position x = "+screenLocation.x);
			// StaticDebug.debug("DND POPUP: new position y = "+screenLocation.y);
			// StaticDebug.debug("DND POPUP: Mouse position has changed.. hide popup first");
			// hide tooltip
			hideDropDeniedTooltip();
		} else {
			// StaticDebug.debug("DND POPUP: Restart hide timer to prevent popup from being hidden.");
			// otherwise restart hide timer
			hideTimer.restart();
			return;
		}
	}

	Point componentLocation = (Point) screenLocation.clone();
	SwingUtilities.convertPointFromScreen(componentLocation, popupSource);
	if (tipWindow == null && popupSource.contains(componentLocation)) {
		// StaticDebug.debug("DND POPUP: Mouse is inside popupSource and popup is not shown");
		JToolTip tip = popupSource.createToolTip();
		tip.setTipText(reason);
		PopupFactory popupFactory = PopupFactory.getSharedInstance();

		mouseX = screenLocation.x;
		mouseY = screenLocation.y;

		// StaticDebug.debug("DND POPUP: show popup at "+mouseX+","+mouseY+" and start hide timer");
		tipWindow = popupFactory.getPopup(popupSource, tip, mouseX, mouseY);
		tipWindow.show();
		hideTimer.restart();
	}
}
 
Example 3
Source File: Projects.java    From Logisim with GNU General Public License v3.0 4 votes vote down vote up
public static Point getLocation(Window win) {
	Point ret = frameLocations.get(win);
	return ret == null ? null : (Point) ret.clone();
}
 
Example 4
Source File: IIOParam.java    From jdk8u-dev-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 5
Source File: IIOParam.java    From jdk1.8-source-analysis with Apache License 2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 6
Source File: IIOParam.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 7
Source File: IIOParam.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 8
Source File: IIOParam.java    From openjdk-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 9
Source File: IIOParam.java    From openjdk-8-source with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 10
Source File: IIOParam.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 11
Source File: IIOParam.java    From Java8CN with Apache License 2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 12
Source File: IIOParam.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 13
Source File: IIOParam.java    From openjdk-jdk9 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination {@code BufferedImage} will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using {@code ImageWriter.replacePixels}.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no {@code unsetDestinationOffset} method;
 * simply call {@code setDestinationOffset(new Point(0, 0))} to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * {@code Point}.
 *
 * @exception IllegalArgumentException if
 * {@code destinationOffset} is {@code null}.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 14
Source File: IIOParam.java    From Bytecoder with Apache License 2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination {@code BufferedImage} will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using {@code ImageWriter.replacePixels}.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no {@code unsetDestinationOffset} method;
 * simply call {@code setDestinationOffset(new Point(0, 0))} to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * {@code Point}.
 *
 * @exception IllegalArgumentException if
 * {@code destinationOffset} is {@code null}.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 15
Source File: IIOParam.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 16
Source File: IIOParam.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 17
Source File: IIOParam.java    From JDKSourceCode1.8 with MIT License 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 18
Source File: IIOParam.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 19
Source File: IIOParam.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}
 
Example 20
Source File: IIOParam.java    From dragonwell8_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Specifies the offset in the destination image at which future
 * decoded pixels are to be placed, when reading, or where a
 * region will be written, when writing.
 *
 * <p> When reading, the region to be written within the
 * destination <code>BufferedImage</code> will start at this
 * offset and have a width and height determined by the source
 * region of interest, the subsampling parameters, and the
 * destination bounds.
 *
 * <p> Normal writes are not affected by this method, only writes
 * performed using <code>ImageWriter.replacePixels</code>.  For
 * such writes, the offset specified is within the output stream
 * image whose pixels are being modified.
 *
 * <p> There is no <code>unsetDestinationOffset</code> method;
 * simply call <code>setDestinationOffset(new Point(0, 0))</code> to
 * restore default values.
 *
 * @param destinationOffset the offset in the destination, as a
 * <code>Point</code>.
 *
 * @exception IllegalArgumentException if
 * <code>destinationOffset</code> is <code>null</code>.
 *
 * @see #getDestinationOffset
 * @see ImageWriter#replacePixels
 */
public void setDestinationOffset(Point destinationOffset) {
    if (destinationOffset == null) {
        throw new IllegalArgumentException("destinationOffset == null!");
    }
    this.destinationOffset = (Point)destinationOffset.clone();
}