stella.jview
Class JGuiderPanel

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by jview.AbstractDisplayable
                  extended by stella.jview.JGuiderPanel
All Implemented Interfaces:
ActionListener, Cloneable, EventListener, ChangeListener, Displayable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class JGuiderPanel
extends AbstractDisplayable
implements ActionListener, ChangeListener

A guider panel adds the following functionality to the JGuiderCanvas. The individula functionas are available via button (or a scroll-bar) in the bottom part of the panel. The entire panel is layed-out with a BorderLayout, the canvas as the central component and the buttons in the South component.


Nested Class Summary
static class JGuiderPanel.Show
          Test class to show the layout etc.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  boolean cancel
          True, if the movie should be canceled.
private  int current
          Index of guider image from jar archive currently displayed.
private static Rectangle DEFFITSDIMENSION
          Defines my drawing sets.
private static String DEFFITSHEADER
          Defines my drawing sets.
private static String DEFFITSTAIL
          Defines my drawing sets.
private static int DEFICONSIZE
          Defines my drawing sets.
private static boolean DEFUSEINFO
          Defines my drawing sets.
private  JGuiderCanvas display
          The guider canvas.
private  int firstindex
          Lowest index of guider images found in jar archive.
private  JLabel indexlabel
          The image slider.
private  URLClassLoader jar
          After invoking applyUnique(java.lang.String), fits are loaded from a this jar.
static String JAREXTENSION
          Extension to the jar file containing guider info.
static String JARHEADER
          The aspect ratio, the fits x-size/y-size.
static String KEY_FITSDIMENSION
          The aspect ratio, the fits x-size/y-size.
static String KEY_FITSHEADER
          The aspect ratio, the fits x-size/y-size.
static String KEY_FITSTAIL
          The aspect ratio, the fits x-size/y-size.
static String KEY_ICONSIZE
          The aspect ratio, the fits x-size/y-size.
static String KEY_USEINFO
          The aspect ratio, the fits x-size/y-size.
private  int lastindex
          Highest index of guider images found in jar archive.
private  Thread movie
          The thread to play a movie.
private  JPanel panel
          The panel we deliver.
private  JSlider slider
          The image slider.
private  String unique
          Current unique name set.
 
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
JGuiderPanel(Map prop)
          Constructs a new guider panel.
 
Method Summary
 void actionPerformed(ActionEvent ae)
          Catches the actions from the diverse buttons.
private  void applyFitsAndInfo(URL fits, URL info)
          This method uses the provided resources to set a fits file in the guider canvas display and to add GuiderInfo related data to the display.
 void applyJar(URL uniquejar, String special)
          Directly loads the jar file from the given url.
 void applyUnique(String special)
          Assings the given unique number to the panel.
 Component getRepresentation()
          Returns a panel consiting of the guider canvas plus a panel of buttons with a slider on the bottom.
 void init()
          Initializes the panel, the JGuiderCanvas is instantiated with my properties here.
private  void showCanvas(int index)
          Shows the canvas of the given index.
 void stateChanged(ChangeEvent ce)
          Catches the slider actions.
 
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 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

JAREXTENSION

public static final String JAREXTENSION
Extension to the jar file containing guider info.

See Also:
Constant Field Values

JARHEADER

public static final String JARHEADER
The aspect ratio, the fits x-size/y-size.

See Also:
Constant Field Values

KEY_FITSHEADER

public static final String KEY_FITSHEADER
The aspect ratio, the fits x-size/y-size.

See Also:
Constant Field Values

KEY_FITSTAIL

public static final String KEY_FITSTAIL
The aspect ratio, the fits x-size/y-size.

See Also:
Constant Field Values

KEY_FITSDIMENSION

public static final String KEY_FITSDIMENSION
The aspect ratio, the fits x-size/y-size.

See Also:
Constant Field Values

KEY_USEINFO

public static final String KEY_USEINFO
The aspect ratio, the fits x-size/y-size.

See Also:
Constant Field Values

KEY_ICONSIZE

public static final String KEY_ICONSIZE
The aspect ratio, the fits x-size/y-size.

See Also:
Constant Field Values

DEFFITSHEADER

private static final String DEFFITSHEADER
Defines my drawing sets.

See Also:
Constant Field Values

DEFFITSTAIL

private static final String DEFFITSTAIL
Defines my drawing sets.

See Also:
Constant Field Values

DEFUSEINFO

private static final boolean DEFUSEINFO
Defines my drawing sets.

See Also:
Constant Field Values

DEFICONSIZE

private static final int DEFICONSIZE
Defines my drawing sets.

See Also:
Constant Field Values

DEFFITSDIMENSION

private static final Rectangle DEFFITSDIMENSION
Defines my drawing sets.


panel

private JPanel panel
The panel we deliver.


display

private JGuiderCanvas display
The guider canvas.


slider

private JSlider slider
The image slider.


indexlabel

private JLabel indexlabel
The image slider.


jar

private URLClassLoader jar
After invoking applyUnique(java.lang.String), fits are loaded from a this jar.


firstindex

private int firstindex
Lowest index of guider images found in jar archive.


lastindex

private int lastindex
Highest index of guider images found in jar archive.


unique

private String unique
Current unique name set.


current

private int current
Index of guider image from jar archive currently displayed.


movie

private Thread movie
The thread to play a movie.


cancel

private boolean cancel
True, if the movie should be canceled.

Constructor Detail

JGuiderPanel

public JGuiderPanel(Map prop)
Constructs a new guider panel. Its properties are used for constructing the guider canvas in the init section.

Method Detail

init

public void init()
Initializes the panel, the JGuiderCanvas is instantiated with my properties here.

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

getRepresentation

public Component getRepresentation()
Returns a panel consiting of the guider canvas plus a panel of buttons with a slider on the bottom.

Specified by:
getRepresentation in interface Displayable

applyUnique

public void applyUnique(String special)
Assings the given unique number to the panel. We search a jar file containing the acquire/guiding frames plus the status info, derived from this unique name. The display is set such that it shows the first guide/acquire frame, and the sliders ticks are updated to show the number of available frames.


applyJar

public void applyJar(URL uniquejar,
                     String special)
Directly loads the jar file from the given url. Can be used for file browsing.


actionPerformed

public void actionPerformed(ActionEvent ae)
Catches the actions from the diverse buttons. The display is updated according to the settings in the properties.

Specified by:
actionPerformed in interface ActionListener

stateChanged

public void stateChanged(ChangeEvent ce)
Catches the slider actions.

Specified by:
stateChanged in interface ChangeListener

showCanvas

private void showCanvas(int index)
Shows the canvas of the given index. The index handed over is recorded in the current index. The knob on the slider is set to reflect the change.


applyFitsAndInfo

private void applyFitsAndInfo(URL fits,
                              URL info)
This method uses the provided resources to set a fits file in the guider canvas display and to add GuiderInfo related data to the display.