Global Earthquake Monitor. This project based on Java Project. It is real time working project. This project used OOPs concept.
World earthquake shown in map with magnitude, date, time, length, affected area.
Presentation of webinar "Overview of Function Point Analysis"
On this webinar we investigated on a very high-level estimation in function points. It is introductory webinar and it provides basics on this estimation method. During the webinar we went over following topics:
Theoretical information on FP (Project estimation model, History, Concept, Pro and Con);
Practical information of FP (Application Boundary, Type of count, Application Elements and transactions, Formulas, Non-functional requirements);
Examples and Exercises;
Next steps and recommended materials.
Automated Driver Fatigue Detection and Road Accident Prevention System: An Intelligent Approach to Solve a Fatal Problem. At least 4,284 people, including 516 women and 539 children, were killed and 9,112 others were injured in 3,472 road accidents across Bangladesh in 2017. Some of those accidents could have been avoided if proper systems were implemented at the time. This project focuses on creating a system based on EEG (Electroencephalogram) and ECG (electrocardiogram) signal from driver which will alert a driver about drowsiness while driving.
Presentation of webinar "Overview of Function Point Analysis"
On this webinar we investigated on a very high-level estimation in function points. It is introductory webinar and it provides basics on this estimation method. During the webinar we went over following topics:
Theoretical information on FP (Project estimation model, History, Concept, Pro and Con);
Practical information of FP (Application Boundary, Type of count, Application Elements and transactions, Formulas, Non-functional requirements);
Examples and Exercises;
Next steps and recommended materials.
Automated Driver Fatigue Detection and Road Accident Prevention System: An Intelligent Approach to Solve a Fatal Problem. At least 4,284 people, including 516 women and 539 children, were killed and 9,112 others were injured in 3,472 road accidents across Bangladesh in 2017. Some of those accidents could have been avoided if proper systems were implemented at the time. This project focuses on creating a system based on EEG (Electroencephalogram) and ECG (electrocardiogram) signal from driver which will alert a driver about drowsiness while driving.
Autonomous drone - indoor navigation
Lightweight frame design
Indoor Wi-Fi repeater with maximum coverage
GPS integration
Direction detection by compass
Calibration by Gyroscope
Halstead's software science - ananalytical techniqueVishnupriya T H
One of the project estimation technique in analytical estimation technique is Halsteads Software Science. Halstead's Technique measure 1) size, 2) Development effort, 3) Development cost
Activities During Software Project Management, Process For Successful Projects, categories of functional units, Counting function points, Computing function points
A report on SOS App For Android platform,AN ANDROID APPLICATION FOR EMERGENCIES/The aim of the project is to develop an Android application that lets its users to send notifications in case of an emergency or a panic situation. The users can send multiple text messages and emails on the press of a single button. The phone numbers, email ids and the contents of the text and email messages can be set from within the application. The text messages and emails sent, along with the content, also have the last known location of the user. This is very helpful in tracking the whereabouts of the person. The user can also call 911 directly from within the application, if the nature of the situation demands it.
project on smart car parking. automatic bill generation technique. individual timer system to calculate time. even odd day wise parking as per parking rule by government of india
Back-end and front-end development are two distinct but interconnected components of web development. Understanding their differences and roles is fundamental for anyone entering the field.
Autonomous drone - indoor navigation
Lightweight frame design
Indoor Wi-Fi repeater with maximum coverage
GPS integration
Direction detection by compass
Calibration by Gyroscope
Halstead's software science - ananalytical techniqueVishnupriya T H
One of the project estimation technique in analytical estimation technique is Halsteads Software Science. Halstead's Technique measure 1) size, 2) Development effort, 3) Development cost
Activities During Software Project Management, Process For Successful Projects, categories of functional units, Counting function points, Computing function points
A report on SOS App For Android platform,AN ANDROID APPLICATION FOR EMERGENCIES/The aim of the project is to develop an Android application that lets its users to send notifications in case of an emergency or a panic situation. The users can send multiple text messages and emails on the press of a single button. The phone numbers, email ids and the contents of the text and email messages can be set from within the application. The text messages and emails sent, along with the content, also have the last known location of the user. This is very helpful in tracking the whereabouts of the person. The user can also call 911 directly from within the application, if the nature of the situation demands it.
project on smart car parking. automatic bill generation technique. individual timer system to calculate time. even odd day wise parking as per parking rule by government of india
Back-end and front-end development are two distinct but interconnected components of web development. Understanding their differences and roles is fundamental for anyone entering the field.
This program is designed for the use of LibraryManagement System and its functioning Main Objective of this project to facilitate the transactions through use of electronic medium. We use java netbeans 6.5.1 software and Mysql to programming our project.
Hi There, This Synopsis report is Implemented by Umang Saxena,Sakshi Sharma and Ronit Shrivastava of IT Branch,SVVV Indore.This will help for those students who wants to make a good and effective report regarding to any topic.
Thank you
Warm regards
Ball Collecting Game is an OpenGL based 2D game. It consists of a player in an
environment where Coins (coloured circles) are falling from sky. If the player collides with
any of the Coins then Score of player increased by 1. The player’s score is the no. of Coins
collected by him/her.
RFID Technology - Electronics and Communication Seminar TopicHimanshiSingh71
RFID Technology - Electronics and Communication Seminar Topic.
Radio Frequency Identification. Active tag and passive Tag
Scope of rfid. Current uses of RFID Technology. Applications.
Automatic Car Number Plate Detection and Recognition using MATLABHimanshiSingh71
Car Number Plate Recognition and Detection (ANPRD) using MATLAB. This is MATLAB based project.
Take an input from user than convert it into gray scale image and then applying morphological operations and many more functions.
Object Oriented Programming in Java & Project Global Earthquake Monitor. In this ppt there is data types ,overloading and overriding methods ,public vs private in java ,variable declaration and assignment.
E1 LINK IS EUROPEAN FORMAT ,Europe Line Rate
,E1 LINK, E1 VS T1 LINK, E1 SPECIFICATION, E1 ENCODING tECHNIQUES, high density bipolar , alternate marking inversion,itut,t1,e1 frame format
-Study of the functionality of 2MB mother board, providing E1 data interfaces
-CMS LAB,TEST EQUIPMENT, QUALITY CONTROL. - ABOUT BEL,ROTATIONAL PROGRAM.-FPGA,ADSP,DSO,VHDL.
-E1 EUROPEAN DATA FORMAT , LINK, SPECIFICATION
ENCODING TECHNIQUES- HDB3, AMI
In this, there are so many programs with their codes such as Simple Interest, Marksheet, Quadratic Equation, Loop condition, If-else statement, switch statement, series, formula, Converstion
MySQL two table queries
Function Queries - Select math function such as round ,pow e.t.c
How to insert , select, display , update, search from two table?
Java Database Connectivity
How to connect MySQL and NetBeans ?
Programming - how to insert data direct in MySQL
-How to search data direct from MySQL in Program
- How to delete data direct from MySQL In Program
- How to Updat Data Direct From MySQL in Program
“Role of the human value to improve the situation to protect the future of child (6 to 14 years).”
Child Labour is the practice of having children engage in economic activity, on a part- or full-time basis. The practice deprives children of their childhood, and is harmful to their physical and mental development . Poverty , lack of good schools and the growth of the informal economy are considered to be the key causes of child labour in India.
Child labour is a persisting social evil . A well nourished child is priceless asset of a nation . A child should be facilitated to grow in multiple dimensions to attain the physical and mental fitness . The society and the government have responsibility to create conducive environment for the healthy growth of a child.
The complex issue of child labour is a developmental issue worth investigating.
The notion that children are being exploited and forced into labour while not receiving education crucial to development , concerns many people . India is the largest example of a nation plagued by the problem of child labour.
Child labour is a source of income for poor families.
Airline reservation project using JAVA in NetBeans IDEHimanshiSingh71
This project is based on the database connectivity JDBC . In this application user can book airline flight . This is offline airline program in which the user can book and cancelled their flight and payment through credit and debit card .
User can take the information of different types of airline flight . In this application user can also see and take knowledge about the famous historical places without moving to another website .
This application is also secure from hacker.
Overall , this application is very much useful for users because they can do offline flight booking and it is secure application for booking flight and other purposes.
Automatic street light using LDR and TransistorHimanshiSingh71
It glows during night and switches off automatically as the sun rises. Street light which automatically gets turned on in the night and gets turned off in the morning or day time, there are sensors who senses the light and control the light accordingly.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
HEAP SORT ILLUSTRATED WITH HEAPIFY, BUILD HEAP FOR DYNAMIC ARRAYS.
Heap sort is a comparison-based sorting technique based on Binary Heap data structure. It is similar to the selection sort where we first find the minimum element and place the minimum element at the beginning. Repeat the same process for the remaining elements.
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...ssuser7dcef0
Power plants release a large amount of water vapor into the
atmosphere through the stack. The flue gas can be a potential
source for obtaining much needed cooling water for a power
plant. If a power plant could recover and reuse a portion of this
moisture, it could reduce its total cooling water intake
requirement. One of the most practical way to recover water
from flue gas is to use a condensing heat exchanger. The power
plant could also recover latent heat due to condensation as well
as sensible heat due to lowering the flue gas exit temperature.
Additionally, harmful acids released from the stack can be
reduced in a condensing heat exchanger by acid condensation. reduced in a condensing heat exchanger by acid condensation.
Condensation of vapors in flue gas is a complicated
phenomenon since heat and mass transfer of water vapor and
various acids simultaneously occur in the presence of noncondensable
gases such as nitrogen and oxygen. Design of a
condenser depends on the knowledge and understanding of the
heat and mass transfer processes. A computer program for
numerical simulations of water (H2O) and sulfuric acid (H2SO4)
condensation in a flue gas condensing heat exchanger was
developed using MATLAB. Governing equations based on
mass and energy balances for the system were derived to
predict variables such as flue gas exit temperature, cooling
water outlet temperature, mole fraction and condensation rates
of water and sulfuric acid vapors. The equations were solved
using an iterative solution technique with calculations of heat
and mass transfer coefficients and physical properties.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSveerababupersonal22
It consists of cw radar and fmcw radar ,range measurement,if amplifier and fmcw altimeterThe CW radar operates using continuous wave transmission, while the FMCW radar employs frequency-modulated continuous wave technology. Range measurement is a crucial aspect of radar systems, providing information about the distance to a target. The IF amplifier plays a key role in signal processing, amplifying intermediate frequency signals for further analysis. The FMCW altimeter utilizes frequency-modulated continuous wave technology to accurately measure altitude above a reference point.
6th International Conference on Machine Learning & Applications (CMLA 2024)ClaraZara1
6th International Conference on Machine Learning & Applications (CMLA 2024) will provide an excellent international forum for sharing knowledge and results in theory, methodology and applications of on Machine Learning & Applications.
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
1. GLOBAL EARTHQUAKE MONITOR
A Report submitted in partial fulfilment of the requirement for the
award of degree of
Bachelor of Technology
In
Electronics and Communication Engineering
Submitted By
HIMANSHI (02215002817)
MAHARAJA SURAJMAL INSTITUTE OF TECHNOLOGY
C-4, Janakpuri, New Delhi-58
Affiliated to Guru Gobind Singh Indraprastha University, Delhi
June, 2020
3. 3
CANDIDATE’S DECLARATION
I, Himanshi, Roll No. 02215002817, B.Tech (Semester- 7th)
of the Maharaja
Surajmal Institute of Technology, New Delhi hereby declare that the Training Report
entitled “Object-Oriented Programming in Java” is an original work and data provided in
the study is authentic to the best of my knowledge. This report has not been submitted to any
other Institute for the award of any other degree.
Name of Student:
Himanshi
(Roll No. 02215002817)
4. 4
ACKNOWLEDGEMENT
A research work owes its success from commencement to completion, to the people
in love with researchers at various stages. Let me in this page express my gratitude to all those
who helped us in various stage of this study. First, I would like to express my sincere gratitude
indebtedness to Mr. Puneet Azad (HOD, Department of Information Technology, Maharaja
Surajmal Institute of Technology, New Delhi) for allowing me to undergo the summer training
of 6 weeks with Coursera.
I am grateful to my guide Ms. Mia Minnes, Ms. Christine Alvarado, and Mr. Leo
Porter, for the help provided in completion of the project, which was assigned to me. Without
his friendly help and guidance it was difficult to develop this project.
Last but not least, I pay my sincere thanks and gratitude to all the staff at courser for
their support and for making my training valuable and fruitful.
Submitted By:
HIMANSHI
7. 7
List Of Figures
Figure 1 Coursera Logo ...………………………………….…………. 8
Figure 2 Live Earthquake data feed from http://earthquake.usgs.gov/ …… 14
Figure 3 city-data.json ………………………………………………. 15
Figure 4 blankLight-1-3.mbtiles ………………………………………. 16
Figure 5 countries.geo.json ………………………………………………. 16
Figure 6 2.5_week.atom ………………………………………………. 17
Figure 7 Libraries ………………………………………………………. 18
Figure 8 SRC Files ………………………………………………………. 22
Figure 9 Extends vs Implements ………………………………………. 23
Figure 10 EarthquakeCityMap.java run ……………………………….. 37
Figure 11 Zoom(2) in Offline Mode ……………………………………….. 38
Figure 12 Zoom(3) in Offline Mode ……………………………………….. 38
Figure 13 Cursor move on City Marker ……………………………….. 39
Figure 14 Cursor move on Land Earthquake ……………………………….. 39
Figure 15 Mouse clicked on Land Earthquake ……………………….. 40
Figure 16 Mouse clicked on Ocean Earthquake ……………………….. 40
Figure 17 Click on City Marker ……………………………………….. 41
Figure 18 Zoom(5) in Offline Mode ………………………………………... 41
Figure 19 EarthquakeCityMap.java file run ………………………………… 42
Figure 20 Cursor move on Ocean Earthquake ………………………... 43
Figure 21 Cursor move on CityMarker ………………………………… 44
Figure 22 Zoom in too much and Cursor move on ………………………… 45
Figure 23 Click on Ocean Earthquake ………………………………… 45
Figure 24 Information Box …………………………………………………. 46
8. 8
ABOUT THE COURSERA
Coursera (/kərˈsɛrə/) is an American massive open online course (MOOC) provider
founded in 2012 by Stanford University's computer science professors Andrew
Ng and Daphne Koller that offers massive open online courses (MOOC), specializations,
degrees, professional and mastertrack courses.
Coursera works with universities and other organizations to offer online courses,
certifications, and degrees in a variety of subjects, such as engineering, data science, machine
learning, mathematics, business, financing, computer science, digital
marketing, humanities, medicine, biology, social sciences, 3000 plus variety of courses
giving students a very broad range of information & experience in different fields.
ABOUT THE COURSE
Object Oriented Programming in Java:
Object design: constructors, instance variables, methods
Memory models and Scope
Creating GUIs using PApplet
Unfolding Maps
Inheritance and Polymorphism
Event-Driven Programming
Searching: Linear Search & Binary Search
Sorting: Insertion Sort & Selection Sort
Fig.1 Coursera Logo
9. 9
PROJECT DETAILS
OVERVIEW:
This project was a part of the Java Object-Oriented Design of Data Structures. An
interactive application with a Graphical User Interface (GUI).
Displays a world map with Earthquake data. This interactive map uses a live RSS feed
from the U.S. Geological Survey to show the location, magnitude, and potential impact of
earthquakes around the world. It contains:
Object Oriented Programming principles like Encapsulation, Inheritance,
Polymorphism and Abstraction.
Event Driven Programming
Searching and Sorting techniques for data to be displayed.
SOFTWARE:
ECLIPSE IDE
JAVA PLATFORM (JDK) 8u60
LANGUAGE:
Java
LIBRARIES:
Unfolding Maps
Processing Library
10. 10
JAVA:
Java is a class-based, Object-Oriented Programming Language that is designed to
have as few implementation dependencies as possible. It is a general-purpose programming
language intended to let application developers Write Once, Run
Anywhere (WORA), meaning that compiled Java code can run on all platforms that support
Java without the need for recompilation. Java applications are typically compiled
to bytecode that can run on any Java Virtual Machine (JVM) regardless of the
underlying computer architecture.
UNFOLDING MAPS:
Unfolding is a library to create interactive maps and geo visualizations
in Processing and Java.
The main purpose of using unfolding is to create not only static maps but also interactive
maps in both java and processing. It can easily be installed on eclipse by downloading the
unfolding template from the official website. It is widely used due to the features provided by
unfolding like:
1. Interaction Events: In unfolding, we can easily create interactive maps. The basic
interactions like zoom and pan are included in this library.
2. Data Visualization: This library is very robust that it even lets users create geo-
positioned markers to display the data on a map. This visual style can be freely adapted.
This library also supports users to load and display user-defined shapes like points, lines
or polygons.
3. Styled Maps: This library is a title-based map library. This library allows map titles to
have various geographic features and styles.
4. Clean & Extendable Code: This library allows the beginners to easily create simple
maps. Advanced users can also sketch their prototypes or create their own sophisticated
visualizations.
11. 11
PROCESSING LIBRARY:
Processing is an open-source low level animation and GUI library built on Java with
additional simplifications like additional classes, aliased mathematical functions and
operations. It also provides a GUI for simple compilation of the programs written in
processing.
Features of Processing: The following are the features of processing:
It includes a sketchbook which is a minimalistic alternative to an IDE. This sketchbook
can be used as a normal IDE to organize projects.
Every sketch drawn in processing is a subclass of the Java class (PApplet). This class
implements almost all the features of processing.
Since processing inherits the properties of the class, all the additional classes defined in
the sketch will be treated as an inner class when the code is being converted into a pure
java code before compiling. Therefore, the use of static variables and methods is strictly
prohibited in processing.
The processing language also gives the users an option to create own classes in the
PApplet sketch. Therefore, this gives the users a chance to use a more complex data
structures apart from the basic data types in java.
12. 12
Object Oriented Programming:
Object-Oriented Programming or OOPs refers to languages that uses objects in
programming. Object-oriented programming aims to implement real-world entities like
inheritance, hiding, polymorphism etc. in programming. The main aim of OOP is to bind
together the data and the functions that operate on them so that no other part of the code can
access this data except that function.
Main OOPs Concepts:
POLYMORPHISM: Polymorphism refers to the ability of OOPs programming
languages to differentiate between entities with the same name efficiently. This is done
by Java with the help of the signature and declaration of these entities.
INHERITANCE: Inheritance is an important pillar of OOP (Object Oriented
Programming). It is the mechanism in java by which one class is allow to inherit the
features (fields and methods) of another class.
ENCAPSULATION: Encapsulation is defined as the wrapping up of data under a
single unit. It is the mechanism that binds together code and the data it manipulates.
Another way to think about encapsulation is, it is a protective shield that prevents the
data from being accessed by the code outside this shield.
ABSTRACTION: Data Abstraction is the property by virtue of which only the
essential details are displayed to the user. The trivial or the non-essentials units are not
displayed to the user. Ex: A car is viewed as a car rather than its individual
components.
Data Abstraction may also be defined as the process of identifying only the required
characteristics of an object ignoring the irrelevant details.
13. 13
CLASS PApplet:
java.lang.Object
processing.core.PApplet
The processing library in Java has a class called PApplet which is used in
Making Graphical User Interface (GUI).
The PApplet class must be the superclass of an applet that is to be embedded in a Web
page or viewed by the Java Applet Viewer.
The PApplet class has two main methods namely the setup() and the draw() method.
Using PApplet class we can create user-friendly GUI apps, which means the
application is user interactive, they have icons, sliders, we can click, drag, drop and
play with the app window.
The setup method is run once whereas the draw function will run repeatedly drawing
the image on the canvas.
Base class for all sketches that use processing.core.
import processing.core.PApplet;
CLASS SimplePointMarker:
java.lang.Object
de.fhpotsdam.unfolding.marker.AbstractMarker
de.fhpotsdam.unfolding.marker.SimplePointMarker
Marker representing a single location. Use directly to display as simple circle, or
extend it for custom styles.
18. 18
LIBRARIES
A Java library contains code which you can access and use in your Java project. The
deployment format of a Java library is a JAR file.
java.util.ArrayList: Resizable-array implementation of the List interface.
Implements all optional list operations, and permits all elements, including null. In
addition to implementing the List interface, this class provides methods to manipulate
the size of the array that is used internally to store the list.
java.util.Arrays: This class contains various methods for manipulating arrays (such
as sorting and searching). This class also contains a static factory that allows arrays to
be viewed as lists.
Fig.7 Libraries / Header Files
19. 19
The methods in this class all throw a NullPointerException, if the specified array
reference is null, except where noted.
java.util.Collections: This class consists exclusively of static methods that operate on
or return collections. It contains polymorphic algorithms that operate on collections,
"wrappers", which return a new collection backed by a specified collection, and a few
other odds and ends.
The methods of this class all throw a NullPointerException if the collections or class
objects provided to them are null.
java.util.List: An ordered collection (also known as a sequence). The user of this
interface has precise control over where in the list each element is inserted. The user
can access elements by their integer index (position in the list), and search for elements
in the list.
Unlike sets, lists typically allow duplicate elements. More formally, lists typically
allow pairs of elements e1 and e2 such that e1.equals(e2).
de.fhpotsdam.unfolding.UnfoldingMap: An interactive map. Uses the MapDisplay,
and handles hit test, active status, as well as all interactions such as panning, zooming,
and rotating (with or without tweening). Acts as facade for the map interactions, e.g.
using innerScale for zooming, and outerRotate for rotating.
de.fhpotsdam.unfolding.data.Feature: A feature stores one or more locations, its
type, and additional data properties.
de.fhpotsdam.unfolding.data.GeoJSONReader: Reads GeoJSON files and creates
Features.
de.fhpotsdam.unfolding.data.PointFeature: Stores a single location.
20. 20
de.fhpotsdam.unfolding.geo.Location: The Location represents a geo location
defined by latitude and longitude.
de.fhpotsdam.unfolding.marker.AbstractShapeMarker: Abstract marker
representing multiple locations and can be implemented as lines, polygons, or other
shapes. Handles multiple locations, and implements the main marker methods for
handling those properly.
de.fhpotsdam.unfolding.marker.Marker: Displays visual representations of geo-
spatial locations using Marker and MarkerManager. Marker interface for all markers
to be drawn on to maps.
de.fhpotsdam.unfolding.marker.MultiMarker: A MultiMarker enables handling of
multiple, logically grouped markers. Properties and display states are the same for all
its markers. A MultiMarker can consist of various sub-markers, even of different
types. For instance, a MultiMarker could have three polygon marker and one point
marker.
de.fhpotsdam.unfolding.providers.MBTilesMapProvider: MapProvider for local
MBTiles.
de.fhpotsdam.unfolding.providers.AbstractMapProvider
de.fhpotsdam.unfolding.providers.AbstractMapTileProvider
de.fhpotsdam.unfolding.providers.MBTilesMapProvider
de.fhpotsdam.unfolding.utils.MapUtils: Utility and convenience methods for
simplifying map usage.
parsing.ParseFeed: This method is to parse a GeoRSS feed corresponding to
earthquakes around the globe.
21. 21
processing.core.PApplet: PApplet class must be the superclass of an applet that is to
be embedded in a Web page or viewed by the Java Applet Viewer. The PApplet class
has two main methods namely the setup() and the draw() method.
processing.core.PConstants: Numbers shared throughout processing.core.
An attempt is made to keep the constants as short/non-verbose as possible. For
instance, the constant is TIFF instead of FILE_TYPE_TIFF. We'll do this as long as
we can get away with it.
processing.core.PGraphics: Main graphics and rendering context, as well as the base
API implementation for processing "core". Use this class if you need to draw into an
off-screen graphics buffer. A PGraphics object can be constructed with
the createGraphics() function. The beginDraw() and endDraw() methods are
necessary to set up the buffer and to finalize it. The fields and methods for this class
are extensive.
22. 22
SRC FILES
A Java source file is a plain
text file containing Java source code
and having . java extension. The
. java extension means that the file is
the Java source file. Java
source code file contains source code
for a class, interface, enumeration, or
annotation type.
EarthquakeCityMap.java:
public class EarthquakeCityMap extends PApplet {
...
}
EarthquakeMarker.java:
public abstract class EarthquakeMarker extends CommonMarker implements
Comparable<EarthquakeMarker>
{
...
}
CommonMarker.java:
public abstract class CommonMarker extends SimplePointMarker {
...
}
CityMarker.java:
public class CityMarker extends CommonMarker {
...
}
LandQuakeMarker.java:
Fig.8 SRC Files
23. 23
public class LandQuakeMarker extends EarthquakeMarker {
...
}
OceanQuakeMarker.java:
public class OceanQuakeMarker extends EarthquakeMarker {
...
}
Extends: In Java, the extends keyword is used to indicate that the class which is being
defined is derived from the base class using inheritance. So basically, extends keyword
is used to extend the functionality of the parent class to the subclass. In Java, multiple
inheritances are not allowed due to ambiguity. Therefore, a class can extend only one
class to avoid ambiguity.
Implements: In Java, the implements keyword is used to implement an interface. An
interface is a special type of class which implements a complete abstraction and only
contains abstract methods. To access the interface methods, the interface must be
“implemented” by another class with the implements keyword and the methods need
to be implemented in the class which is inheriting the properties of the interface. Since
an interface is not having the implementation of the methods, a class can implement
any number of interfaces at a time.
Fig.9 Extends vs Implements
24. 24
Code
setup() Method:
public void setup() {
size(900, 700, OPENGL);
if (offline) {
map = new UnfoldingMap(this, 300, 50, 750, 650, new
MBTilesMapProvider(mbTilesString));
earthquakesURL = "2.5_week.atom";
}
else {
map = new UnfoldingMap(this, 300, 50, 650, 600, new
Google.GoogleMapProvider());
}
MapUtils.createDefaultEventDispatcher(this, map);
List<Feature> countries = GeoJSONReader.loadData(this, countryFile);
countryMarkers = MapUtils.createSimpleMarkers(countries);
List<Feature> cities = GeoJSONReader.loadData(this, cityFile);
cityMarkers = new ArrayList<Marker>();
for(Feature city : cities) {
cityMarkers.add(new CityMarker(city));
}
List<PointFeature> earthquakes = ParseFeed.parseEarthquake(this,
earthquakesURL);
quakeMarkers = new ArrayList<Marker>();
for(PointFeature feature : earthquakes) {
if(isLand(feature)) {
quakeMarkers.add(new LandQuakeMarker(feature));
}
else {
quakeMarkers.add(new OceanQuakeMarker(feature));
}
}
printQuakes();
int t = quakeMarkers.size();
25. 25
sortAndPrint(t);
map.addMarkers(quakeMarkers);
map.addMarkers(cityMarkers);
}
size (width, height):
Syntax size(width, height)
size(width, height, renderer)
Parameters width int: height of the display window in units of pixels
height int: height of the display window in units of pixels
Defines the dimension of the display window width and height in units of
pixels. In a program that has the setup() function, the size() function must be the first
line of code inside setup(), and the setup() function must appear in the code tab with
the same name as your sketch folder.
The built-in variables width and height are set by the parameters passed to this
function. For example, running size(640, 480) will assign 640 to the width variable
and 480 to the height variable. If size() is not used, the window will be given a default
size of 100 x 100 pixels.
The renderer parameter selects which rendering engine to use. For example, if
you will be drawing 3D shapes, use P3D. In addition to the default renderer, other
renderers are:
P2D (Processing 2D): 2D graphics renderer that makes use of OpenGL-
compatible graphics hardware.
P3D (Processing 3D): 3D graphics renderer that makes use of OpenGL-
compatible graphics hardware.
map = new UnfoldingMap(this, 300, 50, 750, 650, new
MBTilesMapProvider(mbTilesString)) :
Parameters:
this – The main applet
26. 26
300 – The x position of this map.
50 – The y position of this map.
750 – The width of this map.
650 – The height of this map.
MBTilesMapProvider(mbTilesString)) or Google.GoogleMapProvider()) – we
needed to specify when we're building a new unfolding map object is where
that unfolding map object learns about the map features, in particular, the
boundaries of continents for example, or countries, or any road data that we
want to display in our map. And in order to do that, Unfolding Maps has this
infrastructure of map providers,
MapUtils.createDefaultEventDispatcher(this, map) :
Initializes default events, i.e. all given maps handle mouse and keyboard
interactions. No cross-listening between maps.
Parameters:
this - The PApplet needed for mouse and key user interactions.
map- one map
MapUtils.createSimpleMarkers(countries):
Creates Unfolding's simple markers from features. (without the need to create
a MarkerFactory)
Parameters:
features - The features to get markers for.
Returns:
The EventDispatcher to use for additional event handling.
GeoJSONReader.loadData(this, countryFile):
Parses a GeoJSON String and creates features for them.
Parameters:
this - The PApplet.
27. 27
countryFile - The name of the GeoJSON file.
Returns:
A list of features.
draw() Method:
public void draw() {
background(150,150,150);
map.draw();
addKey();
}
background(150,150,150): The background() function sets the color used for the
background of the Processing window. The default background is light gray. This
function is typically used within draw() to clear the display window at the beginning
of each frame, but it can be used inside setup() to set the background on the first frame
of animation or if the backgound need only be set once.
sortAndPrint() Method:
This method call from setup in EarthquakeCityMap. This method is used to sort the
earthquake magnitude in descending order and then print it.
private void sortAndPrint(int numToPrint) {
EarthquakeMarker[] markers=new
EarthquakeMarker[quakeMarkers.size()];
markers=quakeMarkers.toArray(markers);
List<Float> quakeMarkerList = new ArrayList<Float>();
Arrays.sort(markers);
for(int num=0;num<numToPrint;num++)
{
quakeMarkerList.add(markers[num].getMagnitude());
}
Collections.sort(quakeMarkerList);
Collections.reverse(quakeMarkerList);
System.out.println(quakeMarkerList.toString());
}
29. 29
lastSelected = marker;
marker.setSelected(true);
return;
}
}
}
mouseClicked() Method: The event handler for mouse clicks. It will display an
earthquake and its threat circle of cities or if a city is clicked, it will display all the earthquakes
where the city is in the threat circle.
public void mouseClicked()
{
if (lastClicked != null) {
unhideMarkers();
lastClicked = null;
}
else if (lastClicked == null)
{
checkEarthquakesForClick();
if (lastClicked == null) {
checkCitiesForClick();
}
}
}
checkCitiesForClick(): This is a helper method that will check if a city marker was
clicked on and respond appropriately. The city markers to see if one of them is selected and
hide all the other earthquakes.
private void checkCitiesForClick()
{
if (lastClicked != null) return;
for (Marker marker : cityMarkers) {
if (!marker.isHidden() && marker.isInside(map, mouseX,
mouseY)) {
lastClicked = (CommonMarker)marker;
for (Marker mhide : cityMarkers) {
if (mhide != lastClicked) {
mhide.setHidden(true);
}
}
for (Marker mhide : quakeMarkers) {
EarthquakeMarker quakeMarker =
(EarthquakeMarker)mhide;
30. 30
if
(quakeMarker.getDistanceTo(marker.getLocation())
> quakeMarker.threatCircle()) {
quakeMarker.setHidden(true);
}
}
return;
}
}
}
checkEarthquakesForClick() Method: This is a helper method that will check if a
earthquake was clicked on and respond appropriately. The earthquake markers to see if one
of them is selected and hide all the other earthquakes.
private void checkEarthquakesForClick()
{
if (lastClicked != null) return;
for (Marker m : quakeMarkers) {
EarthquakeMarker marker = (EarthquakeMarker)m;
if (!marker.isHidden() && marker.isInside(map, mouseX,
mouseY)) {
lastClicked = marker;
for (Marker mhide : quakeMarkers) {
if (mhide != lastClicked) {
mhide.setHidden(true);
}
}
for (Marker mhide : cityMarkers) {
if (mhide.getDistanceTo(marker.getLocation())
> marker.threatCircle()) {
mhide.setHidden(true);
}
}
return;
}
}
}
unhideMarkers() Method: This is used to unhide all markers.
private void unhideMarkers() {
for(Marker marker : quakeMarkers) {
marker.setHidden(false);
}
31. 31
for(Marker marker : cityMarkers) {
marker.setHidden(false);
}
}
isLand() Method: Checks whether this quake occurred on land. If it did, it sets the
"country" property of its PointFeature to the country where it occurred and returns true.
Otherwise it returns false.
private boolean isLand(PointFeature earthquake) {
for (Marker country : countryMarkers) {
if (isInCountry(earthquake, country)) {
return true;
}
}
return false;
}
addKey() Method: This is a helper method to draw key in GUI.
private void addKey() {
fill(255, 250, 240);
int xbase = 25;
int ybase = 50;
stroke(0,0,0);
rect(xbase, ybase, 250, 410);
stroke(250,235,215);
fill(245,255,250);
rect(xbase-10, ybase-10, 260, 420);
fill(0);
textAlign(LEFT, CENTER);
textSize(12);
text("Earthquake Key", xbase+25, ybase+25);
fill(255,0,255);
int tri_xbase = xbase + 35;
int tri_ybase = ybase + 50;
stroke(0,0,0);
triangle(tri_xbase, tri_ybase-5, tri_xbase-5, tri_ybase+5,
tri_xbase+5, tri_ybase+5);
fill(0, 0, 0);
textAlign(LEFT, CENTER);
text("City Marker", tri_xbase + 15, tri_ybase);
33. 33
int t_ybas=ybase+280;
fill(250,0,250);
stroke(0,0,0);
triangle(t_xbas, t_ybas-5, t_xbas-5, t_ybas+5, t_xbas+5, t_ybas+5);
fill(0,255,255);
stroke(0,255,255);
triangle(t_xbas, t_ybas-7, t_xbas-7, t_ybas+7, t_xbas+7, t_ybas+7);
int t_xba=xbase+35;
int t_yba=ybase+300;
fill(250,0,250);
stroke(0,0,0);
triangle(t_xba, t_yba-5, t_xba-5, t_yba+5, t_xba+5, t_yba+5);
fill(0,255,0);
stroke(0,255,0);
triangle(t_xba, t_yba-7, t_xba-7, t_yba+7, t_xba+7, t_yba+7);
fill(255,255,255);
stroke(255,0,0);
ellipse(xbase+35, ybase+340, 12, 12);
stroke(34,139,34);
ellipse(xbase+35, ybase+360, 12, 12);
stroke(139,0,139);
ellipse(xbase+35, ybase+380, 12, 12);
textAlign(LEFT, CENTER);
fill(0, 0, 0);
text("+5.0 Magnitude", xbase+50, ybase+340);
text("+4.0 Magnitude", xbase+50, ybase+360);
text("Below 4.0", xbase+50, ybase+380);
stroke(255,250,240);
noFill();
rect(300, 50, 750, 650);
}
fill(): Sets the color used to fill shapes.
noFill(): Disables filling geometry. If both noStroke() and noFill() are called,
nothing will be drawn to the screen.
triangle(): A triangle is a plane created by connecting three points. The first two
arguments specify the first point, the middle two arguments specify the second point,
and the last two arguments specify the third point.
ellipse(): Draws an ellipse (oval) to the screen. An ellipse with equal width and
height is a circle. By default, the first two parameters set the location, and the third
34. 34
and fourth parameters set the shape's width and height. The origin may be changed
with the ellipseMode() function.
rect(): Draws a rectangle to the screen. A rectangle is a four-sided shape with every
angle at ninety degrees. By default, the first two parameters set the location of the
upper-left corner, the third sets the width, and the fourth sets the height. The way
these parameters are interpreted, however, may be changed with
the rectMode() function.
stroke(): Sets the color used to draw lines and borders around shapes. This color is
either specified in terms of the RGB or HSB color depending on the
current colorMode(). The default color space is RGB, with each value in the range
from 0 to 255.
color(): Creates colors for storing in variables of the color datatype. The parameters
are interpreted as RGB or HSB values depending on the current colorMode().
textAlign(): Sets the current alignment for drawing text. The parameters LEFT,
CENTER, and RIGHT set the display characteristics of the letters in relation to the
values for the x and y parameters of the text() function.
text(): Draws text to the screen. Displays the information specified in the first
parameter on the screen in the position specified by the additional parameters. A
default font will be used unless a font is set with the textFont() function and a default
size will be used unless a font is set with textSize(). Change the color of the text with
the fill() function. The text displays in relation to the textAlign() function, which
gives the option to draw to the left, right, and center of the coordinates.
textSize(): Sets the current font size. This size will be used in all subsequent calls to
the text() function. Font size is measured in units of pixels.
printQuakes() Method: Prints countries with number of earthquakes through loop the
country markers or country features (either will work) and then for each country, loop through
35. 35
the quakes to count how many occurred in that country. Recall that the country markers have
a "name" property, and LandQuakeMarkers have a "country" property set.
private void printQuakes() {
int totalWaterQuakes = quakeMarkers.size();
for (Marker country : countryMarkers) {
String countryName = country.getStringProperty("name");
int numQuakes = 0;
for (Marker marker : quakeMarkers)
{
EarthquakeMarker eqMarker = (EarthquakeMarker)marker;
if (eqMarker.isOnLand()) {
if
(countryName.equals(eqMarker.getStringProperty("country"))) {
numQuakes++;
}
}
}
if (numQuakes > 0) {
totalWaterQuakes -= numQuakes;
System.out.println(countryName + ": " + numQuakes);
}
}
System.out.println("OCEAN QUAKES: " + totalWaterQuakes);
}
OUTPUT:
36. 36
isInCountry() Method: This is a helper method to test whether a given earthquake is in
a given country This will also add the country property to the properties of the earthquake
feature if it's in one of the countries.
private boolean isInCountry(PointFeature earthquake, Marker country) {
Location checkLoc = earthquake.getLocation();
if(country.getClass() == MultiMarker.class) {
for(Marker marker : ((MultiMarker)country).getMarkers()) {
if(((AbstractShapeMarker)marker).isInsideByLocation(checkLoc)) {
earthquake.addProperty("country",
country.getProperty("name"));
return true;
}
}
}
else if(((AbstractShapeMarker)country).isInsideByLocation(checkLoc))
{
earthquake.addProperty("country",
country.getProperty("name"));
return true;
}
return false;
}
37. 37
OUTPUT
OFFLINE Mode:
If we are working offline, then set the value of this variable to true.
private static final boolean offline = true;
When EarthquakeCityMap.java file run:
Fig.10 EarthquakeCityMap.java run
38. 38
When Zoom(2) then it look’s like:
When zoom(3) then it look like :
Fig.11 Zoom(2) in Offline Mode
Fig.12 Zoom(3) in Offline Mode
39. 39
When cursor move on City Marker:
When cursor move on Land Earthquake:
Fig.13 Cursor move on City Marker
Fig.14 Cursor move on Land Earthquake
40. 40
When mouse clicked on Land Earthquake then the city affected by that earthquake is
also shown:
When mouse clicked on Ocean Earthquake then the city affected by that earthquake
is also shown:
Fig.15 Mouse clicked on Land Earthquake
Fig.16 Mouse clicked on Ocean Earthquake
41. 41
When we Click on City Marker then all Earthquake is shown which affected that
city:
When zoom(5) then it shows clearly above Earthquake’s:
Fig.17 Click on City Marker
Fig.18 Zoom(5) in Offline Mode
42. 42
ONLINE MODE:
When we working online then set the value of this variable to false.
private static final boolean offline = false;
When EarthquakeCityMap.java file run:
Fig.19 EarthquakeCityMap.java file run
43. 43
When cursor move on Ocean Earthquake:
Fig.20 Cursor move on Ocean Earthquake
44. 44
When cursor move on CityMarker:
Fig.21 Cursor move on CityMarker
45. 45
When we Zoom in too much and Cursor move on CityMarker:
When we Click on Ocean Earthquake:
Fig.22 Zoom in too much and Cursor move on
CityMarker
Fig.23 Click on Ocean Earthquake
47. 47
RESULT
This project was a part of the Java Object-Oriented Design of Data Structures
Specialization by UCSD on Coursera. This Specialization covers intermediate topics in
software development, including implementation of data structures and algorithms for
organizing large amounts of data in a way that is both efficient and easy to work with. The
project that was assigned was completed successfully.
User Stories:-
1. Users can obtain a graphical representation of how each earthquake compares to other
earthquakes along a certain parameter.
2. If the user clicks an earthquake marker, all cities that may be affected by this
earthquake are displayed; when the user clicks a city marker, all earthquakes that may
affect that city are displayed.
3. Popup information boxes about the earthquakes and cities are always drawn on top of
all other graphical information. Information boxes are contained within the map
content area.
48. 48
CONCLUSION
It gives me immense pleasure to write that my summer training has completed
successfully online from Coursera. This report presented a complete overview of Basics of
Java Programming. I got this opportunity to create a Global Earthquake Monitor using Java.
I also understood and got the knowledge more about java language and its applications.
After completing this course from Coursera, I can say I have learnt about the basics of
OOPs. I learned using the different libraries of Java like, Unfolding Maps, Processing Library.
These Libraries were an essential part of my project on Global Earthquake Monitor as they
helped me Analyze and Visualize the data easily.
I have gained lots of knowledge and experience needed to be successful in great engineering
challenges.