Index of /~torsjark/undervisning/java/program/bluej/examples/shapes

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory   -  
[   ]Canvas$1.class 2004-10-26 16:00 159  
[   ]Canvas$CanvasPane.class2004-10-26 16:00 681  
[   ]Canvas$ShapeDescript..>2004-10-26 16:00 713  
[   ]Canvas.class 2004-10-26 16:00 3.7K 
[   ]Canvas.ctxt 2003-10-16 14:38 3.1K 
[TXT]Canvas.java 2003-10-16 14:38 6.7K 
[   ]Circle.class 2004-10-26 16:00 2.0K 
[   ]Circle.ctxt 2003-10-16 14:38 2.4K 
[TXT]Circle.java 2005-10-21 11:44 3.5K 
[TXT]README.TXT 2003-10-16 14:38 1.5K 
[   ]Square.class 2003-10-16 14:38 2.3K 
[   ]Square.ctxt 2003-10-16 14:38 2.4K 
[TXT]Square.java 2003-10-16 14:38 3.1K 
[   ]Triangle.class 2003-10-16 14:38 2.5K 
[   ]Triangle.ctxt 2003-10-16 14:38 2.5K 
[TXT]Triangle.java 2003-10-16 14:38 3.3K 
[   ]bluej.pkg 2003-10-16 14:38 905  
[   ]bluej.pkh 2003-10-16 14:38 906  
[   ]semantic.cache 2005-10-21 12:28 3.9K 

Project "shapes"
Authors: Michael Kolling and David J. Barnes

This project is part of the material for the book

   Objects First with Java - A Practical Introduction using BlueJ
   David J. Barnes and Michael Kolling
   Pearson Education, 2002

It is discussed in chapter 1.

This is a very simple project to demonstrate some characteristics of
objects.

You can create various shapes, and you will see, if you do, that those
shapes are drawn on screen (in a window that we call the "canvas").

You can then manipulate these objects: change their position, size and 
colour. Try it out: create a few different squares, triangles and circles.

This project is designed as a first example of object-oriented programming.
It illustrates a number of concepts:

 - a Java project (application) is a collection of classes
 - objects can be created from classes
 - from any one class, many objects may be created
 - objects have operations (methods)
 - operations can have parameters
 - parameters have types (at least String and int)
 - objects hold data (fields)
 - the operations and fields are common to all objects
 - the values stored in the fields can be different for each object

The project also demonstrates

 - BlueJ object creation
 - interactive method invocation
 - parameter passing

A good second project to look at after this is "picture", which adds a class
to those ones in this project. That class (named "Picture") uses the shapes
to draw a picture. It can be used to experiment with coding.

Michael Kolling, July 2000