Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 67

D E PA RT M E N T O F C OM PU TE R SCI E N CE UN IV E RS I T Y OF MORATU WA

FINAL YEAR PROJECT


GENARIC PRINTING MODULE

GPModule
DATE OF SUBMISSION: MAY 04,2003
PREPAIRED BY:

S.N.C. Sethunga.

II This report is submitted in partial fulfillment of the requirements for the award of the degree of Bachelor of Science of Engineering at University of Moratuwa, Sri Lanka.

ABSTRACT

ABSTRACT

GENERIC PRINTING MODULE

The Generic Printing Module is developed as the final year project. This is a desktop application developed to aid to application software developers to have a printing section in their application. To have printing section, the developer should deal with interface, printing format related to application and etc, But Generic printing module provides the necessary tools for developers to integrate a printing section in their application without changing any code related to printing section. Since we are using Generic Printing Module, customizing not only be done to the printing, but the interface can also be customized according to main system that is being developed. The GPModule is a piece of software which prints a given data using information of the format fed through configuration files.

SUPERVISOR: AUTHOR:

MR. M. FIRDHOUS

S.N.C. Sethunga

III

ACKNOWLEDGEMENT
I would like to thank the staff of the department of Computer Science and Engineering and especially to Mr. Shantha Pranando for providing-his helping hand and guidance to get the project succeed. Further, It is a great opportunity for me to go through a such project in being an undergraduate and I am very grateful to the Computer science department and the University of Moratuwa as a whole. Especially I am extremely grateful to my internal supervisor Mr. M. Firdhous for his guidance provided through out the process.

IV

INTRODUCTION
Printing is a powerful tool for business. Printing improves communication, decision-making and managerial productivity, the manager, sales person, or decision maker who does no use printed documents for business operates at a competitive disadvantage. So in todays context inclusion of a printing section can be seen in almost all applications. To have a printing section in an application developer should concern about the format of the printouts and the interface provided to the user of the system. The format of the printouts varies application to applications and the interface provided by the printing section should keep the uniformity of the system that is being developed. So formatting and the interface are major concern in printing section development. Especially formatting of the data related to the application makes the inclusion time of a printing section is high for the developers. Generic Printing Module, as the name implies, has the feature of generality. Generic Printing Module is a module for printing section that can be integrated to a system which is developed using Java as a separate section. And this is developed as an individual project. The above is a major concern in helping application developers and the module development tool. can be considered as a rapid application

V My major objective was to develop a system which helps developers to include a printing section in their application without time waste. In developing the system I used Java as the programming language. For the configuration part I used HTML and disk files accessed through java.

AIMS
THE AIMS OF DEVELOPING THIS MODULE CAN BE LISTED AS FOLLOWS.

a) Developing a module for printing section. i. The system should print formatted documents

b) A print preview should be provide i. For a particular configuration and the data fed to the module, a print preview should be provided. ii. Navigating facility should be provided for multiple paged printouts. iii. iv. Paging of the document given. Inclusion of customized headers and footers.

VI v. vi. vii. viii. ix. x. Zoom out/ Zoom in functions. Customizable zooming level. Zoom level displaying Customizable no of pages in a display. 3D page view Showing multiple pages with zoom level selection. xi. xii. Page setup through the print preview Full screen print preview and restoring

c) Printing of data of multiple sets. i. ii. iii. Giving print preview for each set Navigation through the sets Printing of data related to multiple sets.

d) Providing the system as separate module. i. The module is developed to integrate with other Java based developments. ii. Minimum coupling to the main application to which Generic Printing Module is going to be included should be maintained.

VII e) Platform Independence. i. The system should run on Windows & Unix environments ii. Giving print preview and printouts for and system considering given configuration.

VIII
TABLE OF CONTENTS

