support.convexhull
Class HullHelper

java.lang.Object
  extended by support.convexhull.HullHelper
All Implemented Interfaces:
ConvexHullConstants

public class HullHelper
extends Object
implements ConvexHullConstants

This class is the top level class for the online convex hull. It contains the GUI acts as the overall control structure for implementors of the ConvexHull interface and the HullCanvas.

See Also:
ConvexHull, HullCanvas

Field Summary
 
Fields inherited from interface support.convexhull.ConvexHullConstants
BLUE_POINT_IMAGE, BOTTOM_COLOR, c, CANVAS_HEIGHT, CANVAS_WIDTH, ERROR_COLOR, FIGHTER_MODEL, FRAME_HEIGHT, FRAME_WIDTH, FRAME_X, FRAME_Y, HULL_CONNECT_COLOR, HULL_POINT_RADIUS, IMAGE_PATH, MODEL_PATH, OFF_HULL, ON_HULL, PURPLE_POINT_IMAGE, RED_POINT_IMAGE, ROBOT_MODEL, TOP_COLOR
 
Constructor Summary
HullHelper(ConvexHull hull)
          Constructs a new HullHelper.
 
Method Summary
 void addVertex(int x, int y)
          Adds a vertex to the screen.
 Iterator<Entry<Integer,HullPoint>>[] chains()
          This method returns two Iterators containing the points in the top and bottom chains.
 void clear()
          Clears all points and edges from the screen.
protected  void loadFile()
          Loads a file.
 void printPoints()
          This outputs all the points to the shell.
 void runRobot()
          Calls mture's magic 3d shit
 void setPointText(int x, int y)
          Sets the values in the texts boxes in the GUIPanel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HullHelper

public HullHelper(ConvexHull hull)
Constructs a new HullHelper.

Parameters:
hull - The ConvexHull for which this HullHelper will be the frontend.
Method Detail

loadFile

protected void loadFile()
Loads a file. Shows error dialog and retries on failure.


addVertex

public void addVertex(int x,
                      int y)
Adds a vertex to the screen. This first calls insert from ConvexHull. It then calls addVertex from HullCanvas

Parameters:
x - The x coordinate of the point.
y - The y coordinate of the point.

setPointText

public void setPointText(int x,
                         int y)
Sets the values in the texts boxes in the GUIPanel

Parameters:
x - The x coordinate to be displayed
y - The y coordinate to be displayed

clear

public void clear()
Clears all points and edges from the screen. Also calls clear on the ConvexHull.


chains

public Iterator<Entry<Integer,HullPoint>>[] chains()
This method returns two Iterators containing the points in the top and bottom chains.

Returns:
A pair of iterators that contain the top and bottom chains.

runRobot

public void runRobot()
Calls mture's magic 3d shit


printPoints

public void printPoints()
This outputs all the points to the shell. Consider using redirection: run > points This will cause all output of the command run to saved to a file called points that you can open later.