safehome
Class ControlPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by safehome.device.DeviceControlPanelAbstract
                          extended by safehome.ControlPanel
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class ControlPanel
extends DeviceControlPanelAbstract

This class is a simple implementation of the abstract class DeviceControlPanelAbstract. All abstract methods are implemented simply to show that each button is working well.

Author:
cs550 TA
See Also:
DeviceControlPanelAbstract, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
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
(package private) static long serialVersionUID
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ControlPanel()
          Constructs a control panel frame.
 
Method Summary
 void button0()
          Specifies the action which occurs when button 0 is pressed.
 void button1()
          Specifies the action which occurs when button 1 is pressed.
 void button2()
          Specifies the action which occurs when button 2 is pressed.
 void button3()
          Specifies the action which occurs when button 3 is pressed.
 void button4()
          Specifies the action which occurs when button 4 is pressed.
 void button5()
          Specifies the action which occurs when button 5 is pressed.
 void button6()
          Specifies the action which occurs when button 6 is pressed.
 void button7()
          Specifies the action which occurs when button 7 is pressed.
 void button8()
          Specifies the action which occurs when button 8 is pressed.
 void button9()
          Specifies the action which occurs when button 9 is pressed.
 void buttonSharp()
          Specifies the action which occurs when button # is pressed.
 void buttonStar()
          Specifies the action which occurs when button * is pressed.
 
Methods inherited from class safehome.device.DeviceControlPanelAbstract
actionPerformed, setDisplayAway, setDisplayNotReady, setDisplaySecurityZone, setDisplayShortMessage1, setDisplayShortMessage2, setDisplayStay, setLedArmed, setLedPowered
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

ControlPanel

public ControlPanel()
Constructs a control panel frame.

Pre-condition: None.

Post-condition: The control panel frame is ready. It is initially invisible.

See Also:
DeviceControlPanelAbstract.DeviceControlPanelAbstract().
Method Detail

button1

public void button1()
Specifies the action which occurs when button 1 is pressed. It sets security zone number to 1, turns on the power LED and changes the message to

Key 1 pressed
On Button

Pre-condition: The control panel is ready and visible to the user.

Post-condition: Security zone number is changed to 1, power LED is turned on and the message is changed to

Key 1 pressed
On Button

Specified by:
button1 in class DeviceControlPanelAbstract
See Also:
DeviceControlPanelAbstract.button1()

button2

public void button2()
Specifies the action which occurs when button 2 is pressed. It sets security zone number to 2, turns off all the LEDs, clears status display(Away, Stay, Not Ready) and changes the message to

Key 2 pressed
Off Button

Pre-condition: The control panel is ready and visible to the user.

Post-condition: Security zone number is changed to 2, all the LEDs are turned off, the status display is clear and the message is changed to

Key 2 pressed
Off Button

Specified by:
button2 in class DeviceControlPanelAbstract
See Also:
DeviceControlPanelAbstract.button2()

button3

public void button3()
Specifies the action which occurs when button 3 is pressed. It sets security zone number to 3, turns off the 'armed' LED, clears status display(Away, Stay, Not Ready) and changes the message to

Key 3 pressed
Reset Button

Pre-condition: The control panel is ready and visible to the user.

Post-condition: Security zone number is changed to 3, the 'armed' LED is turned off, the status display is clear and the message is changed to

Key 3 pressed
Reset Button

Specified by:
button3 in class DeviceControlPanelAbstract
See Also:
DeviceControlPanelAbstract.button3()

button4

public void button4()
Specifies the action which occurs when button 4 is pressed. It sets security zone number to 4 and changes the message to

Key 4 pressed

Pre-condition: The control panel is ready and visible to the user.

Post-condition: Security zone number is changed to 4 and the message is changed to

Key 4 pressed

Specified by:
button4 in class DeviceControlPanelAbstract
See Also:
DeviceControlPanelAbstract.button4()

button5

public void button5()
Specifies the action which occurs when button 5 is pressed. It sets security zone number to 5 and changes the message to

Key 5 pressed

Pre-condition: The control panel is ready and visible to the user.

Post-condition: Security zone number is changed to 5 and the message is changed to

Key 5 pressed

Specified by:
button5 in class DeviceControlPanelAbstract
See Also:
DeviceControlPanelAbstract.button5()

button6

public void button6()
Specifies the action which occurs when button 6 is pressed. It sets security zone number to 6 and changes the message to

Key 6 pressed

Pre-condition: The control panel is ready and visible to the user.

Post-condition: Security zone number is changed to 6 and the message is changed to

Key 6 pressed

Specified by:
button6 in class DeviceControlPanelAbstract
See Also:
DeviceControlPanelAbstract.button6()

button7

public void button7()
Specifies the action which occurs when button 7 is pressed. It sets security zone number to 7 , turns on the 'Away' LED, shows 'Away' status on the display and changes the message to

Key 7 pressed
Away Button

Pre-condition: The control panel is ready and visible to the user.

Post-condition: Security zone number is changed to 7, 'armed' LED is turned on 'Away' status is shown on the display and the message is changed to

Key 7 pressed
Away Button

Specified by:
button7 in class DeviceControlPanelAbstract
See Also:
DeviceControlPanelAbstract.button7()

button8

public void button8()
Specifies the action which occurs when button 8 is pressed. It sets security zone number to 8 , turns on the 'Stay' LED, shows 'Stay' status on the display and changes the message to

Key 8 pressed
Stay Button

Pre-condition: The control panel is ready and visible to the user.

Post-condition: Security zone number is changed to 8, 'armed' LED is turned on 'Stay' status is shown on the display and the message is changed to

Key 8 pressed
Stay Button

Specified by:
button8 in class DeviceControlPanelAbstract
See Also:
DeviceControlPanelAbstract.button8()

button9

public void button9()
Specifies the action which occurs when button 9 is pressed. It sets security zone number to 9, shows 'Stay' status on the display and changes the message to

Key 9 pressed
Code Button

Pre-condition: The control panel is ready and visible to the user.

Post-condition: Security zone number is changed to 9, 'Not Ready' status is shown on the display and the message is changed to

Key 9 pressed
Code Button

Specified by:
button9 in class DeviceControlPanelAbstract
See Also:
DeviceControlPanelAbstract.button9()

buttonStar

public void buttonStar()
Specifies the action which occurs when button * is pressed. It sets security zone number to 10 and changes the message to

Key * pressed
Panic Button

Pre-condition: The control panel is ready and visible to the user.

Post-condition: Security zone number is changed to 10 and the message is changed to

Key * pressed
Panic Button

Specified by:
buttonStar in class DeviceControlPanelAbstract
See Also:
DeviceControlPanelAbstract.buttonStar()

button0

public void button0()
Specifies the action which occurs when button 0 is pressed. It sets security zone number to 11 and changes the message to

Key 0 pressed

Pre-condition: The control panel is ready and visible to the user.

Post-condition: Security zone number is changed to 11 and the message is changed to

Key 0 pressed

Specified by:
button0 in class DeviceControlPanelAbstract
See Also:
DeviceControlPanelAbstract.button0()

buttonSharp

public void buttonSharp()
Specifies the action which occurs when button # is pressed. It sets security zone number to 12 and changes the message to

Key # pressed
Panic Button

Pre-condition: The control panel is ready and visible to the user.

Post-condition: Security zone number is changed to 12 and the message is changed to

Key # pressed
Panic Button

Specified by:
buttonSharp in class DeviceControlPanelAbstract
See Also:
DeviceControlPanelAbstract.buttonSharp()