Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
0e5ac1c
Reduced pen width for Pentagon Crazy.
joonspoon Jul 25, 2015
d09e434
Added setX and setY methods needed for StarShow.
Jul 25, 2015
d50a9a6
Fixing setX and setY.
Jul 25, 2015
fd63da9
Updated jar.
Jul 25, 2015
713993d
Adjusted setX and setY
DaveDisI Jul 28, 2015
8fe25fa
Merge remote-tracking branch 'origin/master'
DaveDisI Jul 28, 2015
dbdd9f3
Fixed setX and setY
DaveDisI Jul 28, 2015
af223fc
Fixed Pen Line Glitch
DaveDisI Jul 29, 2015
fbc23ad
deleted main method for testing
DaveDisI Jul 29, 2015
1aa7ab5
added tLoAP image to background
DaveDisI Aug 2, 2015
b8b89f6
Moved photo and resized
Aug 3, 2015
18939d0
Update 8/3/15
DaveDisI Aug 4, 2015
d79caca
Update 8/4/15 (see previous update for more)
DaveDisI Aug 4, 2015
ed5e3bb
8/5/15
DaveDisI Aug 6, 2015
70abf85
Updated Jar
DaveDisI Aug 27, 2015
a58bddd
Updated as per June's Request
DaveDisI Aug 28, 2015
eec9556
1) Cropped league logo
ecolban Aug 29, 2015
1610958
Small corrections
ecolban Aug 29, 2015
b513e89
Used a BlockingQueue to synchronize the main thread and the EDT, rather
ecolban Aug 30, 2015
81d1341
Used a blocking queue to synchronize the main thread with the EDT rather
ecolban Aug 30, 2015
ade122f
Fixed problem with sparkles outside of the robot image, when robot is
ecolban Aug 31, 2015
e0963a4
Fixed problem of window not built yet when asking for window.getWidth()
ecolban Aug 31, 2015
9b52ca3
Better way of fixing the last fix. "Kids' style" formatting applied.
ecolban Aug 31, 2015
5673203
Refactoring only
ecolban Aug 31, 2015
e418e7c
Modest refactoring
ecolban Sep 2, 2015
8242a69
Placed all images in a resource folder (named "res").
ecolban Sep 3, 2015
c358724
Added KeyboardAdaptor
ecolban Oct 13, 2015
6b02d9a
Added a KeyboardAdapter and an example of how it can be extended with
ecolban Oct 14, 2015
6c3ee4e
Added more flexibility w.r.t. KeyboardAdapter and multi-threading.
ecolban Jan 6, 2016
14c0d99
Added a README file and further examples.
ecolban Jan 11, 2016
a9ea06e
Minor correction in README file.
ecolban Jan 11, 2016
ad6a942
Small corrections to README.
ecolban Jan 11, 2016
f5cb457
Missing files in jar has been added.
ecolban Jan 11, 2016
543e0f0
More examples
ecolban Jan 11, 2016
da3c0a2
Added more examples. Replaced logo image with better image.
ecolban Jan 13, 2016
cdae719
Add composition example
ecolban Feb 8, 2016
eb3cf1a
Merge fork back into master
Mar 19, 2016
24f2a68
changeRobot now takes an image URL
DaveDLeague Jul 11, 2016
bed50fe
Deleted File
DaveDLeague Jul 11, 2016
ce50fe2
Made Driver.java more similar to MyRobot.java
Jul 14, 2016
000aae7
Recompile Robot.jar with java 7
Aug 25, 2016
9a7ec93
Merge branch 'master' of https://github.com/ecolban/Robot
Aug 25, 2016
3763059
Make addKeyboardAdapter an instance method
Jul 14, 2016
9856330
Merge pull request #7 from ecolban/m1
jointheleague-it Aug 27, 2016
a6a4934
Merge pull request #5 from DaveDLeague/master
jointheleague-it Aug 27, 2016
4298a40
Remove unused import
Sep 5, 2016
759c246
Merge pull request #8 from ecolban/master
jointheleague-it Sep 10, 2016
fce7e41
Updated .jar
Sep 10, 2016
890e288
added ability to change window background image
DaveDLeague Jul 28, 2017
ed1033d
Add files via upload
DaveDLeague Aug 3, 2017
086c781
Delete Robot.jar
DaveDLeague Aug 3, 2017
a6fbb29
Add files via upload
DaveDLeague Aug 3, 2017
f4e83aa
Add files via upload
DaveDLeague Aug 3, 2017
3a10567
added getX and getY and setWindowSize. Speed now goes to 100.
Aug 9, 2017
7c29818
Add doc
ecolban Dec 7, 2017
0067746
Merge branch 'master' of https://github.com/jointheleague/Robot
ecolban Dec 7, 2017
3782386
Synchronize Robot state
ecolban Dec 26, 2017
d60fafa
Rename WasdKeyboardAdapter.java
ecolban Dec 26, 2017
2ecd8a6
Reformat code
ecolban Dec 28, 2017
3e94e14
Update jar/robot.jar
ecolban Dec 28, 2017
c017803
Regenerate javadoc
ecolban Dec 30, 2017
a3b6299
Merge pull request #2 from ecolban/PR1
keithagroves Jan 6, 2018
68da2fd
Add RobotInterface.java
Aug 19, 2018
a938bb6
Add RobotInterface.java
Aug 19, 2018
7b6b879
Regenerate javadoc
Aug 27, 2018
2abc330
Merge pull request #3 from ecolban/master
keithagroves Aug 28, 2018
a2fb513
Enhance examples
erikcolban Dec 17, 2018
ef2c47b
Merge pull request #4 from ecolban/examples
keithagroves Jan 1, 2019
f21c062
Add curves
erikcolban Dec 30, 2018
c1e75fb
Merge branch 'master' into curves
erikcolban Jan 4, 2019
c2958e7
Regenerate javadoc
erikcolban Jan 5, 2019
59f58e7
Update README.md
ecolban Jan 5, 2019
08b0acb
Update README.md
ecolban Jan 5, 2019
9d59438
Minor cleanup
erikcolban Jan 5, 2019
cb18f6f
Merge branch 'curves' of https://github.com/ecolban/Robot into curves
erikcolban Jan 5, 2019
795ef3b
Merge pull request #5 from ecolban/curves
keithagroves Jan 7, 2019
12c1dd7
Merge branch 'master' of https://github.com/jointheleague/Robot
Jan 11, 2019
f21f3a2
Add MIT licence
erikcolban Jan 21, 2019
92bbd4b
Merge pull request #6 from ecolban/master
keithagroves Jan 21, 2019
4e6bc43
Fix bugs
erikcolban Jan 22, 2019
eecee55
Add fill parameter to followPath
erikcolban Jan 29, 2019
9ba00ed
Merge pull request #7 from ecolban/master
keithagroves Jan 31, 2019
baf5455
Add fill parameter to followPath
erikcolban Jan 29, 2019
a5df795
Merge branch 'master' of https://github.com/jointheleague/Robot
erikcolban Feb 3, 2019
a25b14f
Update example 14
erikcolban Feb 3, 2019
316e81e
Update jar file with latest changes
erikcolban Feb 4, 2019
b8405bf
Merge pull request #8 from ecolban/master
keithagroves Feb 5, 2019
fcc5f4a
Add Robot method: turnTo
erikcolban May 8, 2019
184e358
Merge pull request #9 from ecolban/turnTo
keithagroves May 9, 2019
28eb519
Merge branch 'master' of https://github.com/jointheleague/Robot
Jun 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
302 changes: 299 additions & 3 deletions .settings/org.eclipse.jdt.core.prefs

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License

