Ellipse clickGetter works

This commit is contained in:
jan 2016-07-10 07:14:09 -07:00
parent ee6eccee36
commit df880a0e66
6 changed files with 243 additions and 212 deletions

View File

@ -2,16 +2,12 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="6e752a8c-6cb9-4ef9-9031-0329ce15fcb4" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/ProjectorCommand.java" />
<change type="MOVED" beforePath="$PROJECT_DIR$/src/EllipseClass.java" afterPath="$PROJECT_DIR$/src/Ellipse.java" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/ClickGetter.java" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/Procedure.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Calibrator.java" afterPath="$PROJECT_DIR$/src/Calibrator.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Camera.java" afterPath="$PROJECT_DIR$/src/Camera.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Ellipse.java" afterPath="$PROJECT_DIR$/src/Ellipse.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/Menu.java" afterPath="$PROJECT_DIR$/src/Menu.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ProjectorApplet.java" afterPath="$PROJECT_DIR$/src/ProjectorApplet.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/shrinkingCircle.java" afterPath="$PROJECT_DIR$/src/shrinkingCircle.java" />
</list>
<ignored path="processing-intellij.iws" />
<ignored path=".idea/workspace.xml" />
@ -35,8 +31,8 @@
<file leaf-file-name="euglena_basic_stimuli.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/euglena_basic_stimuli.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="536">
<caret line="332" column="18" selection-start-line="332" selection-start-column="18" selection-end-line="332" selection-end-column="18" />
<state relative-caret-position="392">
<caret line="424" column="17" selection-start-line="424" selection-start-column="17" selection-end-line="424" selection-end-column="17" />
<folding>
<element signature="e#0#16478#0" expanded="true" />
<element signature="imports" expanded="true" />
@ -56,12 +52,15 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="EuglenaApplet.java" pinned="false" current-in-tab="false">
<file leaf-file-name="EuglenaApplet.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/EuglenaApplet.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="717">
<caret line="54" column="58" selection-start-line="54" selection-start-column="58" selection-end-line="54" selection-end-column="58" />
<folding />
<state relative-caret-position="321">
<caret line="59" column="9" selection-start-line="59" selection-start-column="9" selection-end-line="59" selection-end-column="9" />
<folding>
<element signature="e#398#399#0" expanded="true" />
<element signature="e#443#444#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -69,12 +68,12 @@
<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="574">
<caret line="34" column="18" selection-start-line="34" selection-start-column="18" selection-end-line="36" selection-end-column="20" />
<state relative-caret-position="573">
<caret line="44" column="0" selection-start-line="44" selection-start-column="0" selection-end-line="44" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#543#544#0" expanded="true" />
<element signature="e#602#603#0" expanded="true" />
<element signature="e#514#515#0" expanded="true" />
<element signature="e#573#574#0" expanded="true" />
</folding>
</state>
</provider>
@ -83,19 +82,11 @@
<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="141">
<caret line="62" column="21" selection-start-line="62" selection-start-column="21" selection-end-line="62" selection-end-column="21" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ProjectorCommand.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/ProjectorCommand.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="1" column="4" selection-start-line="1" selection-start-column="4" selection-end-line="1" selection-end-column="4" />
<folding />
<state relative-caret-position="645">
<caret line="56" column="25" selection-start-line="56" selection-start-column="25" selection-end-line="56" selection-end-column="25" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -112,20 +103,6 @@
</provider>
</entry>
</file>
<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="828">
<caret line="26" column="59" selection-start-line="26" selection-start-column="59" selection-end-line="26" selection-end-column="59" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1074#1075#0" expanded="true" />
<element signature="e#1108#1109#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<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">
@ -138,19 +115,6 @@
</provider>
</entry>
</file>
<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="2880">
<caret line="80" column="17" selection-start-line="80" selection-start-column="17" selection-end-line="80" selection-end-column="17" />
<folding>
<element signature="e#0#3781#0" expanded="true" />
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
@ -186,10 +150,13 @@
<option value="$PROJECT_DIR$/src/Camera.java" />
<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/ProjectorApplet.java" />
<option value="$PROJECT_DIR$/src/Procedure.java" />
<option value="$PROJECT_DIR$/src/Ellipse.java" />
<option value="$PROJECT_DIR$/src/EuglenaApplet.java" />
<option value="$PROJECT_DIR$/src/ProjectorApplet.java" />
<option value="$PROJECT_DIR$/src/ProjectorCommand.java" />
</list>
</option>
</component>
@ -468,7 +435,14 @@
<option name="project" value="LOCAL" />
<updated>1468109775159</updated>
</task>
<option name="localTasksCounter" value="2" />
<task id="LOCAL-00002" summary="Ellipse can be drawn...">
<created>1468157042910</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1468157042910</updated>
</task>
<option name="localTasksCounter" value="3" />
<servers />
</component>
<component name="ToolWindowManager">
@ -531,7 +505,8 @@
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Start javaifying" />
<option name="LAST_COMMIT_MESSAGE" value="Start javaifying" />
<MESSAGE value="Ellipse can be drawn..." />
<option name="LAST_COMMIT_MESSAGE" value="Ellipse can be drawn..." />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
@ -546,7 +521,10 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="630">
<caret line="39" column="5" selection-start-line="39" selection-start-column="5" selection-end-line="39" selection-end-column="5" />
<folding />
<folding>
<element signature="e#398#399#0" expanded="true" />
<element signature="e#443#444#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -556,8 +534,8 @@
<caret line="33" column="18" selection-start-line="33" selection-start-column="8" selection-end-line="33" selection-end-column="18" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#543#544#0" expanded="true" />
<element signature="e#602#603#0" expanded="true" />
<element signature="e#514#515#0" expanded="true" />
<element signature="e#573#574#0" expanded="true" />
</folding>
</state>
</provider>
@ -577,9 +555,8 @@
<state relative-caret-position="720">
<caret line="41" column="23" selection-start-line="41" selection-start-column="23" selection-end-line="41" selection-end-column="23" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1074#1075#0" expanded="true" />
<element signature="e#1108#1109#0" expanded="true" />
<element signature="e#1074#1075#0" expanded="false" />
<element signature="e#1108#1109#0" expanded="false" />
</folding>
</state>
</provider>
@ -620,7 +597,10 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="522">
<caret line="40" column="35" selection-start-line="40" selection-start-column="35" selection-end-line="40" selection-end-column="35" />
<folding />
<folding>
<element signature="e#398#399#0" expanded="true" />
<element signature="e#443#444#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -654,7 +634,10 @@
<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 />
<folding>
<element signature="e#398#399#0" expanded="true" />
<element signature="e#443#444#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -662,7 +645,10 @@
<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 />
<folding>
<element signature="e#398#399#0" expanded="true" />
<element signature="e#443#444#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -670,7 +656,10 @@
<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 />
<folding>
<element signature="e#398#399#0" expanded="true" />
<element signature="e#443#444#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -678,7 +667,10 @@
<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 />
<folding>
<element signature="e#398#399#0" expanded="true" />
<element signature="e#443#444#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -686,7 +678,10 @@
<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 />
<folding>
<element signature="e#398#399#0" expanded="true" />
<element signature="e#443#444#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -694,7 +689,10 @@
<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 />
<folding>
<element signature="e#398#399#0" expanded="true" />
<element signature="e#443#444#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
@ -753,54 +751,13 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/euglena_basic_stimuli.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="536">
<caret line="332" column="18" selection-start-line="332" selection-start-column="18" selection-end-line="332" selection-end-column="18" />
<folding>
<element signature="e#0#16478#0" expanded="true" />
<element signature="imports" 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="2880">
<caret line="80" column="17" selection-start-line="80" selection-start-column="17" selection-end-line="80" selection-end-column="17" />
<folding>
<element signature="e#0#3781#0" expanded="true" />
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/lib/core.jar!/processing/core/PApplet.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="187665">
<caret line="6804" column="0" selection-start-line="6804" selection-start-column="0" selection-end-line="6804" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Camera.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="828">
<caret line="26" column="59" selection-start-line="26" selection-start-column="59" selection-end-line="26" selection-end-column="59" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1074#1075#0" expanded="true" />
<element signature="e#1108#1109#0" 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="108">
<caret line="3" column="12" selection-start-line="3" selection-start-column="12" selection-end-line="3" selection-end-column="12" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1074#1075#0" expanded="false" />
<element signature="e#1108#1109#0" expanded="false" />
</folding>
</state>
</provider>
@ -815,34 +772,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/EuglenaApplet.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="717">
<caret line="54" column="58" selection-start-line="54" selection-start-column="58" selection-end-line="54" selection-end-column="58" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ProjectorApplet.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="574">
<caret line="34" column="18" selection-start-line="34" selection-start-column="18" selection-end-line="36" selection-end-column="20" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#543#544#0" expanded="true" />
<element signature="e#602#603#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Ellipse.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="141">
<caret line="62" column="21" selection-start-line="62" selection-start-column="21" selection-end-line="62" selection-end-column="21" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ProjectorCommand.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
@ -851,6 +780,95 @@
</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="42" selection-start-line="1" selection-start-column="42" selection-end-line="1" selection-end-column="42" />
<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="97" column="41" selection-start-line="97" selection-start-column="41" selection-end-line="97" selection-end-column="41" />
<folding>
<element signature="e#0#3781#0" expanded="true" />
<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="108">
<caret line="3" column="12" selection-start-line="3" selection-start-column="12" selection-end-line="3" selection-end-column="12" />
<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="573">
<caret line="44" column="0" selection-start-line="44" selection-start-column="0" selection-end-line="44" selection-end-column="0" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#514#515#0" expanded="true" />
<element signature="e#573#574#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/euglena_basic_stimuli.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="392">
<caret line="424" column="17" selection-start-line="424" selection-start-column="17" selection-end-line="424" selection-end-column="17" />
<folding>
<element signature="e#0#16478#0" expanded="true" />
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Procedure.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 />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Ellipse.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="645">
<caret line="56" column="25" selection-start-line="56" selection-start-column="25" selection-end-line="56" selection-end-column="25" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar://$PROJECT_DIR$/lib/core.jar!/processing/core/PApplet.class">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="812">
<caret line="887" column="16" selection-start-line="887" selection-start-column="16" selection-end-line="887" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/EuglenaApplet.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="321">
<caret line="59" column="9" selection-start-line="59" selection-start-column="9" selection-end-line="59" selection-end-column="9" />
<folding>
<element signature="e#398#399#0" expanded="true" />
<element signature="e#443#444#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>

