Beruflich Dokumente
Kultur Dokumente
Abstract
Virtual Controller: This program allows any computer to control other PCs remotely.
Project aims at administering a remote computer using network communication. The
remote computer acts as client and the controlling computer acts as a server. Any number
of clients can be connected to the server. The core function of client is sending a screen
shot of the client’s desktop at a predefined amount of time. For each client a new frame is
generated and the screen shot is displayed at the sever side. The clients control is
communicated in the form of mouse movement and key strokes.
Program Features:
View remote desktop
Mouse movement control
Mouse buttons control
Keyboard control
Modules:
Develop Remote Server
[1]
SRTIST(I.T Dept)
Virtual Controller
1. INTRODUCTION
1.1 Purpose
Administration in computer organization is a modern professional responsible for the
maintenance of computer hardware and software that comprises a computer
network. This normally includes the deployment, configuration, maintenance and
monitoring of active Employee function. A related role is that of the network
specialist, or network analyst, who concentrates on network design and security.
Network administrators are responsible for making sure computer hardware and the
network infrastructure itself is maintained properly for an IT organization. They are
deeply involved in the rolling out new software installs, and as well as employee
tasks what actually they are doing in the time of job. But there is a problem to
maintain all networks with one administrator. So our virtual controller program
allows any computer to control other PCs remotely. Project aims at administering a
remote computer using network communication. The remote computer acts as
client and the controlling computer acts as a server.
Any number of clients can be connected to the server. The core function of client is
sending a screen shot of the client’s desktop at a predefined amount of time. For
each client a new frame is generated and the screen shot is displayed at the sever
side. The clients control is communicated in the form of mouse movement and key
strokes.
1.2 Scope
Virtual Controller provides some very useful and general important functions for the
administrator to maintain the clients function or tasks in computer network and, in this
application, reduce the burden on administrator work and saving the time for all levels of
network. This the client side, its core function is sending a screen shot of the client's
desktop every predefined amount of time. Also it receives server commands such as
"move the mouse command", and then executes the command at the client's PC. Any
[2]
SRTIST(I.T Dept)
Virtual Controller
number of clients can be connected to the server. The core function of client is sending a
screen shot of the client’s desktop at a predefined amount of time.
1.3 Project Overview
Although virtual Controller is an innovative application, the modern formulation of it is
often given in terms of the existing system problems, in generally administrators are
responsible for making sure computer hardware and the network infrastructure itself is
maintained properly for an IT organization. They are deeply involved in the rolling out
new software installs, and as well as employee tasks what actually they are doing in the
time of job. But there is a problem to maintain all networks with one administrator. This
is the administrator waits for client’s connections and per each connected client, a new
frame appears showing the current client screen. When you move the mouse over the
frame, this results in moving the mouse at the client side. The same happens when you
right/left click mouse button or type a key while the frame is in focus.
connections and per each connected client, a new frame appears showing the current
client screen.
When you move the mouse over the frame, this results in moving the mouse at
the client side. The same happens when you right/left click mouse button or type a key
while the frame is in focus. Client side, its core function is sending a screen shot of the
client's desktop every predefined amount of time. Also it receives server commands such
as "move the mouse command", and then executes the command at the client's PC.
[4]
SRTIST(I.T Dept)
Virtual Controller
2. MODULE DESCRIPTION
3.1 Modules:
Develop Remote Server
This is the server part which waits for clients connections and per each connected
client, a new frame appears showing the current client screen. When you move the mouse
over the frame, this results in moving the mouse at the client side. The same happens
when you right/left click mouse button or type a key while the frame is in focus.
This the client side, its core function is sending a screen shot of the client's
desktop every predefined amount of time. Also it receives server commands such as
"move the mouse command", and then executes the command at the client's PC.
[5]
SRTIST(I.T Dept)
Virtual Controller
[6]
SRTIST(I.T Dept)
Virtual Controller
4. FEASIBILITY STUDY
The next step in analysis is to verify the feasibility of the proposed system. “All
projects are feasible given unlimited resources and infinite time“. But in reality both
resources and time are scarce. Project should confirm to time bounce and should be
optimal in there consumption of resources. The development of computer-based system is
likely to be played by Scarcity of resources and difficulty in completion dates. Feasibility
study is the measure of how beneficial or practical information system will be to an
organization. Further developer would like to finalize the software and hardware
requirements to develop the proposed system. The objective of Feasibility Study is to
evaluate the relevant factors involved in the problem statement, considers preliminary
alternative solutions’ weakness and advantages, and recommended a feasible solution to
the problem statement.
• Technical feasibility
• Operational feasibility
• Economical feasibility
[7]
SRTIST(I.T Dept)
Virtual Controller
As we are developing this virtual controller Application on Java 2 platform edition which
is an open source and free of cost. Once we started developing this application in Java 2
platform edition then they is no need of purchasing any special software or application
software for support. Java it self provides all necessary functionalities and resources for
developing virtual controller Application. For Example like developing GUI can be
developed by AWT or Swing Framework which is much available in Java.
[8]
SRTIST(I.T Dept)
Virtual Controller
5. DESIGN OBJECTIVES
Design is the first step in moving from problem domain to the solution domain.
Design is essentially the bridge between requirements specification and the final solution.
The goal of design process is to produce a model or representation of a
system, which can be used later to build that system. The produced model is called the
“Design of the System”. It is a plan for a solution for the system.
[10]
SRTIST(I.T Dept)
Virtual Controller
does not connect the server just giving information to the server. If the ip addresses are
validate then only streaming will continue.
Interaction Diagram
An Interaction diagram shows an interaction, consisting of a set of objects and their
relationships, including the messages that may be dispatched among them.
Interaction diagrams are used for modeling the dynamic aspects of the system.
A sequence diagram is an interaction diagram that emphasizes the time ordering of the
messages. Graphically, a sequence diagram is a table that shows objects arranged alongs
the X-axis and messages, ordered in increasing time, along the Y-axis and messages,
ordered in increasing time, along the Y-axis.
Sequence Diagram:
Sequence diagrams demonstrates the sequential flow of software architecture used in this
application .Sequence diagrams document the interactions between classes to achieve a
result, such as a use case. Because UML is designed for object oriented programming,
this communications between classes are known as messages. The sequence diagrams
lists diagrams lists objects horizontally, and time vertically, and models these messages
over time.
Activity Diagram
An Activity Diagram is essentially a flow chart showing flow of control from activity to
activity. They are used to model the dynamic aspects of as system .They can also be used
to model the flow of an object as it moves from state to state at different points in the
flow of control.
An activity is an ongoing non-atomic execution with in a state machine. Activities
ultimately result in some action, which is made up of executable atomic computations
that result in a change of state of distinguishes a use case diagram from all other kinds of
diagrams is its particular content.
[11]
SRTIST(I.T Dept)
Virtual Controller
[12]
SRTIST(I.T Dept)
Virtual Controller
[13]
SRTIST(I.T Dept)
Virtual Controller
[14]
SRTIST(I.T Dept)
Virtual Controller
Collaboration Diagram:
[16]
SRTIST(I.T Dept)
Virtual Controller
Activity Diagram:
[17]
SRTIST(I.T Dept)
Virtual Controller
State Diagram:
[18]
SRTIST(I.T Dept)
Virtual Controller
Component diagram:
[19]
SRTIST(I.T Dept)
Virtual Controller
Deployment diagram:
[20]
SRTIST(I.T Dept)
Virtual Controller
[21]
SRTIST(I.T Dept)
Virtual Controller
b) Design Phase:
Design is concerned with identifying software components, specifying relationships
among components, maintaining a record of design decisions.
c) Implementation Phase:
The implementation phase of software development involves translation of design
specifications source code and debugging, documentation and unit testing of the source
code.
[22]
SRTIST(I.T Dept)
Virtual Controller
d) Testing Phase:
It involves two kinds of testing:
i) In integration testing the individual program units or programs are integrated and
tested.
ii) Acceptance Testing involves planning and execution of various types of tests in order
to demonstrate that the implemented software satisfies the stated requirements.
Java Overview
Java is a powerful but lean object-oriented programming language. It has
generated a lot of excitement because it makes it possible to program for Internet by
creating Applets which are programs that can be embedded in web page. The context of
an applet can be an animation with sound, an interactive game or a ticker tape. With
constantly updated stock prices, applets can be just little decorations to liven up web
page, or they can be serious applications like Word processor or Spreadsheet.
But Java is more than a programming language for writing Applets. It is being used
more and more for writing standalone applications as well. It is becoming so popular that
many people believe it will become standard language for both general purpose and
Internet programming.
There are many buzzwords associated with Java, but because of its spectacular
growth in popularity, a new buzzword has appeared ubiquitous. Indeed, all indications
are that it will soon be everywhere.
[23]
SRTIST(I.T Dept)
Virtual Controller
Java builds on the strength of C++. It has taken the best features of C++ and
discarded the more problematic and error prone parts. To this lean core, it has added
garbage collection (automatic memory management), multithreading (the capacity for
one program to do more than one thing at a time), security capabilities. This result is that
Java is simple, elegant, and powerful and easy-to-use.
Java is actually a platform consisting of 3 components:
• Java Programming Language
• Java Library of Classes and Interfaces
• Java Virtual Machine
The following sections will say more about these components.
Java is portable:
One of the biggest advantages Java offers is that it is portable. An
application written in Java will run on all the major platforms. Any computer with a Java-
based browser can run the applications or Applets written in the Java-Programming-
Language. A programmer no longer has to write one program to run on a Macintosh,
another program to run on a Windows-machine still another to run on a UNIX-machine
and so on. In other words, with Java developers write their programs only once.
The Virtual Machine is what gives Java is cross platform capabilities. Rather being
compiled into machine language, which is different for each OS’s and computer
architecture, Java code is compiled into Byte codes. With other
Languages, the program code is compiled into a language that the computer can
understand. The problem is that other computers with different machine instruction set
cannot understand that language. Java code on the other hand is compiled into Byte-Code
rather than a machine language. This byte codes go to the JVM, which executes them
directly or translates them into the language that is understood by the machine running it.
In summary, these means that with the JDBC API extending Java, a programmer writing
Java code can access all the major RDBMS on any platform that supports the JVM.
[24]
SRTIST(I.T Dept)
Virtual Controller
[25]
SRTIST(I.T Dept)
Virtual Controller
7.CODE
import java.awt.BorderLayout;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
/**
* This is the entry class of the server
*/
public class ServerInitiator {
//Main server frame
private JFrame frame = new JFrame();
//JDesktopPane represents the main container that will contain all
//connected clients' screens
private JDesktopPane desktop = new JDesktopPane();
try {
ServerSocket sc = new ServerSocket(port);
//Show Server GUI
drawGUI();
//Listen to server port and accept clients connections
while(true){
Socket client = sc.accept();
System.out.println("New client Connected to the server");
//Per each client create a ClientHandler
new ClientHandler(client,desktop);
}
} catch (IOException ex) {
ex.printStackTrace();
[26]
SRTIST(I.T Dept)
Virtual Controller
}
}
/*
* Draws the main server GUI
*/
public void drawGUI(){
frame.add(desktop,BorderLayout.CENTER);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Show the frame in a maximized state
frame.setExtendedState(frame.getExtendedState()|JFrame.MAXIMIZED_BOTH);
frame.setVisible(true);
}
}
[27]
SRTIST(I.T Dept)
Virtual Controller
7.1.2 ClientCommandsSender:
package remoteserver;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;
import javax.swing.JPanel;
class ClientCommandsSender implements KeyListener,
MouseMotionListener,MouseListener {
//not implemented
public void mouseEntered(MouseEvent e) {
}
//not implemented
public void mouseExited(MouseEvent e) {
//not implemented
public void keyTyped(KeyEvent e) {
}
[29]
SRTIST(I.T Dept)
Virtual Controller
[30]
SRTIST(I.T Dept)
Virtual Controller
7.1.3ClientHandler:
package remoteserver;
import java.awt.BorderLayout;
import java.awt.Rectangle;
import java.beans.PropertyVetoException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.Socket;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import java.net.InetAddress;
/*
* Draw GUI per each connected client
*/
public void drawGUI(){
interFrame.setLayout(new BorderLayout());
interFrame.getContentPane().add(cPanel,BorderLayout.CENTER);
interFrame.setSize(100,100);
desktop.add(interFrame);
try {
//Initially show the internal frame maximized
interFrame.setMaximum(true);
} catch (PropertyVetoException ex) {
ex.printStackTrace();
}
//this allows to handle KeyListener events
cPanel.setFocusable(true);
interFrame.setVisible(true);
}
[31]
SRTIST(I.T Dept)
Virtual Controller
try{
//Read client screen dimension
ois = new ObjectInputStream(cSocket.getInputStream());
clientScreenDim =(Rectangle) ois.readObject();
}catch(IOException ex){
ex.printStackTrace();
}catch(ClassNotFoundException ex){
ex.printStackTrace();
}
//Start recieveing screenshots
new ClientScreenReciever(ois,cPanel);
//Start sending events to the client
new ClientCommandsSender(cSocket,cPanel,clientScreenDim);
}
[32]
SRTIST(I.T Dept)
Virtual Controller
7.1.4ClientScreenReciever:
package remoteserver;
import java.awt.Graphics;
import java.awt.Image;
import java.io.IOException;
import java.io.ObjectInputStream;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
/**
* ClientScreenReciever is responsible for recieving client screenshot and displaying
* it in the server. Each connected client has a separate object of this class
*/
class ClientScreenReciever extends Thread {
try {
import java.awt.AWTException;
import java.awt.Dimension;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
/**
*
* This class is responsible for connecting to the server
* and starting ScreenSpyer and ServerDelegate classes
*/
public class ClientInitiator {
try {
System.out.println("Connecting to server ..........");
socket = new Socket(ip, port);
System.out.println("Connection Established.");
GraphicsDevice gDev=gEnv.getDefaultScreenDevice();
frame.setBounds(100,100,150,150);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(button);
button.addActionListener( new ActionListener() {
[35]
SRTIST(I.T Dept)
Virtual Controller
7.2.2ScreenSpyer:
package remoteclient;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;
import javax.swing.ImageIcon;
/**
* This class is responisble for sending sreenshot every predefined duration
*/
class ScreenSpyer extends Thread {
try{
//Prepare ObjectOutputStream
oos = new ObjectOutputStream(socket.getOutputStream());
/*
* Send screen size to the server in order to calculate correct mouse
* location on the server's panel
*/
oos.writeObject(rectangle);
}catch(IOException ex){
ex.printStackTrace();
}
while(continueLoop){
//Capture screen
BufferedImage image = robot.createScreenCapture(rectangle);
/* I have to wrap BufferedImage with ImageIcon because BufferedImage class
[36]
SRTIST(I.T Dept)
Virtual Controller
[37]
SRTIST(I.T Dept)
Virtual Controller
7.2.3ServerDelegate:
package remoteclient;
import java.awt.Robot;
import java.io.IOException;
import java.net.Socket;
import java.util.Scanner;
/*
* Used to recieve server commands then execute them at the client side
*/
class ServerDelegate extends Thread {
while(continueLoop){
//recieve commands and respond accordingly
System.out.println("Waiting for command");
int command = scanner.nextInt();
System.out.println("New command: " + command);
switch(command){
case -1:
robot.mousePress(scanner.nextInt());
break;
case -2:
robot.mouseRelease(scanner.nextInt());
break;
case -3:
robot.keyPress(scanner.nextInt());
break;
case -4:
robot.keyRelease(scanner.nextInt());
break;
[38]
SRTIST(I.T Dept)
Virtual Controller
case -5:
robot.mouseMove(scanner.nextInt(), scanner.nextInt());
break;
}
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
[39]
SRTIST(I.T Dept)
Virtual Controller
8.TESTING
• To ensure that during operation the system will perform as per specification.
• To make sure that system meets the user requirements during operation.
• To make sure that during the operation, incorrect input, processing and output will
be detected.
• To see that when correct inputs are fed to the system the outputs are correct.
• To verify that the controls incorporated in the same system as intended.
Testing is a process of executing a program with the intent of finding an error. A good
test case is one that has a high probability of finding an as yet undiscovered error
The software developed has been tested successfully using the following testing
strategies and any errors that are encountered are corrected and again the part of the
program or the procedure or function is put to testing until all the errors are removed. A
successful test is one that uncovers undiscovered error.
Note that the result of the system testing will prove that the system is working
correctly. It will give confidence to system designer, users of the system and prevent
frustration during implementation process etc.
[40]
SRTIST(I.T Dept)
Virtual Controller
Integration Testing
All the tested modules are combined into sub systems, which are then tested.
The goal is to see if the modules are properly integrated, and the emphasis being on
[41]
SRTIST(I.T Dept)
Virtual Controller
the testing interfaces between the modules. In the generic code integration testing is
done mainly on table creation module and insertion module.
Validation Testing
This testing concentrates on confirming that the software is error-free in all
respects. All the specified validations are verified and the software is subjected to hard-
core testing. It also aims at determining the degree of deviation that exists in the software
designed from the specification; they are listed out and are corrected.
System Testing
This testing is a series of different tests whose primary goal is to exercise the
computer-based system. This involves:
• Implementing the system in a simulated production environment and testing it.
• Introducing errors and testing for error handling.
TEST CASE 2:
The IP address of server should be entered correctly at
the client’s end. Otherwise error message is displayed.
[42]
SRTIST(I.T Dept)
Virtual Controller
In this initially user selects the java programming file and those should be in the
form of either class files or source files. After that he add the source file and class file and
also set some important setting then select go for processing controller application.
Screen 1:
[43]
SRTIST(I.T Dept)
Virtual Controller
Screen 2:
[44]
SRTIST(I.T Dept)
Virtual Controller
Screen 3:
[45]
SRTIST(I.T Dept)
Virtual Controller
[46]
SRTIST(I.T Dept)
Virtual Controller
Screen 4:
[47]
SRTIST(I.T Dept)
Virtual Controller
9. REQUIRED PACKAGES
import java.awt.AWTException;
import java.awt.Dimension;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
.
.
.
public void initialize(int port){
[48]
SRTIST(I.T Dept)
Virtual Controller
try {
ServerSocket sc = new ServerSocket(port);
//Show Server GUI
drawGUI();
//Listen to server port and accept clients connections
while(true){
Socket client = sc.accept();
System.out.println("New client Connected to the server");
//Per each client create a ClientHandler
new ClientHandler(client,desktop);
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
try{
//Read client screen dimension
ois = new ObjectInputStream(cSocket.getInputStream());
clientScreenDim =(Rectangle) ois.readObject();
}catch(IOException ex){
[50]
SRTIST(I.T Dept)
Virtual Controller
ex.printStackTrace();
}catch(ClassNotFoundException ex){
ex.printStackTrace();
}
//Start recieveing screenshots
new ClientScreenReciever(ois,cPanel);
//Start sending events to the client
new ClientCommandsSender(cSocket,cPanel,clientScreenDim);
}
////eg:ClientCommandSenderClass
public void mouseDragged(MouseEvent e) {
}
[52]
SRTIST(I.T Dept)
Virtual Controller
10.CONCLUSION
Virtual Controller provides some very useful and general important functions in
the administration tasks, in this application; The remote computer acts as client and the
controlling computer acts as a server. Any number of clients can be connected to the
server. The modern virtual controller achieves in terms of the existing system problems,
in generally administrators are server part which waits for clients connections and per
each connected client, a new frame appears showing the current client screen. When you
move the mouse over the frame, these results in moving the mouse at the client side.
[53]
SRTIST(I.T Dept)
Virtual Controller
11. BIBILIOGRAPHY
[54]
SRTIST(I.T Dept)