stella.jview
Class JBaycamMosaic

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by jview.JMosaic
                      extended by stella.jview.JBaycamMosaic
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ConditionalRefreshing, Initializable, PropertyAware, PropertyComposed, Refreshing

public class JBaycamMosaic
extends JMosaic
implements ConditionalRefreshing

A baycam mosaic consists of images taken by the STELLA baycam. Each tile takes it images from KEY_BAYCAMHOST, matches them with KEY_BAYCAMNAMES and updates them regularily using the time base in KEY_BAYCAMUPDATE. The number of file names in KEY_BAYCAMNAMES defines the number of rows. The size of the individual tiles can be set with JMosaic.KEY_TILESIZE from the base class. Specifying a height of -1 there keeps the aspect ratio of the webcam images.

See Also:
Serialized Form

Nested Class Summary
protected  class JBaycamMosaic.StellaFilter
          A file fliter that takes the name of the file and tries to match it with the constructed head.
static class JBaycamMosaic.Test
          Test class.
 
Nested classes/interfaces inherited from class jview.JMosaic
JMosaic.Stella
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private static SimpleDateFormat DATEFORMAT
           
private static String DEFBAYCAMHOST
          The default baycam host.
private static String DEFBAYCAMNAMES
          The default baycam names for STELLA-I.
private static String DEFBAYCAMPATH
          The default baycam path.
private static String DEFBAYCAMPROTOCOL
          The default baycam protocol.
private static long DEFBAYCAMUPDATE
          The default update frequency in ms.
private static int DEFTILESHRINK
          Per default, we shrink by a factor of two.
static String KEY_BAYCAMHOST
          The host name of the server providing the baycam images.
static String KEY_BAYCAMNAMES
          The names parts of the baycam images used for display.
static String KEY_BAYCAMPATH
          The path name of the server providing the baycam images directory.
static String KEY_BAYCAMPROTOCOL
          The protocol of the server providing the baycam images.
static String KEY_BAYCAMUPDATE
          The update interval for baycam images.
private  List latest
          A list of latest-url instances to check for new images.
 
Fields inherited from class jview.JMosaic
KEY_BORDERCOLOR, KEY_BORDERSIZE, KEY_COLUMNSMOSAIC, KEY_ROWSMOSAIC, KEY_TILESHRINK, KEY_TILESIZE
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JBaycamMosaic(PropertyBearing info)
          Constructs a new baycam mosaic.
 
Method Summary
 long getRefreshInterval()
          Returns the scheduling period.
 void init()
          Initializes the baycam mosaic.
 boolean isFixedRate()
          Returns false.
 boolean isRefreshNeeded()
          Returns true if the mosaic is visible.
 void refresh()
          The method that does the update.
 void setComposedProperties(PropertyBearing prop)
          Sets the composed properties of the baycam image.
 
Methods inherited from class jview.JMosaic
getComposedProperties, setImages
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_BAYCAMPROTOCOL

public static final String KEY_BAYCAMPROTOCOL
The protocol of the server providing the baycam images.

See Also:
Constant Field Values

KEY_BAYCAMHOST

public static final String KEY_BAYCAMHOST
The host name of the server providing the baycam images.

See Also:
Constant Field Values

KEY_BAYCAMPATH

public static final String KEY_BAYCAMPATH
The path name of the server providing the baycam images directory.

See Also:
Constant Field Values

KEY_BAYCAMNAMES

public static final String KEY_BAYCAMNAMES
The names parts of the baycam images used for display.

See Also:
Constant Field Values

KEY_BAYCAMUPDATE

public static final String KEY_BAYCAMUPDATE
The update interval for baycam images.

See Also:
Constant Field Values

DEFBAYCAMPROTOCOL

private static final String DEFBAYCAMPROTOCOL
The default baycam protocol.

See Also:
Constant Field Values

DEFBAYCAMHOST

private static final String DEFBAYCAMHOST
The default baycam host.

See Also:
Constant Field Values

DEFBAYCAMPATH

private static final String DEFBAYCAMPATH
The default baycam path.

See Also:
Constant Field Values

DEFBAYCAMNAMES

private static final String DEFBAYCAMNAMES
The default baycam names for STELLA-I.

See Also:
Constant Field Values

DEFBAYCAMUPDATE

private static final long DEFBAYCAMUPDATE
The default update frequency in ms.

See Also:
Constant Field Values

DEFTILESHRINK

private static final int DEFTILESHRINK
Per default, we shrink by a factor of two.

See Also:
Constant Field Values

DATEFORMAT

private static final SimpleDateFormat DATEFORMAT

latest

private List latest
A list of latest-url instances to check for new images.

Constructor Detail

JBaycamMosaic

public JBaycamMosaic(PropertyBearing info)
Constructs a new baycam mosaic. Note that the composed properties are set before the component is initialized.

Method Detail

setComposedProperties

public void setComposedProperties(PropertyBearing prop)
Sets the composed properties of the baycam image. Defaults all neccessary parameters.

Specified by:
setComposedProperties in interface PropertyAware
Overrides:
setComposedProperties in class JMosaic

init

public void init()
Initializes the baycam mosaic. Takes the image names number and sets it equal to the row number. The image urls are retrieved from the server and the update thread is started.

Specified by:
init in interface Initializable
Overrides:
init in class JMosaic

refresh

public void refresh()
The method that does the update.

Specified by:
refresh in interface Refreshing

getRefreshInterval

public long getRefreshInterval()
Returns the scheduling period.

Specified by:
getRefreshInterval in interface Refreshing

isFixedRate

public boolean isFixedRate()
Returns false.

Specified by:
isFixedRate in interface Refreshing
See Also:
Timer

isRefreshNeeded

public boolean isRefreshNeeded()
Returns true if the mosaic is visible.

Specified by:
isRefreshNeeded in interface ConditionalRefreshing