view
Class LightView

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 view.LightView
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class LightView
extends JFrame

This is the primary class for the view part of this project. It communicates to the model through the controller, and controls all portions of the GUI.

See Also:
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.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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
LightView(ILightViewConnector _connector)
          This constructor sets up the GUI.
 
Method Summary
 void deviceDisconnected()
          This method will notify the view if the device has disconnected without the view specifically telling it to disconnect.
 void makeVisible()
          This method makes the view visible.
 void raiseError(String error, String desc)
          This method will notify the user of the given error.
 void raiseError(Throwable error, String desc)
          This method will notify the user of the given error.
 void selectCueWithoutTransition(String cue)
          This method will select the given cue without triggering a transition.
 void setChannelSource(Channel channel, float[] source)
          This method will set the source for the given channel.
 void setChannelSource(short address, float[] source)
          This method will set the source for the given address.
 void setChannelSources(Channel[] channels, float[][] sources)
          This method will set the source for a series of channels.
 void setChannelSources(short[] addresses, float[][] sources)
          This method will set the source for a series of a channels.
 void toggleDataEntry(boolean enabled)
          This method will toggle the data entry fields for the program.
 void updateCueList()
          This method will update the cue list.
 void updateFadeDownProgress(int percentDone)
          This method will update the fade down progress meter.
 void updateFadeUpProgress(int percentDone)
          This method will update the fade up progress meter.
 void updateValue(Channel channel)
          This method will update the value of the given channel without changing its source.
 void updateValue(Channel channel, float[] source)
          This method will update the value and source of the given channel.
 void updateValues(Channel[] channels)
          This method will update the given channels without changing the current channel source.
 void updateValues(Channel[] channels, float[][] sources)
          This method will update the given channels with the given sources.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, 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, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, 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, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Constructor Detail

LightView

public LightView(ILightViewConnector _connector)
This constructor sets up the GUI.

Parameters:
_connector - The connector.
Method Detail

makeVisible

public void makeVisible()
This method makes the view visible. TODO: Finish working on the cue advance code, or at least clean this mess up.


updateValues

public void updateValues(Channel[] channels,
                         float[][] sources)
This method will update the given channels with the given sources.

Parameters:
channels - The address, value pairs to update.
sources - The sources of the updated values.

updateValues

public void updateValues(Channel[] channels)
This method will update the given channels without changing the current channel source.

Parameters:
channels - The address, value pairs to update.

updateValue

public void updateValue(Channel channel,
                        float[] source)
This method will update the value and source of the given channel.

Parameters:
channel - The address, value pair to update.
source - The source of the new value.

updateValue

public void updateValue(Channel channel)
This method will update the value of the given channel without changing its source.

Parameters:
channel - The address, value pair to update.

updateFadeUpProgress

public void updateFadeUpProgress(int percentDone)
This method will update the fade up progress meter.

Parameters:
percentDone - The percentage done between 0 and 100.

updateFadeDownProgress

public void updateFadeDownProgress(int percentDone)
This method will update the fade down progress meter.

Parameters:
percentDone - The percentage done on the fade between 0 and 100.

updateCueList

public void updateCueList()
This method will update the cue list.

TODO: This method should probably take in the new cue list values.


selectCueWithoutTransition

public void selectCueWithoutTransition(String cue)
This method will select the given cue without triggering a transition.

Parameters:
cue - The summary of the cue to select.

toggleDataEntry

public void toggleDataEntry(boolean enabled)
This method will toggle the data entry fields for the program.

Parameters:
enabled - When true, this will enable data input, and when false, disallow input.

setChannelSource

public void setChannelSource(short address,
                             float[] source)
This method will set the source for the given address.

Parameters:
address - The address of the channel to change the source for.
source - The new source for the channel.

setChannelSource

public void setChannelSource(Channel channel,
                             float[] source)
This method will set the source for the given channel. Only the address will be used from the channel object, the value will be ignored.

Parameters:
channel - The channel to change the source for. Only the address will be used, the value will be ignored.
source - The new source for the channel.

setChannelSources

public void setChannelSources(short[] addresses,
                              float[][] sources)
This method will set the source for a series of a channels.

Parameters:
addresses - The array of addresses to set the source for.
sources - The new sources for the given addresses.

setChannelSources

public void setChannelSources(Channel[] channels,
                              float[][] sources)
This method will set the source for a series of channels.

Parameters:
channels - The channels to change the source for. Only the address will be used, the value will be ignored.
sources - The new sources for the given channels.

raiseError

public void raiseError(String error,
                       String desc)
This method will notify the user of the given error.

Parameters:
error - The error, usually including the stack trace.
desc - The description of the error: why this might have occured, what to do about it, etc. This will be displayed above the error message to the user.

raiseError

public void raiseError(Throwable error,
                       String desc)
This method will notify the user of the given error. It will use the stack trace from the given exception as the error message.

Parameters:
error - The throwable error to use the stack trace from for the error message.
desc - The description of the error: why this might have occured, what to do about it, etc. This will be displayed above the error message to the user.

deviceDisconnected

public void deviceDisconnected()
This method will notify the view if the device has disconnected without the view specifically telling it to disconnect.