public class SimpleClipGraphics
extends java.lang.Object
It provides a variety of format. In some of those, the data is formated as RTF, which can be pasted into most word processors.
You can select the vector format embedded in the picture. The default value
is PictureFormat.MACPICT which works more or less everywhere.
For better quality, you might choose PictureFormat.EMF. However, it
doesn't render correctly in Word on Mac OS X. It renders well in all versions
of Openoffice, though.
Note that in some cases you will need something a bit more sophisticated, especially if you want to propose more than one format.
| Constructor and Description |
|---|
SimpleClipGraphics(int width,
int height)
Prepare a vector graphic.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copyToClipboard()
performs a copy to the clipboard.
|
void |
copyToClipboard(java.awt.datatransfer.ClipboardOwner owner)
performs a copy to the clipboard.
|
java.awt.Graphics2D |
getGraphics()
Gets the graphics 2D environment where you must write.
|
int |
getPictureFormat()
Returns the vector format used for the picture (EMF, WMF...)
|
void |
setPictureFormat(int pictureFormat)
Sets the picture format used for the picture (EMF, WMF...)
|
public SimpleClipGraphics(int width,
int height)
width - height - public java.awt.Graphics2D getGraphics()
public int getPictureFormat()
PictureFormatpublic void setPictureFormat(int pictureFormat)
pictureFormat - public void copyToClipboard(java.awt.datatransfer.ClipboardOwner owner)
owner - the clipboard owner. Can be null.public void copyToClipboard()