uk.ac.ed.inf.sdp2012.group7.testing.vision
Class VisionTesting

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by uk.ac.ed.inf.sdp2012.group7.testing.vision.VisionTesting
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class VisionTesting
extends java.awt.Panel
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
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
static java.awt.Point ball
           
static java.awt.Point ballAuto
           
static double blueAngle
           
static double blueAngleClick
           
static java.awt.Point blueBottom
           
static java.util.ArrayList<java.awt.Point> blueC
           
static java.awt.Point blueCentroid
           
static java.awt.Point blueCentroidAuto
           
static double blueOrientation
           
static int left
           
static int leftAuto
           
static int right
           
static int rightAuto
           
static double yellowAngle
           
static double yellowAngleClick
           
static java.awt.Point yellowBottom
           
static java.util.ArrayList<java.awt.Point> yellowC
           
static java.awt.Point yellowCentroid
           
static java.awt.Point yellowCentroidAuto
           
static double yellowOrientation
           
 
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
VisionTesting()
           
 
Method Summary
 void addMouseListeners(javax.swing.JFrame window, VisionPanel panel)
           
static boolean close(java.awt.Point a, java.awt.Point b)
           
static int cmToPixels(float cm)
           
 java.awt.Point correctPoint(java.awt.Point p)
           
static java.awt.Point getClickPoint(java.lang.String message)
           
static double getOrientation(java.awt.Point top, java.awt.Point greyCircle)
           
static void main(java.lang.String[] args)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
static float pixelsToCM(double pixelValue)
           
static void readXMLAuto(java.io.File xmlFile)
           
static void readXMLClick(java.io.File xmlFile)
           
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, 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, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

blueC

public static java.util.ArrayList<java.awt.Point> blueC

yellowC

public static java.util.ArrayList<java.awt.Point> yellowC

blueOrientation

public static double blueOrientation

yellowOrientation

public static double yellowOrientation

ball

public static java.awt.Point ball

ballAuto

public static java.awt.Point ballAuto

blueCentroid

public static java.awt.Point blueCentroid

yellowCentroid

public static java.awt.Point yellowCentroid

blueCentroidAuto

public static java.awt.Point blueCentroidAuto

yellowCentroidAuto

public static java.awt.Point yellowCentroidAuto

blueBottom

public static java.awt.Point blueBottom

yellowBottom

public static java.awt.Point yellowBottom

left

public static int left

right

public static int right

leftAuto

public static int leftAuto

rightAuto

public static int rightAuto

blueAngleClick

public static double blueAngleClick

yellowAngleClick

public static double yellowAngleClick

blueAngle

public static double blueAngle

yellowAngle

public static double yellowAngle
Constructor Detail

VisionTesting

public VisionTesting()
Method Detail

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

getClickPoint

public static java.awt.Point getClickPoint(java.lang.String message)

correctPoint

public java.awt.Point correctPoint(java.awt.Point p)

main

public static void main(java.lang.String[] args)

getOrientation

public static double getOrientation(java.awt.Point top,
                                    java.awt.Point greyCircle)

addMouseListeners

public void addMouseListeners(javax.swing.JFrame window,
                              VisionPanel panel)

close

public static boolean close(java.awt.Point a,
                            java.awt.Point b)

readXMLClick

public static void readXMLClick(java.io.File xmlFile)

readXMLAuto

public static void readXMLAuto(java.io.File xmlFile)

cmToPixels

public static int cmToPixels(float cm)

pixelsToCM

public static float pixelsToCM(double pixelValue)