Add more comments

This commit is contained in:
jan 2017-01-08 16:29:41 -08:00
parent ccce12c725
commit 26db90a78b
7 changed files with 197 additions and 174 deletions

View File

@ -2,12 +2,12 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="6e752a8c-6cb9-4ef9-9031-0329ce15fcb4" name="Default" comment="Ellipse can be drawn...">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Camera.java" afterPath="$PROJECT_DIR$/src/Camera.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ClickGetter.java" afterPath="$PROJECT_DIR$/src/ClickGetter.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/EuglenaApplet.java" afterPath="$PROJECT_DIR$/src/EuglenaApplet.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/LEDControl.java" afterPath="$PROJECT_DIR$/src/LEDControl.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Line.java" afterPath="$PROJECT_DIR$/src/Line.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ProjectorApplet.java" afterPath="$PROJECT_DIR$/src/ProjectorApplet.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Settings.java" afterPath="$PROJECT_DIR$/src/Settings.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Menu.java" afterPath="$PROJECT_DIR$/src/Menu.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ProjectorCommand.java" afterPath="$PROJECT_DIR$/src/ProjectorCommand.java" />
</list>
<ignored path="processing-intellij.iws" />
<ignored path=".idea/workspace.xml" />
@ -29,11 +29,23 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="EuglenaApplet.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/EuglenaApplet.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="292">
<caret line="141" column="14" selection-start-line="141" selection-start-column="9" selection-end-line="141" selection-end-column="14" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ProjectorApplet.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/ProjectorApplet.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="324">
<caret line="9" column="53" selection-start-line="9" selection-start-column="53" selection-end-line="9" selection-end-column="53" />
<state relative-caret-position="635">
<caret line="20" column="0" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1049#1050#0" expanded="true" />
@ -45,21 +57,11 @@
</provider>
</entry>
</file>
<file leaf-file-name="Line.java" pinned="false" current-in-tab="false">
<file leaf-file-name="Line.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/Line.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1260">
<caret line="36" column="20" selection-start-line="36" selection-start-column="20" selection-end-line="36" selection-end-column="20" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="LEDControl.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/LEDControl.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="936">
<caret line="26" column="63" selection-start-line="26" selection-start-column="63" selection-end-line="26" selection-end-column="63" />
<state relative-caret-position="-1421">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -70,8 +72,8 @@
<file leaf-file-name="Menu.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Menu.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="544">
<caret line="226" column="32" selection-start-line="226" selection-start-column="32" selection-end-line="226" selection-end-column="32" />
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -79,21 +81,21 @@
</provider>
</entry>
</file>
<file leaf-file-name="Ellipse.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/Ellipse.java">
<file leaf-file-name="Calibrator.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Calibrator.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="108">
<caret line="4" column="6" selection-start-line="4" selection-start-column="6" selection-end-line="4" selection-end-column="6" />
<state relative-caret-position="-684">
<caret line="7" column="6" selection-start-line="7" selection-start-column="6" selection-end-line="7" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Settings.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Settings.java">
<file leaf-file-name="Ellipse.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Ellipse.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="1" column="21" selection-start-line="1" selection-start-column="21" selection-end-line="1" selection-end-column="21" />
<state relative-caret-position="1080">
<caret line="31" column="34" selection-start-line="31" selection-start-column="34" selection-end-line="31" selection-end-column="34" />
<folding />
</state>
</provider>
@ -102,18 +104,20 @@
<file leaf-file-name="Shrink.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Shrink.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="108">
<state relative-caret-position="144">
<caret line="4" column="6" selection-start-line="4" selection-start-column="6" selection-end-line="4" selection-end-column="6" />
<folding />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Translate.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Translate.java">
<file leaf-file-name="ClickGetter.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/ClickGetter.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="108">
<caret line="4" column="13" selection-start-line="4" selection-start-column="13" selection-end-line="4" selection-end-column="13" />
<state relative-caret-position="36">
<caret line="1" column="39" selection-start-line="1" selection-start-column="39" selection-end-line="1" selection-end-column="39" />
<folding />
</state>
</provider>
@ -122,8 +126,8 @@
<file leaf-file-name="Camera.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Camera.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="396">
<caret line="13" column="46" selection-start-line="13" selection-start-column="46" selection-end-line="13" selection-end-column="46" />
<state relative-caret-position="252">
<caret line="7" column="28" selection-start-line="7" selection-start-column="28" selection-end-line="7" selection-end-column="28" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -170,9 +174,7 @@
<option value="$PROJECT_DIR$/lib/core.jar!/processing/core/PApplet.class" />
<option value="$PROJECT_DIR$/src/EllipseClass.java" />
<option value="$PROJECT_DIR$/src/Command.java" />
<option value="$PROJECT_DIR$/src/ProjectorCommand.java" />
<option value="$PROJECT_DIR$/src/MouseGetter.java" />
<option value="$PROJECT_DIR$/src/ClickGetter.java" />
<option value="$PROJECT_DIR$/src/Procedure.java" />
<option value="$PROJECT_DIR$/src/euglena_basic_stimuli.java" />
<option value="$PROJECT_DIR$/src/Ellipse.java" />
@ -180,19 +182,22 @@
<option value="$PROJECT_DIR$/src/Calibrator.java" />
<option value="$PROJECT_DIR$/src/Triangle.java" />
<option value="$PROJECT_DIR$/src/clearDisplay.java" />
<option value="$PROJECT_DIR$/src/Menu.java" />
<option value="$PROJECT_DIR$/src/EuglenaApplet.java" />
<option value="$PROJECT_DIR$/src/Settings.java" />
<option value="$PROJECT_DIR$/src/Line.java" />
<option value="$PROJECT_DIR$/src/LEDControl.java" />
<option value="$PROJECT_DIR$/src/ProjectorApplet.java" />
<option value="$PROJECT_DIR$/src/Camera.java" />
<option value="$PROJECT_DIR$/src/EuglenaApplet.java" />
<option value="$PROJECT_DIR$/src/ProjectorCommand.java" />
<option value="$PROJECT_DIR$/src/LEDControl.java" />
<option value="$PROJECT_DIR$/src/Menu.java" />
<option value="$PROJECT_DIR$/src/ClickGetter.java" />
<option value="$PROJECT_DIR$/src/Line.java" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="width" value="1596" />
<option name="height" value="1800" />
<option name="x" value="-2" />
<option name="width" value="1602" />
<option name="height" value="1802" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<OptionsSetting value="true" id="Add" />
@ -474,11 +479,11 @@
<servers />
</component>
<component name="ToolWindowManager">
<frame x="0" y="0" width="1596" height="1800" extended-state="4" />
<frame x="-2" y="0" width="1602" height="1802" extended-state="4" />
<editor active="true" />
<layout>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.40037015" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.39987677" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
@ -606,10 +611,6 @@
<caret line="39" column="5" selection-start-line="39" selection-start-column="5" selection-end-line="39" selection-end-column="5" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#600#601#0" expanded="true" />
<element signature="e#645#646#0" expanded="true" />
<element signature="e#689#690#0" expanded="true" />
<element signature="e#726#727#0" expanded="true" />
</folding>
</state>
</provider>
@ -684,10 +685,6 @@
<caret line="40" column="35" selection-start-line="40" selection-start-column="35" selection-end-line="40" selection-end-column="35" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#600#601#0" expanded="true" />
<element signature="e#645#646#0" expanded="true" />
<element signature="e#689#690#0" expanded="true" />
<element signature="e#726#727#0" expanded="true" />
</folding>
</state>
</provider>
@ -721,10 +718,6 @@
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#600#601#0" expanded="true" />
<element signature="e#645#646#0" expanded="true" />
<element signature="e#689#690#0" expanded="true" />
<element signature="e#726#727#0" expanded="true" />
</folding>
</state>
</provider>
@ -735,10 +728,6 @@
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#600#601#0" expanded="true" />
<element signature="e#645#646#0" expanded="true" />
<element signature="e#689#690#0" expanded="true" />
<element signature="e#726#727#0" expanded="true" />
</folding>
</state>
</provider>
@ -749,10 +738,6 @@
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#600#601#0" expanded="true" />
<element signature="e#645#646#0" expanded="true" />
<element signature="e#689#690#0" expanded="true" />
<element signature="e#726#727#0" expanded="true" />
</folding>
</state>
</provider>
@ -763,10 +748,6 @@
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#600#601#0" expanded="true" />
<element signature="e#645#646#0" expanded="true" />
<element signature="e#689#690#0" expanded="true" />
<element signature="e#726#727#0" expanded="true" />
</folding>
</state>
</provider>
@ -777,10 +758,6 @@
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#600#601#0" expanded="true" />
<element signature="e#645#646#0" expanded="true" />
<element signature="e#689#690#0" expanded="true" />
<element signature="e#726#727#0" expanded="true" />
</folding>
</state>
</provider>
@ -791,10 +768,6 @@
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#600#601#0" expanded="true" />
<element signature="e#645#646#0" expanded="true" />
<element signature="e#689#690#0" expanded="true" />
<element signature="e#726#727#0" expanded="true" />
</folding>
</state>
</provider>
@ -879,47 +852,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Calibrator.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="684">
<caret line="19" column="37" selection-start-line="19" selection-start-column="31" selection-end-line="19" selection-end-column="37" />
<folding>
<element signature="e#0#3821#0" expanded="false" />
<element signature="imports" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/EuglenaApplet.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#600#601#0" expanded="true" />
<element signature="e#645#646#0" expanded="true" />
<element signature="e#689#690#0" expanded="true" />
<element signature="e#726#727#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ProjectorCommand.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="17" selection-start-line="0" selection-start-column="17" selection-end-line="0" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ClickGetter.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="17" selection-start-line="0" selection-start-column="17" selection-end-line="0" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Rectangle.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="108">
@ -944,60 +876,10 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Shrink.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="108">
<caret line="4" column="6" selection-start-line="4" selection-start-column="6" selection-end-line="4" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/LEDControl.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="936">
<caret line="26" column="63" selection-start-line="26" selection-start-column="63" selection-end-line="26" selection-end-column="63" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Menu.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="544">
<caret line="226" column="32" selection-start-line="226" selection-start-column="32" selection-end-line="226" selection-end-column="32" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ProjectorApplet.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="324">
<caret line="9" column="53" selection-start-line="9" selection-start-column="53" selection-end-line="9" selection-end-column="53" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1049#1050#0" expanded="true" />
<element signature="e#1108#1109#0" expanded="true" />
<element signature="e#2751#2752#0" expanded="true" />
<element signature="e#2791#2792#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Line.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1260">
<caret line="36" column="20" selection-start-line="36" selection-start-column="20" selection-end-line="36" selection-end-column="20" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Camera.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="396">
<caret line="13" column="46" selection-start-line="13" selection-start-column="46" selection-end-line="13" selection-end-column="46" />
<state relative-caret-position="252">
<caret line="7" column="28" selection-start-line="7" selection-start-column="28" selection-end-line="7" selection-end-column="28" />
<folding>
<element signature="imports" expanded="true" />
</folding>
@ -1012,14 +894,102 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/EuglenaApplet.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="292">
<caret line="141" column="14" selection-start-line="141" selection-start-column="9" selection-end-line="141" selection-end-column="14" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/LEDControl.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="6" column="22" selection-start-line="6" selection-start-column="22" selection-end-line="6" selection-end-column="22" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ProjectorCommand.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="396">
<caret line="11" column="22" selection-start-line="11" selection-start-column="22" selection-end-line="11" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Ellipse.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="108">
<caret line="4" column="6" selection-start-line="4" selection-start-column="6" selection-end-line="4" selection-end-column="6" />
<state relative-caret-position="1080">
<caret line="31" column="34" selection-start-line="31" selection-start-column="34" selection-end-line="31" selection-end-column="34" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Shrink.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="4" column="6" selection-start-line="4" selection-start-column="6" selection-end-line="4" selection-end-column="6" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ClickGetter.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="1" column="39" selection-start-line="1" selection-start-column="39" selection-end-line="1" selection-end-column="39" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ProjectorApplet.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="635">
<caret line="20" column="0" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1049#1050#0" expanded="true" />
<element signature="e#1108#1109#0" expanded="true" />
<element signature="e#2751#2752#0" expanded="true" />
<element signature="e#2791#2792#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Calibrator.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-684">
<caret line="7" column="6" selection-start-line="7" selection-start-column="6" selection-end-line="7" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Menu.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Line.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1421">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>

