|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.tools.SnapshotTool
public class SnapshotTool
This provides a simple way to capture screen images.
Method Summary | |
---|---|
void |
copyImage(java.awt.Component component)
Copies an image of a component to the clipboard |
void |
copyImage(java.awt.Image image)
Copies the specified image to the system clipboard. |
java.awt.Image |
getClipboardImage()
Returns the image on the clipboard, if any. |
static java.lang.String |
getString(java.lang.String key)
|
static SnapshotTool |
getTool()
Gets the shared SnapshotTool. |
static boolean |
isImageFormatSupported(java.lang.String format)
|
void |
printImage(java.awt.Component component)
Prints an image of a component |
boolean |
saveImage(java.lang.String filename,
java.awt.Component component)
Saves the image produced by a component |
boolean |
saveImage(java.lang.String filename,
java.awt.Component component,
java.io.OutputStream output)
Saves the image produced by a component to an output stream |
boolean |
saveImage(java.lang.String filename,
java.awt.Component component,
java.io.OutputStream output,
double scale)
Saves the (possibly scaled) image produced by a component to an output stream |
void |
send(Job job,
Tool replyTo)
Sends a job to this tool and specifies a tool to reply to. |
static void |
setLocale(java.util.Locale locale)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void setLocale(java.util.Locale locale)
public static java.lang.String getString(java.lang.String key)
public static SnapshotTool getTool()
public void send(Job job, Tool replyTo) throws java.rmi.RemoteException
send
in interface Tool
job
- the JobreplyTo
- the tool to notify when the job is complete (may be null)
java.rmi.RemoteException
public boolean saveImage(java.lang.String filename, java.awt.Component component)
filename
- the name of a filecomponent
- the component to get the image from
public boolean saveImage(java.lang.String filename, java.awt.Component component, java.io.OutputStream output)
filename
- the name of a file (the extension indicates the format). If null, teh user will be prompted for a namecomponent
- the component to get the image fromoutput
- An optional output stream to save to. If null the image is saved to a file
public boolean saveImage(java.lang.String filename, java.awt.Component component, java.io.OutputStream output, double scale)
filename
- the name of a file (the extension indicates the format). If null, the user will be prompted for a namecomponent
- the component to get the image fromoutput
- An optional output stream to save to. If null the image is saved to a filescale
- A scale factor that resizes the image. A value of 1 uses the actual size.
public static boolean isImageFormatSupported(java.lang.String format)
public void copyImage(java.awt.Image image)
image
- the image to copypublic java.awt.Image getClipboardImage()
public void copyImage(java.awt.Component component)
component
- the component to copypublic void printImage(java.awt.Component component)
component
- the component to print
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |