Professional Documents
Culture Documents
Uit Rec
Uit Rec
Uit Rec
AIM:
To perform image mapping on India Map
CODE:
<!DOCTYPE html>
<!-- saved from url=(0052)file:///C:/Users/ITMCLAB/Documents/imagemapping.html -->
</head>
<body onmousemove="showCoords(event)">
<script language="javascript">
function showCoords(event)
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
{
let x = event.clientX;
let y = event.clientY;
let text = "X coords: " + x + ", Y coords: " + y;
document.getElementById("demo").innerHTML = text;
}
</script>
<img src="indiamap.jpg" usemap="#indiamap" width="600" height="600">
<map name="indiamap">
<area shape="rect" coords="73,194,182,276" alt="rajasthan" href="rajasthan.html"
target="_blank">
</map>
<div>
</html>
rajasthan.html
<!DOCTYPE html>
<html>
<head>
<title>RAJASTHAN</title>
background-image:
url('pattern1.jpg'); background-
repeat: repeat;
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
background-attachment: fixed;
}
.topnav {
overflow: hidden;
background-color: rgba(0,0,0,0);
}
.topnav a.disabled
{
pointer-events: none;
opacity: 50;
}
.topnav a {
float: right;
color: black;
text-align: center;
display:block;
padding: 25px 16px;
text-decoration: none;
font-size: 25px;
}
.topnav a:hover {
background-color: #ddd;
color: black;
text-transform:uppercase;
}
.topnav a.split {
float: left;
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
}
.para
{
text-align:center;
padding:20px;
background: rgba(0,0,0,0);
color:black;
font:30px sans-serif;
}
.parag
{
text-align:left;
padding:20px;
background: rgba(0,0,0,0);
color:#080232;
font:20px sans-serif;
}
div.gallery {
border: 1px solid rgb(151, 132, 132);;
div.gallery:hover {
border: 1px solid #000000;
}
div.gallery img {
width: 100%;
height: auto;
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
div.desc {
padding: 15px;
text-align: center;
font-weight: bolder;
font-size: 150%;
color:#080232;
text-shadow: #080232;
*{
box-sizing: border-box;
}
.responsive {
padding: 0 6px;
float: left;
width: 24.99999%;
}
.responsive {
width: 49.99999%;
margin: 6px 0;
}
}
.responsive {
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
width: 100%;
}
.clearfix:after {
content: "";
display: table;
clear: both;
}
</style>
</head>
<body>
<center>
<div class="topnav">
<a href="#contact">Contact</a>
<a href="#About">About</a>
<a href="#Home">Home</a>
</center>
<div class="responsive">
<div class="gallery">
<a target="_blank" href="bikaner.jpg">
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
</div>
</div>
<div class="responsive">
<div class="gallery">
</a>
<div class="desc">Mewar</div>
</div>
</div>
<div class="responsive">
<div class="gallery">
</a>
<div class="desc">Gadisar Lake</div>
</div>
</div>
<div class="responsive">
<div class="gallery">
</a>
<div class="desc">Camel festival</div>
</div>
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
</div>
<div class="clearfix"></div>
<div class="responsive">
<div class="gallery">
<a target="_blank" href="udaipur.jpg">
<div class="desc">Udaipur</div>
</div>
</div>
<div class="responsive">
<div class="gallery">
<a target="_blank" href="desert.jpg">
<div class="desc">Desert</div>
</div>
</div>
<div class="responsive">
<div class="gallery">
<a target="_blank" href="hawa.jpg">
</div>
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
<div class="responsive">
<div class="gallery">
<a target="_blank" href="ranakpur.jpg">
<div class="desc">Ranakpur</div>
</div>
</div>
<div class="clearfix"></div>
<div class="parag">
<p> <strong style="font-size:20px;font-family: verdana ">The state of Rajasthan in
northwestern India includes part of the Thar desert, as well as Rathambore National Park
,home to wild tigers, and verdant Mount Abu and its elaborate temples. A camel safari
near the inhabited desert trading center of jaisalmer gives a hint of the area's beautiful
desolation. Udaipur's lakefront setting provides rich contrasts
.The caital, Jaipur, is a shopper's dream. Hire a car and driver to take in the spread-out
sights. Stay in a heritage hotel to feel like a Maharaja
</s></strong><br><br></div>
</body>
</html>
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
OUTPUT:
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
RESULT:
Thus, image mapping on India Map has been performed successfully
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
AIM:
To create a college website using inline internal and external CSS
CODE:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
<style>
.crd{
padding-top: 10px;
padding-left: 15%;
padding-right: 17%;
padding-bottom: 20px;
}
.card {
.card:hover {
.ig{
padding-left: 325px;
padding-top: 10px;
}
.cva{
background-color: bisque;
}
</style>
</head>
<body>
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
<header>
<div class="topnav">
<img src="https://www.svce.ac.in/wp-content/uploads/2021/12/svce-logo.png"
height="70px" width="350px">
<a href="#news">News</a>
<a href="#contact">Contact</a>
<a href="#about">About</a>
<a href="#placements">Placements</a>
<a href="#campuslife">Campus Life</a>
<a href="#academics">Academics</a>
<a href="#admission">Admission</a>
</header>
<section class="cnva">
</section>
<section class="ig">
<br>
<br>
<br>
<br>
<br>
<section class="crd">
<div class="card">
<img src="https://www.svce.ac.in/wp-content/uploads/2021/04/why-svce.png" alt="Why
SVCE" height="450px" width="750px">
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
</div>
</section>
<footer>
<div class="footer-content">
</div>
</footer>
</body>
</html>
EXTERNAL CSS
.cnva
{
width: 1345px;
height: 25px;
padding-left: 7px;
background-color: dodgerblue;
animation-name: example;
animation-duration: 60s;
animation-delay: 5s;
transition: 0.3s;
animation-direction: alternate-reverse;
}
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
@keyframes example {
from {background-color:
dodgerblue;} to {background-color:
darkorange;}
}
.topnav
{
background-color: default;
overflow: hidden;
padding-left: 10px;
.topnav a
{
float: right;
color: darkorange;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.topnav a:hover
{
background-color: steelblue;
color: black;
}
.topnav a.active {
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
background-color: default;
color: darkblue;
}
footer {
background-color: lightslategrayi
; color: dodgerblue;
padding: 20px 0;
text-align: center;
}
.footer-content {
max-width: 1200px;
margin: 0 auto;
display: flex;
flex-direction:
column; align-items:
center;
}
footer p {
margin-bottom: 10px;
footer ul {
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
list-style: none;
display: flex;
}
footer ul li {
margin: 0 15px;
}
footer ul li a {
color: darkorange;
text-decoration: none;
}
footer ul li a:hover {
text-decoration: underline;
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
OUTPUT:
RESULT:
Thus, college website using inline, internal and external CSS has been created
successfully.
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
AIM:
To parse and render information of XML
ALGORITHM:
XML Parsing using Java:
1. Import required packages: `org.w3c.dom`, `javax.xml.parsers`, `java.io`, `java.util`.
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
CODE:
XML
<caption id="1">
<name></name>
<empid>123abc</empid>
<role>assistant</role>
</caption>
<caption id="2">
<name>ram</name>
<empid>456tyu</empid>
<role>designer</role>
</caption>
<caption id="3">
<name>prem</name>
<empid>298vbu</empid>
<role>manager</role>
</caption>
</empdetails>
parser.java
import java.io.*;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import java.util.*;
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
{
public static void main(String []args)throws Exception
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new File("ex3.xml"));
Element root = document.getDocumentElement();
Scanner sc = new Scanner(System.in);
System.out.println("enter user id :");
String id=sc.nextLine();
NodeList nlist =
document.getElementsByTagName("caption");
System.out.println("\n root tag:"+root.getNodeName()+"\n");
for (int temp=0;temp<nlist.getLength();temp++)
{
Node node = nlist.item(temp);
if(node.getNodeType() == Node.ELEMENT_NODE)
{
System.out.println("name : " +
ele.getElementsByTagName("name").item(0).getTextContent());
System.out.println("empid : " +
ele.getElementsByTagName("empid").item(0).getTextContent());
System.out.println("role : " + ele.getElementsByTagName("role").item(0).getTextContent());
}
}
}
}
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
OUTPUT:
RESULT:
Thus, parsing and rendering of information form XML file has been executed successfully.
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
AIM:
To implement TCP and UDP for chat server and client
ALGORITHM:
UDP Server:
1. Import required packages: `java.io`, `java.net`.
- Send a DatagramPacket containing `buf` to client's InetAddress `ia` and client port
`cport`.
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
UDP Client:
- Read input from the user using `dis` into a String `str`.
- Convert `str` to bytes and store in `buf`.
- Send a DatagramPacket containing `buf` to server's InetAddress `ia` and server port
`sport`.
- Receive data into the `dp` DatagramPacket.
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
CODE:
UDPServer.java
import java.io.*;
import java.net.*;
class UDPServer
{
{
serversocket = new DatagramSocket(sport);
dp = new DatagramPacket(buf,buf.length);
dis = new BufferedReader
(new InputStreamReader(System.in));
ia = InetAddress.getLocalHost();
System.out.println("Server is Running...");
while(true)
{
serversocket.receive(dp);
String str = new String(dp.getData(), 0,
dp.getLength());
if(str.equals("STOP"))
{
System.out.println("Terminated...");
break;
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
}
System.out.println("Client: " + str);
String str1 = new String(dis.readLine());
buf = str1.getBytes();
}
}
UDPClient
import java.io.*;
import java.net.*;
class UDPClient
{
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
buf = str.getBytes();
if(str.equals("STOP"))
{
System.out.println("Terminated...");
clientsocket.send(new
DatagramPacket(buf,str.length(), ia,sport));
break;
}
}
}
OUTPUT:
UDP
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
ALGORITHM:
Server-Side
- Read input from the user using `Scanner` into the `msg`.
- Send the input message to the client using `outputToClient`.
Client-Side Chat
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
- Read input from the user using `Scanner` into the `msg`.
- Send the input message to the server using `toServer`.
CODE:
ServerChat.java
import java.io.*;
import java.net.*;
import java.util.Scanner;
public class ServerChat {
public static void main(String[] args) throws IOException {
ServerSocket serverSocket = new ServerSocket(8087);
Socket socket = serverSocket.accept();
DataInputStream inputFromClient = new
DataInputStream(socket.getInputStream());
DataOutputStream outputToClient = new
DataOutputStream(socket.getOutputStream());
Scanner sc = new Scanner(System.in);
String msg;
while (true) {
msg = inputFromClient.readUTF();
System.out.println("Client says:" + msg);
System.out.println("(From Server) Input message to
client:"); msg = sc.nextLine();
outputToClient.writeUTF(msg);
}
}
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
ClientChat.java
import java.io.*;
import java.net.Socket;
import java.util.Scanner;
public class ClientChat {
public static void main(String[] args) throws IOException {
Socket socket = new Socket("localhost", 8087);
DataInputStream fromServer = new DataInputStream(socket.getInputStream());
DataOutputStream toServer = new
DataOutputStream(socket.getOutputStream());
Scanner sc = new Scanner(System.in);
String msg;
while (true) {
System.out.println("(From Client)Input message to server:");
msg = sc.nextLine();
toServer.writeUTF(msg);
msg = fromServer.readUTF();
System.out.println("Server:" + msg);
}
}
}
OUTPUT:
REGNO:21272108010 PAGEN
CS18511 – USER INTERFACE TECHNOLOGIES LABORATORY
RESULT:
Thus UDP and TCP chat client server has been executed successfully
REGNO:21272108010 PAGEN