|
|||||||||
PREV NEXT | FRAMES NO FRAMES |
xtras
package and the
Change Log for the
entire library.
See:
Description
Packages | |
---|---|
becker.gui | Classes to help create graphical user interfaces. |
becker.robots | Karel the Robot provides a gentle introduction to object-oriented programming via a simple robot which can move, turn left, pick things up, transport them and put them down again. |
becker.robots.icons | Icons used to display robots, intersections, and other things in the robot world. |
becker.util | Provides generally useful utilities for beginning programmers. |
becker.xtras.comboLock | The comboLock package provides a graphical user interface (GUI) for a
combination lock that uses an instance of
a student-written class implementing the
IComboLock interface. |
becker.xtras.gasPump | The gasPump package provides a graphical user interface (GUI) for a gas pump that uses three instances of
a student-written class implementing the
IMeter interface. |
becker.xtras.grapher | The grapher package provides a graphical user interface to graph mathematical functions which
implement one of three Java interfaces: IFunction ,
IQuadraticFunction ,
or IPolynomialFunction . |
becker.xtras.hangman | Provides a graphical user interface (GUI) for a game of Hangman that
uses an instance of a student-written class implementing the IHangman interface. |
becker.xtras.imageTransformation | The imageTransformation package provides a graphical user interface (GUI) for a student-written class to transform images using a two-dimensional array of integers. |
becker.xtras.jotto | Jotto is a game program where students may contribute some of the code. |
becker.xtras.marks | Provides a graphical user interface (GUI) for a student-written class to maintain assignment marks in a two-dimensional array. |
becker.xtras.nameSurfer | NameSurfer graphs names and their popularity over time as gathered from United States Social Security Administration data. |
becker.xtras.radio | Provides a graphical user interface (GUI) for an AM/FM radio using two instances of
a student-written class implementing the
ITuner interface. |
becker.xtras.tollBooth | The tollBooth package provides a graphical user interface (GUI) for a
highway toll booth simulation that uses an instance of a student-written class
implementing the ITollBooth
interface. |
A library in support of Java: Learning to Program with Robots, an
introductory Java programming textbook by Byron Weber Becker; see also the
Required Programming Skills
for projects in the xtras
package and the
Change Log for the
entire library.
The becker.xtras
packages include code designed to be used in assignments. Each
sub-package includes a graphical user interface that works with one or more
instances of a class or classes written by students (generally the model part
of the model-view-controller pattern). Classes written by students are always
specified by an interface.
The following table summarizes the programming skills each project is designed to exercise.
Key: |
|
Package | Using Objects | Inheritance | Instance Variables | 1D Arrays | GUIs | |||||||||
Using Multiple Instances | Control Structures | Collaborative Classes | 2D Arrays | |||||||||||
Writing Methods | Parameters | I/O | Polymor. | |||||||||||
robots (Level 1) |
^ | ^ | ||||||||||||
robots (Level 2) |
| | ^ | ^ | ^ | |||||||||
robots (Level 3) |
| | | | | ^ | ^ | + | + | |||||
comboLock |
(10-20-30) | | ^ | | ^ | |||||||||
gasPump |
| ^ | ^ | | ^ | |||||||||
radio |
| ^ | ^ | + | | ^ | + | |||||||
grapher |
| | | ^ | + | |||||||||
nameSurfer |
| | | | | ^ | ^ | ^ | + | |||||
hangman |
| | | | | | ^ | + | | + | + | |||
imageTransformation |
| | | | | ^ | ||||||||
jotto |
| | | + | | | | ^ | ^ | ^ | + | |||
marks |
| | | | | | | ^ |
Skills Summary
becker.xtras.tollBooth
to support lectures for Chapter 07.JFileChooser
,
allowing the user to easily choose an input file.becker.util.AbstractModel
to make implementing IModel
as painless as possible.daysUntil
method in becker.util.DateTime
to
return an int
instead of long
.DateTime.format()
method to use
constants set by setFormatLength
and setFormatInclude
instead of
passing constants as parameters to format
setColor
and getColor
to Icon
and Sim
, making the ability to color things nearly universal and easy.becker.util.Test
to facilitate using the class before class methods are discussed.daysBetween
from DateTime
.becker.xtras
full-fledged models from the Model-View-Controller pattern.new Robot(aCity, aStreet, anAvenue, aDirection)
becker.robots.Directions
with becker.robot.Direction
, an enumerated type.isBesideThing()
method in becker.robots.Robot
with canPickupThing()
, which better describes the question the method answers.City
to show itself in a frame. Elimintated CityFrame
.Icon
and subclasses to a subpackage, becker.robots.icons
, to reduce the clutter and distractions in the JavaDoc.Robot
a subclass of Sim
rather than Thing
.examineThing
with examineThings
, which returns an iterator, giving access to all the things rather than
just a random one. Added companion methods examineRobots
and examineLights
. This applies to Robot
, Intersection
, and City
.getRelativeSize
and setRelativeSize
in Icon
and subclasses. Added setColor
, getColor
, setTransparency
, and getTransparency
.getTransparency
and setTransparency
to the IColor
interface and the classes that implement it.City#City(Scanner)
to specify frame title, streets to display, etc.MazeCity
, an extension of City
that builds a maze with walls.becker.robots.Colorable
(superceded by IColorable
)becker.robots.ColoredIcon
(superceded by IColorable
)becker.robots.Labeled
(superceded by ILabeled
)becker.robots.Predicate
(superceded by IPredicate
)becker.util.FormLayout
(superceded by becker.gui.FormLayout
)becker.util.RowLayout
(superceded by becker.gui.RowLayout
)becker.xtras.FormLayout
(superceded by becker.gui.FormLayout
)becker.xtras.RowLayout
(superceded by becker.gui.RowLayout
)becker.xtras.LedDisplay
(superceded by becker.gui.LedDisplay
)set
methods and some static factory methods to DateTime
. Now properly overrides hashCode
.becker.xtras.hangman
package.becker.gui.JIntField
.Colored
and ColoredIcon
and merged them into IColorable
. Predicate
and added IPredicate
.Labeled
and added ILabel
.becker.xtras.grapher
package.Robot
public in RobotSE
.CompositeIcon
when used with icons having relativeSize <> 1.0Thing(Robot heldBy)
where the robot didn't actually end up holding the thing.Robot
, isBesideThing(Predicate.anyRobot)
always returned true
(because the robot is always beside itself), which is unintuitive and
has no easy work-around. isBesideThing
is implemented in terms of examineThing(Predicate p)
. Changed examineThing
to always explicitly exclude the robot itself.becker.xtras.jotto
; improvements to documentation.getSpeed()
and setSpeed()
in Robot
were unintuitive expressed as milliseconds per move. To speed things up
by a factor you divided and to slow down you multiplied. Changed them to be
measured in seconds per move. Now, to go twice as fast, write this.setSpeed(this.getSpeed()*2)
.ckIsBetween(...)
methods to becker.util.Test
.City
from a text file and fixed a bug causing that constructor to hang if
the last line did not include a carriage return.becker.xtras.gasPump
.becker.xtras.comboLock.Demo
to DemoComboLock
to avoid duplicate names in the JavaDoc listing of all classes.
Similarly for the grapher
, imageTransformation
, marks
, and radio
packages.becker.xtras.FormLayout
, becker.xtras.RowLayout
, and becker.xtras.LedDisplay
to becker.gui
and deprecated the originals. Last time they move, I promise!becker.xtras.jotto
package to support array-based homework assignments.becker.robots.Intersection
public rather than private: countThings()
, countThings(Predicate)
, and examineThing(Predicate)
.TextInput
.becker.util.FormLayout
and becker.util.RowLayout
to becker.xtras
.becker.xtras.LedDisplay
to simulate light emitting diode diasplays commonly found on clocks and
radios.becker.xtras.radio
, a GUI simulating an AM/FM radio; students provide two instances of the
interface ITuner
.becker.xtras
so students can easily see an example of what they should
implement.AppletRunner
class to make it quick and easy to run a robot program as an
applet.move(int)
, turnLeft(int)
, and turnRight(int)
are positive. TextInput
where calling skipSpaces
twice in a row left the file cursor in a wrong state.clone
and equals
to DateTime
. becker.xtras.jotto
. Fixed.daysBetween
method to the becker.util.DateTime
class. Test.ckEquals(String, Object, Object)
where it did not handle two null objects correctly.KarelFrame
.CityFrame
to control title, size, and location.RobotsUI
to RobotUIComponents
and added accessor methods making customized graphical interfaces much
easier to build.Predicate
s back in the Predicate
class rather than distributing them to many classes.imageTransformation
sample solution that rotates the image.numThings
parameter to RobotRC
and RobotSE
-- to match the new constructor added to Robot
some time ago.becker.io.TextInput
where readInt
sometimes returned the same number twice in a row.becker.xtras.imageTransformation
to be more consistent with class names.
Restructured the ImageTransformerGUI
so that extraneous JFrame
methods don't show in the JavaDoc. Automatically loads a picture. Added
some new transformations.becker.xtras.marks
package.readWord
and wordIsAvailable
, replacing them with readToken
and tokenIsAvailable
due to student confusion over what constitutes a "word".readLine
so that it skips leading whitespace, making it consistent with all the
other read
X methods (except readChar
). Almost every time the issue has come up in class it is because readLine
was doing the wrong thing.
|
|||||||||
PREV NEXT | FRAMES NO FRAMES |