|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
jview.AbstractDisplayable
jview.JWebcam
public class JWebcam
A webcam canvas is connected to a webcam somewhere accessible via internet. The background image of the canvas is fetched from this site at regular intervalls. It is possible to overplot some shapes onto the image.
| Nested Class Summary | |
|---|---|
private static class |
JWebcam.SimpleAuthenticator
A authenticator for plain usernames/passwords. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static String |
DEFDATECOLOR
Default date color. |
private static float |
DEFDATEHORJUST
Default horizontal justification (left). |
private static Point2D |
DEFDATEPOS
Default date position up left. |
private static float |
DEFDATEVERTJUST
Default horizontal justification (left). |
private static String |
DEFPROTOCOL
Default protocol is http. |
private static boolean |
DEFSHOWDATE
Default do not show date. |
private static long |
DEFUPDATE
Default update interval is 60 minutes. |
static String |
KEY_CLIPRAW
Clipping to be performaed on the raw image, immediately after fetch. |
static String |
KEY_DATECOLOR
color of displayed date. |
static String |
KEY_DATEFONT
Font of displayed date. |
static String |
KEY_DATEFORMAT
If given, the date format. |
static String |
KEY_DATEHORJUST
Horizontal justification of date. |
static String |
KEY_DATEPOS
Position of date text. |
static String |
KEY_DATEVERTJUST
Vertical justification of date. |
static String |
KEY_HOST
The host name of the server providing the baycam images. |
static String |
KEY_PASSPHRASE
If this field is present we have a user name and password. |
static String |
KEY_PATH
The path name of the server providing the baycam images directory. |
static String |
KEY_PROTOCOL
The protocol of the server providing the baycam images. |
static String |
KEY_SHOWDATE
If true, we also show the date. |
static String |
KEY_TIMEMETHOD
The method in the URL connection that tells us a date. |
static String |
KEY_UPDATE
The update interval for webcam images in server push. |
private long |
lastmodified
The last URL-modification time we retrieved from. |
private Authenticator |
password
If the login requires a password. |
| Fields inherited from class jview.AbstractDisplayable |
|---|
KEY_COMPONENTNAME, KEY_ICON, KEY_INSETS |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
JWebcam(Map prop)
Constructs a new webcam canvas. |
|
| Method Summary | |
|---|---|
boolean |
canDeliver()
We can deliver if the modification time on the server is below the modification time of our latest retrieval. |
protected PasswordAuthentication |
getAuthentication()
Returns the password authentication or null. |
protected URL |
getDownloadUrl(Date ignored)
Returns the url we can download the image from. |
long |
getRefreshInterval()
We return our minimum interval. |
Component |
getRepresentation()
We return the webcam image in a viewport canvas to allow zooming. |
Component |
getRepresentationAt(Date now)
We get the representation at the desired date. |
protected BufferedImage |
getWebcamImage(URL download)
Returns the webcam image from the stated url. |
void |
init()
Loads URL-resources, if there are any. |
| Methods inherited from class jview.AbstractDisplayable |
|---|
getComponentName, getIcon, getIcon |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jview.Displayable |
|---|
getIcon |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Field Detail |
|---|
public static final String KEY_PROTOCOL
public static final String KEY_HOST
public static final String KEY_PATH
public static final String KEY_UPDATE
public static final String KEY_TIMEMETHOD
public static final String KEY_PASSPHRASE
public static final String KEY_SHOWDATE
public static final String KEY_DATEFORMAT
public static final String KEY_DATEPOS
public static final String KEY_DATEHORJUST
public static final String KEY_DATEVERTJUST
public static final String KEY_DATECOLOR
public static final String KEY_DATEFONT
public static final String KEY_CLIPRAW
private static final String DEFPROTOCOL
private static final long DEFUPDATE
private static final boolean DEFSHOWDATE
private static final Point2D DEFDATEPOS
private static final float DEFDATEHORJUST
private static final float DEFDATEVERTJUST
private static final String DEFDATECOLOR
private long lastmodified
private Authenticator password
| Constructor Detail |
|---|
public JWebcam(Map prop)
| Method Detail |
|---|
public void init()
PropertyResources
init in interface Initializableinit in class PropertyResourcespublic long getRefreshInterval()
getRefreshInterval in interface DisplayChronologypublic boolean canDeliver()
canDeliver in interface DisplayChronologypublic Component getRepresentation()
getRepresentation in interface Displayablepublic Component getRepresentationAt(Date now)
protected BufferedImage getWebcamImage(URL download)
throws IOException
IOExceptionprotected URL getDownloadUrl(Date ignored)
protected PasswordAuthentication getAuthentication()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||