View File

@ -1,3 +1,7 @@
/*
Interface for handling mouse clicks
*/
public interface ClickGetter {
boolean click(int mouseX, int mouseY);
}

View File

@ -4,9 +4,10 @@ import processing.core.*;
public class EuglenaApplet extends PApplet {
/*
This is the main Processing applet.
This applet draws the main window and menu
*/
final int cameraMode = 9;
final int cameraMode = 8;
final int whichArduino = 0;
// Hardware

View File

@ -3,6 +3,10 @@ import static processing.core.PApplet.*;
import cc.arduino.*;
class LEDControl {
/*
LED controller
*/
final int comRate = 57600;
Arduino arduino;

View File

@ -3,6 +3,10 @@ import static processing.core.PApplet.*;
class Line {
/*
Class representing a line
*/
float x1, y1, x2, y2;
int color, brushSize;
boolean visible;
@ -31,6 +35,14 @@ class Line {
ProjectorCommand makeProjectorCommand() {
/*
Create a ProjectorCommand which draws ourselves!
The ```(arg) -> {my(); commands(); here(); return v}``` syntax creates a
"closure", which is just a function that we write on-the-fly and
store for later use.
*/
return (ProjectorApplet p) -> {
if (!visible) {
//done drawing already
@ -54,6 +66,11 @@ class Line {
}
ClickGetter makeClickGetter(ProjectorApplet p) {
/*
Create a ClickGetter which can accept incoming mouse clicks
and use them to update ourselves.
*/
return (int x, int y) -> {
if (!point1complete){
x1 = x;

View File

@ -3,6 +3,10 @@ import static processing.core.PApplet.*;
import controlP5.*;
class Menu {
/*
Right-side menu
*/
final int width = 200; // Width of toolbar on left side of display
EuglenaApplet parent;
@ -189,6 +193,11 @@ class Menu {
}
void controlEvent(ControlEvent theEvent) {
/*
Handle a controlEvent -- controlP5 generates these events anytime
a menu item is clicked.
*/
//println(theEvent);
if (theEvent.isFrom(shapesList)) {
switch((int) shapesList.getValue()) {

View File

@ -1,3 +1,21 @@
/*
This file defines the ProjectorCommand interface.
It says, "if you want a class you wrote to also be a ProjectorCommand,
it must have a method ```run``` which takes a ProjectorApplet and
returns a boolean".
You can quickly make a ProjectorCommand by using the syntax
yourLocalVariable = 5;
ProjectorCommand yourCommand = (ProjectorApplet p) -> {
your(yourLocalVariable);
code();
here();
}
return yourCommand;
*/
public interface ProjectorCommand {
boolean run(ProjectorApplet p) throws ProjectorCommandException;
}