ABSTRACT............................................................................................................................2 GENERIC PRINTING MODULE...................................................................................................2 ACKNOWLEDGEMENT......................................................................................................3 INTRODUCTION..................................................................................................................4 AIMS......................................................................................................................................5 THE AIMS OF DEVELOPING THIS MODULE CAN BE LISTED AS FOLLOWS..................................5 CHAPTER INTRODUCTION.........................................................................................12 1.1GENERIC PRINTING MODULED.........................................................................................12 1.1.1PRINTING MODULE........................................................................................................13 1.1.2USE OF GENERIC MODULE: ..........................................................................................14 1.1.3MODULE ENVIRONMENT & INTEGRATION.....................................................................15 2. CHAPTER - FUNDAMENTAL CONCEPTS AND TECHNOLOGIES USED IN GPMODULE DEVELOPMENT.........................................................................................16 2.1OBJECT ORIENT DEVELOPMENT.......................................................................................16 2.1.1CLASSES........................................................................................................................17 2.1.2OBJECTS, ATTRIBUTES AND OPERATIONS;.....................................................................17 2.1.3CLASS RELATIONSHIPS..................................................................................................18 2.2RATIONAL ROSE...............................................................................................................20 2.2.1CLASS PACKAGE...........................................................................................................21 2.2.2RATIONAL ROSE CLASSES..............................................................................................22 2.2.2.1 CLASS ATTRIBUTES..................................................................................................23 2.2.2.2 CLASS OPERATIONS..................................................................................................23 2.2.2.3 CLASS RELATIONSHIPS.............................................................................................23 2.3JAVA.................................................................................................................................25 2.3.1WHAT IS JAVA?..............................................................................................................26 2.3.2JAVA IS SMALL AND SIMPLE.........................................................................................27 2.3.3JAVA IS OBJECT ORIENTED...........................................................................................28 2.3.4JAVA IS SAFE.................................................................................................................29 2.3.5JAVA IS PLATFORM INDEPENDENT................................................................................30 2.3.6JAVA IS THAT OTHER STUFF, TOO................................................................................31 2.3.7JAVAOS.........................................................................................................................32 2.4XML..................................................................................................................................33 2.4.1SGML VS XML?............................................................................................................33 2.4.2TWO KINDS OF XML PAGES.........................................................................................33 2.4.3DTD (DOCUMENT TYPE DEFINITION)...........................................................................33 2.4.4MAKING YOUR OWN BLOCKS.......................................................................................34 2.4.5HTML VS XML?............................................................................................................35 2.4.6THE MAIN DIFFERENCES ...............................................................................................35 2.4.7XML IS FREE AND EXTENSIBLE.....................................................................................36 2.4.8XML IS A COMPLEMENT TO HTML...............................................................................36 2.5XHTML...........................................................................................................................37 2.5.1WHAT IS XHTML?.......................................................................................................37

IX
2.5.2XHTML DTD...............................................................................................................37 2.5.3MAIN FEATURES OF XHTML .......................................................................................37 3. CHAPTER - IMPLEMENTATION...............................................................................40 3.1REQUIREMENT SPECIFICATION.........................................................................................40 3.1.1OBJECTIVES:..................................................................................................................40 3.1.1.1INTERFACE..................................................................................................................41 3.1.1.1.1PRINT.......................................................................................................................41 3.1.1.1.2PAGE SETUP.............................................................................................................42 3.1.1.1.3ZOOM IN/ZOOM OUT ...............................................................................................42 3.1.1.1.4PAGE UP/DOWN........................................................................................................43 3.1.1.2HELPING SYSTEM........................................................................................................44 3.1.1.3FORMATTING..............................................................................................................45 3.1.1.3.1FORMATTING ..........................................................................................................45 3.1.1.3.2FORMATTING LANGUAGE .......................................................................................46 3.1.1.4CONFIGURATION ........................................................................................................46 3.1.1.5PLUGGED TO MAIN APPLICATION ..............................................................................47 3.2DESIGN.............................................................................................................................47 3.2.1THE ARCHITECTURE......................................................................................................47 3.2.2THE USER CASE VIEW:...................................................................................................50 3.2.3THE CLASS DIAGRAMS:.................................................................................................54 3.3IMPLEMENTATION.............................................................................................................58 3.3.1LANGUAGE FOR IMPLEMENTATION...............................................................................58 3.4GPMODULE ...................................................................................................................59 4. CHAPTER - CONCLUSIONS.........................................................................................61 5. CHAPTER - FUTURE WORKS.....................................................................................64 6. CHAPTER - REFERENCES...........................................................................................66

TABLE OF FIGURES FIGURE 1 - MODULE CONNECTIONS ROSE IMPLEMENTATION......................22 FIGURE 2 - AGGREGATION RELATION.................................................................24 FIGURE 3 - ASSOCIATION WITH A CARDINALITY INFORMATION. ...............25 FIGURE 4 - PRINT FUNCTIONS ..................................................................................42 FIGURE 5 - PAGE SETUP..............................................................................................42 FIGURE 6 - ZOOM IN/OUT INTERFACE....................................................................43 FIGURE 7 - HELPING SUB MODULE..........................................................................44 FIGURE 8 - SAMPLE PRINT PREVIEW......................................................................45 FIGURE 9 - CUSTOMIZING HEADERS/FOOTER ....................................................46 FIGURE 10 - SIMPLE FUNCTIONAL ARCHITECTURE .........................................48 FIGURE 11 - ABSTRACT VIEW OF THE SYSTEM ARCHITECTURE...................49 FIGURE 12 - SEQUENCE DIAGRAM............................................................................50 FIGURE 13 - SEQUENCE DIAGRAM FOR INITIALIZATION.................................52 FIGURE 14 - USER CASE DIAGRAM ..........................................................................53 FIGURE 15 - FRMPRINTPREVIEW CLASS THE MAIN CLASS ............................54 FIGURE 16 - CLASS PAGE - THE HTML PARSER....................................................55 FIGURE 17 - CLASS PREVIEW PANE - THE PREVIEW..........................................57 FIGURE 18 - CLASS PAPERPANEL .............................................................................57 FIGURE 19 -INTERFACE A SNAP SHOT..................................................................59

XI

XII