Copyright 2019 David Dunn & Erik Colban

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Project Description

This project allows novice programmers to experience a quick and easy start to programming. An example of a very simple program is as follows:

import Robot;

public class RobotExample
{

public static void main(String[] args) throws InterruptedException
{
Robot rob = new Robot();
rob.setSpeed(5);
rob.penDown();
rob.move(100);
rob.turn(90);
}
}


This program will bring up a window with the image of a robot in it. The robot moves 100 points while drawing a line, turns 90 degrees, and stops. With small variations, the programmer can make the robot make more intricate movements and draw more intricate patterns. `RobotExample1` and `RobotExample4` show examples slightly more complex. These examples also illustrate the use of for-loops.

A robot can also be controlled via the keys on the keyboard by adding a `KeyboardAdapter`. `RobotExample2` is a very small program, which lets the user control the robot via up, down, left and right arrow key presses. `ExtendedKeyboardAdapter` shows an extension of `KeyboardAdapter` that adds further commands that can be invoked through the key presses. In `RobotExample3`, the use of `ExtendedKeyboardAdapter` is illustrated. This example also shows how to use any image as the robot image.

More than one robot can be added to the window, which is illustrated by `RobotExample5`. This example also shows how to make the robots run simultaneously by letting the robots run in different threads.

`RobotExample6` shows how to control two robots separately from the keyboard using `ShiftKeyboardAdapter`s. When the user holds down the shift key, one robot reacts to the key events, otherwise the other robot reacts to the key events.

