|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
jview.AbstractDisplayable
stella.jview.JRoofView
public class JRoofView
A graphical display of the current state of the roof. Five different positions of the roof are recognized, depending on the status of the limit switches and the X-switches. Additionally to these switches, the state of the roof locking mechanism can be queried. A typical roof view looks like

RoofInfo and further to the roof view class to obtain an
accurate view of the current roof state.
Note that the roof-view class does not care
about the format of the status message, it must be converted in an
other application to the appropriate input format, see RoofInfo.
| Nested Class Summary | |
|---|---|
protected class |
JRoofView.JRoofCanvas
A class that displays the STELLA building and the roofs according to the images, blinking instances and offsets assigned to it. |
static class |
JRoofView.Link
Matches the roof view with an remote error caster, which should be the environment master on Tenerife. |
static class |
JRoofView.Show
Test purpose mainly. |
static class |
JRoofView.Test
Test purpose mainly. |
| Nested classes/interfaces inherited from class util.PropertyContainer |
|---|
PropertyContainer.URLResource |
| Field Summary | |
|---|---|
private static int |
DEFBLINK
The key to blinking intervall for normal blinks. |
private static int |
DEFCENTRALOFFSET
The key to the x-offset for position central. |
private static String |
DEFCOMPONENTNAME
The default name of the component. |
private static int |
DEFFASTBLINK
The key to blinking intervall for fast blinks. |
private static String |
DEFFASTIMAGE
The key to the image path of fast indicator. |
private static String |
DEFGREEN
The key to image-path part for 0 (green) images. |
private static int |
DEFHALFOPENOFFSET
The key to the x-offset for position half-open. |
private static int |
DEFHALFSHUTOFFSET
The key to the x-offset for position half-shut. |
private static String |
DEFLAYOUT
The key to the background image path. |
private static String |
DEFLIMITLEFT
The key to the left-widged-view limit-switch-image path. |
private static String |
DEFLIMITRIGHT
The key to the right-widged-view limit-switch-image path. |
private static String |
DEFLOCKDOWN
The key to the image path of lock-down. |
private static Point |
DEFLOCKOFFSET
The key to the x, y-offset for lock position, relative to roof. |
private static String |
DEFLOCKSTALLED
The key to the image path of stalled locks. |
private static String |
DEFLOCKUP
The key to the image path of lock-down. |
private static Point |
DEFOPENLIMITOFFSET
The key to the x, y-offset for position open limit. |
private static int |
DEFOPENOFFSET
The key to the x-offset for position open. |
private static String |
DEFRED
The key to image-path part for 1 (red) images. |
private static String |
DEFROOFSIDE
The key to the side-view roof-image path. |
private static String |
DEFROOFTOP
The key to the top-view roof-image path. |
private static Point |
DEFSHUTLIMITOFFSET
The key to the x, y-offset for position shut limit. |
private static int |
DEFSHUTOFFSET
The key to the x-offset for position shut. |
private static Point |
DEFSIDELEFTORIGIN
The key to the (x,y) origin for left-handed roofs, side view. |
private static Point |
DEFSIDERIGHTORIGIN
The key to the (x,y) origin for left-handed roofs, side view. |
private static Dimension |
DEFSIZE
The key to the size. |
private static String |
DEFSLOWIMAGE
The key to the image path of slow indicator. |
private static Point |
DEFSPEEDLEFT
The key to the position of the speedometer, left roofs. |
private static Point |
DEFSPEEDRIGHT
The default position of the speedometer, right roof. |
private static Point |
DEFTOPLEFTORIGIN
The key to the (x,y) origin for left-handed roofs, top view. |
private static Point |
DEFTOPRIGHTORIGIN
The key to the (x,y) origin for right-handed roofs, top view. |
private static String |
DEFURLRESOURCES
The default image directory. |
private static Point |
DEFXOFFSET
The key to the x, y-offset for position X-switch, relative to roof. |
private static String |
DEFXSWITCHDOWN
The key to the image path of the down-pointing X-switch. |
private static String |
DEFXSWITCHLEFT
The key to the image path of the left-pointing X-switch. |
private static String |
DEFXSWITCHRIGHT
The key to the image path of the right-pointing X-switch. |
private static Image |
fastpic
The image of the fast speedometer. |
static String |
KEY_BLINK
The key to blinking intervall for normal blinks. |
static String |
KEY_CENTRALOFFSET
The key to the x-offset for position central. |
static String |
KEY_FASTBLINK
The key to blinking intervall for fast blinks. |
static String |
KEY_FASTIMAGE
The key to the image path of fast indicator. |
static String |
KEY_GREEN
The key to image-path part for 0 (green) images. |
static String |
KEY_HALFOPENOFFSET
The key to the x-offset for position half-open. |
static String |
KEY_HALFSHUTOFFSET
The key to the x-offset for position half-shut. |
static String |
KEY_LAYOUT
The key to the background image path. |
static String |
KEY_LIMITLEFT
The key to the left-widged-view limit-switch-image path. |
static String |
KEY_LIMITRIGHT
The key to the right-widged-view limit-switch-image path. |
static String |
KEY_LOCKDOWN
The key to the image path of lock-down. |
static String |
KEY_LOCKOFFSET
The key to the x, y-offset for lock position, relative to roof. |
static String |
KEY_LOCKSTALLED
The key to the image path of stalled locks. |
static String |
KEY_LOCKUP
The key to the image path of lock-down. |
static String |
KEY_OPENLIMITOFFSET
The key to the x, y-offset for position open limit. |
static String |
KEY_OPENOFFSET
The key to the x-offset for position open. |
static String |
KEY_RED
The key to image-path part for 1 (red) images. |
static String |
KEY_ROOFSIDE
The key to the side-view roof-image path. |
static String |
KEY_ROOFTOP
The key to the top-view roof-image path. |
static String |
KEY_SHUTLIMITOFFSET
The key to the x, y-offset for position shut limit. |
static String |
KEY_SHUTOFFSET
The key to the x-offset for position shut. |
static String |
KEY_SIDELEFTORIGIN
The key to the (x,y) origin for left-handed roofs, side view. |
static String |
KEY_SIDERIGHTORIGIN
The key to the (x,y) origin for left-handed roofs, side view. |
static String |
KEY_SIZE
The key to the background image path. |
static String |
KEY_SLOWIMAGE
The key to the image path of slow indicator. |
static String |
KEY_SPEEDLEFT
The key to the speedometer, left roof. |
static String |
KEY_SPEEDRIGHT
The key to the speedometer, right roof. |
static String |
KEY_TOPLEFTORIGIN
The key to the (x,y) origin for left-handed roofs, top view. |
static String |
KEY_TOPRIGHTORIGIN
The key to the (x,y) origin for right-handed roofs, top view. |
static String |
KEY_XOFFSET
The key to the x, y-offset for position X-switch, relative to roof. |
static String |
KEY_XSWITCHDOWN
The key to the image path of the down-pointing X-switch. |
static String |
KEY_XSWITCHLEFT
The key to the image path of the left-pointing X-switch. |
static String |
KEY_XSWITCHRIGHT
The key to the image path of the right-pointing X-switch. |
private static Image[] |
limitleftpic
The image of the limit switch, wedged part left. |
private static Image[] |
limitrightpic
The image of the limit switch, wedged part right. |
private static Image[] |
lockdownpic
The image of the lock, deployed. |
private static Image[] |
lockstallpic
The image of the lock if stalled. |
private static Image[] |
lockuppic
The image of the lock, receded. |
protected JRoofView.JRoofCanvas |
roof
The JPanel to display. |
private static Image[] |
roofsidepic
The image of the roof, side view. |
private static Image[] |
rooftoppic
The image of the roof, top view. |
private static Image |
slowpic
The image of the slow speedometer. |
private static BufferedImage |
stellabuf
The background image copy. |
private static Image |
stellapic
The background image. |
private boolean |
virgin
True if painted for the first time. |
private static Image[] |
xdownpic
The image of the X-switch, pointing down. |
private static Image[] |
xleftpic
The image of the X-switch, pointing left. |
private static Image[] |
xrightpic
The image of the X-switch, pointing right. |
| Fields inherited from class jview.AbstractDisplayable |
|---|
KEY_COMPONENTNAME, KEY_ICON, KEY_INSETS |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES |
| Fields inherited from interface util.PropertyBearing |
|---|
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
JRoofView(Map info)
Constructs a new roof view instance. |
|
| Method Summary | |
|---|---|
private int |
getNorthBoltBlink(Trigger[] info)
Get the blink frequency of the north bolt. |
Component |
getRepresentation()
Returns a panel to show the current status of the roof. |
private int |
getSouthBoltBlink(Trigger[] info)
Get the blink frequency of the south bolt. |
private int |
getSpeedBlink(Trigger[] info)
Get the blink frequency of the speed indicator. |
void |
init()
The init method loads all images. |
private Image[] |
loadGreenRed(String filename)
Loads two images, a green and a red version. |
private void |
placeLeftRoof(int xoff,
Image lrti,
Image lrsi,
int lrb,
Image lbni,
Image lbsi,
int lbnb,
int lbsb)
Prepares any non-standard positions for drawing. |
private void |
placeRightRoof(int xoff,
Image rrti,
Image rrsi,
int rrb,
Image rbni,
Image rbsi,
int rbnb,
int rbsb)
Prepares any non-standard positions for drawing. |
private void |
showLeftRoof(Trigger[] info)
Draws the image of a left-handed roof according to the roof info settings. |
private void |
showRightRoof(Trigger[] info)
Draws the image of a left-handed roof according to the roof info settings. |
void |
showRoof(RoofInfo[] roofinfo)
Takes an array of roof info objects to deduce the status of the roof to draw. |
| Methods inherited from class jview.AbstractDisplayable |
|---|
getComponentName, getIcon, getIcon |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String KEY_LAYOUT
public static final String KEY_ROOFTOP
public static final String KEY_ROOFSIDE
public static final String KEY_LIMITRIGHT
public static final String KEY_LIMITLEFT
public static final String KEY_XSWITCHLEFT
public static final String KEY_XSWITCHRIGHT
public static final String KEY_XSWITCHDOWN
public static final String KEY_LOCKDOWN
public static final String KEY_LOCKUP
public static final String KEY_LOCKSTALLED
public static final String KEY_FASTIMAGE
public static final String KEY_SLOWIMAGE
public static final String KEY_GREEN
public static final String KEY_RED
public static final String KEY_BLINK
public static final String KEY_FASTBLINK
public static final String KEY_TOPLEFTORIGIN
public static final String KEY_TOPRIGHTORIGIN
public static final String KEY_SIDELEFTORIGIN
public static final String KEY_SIDERIGHTORIGIN
public static final String KEY_OPENOFFSET
public static final String KEY_HALFOPENOFFSET
public static final String KEY_CENTRALOFFSET
public static final String KEY_HALFSHUTOFFSET
public static final String KEY_SHUTOFFSET
public static final String KEY_OPENLIMITOFFSET
public static final String KEY_SHUTLIMITOFFSET
public static final String KEY_XOFFSET
public static final String KEY_LOCKOFFSET
public static final String KEY_SPEEDLEFT
public static final String KEY_SPEEDRIGHT
public static final String KEY_SIZE
private static final String DEFURLRESOURCES
private static final String DEFLAYOUT
private static final String DEFROOFTOP
private static final String DEFROOFSIDE
private static final String DEFLIMITRIGHT
private static final String DEFLIMITLEFT
private static final String DEFXSWITCHLEFT
private static final String DEFXSWITCHRIGHT
private static final String DEFXSWITCHDOWN
private static final String DEFLOCKDOWN
private static final String DEFLOCKUP
private static final String DEFLOCKSTALLED
private static final String DEFFASTIMAGE
private static final String DEFSLOWIMAGE
private static final String DEFGREEN
private static final String DEFRED
private static final int DEFBLINK
private static final int DEFFASTBLINK
private static final Point DEFTOPLEFTORIGIN
private static final Point DEFTOPRIGHTORIGIN
private static final Point DEFSIDELEFTORIGIN
private static final Point DEFSIDERIGHTORIGIN
private static final int DEFOPENOFFSET
private static final int DEFHALFOPENOFFSET
private static final int DEFCENTRALOFFSET
private static final int DEFHALFSHUTOFFSET
private static final int DEFSHUTOFFSET
private static final Point DEFOPENLIMITOFFSET
private static final Point DEFSHUTLIMITOFFSET
private static final Point DEFXOFFSET
private static final Point DEFLOCKOFFSET
private static final Point DEFSPEEDLEFT
private static final Point DEFSPEEDRIGHT
private static final Dimension DEFSIZE
private static final String DEFCOMPONENTNAME
private static Image stellapic
private static Image[] rooftoppic
private static Image[] roofsidepic
private static Image[] limitrightpic
private static Image[] limitleftpic
private static Image[] xdownpic
private static Image[] xrightpic
private static Image[] xleftpic
private static Image[] lockdownpic
private static Image[] lockuppic
private static Image[] lockstallpic
private static Image fastpic
private static Image slowpic
private static BufferedImage stellabuf
protected JRoofView.JRoofCanvas roof
private boolean virgin
| Constructor Detail |
|---|
public JRoofView(Map info)
getRepresentation() method is called. The constructor takes
care of initializing all images and parsing all offsets.All properties required by the roof view class has defaults, so construction is successful even when called with an empty properties object.
| Method Detail |
|---|
public void init()
init in interface Initializableinit in class PropertyContainerprivate Image[] loadGreenRed(String filename)
KEY_GREEN and KEY_RED. The image with
the index zero is always the green pic.Because this method uses the ImageIcon class, it blocks until the images are fully loaded.
public Component getRepresentation()
showRoof(stella.roof.RoofInfo[]) method does this things.
public void showRoof(RoofInfo[] roofinfo)
private void showLeftRoof(Trigger[] info)
JRoofView.JRoofCanvas class for correctly drawing the roof.
The roof canvas is not told to repaint, this should be done in
the calling routine.
private void showRightRoof(Trigger[] info)
JRoofView.JRoofCanvas class for correctly drawing the roof.
The roof canvas is not told to repaint, this should be done in
the calling routine.
private int getSpeedBlink(Trigger[] info)
private int getNorthBoltBlink(Trigger[] info)
private int getSouthBoltBlink(Trigger[] info)
private void placeLeftRoof(int xoff,
Image lrti,
Image lrsi,
int lrb,
Image lbni,
Image lbsi,
int lbnb,
int lbsb)
xoff - Offset in x from origin, left side.lrti - Image of the left-top roof.lrsi - Image of the left-side roof.lrbb - Blinking intervall for left roof, 0=steadylbni - Image of the left-north bolt.lbsi - Image of the left-south bolt.lbnb - Blinking intervall for left-north bolt.lbsb - Blinking intervall for left-south bolt.
private void placeRightRoof(int xoff,
Image rrti,
Image rrsi,
int rrb,
Image rbni,
Image rbsi,
int rbnb,
int rbsb)
xoff - Offset in x from origin, right side.rrti - Image of the right-top roof.rrsi - Image of the right-side roof.rrbb - Blinking intervall for right roof, 0=steadyrbni - Image of the right-north bolt.rbsi - Image of the right-south bolt.rbnb - Blinking intervall for right-north bolt.rbsb - Blinking intervall for right-south bolt.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||