FIGURE 1 - MODULE CONNECTIONS ROSE IMPLEMENTATION......................22 FIGURE 2 - AGGREGATION RELATION.................................................................24 FIGURE 3 - ASSOCIATION WITH A CARDINALITY INFORMATION. ...............25 FIGURE 4 - PRINT FUNCTIONS ..................................................................................42 FIGURE 5 - PAGE SETUP..............................................................................................42 FIGURE 6 - ZOOM IN/OUT INTERFACE....................................................................43 FIGURE 7 - HELPING SUB MODULE..........................................................................44 FIGURE 8 - SAMPLE PRINT PREVIEW......................................................................45 FIGURE 9 - CUSTOMIZING HEADERS/FOOTER ....................................................46 FIGURE 10 - SIMPLE FUNCTIONAL ARCHITECTURE .........................................48 FIGURE 11 - ABSTRACT VIEW OF THE SYSTEM ARCHITECTURE...................49 FIGURE 12 - SEQUENCE DIAGRAM............................................................................50 FIGURE 13 - SEQUENCE DIAGRAM FOR INITIALIZATION.................................52 FIGURE 14 - USER CASE DIAGRAM ..........................................................................53 FIGURE 15 - FRMPRINTPREVIEW CLASS THE MAIN CLASS ............................54 FIGURE 16 - CLASS PAGE - THE HTML PARSER....................................................55 FIGURE 17 - CLASS PREVIEW PANE - THE PREVIEW..........................................57 FIGURE 18 - CLASS PAPERPANEL .............................................................................57 FIGURE 19 -INTERFACE A SNAP SHOT..................................................................59

CHAPTER INTRODUCTION

1.1 GENERIC PRINTING MODULED

Software developers take long lead time for developing printing section in their products, and this is great expense.

XIII GP Module is a printing module which overcomes these obstacles. Using the module you can have great advantages as a software developer through your software product without rewriting any code related to printing section even for formatting the graphics related part which produces the needed printout format. You can create your own formatting file using html tags. A module may be dependent on, and require other Components be present. The interfaces between them must be well defined, stable (not likely to change frequently), and limited in number. Modules may be separately installed or upgraded as long as the interfaces to other components are kept backwards compatible. To add the module to an application, have to do is follow a simple three step process: 1. Creating formatting file which explain the format of the printouts related to your software product 2. Making a configuration file that includes interface

parameters for the interface of the print preview. 3 pass required data to the module to use in printing. Some technical concepts that make the background to the GPModule are as follows

1.1.1 PRINTING MODULE

1. Module

for printing:

XIV A module is an independent software program that can be developed separately and can be integrated to another product with least amount of effort. Module that is developed for the printing does the printing behalf of developed system to which the module is loosely coupled. 2. Generic module Making of a module generic gives more usability. Inclusion of customizability to a generic module gives highly useful product.
1.1.2 USE OF GENERIC MODULE:

1. Ability to be integrated to a range of products. 2. Platform independent usage. 3. Low coupling and less errors Since developing a printing section for each product is time consuming, If a developer has a printing module that can be integrated easily with the system, make the development rapid. In other hand a printing section can be included easily even for the systems that have less importance of printing since it takes very small amount of effort.

XV
1.1.3 MODULE ENVIRONMENT & INTEGRATION

A module system consists of several modules and the controlled coupling of those modules which is formed by integration and communication of the modules. The desired condition is to have less coupling and high cohesion. There for each module should do the task only its own and completely. This implies the importance and the ability to have such generic printing module.

XVI

2. CHAPTER - FUNDAMENTAL CONCEPTS AND TECHNOLOGIES USED IN GPMODULE DEVELOPMENT


This Chapter will give an introduction and explanation of some of the fundamental concepts and technologies used for generic module of printing. Those technologies used design phase onwards are explained bellow.

2.1

OBJECT ORIENT DEVELOPMENT

Object oriented design technique is the most widely used software design techniques now days. Natural structure of the environment is more closed to the concept of Object Orientation. It gives main reason for the popularity of the OO Development.

XVII Object oriented design and implementation offers many benefits over previous process oriented development techniques. The business object and its characteristics are more stable over time than processes. The definition and modeling of business objects allows parallel development of applications against standard interfaces to the objects. Maintenance of applications is less complex since small changes can be isolated to a single class without the cascading effect on other code. This section of the chapter will explain some of the basic terms and techniques used in Object oriented development such as classes, objects, relationships and etc

2.1.1

CLASSES

Classes are used to represent real, physical entities such as Customers, Parts, Machines, and Inventory Locations. They also represent intangible entities such as Checking Accounts, Orders, and Invoices.
2.1.2

OBJECTS, ATTRIBUTES AND OPERATIONS;

Classes are used as templates for the creation of objects, which are real instances (occurrences) of business elements. Creation of an object from the class template is a process called instantiation. Classes model the characteristics of a common set of objects by defining their attributes (data about the object), and their behavior (software methods). These methods are called operations. As instances of a class (objects) are being created, each will have the data structure and methods defined by its class, but with its own unique data values.

XVIII Inheritance

A class may also be defined as a derived class based on another class. A derived class is said to inherit all of the attributes and methods of the base class. The derived class may then have attributes and methods added to it to become a new, unique class. Encapsulation;

A key characteristic of object oriented implementations is that of data hiding, or encapsulation. This means that an objects data is only visible outside the object by way of the objects own methods.

2.1.3

CLASS RELATIONSHIPS

