com.smartwerkz.jupload.classic.screenshot
Class ScreenCamera

java.lang.Object
  extended by com.smartwerkz.jupload.classic.screenshot.ScreenCamera

public abstract class ScreenCamera
extends java.lang.Object

Has to be implemented and an instace has to be delivered to take a delayed screenshot with the ScreenCapturer

Since:
Jan 18, 2006, 12:30:19 AM
Author:
Dominik Seifert

Field Summary
protected  java.util.TimerTask currentTask
           
static java.awt.Dimension screenDimension
           
 
Constructor Summary
ScreenCamera()
           
 
Method Summary
 void cancel()
           
 void capture(java.awt.GraphicsDevice device, int delayInSeconds)
          Captures a screenshot with the given device, delayed by the given amount of seconds or instantly if the amount of seconds is less than 1.
static java.awt.image.BufferedImage capture(java.awt.GraphicsDevice device, java.awt.Rectangle where)
          Captures and returns a screenshot taken from the given device.
static java.awt.image.BufferedImage capture(java.awt.Rectangle where)
          Captures and returns a screenshot taken from the default device.
abstract  void captureCancelled()
           
abstract  void captured(java.awt.image.BufferedImage img, int delay, int captureTime)
          Is called when a capture has successfully been taken after the given delay.
abstract  void captureFailed(int delay, java.lang.Exception e)
          Is called when the capturing failed because of the given Exception after the given delay.
abstract  void captureStarting(int delay)
          Is called when a delayed capture should be taken.
 boolean capturing()
           
static java.awt.GraphicsDevice[] getDevices()
          Returns all available devices for screen captures.
 long getElapsedTime()
           
 long getStartTime()
           
abstract  java.awt.Rectangle getTarget()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

screenDimension

public static final java.awt.Dimension screenDimension

currentTask

protected java.util.TimerTask currentTask
Constructor Detail

ScreenCamera

public ScreenCamera()
Method Detail

getDevices

public static java.awt.GraphicsDevice[] getDevices()
Returns all available devices for screen captures. Each one might represent a different monitor. The user should have the chance to choose which one to use.


capture

public static java.awt.image.BufferedImage capture(java.awt.Rectangle where)
                                            throws java.lang.Exception
Captures and returns a screenshot taken from the default device.

Throws:
java.lang.Exception

capture

public static java.awt.image.BufferedImage capture(java.awt.GraphicsDevice device,
                                                   java.awt.Rectangle where)
                                            throws java.lang.Exception
Captures and returns a screenshot taken from the given device.

Parameters:
device - The device to be used
Throws:
java.lang.Exception
See Also:
getDevices()

capture

public void capture(java.awt.GraphicsDevice device,
                    int delayInSeconds)
Captures a screenshot with the given device, delayed by the given amount of seconds or instantly if the amount of seconds is less than 1. Beeps every second. Cancels the current capture if the camera is still capturing and sets the currentTask within the camera.


capturing

public boolean capturing()

cancel

public void cancel()

getStartTime

public long getStartTime()

getElapsedTime

public long getElapsedTime()

getTarget

public abstract java.awt.Rectangle getTarget()
Returns:
The target that is to be captured. null if the whole screen should be taken.

captureStarting

public abstract void captureStarting(int delay)
Is called when a delayed capture should be taken.


captured

public abstract void captured(java.awt.image.BufferedImage img,
                              int delay,
                              int captureTime)
Is called when a capture has successfully been taken after the given delay.

Parameters:
captureTime - The amount of milliseconds that the capturing took.

captureFailed

public abstract void captureFailed(int delay,
                                   java.lang.Exception e)
Is called when the capturing failed because of the given Exception after the given delay.


captureCancelled

public abstract void captureCancelled()


Copyright © 2007 smartwerkz.com. All Rights Reserved.