3
src/ClickGetter.java Normal file
View File

@ -0,0 +1,3 @@
public interface ClickGetter {
boolean click(int mouseX, int mouseY);
}

View File

@ -1,82 +1,80 @@
import processing.core.*;
import static processing.core.PApplet.*;
//class EllipseDrawer {
//
// Ellipse ellipseinprogress;
//
// boolean centerpointcomplete;
// boolean widthcomplete;
//
// void reset() {
// ellipseinprogress = new Ellipse(-1, -1, 0, 0);
// ellipseinprogress.visible = false;
// centerpointcomplete = false;
// widthcomplete = false;
//
// }
//
// EllipseDrawer(){
// this.reset();
// }
//
// void mouseClicked(ProjectorApplet p, float x, float y){
// if (!centerpointcomplete){
// ellipseinprogress.centerX = x;
// ellipseinprogress.centerY = y;
// centerpointcomplete = true;
//
// } else if (!widthcomplete) {
// ellipseinprogress.width = PApplet.abs(ellipseinprogress.centerX - x) * 2;
// widthcomplete = true;
//
// } else {
// ellipseinprogress.height = PApplet.abs(ellipseinprogress.centerY - y) * 2;
// ellipseinprogress.visible = true;
// //ellipses.add(ellipseinprogress);
//
// ellipseinprogress.draw(p);
// this.reset();
// }
// }
//}
class Ellipse {
float centerX, centerY, width, height;
int red, green, blue, brushSize;
int color, brushSize;
boolean visible;
Ellipse(float centerX, float centerY, float width, float height, int rVal, int gVal, int bVal, int penWidth) {
private boolean centerPointComplete, widthComplete;
Ellipse(int color, int penWidth) {
this.color = color;
this.brushSize = penWidth;
this.centerPointComplete = false;
this.widthComplete = false;
}
Ellipse(float centerX, float centerY, float width, float height, int color, int penWidth) {
this.centerX = centerX;
this.centerY = centerY;
this.width = width;
this.height = height;
this.red = rVal;
this.green = gVal;
this.blue = bVal;
this.color = color;
this.brushSize = penWidth;
this.visible = true;
this.centerPointComplete = true;
this.widthComplete = true;
}
void draw(ProjectorApplet projector) {
if (visible) {
projector.commandQueue.add(
(ProjectorApplet p) -> {
float old_strokeWeight = p.g.strokeWeight;
int old_strokeColor = p.g.strokeColor;
ProjectorCommand drawCommand() {
return (ProjectorApplet p) -> {
if (!visible) {
//done drawing already
return true;
}
p.ellipseMode(PApplet.CENTER);
p.strokeWeight(brushSize);
p.stroke(p.color(red, green, blue));
p.noFill();
float old_strokeWeight = p.g.strokeWeight;
int old_strokeColor = p.g.strokeColor;
p.ellipse(p.convertXCoord(centerX), p.convertYCoord(centerY),
p.convertXDistance(width), p.convertYDistance(height));
p.strokeWeight(old_strokeWeight);
p.stroke(old_strokeColor);
return true;
});
}
p.ellipseMode(CENTER);
p.strokeWeight(brushSize);
p.stroke(color);
p.noFill();
p.ellipse(p.convertXCoord(centerX), p.convertYCoord(centerY),
p.convertXDistance(width), p.convertYDistance(height));
p.strokeWeight(old_strokeWeight);
p.stroke(old_strokeColor);
return true;
};
}
ClickGetter clickGetter(ProjectorApplet p) {
return (int x, int y) -> {
if (!centerPointComplete){
centerX = x;
centerY = y;
centerPointComplete = true;
return false;
} else if (!widthComplete) {
width = abs(centerX - x) * 2;
widthComplete = true;
return false;
} else {
height = abs(centerY - y) * 2;
visible = true;
p.commandQueue.add(drawCommand());
return true;
}
};
}
}

View File

@ -12,6 +12,7 @@ public class EuglenaApplet extends PApplet {
// Software components
Menu menu;
Calibrator calibrator;
ClickGetter clickGetter;
boolean tester;
@ -52,12 +53,24 @@ public class EuglenaApplet extends PApplet {
image(camera.getImage(), 0, 0, width - menu.width, height);
if (!tester) {
new Ellipse(0f, 0f, 1000f, 1000f, 250, 250, 250, 8).draw(this.projectorApplet);
// this.projectorApplet.commandQueue.add(new Ellipse(0f, 0f, 1000f, 1000f, color(250, 250, 250), 8).drawCommand());
this.clickGetter = new Ellipse(color(255), 10).clickGetter(projectorApplet);
tester = true;
}
}
@Override
public void mouseClicked(){
if (clickGetter != null) {
if (clickGetter.click(mouseX, mouseY)) {
clickGetter = null;
}
}
}
void drawArrow(int cx, int cy, int len, float angle){
pushMatrix();
translate(cx, cy);

4
src/Procedure.java Normal file
View File

@ -0,0 +1,4 @@
public interface Procedure {
void execute();
}

View File

@ -1,7 +1,6 @@
import processing.core.PApplet;
import java.util.ArrayDeque;
import java.util.function.*;
class ProjectorApplet extends PApplet {
final int projectorScreenNumber = 2;
@ -32,10 +31,6 @@ class ProjectorApplet extends PApplet {
@Override
public void draw() {
// background(50);
// fill(255);
// ellipse(mouseX, mouseY, 10, 10);
calibrator.draw(parent);
while (!commandQueue.isEmpty()) {