Chapter 4 Drawing and Image processing with Java - the Tuttle class

This chapter will introduce a class which implements a style of graphical output known as turtle graphics. In this style of graphics it is imagined that a turtle, or other small creature, is crawling across the surface of the screen and sometimes leaving a trail as it goes. Instructions such as crawl forward, or backwards, so many steps; turn right, or left, so many degrees or pull your pen up, or down, can be given to the turtle and result in the expected output being produced on the screen. Due to a typing error during a project involving turtle graphics several years ago these became known as tuttle graphics to the author and the name has stayed.

In the previous chapter the Canvas class was extended to produce specialised interface components and the Tuttle class will be similarly produced in this chapter. To enable sophisticated components to be produced Java's drawing facilities will have to be understood in greater detail, and the implementation of Tuttle graphics will more than satisfy this requirement. This will also afford an opportunity for an introduction to the algorithmic manipulation of images to be provided. As this book is only a primer these introductions will necessarily only provide an initial understanding and competence. The intention is that they will be sufficient for more advanced discussions of these topics to be approached, suggestions concerning suitable references are made in Appendix A.

The Tuttle class is also being developed at this stage so that various different styles of user interfaces, which will be used to control the Tuttle, can be introduced in the chapters which follow. It may be that the details of Java's graphical capabilities are found very complex when they are considered for the first time. If this is the case then the details can be glossed over and all that needs to be understood for the chapters which follow are the public features of the Tuttle class and how to use them.


4.1 The public resources of the Tuttle class

Table of Contents.




A Java GUI programmer's primer
Java GUI Programmers Primer, A
ISBN: 0139088490
EAN: 2147483647
Year: 1998
Pages: 85
Authors: Fintan Culwin

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net