Professional Documents
Culture Documents
Dimensionality reduction methods used for prediction can be direct into a general framework by
deriving from a common target function. In traditional work, we provide a framework for
applying additive models to a large number of input variables. The main idea is to reduce the
task dimensionality by deriving a small number of new covariates obtained by linear
combinations of the inputs, the linear weights being estimated with respect to the present
regression problem. The weights are also limited to prevent overshooting and facilitate the
interpretation of the derived covariates. We determine the identifiability of the model under mild
assumptions and represent an approximate algorithm. In the proposed system, a model to predict
how people spread from one place to another after a certain time. This information is very useful
to investigate questions such as the prediction of vehicle traffic and the spread of contagious
diseases. The standard statistics provided by commercial dimensionality data are used as inputs
to our prediction model. Experiments show that if the measured time slot is less than the
expected cell residence time and is not close to the expected call retention time, a good accuracy
of the prediction model can be expected. Dimensionality Reduction is usually achieved on the
feature space by accepting one of the prescribed methods that fall under the chosen technique.
Data pre-processing is an approach in which these irregularities are detected, analyzed, and
processed by using certain behavioral predictions and modifications to alter the inapplicability
present in the record.
INTRODUCTION
Prediction of human movement behavior is important for studying issues such as prediction of
vehicle traffic and spread of contagious diseases, which requires tracing the movement of people.
In, a wireless sensor network technology is utilized to obtain high-resolution data of close
proximity interactions which cause the spread of most contagious diseases. However, this
method needs extra effort to distribute the senor network motes, and is constrained in a small
area.
The Cell-ID-based method determines the mobile users position based on the coverage of SAs.
An SA includes one or more cells. At most one-cell-sized accuracy (about 500 meters) can be
achieved when the SA includes only one cell. The observed time difference of arrival (OTDOA)
method utilizes trilateration to determine the mobile users position. At least three concurrent
downlink signals from different cells are measured by the mobile phone. The time differences
among the signal arrivals are calculated to form hyperbolic curves. The intersection of these
curves is then used to indicate the mobile users position.
A normal uplink signal from the mobile user is measured in different cells, and no extra signal is
required. Same calculation process as OTDOA is then conducted to find out the mobile users
position. Since the measurement and the calculation process are exercised only in the RAN, this
method does not require any modification to the mobile phone.
EXISITING SYSTEM
However, additive models are not adapted to problems involving a large number (eg, hundreds)
of input variables because they are prone to over-adaptation, in addition to the loss of readability.
We present a framework for the application of additive models to a large number of input
variables. The basic idea is to reduce the task dimensionality by deriving a small number of new
co-variants obtained by linear combinations of inputs, estimating the linear weights in view of
the present regression problem. The weights are also limited to prevent overshooting and
facilitate the interpretation of the derived covariates. We determine the identifiability of the
model under mild assumptions and represent an approximate algorithm. Experiments on
synthetic and real data show that our approach is comparable in terms of accuracy compared to
baseline methods, resulting in models with lower complexity and practical insights In high-
dimensional real regression tasks.
DISADVANTAGES
Additive models are not designed for problems with a large number of input variables.
The structured dimen- sionality reduction is not a constraint; it is very difficult to trace
the influence of the input variables on the final response variable, since deletions can
occur systematically between the different derived covariates.
PROPOSED SYSTEM
A model for predicting how people spread from one place to another after a certain time. This
information is very useful to investigate questions such as the prediction of vehicle traffic and the
spread of contagious diseases. The standard statistics provided by commercial dimensionality
data are used as inputs to our prediction model. Experiments show that if the measured time slot
is less than the expected cell residence time and is not close to the expected call retention time, a
good accuracy of the prediction model can be expected. Dimensionality Reduction is usually
achieved on the feature space by accepting one of the prescribed methods that fall under the
chosen technique. Data pre-processing is an approach in which these irregularities are detected,
analyzed, and processed by using certain behavioral predictions and modifications to alter the
inapplicability present in the record. Our framework expands the applicability to high-
dimensional problems while maintaining their interpretability and their potential to provide
practical insights.
ADVANTAGES
The advantages of this method include the asymptotic efficiency of maximum likelihood
estimates under regularity conditions.
The technological advancements specifically the in data collection and the geographic
information systems area has enabled users to capture various aspects of the systems
ranging from the widespread physical to the high precision features.
We can take the advantage of reduced dimensionality to form better neighborhood of
customers.
FEASIBILITY STUDY
The feasibility of the project is analyzed in this phase and business proposal is put forth with
a very general plan for the project and some cost estimates. During system analysis the
feasibility study of the proposed system is to be carried out. This is to ensure that the
proposed system is not a burden to the company. For feasibility analysis, some
understanding of the major requirements for the system is essential.
Economical Feasibility
Technical Feasibility
Social Feasibility
Economical Feasibility
This study is carried out to check the economic impact that the system will have on the
organization. The amount of fund that the company can pour into the research and development
of the system is limited. The expenditures must be justified. Thus the developed system as well
within the budget and this was achieved because most of the technologies used are freely
available. Only the customized products had to be purchased.
Technical Feasibility
This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand on the available
technical resources. This will lead to high demands on the available technical resources. This
will lead to high demands being placed on the client. The developed system must have a modest
requirement, as only minimal or null changes are required for implementing this system.
Social Feasibility
The aspect of study is to check the level of acceptance of the system by the user. This
includes the process of training the user to use the system efficiently. The user must not feel
threatened by the system, instead must accept it as a necessity. The level of acceptance by the
users solely depends on the methods that are employed to educate the user about the system and
to make him familiar with it. His level of confidence must be raised so that he is also able to
make some constructive criticism, which is welcomed, as he is the final user of the system.
SYSTEM SPECIFICATION
SOFTWARE REQUIREMENTS
Hard disk : 80 GB
HARDWARE REQUIREMENTS
Front-End : eclipse
MODULES:
Human Movement:
Large samples of human movements. Our solution is the first work that can statistically answer
this question by effectively utilizing the statistics collected from millions of mobile users. As a
final remark, this work is pending US and Taiwan patents. The aforementioned techniques can
effectively monitor the behaviors of specific mobile users at the cost of modifications to telecom
network, which are not appropriate to generate behavior statistics for a large number of users that
are typically required to study problems such as pedestrian movement and contagious disease
spread.
Dimension Reduction
Dimension reduction is the process of reducing the random number of variables under
consideration. In recent years, the high dimensionality of modern massive datasets has provided
a considerable challenge to efficient algorithmic solutions design. Dimensionality reduction
techniques aims at finding the meaningful low dimensional data structures hidden in their high-
dimensional observations which allow the user to better analyze the complex data sets. Feature
extraction and feature selection are two popular methods for dimensionality reduction.
Dimension reduction techniques may be divided into two classes: linear methods [e.g. the
Principal Component Analysis (PCA), linear discriminant analysis (LDA)] and nonlinear
algorithms like Kernel PCA and Kernel LDA.
KNN is very simple, highly efficient and effective algorithm for pattern recognition that
classifies new observation into the class, to which the majority of its k nearest neighbors at
training data set belong. In other words, k most similar training data observations to unclassified
observation are searched. KNN involves large storage requirement and intensive computation,
and the value of k also needs to be determined properly.
Location Coverage:
The granularity of location coverage the movement of a mobile user is described as follows: The
user stays at one cell for a period of time, and then moves to the next cell. If we sum up the
residence times of the cells he/ she visited, then we know exactly which cell the user visited after
a specific elapsed time.
Spread Prediction:
System Design
The standard statistics provided by a commercial mobile telecom network are used
as inputs of our prediction model. Experiments indicate that if the measured time
slot is smaller than the expected cell residence time, and is not close to the
expected call holding time, then good accuracy of the prediction model can be
expected. In this architecture the users are connected with the server for collecting
the data. Users can connect with the IP address from the server port. The mobile
movement collecting the moving user data based on the server. The result mainly
used for collecting user information.
Source
Connect IP Address
Mobile Movement
Server Information
USE CASE DIAGRAM
Telecoms Handoff
SOURCE DESTINATION
Movement Based
Mobile Networks
ENTER IP ADDRESS
COLLABORATION DIAGRAM:
SOURC
E
MOBILE
1: ENTER IP ADDRESS MOVEMENT
2: MOBILE LOCATION VISIBLE
CONNECT IP
ADDRESS
DESTINA
TION
3: HANDOFF LOGIC ON MOBILE
ABOUT JAVA
This is achieved by compiling the Java language code, not to machine code but to
Java bytecode instructions analogous to machine code but intended to be
interpreted by a virtual machine (VM) written specifically for the host hardware.
End-users commonly use a JRE installed on their own machine, or in a Web
browser.
Standardized libraries provide a generic way to access host specific features such
as graphics, threading and networking. In some JVM versions, bytecode can be
compiled to native code, either before or during program execution, resulting in
faster execution.
A major benefit of using bytecode is porting. However, the overhead of
interpretation means that interpreted programs almost always run more slowly than
programs compiled to native executables would, and Java suffered a reputation for
poor performance. This gap has been narrowed by a number of optimization
techniques introduced in the more recent JVM implementations.
One of the unique advantages of the concept of a runtime engine is that errors
(exceptions) should not 'crash' the system. Moreover, in runtime engine
environments such as Java there exist tools that attach to the runtime engine and
every time that an exception of interest occurs they record debugging information
that existed in memory at the time the exception was thrown (stack and heap
values). These Automated Exception Handling tools provide 'root-cause'
information for exceptions in Java programs that run in production, testing or
development environments.
SWINGS:
PLATFORM INDEPENDENCE:
Swing is platform independent both in terms of its expression (Java) and its
implementation (non-native universal rendering of widgets).
EXTENSIBILITY:
COMPONENT-ORIENTED :
CUSTOMIZABLE:
Given the programmatic rendering model of the Swing framework, fine control
over the details of rendering of a component is possible in Swing. As a general
pattern, the visual representation of a Swing component is a composition of a
standard set of elements, such as a "border", "inset", decorations, etc. Typically,
users will programmatically customize a standard Swing component (such as a
JTable) by assigning specific Borders, Colors, Backgrounds, opacities, etc., as the
properties of that component. The core component will then use these property
(settings) to determine the appropriate renderers to use in painting its various
aspects. However, it is also completely possible to create unique GUI controls with
highly customized visual representation.
CONFIGURABLE:
LIGHTWEIGHT UI :
Swing's configurability is a result of a choice not to use the native host OS's GUI
controls for displaying itself. Swing "paints" its controls programmatically through
the use of Java 2D APIs, rather than calling into a native user interface toolkit.
Thus, a Swing component does not have a corresponding native OS GUI
component, and is free to render itself in any way that is possible with the
underlying graphics APIs.
However, at its core every Swing component relies on an AWT container, since
(Swing's) JComponent extends (AWT's) Container. This allows Swing to plug into
the host OS's GUI management framework, including the crucial device/screen
mappings and user interactions, such as key presses or mouse movements. Swing
simply "transposes" its own (OS agnostic) semantics over the underlying (OS
specific) components. So, for example, every Swing component paints its rendition
on the graphic device in response to a call to component.paint(), which is defined
in (AWT) Container. But unlike AWT components, which delegated the painting to
their OS-native "heavyweight" widget, Swing components are responsible for their
own rendering.
This transposition and decoupling is not merely visual, and extends to Swing's
management and application of its own OS-independent semantics for events fired
within its component containment hierarchies. Generally speaking, the Swing
Architecture delegates the task of mapping the various flavors of OS GUI
semantics onto a simple, but generalized, pattern to the AWT container. Building
on that generalized platform, it establishes its own rich and complex GUI
semantics in the form of the JComponent model. A review of the source of
Container. java and JComponent.java classes is recommended for further insights
into the nature of the interface between Swing's lightweight components and
AWT's heavyweight widgets.
LOOSELY-COUPLED/MVC:
The Swing library makes heavy use of the Model/View/Controller software design
pattern, which conceptually decouples the data being viewed from the user
interface controls through which it is viewed. Because of this, most Swing
components have associated models (which are specified in terms of Java
interfaces), and the programmer can use various default implementations or
provide their own. The framework provides default implementations of model
interfaces for all of its concrete components.
Typically, Swing component model objects are responsible for providing a concise
interface defining events fired, and accessible properties for the (conceptual) data
model for use by the associated JComponent. Given that the overall MVC pattern
is a loosely-coupled collaborative object relationship pattern, the model provides
the programmatic means for attaching event listeners to the data model object.
Typically, these events are model centric (ex: a "row inserted" event in a table
model) and are mapped by the JComponent specialization into a meaningful event
for the GUI component.
For example, the JTable has a model called TableModel that describes an
interface for how a table would access tabular data. A default implementation of
this operates on a two-dimensional array.
RELATIONSHIP TO AWT:
Since early versions of Java, a portion of the Abstract Window Toolkit (AWT) has
provided platform-independent APIs for user interface components. In AWT, each
component is rendered and controlled by a native peer component specific to the
underlying windowing system.
Much of the Swing API is generally a complementary extension of the AWT rather
than a direct replacement. In fact, every Swing lightweight interface ultimately
exists within an AWT heavyweight component because all of the top-level
components in Swing (JApplet, JDialog, JFrame, and JWindow) extend an
AWT top-level container. However, the use of both lightweight and heavyweight
components within the same window is generally discouraged due to Z-order
incompatibilities.
NETWORKING BASICS:
Ken Thompson and Dennis Ritchie developed UNIX in concert with the C
language at Bell Telephone Laboratories, Murray Hill, New Jersey, in 1969. In
1978, Bill Joy was leading a project at Cal Berkeley to add many new features to
UNIX, such as virtual memory and full-screen display capabilities. By early 1984,
just as Bill was leaving to found Sun Microsystems, he shipped 4.2BSD,
commonly known as Berkeley UNIX.4.2BSD came with a fast file system, reliable
signals, interprocess communication, and, most important, networking. The
networking support first found in 4.2 eventually became the de facto standard for
the Internet. Berkeleys implementation of TCP/IP remains the primary standard
for communications with the Internet. The socket paradigm for inter process and
network communication has also been widely adopted outside of Berkeley.
SOCKET OVERVIEW:
CLIENT/SERVER
A server is anything that has some resource that can be shared. There
are compute servers, which provide computing power; print servers, which
manage a collection of printers; disk servers, which provide networked disk space;
and web servers, which store web pages. A client is simply any other entity that
wants to gain access to a particular server.
RESERVED SOCKETS:
Java supports TCP/IP both by extending the already established stream I/O
interface. Java supports both the TCP and UDP protocol families. TCP is used for
reliable stream-based I/O across the network. UDP supports a simpler, hence faster,
point-to-point datagram-oriented model.
INETADDRESS:
FACTORY METHODS:
throws UnknownHostException
INSTANCE METHODS:
The InetAddress class also has several other methods, which can be
used on the objects returned by the methods just discussed. Here are some of the
most commonly used.
Boolean equals (Object other)- Returns true if this object has the
same Internet address as other.
There are two kinds of TCP sockets in Java. One is for servers, and the other
is for clients. The ServerSocket class is designed to be a listener, which waits for
clients to connect before doing anything. The Socket class is designed to connect to
server sockets and initiate protocol exchanges.
A socket can be examined at any time for the address and port
information associated with it, by use of the following methods:
int getPort( )Returns the remote port to which this Socket object is
connected.
int getLocalPort( ) Returns the local port to which this Socket object is
connected.
Once the Socket object has been created, it can also be examined to
gain access to the input and output streams associated with it. Each of these
methods can throw an IOException if the sockets have been invalidated by a loss
of connection on the Net.
ServerSocket(int port) Creates server socket on the specified port with a queue
length of 50.
ServerSocket has a method called accept( ), which is a blocking call that will
wait for a client to initiate communications, and then return with a normal Socket
that is then used for communication with the client.
SYSTEM TESTING
The purpose of testing is to discover errors. Testing is the process of trying
to discover every conceivable fault or weakness in a work product. It provides a
way to check the functionality of components, sub assemblies, assemblies and/or a
finished product It is the process of exercising software with the intent of ensuring
that the Software system meets its requirements and user expectations and does not
fail in an unacceptable manner. There are various types of test. Each test type
addresses a specific testing requirement.
TYPES OF TESTS
Unit Testing
Unit testing involves the design of test cases that validate that the internal
program logic is functioning properly, and that program inputs produce valid
outputs. All decision branches and internal code flow should be validated. It is the
testing of individual software units of the application .it is done after the
completion of an individual unit before integration. This is a structural testing, that
relies on knowledge of its construction and is invasive. Unit tests perform basic
tests at component level and test a specific business process, application, and/or
system configuration. Unit tests ensure that each unique path of a business process
performs accurately to the documented specifications and contains clearly defined
inputs and expected results.
Integration Testing
Integration tests are designed to test integrated software components to
determine if they actually run as one program. Testing is event driven and is more
concerned with the basic outcome of screens or fields. Integration tests
demonstrate that although the components were individually satisfaction, as shown
by successfully unit testing, the combination of components is correct and
consistent. Integration testing is specifically aimed at exposing the problems that
arise from the combination of components
Functional Testing
Functional tests provide systematic demonstrations that functions tested are
available as specified by the business and technical requirements, system
documentation, and user manuals.
System Testing
System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable results. An
example of system testing is the configuration oriented system integration test.
System testing is based on process descriptions and flows, emphasizing pre-driven
process links and integration points.
White Box Testing
White Box Testing is a testing in which in which the software tester has
knowledge of the inner workings, structure and language of the software, or at least
its purpose. It is purpose. It is used to test areas that cannot be reached from a black
box level.
DATABASE DESIGN
Database design is the process of producing a detailed data model of a database. This
logical data model contains all the needed logical and physical design choices and physical
storage parameters needed to generate a design in a data definition language, which can then be
used to create a database. A fully attributed data model contains detailed attributes for each
entity. The term database design can be used to describe many different parts of the design of an
overall database system.
However, the term database design could also be used to apply to the overall process of
designing, not just the base data structures, but also the forms and queries used to part of the
overall database application within the database management system(DBMS).
The process of doing database design generally consists of a number of steps which will
be carried out by the database designer. Usually , the designer most:
Design Process
Determine the purpose of the database This helps prepare for the remaining steps.
Find and organize the information required Gather all of the types of information to record
in the databases, such as product name and order number.
Divide the information into tables Divide information items into major entities or subjects,
such as Products or Orders. Each subject then becomes a table.
Turn information items into columns Decide what information needs to be stored in each
table. Each item becomes a field, and is displayed as a column in the table.
Setup the table relationships Look at each table and decide how the data in one table is
related to the data in other tables.
Refine the design Analyze the design for errors. Create table and add a few records of sample
data. Check if results come from the tables as expected.
INPUT DESIGN
The input design is the link between the information system and the user. It comprises the
developing specification and procedures for data preparation and those steps are necessary to put
transaction data in to a usable form for processing can be achieved by inspecting the computer to
read data from a written or printed document or it can occur by having people keying the data
directly into the system. The design of input focuses on controlling the amount of input required,
controlling the errors, avoiding delay, avoiding extra steps and keeping the process simple. The
input is designed in such a way so that it provides security and ease of use with retaining the
privacy. Input Design considered the following things:
OBJECTIVES
1. Input Design is the process of converting a user-oriented description of the input into a
computer-based system. This design is important to avoid errors in the data input process and
show the correct direction to the management for getting correct information from the
computerized system.
2. It is achieved by creating user-friendly screens for the data entry to handle large volume of
data. The goal of designing input is to make data entry easier and to be free from errors. The data
entry screen is designed in such a way that all the data manipulates can be performed. It also
provides record viewing facilities.
3. When the data is entered it will check for its validity. Data can be entered with the help of
screens. Appropriate messages are provided as when needed so that the user
will not be in maize of instant. Thus the objective of input design is to create an input layout that
is easy to follow
OUTPUT DESIGN
A quality output is one, which meets the requirements of the end user and presents the
information clearly. In any system results of processing are communicated to the users and to
other system through outputs. In output design it is determined how the information is to be
displaced for immediate need and also the hard copy output. It is the most important and direct
source information to the user. Efficient and intelligent output design improves the systems
relationship to help user decision-making.
1. Designing computer output should proceed in an organized, well thought out manner; the right
output must be developed while ensuring that each output element is designed so that people will
find the system can use easily and effectively. When analysis design computer output, they
should Identify the specific output that is needed to meet the requirements.
3.Create document, report, or other formats that contain information produced by the system.
The output form of an information system should accomplish one or more of the following
objectives.
IMPLEMENTATION
It making the new system available to a prepared set of users (the
deployment), and positioning on-going support and maintenance of the system
within the Performing Organization (the transition). At a finer level of detail,
deploying the system consists of executing all steps necessary to educate the
Consumers on the use of the new system, placing the newly developed system into
production, confirming that all data required at the start of operations is available
and accurate, and validating that business functions that interact with the system
are functioning properly. Transitioning the system support responsibilities involves
changing from a system development to a system support and maintenance mode
of operation, with ownership of the new system moving from the Project Team to
the Performing Organization.
Planning
Training
System testing and
Changeover Planning
Planning is the first task in the system implementation. Planning means
deciding on the method and the time scale to be adopted. At the time of
implementation of any system people from different departments and system
analysis involve. They are confirmed to practical problem of controlling various
activities of people outside their own data processing departments. The line
managers controlled through an implementation coordinating committee. The
committee considers ideas, problems and complaints of user department, it must
also consider;
Project Manager
Project Sponsor
Business Analyst
Data/Process Modeler
Technical Lead/Architect
Application Developers
Software Quality Assurance (SQA) Lead
Technical Services (HW/SW, LAN/WAN, TelCom)
Information Security Officer (ISO)
Technical Support (Help Desk, Documentation, Trainers)
Customer Decision-Maker
Consumers may experience a period of time in which the systems that they
depend on to perform their jobs are temporarily unavailable to them. They may be
asked to maintain detailed manual records or logs of business functions that they
perform to be entered into the new system once it is operational.
During this preparation process the Project Manager must verify that all
conditions that must be met prior to initiating deployment activities have been met,
and that the final green light is on for the team to proceed. The final process
within the System Development Lifecycle is to transition ownership of the system
support responsibilities tothe Performing Organization. In order for there to be an
efficient and effective transition, the Project Manager should make sure that all
involved parties are aware of the transition plan, the timing of the various
transition activities, and their role in its execution.
Due to the number of project participants in this phase of the SDLC, many
of the necessary conditions and activities may be beyond the direct control of the
Project Manager.
CONCLUSION
This work reports an efficient dimensionality reduction approach for the class prediction related
to the human activity recognition data composed by several active ties, such as lying down,
walking, sitting, and standing, ascending and descending stairs. Dimensionality Reduction is
usually achieved on the feature space by accepting one of the prescribed methods that fall under
the chosen technique. Data pre-processing is an approach in which these irregularities are
detected, analyzed, and processed by using certain behavioral predictions and modifications to
alter the inapplicability present in the record. Our framework expands the applicability to high-
dimensional problems while maintaining their interpretability and their potential to provide
practical insights.
REFERENCES:
the United States of Am., vol. 107, no. 51, pp. 22020-22025, 2010.
Trans. Vehicular Technology, vol. 56, no. 1, pp. 322-330, Jan. 2007.
[4] M.-H. Tsai, Y.-B. Lin, and H.-H. Wang, Active Location
Dec. 2009.
782, 2008.
[6] Y.-B. Lin and A.-C. Pang, Wireless and Mobile All-IP Networks. John
Wiley and Sons, 2005.
[8] Y.-C. Lai, P. Lin, and S.-M. Cheng, Performance Modeling for
Screen shot
SAMPLE SOURCE CODE
Server.java
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Vector;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumn;
public JLabel warninglbl = new JLabel("Warning! User left from the safe region!");
JScrollPane pane;
String len,conn="";
String t1str;
String
event1="null",event2="null",event3="null",event4="null",event5="null",event6="null",event7="
null",event8="null",event9="null";
};
@SuppressWarnings("unchecked")
Server()
jf = new JFrame("server");
c = jf.getContentPane();
c.setLayout(null);
jf.setSize(815, 730);
bf.setIcon(new javax.swing.ImageIcon("server.png"));
jf.setResizable(false);
IMAGE2.setBounds(650,200,128,128);
IMAGE2.setIcon(new javax.swing.ImageIcon("satellite-icon128.png"));
IMAGE3.setBounds(450,400,256,256);
usrimg1.setBounds(50,240,30 ,30);
usrimg1.setIcon(new javax.swing.ImageIcon("green.png"));
usrimg2.setBounds(50,280,30,30);
usrimg2.setIcon(new javax.swing.ImageIcon("green.png"));
usrimgf1.setBounds(50,240,30,30);
usrimgf1.setIcon(new javax.swing.ImageIcon("grey.png"));
usrimgf2.setBounds(50,280,30,30);
usrimgf2.setIcon(new javax.swing.ImageIcon("grey.png"));
usr1disable.setBounds(70,400,160,30);
usr2disable.setBounds(260,400,160,30);
usr1enable.setBounds(90,240,230,30);
usr2enable.setBounds(90,280,230,30);
textfld.setBounds(90,240,230,30);
jp.setBounds(30,30,750,645);
jp.setBackground(Color.darkGray);
jp1.setBounds(30,200,750,450);
jp1.setBackground(Color.GREEN);
testclientip1.setBounds(100,250,200,30);
testclientipA.setBounds(100,300,150,30);
testclientipB.setBounds(100,350,150,30);
textip.setBounds(300,250,100,30);
textip1.setBounds(300,300,100,30);
textip2.setBounds(300,350,100,30);
ipconnect.setBounds(200,500,120,30);
ipconnect.setIcon(new javax.swing.ImageIcon("connectblue.png"));
testclientip1.setForeground(Color.ORANGE);
testclientipA.setForeground(Color.ORANGE);
testclientipB.setForeground(Color.ORANGE);
testclientip1.setFont(fo);
testclientipA.setFont(fo);
testclientipB.setFont(fo);
usr1disable.setForeground(Color.RED);
usr2disable.setForeground(Color.RED);
usr1enable.setForeground(Color.green);
usr2enable.setForeground(Color.green);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// Class.forName("com.mysql.jdbc.Driver");
// con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/mb","root","");
System.out.println("deleted ");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
initTable();
//Table coding
// header.setFont(fs3);
// header.setForeground(new Color(120,0,0));
table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
table.setShowGrid(true);
table.setEnabled(true);
table.setForeground(Color.BLUE);
// table.setFont(fs3);
scroller.setBounds(48,400,700,200);
jf.setUndecorated(false);
table.setAutoResizeMode(1);
scroller.setVisible(false);
jp.setVisible(false);
IMAGE.setVisible(false);
IMAGE1.setVisible(false);
IMAGE2.setVisible(true);
IMAGE3.setVisible(true);
usrimg1.setVisible(false);
usrimg2.setVisible(false);
usrimgf1.setVisible(false);
usrimgf2.setVisible(false);
usr1enable.setVisible(true);
usr2enable.setVisible(true);
warninglbl.setVisible(false);
usr1disable.setVisible(false);
usr2disable.setVisible(false);
textfld.setVisible(false);
c.add(textfld);
c.add(scroller);
c.add(testclientip1);
c.add(testclientipA); c.add(testclientipB);
c.add(textip);
c.add(textip1); c.add(textip2);
c.add(ipconnect); c.add(IMAGE3);
c.add(usrimg1); c.add(usrimg2);
c.add(usrimgf1); c.add(usrimgf2);
c.add(IMAGE1); c.add(IMAGE2);
c.add(usr1disable); c.add(usr2disable);
c.add(usr1enable); c.add(usr2enable);
c.add(warninglbl);
c.add(bf);
ipconnect.addActionListener(this);
jf.show();
jf.addWindowListener(new WindowAdapter()
{
System.exit(0);
}});
t.setName("Listener-" + ports[i]);
t.start();
//tableModel.addTableModelListener(new InteractiveTableModelListener());
table.setModel(tableModel);
table.setSurrendersFocusOnKeystroke(true);
TableColumn hidden =
table.getColumnModel().getColumn(InteractiveTableModel.HIDDEN_INDEX);
hidden.setMinWidth(2);
hidden.setPreferredWidth(2);
hidden.setMaxWidth(2);
SwingUtilities.updateComponentTreeUI(c);
c.repaint();
//hidden.setCellRenderer(new
InteractiveRenderer(InteractiveTableModel.HIDDEN_INDEX));
this.interactiveColumn = interactiveColumn;
int column)
!tableModel.hasEmptyRow())
tableModel.addEmptyRow();
highlightLastRow(row);
return c;
if (row == lastrow - 1) {
} else {
table.setColumnSelectionInterval(0, 0);
}
public class InteractiveTableModelListener implements TableModelListener {
if (evt.getType() == TableModelEvent.UPDATE) {
table.setRowSelectionInterval(row, row);
ServerSocket server;
Socket connection;
BufferedReader br = null;
int port;
this.port = port;
try {
server = new ServerSocket(port);
while (true) {
connection = server.accept();
br = new BufferedReader(
connection.getInputStream())));
String strLine;
// System.out.println(strLine);
buffer.append(strLine + "\n");
String a1=buffer.toString();
br.close();
connection.close();
length=a1.length();
// NODE A
if (this.port == 8500 ) {
usrimg1.setVisible(true);
usr1enable.setVisible(true);
usr1disable.setVisible(false);
//jcb1.setEnabled(false);
//intr1();
if (this.port == 8501 )
usrimg1.setVisible(true);
usrimgf1.setVisible(false);
usr1enable.setVisible(false);
if (this.port == 8502 )
usrimg1.setVisible(true);
usrimgf1.setVisible(false);
usr2enable.setVisible(true);
//intr2();
if (this.port == 8503 )
usrimg1.setVisible(true);
usrimgf1.setVisible(false);
textfld.setVisible(false);
usr1enable.setText(buffer.toString());
usr1enable.setVisible(true);
catch (IOException e) {}
finally {}
try {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
java.util.logging.Logger.getLogger(Server.class.getName()).log(java.util.logging.Level.SEVERE
, null, ex);
java.util.logging.Logger.getLogger(Server.class.getName()).log(java.util.logging.Level.SEVERE
, null, ex);
java.util.logging.Logger.getLogger(Server.class.getName()).log(java.util.logging.Level.SEVERE
, null, ex);
new Server();
void call12()
try {
byteArray = textfld.getText().getBytes();
bos.write(byteArray, 0, byteArray.length);
bos.flush();
bos.close();
client.close();
e1.printStackTrace();
e1.printStackTrace();
} finally {
if (bos != null) {
try {
bos.close();
e1.printStackTrace();
void call13()
byteArray = textfld.getText().getBytes();
bos.write(byteArray, 0, byteArray.length);
bos.flush();
bos.close();
client.close();
e1.printStackTrace();
e1.printStackTrace();
} finally {
if (bos != null) {
try {
bos.close();
e1.printStackTrace();
}
void username()
if(e.getSource()== ipconnect)
conn="Connect";
if(textip.getText().equals(""))
else
event1=textip.getText().toString().trim();
event2=textip1.getText().toString().trim();
event3=textip2.getText().toString().trim();
try {
m = new Moving();
f.add(jp);
f.add(m);
f.setSize(815,730);
f.setVisible(true);
m.timera.start();
m.timerx.start();
e1.printStackTrace();
e1.printStackTrace();
scroller.setVisible(true);
ipconnect.setVisible(false);
textip.setVisible(false);
textip1.setVisible(false);
textip2.setVisible(false);
testclientip1.setVisible(false);
testclientipA.setVisible(false);
testclientipB.setVisible(false);
jp1.setVisible(false);
usrimg1.setVisible(false);
usrimg2.setVisible(false);
usrimgf1.setVisible(true);
usrimgf2.setVisible(true);
jp.setVisible(true);
IMAGE2.setVisible(false);
IMAGE3.setVisible(false); }
User.java
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ConnectException;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import sun.tools.jar.Main;
public Container c;
public JLabel errlbl = new JLabel("Sorry, This user is not connected with current user. ");
String conn="";
int length;
String len;
int t1len;
String t1str;
String event2="null";
@SuppressWarnings("deprecation")
User()
{
jf = new JFrame("Establish Connection with Server");
c = jf.getContentPane();
c.setLayout(null);
jf.setSize(815, 730);
bf.setIcon(new javax.swing.ImageIcon("userlogin.png"));
jf.setResizable(false);
jp.setBounds(500,430,100,150);
jp.setBackground(Color.darkGray);
loginicon.setBounds(320,480,180,180);
loginicon.setIcon(new javax.swing.ImageIcon("interconnect.png"));
testclientip1.setForeground(Color.ORANGE);
testclientip1.setFont(f);
ipconnect.setBounds(330,430,120,30);
ipconnect.setIcon(new javax.swing.ImageIcon("connectblue.png"));
jtf.setBounds(400,350,150,30);
unauthorised.setForeground(Color.RED);
unauthorised.setFont(fo);
errlbl.setBounds(200, 450,600, 30);
errlbl.setForeground(Color.RED);
errlbl.setFont(f);
errlbl.setVisible(false);
jf.setVisible(false);
jp.setVisible(false);
unauthorised.setVisible(false);
loginicon.setVisible(true);
//combobox.setEditable(true);
c.add(loginicon);
c.add(errlbl);
c.add(testclientip1);
c.add(jtf);
c.add(ipconnect);
c.add(unauthorised);
// c.add(scrpane,BorderLayout.CENTER);
c.add(bf);
ipconnect.addActionListener(this);
jf.show();
jf.addWindowListener(new WindowAdapter()
System.exit(0);
}});
t.setName("Listener-" + ports[i]);
t.start();
}}
try {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
java.util.logging.Logger.getLogger(User.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
java.util.logging.Logger.getLogger(User.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
java.util.logging.Logger.getLogger(User.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
java.util.logging.Logger.getLogger(User.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
new User();
ServerSocket server;
Socket connection;
BufferedReader br = null;
int port;
this.port = port;
try {
while (true)
connection = server.accept();
String strLine;
// System.out.println(strLine);
buffer.append(strLine + "\n");
br.close();
connection.close();
String a1=buffer.toString();
length=a1.length();
if(this.port==1500)
unauthorised.setVisible(true);
catch (IOException e) {
finally {
@Override
if(e.getSource()== ipconnect)
conn="Connect";
if(jtf.getText().equals(""))
else
JOptionPane.showMessageDialog(null,"Connecting IP
Address!!", "Message Box", 1);
event2 = jtf.getText().toString().trim();
new User1();
testclientip1.setVisible(false);
jtf.setVisible(false);
ipconnect.setVisible(false);
jf.setVisible(false);
jp.setVisible(false);
call11();
void cal() {
try {
bos.write(byteArray1, 0, byteArray1.length);
bos.flush();
bos.close();
client1.close();
ue.printStackTrace();
catch (IOException e)
e.printStackTrace();
finally
if (bos != null) {
try {
bos.close();
e1.printStackTrace();
}
try {
client1.close();
e1.printStackTrace();
// view.setEnabled(false);
// unauthorised.setVisible(true);
void call11()
try
byteArray = jtf.getText().getBytes();
bos.write(byteArray, 0, byteArray.length);
bos.flush();
bos.close();
client.close();
}
System.out.println(ex.getMessage());
System.exit(0);
e1.printStackTrace();