classes-arjsan1's Introduction
Cityscape Lab # Introduction # The goal of this lab is for you to demonstrate that you can define classes, create objects, and display graphics via a Java application. # Requirements # * Commit to GitHub, at least daily, with a meaningful commit message describing what you accomplished and what needs to be done next. * Create a Java graphical application (with a Viewer class, Component class, and other classes) that displays a cityscape. * Complete each milestone and demonstrate to your instructor for feedback before continuing to the next milestone. * **Milestone #1** * design one class for an element of the cityscape (e.g., building, window, sun, moon, car, tree) * demonstrate good class design (encapsulation) * provide configurability through constructors and instance variables (size, color, etc.) * demonstrate this milestone to your instructor and receive feedback * **Milestone #2** * create multiple instances of at this class with different properties and display in the cityscape * demonstrate this milestone to your instructor and receive feedback * **Milestone #3** * design at least two additional classes, at least three in total, for elements of the cityscape (e.g., building, window, sun, moon, car, tree) * demonstrate good class design (encapsulation) * provide configurability through constructors and instance variables (size, color, etc.) * demonstrate this milestone to your instructor and receive feedback * **Milestone #4** * Animate at least one object in the cityscape. The animation must be purposeful, not random. This means that you must modify a property of an object and that object must persist across calls to the paintComponent method. * demonstrate this milestone to your instructor and receive feedback * Document all classes using JavaDoc comments as demonstrated in our [code template](https://drive.google.com/file/d/18U-gWhzdb5q6cDMV5up- e0itlunQtbrA/view?usp=sharing). Here is an example design class diagram to illustrate the relationship among the classes in this proj![image alt text](image_0.png) # Extensions # * Define additional classes for additional elements of the cityscape. * Randomize your cityscape (a different cityscape every time) * Add More Awesome. # Submission # * Submit a link to your GitHub repository for this assignment in Canvas. * If you would like your Cityscape Lab featured on the school TVs, take a short screencast of your animated cityscape and add it to the [shared Google slide deck](https://docs.google.com/presentation/d/ 1utgoGkeT80Y2CxREjxTef4jxy8t8YyU-UfQOvec37XQ/edit?usp=sharing) based on the provided template slide. https://docs.google.com/document/d/1lXPI4xs0Gn15SQr2bRSXQHGeqDjcgMHxWynYjRQCfKg/edit
classes-arjsan1's People
classes-arjsan1's Issues
A set method may be useful, but an even more useful method for the purpose of animation would be a move method which updates the position according to instructions provided through parameters.
Lines 64 to 68 in 42bf570
Javadoc comments are not updated from the template provided.
classes-ArjSan1/CityscapeComponent.java
Line 38 in 42bf570
A better assignment of responsibility for animation would be for the UFO class to encapsulate how its position is changed. Instead of the CityscapeComponent class having to keep track of positions, a single move method could be invoked with instruction on how to move.
classes-ArjSan1/CityscapeComponent.java
Lines 95 to 97 in 42bf570
I would recommend encapsulating windows within the Building class. The Building class should be responsible for drawing its own windows and then the paintComponent method wouldn't need to handle that. The code would be more reusable, there would be less code in paintComponent, and there would likely be fewer bugs.
classes-ArjSan1/CityscapeComponent.java
Lines 20 to 27 in 42bf570
You are inconsistently using the "this" keyword in your class. I suggest using it everywhere an instance variable is referenced, however, if you aren't going to use it you should be consistent and not use it anywhere.
classes-ArjSan1/CityscapeComponent.java
Lines 52 to 54 in 42bf570
Not necessary to add the type of object in the draw method name since the method will be called on a certain type of object anyway.
classes-ArjSan1/CityscapeComponent.java
Lines 71 to 80 in 42bf570
Nice work making your classes configurable and therefor more flexible and reusable!
classes-ArjSan1/CityscapeComponent.java
Lines 42 to 54 in 42bf570
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.