If a user wants to teach a `Robot` new tricks, it is possible to extend the `Robot` class and add new methods and/or override existing ones. This is illustrated by `MyRobot`, which can draw regular polygons. The usage is shown in `RobotExample8`. Alternatively to extension, composition may be used. The class `Driver` has a `Robot` instance and commands to the `Driver` instance are delegated to the `Robot` instance. The usage is illustrated by `RobotExample9`. As one can see, `RobotExample8` and `RobotExample9` are almost identical.

Robots don't necessary have to move in straight lines. `RobotExample11.java` illustrates the use of `quadTo()` and `cubicTo()` to make robots move along quadratic and cubic paths. `RobotExample12.java` illustrates the command `followPath()` that takes a `PathIterator` as argument.

# Importing the jar file

Download this [jar file](https://github.com/ecolban/Robot/blob/master/jar/robot.jar?raw=true) and add it to the build path of your project. This jar file also contains the API documentation in the folder named `doc`.








22 changes: 22 additions & 0 deletions Robot.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/bin" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="inheritedJdk" />
<orderEntry type="module-library" scope="TEST">
<library name="JUnit4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
32 changes: 32 additions & 0 deletions doc/allclasses-frame.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_144) on Fri Jan 04 21:41:47 PST 2019 -->
<title>All Classes</title>
<meta name="date" content="2019-01-04">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<h1 class="bar">All&nbsp;Classes</h1>
<div class="indexContainer">
<ul>
<li><a href="org/jointheleague/graphical/robot/curves/Close.html" title="class in org.jointheleague.graphical.robot.curves" target="classFrame">Close</a></li>
<li><a href="org/jointheleague/graphical/robot/curves/Cubic.html" title="class in org.jointheleague.graphical.robot.curves" target="classFrame">Cubic</a></li>
<li><a href="org/jointheleague/graphical/robot/curves/Drawable.html" title="interface in org.jointheleague.graphical.robot.curves" target="classFrame"><span class="interfaceName">Drawable</span></a></li>
<li><a href="org/jointheleague/graphical/robot/curves/DynamicPath.html" title="class in org.jointheleague.graphical.robot.curves" target="classFrame">DynamicPath</a></li>
<li><a href="org/jointheleague/graphical/robot/KeyboardAdapter.html" title="class in org.jointheleague.graphical.robot" target="classFrame">KeyboardAdapter</a></li>
<li><a href="org/jointheleague/graphical/robot/curves/Line.html" title="class in org.jointheleague.graphical.robot.curves" target="classFrame">Line</a></li>
<li><a href="org/jointheleague/graphical/robot/curves/Move.html" title="class in org.jointheleague.graphical.robot.curves" target="classFrame">Move</a></li>
<li><a href="org/jointheleague/graphical/robot/curves/Quad.html" title="class in org.jointheleague.graphical.robot.curves" target="classFrame">Quad</a></li>
<li><a href="org/jointheleague/graphical/robot/Robot.html" title="class in org.jointheleague.graphical.robot" target="classFrame">Robot</a></li>
<li><a href="org/jointheleague/graphical/robot/Robot.Pos.html" title="class in org.jointheleague.graphical.robot" target="classFrame">Robot.Pos</a></li>
<li><a href="org/jointheleague/graphical/robot/RobotImage.html" title="class in org.jointheleague.graphical.robot" target="classFrame">RobotImage</a></li>
<li><a href="org/jointheleague/graphical/robot/RobotInterface.html" title="interface in org.jointheleague.graphical.robot" target="classFrame"><span class="interfaceName">RobotInterface</span></a></li>
<li><a href="org/jointheleague/graphical/robot/RobotWindow.html" title="class in org.jointheleague.graphical.robot" target="classFrame">RobotWindow</a></li>
<li><a href="org/jointheleague/graphical/robot/curves/Segment.html" title="interface in org.jointheleague.graphical.robot.curves" target="classFrame"><span class="interfaceName">Segment</span></a></li>
</ul>
</div>
</body>
</html>
32 changes: 32 additions & 0 deletions doc/allclasses-noframe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_144) on Fri Jan 04 21:41:47 PST 2019 -->
<title>All Classes</title>
<meta name="date" content="2019-01-04">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<h1 class="bar">All&nbsp;Classes</h1>
<div class="indexContainer">
<ul>
<li><a href="org/jointheleague/graphical/robot/curves/Close.html" title="class in org.jointheleague.graphical.robot.curves">Close</a></li>
<li><a href="org/jointheleague/graphical/robot/curves/Cubic.html" title="class in org.jointheleague.graphical.robot.curves">Cubic</a></li>
<li><a href="org/jointheleague/graphical/robot/curves/Drawable.html" title="interface in org.jointheleague.graphical.robot.curves"><span class="interfaceName">Drawable</span></a></li>
<li><a href="org/jointheleague/graphical/robot/curves/DynamicPath.html" title="class in org.jointheleague.graphical.robot.curves">DynamicPath</a></li>
<li><a href="org/jointheleague/graphical/robot/KeyboardAdapter.html" title="class in org.jointheleague.graphical.robot">KeyboardAdapter</a></li>
<li><a href="org/jointheleague/graphical/robot/curves/Line.html" title="class in org.jointheleague.graphical.robot.curves">Line</a></li>
<li><a href="org/jointheleague/graphical/robot/curves/Move.html" title="class in org.jointheleague.graphical.robot.curves">Move</a></li>
<li><a href="org/jointheleague/graphical/robot/curves/Quad.html" title="class in org.jointheleague.graphical.robot.curves">Quad</a></li>
<li><a href="org/jointheleague/graphical/robot/Robot.html" title="class in org.jointheleague.graphical.robot">Robot</a></li>
<li><a href="org/jointheleague/graphical/robot/Robot.Pos.html" title="class in org.jointheleague.graphical.robot">Robot.Pos</a></li>
<li><a href="org/jointheleague/graphical/robot/RobotImage.html" title="class in org.jointheleague.graphical.robot">RobotImage</a></li>
<li><a href="org/jointheleague/graphical/robot/RobotInterface.html" title="interface in org.jointheleague.graphical.robot"><span class="interfaceName">RobotInterface</span></a></li>
<li><a href="org/jointheleague/graphical/robot/RobotWindow.html" title="class in org.jointheleague.graphical.robot">RobotWindow</a></li>
<li><a href="org/jointheleague/graphical/robot/curves/Segment.html" title="interface in org.jointheleague.graphical.robot.curves"><span class="interfaceName">Segment</span></a></li>
</ul>
</div>
</body>
</html>
122 changes: 122 additions & 0 deletions doc/constant-values.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_144) on Fri Jan 04 21:41:47 PST 2019 -->
<title>Constant Field Values</title>
<meta name="date" content="2019-01-04">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Constant Field Values";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Constant Field Values" class="title">Constant Field Values</h1>
<h2 title="Contents">Contents</h2>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">Frames</a></li>
<li><a href="constant-values.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
Loading