Purchase Solution

Java Programming: Simple class hierarchies

Not what you're looking for?

Ask Custom Question

I need help to implent implement the four classes:

class DataItem; partially implemented abstract base class of hierarchy; defines data members for common data elements; provides common functionality;
class PictureDataItem; concrete class for Image based data items;
class SoundDataItem; concrete class for Sound based data items;
class TextDataItem; concrete class for Text based data items;

Tracer statements.
Can you incorporate tracer statements in a the methods of the classes that you write.

----------------------------------------------------------------------------------

For more information theres a readme.txt

The main Java framework code is supplied, I need help!!!!!!!!! to implement the
DataItem hierarchy.

A2.java
Driver program.
Creates the other elements, displays GUI.

Run:
java A2 data.txt
where data.txt is data file with text defining the background picture
and the various data items.

A2Control.java
Code that deals with user inputs via mouse (mouse motions
and mouse clicks). These results in calls to A2Model where
check if mouse in an active region and respond appropriately.

A2Display.java
A very simple GUI - canvas in scrollpane (AWT library).

A2Model.java
The data! An instance of this class will own an image (the
background image for the display) and a collection of data items.
It has an input function that reads the lines in the data file
that specify the type of the next data item; the appropriate item
is created (Java 'reflection' style) and told to read its data.
The input function builds the collection of items. The other functions
in this class perform tasks like checking whether a data item
has been clicked, and choosing an appropriate cursor.

CursorCollection.java
Code to create cursors from GIF images and make these
available by name.

DataItem.java
Uhm - well actually you have to write this; this "code" is
fragmentary.

MyCanvas.java
Display area linked to underlying data - arranges that data
is drawn at appropriate times. (Here, the data is just the
background image)

PictureDialog.java
See TextDialog, but this is for pictures

TextDialog.java
Intended for use from the display function in TextDataItem
Constructor takes reference to "frame", a title, and a Vector<String>
collection of text; should create a new TextDialog, make it visible,
it will display until its window closed.

images/
Directory with a few "GIF" images that could be used for cursors
Also a place to put own images

sounds/
Place to put sound files

data.txt
Dummy file providing some suggestion as to form of a data file

cursors.txt
File with names and references to cursor gif files

Attachments
Purchase this Solution

Solution Summary

The expert examines Java Programming simple class hierarchies. Incorporate tracer statements are examined.

Purchase this Solution


Free BrainMass Quizzes
Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

C# variables and classes

This quiz contains questions about C# classes and variables.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.