An important aspect of modeling is defining relationships between classes. There are multiple types of relationships that will be modeled.

A class may be constructed of other classes: an assembly is constructed of one or more subassemblies, or an order contains one or more order items.

A class has awareness of another class: a sales order knows which customer it is for, a purchase order knows which supplier it is for.

A class has been derived from another class: a sales part class has been derived from a more general part class; a specific automobile body type class has been derived from a general passenger automobile class.

XIX

A class may depend on methods in another class to support its own behaviors: an analysis class may depend on methods in other classes to gather data for analysis purposes; a maintenance activity class may depend on methods in an inventory class to determine part availability. Relationships are used to model the interaction between classes.

Relationships indicate some type of physical or logical connection between classes. Relationships also show dependencies between classes. When a class is derived from another class, a relationship is used to indicate the base class and the derived class. Some are

Aggregation Association Dependency Generalization An aggregation relationship is used to specify a parent-child

relationship between two classes. This is normally a one to many relationships. An assembly is made up of many sub-assemblies. The implementation of aggregate relationships is by way of including the primary key of the parent as the first part of the primary key of the child. This gives the child a unique identity, but indicates ownership on the part of the parent. When instantiating a child class object, the parent class object must already exist. The Association relationship is used to specify that one class has awareness, or knows about another class. A customer order

XX knows which customer it is for. An order item knows which sales part it is for. This relationship is commonly a many-to-one association. Each order can be for only one customer, but many other orders can be for that customer as well. The association relationship is implemented by adding

additional generated attribute(s) to the knowing class, which contain the primary key of the known about class. The cardinality information shows that this is a one-to-many (1..*) relationship. To model a many-to-many relationship between two classes, an association is created between them, but with a variation. The association is set to cardinality of many-to-many (*..*). Then an additional class, called a link class, must be created. A link association is then created between the new link class, and the previously created association relationship between the two original classes. The class is modeled as a normal class, and becomes a link class by use of the link attribute notation.

2.2

RATIONAL ROSE three different modeling notation

Rational

Rose

supports

standards, Unified Modeling Language (UML), Object Modeling Technology (OMT), and Booch. UML is used by me for modeling. UML represents the best of OMT, Booch, and others and is the current industry standard. The Rose tool can show the same model in any of the three notations by choosing the desired one under the View menu item.

XXI
2.2.1

CLASS PACKAGE

A class package is a top level representation of an application component (previously referred to as module) in UML. A model contains one or more class packages. By double clicking on a package, Rose will open a class diagram sheet for that component. The top level for the Demo Application shows three class packages (components): Enterprise, Stock Control, and Order Entry.

XXII

Figure 1 - Module connections Rose implementation

2.2.2

RATIONAL ROSE CLASSES Rose supports a number of class types.

Class

Normal class with attributes and operations.

Instantiated Class Class with a fixed set of attribute values. This class is referred to as an IID (Internal Identifier).

XXIII

Class Utility

Class

with

operations

only.

Operates on another classs data. Operates on multiple objects within another class.

2.2.2.1

CLASS ATTRIBUTES

The attributes specified for the class will serve as default columns for persistent storage of data values for objects instantiated from the class. An attribute specification consists of a name, a data type, and an export control, which defines the scope of use for an attribute.

2.2.2.2

CLASS OPERATIONS (referred to as methods in object oriented

Operations

terminology) are specified in Rose modeling to create the structure for implementing the software functions needed to carry out the desired behaviors for a class. Operations will have arguments passed to them when they are executed. Any additional required arguments must be specified in the model, along with the data type for the argument.

2.2.2.3

CLASS RELATIONSHIPS

Relationships are used to model the interaction between classes. Relationships indicate some type of physical or logical connection between classes. Relationships also show dependencies between

XXIV classes. When a class is derived from another class, a relationship is used to indicate the base class and the derived class. Four relationships that are commonly used:

Aggregation Association Dependency Generalization Sample relationship showing methodologies using rational rose.

Figure 2 - Aggregation relation

XXV

Figure 3 - Association with a cardinality information.

2.3

JAVA

Never before has a new programming language received so much attention and become so popular so quickly. In the first year of its existence, Java took the Web by storm and became its adopted programming language. Since then, Java has become the language of choice for developing both Internet and intranet applications, and is used for both business and consumer software development. The Java phenomenon has captivated the imaginations of programmers around the world and is leading the way toward the next era of distributed application development. Java's appeal lies in its simplicity, its familiarity, and the careful selection of features that it includes and excludes. Java was not designed by a government committee or a clique of academics. It shares its spirit with C more than any syntactical similarities. It is a

XXVI programming language that was designed by programmers for programmers.

2.3.1

WHAT IS JAVA?

The basics: Java is an object-oriented programming language developed by Sun Microsystems that plays to the strengths of the Internet. Object-oriented programming (OOP) is an unusual but powerful way to develop software. In OOP, a computer program is considered to be a group of objects that interact with each other. Consider an embezzlement program implemented with Java: A Worker object skims some Money objects from the CompanyFunds object and puts them in its own BankAccount object. If another Worker object uses the DoublecheckFunds object, a Police object will be called. The feature that is best known about Java is that it can be used to create programs that execute from World Wide Web pages. These programs are called applets. Java programs made such a big splash on the Web because they offered interactivity in a medium that was largely one way. The Web distributes almost all information in a passive manner. Someone using a browser asks for a page, looks it over, asks for another, looks it over, and so on. Although Web-based programs are strength of the language, Java is a general-purpose language that can be used to develop all kinds of programs.

