Professional Documents
Culture Documents
By
W.A.B.Janith
Group Member
N.M.S.B.Hettigedara
Supervisor:
Professor L.A.L.W.Jayasekara
Faculty of Science
University of Ruhuna
Sri Lanka
2010
ABSTRACT
Preparing and Developing Computerized System for Summarized
Monthly Running Report(R/51) in Sri Lanka Transport Board
W.A.B. Janith
Faculty of Science
University of Ruhuna
Sri Lanka
1|Page
ACKNOWLEDGMENTS
I take this opportunity to express my profound sense of gratitude and respect to all
those who helped me throughout the duration of this project. I express my sincere
gratitude and thankfulness towards Professor L.A.L.W.Jayasekara, Department of
mathematics, Ruhuna University, Matara, for his valuable times and guidance
throughout to Our Project.
I am grateful for valuable suggestions rendered by all the staff members of the
running section, Balangoda depot of CTB, Balangoda, Sri lanka.
I am grateful for the co-operation to my project member and all our friends for
providing critical feedback & support whenever required. I regret any inadvertent
omissions.
W.A.B. janith
University of Ruhuna
Matara.
2|Page
CONTENTS
Introduction
Method of Solution
Database structure
Conclusions
Discussion
Bibliography
3|Page
Introduction
Document of R/51
There are many documents such as R/22,R/41 and etc. R/51 also a document. It
is the most important document in depot. R means which belongs to running
section. This document is prepared at the end of month and also update per
month. It is full summary of route. Necessary information are got from R/51 by
top management. There are nine copies. One of them send to Sri Lanka transport
commission in Narahenpita. At that place they analyze about route and take
actions for loss routes.
There are 21 columns to fill. Some of them have to fill and others have to calculate data.
4|Page
1. Route number
Any bus travel anywhere definitely it has route number. Each route
has regular number. As a example From Balangoda to Kandy route
number is 69
2. Description of route
This field describe about route. As a example route number 69
description is from Balangoda to Kandy across Kegalle
3. Distance
Total distance at the end of route. It is not change
4. Value of a ticket
Value of a ticket for full route
5. Size of bus
It is mentioned numbers of passengers without stand passengers
6. Type of bus
I. type of A (double decor)
II. type of B (double door)
III. type of C (double door but not large than type of B)
IV. type of D (single door)
V. type of E (single door but not large than type of D, Specially use
this bus for estate or rural areas)
7. Documentary
8. Numbers of buses
Numbers of buses are traveled regular route
9. Registered kilometers
Decided kilometers for travel
5|Page
14. Income per Kilometer
income
Income per kilometer=
kilometer_ with_incom e
15. Value per kilometer
Value_of_t icket
Value per kilometer=
distance
Clark must give lowest ten load factor out of all. Government pays for that
routes as a encouragement.
6|Page
Specification of the problem
Problem 1
Completing R/51 at the end of month is major problem which must be filled
end of month by regular Clark, but he cannot do it regular time who was
always late nearly two weeks. So there are lot of complains from top
management. Top management must submit R\51 to transport commission.
Regularly Clark spends 3 days for calculate data.
Problem 2
Completing R/51 at end of the month the report must send to Sri Lanka
transport commission in Narahenpita and other copies must be post in regular
mail post so we can post by E-mail all copies in short time.
Methods of Solution
We have try to give software solution above problem. First we share our
project. I have decided to develop repairing section such as, developing and
preparing R\51 (different than partner). I and partner used below documents to get
data.
1. R\22
2. Log sheet
What is R\22
This document is used by conductor which is also a basic document. Every
day depot provides this document to conductor. Generally this can be used for
financial checking by officers. R\22 has duty no. There is lot of data in here but we
get only necessary data. Below data are used by us.
1. Route
2. No of trip
3. Tickets sold
4. Value of tickets (for a route)
5. Registered kilometers
6. Running kilometers
7. date
7|Page
What is Log sheet
Log sheet also a basic document. It is used by driver. Everyday depot provides
this document. Below data are used by us. Sometime it is used by engine section
for trial.
1. Registered kilometers
2. Running kilometers
3. Lost kilometers
4. Bus number
5. Engine oil
6. Fuel
7. Instrument
To overcome from this entire problem in Sri Lanka Transport Board Balangoda Office wanted to
move to a new system which is desktop application, and which leads to prepare final sheet by the
Desktop and to collect, retrieve and maintain data
Main requirements:
The Desktop application system should be able to collect data from R/22 and log sheet
to temporary data tables. After the computer operator in running section verified the
submitted data the data is saved into main data tables.
The data in the database can be viewed by computer operator
In the running record of maintaining system, operator can be able to log in to the system
to view running information, check defects running information record through the
running system.
In end of the month operator can be generate R\51 Summery report by one click.
If operator want to post a this R\51 report by e-mail ,the operate should be tick sending
to head office.
I planed as first to build User interface to enter and retrieved data of Route detail
and Running recodes after then this data must persist in ctbsourse databases.
I Show my first user interfaces that will be in link button can be open route table
,running table and bus type table.
8|Page
There is code in following about above interface
/*
* CtbpROJECTView.java
*/
package ctbproject;
import java.awt.EventQueue;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
/**
* The application's main frame.
*/
public class CtbpROJECTView extends FrameView {
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() {
9|Page
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);
@Action
public void showAboutBox() {
if (aboutBox == null) {
JFrame mainFrame = CtbpROJECTApp.getApplication().getMainFrame();
aboutBox = new CtbpROJECTAboutBox(mainFrame);
aboutBox.setLocationRelativeTo(mainFrame);
}
CtbpROJECTApp.getApplication().show(aboutBox);
}
10 | P a g e
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
mainPanel.setName("mainPanel"); // NOI18N
org.jdesktop.application.ResourceMap resourceMap =
org.jdesktop.application.Application.getInstance(ctbproject.CtbpROJECTApp.class).getContext
().getResourceMap(CtbpROJECTView.class);
jPanel1.setBackground(resourceMap.getColor("jPanel1.background")); // NOI18N
jPanel1.setName("jPanel1"); // NOI18N
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setIcon(resourceMap.getIcon("jLabel1.icon")); // NOI18N
jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
jLabel1.setName("jLabel1"); // NOI18N
jPanel2.setBackground(resourceMap.getColor("jPanel2.background")); // NOI18N
jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jPanel2.setName("jPanel2"); // NOI18N
Report.setBackground(resourceMap.getColor("Report.background")); // NOI18N
Report.setText(resourceMap.getString("Report.text")); // NOI18N
Report.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
Report.setName("Report"); // NOI18N
Report.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
ReportMouseClicked(evt);
}
11 | P a g e
});
jButton1.setBackground(resourceMap.getColor("jButton1.background")); // NOI18N
jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
jButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jButton1.setName("jButton1"); // NOI18N
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton1MouseClicked(evt);
}
});
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 189,
Short.MAX_VALUE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 189,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Report, javax.swing.GroupLayout.PREFERRED_SIZE, 187,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(26, 26, 26))
);
12 | P a g e
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(56, 56, 56))
);
menuBar.setBackground(resourceMap.getColor("menuBar.background")); // NOI18N
menuBar.setForeground(resourceMap.getColor("menuBar.foreground")); // NOI18N
menuBar.setName("menuBar"); // NOI18N
fileMenu.setBackground(resourceMap.getColor("fileMenu.background")); // NOI18N
fileMenu.setForeground(resourceMap.getColor("fileMenu.foreground")); // NOI18N
fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
fileMenu.setName("fileMenu"); // NOI18N
javax.swing.ActionMap actionMap =
org.jdesktop.application.Application.getInstance(ctbproject.CtbpROJECTApp.class).getContext
().getActionMap(CtbpROJECTView.class, this);
exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
exitMenuItem.setName("exitMenuItem"); // NOI18N
fileMenu.add(exitMenuItem);
menuBar.add(fileMenu);
helpMenu.setBackground(resourceMap.getColor("helpMenu.background")); // NOI18N
helpMenu.setForeground(resourceMap.getColor("helpMenu.foreground")); // NOI18N
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.setBackground(resourceMap.getColor("statusPanel.background")); //
NOI18N
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
statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(statusPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(statusMessageLabel)
13 | P a g e
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 595,
Short.MAX_VALUE)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(statusAnimationLabel)
.addContainerGap())
.addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 765,
Short.MAX_VALUE)
);
statusPanelLayout.setVerticalGroup(
statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
statusPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE,
47, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(statusMessageLabel)
.addComponent(statusAnimationLabel)
.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>
14 | P a g e
}); // TODO add your handling code here:
}
15 | P a g e
package ctbproject;
import java.awt.EventQueue;
import java.beans.Beans;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import javax.persistence.RollbackException;
import javax.swing.JFrame;
import javax.swing.JPanel;
/**
*
* @author W.A.B. Janith
*/
public class Route extends JPanel {
public Route() {
initComponents();
if (!Beans.isDesignTime()) {
entityManager.getTransaction().begin();
}
}
org.jdesktop.application.ResourceMap resourceMap =
org.jdesktop.application.Application.getInstance(ctbproject.CtbpROJECTApp.class).getContext
().getResourceMap(Route.class);
entityManager = java.beans.Beans.isDesignTime() ? null :
javax.persistence.Persistence.createEntityManagerFactory(resourceMap.getString("entityManag
er.persistenceUnit")).createEntityManager(); // NOI18N
query = java.beans.Beans.isDesignTime() ? null :
entityManager.createQuery(resourceMap.getString("query.query")); // NOI18N
list = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() :
org.jdesktop.observablecollections.ObservableCollections.observableList(query.getResultList
());
masterScrollPane = new javax.swing.JScrollPane();
masterTable = new javax.swing.JTable();
newButton = new javax.swing.JButton();
deleteButton = new javax.swing.JButton();
detailScrollPane = new javax.swing.JScrollPane();
detailTable = new javax.swing.JTable();
saveButton = new javax.swing.JButton();
refreshButton = new javax.swing.JButton();
deleteDetailButton = new javax.swing.JButton();
newDetailButton = new javax.swing.JButton();
setBackground(resourceMap.getColor("Form.background")); // NOI18N
setName("Form"); // NOI18N
masterScrollPane.setName("masterScrollPane"); // NOI18N
16 | P a g e
masterTable.setName("masterTable"); // NOI18N
org.jdesktop.swingbinding.JTableBinding jTableBinding =
org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoB
inding.UpdateStrategy.READ_WRITE, list, masterTable);
org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${routeNo}"));
columnBinding.setColumnName("Route No");
columnBinding.setColumnClass(String.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${fromplace}"))
;
columnBinding.setColumnName("Fromplace");
columnBinding.setColumnClass(String.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${throughplace}
"));
columnBinding.setColumnName("Throughplace");
columnBinding.setColumnClass(String.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${toplace}"));
columnBinding.setColumnName("Toplace");
columnBinding.setColumnClass(String.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${far}"));
columnBinding.setColumnName("Far");
columnBinding.setColumnClass(java.math.BigDecimal.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${priceOfTicket
}"));
columnBinding.setColumnName("Price Of Ticket");
columnBinding.setColumnClass(java.math.BigDecimal.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${busTipe}"));
columnBinding.setColumnName("Bus Tipe");
columnBinding.setColumnClass(ctbSource.Bus.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${documentary}"
));
columnBinding.setColumnName("Documentary");
columnBinding.setColumnClass(java.math.BigDecimal.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${serviceDis}")
);
columnBinding.setColumnName("Service Dis");
columnBinding.setColumnClass(String.class);
bindingGroup.addBinding(jTableBinding);
masterScrollPane.setViewportView(masterTable);
newButton.setText(resourceMap.getString("newButton.text")); // NOI18N
newButton.setName("newButton"); // NOI18N
newButton.addActionListener(formListener);
deleteButton.setText(resourceMap.getString("deleteButton.text")); // NOI18N
deleteButton.setName("deleteButton"); // NOI18N
org.jdesktop.beansbinding.Binding binding =
org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.
UpdateStrategy.READ, masterTable,
org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), deleteButton,
org.jdesktop.beansbinding.BeanProperty.create("enabled"));
bindingGroup.addBinding(binding);
deleteButton.addActionListener(formListener);
17 | P a g e
detailScrollPane.setName("detailScrollPane"); // NOI18N
detailTable.setName("detailTable"); // NOI18N
org.jdesktop.beansbinding.ELProperty eLProperty =
org.jdesktop.beansbinding.ELProperty.create("${selectedElement.runingList}");
jTableBinding =
org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoB
inding.UpdateStrategy.READ_WRITE, masterTable, eLProperty, detailTable);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${date}"));
columnBinding.setColumnName("Date");
columnBinding.setColumnClass(java.util.Date.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${vehicalNo}"))
;
columnBinding.setColumnName("Vehical No");
columnBinding.setColumnClass(String.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${tripNumber}")
);
columnBinding.setColumnName("Trip Number");
columnBinding.setColumnClass(Integer.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${numOfTickets}
"));
columnBinding.setColumnName("Num Of Tickets");
columnBinding.setColumnClass(Integer.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${value}"));
columnBinding.setColumnName("Value");
columnBinding.setColumnClass(java.math.BigDecimal.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${stchKm}"));
columnBinding.setColumnName("Stch Km");
columnBinding.setColumnClass(java.math.BigDecimal.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${stchKmService
}"));
columnBinding.setColumnName("Stch Km Service");
columnBinding.setColumnClass(java.math.BigDecimal.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${stchKmDead}")
);
columnBinding.setColumnName("Stch Km Dead");
columnBinding.setColumnClass(java.math.BigDecimal.class);
jTableBinding.setSourceUnreadableValue(java.util.Collections.emptyList());
bindingGroup.addBinding(jTableBinding);
detailScrollPane.setViewportView(detailTable);
saveButton.setText(resourceMap.getString("saveButton.text")); // NOI18N
saveButton.setName("saveButton"); // NOI18N
saveButton.addActionListener(formListener);
refreshButton.setText(resourceMap.getString("refreshButton.text")); // NOI18N
refreshButton.setName("refreshButton"); // NOI18N
refreshButton.addActionListener(formListener);
deleteDetailButton.setText(resourceMap.getString("deleteDetailButton.text")); //
NOI18N
deleteDetailButton.setName("deleteDetailButton"); // NOI18N
binding =
org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.
18 | P a g e
UpdateStrategy.READ, detailTable,
org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
deleteDetailButton, org.jdesktop.beansbinding.BeanProperty.create("enabled"));
bindingGroup.addBinding(binding);
deleteDetailButton.addActionListener(formListener);
newDetailButton.setText(resourceMap.getString("newDetailButton.text")); // NOI18N
newDetailButton.setName("newDetailButton"); // NOI18N
binding =
org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.
UpdateStrategy.READ, masterTable,
org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), newDetailButton,
org.jdesktop.beansbinding.BeanProperty.create("enabled"));
bindingGroup.addBinding(binding);
newDetailButton.addActionListener(formListener);
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addComponent(newButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(deleteButton))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(245, Short.MAX_VALUE)
.addComponent(newDetailButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(deleteDetailButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(refreshButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(saveButton))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(masterScrollPane,
javax.swing.GroupLayout.DEFAULT_SIZE, 537, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(detailScrollPane,
javax.swing.GroupLayout.DEFAULT_SIZE, 537, Short.MAX_VALUE)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
19 | P a g e
.addComponent(masterScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 231,
Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(deleteButton)
.addComponent(newButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(detailScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 231,
Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(saveButton)
.addComponent(refreshButton)
.addComponent(deleteDetailButton)
.addComponent(newDetailButton))
.addContainerGap())
);
bindingGroup.bind();
}
20 | P a g e
masterTable.clearSelection();
masterTable.setRowSelectionInterval(index, index);
}
@SuppressWarnings("unchecked")
private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt) {
entityManager.getTransaction().rollback();
entityManager.getTransaction().begin();
java.util.Collection data = query.getResultList();
for (Object entity : data) {
entityManager.refresh(entity);
}
list.clear();
list.addAll(data);
}
21 | P a g e
}
list.clear();
list.addAll(merged);
}
}
}
Now there is bus type record view interface
22 | P a g e
package ctbproject;
import java.awt.EventQueue;
import java.beans.Beans;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.RollbackException;
import javax.swing.JFrame;
import javax.swing.JPanel;
/**
*
* @author W.A.B. Janith
*/
public class Bus extends JPanel {
public Bus() {
initComponents();
if (!Beans.isDesignTime()) {
entityManager.getTransaction().begin();
}
}
org.jdesktop.application.ResourceMap resourceMap =
org.jdesktop.application.Application.getInstance(ctbproject.CtbpROJECTApp.class).getContext
().getResourceMap(Bus.class);
entityManager = java.beans.Beans.isDesignTime() ? null :
javax.persistence.Persistence.createEntityManagerFactory(resourceMap.getString("entityManag
er.persistenceUnit")).createEntityManager(); // NOI18N
query = java.beans.Beans.isDesignTime() ? null :
entityManager.createQuery(resourceMap.getString("query.query")); // NOI18N
list = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() :
org.jdesktop.observablecollections.ObservableCollections.observableList(query.getResultList
());
masterScrollPane = new javax.swing.JScrollPane();
masterTable = new javax.swing.JTable();
busTipeLabel = new javax.swing.JLabel();
passengerAmountLabel = new javax.swing.JLabel();
busTipeField = new javax.swing.JTextField();
passengerAmountField = new javax.swing.JTextField();
saveButton = new javax.swing.JButton();
refreshButton = new javax.swing.JButton();
newButton = new javax.swing.JButton();
deleteButton = new javax.swing.JButton();
setBackground(resourceMap.getColor("Form.background")); // NOI18N
setName("Form"); // NOI18N
masterScrollPane.setName("masterScrollPane"); // NOI18N
masterTable.setName("masterTable"); // NOI18N
23 | P a g e
org.jdesktop.swingbinding.JTableBinding jTableBinding =
org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoB
inding.UpdateStrategy.READ_WRITE, list, masterTable);
org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${busTipe}"));
columnBinding.setColumnName("Bus Tipe");
columnBinding.setColumnClass(String.class);
columnBinding =
jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${passengerAmou
nt}"));
columnBinding.setColumnName("Passenger Amount");
columnBinding.setColumnClass(Integer.class);
bindingGroup.addBinding(jTableBinding);
masterScrollPane.setViewportView(masterTable);
busTipeLabel.setForeground(resourceMap.getColor("busTipeLabel.foreground")); //
NOI18N
busTipeLabel.setText(resourceMap.getString("busTipeLabel.text")); // NOI18N
busTipeLabel.setName("busTipeLabel"); // NOI18N
passengerAmountLabel.setForeground(resourceMap.getColor("passengerAmountLabel.foreground"))
; // NOI18N
passengerAmountLabel.setText(resourceMap.getString("passengerAmountLabel.text"));
// NOI18N
passengerAmountLabel.setName("passengerAmountLabel"); // NOI18N
busTipeField.setName("busTipeField"); // NOI18N
org.jdesktop.beansbinding.Binding binding =
org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.
UpdateStrategy.READ_WRITE, masterTable,
org.jdesktop.beansbinding.ELProperty.create("${selectedElement.busTipe}"), busTipeField,
org.jdesktop.beansbinding.BeanProperty.create("text"));
binding.setSourceUnreadableValue(null);
bindingGroup.addBinding(binding);
binding =
org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.
UpdateStrategy.READ, masterTable,
org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), busTipeField,
org.jdesktop.beansbinding.BeanProperty.create("enabled"));
bindingGroup.addBinding(binding);
passengerAmountField.setName("passengerAmountField"); // NOI18N
binding =
org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.
UpdateStrategy.READ_WRITE, masterTable,
org.jdesktop.beansbinding.ELProperty.create("${selectedElement.passengerAmount}"),
passengerAmountField, org.jdesktop.beansbinding.BeanProperty.create("text"));
binding.setSourceUnreadableValue(null);
bindingGroup.addBinding(binding);
binding =
org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.
UpdateStrategy.READ, masterTable,
org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
passengerAmountField, org.jdesktop.beansbinding.BeanProperty.create("enabled"));
bindingGroup.addBinding(binding);
saveButton.setText(resourceMap.getString("saveButton.text")); // NOI18N
saveButton.setName("saveButton"); // NOI18N
saveButton.addActionListener(formListener);
refreshButton.setText(resourceMap.getString("refreshButton.text")); // NOI18N
refreshButton.setName("refreshButton"); // NOI18N
24 | P a g e
refreshButton.addActionListener(formListener);
newButton.setText(resourceMap.getString("newButton.text")); // NOI18N
newButton.setName("newButton"); // NOI18N
newButton.addActionListener(formListener);
deleteButton.setText(resourceMap.getString("deleteButton.text")); // NOI18N
deleteButton.setName("deleteButton"); // NOI18N
binding =
org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.
UpdateStrategy.READ, masterTable,
org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), deleteButton,
org.jdesktop.beansbinding.BeanProperty.create("enabled"));
bindingGroup.addBinding(binding);
deleteButton.addActionListener(formListener);
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addComponent(newButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(deleteButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(refreshButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(saveButton))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(busTipeLabel)
.addComponent(passengerAmountLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(busTipeField,
javax.swing.GroupLayout.DEFAULT_SIZE, 437, Short.MAX_VALUE)
.addComponent(passengerAmountField,
javax.swing.GroupLayout.DEFAULT_SIZE, 437, Short.MAX_VALUE)))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(masterScrollPane,
javax.swing.GroupLayout.DEFAULT_SIZE, 535, Short.MAX_VALUE)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
25 | P a g e
.addComponent(masterScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 236,
Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(busTipeLabel)
.addComponent(busTipeField, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(passengerAmountLabel)
.addComponent(passengerAmountField,
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(saveButton)
.addComponent(refreshButton)
.addComponent(deleteButton)
.addComponent(newButton))
.addContainerGap())
);
bindingGroup.bind();
}
@SuppressWarnings("unchecked")
private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt) {
entityManager.getTransaction().rollback();
entityManager.getTransaction().begin();
java.util.Collection data = query.getResultList();
for (Object entity : data) {
entityManager.refresh(entity);
}
list.clear();
list.addAll(data);
}
26 | P a g e
toRemove.add(b);
entityManager.remove(b);
}
list.removeAll(toRemove);
}
27 | P a g e
Entity-Relationship Diagram
This relation diagram is Entity relation ship diagram it is characterized how to
relationship with table in Database.
Bus type
Passenger
amount
Bus type
To
Assign Through
From
Route Far
Route No
Price of ticket
Bus type
Documentary
R
u
Service District
n
Route No
Date
Number of ticket
Running
Number of trip
Stch..K.M
Vehicle number
Value
Stch..K.M Stch..K.M/Service
28 | P a g e
Database structure
MySql is used as the database management system of this project. The database named
ctbsource is the database of this system. In the ctbsource database there are many tables to
handle by operator. In the ctbsource database contains bus, runing and route tables currently.
Consider about the route table. It consists of all the data of route details of this system.
The above figure is a description of the route table, which we can understand what are the fields and
the corresponding data types of the fields. RouteNo field is the Primary Key of the route table.
In Route table there are not all route decodes. In that there is only fist 3 route recodes.
Consider about the runing table. It consists of all the data of running details of busses in this
system. This tables primary key is Run_no.
29 | P a g e
This is running table .there is some of recodes.
Consider about the bus table. It consists of all the data of bus type and amount of passenger of bus
in this system.
O/R mapping
After then I use new technology to connect and communicate with database. it is Object relational
mapping. Object-relational mapping (ORM, O/RM, and O/R mapping) in computer software is
a programming technique for converting data between incompatible type systems in object-
oriented programming languages. This creates, in effect, a "virtual object database" that can be used
from within the programming language. There are both free and commercial packages available that
perform object-relational mapping, although some programmers opt to create their own ORM tools.
Data management tasks in object-oriented (OO) programming are typically implemented by
manipulating objects that are almost always non-scalar values. For example, consider an address book
entry that represents a single person along with zero or more phone numbers and zero or more
addresses. This could be modeled in an object-oriented implementation by a "person object" with
"slots" to hold the data that comprise the entry: the person's name, a list of phone numbers, and a list
of addresses. The list of phone numbers would itself contain "phone number objects" and so on. The
address book entry is treated as a single value by the programming language (it can be referenced by a
single variable, for instance). Various methods can be associated with the object, such as a method to
return the preferred phone number, the home address, and so on.
However, many popular database products such as structured query language database management
systems (SQL DBMS) can only store and manipulate scalar values such as integers and strings
organized within normalized tables. Convert the object values into groups of simpler values for
storage in the database (and convert them back upon retrieval), only use simple scalar values within
the program. Object-relational mapping is used to implement the first approach.
The heart of the problem is translating those objects to forms that can be stored in the database for
easy retrieval, while preserving the properties of the objects and their relationships; these objects are
then said to be persistent.
30 | P a g e
Fist we billed persistence.xml file then we can billed persistence unite that is name is
ctbpROJECTPU
After then we can b build entity beans file in using O/R mapping with our database ctbsource
package ctbSource;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
*
* @author W.A.B. Janith
*/
@Entity
@Table(name = "route")
@NamedQueries({
@NamedQuery(name = "Route.findAll", query = "SELECT r FROM Route r"),
31 | P a g e
@NamedQuery(name = "Route.findByRouteNo", query = "SELECT r FROM Route r WHERE
r.routeNo = :routeNo"),
@NamedQuery(name = "Route.findByFromplace", query = "SELECT r FROM Route r
WHERE r.fromplace = :fromplace"),
@NamedQuery(name = "Route.findByThroughplace", query = "SELECT r FROM Route r
WHERE r.throughplace = :throughplace"),
@NamedQuery(name = "Route.findByToplace", query = "SELECT r FROM Route r WHERE
r.toplace = :toplace"),
@NamedQuery(name = "Route.findByFar", query = "SELECT r FROM Route r WHERE
r.far = :far"),
@NamedQuery(name = "Route.findByPriceOfTicket", query = "SELECT r FROM Route r
WHERE r.priceOfTicket = :priceOfTicket"),
@NamedQuery(name = "Route.findByDocumentary", query = "SELECT r FROM Route r
WHERE r.documentary = :documentary"),
@NamedQuery(name = "Route.findByServiceDis", query = "SELECT r FROM Route r
WHERE r.serviceDis = :serviceDis")})
public class Route implements Serializable {
@Transient
private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "RouteNo")
private String routeNo;
@Basic(optional = false)
@Column(name = "From_place")
private String fromplace;
@Basic(optional = false)
@Column(name = "Through_place")
private String throughplace;
@Basic(optional = false)
@Column(name = "To_place")
private String toplace;
@Basic(optional = false)
@Column(name = "Far")
private BigDecimal far;
@Basic(optional = false)
@Column(name = "PriceOfTicket")
private BigDecimal priceOfTicket;
@Basic(optional = false)
@Column(name = "Documentary")
private BigDecimal documentary;
@Basic(optional = false)
@Column(name = "serviceDis")
private String serviceDis;
@JoinColumn(name = "BusTipe", referencedColumnName = "BusTipe")
@ManyToOne(optional = false)
private Bus busTipe;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "routeNo")
private List<Runing> runingList;
public Route() {
}
32 | P a g e
public Route(String routeNo, String fromplace, String throughplace, String
toplace, BigDecimal far, BigDecimal priceOfTicket, BigDecimal documentary, String
serviceDis) {
this.routeNo = routeNo;
this.fromplace = fromplace;
this.throughplace = throughplace;
this.toplace = toplace;
this.far = far;
this.priceOfTicket = priceOfTicket;
this.documentary = documentary;
this.serviceDis = serviceDis;
}
33 | P a g e
BigDecimal oldFar = this.far;
this.far = far;
changeSupport.firePropertyChange("far", oldFar, far);
}
@Override
public int hashCode() {
int hash = 0;
hash += (routeNo != null ? routeNo.hashCode() : 0);
34 | P a g e
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
not set
if (!(object instanceof Route)) {
return false;
}
Route other = (Route) object;
if ((this.routeNo == null && other.routeNo != null) || (this.routeNo !=
null && !this.routeNo.equals(other.routeNo))) {
return false;
}
return true;
}
@Override
public String toString() {
return "ctbSource.Route[routeNo=" + routeNo + "]";
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ctbSource;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
35 | P a g e
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
/**
*
* @author W.A.B. Janith
*/
@Entity
@Table(name = "runing")
@NamedQueries({
@NamedQuery(name = "Runing.findAll", query = "SELECT r FROM Runing r"),
@NamedQuery(name = "Runing.findByRunno", query = "SELECT r FROM Runing r WHERE
r.runno = :runno"),
@NamedQuery(name = "Runing.findByDate", query = "SELECT r FROM Runing r WHERE
r.date = :date"),
@NamedQuery(name = "Runing.findByTripNumber", query = "SELECT r FROM Runing r
WHERE r.tripNumber = :tripNumber"),
@NamedQuery(name = "Runing.findByVehicalNo", query = "SELECT r FROM Runing r
WHERE r.vehicalNo = :vehicalNo"),
@NamedQuery(name = "Runing.findByValue", query = "SELECT r FROM Runing r WHERE
r.value = :value"),
@NamedQuery(name = "Runing.findByStchKm", query = "SELECT r FROM Runing r
WHERE r.stchKm = :stchKm"),
@NamedQuery(name = "Runing.findByStchKmService", query = "SELECT r FROM Runing
r WHERE r.stchKmService = :stchKmService"),
@NamedQuery(name = "Runing.findByStchKmDead", query = "SELECT r FROM Runing r
WHERE r.stchKmDead = :stchKmDead"),
@NamedQuery(name = "Runing.findByNumOfTickets", query = "SELECT r FROM Runing
r WHERE r.numOfTickets = :numOfTickets")})
public class Runing implements Serializable {
@Transient
private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "Run_no")
private Integer runno;
@Basic(optional = false)
@Column(name = "Date")
@Temporal(TemporalType.DATE)
private Date date;
@Column(name = "TripNumber")
private Integer tripNumber;
@Column(name = "VehicalNo")
private String vehicalNo;
@Basic(optional = false)
@Column(name = "Value")
private BigDecimal value;
@Basic(optional = false)
@Column(name = "Stch_Km")
private BigDecimal stchKm;
@Column(name = "Stch_Km_Service")
private BigDecimal stchKmService;
@Basic(optional = false)
@Column(name = "Stch_Km_Dead")
private BigDecimal stchKmDead;
@Basic(optional = false)
36 | P a g e
@Column(name = "NumOfTickets")
private int numOfTickets;
@JoinColumn(name = "RouteNo", referencedColumnName = "RouteNo")
@ManyToOne(optional = false)
private Route routeNo;
public Runing() {
}
37 | P a g e
this.vehicalNo = vehicalNo;
changeSupport.firePropertyChange("vehicalNo", oldVehicalNo, vehicalNo);
}
38 | P a g e
public void setRouteNo(Route routeNo) {
Route oldRouteNo = this.routeNo;
this.routeNo = routeNo;
changeSupport.firePropertyChange("routeNo", oldRouteNo, routeNo);
}
@Override
public int hashCode() {
int hash = 0;
hash += (runno != null ? runno.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
not set
if (!(object instanceof Runing)) {
return false;
}
Runing other = (Runing) object;
if ((this.runno == null && other.runno != null) || (this.runno != null &&
!this.runno.equals(other.runno))) {
return false;
}
return true;
}
@Override
public String toString() {
return "ctbSource.Runing[runno=" + runno + "]";
}
package ctbSource;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
39 | P a g e
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
*
* @author W.A.B. Janith
*/
@Entity
@Table(name = "bus")
@NamedQueries({
@NamedQuery(name = "Bus.findAll", query = "SELECT b FROM Bus b"),
@NamedQuery(name = "Bus.findByBusTipe", query = "SELECT b FROM Bus b WHERE
b.busTipe = :busTipe"),
@NamedQuery(name = "Bus.findByPassengerAmount", query = "SELECT b FROM Bus b
WHERE b.passengerAmount = :passengerAmount")})
public class Bus implements Serializable {
@Transient
private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "BusTipe")
private String busTipe;
@Basic(optional = false)
@Column(name = "PassengerAmount")
private int passengerAmount;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "busTipe")
private List<Route> routeList;
public Bus() {
}
40 | P a g e
this.passengerAmount = passengerAmount;
changeSupport.firePropertyChange("passengerAmount", oldPassengerAmount,
passengerAmount);
}
@Override
public int hashCode() {
int hash = 0;
hash += (busTipe != null ? busTipe.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are
not set
if (!(object instanceof Bus)) {
return false;
}
Bus other = (Bus) object;
if ((this.busTipe == null && other.busTipe != null) || (this.busTipe !=
null && !this.busTipe.equals(other.busTipe))) {
return false;
}
return true;
}
@Override
public String toString() {
return busTipe;
}
41 | P a g e
Conclusion
Ctb report generater is very convinent to generate manthliy running report in by one click.
This system replaces the manual CTB running system with this desktop based running section
project and gains a great efficient for that process and save time than before. So this leads to keep
the office in a high efficiency. Now the balangoda deport can submit their monthly running report
forms through the software . And as another requirement is to filter data without limitations, is also
covered by this system. Now the user can filter the database as he/she wish to find the appropriate
data. This system will be a complete desktop base Runnig data recodes system after completing
the future developments which are discussed below.
Discussion
In this system we can implement All net work in CTB deport and can be used electronic
iquepment then we can extend out project in get record in detecting system.as well as using
Entieprise java beans (EJB 2.0)consept we can link all of deport in Island wide so its benifite
is Get source in short time
We can using ststitical testing in finaly develop in this system and increase profite and
income.
Bibliography.
http://www.oracle.com/technetwork/java/index.html
http://download.oracle.com/javase/tutorial/
http://www.java2s.com
http://hocjava.files.wordpress.com/2008/06/a-tutorial-on-jasperreports-ireport-and-jfreechart.pdf
42 | P a g e