Java graphic application, JAVA Programming

Assignment Help:

I need to draw cars and trucks and background with road and a house with sky.

I have to use Vehicle class as a parent class. To draw pictures, i should draw fun things coming up with different drawings. the problem is that it is a "hard code".

I need to create a car class and a truck class as a children of Vehicle class.

the following UML classes shows the required elements in each class:

Vehicle class contains:

-x:int

-y:int

-color: Color

+Vehicle(in x:int, in y:int, in c:Color)

>>> Vehicle class to represent an automobile. there are 2 types of automobile: "car" and "truck". the draw method uses these values to draw the corresponding object.

>>> the draw() method is responsible of all the drawings of the Vehicles. it contains all the logic for drawing.

Car Class Contains:

-doors: int

+draw(in g:Graphics)

+Car(in x: int, in y: int, in c c:Color, in d: int)

+move()

>>> the move() methods move the car across the screen. it simply update the position of the car.

Truck Class Contains:

-type: string

+move()

+draw(in g: Graphics)

+Truck(in x: int, in y: int, in c:Color, in type: string)

DrawPanel Class Contains:

+paintComponent(in g: Graphics)

>>> the drawpanel class should contain Timer object that is responsible of making things move of all Vehicles that i create.

TestDraw class contains nothing its only runs the classes.


Related Discussions:- Java graphic application

What should be output of above code, Number = new Array(5); var abc=4; for(...

Number = new Array(5); var abc=4; for(var i=1; i { Number[i]= abc*i; } Number.reverse(); for(j=0;j { document.write(" "+Number[j]+" "); } A) What should be output of above co

What is jdbc exactly, What is JDBC exactly? Describe the steps required to ...

What is JDBC exactly? Describe the steps required to execute a SQL query using JDBC.

What is dynaactionform, A specialized subclass of ActionForm that permits t...

A specialized subclass of ActionForm that permits the creation of form beans with dynamic sets of properties (configured in configuration file), without requiring the developer to

Give the details of xml files used in validator framework, Two XML configur...

Two XML configuration files are uses by The Validator Framework validator-rules.xml and validation.xml. The validator-rules.xml shows the standard validation routines, these are re

COMPRE METHOD, Implement the compare method of the following class Rectangl...

Implement the compare method of the following class RectangleComparator. The method compares two rectangles. The method should return: A positive integer if the area of the first r

What is actionform, An ActionForm is a JavaBean that extends org.apache.str...

An ActionForm is a JavaBean that extends org.apache.struts.action.ActionForm.  ActionForm handles the session state for web application and the ActionForm object is automatically p

Make a function in java script and compare with ten, Write JavaScript code ...

Write JavaScript code for the following: Make a function compare With Ten (value) Compare the function argument along with ‘10' and display a message while the value is le

Explain the term naming packages in details, Explain the term Naming Packag...

Explain the term Naming Packages in details? As you saw previously name space conflicts arise if two pieces of code declare the similar name. Java remains track of what belongs

What is the role of fonts in java explain with example, What is the role of...

What is the role of fonts in java explain with example? You've already seen one instance of drawing text in the HelloWorldApplet program of the last chapter. You call the drawS

Assignments, Define a function that will take a box type of object as argum...

Define a function that will take a box type of object as argument and return a box object whose dimension is 10 times more than the object

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd