edu.nau.cs.scu
Class DrawFrontViewAntenna

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 edu.nau.cs.scu.DrawFrontViewAntenna
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class DrawFrontViewAntenna
extends javax.swing.JPanel

A panel that handles the display of the elevation position of the antenna. An image is used to represent the antenna itself, while Shape objects represent the angles of the various settings and positions. The display is updated regularly to keep a constant display of the antenna's current state.

Author:
Talbert Tso, Sam Mallon
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  double angle
          The current angle, in degrees, of the antenna's elevation position.
(package private)  java.awt.BasicStroke antStroke
          The BasicStroke object used in conjunction with drawStops to display the current angle of the antenna.
(package private)  java.awt.BasicStroke defaultStroke
          The BasicStroke object used to set the Stroke of g2d back to the default.
(package private)  java.awt.Graphics2D g2d
           
(package private)  java.awt.BasicStroke hdStroke
          The BasicStroke object used in conjunction with drawStops to display the currently set hard stops.
(package private)  java.awt.image.BufferedImage img
          An image which represents the shape and angle of the antenna from a forward-facing view.
(package private)  int img_height
           
(package private)  int img_width
           
(package private)  boolean imgReadError
           
(package private)  double negSoftStopAngle
          The currently set negative soft stop angle, in degrees.
(package private)  float origin_x
           
(package private)  float origin_y
           
(package private)  double posSoftStopAngle
          The currently set positive soft stop angle, in degrees.
(package private)  java.awt.BasicStroke ssStroke
          The BasicStroke object used in conjunction with drawStops to display the currently set soft stops.
 
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
DrawFrontViewAntenna()
          The constructor for this class.
 
Method Summary
 java.awt.image.BufferedImage getAntennaImage()
          Returns a BufferedImage object which represents the shape of the antenna from a forward-facing view.
 void paintComponent(java.awt.Graphics g)
          Handles the setup and display of this antenna representation.
 void updateImage(double degree, double posSSA, double negSSA)
          Sets the current antenna angle and soft stop positions in the display, and repaints the image.
 
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, 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

origin_x

float origin_x

origin_y

float origin_y

g2d

java.awt.Graphics2D g2d

angle

double angle
The current angle, in degrees, of the antenna's elevation position.


posSoftStopAngle

double posSoftStopAngle
The currently set positive soft stop angle, in degrees.


negSoftStopAngle

double negSoftStopAngle
The currently set negative soft stop angle, in degrees.


defaultStroke

java.awt.BasicStroke defaultStroke
The BasicStroke object used to set the Stroke of g2d back to the default.


hdStroke

java.awt.BasicStroke hdStroke
The BasicStroke object used in conjunction with drawStops to display the currently set hard stops.


ssStroke

java.awt.BasicStroke ssStroke
The BasicStroke object used in conjunction with drawStops to display the currently set soft stops.


antStroke

java.awt.BasicStroke antStroke
The BasicStroke object used in conjunction with drawStops to display the current angle of the antenna.


img

java.awt.image.BufferedImage img
An image which represents the shape and angle of the antenna from a forward-facing view.


img_width

int img_width

img_height

int img_height

imgReadError

boolean imgReadError
Constructor Detail

DrawFrontViewAntenna

public DrawFrontViewAntenna()
The constructor for this class. Invokes the JPanel no-argument constructor.

Method Detail

paintComponent

public void paintComponent(java.awt.Graphics g)
Handles the setup and display of this antenna representation.

Overrides:
paintComponent in class javax.swing.JComponent

getAntennaImage

public java.awt.image.BufferedImage getAntennaImage()
Returns a BufferedImage object which represents the shape of the antenna from a forward-facing view. If the image file does not exist or can't be read, returns null

Returns:
the image representing this view of the antenna, if the file is successfully read; null otherwise.

updateImage

public void updateImage(double degree,
                        double posSSA,
                        double negSSA)
Sets the current antenna angle and soft stop positions in the display, and repaints the image. This method is called from the enclosing panel regularly to constantly display the current position of the antenna. All positions are measured in degrees.

Parameters:
degree - the angle, in degrees, of the current antenna position
posSSA - the angle, in degrees, of the positive soft stop
negSSA - the angle, in degrees, of the negative soft stop