Build a graphical user interface to examine

Assignment Help Programming Languages
Reference no: EM133388771

Introduction
This assignment consists of three parts, each with their own weight in the final grade. You will create a model of a galaxy with stars and planets and build a graphical user interface to examine and if needed change it. The stars and planets are generated by another application and provided as .csv files.

You start by importing the provided Eclipse project. In it you will find some domain classes (Body, Star, Planet and Coordinate and a few helper classes and enumerations. Especially the enumerations contain a lot of information, read them!
Start the assignments from there. There also is a test set with Stars; use (a subset of) this to load data into the application. When required a much larger dataset is also available (but too large to put on the server.)
Assignment 1a
First implement a few generic utilities.
Open the class called MathUtil. Implement a static method which calculates the distance between two Bodies or subclasses thereof. Make the method itself inherently generic, do not trust on mere type checking.
Change the class Coordinate so it uses the new method.
Assignment 1b
The next thing to do is getting the data into collections. These collections need specific functionality.
StarCollection
Create a class called StarCollection. This collection only accepts subclasses of Body. When trying to add an already existing Body (as defined by the equals method of Body) it will not add it but return false.
When creating an object of this class it should read the .csv file provided as a (String) parameter and fill the collection with objects created from the file's contents.
Whenever adding a Star to the collection check that:
• The new star is not between 0.03 and 0.3 parsecs from an already existing star
• Not within 0.01 parsecs of an existing star
• Not within 0.3 parsecs of a double star
Whenever adding a star to the collection check whether it is within 0.1 parsecs of exactly one star which is not already a double star; if so, update both stars to reflect them being a double star.
Give the class methods to:
• Return a Set of stars of a given StarType (public Set<Star> x getStarList(StarType type)
• Give a Star with the given designation (public Star find(String designation) Use Delegation of Responsibility to implement this.

Adapting Planet
With the test set you will be able to fill the collection with all stars, but with the full set that is way too much. Internally you need to generate the planets whenever one is needed. The class Planet has a static method to generate a random planet for a star, which if given the same star with the same index and the same seed will yield the same planet all the time. Change this method so it no longer uses an explicit seed but derives it from properties of the star and the distance of the planet.
Add a method which gives a List of Planets, not just a single one. Use the data from the Enumeration StarType to determine how many planets to generate; assume the distance from the planet to the star doubles for each subsequent one1 and spread them over the whole distance (from minimum to maximum.)
PlanetCollection
Create a class called PlanetCollection. This class behaves like a Map<Star, List<Body>>. It is also possible to iterate over its keys without explicitly getting the keyset, so it implements Iterable<List<Body>, giving a list with at index 0 the star and then in order the planets in the star system.
When adding a Star to an object of this class it should only really store the star itself in its internal data, but when retrieving a value (as in myPlanetCollection.get(myStar) it will return a List with the (generated at that time) planets.
Use Delegation of Responsibility to implement this.
Assignment 1c
The current code needs to be tested. Create a class with a main method. Instantiate an object of the class StarCollection, which should mean the data from the file is loaded. Create an object of type PlanetCollection and add all stars to it.
Remove stars having either no planets or only planets of types R, T, Y from the planet collection. Remove stars having no planets from the star collection.

Reference no: EM133388771

Questions Cloud

Provide a brief justification for your rating : provide a brief justification for your rating, using support from the course material. Please limit your justifications for each topic to one paragraph.
What are the top 10 most important news stories : what are the top 10 most important news stories from the year 2000- today's date. Please number them 1-10 and explain (next to each choice) why you picked
Do you think europe has the advantage of moving goods faster : Do you think Europe has the advantage of moving goods faster because of its size? With Britain out of the European Union, how do you think that will play
How might you have handled the situation differently : What happens in the manufacturing of the required inputs that do not arrive at the right time or place? If you were the manager of Poppi's Pool Supplies
Build a graphical user interface to examine : Implement a static method which calculates the distance between two Bodies or subclasses thereof. Make the method itself inherently generic
What are the different types of raw materials : what are the different types of raw materials, work-in-progress, or finished garment identified in the Zara case that is either procured from suppliers
What impact do third parties have on elections : Who are some of the more notable third-party presidential candidates in American history. What impact do third parties have on elections.
Which of keatings presuppositions did you find most : Tell us a little about yourself: are you FR, SOPH, JUN, SEN,. what's your major or what major are you considering; overall education/career plans
Design experiment that will test whether technology affects : Design an experiment that will test whether technology (IV) affects people's social skills (DV). Make sure to include the four aspects

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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