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

Encapsulation, Defines to keeping all the related members together in an ob...

Defines to keeping all the related members together in an object. Specifying member variables as private may hide the methods and variables. Objects should hide their inner working

Illustrate an example to define a student class, Task - Defining a Student ...

Task - Defining a Student class The below illustration will explain how to write a class. We want to write a "Student" class which - should be able to store the below charac

Project 7, Iterate through list of Fish. For each fish that isAlive, do th...

Iterate through list of Fish. For each fish that isAlive, do the following: * * 1. If this fishIsSurroundedByRocks, DO NOTHING, and move on to the next fish. * (This f

Why local variable is preferred over global variable, Why Local variable is...

Why Local variable is preferred over Global variable ? In my point of view Global variable has a few advantage along with Local variables is preferred because of the subsequent

Program to find prime number from linked list, For this assignment you are ...

For this assignment you are provided with a class called LNode which can be used as a list node for a linked list of ints. You are also provided with an abstract class called LList

Gui-based event-driven application program, GUI-Based Application Object...

GUI-Based Application Objectives:   (1)   Learning how to write a GUI-based application in Java. (2) Learning how to write an event driven application program in Java.

What is rmi, RMI is a set of APIs that permits to build distributed applica...

RMI is a set of APIs that permits to build distributed applications. RMI uses interfaces to explain remote objects to turn local method invocations into remote method invocations.

#, Consider the following code? What input is needed for x in order for the...

Consider the following code? What input is needed for x in order for the sum variable that is output at the end of the code to be 12 ? (In other words: what do I need to make X be

Define the key weakness of the web, Define the key weakness of the web? ...

Define the key weakness of the web? the key weakness of the web is Initially web was designed only for humans to read not for computers to understand it.

Describe the life cycle methods of a jsp? , 1. Pre-translated: Before the...

1. Pre-translated: Before the JSP file has been compiled and translated into the Servlet. 2. Translated: The JSP file has been compiled and translated as a Servlet. 3. I

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