Project Synopsis
Project Synopsis
1. Acknowledgement............................................................................................................... 3
2. Abstract............................................................................................................................... 4
3. Problem analysis & definition [5]
3.1. Processing Environment............................................................................................... 5
3.1.1. Hardware and Software requirement............................................................... 5
3.1.2. Operating Environment................................................................................... 5
.2. Development Schedule [ 6 - 13 ]
1. Overview......................................................................................................... 6
2. History............................................................................................................... 6
3. System development......................................................................................... 7
4. System development life cycle topics............................................................... 7
5. Work breakdown structure.............................................................................. 10
6. Strength and weakness.................................................................................... 11
.3. Programming Languages and Development tools [ 14 - 21 ]
3.31. JDK 1.6........................................................................................................... 14
3.32. Microsoft Access............................................................................................ 15
3.33. Split Database Architecture........................................................................... 21
. Software requirement specification [ 22 – 30 ]
.1. The System feature.................................................................................................... 22
.2. Sequence diagram...................................................................................................... 23
.3. Activity diagram........................................................................................................ 24
.4. State Chart diagram................................................................................................... 25
.5. Class diagram............................................................................................................. 26
.6. Use Case diagram....................................................................................................... 27
.7. Deployment diagram................................................................................................. 28
.8. Collaborative diagram............................................................................................ 28
.9. Non-Functional requirement.................................................................................... 29
4.91. Performance requirement............................................................................. 29
4.92. Safety requirement........................................................................................ 29
4.93. Security requirement................................................................................... 29
.10. Functional requirement.............................................................................................. 30
.11. Software Quality Attributes..................................................................................... 30
. Design [ 31 - 35 ]
.1. System Environment.................................................................................................. 31
.2. Use cases.................................................................................................................... 31
5.21.1. Add a marker and requirement........................................................................ 31
5.21.2. Search a Wikipedia article and requirement.................................................. 32
5.21.3. Geocode - Search a location from address...................................................... 33
5.21.4. Reverse Geocode – Search address from location..........................................33
5.21.5. Find Weather of a place and requirement.......................................................34
.2.6 Find path from source to destination..............................................................35
TABLE OF CONTENT
. Documentation [ 36 - 80 ]
.1. Coding........................................................................................................................ 36
.2. Output of the modules................................................................................................ 75
. Testing [ 81 - 84 ]
.1. McCabe Cyclomatic Complexity............................................................................... 81
.2. Add a new marker ,description & test cases.............................................................. 81
.3. Latitude of location ,description & test cases............................................................ 82
.4. Postal Code ,description & test cases......................................................................... 83
.5. Boundary value analysis............................................................................................ 84
. Future Analysis [ 85 ]
.1. Innovative and usefulness.............................................................................................. 85
.2. As a mobile application.................................................................................................. 85
. Reference [ 85 ]
2|Page
ACKNOWLEDGEMENT
It is a pleasure to acknowledge my debt to the many people involved, directly or
indirectly, in the making of this software. First of all, we must thank to each one of the
members of our group for it was our unity, strength and capability with led to the
development of this mammoth project.
Secondly we have benefitted enormously by the comments and review by our Project
Guide “Mr. Deepak Upreti”. Continuing thanking the teachers I must certainly not forget
other lecturers, who not only gave their precious time to listen to our ideas but also guided us.
And also my sincere thanks to Mr.K S Mehta, Head of Department (CSE).
THANK YOU
3|Page
ABSTRACT
The MAPPING APPLICATION is a desktop application, designed to run using maps
from OPENSTREETMAP server and allows users to search relevant Wikipedia
article [geographic location], weather of a place, locate places [Geocoding and
Reverse-Geocoding], find suitable paths and add markers. Database for a city will be
maintained and all standard map tools will be provided. The data will be held in an
Oracle database on the JUIT server. Map-App can work only if the end user system
can establish a connection to a tile map server (openstreetmaps in this case) also for
user to be able to logon and store his data a connection with the database server is
necessary. The main objective of the project is to provide the user to the map of the
desired location for which he/she desires including the weather reports and the details
from the Wikipedia also.
The MAP-App retrieves maps from the openstreetmaps server and marker
locations from the department server system. This system will be web-based, linking
to tile map server and online services such as geonames for location and article
search. An Internet connection is necessary to access the maps and other features of
the application.
Openstreet
Map Server
Map-App
Database
4|Page
PROBLEM ANALYSIS AND DEFINITION
Theme
This Software Requirements Specification provides a complete description of all the
functions and specifications of the MAPPING APPLICATION. The expected audience of
this document is the faculty of CSE department, G. L. Bajaj Inst. of Tech.
PROCESSING ENVIRONMENT
Hardware Requirement
64 MB Ram
Modem (or LAN) for internet connection
P II Processor or Higher
10 MB Disk Space
GPA device (optional) for accessing current user location.
Software Requirement
JDK 1.6
Microsoft Access
Net Beans Release Candidate 2
OPENSTREETMAP Server
Operating System [ Windows NT / 2000 / XP / Vista / windows 7 ]
Operating Environment
JDK 1.4 or above
Server
A server is a machine with following specification –
Operating System - Windows NT / 2000 / XP / Vista
Database - Oracle
Network - Lan
5|Page
The Systems Development Life Cycle (SDLC), or Software Development Life Cycle in
systems engineering, information systems and software engineering, is the process of creating
or altering systems, and the models and methodologies that people use to develop these
systems. The concept generally refers to computer or information systems.
In software engineering the SDLC concept underpins many kinds of software development
methodologies. These methodologies form the framework for planning and controlling the
creation of an information system the software development process
OVERVIEW
Systems Development Life Cycle (SDLC) is a process used by a systems analyst to develop
an information system, including requirements, validation, training, and user (stakeholder)
ownership. Any SDLC should result in a high quality system that meets or exceeds customer
expectations, reaches completion within time and cost estimates, works effectively and
efficiently in the current and planned Information Technology infrastructure, and is
inexpensive to maintain and cost-effective to enhance.
Computer systems are complex and often (especially with the recent rise of Service-Oriented
Architecture) link multiple traditional systems potentially supplied by different software
vendors. To manage this level of complexity, a number of SDLC models have been created:
"waterfall"; "fountain"; "spiral"; "build and fix"; "rapid prototyping"; "incremental"; and
"synchronize and stabilize"
Some agile and iterative proponents confuse the term SDLC with sequential or "more
traditional" processes; however, SDLC is an umbrella term for all methodologies for the
design, implementation, and release of software.
In project management a project can be defined both with a project life cycle (PLC) and an
SDLC, during which slightly different activities occur. According to Taylor (2004) "the
6|Page
project life cycle encompasses all the activities of the project, while the systems development
life cycle focuses on realizing the product requirements".
HISTORY
The systems development lifecycle (SDLC) is a type of methodology used to describe the
process for building information systems, intended to develop information systems in a very
deliberate, structured and methodical way, reiterating each stage of the life cycle. According
to Elliott, Strachan & Radford (2004), the systems development life cycle was originated in
the 1960s to develop large scale functional business systems in an age of large scale business
conglomerates. Information systems activities revolved around heavy data
processing and number crunching routines".
Several systems development frameworks have been partly based on SDLC, such as
the Structured Systems Analysis and Design Method (SSADM) produced for the UK
government Office of Government Commerce in the 1980s. Ever since, according to Elliott
(2004), "the traditional life cycle approaches to systems development have been increasingly
replaced with alternative approaches and frameworks, which attempted to overcome some of
the inherent deficiencies of the traditional SDLC".
SYSTEMS DEVELOPMENT PHASES
A Systems Development Life Cycle (SDLC) adheres to important phases that are essential
for developers, such as planning, analysis, design, and implementation, and are explained in
the section below. Several Systems Development Life Cycle Models exist, the oldest of
which — originally regarded as "the Systems Development Life Cycle" — is the waterfall
model: a sequence of stages in which the output of each stage becomes the input for the next.
These stages generally follow the same basic steps, but many different waterfall
methodologies give the steps different names and the number of steps seems to vary between
four and seven. There is no one correct Systems Development Life Cycle model.
7|Page
The SDLC can be divided into ten phases during which defined IT work products are created
or modified. The tenth phase occurs when the system is disposed of and the task performed is
either eliminated or transferred to other systems. The tasks and work products for each phase
are described in subsequent chapters. Not every project will require that the phases be
sequentially executed. However, the phases are interdependent. Depending upon the size and
complexity of the project, phases may be combined or may overlap.
Initiation/planning
To generate a high-level view of the intended project and determine the goals of the
project. The feasibility study is sometimes used to present the project to upper management
in an attempt to gain funding. Projects are typically evaluated in three areas of feasibility:
economical, operational or organizational, and technical. Furthermore, it is also used as a
reference to keep the project on track and to evaluate the progress of the MIS team. The MIS
is also a complement of those phases. This phase is also called as analysis phase.
Requirements gathering and analysis
The goal of systems analysis is to determine where the problem is in an attempt to fix
the system. This step involves "breaking down" the system in different pieces to analyze the
situation, analyzing project goals, "breaking down" what needs to be created and attempting
to engage users so that definite requirements can be defined (Decomposition computer
science). Requirements Gathering sometimes requires individuals/teams from client as well
as service provider sides to get detailed and accurate requirements.
Design
In systems design functions and operations are described in detail, including screen
layouts, business rules, process diagrams and other documentation. The output of this stage
will describe the new system as a collection of modules or subsystems.
The design stage takes as its initial input the requirements identified in the approved
requirements document. For each requirement, a set of one or more design elements will be
produced as a result of interviews, workshops, and/or prototype efforts. Design elements
describe the desired software features in detail, and generally include functional hierarchy
diagrams, screen layout diagrams, tables of business rules, business process diagrams, pseudo
code, and a complete entity-relationship diagram with a full data dictionary. These design
elements are intended to describe the software in sufficient detail that skilled programmers
may develop the software with minimal additional input.
Build or coding
Modular and subsystem programming code will be accomplished during this stage. Unit
testing and module testing are done in this stage by the developers. This stage is intermingled
8|Page
with the next in that individual modules will need testing before integration to the main
project.
Testing
The code is tested at various levels in software testing. Unit, system and user acceptance
testing are often performed. This is a grey area as many different opinions exist as to what the
stages of testing are and how much if any iteration occurs. Iteration is not generally part of
the waterfall model, but usually some occur at this stage.
9|Page
SYSTEMS DEVELOPMENT LIFE CYCLE TOPICS
Management and control
The Systems Development Life Cycle (SDLC) phases serve as a programmatic guide to
project activity and provide a flexible but consistent way to conduct projects to a depth
matching the scope of the project. Each of the SDLC phase objectives are described in this
section with key deliverables, a description of recommended tasks, and a summary of related
control objectives for effective management. It is critical for the project manager to establish
and monitor control objectives during each SDLC phase while executing projects. Control
objectives help to provide a clear statement of the desired result or purpose and should be
used throughout the entire SDLC process. Control objectives can be grouped into major
categories (Domains), and relate to the SDLC phases as shown in the figure.
To manage and control any SDLC initiative, each project will be required to establish some
degree of a Work Breakdown Structure (WBS) to capture and schedule the work necessary to
complete the project. The WBS and all programmatic material should be kept in the “Project
Description” section of the project notebook. The WBS format is mostly left to the project
manager to establish in a way that best describes the project work. There are some key areas
that must be defined in the WBS as part of the SDLC policy. The following diagram
describes three key areas that will be addressed in the WBS in a manner established by the
project manager.
10 | P a g e
Work breakdown structure organization
The upper section of the Work Breakdown Structure (WBS) should identify the major phases
and milestones of the project in a summary fashion. In addition, the upper section should
provide an overview of the full scope and timeline of the project and will be part of the initial
project description effort leading to project approval. The middle section of the WBS is based
on the seven Systems Development Life Cycle (SDLC) phases as a guide for WBS task
development. The WBS elements should consist of milestones and “tasks” as opposed to
“activities” and have a definitive period (usually two weeks or more). Each task must have a
measurable output (e.g. document, decision, or analysis). A WBS task may rely on one or
more activities (e.g. software engineering, systems engineering) and may require close
coordination with other tasks, either internal or external to the project. Any part of the project
needing support from contractors should have a Statement of work (SOW) written to include
the appropriate tasks from the SDLC phases. The development of a SOW does not occur
during a specific phase of SDLC but is developed to include the work from the SDLC process
that may be conducted by external resources such as contractors.
Baselines in the SDLC
Baselines are an important part of the Systems Development Life Cycle (SDLC). These
baselines are established after four of the five phases of the SDLC and are critical to the
iterative nature of the model. Each baseline is considered as a milestone in the SDLC.
11 | P a g e
Software Prototyping
Joint Applications Design (JAD)
Rapid Application Development (RAD)
Extreme Programming (XP); extension of earlier work in Prototyping and RAD.
Open Source Development
End-user development
Object Oriented Programming
Comparison of Methodologies (Post, & Anderson 2006)
Open End
SDLC RAD Objects JAD Prototyping
Source User
Mediu
Time Frame Long Short Medium Any Short Short
m
MIS staff Many Few Hundreds Split Few One or Two None
Transaction/DS Transactio
Both Both Both DSS DSS DSS
S n
Documentation In
Vital Limited Internal Limited Weak None
and training Objects
Integrity and In
Vital Vital Unknown Limited Weak Weak
security Objects
Few people in the modern computing world would use a strict waterfall model for their
Systems Development Life Cycle (SDLC) as many modern methodologies have superseded
this thinking. Some will argue that the SDLC no longer applies to models like Agile
computing, but it is still a term widely in use in Technology circles. The SDLC practice has
advantages in traditional models of software development, which lends itself more to a
structured environment. The disadvantages to using the SDLC methodology is when there is
need for iterative development or (i.e. web development or e-commerce) where stakeholders
12 | P a g e
need to review on a regular basis the software being designed. Instead of viewing SDLC from
a strength or weakness perspective, it is far more important to take the best practices from the
SDLC model and apply it to whatever may be most appropriate for the software being
designed.
Strengths Weaknesses
Ease of maintenance.
It should not be assumed that just because the waterfall model is the oldest original SDLC
model that it is the most efficient system. At one time the model was beneficial mostly to the
world of automating activities that were assigned to clerks and accountants. However, the
world of technological evolution is demanding that systems have a greater functionality that
would assist help desk technicians/administrators or information technology
specialists/analysts.
13 | P a g e
PROGRAMMING LANGUAGE AND DEVELOPMENT TOOLS
JDK
The Java Development Kit (JDK) is a Sun Microsystems product aimed
at Java developers. Since the introduction of Java, it has been by far the most widely
used Java SDK. On 17 November 2006, Sun announced that it would be released
under the GNU General Public License (GPL), thus making it free software. This
happened in large part on 8 May 2007; Sun contributed the source code to the Open
JDK.
JDK contents
The JDK has as its primary components a selection of programming tools, including:
Java – the loader for Java applications. This tool is an interpreter and can interpret
the class files generated by the javac compiler. Now a single launcher is used for both
development and deployment. The old deployment launcher, jre, no longer comes with
Sun JDK.
Javac – the compiler, which converts source code into Java bytecode.
Jar – the archiver, which packages related class libraries into a single JAR file. This
tool also helps manage JAR files.
Javadoc – the documentation generator, which automatically generates
documentation from source code comments
Jdb – the debugger
Jps – the process status tool, which displays process information for current Java
processes
Javap – the class file disassembler
Appletviewer – this tool can be used to run and debug Java applets without a web
browser.
Javah – the C header and stub generator, used to write native methods
Javaws – the Java Web Start launcher for JNLP applications
Extcheck – a utility which can detect JAR-file conflicts.
Apt – the annotation-processing tool
Jhat – (experimental) Java heap analysis tool
Jstack – (experimental) utility which prints Java stack traces of Java threads
Jstat – (experimental) Java Virtual Machine statistics monitoring tool
Jstatd – (experimental) Jstat daemon
Jinfo – (experimental) this utility gets configuration information from a running Java
process or crash dump.
14 | P a g e
Jmap – (experimental) This utility outputs the memory map for Java and can print
shared object memory maps or heap memory details of a given process or core dump.
Idlj – the IDL-to-Java compiler. This utility generates Java bindings from a
given IDL file.
Policytool – the policy creation and management tool, which can determine policy
for a Java runtime, specifying which permissions are available for code from various
sources
VisualVM – visual tool integrating several commandline JDK tools and lightweight
performance and memory profiling capabilities
Wsimport – generates portable JAX-WS artefacts for invoking a web service.
Jrunscript – Java command-line script shell.
The JDK also comes with a complete Java Runtime Environment, usually called
a private runtime. It consists of a Java Virtual Machine and all of the class libraries present in
the production environment, as well as additional libraries only useful to developers, such as
the internationalization libraries and the IDL libraries.
Copies of the JDK also include a wide selection of example programs demonstrating the use
of almost all portions of the Java API.
MICROSOFT ACCESS
History
Microsoft released Access version 1.0 on 13 November 1992, and an Access 1.1 release in
May 1993 to improve compatibility with other Microsoft products and include the Access
Basic programming language.
Microsoft specified the minimum hardware requirements for Access v2.0 as: Microsoft
Windows v3.1 with 4 MB of RAM required, 6 MB RAM recommended; 8 MB of
available hard disk space required, 14 MB hard disk space recommended. The product
shipped on seven 1.44 MB diskettes. The manual shows a 1993 copyright date.
Originally, the software worked well with relatively small databases but testing showed that
some circumstances caused data corruption. For example, file sizes over 10 MB proved
problematic (note that most hard disks held less than 500 MB at the time this was in wide
use), and the Getting Started manual warns about a number of circumstances where
obsolete device drivers or incorrect configurations can cause data loss. With the phasing out
of Windows 95, 98 and ME, improved network reliability, and Microsoft having released
15 | P a g e
8 service packs for the JetDatabase Engine, the reliability of Access databases has been
improved and it supports both more data and a larger number of users.
With Office 95, Microsoft Access 7.0 (a.k.a "Access 95") became part of the Microsoft
Office Professional Suite, joining Microsoft Excel, Word, and PowerPoint and transitioning
from Access Basic to Visual Basic for Applications (VBA). Since then, Microsoft has
released new versions of Microsoft Access with each release of Microsoft Office. This
includes Access 97 (version 8.0), Access 2000 (version 9.0), Access 2002 (version 10.0),
Access 2003 (version 11.5), and Access 2007 (version 12.0).
The native Access database format (the Jet MDB Database) has also evolved over the years.
Formats include Access 1.0, 1.1, 2.0, 7.0, 97, 2000, 2002, and 2007. The most significant
transition was from the Access 97 to the Access 2000 format; which is not backward
compatible with earlier versions of Access. At the time of this writing, all newer versions of
Access support the Access 2000 format. New features were added to the Access 2002 format
which can be used by Access 2002, 2003, 2007, and 2010.
In Access 2007, a new database format was introduced: ACCDB. The ACCDB supports
complex data types such as multivalue and attachment fields. These new field types are
essentially recordsets in fields and allow the storage of multiple values in one field.
Prior to the introduction of Access, the desktop database market was dominated
by Borland with their Paradox and dBase programs, andFoxPro. Microsoft Access was the
first mass market database program for Windows. With the purchase of FoxPro and
incorporating its Rushmore query optimization routines into Access, Microsoft Access
quickly became the dominant database for Windows effectively eliminating the competition
which failed to transition from the MS-DOS world.
Access's initial codename was Cirrus; the forms engine was called Ruby. This was
before Visual Basic - Bill Gates saw the prototypes and decided that the BASIC language
component should be co-developed as a separate expandable application, a project called
Thunder. The two projects were developed separately as the underlying forms engines were
incompatible with each other; however, these were merged together again after VBA.
Access was also the name of a communications program from Microsoft, meant to compete
with ProComm and other programs. This proved a failure and was dropped. Years later;
Microsoft reused the name for its database software.
16 | P a g e
Simple tasks can be automated through macros with point-and-click options. Microsoft
Access is very popular among non-programmers who can create visually pleasing and
relatively advanced solutions on their own. It is also easy to place a database on a network
and have multiple users share and update data without overwriting each other’s work. Data
is locked at the record level which is significantly different from Excel which locks the entire
spreadsheet.
Microsoft offers a wide range of template databases within the program and for download
from their website. These options are available upon starting Access and allow users to
quickly use and enhance a database with pre-defined tables, queries, forms, reports, and
macros. Popular templates include tracking contacts, assets, issues, events, projects, and
tasks. Templates do not include VBA code.
Microsoft Access also offers the ability for programmers to create solutions using
the programming language Visual Basic for Applications (VBA), which is similar to Visual
Basic 6.0 (VB6) and used throughout the Microsoft Office programs such
as Excel, Word, Outlook and PowerPoint. Most VB6 code including the use of
Windows API calls can be used in VBA. Power users and developers can extend basic end-
user solutions to a professional solution with advanced automation, data validation, error
trapping, and multi-user support.
Database solutions created entirely in Microsoft Access are well suited for individual
and workgroup use across a network. The number of simultaneous users that can be
supported depends on the amount of data, the tasks being performed, level of use,
and application design. Generally accepted limits are solutions with 1 GB or less of data
(Access supports up to 2 GB) and 50 or fewer simultaneous users. This is appropriate for
workgroup and department solutions where the total number of users number a few hundred.
Applications that simply view data or have simple data entry can support considerably more
users. Applications that run complex queries or analysis across large datasets would naturally
require greater bandwidth and memory. Microsoft Access is designed to scale to support
more data and users by linking to multiple Access databases or using a back-end database
like Microsoft SQL Server. With the latter design, the amount of data and users can scale
to enterprise-level solutions.
17 | P a g e
Access 2010 will allow forms and reports to be published to web sites using what is called
"access web services" that runs on SharePoint software. These web based forms and reports
run in any standard browser. The resulting web forms and reports when run in the browser
don't require any ActiveX or add-ins like Silver light. Thus, the resulting application can be
used by running Firefox on Ubuntu Linux, for example.
The original concept of Access was for end users to be able to “access” data from any source.
Other uses include: the import and export of data to many formats
including Outlook ASCII, dBase, Paradox, FoxPro, SQL Server, Oracle, ODBC, etc. It also
has the ability to link to data in its existing location and use it for viewing, querying, editing,
and reporting. This allows the existing data to change and the Access platform to always use
the latest data. It can perform heterogeneous join between data sets stored across different
platforms. Access is often used by people downloading data from enterprise level
databases for manipulation, analysis, and reporting locally.
There is also the Jet Database format (MDB or ACCDB in Access 2007) which can contain
the application and data in one file. This makes it very convenient to distribute the entire
application to another user, who can run it in disconnected environments.
18 | P a g e
One of the benefits of Access from a programmer's perspective is its relative compatibility
with SQL (structured query language) — queries can be viewed graphically or edited as SQL
statements, and SQL statements can be used directly in Macros and VBA Modules to
manipulate Access tables. Users can mix and use both VBA and "Macros" for programming
forms and logic and offers object-oriented possibilities. VBA can also be included in queries.
Microsoft Access offers parameterized queries. These queries and Access tables can be
referenced from other programs like VB6 and .NET through DAO or ADO. From Microsoft
Access, VBA can reference parameterized stored procedures via ADO.
All database tables, queries, forms, reports, macros, and modules are stored in the Access Jet
database as a single file.
For query development, Access offers a Query Designer, a graphical user interface that
allows users to create queries without knowledge of the SQL programming language. In the
Query Designer, users can "show" the data sources of the query (which can be tables or
queries) and select the fields they want returned by clicking and dragging them into the grid.
Joins can be created by clicking and dragging fields in tables to fields in other tables. Access
allows users to view and manipulate the SQL code if desired. Any Access table, including
linked tables from different data sources, can be used in a query.
Access also supports the creation of Pass-Through queries. These are queries that can be
linked to external data sources through the use of ODBC connections on the local machine.
This enables users to interact with data stored outside the Access program without using
linked Tables. The Pass-Through queries are written using the SQL syntax supported by the
external data source.
When developing Reports that are linked to Queries placing or moving items in the design
view of the Report, Access runs the linked query in the background on any placement or
19 | P a g e
movement of an item in that Report. If the Report is linked to a Query that takes a long time
to return records this forces you to wait until the query has run before you can add/edit or
move the next item in the Report (this feature cannot be turned off).
Non-programmers can use the macro feature to automate simple tasks through a series of
drop down selections. Macros allow users to easily chain commands together such as running
queries, importing or exporting data, opening and closing forms, previewing and printing
reports, etc. Macros support basic logic (IF conditions) and the ability to call other macros.
Macros can also contain sub-macros which are similar to subroutines. In Access 2007,
macros are significantly enhanced with the inclusion of error handling and temporary
variable support. Access 2007 also introduces embedded macros that are essentially
properties of an object's event. This eliminates the need to store macros as individual objects.
Macros however, are limited in their functionality by a lack of programming loops and
advanced coding logic. Most professional Access developers use the VBA programming
language for a richer and more powerful development environment.
To manipulate data in tables and queries in VBA, two database access libraries
of COM components are provided: the Data Access Objects (DAO), which is included in
Access and Windows and evolved to ACE in Microsoft Access 2007 for the ACCDE
database format, and ActiveX Data Objects ActiveX Data Objects (ADO). Beside DAO and
ADO, developers can also use OLE DB and ODBC for developing native C/C++ programs
for Access. For ADPs and the direct manipulation of SQL Server data, ADO is required.
DAO is most appropriate for managing data in Access/Jet databases, and the only way to
manipulate the complex field types in ACCDB tables.
In the database container or navigation pane of Access 2007, the system automatically
categorizes each object by type. Many Access developers use the Leszynski naming
convention, though this is not universal; it is a programming convention, not a DBMS-
enforced rule. It is particularly helpful in VBA where references to object names may not
indicate its data type (e.g. tbl for tables, qry for queries).
Microsoft Access is most often used for individual and workgroup projects (the Access 97
speed characterization was done for 32 users).Since Access 97, and with Access 2003 and
2007, Microsoft Access and hardware have evolved significantly. Databases less than 1 GB
in size (which can now fit entirely in RAM) and 50 simultaneous users are well within the
capabilities of Microsoft Access. Of course, performance depends on the database design and
20 | P a g e
tasks. Disk intensive work such as complex searching and querying are the most time
consuming.
As data from a Microsoft Access database can be cached in RAM, processing speed may be
substantially better when there is only a single user or if the data is not changing. In the past,
the effect of packet latency on the record locking system caused Access databases to be too
slow on Virtual Private Network (VPN) or Wide Area Network (WAN) against a Jet
database. This is less of an issue now with broadband connections. Performance can also be
enhanced if a continuous connection is maintained to the back end database throughout the
session rather than opening and closing it for each table access. If Access Database
performance over VPN or WAN suffers, then Microsoft Terminal Services is an effective
solution. Access databases linked to SQL Server or Access Data Projects work great over
VPN and WAN.
SPLIT DATABASE ARCHITECTURE
Microsoft Access applications can adopt split-database architecture. The database can be
divided into a front end database that contains the application objects (queries, forms, reports,
macros, and modules), and is linked to tables stored in a back end shared database containing
the data. The "back-end" database can be stored in a location shared by many users, such as a
file server. The 'front-end' database is distributed to each user's desktop and linked to the
shared database. Using this design, each user has a copy of Microsoft Access installed on
their machine along with their application database. This reduces network traffic since the
application is not retrieved for each use, and allows the front end database to contain tables
with data that is private to each user for storing settings or temporary data. This split database
design also allows development of the application independent of the data. When a new
version is ready, the front end database is replaced without impacting the data database.
Microsoft Access has two built-in utilities, Database Splitter and Linked Table Manager, to
facilitate this architecture.
Linked tables in Access use absolute paths rather than relative paths, so the development
environment either has to have the same path as the production environment or a "dynamic-
linker" routine can be written in VBA.
This is not an economical setup across slow networks, or large organizations separated by
great distances, as this will result in excessive lag to database users. SQL backend should be
considered in these circumstances.
21 | P a g e
SOFTWARE REQUIREMENT SPECIFICATION
The user’s machine should not require any special setup to work with the Map-App. To
the extent possible, open source library (swingx-ws) has been used in the creation. User
should have a LAN and internet connection. User should also have JDK installed on
their systems.
To keep the Application costless Google maps and Yahoo maps API have not been used as
they do not provide free access to desktop application. Efforts are being made to make
connections to Google map server but have been fruitless so far. Moreover other free
geoservices have an old database so the maps and results for searches suffer for the cause.
NON-FUNCTIONAL REQUIREMENTS
There are requirements that are not functional in nature. Specifically, these are the
constraints the system must work within.
0.
Map-App
1. 2. 3.
Data Map-App
User Storage
Management Server
System
22 | P a g e
Add to Database
Done
User Information
Load Marker
Retrieve from Database
ACTIVITY DIAGRAM
Retr
User logs in
y
Ne
w
Register
Us
er Path
Que Finding
Browse Enter Search Item
ry
Enter Location
Add Marker Store Results
No Yes No
Yes
24 | P a g e
STATE CHART DIAGRAM
Enter user
details
User
exi Va
t lid
Cl Ab MapAppAboutBo
MapAppView
os ou x
e
t
Path
Marker
WikiWaypoint
Saved
25 | P a g e
CLASS DIAGRAM
Main(
Map-
App
)
Start
up()
Geta
pplica
tion()
MapAppAbo MapApp
utbox jTextfiel
View
main(
d(s)
closeButton
)
jMenub
closeAboutB ar
ox()
startu
jButton(
p()
s)
jLabel(s)
getap
Waypoint plica
tion()
position
search
getPosition
Wiki()
()
geocode
setPosition
()
()
revGeoc
ode()
weather
Marker User path
()
Wikiwaypoin lat store()
Name point1
t long
password point2
title
title
setMarker() set() setSource()
getTitle() getLat() getName() setDestinatio
getLng() getPass() n()
getTitle()
26 | P a g e
USE CASE DIAGRAM
Browse
Map
Search Location
Find Weather
Find Path
Search Wikipedia
Article
Save Locations
27 | P a g e
DEPLOYMENT DIAGRAM
<<Component Applicationcomputer
Web server
>> <<device>>
: http {OS=Windows}
<<Component
tilemapserver
>>
{openstreetm
<<Component Swing
aps}
>> http application
:webservice
{geonames}
University DB
{vendor=Oracle
version=9i}
COLLABORATION DIAGRAM
28 | P a g e
oc()
3:saveL
3:url()
PERFORMANCE REQUIREMENTS
System can withstand even though any no. of users access the Map-App. This is because of
the use of multithreaded approach. As we are keeping records server of the Map-App free of
user intervention it can withstand the load.
SAFETY REQUIREMENTS
By incorporating a records server from a proven RDBMS (ORACLE) into the system,
reliable performance and integrity of user accounts is ensured. There must be a power backup
for server system.
29 | P a g e
SECURITY REQUIREMENTS
Sensitive data (USER ACCOUNTS) is protected from unwanted access by using appropriate
technology and implementing strict user-access criteria. Currently, the only user to the Map-
App is already registered and the new users are created by database administrator.
FUNCTIONAL REQUIREMENT
Functional Requirements are those that refer to the functionality of the system, i.e.,
what services it will provide to the user.
The MAP-App will be a desktop application. When a User opens the application it
will connect to the online tile mapserver to load the map and data from the database is
loaded as required. Whenever a marker or a waypoint is added a respective entry is
made in the database. Also the previous markers are loaded from the database.
30 | P a g e
DESIGN
The MAP-App retrieves maps from the openstreetmaps server and marker locations
from the department server system. This system will be web-based, linking to tile map server
and online services such as geonames for location and article search. An Internet connection
is necessary to access the maps and other features of the application.
SYSTEM ENVIRONMENT
Map-App can work only if the end user system can establish a connection to a tile map server
(openstreetmaps in this case) also for user to be able to logon and store his data a connection
with the database server is necessary. On launch of application user will be asked to enter
username and password which will be cross-checked from the database. If match is
successful user will be able to store his data in the database.
Openstreet
Map Server
USE CASES
Add a Marker
Map-App
The User enters username and password, browses to his intended spot on map and adds a
marker at it.
Database
31 | P a g e
Enter login details
Requirements: the map-app should be connected to the records database and online map
server.
The User enters search item and the 10 results obtained are marked geographically with the
map cantered at the top result.
Requirements: the Map-App should be connected to the records database, online map server
and the geonames web service.
32 | P a g e
4. Confirmation is received.
The User enters street address which is searched and marked on the map if found.
Requirements: the Map-App should be connected to the records database, online map server
and web service.
URL: address
The User enters coordinates (latitude/longitude) which is searched and the address is
displayed on the map if found.
33 | P a g e
The User enters city name which is searched and weather is displayed if available.
Requirements: the Map-App should be connected to the online map server and web service.
34 | P a g e
2. Query is made to a web service which returns a XML page containing result. This
result is displayed.
The User enters/marks source and destination and the shortest path between them is
displayed.
Requirements: the map-app should be connected to the records database and online map
server. Calculate & Show shortest path
1. User centres the map and marks the source and destination.
2. Appropriate zoom level is selected.
3. User clicks on button ‘Find path’
4. The Graphical calculations are made and the shortest path is shown on the map.
35 | P a g e
DOCUMENTATION
CODING
/*
* MapAboutBox.java
*/
package mapapp;
import org.jdesktop.application.Action;
public class MapAboutBox extends javax.swing.JDialog {
public MapAboutBox(java.awt.Frame parent) {
super(parent);
initComponents();
getRootPane().setDefaultButton(closeButton);
}
@Action public void closeAboutBox() {
dispose();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
closeButton = new javax.swing.JButton();
javax.swing.JLabel appTitleLabel = new javax.swing.JLabel();
javax.swing.JLabel versionLabel = new javax.swing.JLabel();
javax.swing.JLabel appVersionLabel = new javax.swing.JLabel();
javax.swing.JLabel appDescLabel = new javax.swing.JLabel();
javax.swing.JLabel imageLabel = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
org.jdesktop.application.ResourceMap resourceMap =
org.jdesktop.application.Application.getInstance(mapapp.MapApp.class).getContext().getResourceMap(MapAb
outBox.class);
setTitle(resourceMap.getString("title")); // NOI18N
setModal(true);
setName("aboutBox"); // NOI18N
setResizable(false);
javax.swing.ActionMap actionMap =
org.jdesktop.application.Application.getInstance(mapapp.MapApp.class).getContext().getActionMap(MapAbou
tBox.class, this);
closeButton.setAction(actionMap.get("closeAboutBox")); // NOI18N
36 | P a g e
closeButton.setName("closeButton"); // NOI18N
appTitleLabel.setFont(appTitleLabel.getFont().deriveFont(appTitleLabel.getFont().getStyle() |
java.awt.Font.BOLD, appTitleLabel.getFont().getSize()+4));
appTitleLabel.setText(resourceMap.getString("Application.title")); // NOI18N
appTitleLabel.setName("appTitleLabel"); // NOI18N
versionLabel.setFont(versionLabel.getFont().deriveFont(versionLabel.getFont().getStyle() |
java.awt.Font.BOLD));
versionLabel.setText(resourceMap.getString("versionLabel.text")); // NOI18N
versionLabel.setName("versionLabel"); // NOI18N
appVersionLabel.setText(resourceMap.getString("Application.version")); // NOI18N
appVersionLabel.setName("appVersionLabel"); // NOI18N
appDescLabel.setText(resourceMap.getString("appDescLabel.text")); // NOI18N
appDescLabel.setName("appDescLabel"); // NOI18N
imageLabel.setIcon(resourceMap.getIcon("imageLabel.icon")); // NOI18N
imageLabel.setName("imageLabel"); // NOI18N
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(imageLabel)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(versionLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(appVersionLabel)
.addGap(152, 152, 152))
.addComponent(appTitleLabel, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(appDescLabel, javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)
.addComponent(closeButton))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup (javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(imageLabel, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(appTitleLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(appDescLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(versionLabel)
.addComponent(appVersionLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 83,
Short.MAX_VALUE)
.addComponent(closeButton)
.addContainerGap())
37 | P a g e
);
pack();
}// </editor-fold>
// Variables declaration - do not modify
private javax.swing.JButton closeButton;
// End of variables declaration
}
38 | P a g e
/*
* MapApp.java
*/
package mapapp;
import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;
/**
* The main class of the application.
*/
public class MapApp extends SingleFrameApplication {
/**
* At startup create and show the main frame of the application.
*/
@Override protected void startup() {
show(new MapView(this));
}
/**
* This method is to initialize the specified window by injecting resources.
* Windows shown in our application come fully initialized from the GUI
* builder, so this additional configuration is not needed.
*/
@Override protected void configureWindow(java.awt.Window root) {
}
/**
* A convenient static getter for the application instance.
* @return the instance of MapApp
*/
public static MapApp getApplication() {
return Application.getInstance(MapApp.class);
}
/**
* Main method launching the application.
*/
public static void main(String[] args) {
launch(MapApp.class, args);
}
}
39 | P a g e
/*
* MapView.java
*/
package mapapp;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Polygon;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.xpath.XPathExpressionException;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.Task;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.net.URL;
import java.sql.*;
import java.util.HashSet;
import java.util.Set;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPasswordField;
import javax.swing.SwingUtilities;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
import org.jdesktop.swingx.JXMapViewer;
import org.jdesktop.swingx.mapviewer.GeoPosition;
import org.jdesktop.swingx.mapviewer.Waypoint;
import org.jdesktop.swingx.mapviewer.WaypointPainter;
import org.jdesktop.swingx.mapviewer.WaypointRenderer;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
/**
* The application's main frame.
*/
public class MapView extends FrameView {
40 | P a g e
Connection con=null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:amit");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("Select * "+"from pass");
if(rs.next())
{
}
else
{
final JPasswordField jpf = new JPasswordField();
JOptionPane jop = new JOptionPane(jpf,
JOptionPane.QUESTION_MESSAGE,
JOptionPane.OK_CANCEL_OPTION);
JDialog dialog = jop.createDialog("Create New Password:");
dialog.addComponentListener(new ComponentAdapter(){
@Override
public void componentShown(ComponentEvent e){
SwingUtilities.invokeLater(new Runnable(){
@Override
public void run(){
jpf.requestFocusInWindow();
}
});
}
});
dialog.setVisible(true);
int result = (Integer)jop.getValue();
dialog.dispose();
String password = null;
if(result == JOptionPane.OK_OPTION){
password = jpf.getText();
Statement stmt1=con.createStatement();
stmt1.executeUpdate("insert into pass "+"values('"+password+"')");
JOptionPane.showMessageDialog(jXMapKit1,"Hi!! New User \n this is MapApp 2.0 "
, "Welcome",JOptionPane.PLAIN_MESSAGE);
}
if(result == JOptionPane.CANCEL_OPTION)
{
System.exit(0);
}
rs.close();
}
} catch(SQLException sqle) {
System.err.println(sqle.getMessage());
} catch(ClassNotFoundException cnfe) {
System.err.println(cnfe.getMessage());
} catch(Exception e) {
System.err.println(e.getMessage());
} finally {
41 | P a g e
try {
if(con!=null) {
con.close();
}
} catch(SQLException sqle) {
System.err.println(sqle.getMessage());
}
}
String a;
con=null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:amit");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("Select * "+"from pass where pswd='"+password+"'");
if(rs.next())
{
}
else
{
JOptionPane.showMessageDialog(jXMapKit1,"Bad Password!!"
, "Error!!!",JOptionPane.ERROR_MESSAGE);
System.exit(0);
}
rs.close();
} catch(SQLException sqle) {
System.err.println(sqle.getMessage());
42 | P a g e
} catch(ClassNotFoundException cnfe) {
System.err.println(cnfe.getMessage());
} catch(Exception e) {
System.err.println(e.getMessage());
} finally {
try {
if(con!=null) {
con.close();
}
} catch(SQLException sqle) {
System.err.println(sqle.getMessage());
}
}
}
if(result == JOptionPane.CANCEL_OPTION)
{
System.exit(0);
}
initComponents();
// status bar initialization - message timeout, idle icon and busy animation, etc
ResourceMap resourceMap = getResourceMap();
int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
messageTimer = new Timer(messageTimeout, new ActionListener() {
public void actionPerformed(ActionEvent e) {
statusMessageLabel.setText("");
}
});
messageTimer.setRepeats(false);
int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
for (int i = 0; i < busyIcons.length; i++) {
busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
}
busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
public void actionPerformed(ActionEvent e) {
busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
}
});
idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
43 | P a g e
statusAnimationLabel.setIcon(busyIcons[0]);
busyIconIndex = 0;
busyIconTimer.start();
}
progressBar.setVisible(true);
progressBar.setIndeterminate(true);
} else if ("done".equals(propertyName)) {
busyIconTimer.stop();
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
progressBar.setValue(0);
} else if ("message".equals(propertyName)) {
String text = (String)(evt.getNewValue());
statusMessageLabel.setText((text == null) ? "" : text);
messageTimer.restart();
} else if ("progress".equals(propertyName)) {
int value = (Integer)(evt.getNewValue());
progressBar.setVisible(true);
progressBar.setIndeterminate(false);
progressBar.setValue(value);
}
}
});
}
@Action
public void showAboutBox() {
if (aboutBox == null) {
JFrame mainFrame = MapApp.getApplication().getMainFrame();
aboutBox = new MapAboutBox(mainFrame);
aboutBox.setLocationRelativeTo(mainFrame);
}
MapApp.getApplication().show(aboutBox);
}
44 | P a g e
jLabel6 = new javax.swing.JLabel();
list1 = new java.awt.List();
ryte = new javax.swing.JButton();
jPanel7 = new javax.swing.JPanel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jTextField9 = new javax.swing.JTextField();
jButton5 = new javax.swing.JButton();
jLabel7 = new javax.swing.JLabel();
jTextField8 = new javax.swing.JTextField();
jLabel8 = new javax.swing.JLabel();
jPanel8 = new javax.swing.JPanel();
jLabel14 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
jLabel16 = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
jLabel18 = new javax.swing.JLabel();
jLabel19 = new javax.swing.JLabel();
jLabel20 = new javax.swing.JLabel();
jLabel21 = new javax.swing.JLabel();
jLabel22 = new javax.swing.JLabel();
jLabel23 = new javax.swing.JLabel();
jLabel24 = new javax.swing.JLabel();
jLabel25 = new javax.swing.JLabel();
gyu = new javax.swing.JPanel();
list3 = new java.awt.List();
afs = new javax.swing.JButton();
adasd = new javax.swing.JButton();
dfty = new javax.swing.JPanel();
sdf = new javax.swing.JButton();
gj = new javax.swing.JLabel();
adgf = new javax.swing.JLabel();
sgd = new javax.swing.JLabel();
ser = new javax.swing.JLabel();
jf1 = new javax.swing.JTextField();
jf2 = new javax.swing.JTextField();
asfa = new javax.swing.JLabel();
jf3 = new javax.swing.JTextField();
jBn4 = new javax.swing.JButton();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel3 = new javax.swing.JPanel();
jLabel13 = new javax.swing.JLabel();
jTextField10 = new javax.swing.JTextField();
jButton6 = new javax.swing.JButton();
jPanel9 = new javax.swing.JPanel();
list2 = new java.awt.List();
jPanel2 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
45 | P a g e
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jButton7 = new javax.swing.JButton();
jLabel26 = new javax.swing.JLabel();
jLabel27 = new javax.swing.JLabel();
menuBar = new javax.swing.JMenuBar();
javax.swing.JMenu fileMenu = new javax.swing.JMenu();
javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
javax.swing.JMenu helpMenu = new javax.swing.JMenu();
javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
statusPanel = new javax.swing.JPanel();
javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
statusMessageLabel = new javax.swing.JLabel();
statusAnimationLabel = new javax.swing.JLabel();
progressBar = new javax.swing.JProgressBar();
mainPanel.setName("mainPanel"); // NOI18N
jPanel1.setName("jPanel1"); // NOI18N
jXMapKit1.setDefaultProvider(org.jdesktop.swingx.JXMapKit.DefaultProviders.OpenStreetMaps);
jXMapKit1.setName("jXMapKit1"); // NOI18N
jTabbedPane2.setName("jTabbedPane2"); // NOI18N
jPanel4.setName("jPanel4"); // NOI18N
org.jdesktop.application.ResourceMap resourceMap =
org.jdesktop.application.Application.getInstance(mapapp.MapApp.class).getContext().getResourceMap(MapVi
ew.class);
jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
jLabel5.setName("jLabel5"); // NOI18N
jTextField3.setText(resourceMap.getString("jTextField3.text")); // NOI18N
jTextField3.setName("jTextField3"); // NOI18N
javax.swing.ActionMap actionMap =
org.jdesktop.application.Application.getInstance(mapapp.MapApp.class).getContext().getActionMap(MapView
.class, this);
jButton2.setAction(actionMap.get("searchWikipedia")); // NOI18N
jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
jButton2.setName("jButton2"); // NOI18N
jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
jLabel6.setName("jLabel6"); // NOI18N
list1.setName("list1"); // NOI18N
list1.setVisible(true);
ryte.setText(resourceMap.getString("ryte.text")); // NOI18N
ryte.setName("ryte"); // NOI18N
ryte.addActionListener(new java.awt.event.ActionListener() {
46 | P a g e
public void actionPerformed(java.awt.event.ActionEvent evt) {
ryteActionPerformed(evt);
}
});
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2))
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(ryte)
.addComponent(list1, javax.swing.GroupLayout.PREFERRED_SIZE, 68,
Short.MAX_VALUE))))
.addContainerGap())
);
47 | P a g e
jTabbedPane2.addTab(resourceMap.getString("jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N
jPanel7.setName("jPanel5"); // NOI18N
jLabel11.setName("jLabel7"); // NOI18N
jLabel12.setName("jLabel8"); // NOI18N
jTextField9.setName("jTextField5"); // NOI18N
jButton5.setAction(actionMap.get("findWeather")); // NOI18N
jButton5.setText(resourceMap.getString("jButton3.text")); // NOI18N
jButton5.setName("jButton3"); // NOI18N
jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
jLabel7.setName("jLabel7"); // NOI18N
jTextField8.setName("jTextField4"); // NOI18N
jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
jLabel8.setName("jLabel8"); // NOI18N
jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel8.border.title"))
); // NOI18N
jPanel8.setName("jPanel8"); // NOI18N
jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
jLabel14.setName("jLabel14"); // NOI18N
jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
jLabel15.setName("jLabel15"); // NOI18N
jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
jLabel16.setName("jLabel16"); // NOI18N
jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
jLabel17.setName("jLabel17"); // NOI18N
jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
jLabel18.setName("jLabel18"); // NOI18N
jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
jLabel19.setName("jLabel19"); // NOI18N
jLabel20.setName("jLabel20"); // NOI18N
jLabel21.setName("jLabel21"); // NOI18N
jLabel22.setName("jLabel22"); // NOI18N
jLabel23.setName("jLabel23"); // NOI18N
48 | P a g e
jLabel24.setName("jLabel24"); // NOI18N
jLabel25.setName("jLabel25"); // NOI18N
49 | P a g e
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel15)
.addComponent(jLabel18)
.addComponent(jLabel21)
.addComponent(jLabel24))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8,
Short.MAX_VALUE)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel16)
.addComponent(jLabel19)
.addComponent(jLabel22)
.addComponent(jLabel25)))
);
50 | P a g e
.addGroup(jPanel7Layout.createSequentialGroup()
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel11)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel12)
.addComponent(jLabel8)
.addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton5))
.addGroup(jPanel7Layout.createSequentialGroup()
.addGap(5, 5, 5)
.addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addContainerGap())
);
gyu.setName("gyu"); // NOI18N
list3.setName("list3"); // NOI18N
afs.setText(resourceMap.getString("afs.text")); // NOI18N
afs.setName("afs"); // NOI18N
afs.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
afsActionPerformed(evt);
}
});
adasd.setText(resourceMap.getString("adasd.text")); // NOI18N
adasd.setName("adasd"); // NOI18N
adasd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
adasdActionPerformed(evt);
}
});
51 | P a g e
.addGroup(gyuLayout.createSequentialGroup()
.addGap(26, 26, 26)
.addComponent(adasd)
.addGap(89, 89, 89)
.addComponent(list3, javax.swing.GroupLayout.PREFERRED_SIZE, 197,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(31, 31, 31)
.addComponent(afs)
.addContainerGap(353, Short.MAX_VALUE))
);
gyuLayout.setVerticalGroup(
gyuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(gyuLayout.createSequentialGroup()
.addGroup(gyuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(gyuLayout.createSequentialGroup()
.addContainerGap()
.addComponent(list3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(gyuLayout.createSequentialGroup()
.addGap(32, 32, 32)
.addComponent(afs))
.addGroup(gyuLayout.createSequentialGroup()
.addGap(34, 34, 34)
.addComponent(adasd)))
.addContainerGap(12, Short.MAX_VALUE))
);
dfty.setName("dfty"); // NOI18N
sdf.setText(resourceMap.getString("sdf.text")); // NOI18N
sdf.setName("sdf"); // NOI18N
sdf.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
sdfActionPerformed(evt);
}
});
gj.setText(resourceMap.getString("gj.text")); // NOI18N
gj.setName("gj"); // NOI18N
adgf.setText(resourceMap.getString("adgf.text")); // NOI18N
adgf.setName("adgf"); // NOI18N
sgd.setText(resourceMap.getString("sgd.text")); // NOI18N
sgd.setName("sgd"); // NOI18N
ser.setText(resourceMap.getString("ser.text")); // NOI18N
ser.setName("ser"); // NOI18N
jf1.setText(resourceMap.getString("jf1.text")); // NOI18N
52 | P a g e
jf1.setName("jf1"); // NOI18N
jf2.setText(resourceMap.getString("jf2.text")); // NOI18N
jf2.setName("jf2"); // NOI18N
asfa.setText(resourceMap.getString("asfa.text")); // NOI18N
asfa.setName("asfa"); // NOI18N
jf3.setText(resourceMap.getString("jf3.text")); // NOI18N
jf3.setName("jf3"); // NOI18N
jBn4.setText(resourceMap.getString("jBn4.text")); // NOI18N
jBn4.setName("jBn4"); // NOI18N
jBn4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBn4ActionPerformed(evt);
}
});
53 | P a g e
.addGap(382, 382, 382))
);
dftyLayout.setVerticalGroup(
dftyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(dftyLayout.createSequentialGroup()
.addContainerGap()
.addGroup(dftyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(gj)
.addComponent(sgd)
.addComponent(jf1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(asfa)
.addComponent(jf3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(dftyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(dftyLayout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(adgf)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(sdf)
.addGap(25, 25, 25))
.addGroup(dftyLayout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(dftyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ser)
.addComponent(jf2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jBn4))
.addContainerGap())))
);
jTabbedPane1.setName("jTabbedPane1"); // NOI18N
jPanel3.setName("jPanel3"); // NOI18N
jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
jLabel13.setName("jLabel13"); // NOI18N
jTextField10.setText(resourceMap.getString("jTextField10.text")); // NOI18N
jTextField10.setName("jTextField10"); // NOI18N
jButton6.setAction(actionMap.get("postalSearch")); // NOI18N
jButton6.setText(resourceMap.getString("jButton6.text")); // NOI18N
jButton6.setName("jButton6"); // NOI18N
jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel9.border.title"))
); // NOI18N
jPanel9.setName("jPanel9"); // NOI18N
54 | P a g e
list2.setName("list2"); // NOI18N
55 | P a g e
jTabbedPane1.addTab(resourceMap.getString("jPanel3.TabConstraints.tabTitle"), jPanel3); // NOI18N
jPanel2.setName("jPanel2"); // NOI18N
jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
jLabel1.setName("jLabel1"); // NOI18N
jTextField1.setText(resourceMap.getString("jTextField1.text")); // NOI18N
jTextField1.setName("jTextField1"); // NOI18N
jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
jLabel2.setName("jLabel2"); // NOI18N
jTextField2.setText(resourceMap.getString("jTextField2.text")); // NOI18N
jTextField2.setName("jTextField2"); // NOI18N
jButton1.setAction(actionMap.get("geoCode")); // NOI18N
jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
jButton1.setName("jButton1"); // NOI18N
jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
jLabel3.setName("jLabel3"); // NOI18N
jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
jLabel4.setName("jLabel4"); // NOI18N
jButton7.setAction(actionMap.get("forUS")); // NOI18N
jButton7.setText(resourceMap.getString("jButton7.text")); // NOI18N
jButton7.setName("jButton7"); // NOI18N
jLabel26.setText(resourceMap.getString("jLabel26.text")); // NOI18N
jLabel26.setName("jLabel26"); // NOI18N
jLabel27.setText(resourceMap.getString("jLabel27.text")); // NOI18N
jLabel27.setName("jLabel27"); // NOI18N
56 | P a g e
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel2Layout.createSequentialGroup()
.addGap(14, 14, 14)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 92,
Short.MAX_VALUE))
.addComponent(jTextField2, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 106,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jLabel26)
.addComponent(jLabel27))
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(39, 39, 39)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2))
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton7))
.addGap(18, 18, 18)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 22,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel4)
.addGap(4, 4, 4)
.addComponent(jLabel26)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel27)
.addContainerGap(351, Short.MAX_VALUE))
);
jButton1.getAccessibleContext().setAccessibleDescription(resourceMap.getString("jButton1.AccessibleContext
.accessibleDescription")); // NOI18N
57 | P a g e
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jTabbedPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 895,
Short.MAX_VALUE)
.addComponent(jXMapKit1, javax.swing.GroupLayout.DEFAULT_SIZE, 895,
Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 217,
javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jXMapKit1, javax.swing.GroupLayout.DEFAULT_SIZE, 430,
Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 130,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 571,
Short.MAX_VALUE))
.addContainerGap())
);
menuBar.setName("menuBar"); // NOI18N
fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
fileMenu.setName("fileMenu"); // NOI18N
exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
exitMenuItem.setName("exitMenuItem"); // NOI18N
58 | P a g e
fileMenu.add(exitMenuItem);
menuBar.add(fileMenu);
helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
helpMenu.setName("helpMenu"); // NOI18N
aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
aboutMenuItem.setName("aboutMenuItem"); // NOI18N
helpMenu.add(aboutMenuItem);
menuBar.add(helpMenu);
statusPanel.setName("statusPanel"); // NOI18N
statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N
statusMessageLabel.setName("statusMessageLabel"); // NOI18N
statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N
progressBar.setName("progressBar"); // NOI18N
59 | P a g e
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(3, 3, 3))
);
setComponent(mainPanel);
setMenuBar(menuBar);
setStatusBar(statusPanel);
}// </editor-fold>
GeoPosition g;
g=jXMapKit1.getCenterPosition();
jf1.setText(Double.toString(g.getLatitude()));
jf2.setText(Double.toString(g.getLongitude()));
}
JOptionPane.showMessageDialog(jPanel4,sum,title, JOptionPane.INFORMATION_MESSAGE);
Connection con=null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:amit");
Statement stmt=con.createStatement();
stmt.executeUpdate("insert into marker "+"values("+lat+","+lon+",'"+t+"')");
} catch(SQLException sqle) {
60 | P a g e
System.err.println(sqle.getMessage());
} catch(ClassNotFoundException cnfe) {
System.err.println(cnfe.getMessage());
} catch(Exception e) {
System.err.println(e.getMessage());
} finally {
try {
if(con!=null) {
con.close();
}
} catch(SQLException sqle) {
System.err.println(sqle.getMessage());
}
}
}
Double lat[];
Double lon[];
} catch(SQLException sqle) {
System.err.println(sqle.getMessage());
} catch(ClassNotFoundException cnfe) {
System.err.println(cnfe.getMessage());
} catch(Exception e) {
System.err.println(e.getMessage());
} finally {
try {
if(con!=null) {
61 | P a g e
con.close();
}
} catch(SQLException sqle) {
System.err.println(sqle.getMessage());
}
}
t=list3.getSelectedItem();
waypoints.add(new WikiWaypoint(lt, ln, t));
jXMapKit1.setAddressLocation(waypoints.iterator().next().getPosition());
//create a renderer
painter.setRenderer(new WaypointRenderer() {
public boolean paintWaypoint(Graphics2D g, JXMapViewer map, Waypoint wp) {
WikiWaypoint wwp = (mapapp.WikiWaypoint) wp;
//draw tab
g.setPaint(new Color(0,0,255,200));
Polygon triangle = new Polygon();
triangle.addPoint(0,0);
triangle.addPoint(11,11);
triangle.addPoint(-11,11);
g.fill(triangle);
int width = (int) g.getFontMetrics().getStringBounds(wwp.getTitle(), g).getWidth();
g.fillRoundRect(-width/2 -5, 10, width+10, 20, 10, 10);
return false;
}
});
jXMapKit1.getMainMap().setOverlayPainter(painter);
jXMapKit1.getMainMap().repaint();
}
62 | P a g e
ResultSet rs=stmt.executeQuery("Select * "+"from marker");
while(rs.next()) {
list3.add(rs.getString("title"));
}
rs.close();
} catch(SQLException sqle) {
System.err.println(sqle.getMessage());
} catch(ClassNotFoundException cnfe) {
System.err.println(cnfe.getMessage());
} catch(Exception e) {
System.err.println(e.getMessage());
} finally {
try {
if(con!=null) {
con.close();
}
} catch(SQLException sqle) {
System.err.println(sqle.getMessage());
}
}
}
@Action
public Task geoCode() {
return new GeoCodeTask(getApplication());
}
63 | P a g e
node, XPathConstants.STRING);
jLabel4.setText(title);
Double lat = (Double) xpath.evaluate("lat/text()",
node, XPathConstants.NUMBER);
Double lon = (Double) xpath.evaluate("lng/text()",
node, XPathConstants.NUMBER);
waypoints.add(new WikiWaypoint(lat, lon, title));
}
jXMapKit1.setAddressLocation(waypoints.iterator().next().getPosition());
//create a renderer
painter.setRenderer(new WaypointRenderer() {
public boolean paintWaypoint(Graphics2D g, JXMapViewer map, Waypoint wp) {
WikiWaypoint wwp = (mapapp.WikiWaypoint) wp;
//draw tab
g.setPaint(new Color(0,0,255,200));
Polygon triangle = new Polygon();
triangle.addPoint(0,0);
triangle.addPoint(11,11);
triangle.addPoint(-11,11);
g.fill(triangle);
int width = (int) g.getFontMetrics().getStringBounds(wwp.getTitle(), g).getWidth();
g.fillRoundRect(-width/2 -5, 10, width+10, 20, 10, 10);
return false;
}
});
jXMapKit1.getMainMap().setOverlayPainter(painter);
jXMapKit1.getMainMap().repaint();
return waypoints; // return your result
} catch (Exception ex) {
JOptionPane.showMessageDialog(jXMapKit1,"An Error has occured , please try another query"
, "Error!!!",JOptionPane.ERROR_MESSAGE);
ex.printStackTrace();
return null;
}
64 | P a g e
}
@Override protected void succeeded(Object result) {
// Runs on the EDT. Update the GUI based on
// the result computed by doInBackground().
}
}
NodeList list;
XPath xpath;
@Action
public Task searchWikipedia() {
return new SearchWikipediaTask(getApplication());
}
jXMapKit1.setAddressLocation(waypoints.iterator().next().getPosition());
65 | P a g e
//create a renderer
painter.setRenderer(new WaypointRenderer() {
public boolean paintWaypoint(Graphics2D g, JXMapViewer map, Waypoint wp) {
WikiWaypoint wwp = (mapapp.WikiWaypoint) wp;
//draw tab
g.setPaint(new Color(0,0,255,200));
Polygon triangle = new Polygon();
triangle.addPoint(0,0);
triangle.addPoint(11,11);
triangle.addPoint(-11,11);
g.fill(triangle);
int width = (int) g.getFontMetrics().getStringBounds(wwp.getTitle(), g).getWidth();
g.fillRoundRect(-width/2 -5, 10, width+10, 20, 10, 10);
return false;
}
});
jXMapKit1.getMainMap().setOverlayPainter(painter);
jXMapKit1.getMainMap().repaint();
return waypoints; // return your result
} catch (Exception ex) {
JOptionPane.showMessageDialog(jXMapKit1,"An Error has occured , please try another query"
, "Error!!!",JOptionPane.ERROR_MESSAGE);
ex.printStackTrace();
return null;
}
}
@Override protected void succeeded(Object result) {
// Runs on the EDT. Update the GUI based on
// the result computed by doInBackground().
}
}
@Action
public Task findWeather() {
return new FindWeatherTask(getApplication());
}
66 | P a g e
// doInBackground() depends on from parameters
// to FindWeatherTask fields, here.
super(app);
}
@Override protected Set<WikiWaypoint> doInBackground() {
try {
// example: http://ws.geonames.org/findNearByWeather?lat=42&lng=-2&style=full
}
jXMapKit1.setAddressLocation(waypoints.iterator().next().getPosition());
//create a renderer
painter.setRenderer(new WaypointRenderer() {
public boolean paintWaypoint(Graphics2D g, JXMapViewer map, Waypoint wp) {
WikiWaypoint wwp = (mapapp.WikiWaypoint) wp;
//draw tab
g.setPaint(new Color(0,0,255,200));
Polygon triangle = new Polygon();
triangle.addPoint(0,0);
triangle.addPoint(11,11);
triangle.addPoint(-11,11);
g.fill(triangle);
int width = (int) g.getFontMetrics().getStringBounds(wwp.getTitle(), g).getWidth();
67 | P a g e
g.fillRoundRect(-width/2 -5, 10, width+10, 20, 10, 10);
return false;
}
});
jXMapKit1.getMainMap().setOverlayPainter(painter);
jXMapKit1.getMainMap().repaint();
return waypoints; // return your result
} catch (Exception ex) {
jLabel20.setText("");
jLabel21.setText("");
jLabel22.setText("");
jLabel23.setText("");
jLabel24.setText("");
jLabel25.setText("");
JOptionPane.showMessageDialog(jXMapKit1,"An Error has occured " +
"because of ::\n(i)data for the coordinates not available or" +
"\n(ii)Invalid coordinates", "Error!!!",JOptionPane.ERROR_MESSAGE);
ex.printStackTrace();
return null;
}
}
@Override protected void succeeded(Object result) {
// Runs on the EDT. Update the GUI based on
// the result computed by doInBackground().
}
}
@Action
public Task postalSearch() {
return new PostalSearchTask(getApplication());
}
private class PostalSearchTask extends org.jdesktop.application.Task<Object, Void> {
PostalSearchTask(org.jdesktop.application.Application app) {
// Runs on the EDT. Copy GUI state that
// doInBackground() depends on from parameters
// to PostalSearchTask fields, here.
super(app);
}
@Override protected Set<WikiWaypoint> doInBackground() {
try {
// http://ws.geonames.org/postalCodeSearch?postalcode=226016&maxRows=10&style=full
68 | P a g e
URL url = new URL("http://ws.geonames.org/postalCodeSearch?postalcode="+jTextField10.getText()
+"&maxRows=10&style=full");
list2.removeAll();
XPath xpath = XPathFactory.newInstance().newXPath();
NodeList list = (NodeList) xpath.evaluate("//geonames//code",new
InputSource(url.openStream()),XPathConstants.NODESET);
Set<WikiWaypoint> waypoints = new
HashSet<mapapp.WikiWaypoint>();
for(int i = 0; i < list.getLength(); i++) {
org.w3c.dom.Node node = list.item(i);
String title = (String) xpath.evaluate("name/text()",
node, XPathConstants.STRING)+" , "+(String) xpath.evaluate("adminName2/text()",
node, XPathConstants.STRING)+" , "+(String) xpath.evaluate("adminName1/text()",
node, XPathConstants.STRING);
Double lat = (Double) xpath.evaluate("lat/text()",
node, XPathConstants.NUMBER);
Double lon = (Double) xpath.evaluate("lng/text()",
node, XPathConstants.NUMBER);
if(i==0)
{
jTextField8.setText(lat.toString());
jTextField9.setText(lon.toString());
}
list2.add(i+1+"."+(String) xpath.evaluate("name/text()",
node, XPathConstants.STRING)+", Lat: "+(String) xpath.evaluate("lat/text()",
node, XPathConstants.STRING)+", Lon: "+(String) xpath.evaluate("lng/text()",
node, XPathConstants.STRING),i);
waypoints.add(new WikiWaypoint(lat, lon, title));
}
jXMapKit1.setAddressLocation(waypoints.iterator().next().getPosition());
69 | P a g e
g.drawString(wwp.getTitle(), -width/2, 26); //text
return false;
}
});
jXMapKit1.getMainMap().setOverlayPainter(painter);
jXMapKit1.getMainMap().repaint();
return waypoints; // return your result
} catch (Exception ex) {
JOptionPane.showMessageDialog(jXMapKit1,"An Error has occured , please try another query"
, "Error!!!",JOptionPane.ERROR_MESSAGE);
ex.printStackTrace();
return null;
}
}
@Override protected void succeeded(Object result) {
// Runs on the EDT. Update the GUI based on
// the result computed by doInBackground().
}
}
@Action
public Task forUS() {
return new ForUSTask(getApplication());
}
70 | P a g e
node, XPathConstants.STRING);
jLabel4.setText((String) xpath.evaluate("placename/text()",
node, XPathConstants.STRING));
jLabel26.setText((String) xpath.evaluate("streetNumber/text()",
node, XPathConstants.STRING)+", "+(String) xpath.evaluate("street/text()",
node, XPathConstants.STRING)+", "+(String) xpath.evaluate("adminName2/text()",
node, XPathConstants.STRING)+", "+(String) xpath.evaluate("adminName1/text()",
node, XPathConstants.STRING));
jLabel27.setText((String) xpath.evaluate("countryCode/text()",
node, XPathConstants.STRING)+". PIN : "+(String) xpath.evaluate("postalcode/text()",
node, XPathConstants.STRING));
Double lat = (Double) xpath.evaluate("lat/text()",
node, XPathConstants.NUMBER);
Double lon = (Double) xpath.evaluate("lng/text()",
node, XPathConstants.NUMBER);
if(i==0)
jTextField10.setText((String) xpath.evaluate("postalcode/text()",
node, XPathConstants.STRING));
waypoints.add(new WikiWaypoint(lat, lon, title));
}
jXMapKit1.setAddressLocation(waypoints.iterator().next().getPosition());
WaypointPainter painter = new WaypointPainter();
//set the waypoints
painter.setWaypoints(waypoints);
//create a renderer
painter.setRenderer(new WaypointRenderer() {
public boolean paintWaypoint(Graphics2D g, JXMapViewer map, Waypoint wp) {
WikiWaypoint wwp = (mapapp.WikiWaypoint) wp;
//draw tab
g.setPaint(new Color(0,0,255,200));
Polygon triangle = new Polygon();
triangle.addPoint(0,0);
triangle.addPoint(11,11);
triangle.addPoint(-11,11);
g.fill(triangle);
int width = (int) g.getFontMetrics().getStringBounds(wwp.getTitle(), g).getWidth();
g.fillRoundRect(-width/2 -5, 10, width+10, 20, 10, 10);
//draw text w/ shadow
g.setPaint(Color.BLACK);
g.drawString(wwp.getTitle(), -width/2-1, 26-1); //shadow
g.drawString(wwp.getTitle(), -width/2-1, 26-1); //shadow
g.setPaint(Color.WHITE);
g.drawString(wwp.getTitle(), -width/2, 26); //text
return false;
}
});
jXMapKit1.getMainMap().setOverlayPainter(painter);
jXMapKit1.getMainMap().repaint();
return waypoints; // return your result
} catch (Exception ex) {
JOptionPane.showMessageDialog(jXMapKit1,"An Error has occured , please try another query"
71 | P a g e
, "Error!!!",JOptionPane.ERROR_MESSAGE);
ex.printStackTrace();
return null;
}
}
@Override protected void succeeded(Object result) {
// Runs on the EDT. Update the GUI based on
// the result computed by doInBackground().
}
}
// Variables declaration - do not modify
private javax.swing.JButton adasd;
private javax.swing.JLabel adgf;
private javax.swing.JButton afs;
private javax.swing.JLabel asfa;
private javax.swing.JPanel dfty;
private javax.swing.JLabel gj;
private javax.swing.JPanel gyu;
private javax.swing.JButton jBn4;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JButton jButton7;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel21;
private javax.swing.JLabel jLabel22;
private javax.swing.JLabel jLabel23;
private javax.swing.JLabel jLabel24;
private javax.swing.JLabel jLabel25;
private javax.swing.JLabel jLabel26;
private javax.swing.JLabel jLabel27;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
72 | P a g e
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel7;
private javax.swing.JPanel jPanel8;
private javax.swing.JPanel jPanel9;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTabbedPane jTabbedPane2;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField10;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField8;
private javax.swing.JTextField jTextField9;
private org.jdesktop.swingx.JXMapKit jXMapKit1;
private javax.swing.JTextField jf1;
private javax.swing.JTextField jf2;
private javax.swing.JTextField jf3;
private java.awt.List list1;
private java.awt.List list2;
private java.awt.List list3;
private javax.swing.JPanel mainPanel;
private javax.swing.JMenuBar menuBar;
private javax.swing.JProgressBar progressBar;
private javax.swing.JButton ryte;
private javax.swing.JButton sdf;
private javax.swing.JLabel ser;
private javax.swing.JLabel sgd;
private javax.swing.JLabel statusAnimationLabel;
private javax.swing.JLabel statusMessageLabel;
private javax.swing.JPanel statusPanel;
// End of variables declaration
private final Timer messageTimer;
private final Timer busyIconTimer;
private final Icon idleIcon;
private final Icon[] busyIcons = new Icon[15];
private int busyIconIndex = 0;
private JDialog aboutBox;
}
73 | P a g e
/*WikiWaypoiont.java
package mapapp;
import org.jdesktop.swingx.mapviewer.GeoPosition;
import org.jdesktop.swingx.mapviewer.Waypoint;
/**
* @author amit singh
*/
class WikiWaypoint extends Waypoint {
private GeoPosition position;
private String title;
/**
* Creates a new instance of Waypoint at lat/long 0,0
*/
public WikiWaypoint() {
position=new GeoPosition(0, 0);
}
/**
* Creates a new instance of Waypoint at the specified
* latitude and longitude
* @param latitude new latitude
* @param longitude new longitude
*/
public WikiWaypoint(double latitude, double longitude,String t) {
position=new GeoPosition(latitude,longitude);
title=t;
}
/**
* Creates a new instance of Waypoint at the specified
* GeoPosition
* @param coord a GeoPosition to initialize the new Waypoint
*/
public WikiWaypoint(GeoPosition coord) {
this.position = coord;
}
/**
* Get the current GeoPosition of this Waypoint
* @return the current position
*/
@Override
public GeoPosition getPosition() {
return position;
}
74 | P a g e
/**
* Set a new GeoPosition for this Waypoint
* @param coordinate a new position
*/
@Override
public void setPosition(GeoPosition coordinate) {
GeoPosition old = getPosition();
this.position = coordinate;
firePropertyChange("position", old, getPosition());
}
75 | P a g e
OUTPUT OF THE MODULES
First Run
76 | P a g e
Password Dialog
77 | P a g e
Wikipedia Search
Weather Search
78 | P a g e
Add a Marker
79 | P a g e
Geocode (Postal Code to Lat/Long)
80 | P a g e
Reverse Geocode(Lat/lng to address)-General
81 | P a g e
TESTING
McCabe Cyclomatic Complexity
Complexity=18
1. Name of Location
DESCRIPTION
- This function has been used to enter the name of the new place.
Equivalence classes:
E1 = length of the name between 0 and 50 valid
E5=blank/space invalid
82 | P a g e
TEST CASES
TEST NAME EXPECTED
ID OUTPUT
1 abc Valid
2 xvz………(upto 51) Invalid
3 (blank) Invalid
4 567 Valid
5 *&% Valid
Equivalence classes
E1 = floating type number between -90 and 90 valid
TEST CASES
TEST LATITUDE EXPECTED
ID OUTPUT
1 50.02 Valid
2 xvz Invalid
3 - Valid
4 -567.0 Invalid
5 *&% Invalid
83 | P a g e
Postal code
DESCRIPTION
- This function has been used to enter the postal code.
Equivalence classes
TEST CASES :
84 | P a g e
BOUNDARY VALUE ANALYSIS
1) LATITUDE
-90 0 +90
-90.01(INVALID) 89.99(VALID)
2) LONGITUDE
-180 0 180
-180.01(INVALID) 179.99(VALID)
3) POSTAL CODE
-1(INVALID) 1(VALID)
85 | P a g e
FUTURE ANALYSIS
so the main objective behind the development of this project was to develop to such a light
weight mapping application that can work efficiently and properly on the low configuration
computers and having connected by a very low network internet connection.
So this Map-App mapping application not only provides the user the location of the target
place and also provides the other information about that place like weather condition. The
other benefit of this project is that this is very light weight computing application that runs
very efficiently on the low configuration computers also.
AS A MOBILE APPLICATION
The future scope of the project is also for the making such a mini application for the light
processing devices like mobile phone for accessing the devices also.
REFERENCES
https://swingx-ws.dev.java.net/
http://forums.java.net
www.geonames.org
“JAVA COMPLETE REFERENCE” is a Java text book by Herb Schidlt
“DATABASE SYSTEM CONCEPTS” is a database text book by Korth.
86 | P a g e