XXVII A Java program is created as a text file with the file extension .java. It is compiled into one or more files of bytecodes with the extension .class. Bytecodes are sets of instructions similar to the machine code instructions created when a computer program is compiled. The difference is that machine code must run on the computer system it was compiled for, and bytecodes can run on any computer system equipped to handle Java programs.

2.3.2

JAVA IS SMALL AND SIMPLE

The object-oriented approach, and most of Java's syntax, is adapted from C++. Programmers who are familiar with that language (or with C) will have a much easier time learning Java because of the common features. However, Java has been described as "C++ minus" because of elements of C++ that were omitted. The most complex parts of C+ + were excluded from Java, such as pointers and memory management. These elements are complicated to use, and are thus easier to use incorrectly. Finding a pointer error in a large program is an experience not unlike searching for the one-armed man who framed you for murder. Memory management occurs automatically in Java-programmers do not have to write their own garbagecollection routines to free up memory. Another design decision to make Java simpler is its elementary data types and objects. The language enforces very strict rules

XXVIII regarding variables-in almost all cases, you have to use variables as the data type they were declared to be, or use explicit casts to manipulate them. This arrangement permits mistakes in variable use to be caught when the program is compiled, rather than letting them creep into a running program where they're harder to find. As a result, programs behave in a more predictable manner. Experienced programmers may have trouble adjusting to some of the changes and reductions from C++. However, Java's developers were trying to make the language easier to write, debug, and learn.

2.3.3

JAVA IS OBJECT ORIENTED

Object-oriented programming (OOP) is a powerful way of organizing and developing software. The short-form description of OOP is that it organizes a program as a set of components called objects. These objects exist independently of each other, and they have rules for communicating with other objects and for telling those objects to do things.

Java inherits its object-oriented concepts from C++ and other languages such as Smalltalk. The fact that a programming language is object oriented may not seem like a benefit to some. Objectoriented programming can be an intimidating subject to tackle, even if you have some experience programming with other languages. However, object-oriented programs are more adaptable for use in other projects, easier to understand, and more bug proof. The language includes a set of class libraries that provide basic variable types, system input and output capabilities, and other

XXIX functions. It also includes classes to support networking, Internet protocols, and graphical user interface functions. There's a lot of excitement in the programming community because Java provides a new opportunity to use object-oriented techniques on the jobs. Smalltalk, the language that pioneered object-oriented programming in the 1970s, is well-respected but has never been widely adopted as a software-development choice. As a result, getting the go-ahead to develop a project using Smalltalk can be an uphill struggle. C++ is object oriented, but concerns about its use have already been described. Java is overcoming the hurdle in terms of usage, especially in regard to Internet programming and the development of distributed applications.

2.3.4

JAVA IS SAFE

