uk.ac.ed.inf.sdp2012.group7.vision
Class InitialLocation

java.lang.Object
  extended by uk.ac.ed.inf.sdp2012.group7.vision.InitialLocation
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

public class InitialLocation
extends java.lang.Object
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

Get the colour value of yellow and do the manual testing stuff

Author:
James Hulme, Dale Myers

Field Summary
 java.awt.Point testCoords
           
 boolean testMouseClick
           
 
Constructor Summary
InitialLocation()
          Constructor
InitialLocation(VisionFeed visionFeed, javax.swing.JFrame windowFrame, ThresholdsState ts)
          The constructor
 
Method Summary
 java.awt.Point correctPoint(java.awt.Point p)
          Necessary for some reason
 int correctX(int x)
           
 int correctY(int y)
           
 java.awt.Color getClickColor(java.lang.String message)
          Get the color where we click
 java.awt.Color getColor(java.awt.Point p, java.awt.image.BufferedImage image)
          Gets the colour where clicked
 void getColors()
           
 java.util.ArrayList<java.lang.Double> getOrientationPoints()
           
 java.util.ArrayList<java.lang.Integer> getPitchPoints()
           
 void getTestData(java.awt.image.BufferedImage image, java.lang.String filename)
          Get the data for the test framework
 java.util.ArrayList<java.awt.Point> getTestPoints()
           
 java.util.ArrayList<java.awt.Point> getTestPointsAuto()
           
 java.awt.image.BufferedImage markImage(java.awt.image.BufferedImage image)
          Draw the pitch boundaries on
 void mouseClicked(java.awt.event.MouseEvent e)
          Checks when mouse is clicked
 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)
           
 void setYellowValues(java.awt.Color c)
           
 void setYellowValues(int r, int g, int b)
          Set the yellow values r,g,b gained from setYellowValues with just a c
 void writeImage(java.awt.image.BufferedImage image, java.lang.String fn)
          Save an image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

testMouseClick

public boolean testMouseClick

testCoords

public java.awt.Point testCoords
Constructor Detail

InitialLocation

public InitialLocation(VisionFeed visionFeed,
                       javax.swing.JFrame windowFrame,
                       ThresholdsState ts)
The constructor

Parameters:
visionFeed -
windowFrame -
ts -

InitialLocation

public InitialLocation()
Constructor

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)
Checks when mouse is clicked

Specified by:
mouseClicked in interface java.awt.event.MouseListener

getTestPoints

public java.util.ArrayList<java.awt.Point> getTestPoints()

getTestPointsAuto

public java.util.ArrayList<java.awt.Point> getTestPointsAuto()

getOrientationPoints

public java.util.ArrayList<java.lang.Double> getOrientationPoints()

getPitchPoints

public java.util.ArrayList<java.lang.Integer> getPitchPoints()

getTestData

public void getTestData(java.awt.image.BufferedImage image,
                        java.lang.String filename)
Get the data for the test framework

Parameters:
image - Frame to test
filename - What to call saved file

getColors

public void getColors()

setYellowValues

public void setYellowValues(java.awt.Color c)

setYellowValues

public void setYellowValues(int r,
                            int g,
                            int b)
Set the yellow values r,g,b gained from setYellowValues with just a c

Parameters:
r - red channel
g - green channel
b - blue channel

getClickColor

public java.awt.Color getClickColor(java.lang.String message)
Get the color where we click

Parameters:
message - Asks what to click on
Returns:
The colour of pixel where we clicked

correctPoint

public java.awt.Point correctPoint(java.awt.Point p)
Necessary for some reason

Parameters:
p - Point to correct
Returns:
Corrected Point

correctX

public int correctX(int x)

correctY

public int correctY(int y)

getColor

public java.awt.Color getColor(java.awt.Point p,
                               java.awt.image.BufferedImage image)
Gets the colour where clicked

Parameters:
p - Point where we clicked
image - Frame to get colour from
Returns:
The colour

markImage

public java.awt.image.BufferedImage markImage(java.awt.image.BufferedImage image)
Draw the pitch boundaries on

Parameters:
image - Frame to draw on
Returns:
The frame after being drawn on

writeImage

public void writeImage(java.awt.image.BufferedImage image,
                       java.lang.String fn)
Save an image

Parameters:
image - What to save
fn - Where to save