Welcome to the Jython Environment for Students (JES), Version 3.1! We have made several changes since our last release, so take a look around. Some of these changes were implemented thanks to work done at Kalamazoo College. All changes in this version are listed below. Environment --JES now runs using the latest version of Jython, version 2.2.1, which comes included with JES. --JES also comes packaged with the latest Java JRE. --The homework assignment turn-in tool has been removed. --Redo functionality has been added to the program area to go along with Undo. --"true" and "false" constants have been added. --Color value wrap-around is now an option available under Edit-->Options. When turned on, RGB values outside the 0-255 range will be wrapped around using modulus division. When turned off, RGB values will be capped at 0 and 255. --Also available under Edit-->Options is a backup save function. When selected, JES will save a duplicate file in the same folder with the extension ".pybak". Input/Output --Python input() and raw_input() now present users with dialog boxes for input. --Unicode can no longer be created and printed simply by using "\u". The following code no longer works: >>> unicodeString = u"\u0061\u0062" >>> print unicodeString ab Instead use the following: >>> unicodeString = u"\u0061\u0062" >>> encodedString = unicodeString.encode('utf-8') #or some other codec >>> print encodedString ab This is a Python change, not a JES change. Files --setMediaPath() and setMediaFolder() can now take a directory path as input. The old functionality of sending no arguments and getting a file chooser still works. --Using getMediaPath() or getMediaFolder() with no arguments now returns the current media folder. --The new method setLibPath() adds a folder to the user's Python path, so that user-created modules can be imported. Like setMediaPath() and setMediaFolder(), this method works with no arguments or with a directory path as input. Pictures --There are four new methods for adding shapes to pictures: addArc(), addArcFilled(), addOval(), addOvalFilled() --Several methods now take a Color as an optional parameter. These include: addLine() addRect() addRectFilled() addText() addTextWithStyle() makeEmptyPicture() as well as the new methods listed above. --show() now repaints automatically. --getPixelAt() is a new method with the same functionality as getPixel() --The color setting methods (setRed(), setGreen(), setBlue()) now perform error checking if the Color Wraparound option is deselected. --The Color Wraparound option can be temporarily activated or deactivated within a program using setColorWrapAround() and getColorWrapAround(). --Color objects can now be added and subtracted. This is done by summing RGB values. RGB values outside 0-255 are handled by the Color Wraparound option. --crop() and a more sophisticated copyInto() are available when using Object-Oriented notation. These methods are not listed in the JES Functions menu. --The new explore() method will take a Picture object and open up the Picture Tool. Sounds --makeEmptySound() now takes a number of samples instead of a number of seconds. To create a sound in terms of seconds, use the new method makeEmptySoundBySeconds(). In addition, both methods optionally take a sampling rate as a parameter along with the duration. --getSample() and setSample have been replaced by getSampleValue() and setSampleValue(). --getNumSamples() is a new method that returns the number of samples in a sound, same as getLength(). --getDuration() is a new method that returns the length of the sound in seconds. --stopPlaying() is a new method that forces a sound to cease playback. --The new explore() method will take a Sound object and open up the Sound Tool. --copySoundInto() and cropSound() are available when using Object-Oriented notation only. These methods are not listed in the JES Functions menu. --The following six methods have been declared deprecated. Their functionality still exists within JES, but there is no further reference to them in our help files and documentation: playAtRate(), playAtRateDur(), playInRange(), blockingPlayInRange(), playAtRateInRange(), blockingPlayAtRateInRange() Movies --The new explore() method will take a Movie object and open up the Frame Sequencer Tool. --There is a new method for writing out movies. writeQuicktime() will write out movies in the MOV format. Turtles --turnToFace() can now take a turtle as input rather than (x,y) coordinates. --turn() now takes a floating point number rather than an integer as input. --New method getHeading() now returns the heading of the turtle in degrees. Debugging --The ability to pause and step through code using the Watcher has been disabled. --The method showVars() has been reintroduced. When called, a new window will appear, showing the value and type of any variable available in the command area.