Another thing essential to Java's success is that it be safe. This emphasis on security was well-suited for Java's adaptation to the World Wide Web. A Java program that executes from a Web page is called an applet. All other Java programs are called applications. When an applet is encountered on a Web page (if the user's browser can handle Java), the browser downloads the applet along with the text and images on the page. The applet then runs on the user's computer. This act should raise a warning because a lot of harmful things can occur when programs are executed: viruses, Trojan horses, the Microsoft Network, and so on.

Java provides security on several different levels. First, the language was designed to make it extremely difficult to execute

XXX damaging code. The elimination of pointers is a big step in this regard. Pointers are a powerful feature, as the programmers of Clike languages can attest, but pointers can be used to forge access to parts of a program where access is not allowed, and to access areas in memory that are supposed to be unalterable. By eliminating all pointers except for a limited form of references to objects, Java is a much more secure language. Another level of security is the byte code verifier. As described earlier, Java programs are compiled into sets of instructions called byte codes. Before a Java program is run, a verifier checks each byte code to make sure that nothing suspicious is going on. In addition to these measures, Java has several safeguards that apply to applets. To prevent a program from committing random acts of violence against a user's disk drives, an applet cannot open, read, or write files on the user's system. Also, because Java applets can open new windows, these windows have a Java logo and text that identifies their identity. This prevents one of these pop-up windows from pretending to be something such as a user name and password dialog box. Because of the multiple levels of security, and the continued efforts to improve these measures, Java is generally regarded as a secure means to execute code over the World Wide Web.

2.3.5

JAVA IS PLATFORM INDEPENDENT

Platform independence is another way of saying that Java is architecture neutral. That basically means that Java programs don't care what system they're running on.Most computer software is

XXXI developed for a specific operating system. Platform independence is the ability of the same program to work on different operating systems; Java is completely platform independent.

Java's variable types have the same size across all Java development platforms-so an integer is always the same size, no matter which system a Java program was written and compiled on. Also, as shown by the use of applets on the Web, a Java .class file of bytecode alteration. Sun Microsystems has been aggressive in making Java available on different systems. Java's declaration of platform independence is often trumpeted by Java advocates as a major accomplishment because it opens up a much larger audience for programs than has been readily available in the past. Although no major commercial releases of Java-based software have been introduced as of this writing (other than JavaSoft products such as HotJava and the Java WorkShop announced. programming environment), several have been instructions can execute on any platform without

2.3.6

JAVA IS THAT OTHER STUFF, TOO

One adjective that has been left out thus far is that Java is multithreaded. Threads represent a way for a computer program to do more than one task at the same time. Many operating systems are multitasking. Windows 95, for example, enables a person to write a book chapter with Word in one window while using Netscape Navigator to download every known picture in the other.

XXXII A multithreaded language extends this schizophrenic behavior to programs so that more than one set of instructions can be executed concurrently. Java provides the tools to write multithreaded programs and to make these programs reliable in execution. Another thing that should be highlighted is Java's network-centric nature. Sun, the company that trademarked the phrase, "the network is the computer," has created a language that backs it up. Java makes it possible to create applications that communicate across the Internet. Its networkability may be the area in which Java truly separates itself from other languages that can be used for development. And more precisely the thing that distinguishes Java is its approach to distributed programming.

2.3.7

JAVAOS

JavaOS, a compact operating system intended to run Java programs. The stated goal is to be the fastest and smallest platform that can handle Java. In addition to being a competitor to operating systems such as Microsoft Windows 95, JavaOS will put the language where it was originally intended to be: in appliances. The operating system will be embedded on processor chips being developed by Sun.

XXXIII
2.4 2.4.1

XML

SGML VS XML?

SGML stands for Standard Generalized Markup Language. SGML is the mother of markup languages like HTML. Think of it this way: By using SGML, you have the ability to create your own tags. XML stands for eXtensible MarkUp Language. XML is a sub-set of SGML, as is HTML and it is the best description of the language. XML can be considered as a very simplified version of SGML. It is a version of the language that people can understand. It will allow you to set up your own tags and mathematical equations using commands that you can probably understand.

2.4.2 TWO KINDS OF XML PAGES

The two main types of XML pages are the "standalone" and those that use a DTD. The standalone is just what it says: the page stands alone relying on the browser to have the XML DTD. In the XML language, the browser will be the XML processor. The other type of page offers the DTD to the browser so it can run the page.

2.4.3 DTD (DOCUMENT TYPE DEFINITION)

SGML is what is known as a "meta-language;" it allows a programmer to write a DTD (Document Type Definition) that numerous pages can follow. For instance, all of you use a word processor. You type the letter "j." Something inside of that word processor must understand what you did and display that letter. That's the DTD. You then alter the letter's size, font, and color.

XXXIV Again, the commands the word processor used were all understood and acted upon by using the DTD as a guide. HTML uses DTDs. Ever seen one of these at the very top of a page's source code: <!doctype html public "-//w3c//DTD html 4.0//en"> document declaration. The one drawback with a word processor, and HTML, is that you cannot set up your own DTDs. HTML is a very stable format of markup languages. The commands mean the same thing everywhere. The language is easy to learn because it is like playing blocks, to some extent. The tools you use never change. JavaScript is more difficult because you are actually creating the blocks before you play with them. Actually, that's the purpose of XML; it allows you to create your own blocks to play with. Because XML is a simplified version of SGML That's a

2.4.4

MAKING YOUR OWN BLOCKS

say you want to create a document where a certain type of text is going to be bold, italic, red, 25 point, Arial font, and a few other fancy things. And this type of text appears a great many times. In HTML you would need to write out the start and end flags every time you made the text. You can set up a style sheet to do that. That's the general idea here, a giant style sheet-type document that acts as "mother" for all the other documents was set. Creating your own DTD eliminates one whole step in the process -- the HTML.

XXXV
2.4.5

HTML VS XML?

Html was the first computer language that could be understood and used by the masses. it's become static. There's not a lot more one can do with it. Supposedly XML will allow a lot more flexibility in your Web pages. There will also be more flexibility in your HREF links. You'll be able to create cross-references and threads and other fun stuff. HTML will be around for years to come, if not forever. It is still a solid format and too many people know it. The W3C suggests that HTML should be "an application of XML". The purpose is to tighten HTML's programming standards to make them compliant with XML. XML is very specific. One thing means one thing. HTML isn't so specific. For example:

Tags can be in caps or not. TEXTAREA boxes require end tags, yet text boxes do not. Tags can end in any order regardless of how they were placed.

By placing the HTML 4.0 DTD under the XML DTD, the language has no choice but to follow the same strict rules that XML does.

2.4.6

THE MAIN DIFFERENCES

XML was designed to carry data. XML is not a replacement for HTML. XML and HTML were designed with different goals:

XXXVI XML was designed to describe data and to focus on what data is. HTML was designed to display data and to focus on how data looks. HTML is about displaying information, XML is about describing information.

2.4.7

XML IS FREE AND EXTENSIBLE

The tags used to markup HTML documents and the structure of HTML documents is predefined. The author of HTML documents can only use tags that are defined in the HTML standard (like <p>, <h1>, etc.). XML allows the author to define his own tags and his own document structure.

2.4.8

XML IS A COMPLEMENT TO HTML

XML is not a replacement for HTML. It is important to understand that XML is not a replacement for HTML. In future Web development it is most likely that XML will be used to describe the data, while HTML will be used to format and display the same data. XML is a cross-platform, software and hardware independent tool for transmitting information.

XXXVII
2.5

XHTML

XHTML is a new format close to XML, but with a lot of HTML qualities about it.
2.5.1

WHAT IS XHTML?

Its XML with HTML written into the Document Type Definition (DTD).
2.5.2

XHTML DTD

Inside your browser, there's a DTD. It's different from browser to browser depending on which version you're using. The reason that Internet Explorer 4.0 understands some HTML 4.0 level commands and Internet Explorer 3.0 doesn't is because those commands were written into the 4.0 browser's DTD. The new XHTML 1.0 DTD is basically the XML DTD with the HTML 4.0 DTD put inside it. Users must follow the majority of XML rules because HTML is under XML's umbrella rather than being the other way around.

2.5.3

MAIN FEATURES OF XHTML

The main features of XHTML are extensibility; portability; and standardization.

Extensibility: XHTML is extendable. You can create your own tags and add onto it.

Portability: Those new tags are done in such a way that all can understand it.

XXXVIII

Standardization: Now we have a true template for what is and is not acceptable coding. Everyone must follow that template.

But, some problems are there like. XHTML is not as easy to just play around with on the weekend as HTML. HTML is so simple that everyone can use. People might lose interest being held to such a rigid set of rules. The XHTML DTD contains HTML. You just need to use an HTML declaration statement at the top of the document.

XXXIX

XL

3.

CHAPTER - IMPLEMENTATION

3.1 3.1.1 OBJECTIVES:

REQUIREMENT SPECIFICATION

Developing printing module so that to print documents with and format related to the main system. The module deals generate necessary interface for printing system with a print preview and can be plugged into other applications by creating configuration documents and passing data as parameters. Requirements for each section of the module

XLI
3.1.1.1 INTERFACE

3.1.1.1.1 PRINT

Most of functions that we can see in most of commercial applications in the market. The OS is also providing a interface for print function which includes functionality to setting 1. print properties 2. range printing 3. no of copy selection

XLII Figure 4 - Print functions

3.1.1.1.2 PAGE SETUP

Customizing of the page properties. Like paper selecting orientation margin selection .

Figure 5 - Page Setup


3.1.1.1.3 ZOOM IN/ZOOM OUT

Module generates a preview for printing pages. Zoom in and out by a fixed factor should be included. And the user should be able to select a customized level of zoom. Selecting no of pages to be shown in a single screen also a essential and showing zoom level related to the page no selection.

XLIII

Figure 6 - Zoom In/Out interface

Giving full screen print preview for the mouse click also to be supported

3.1.1.1.4 PAGE UP/DOWN

Ones more than pages are to be printed in the preview page up/down should be added.

displaying data related multiple sets

Since printouts should be taken for mare than one set depending the main application print previewing and printing should be done for each set the necessary functionality should be provided for this.

XLIV
3.1.1.2 HELPING SYSTEM

Figure 7 - Helping sub module

Supporting above interface functions a print preview should be provided

XLV Figure 8 - Sample Print Preview

The properties of interface should be as follows 1 2 3 4


5

Display the format to be printed. 3d view of the paper showing of multiple pages in a view These pages ca be selected with the mouse.
Functionality related to paging and scrolling the paged preview. (using scrollbar & page down/up buttons.)

3.1.1.3

FORMATTING

3.1.1.3.1 FORMATTING

Since the format of the printout should be defer from one system to other, format is to be specified using some formatting tool. Formatting tool should give a comprehensive method to specified any need format. User friendly formatting language. In addition to the formatting specified from the formatting file headers and footers should be customized and added to the printouts Customizing header and footers 1. 2. 3. 4. 5. Font selection for header & footers Adding page no, total pages, data, time user name Selection of wall paper for header & footer consider about Reveres in even pages Find image panel may use.

XLVI

Figure 9 - Customizing headers/footer

3.1.1.3.2 FORMATTING LANGUAGE

XHtml may be used as the formatting language or the formatting tool. Since the Html is the most widely used and popular formatting language now days html may used for the formatting task.
3.1.1.4 CONFIGURATION

The module is used by the developers to add to their developments as an add-on section. The interface provided by the module should have uniform theme with the main application so there should be a mechanism for specifying the

XLVII interface parameters. Configuration file may be used for the specification.
3.1.1.5 PLUGGED TO MAIN APPLICATION

The module is to be added separately to the main application with the forming of a minimum coupling. The data can be passed to the module as parameters. Print preview interface may be a dialog box which ca be popped up form the main application interface.

3.2

DESIGN

Simple object oriented structure is to be maintained. Overall project at the end is in the form of a module.

3.2.1 THE ARCHITECTURE.

XLVIII

Main application
HTML Formatting

Data

GP Modul e

Print out

Figure 10 - Simple functional architecture

Simple function of the GPModule can be illustrated as above sketch. It takes Html formatting and data in the form of a vector producing printouts which is formatted using html formatting file. The main component of the module inside the packages uses a preview pane and an object that parse html tags for creating print preview and printing that is with the format specified by the formatting file.

XLIX

Preview pane Interface Html parsing

Figure 11 - Abstract view of the system Architecture UML is for exactly the same so UML (unified modeling language ) used for the design with Rational Rose which one of the most popular design tool in the market specially for design with UML.

3.2.2 THE USER CASE VIEW:

Data Store

Main form

Html making Html parse

Paper make

Data Config file, Style file

Style file /data Html Html

Display

Figure 12 - Sequence diagram

LI

STAR T Create Displaying form

Create first page.

First page display calling

Configuration file parsing and Html making


Set he total no of pages

Show the pages and change the setting

Change the page format

END

LII

Figure 13 - Sequence diagram for initialization

LIII

Figure 14 - user case diagram

LIV
3.2.3 THE CLASS DIAGRAMS:

Figure 15 - frmPrintPreview class the main class

LV

Figure 16 - class page - the html parser

LVI

LVII Figure 17 - class preview pane - the preview

Figure 18 - class paperPanel

LVIII

3.3

IMPLEMENTATION

3.3.1 LANGUAGE FOR IMPLEMENTATION

Some properties of the module 1. Platform independence 2. More usage 3. for Object Oriented design (With module) Java One of most widely used popular technologies. Provides not only programming language but all the technological background for developments with the above properties. Java technology is used as the programming language.

LIX

3.4

GPMODULE

The module is developed through above steps. It gives almost all the functionalities for the printing task.

Figure 19 -interface a snap shot

LX

LXI

4. CHAPTER - CONCLUSIONS
Rapid application that development competes with is an emerging software

technology/technique

traditional

development techniques. RAP already has the upper hand from the two technologies due to the feature of rapidity and now there is a greater tendency of developing Rapid application development tools for traditional software development technologies. Object oriented design technique is the most widely used software design techniques now days. Natural structure of the environment is more closed to the concept of Object Orientation. It gives reason for the popularity of the OO Development. In OOD process, system decomposition to the Modules is done as development technique. So enforcing design to have separate modules for separate section eventually leads to good design and good product. Java is most widely used technology for software developments. It provides platform independence by the use of Virtual Machine concept. Combination of rapid application development with Java technology may helpful for the success of software industry. But issues related to speed always a case with java. So the overall performances may decrease of the module. Therefore the disk accessing and algorithms should be more efficient.

LXII Generic module is a module that can be adopted of used for many situations. Java is one of proper language for developing generic solution since java gives platform independence which is a form of generosity to the solution. Generic module development is one of the newly found rapid application development techniques which is often employed in optimization of development time. GPModule has combined all the above properties, and it can be considered as a generic rapid application development tool in the form of a module which ca be used in a development as a separated section. 1. Platform independence 2. use of module as RAP tool 3. User-friendly customization 4. Leading to good design and good interface Can be considered as advantages of using the project If a developer wants to a printing section in his application he has to deal with developing interface, forming of graphics object which is fed to the printer and etc.. Although he has a frame work for printing section development, At least the graphics object is to be formed to obtained print out in required format. GPModule avoids wasting time for developing the print section. Developer does not need rebuild the code of section related to printing. Even at least for forming of graphics.

LXIII This project started off with a simple idea with more specific target; developing a proper design for the project was the most difficult task of all. Even though with more precise specification and having no prior experience or knowledge about this domain, made this project both, challenging. Details for the simple specification had to be gathered by examine using existing modules. It was time consuming and the method of connecting to a main application to be decided. Consideration about a good design from the start of the project, served me well in completing the project successfully. A great deal of effort was put into searching for a component which parses html giving graphics object. But it was in vain and I had to develop a object my own. I developed it with the least functionality that fulfilled the minimum requirements for the task. Finding such component will eventually improve the performance and the accuracy of the module. I kept that problem for future works by satisfying with my own component.

LXIV

5. CHAPTER - FUTURE WORKS

Since java is used as the development technology the issues related to speed is be more considerable factor. So some sections of the existing module should be reconsidered. Parsing component should be more efficient. So in future evolution of the module should use a java inbuilt component for html tag parsing so that to obtain required level of accuracy and efficiency. As more extended version of the module may used XHTML as the formatting language with a parsing java inbuilt component.

LXV The GPModule is to be added to another module as a separated section so the interface of the module should be uniform with main application. Therefore it is essential the precise customization of the interface. So the mechanism should be more comprehensive. So precise interface customization section may be introduced to the module in future. Current module suffers the lack of functionality level which should be there, related to customization of headers and footers. Overall customization level improvement can be expected in coming vision. Another essential section that should be in the module is helping sub module. I leaved at as a future work satisfying only with including the tool tips. Since this module is for java developers it is better to be developed this kind of rapid application development tools for other technological backgrounds as well.

LXVI

6. CHAPTER - REFERENCES
XML. Available from: http:// www.w3schools.com/.

Java TM (1995-2001): [online]. Available from: http://java.sun.com/.

LXVII Rational rose Home (2003): [online]. Available from: http://www.rational.com/rose

You might also like