tortues
Class Controller

java.lang.Object
  extended by tortues.Controller

public class Controller
extends java.lang.Object

Controller (MVC)   * @author Julien VAUBOURG   * @version 0.2 (2010-10-12)


Constructor Summary
protected Controller(Tortoise franklin)
          Creates the controller, with a turtle
 
Method Summary
protected  void execCommand(java.lang.String commandText)
          Executes a turtle command, and adds it to the history
protected  void execCommand(java.lang.String commandText, boolean save)
          Executes a turtle command
protected  Tortoise getFranklin()
          Returns Franklin
protected  java.util.ArrayList<java.awt.Point[]> getSegments()
          Returns the drawing
protected static void help()
          Help on console
protected  java.lang.String historyDown()
          Goes down in the command history
protected  java.lang.String historyUp()
          Back in the command history
protected  void open()
          Open a saved drawing (with file chooser)
protected  void open(java.io.File dumpFile)
          Open a saved drawing
protected  void open(java.io.InputStream dumpStream)
          Open a saved drawing
protected  void setView(Screen view)
          Set the attached view (MVC)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Controller

protected Controller(Tortoise franklin)
Creates the controller, with a turtle

Parameters:
franklin - Tortoise instance of Franklin
Method Detail

getSegments

protected java.util.ArrayList<java.awt.Point[]> getSegments()
Returns the drawing

Returns:
Segments composing the drawing

getFranklin

protected Tortoise getFranklin()
Returns Franklin

Returns:
Franklin tortoise instance

historyUp

protected java.lang.String historyUp()
Back in the command history

Returns:
Older command

historyDown

protected java.lang.String historyDown()
Goes down in the command history

Returns:
Newer command

setView

protected void setView(Screen view)
Set the attached view (MVC)

Parameters:
view - Screen view instance

execCommand

protected void execCommand(java.lang.String commandText)
Executes a turtle command, and adds it to the history

Parameters:
commandText - Turtle command

execCommand

protected void execCommand(java.lang.String commandText,
                           boolean save)
Executes a turtle command

Parameters:
commandText - Turtle command
save - Save in the command history

open

protected void open()
Open a saved drawing (with file chooser)


open

protected void open(java.io.File dumpFile)
Open a saved drawing

Parameters:
dumpFile - Saved drawing file

open

protected void open(java.io.InputStream dumpStream)
Open a saved drawing

Parameters:
dumpStream - Saved drawing file

help

protected static void help()
Help on console