TECHNICAL DOCUMENTATION

Similar documents
/** Creates new form NewJFrame */ public NewJFrame() { initcomponents(); initblogsearch(); //initializes Index List box }

UNICENTA OPOS THE FEATURES, FAILURES AND COMMUNITY. Sponsored by

EDITING IMAGES/ICONS IN OPENBRAVO POS SOURCE CODE

Hanley s Survival Guide for Visual Applications with NetBeans 2.0 Last Updated: 5/20/2015 TABLE OF CONTENTS

jlabel14 = new javax.swing.jlabel(); jlabel15 = new javax.swing.jlabel(); jlabel16 = new javax.swing.jlabel(); jlabel17 = new javax.swing.

Java Programming Summer 2008 LAB. Thursday 8/21/2008

* To change this license header, choose License Headers in Project Properties.

グラフを表すデータ構造 JAVA での実装

Prototyping a Swing Interface with the Netbeans IDE GUI Editor

* To change this license header, choose License Headers in Project Properties.

I.1 Introduction Matisse GUI designer I.2 GroupLayout Basics Sequential and Parallel Arrangements sequential horizontal orientation

Answer on question #61311, Programming & Computer Science / Java

Assignment 1. Application Development

INSTITUTO POLITÉCNICO NACIONAL ESCUELA SUPERIOR DE CÓMPUTO

Role-Coll Role Based Collaboration Software

Mend for Eclipse quick start guide local analysis

2IS45 Programming

Java, Swing, and Eclipse: The Calculator Lab.

Name: Checked: Learn about listeners, events, and simple animation for interactive graphical user interfaces.

Graphical User Interface

Exercice G09 (v3) File: Shape.java Project: G09-MiniDraw_v3 1GGE

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Lab 4. D0010E Object-Oriented Programming and Design. Today s lecture. GUI programming in

This exam is closed textbook(s) and closed notes. Use of any electronic device (e.g., for computing and/or communicating) is NOT permitted.

Chapter 2. Network Chat

Exercice G02 (v2) File: MovingBall.java Project: G02-Smileys_v2 1GGE

DAFTAR LAMPIRAN. Source Code Java Aplikasi Keyword to Image Renamer Split

SampleApp.java. Page 1

GUI (Graphic User Interface) Programming. Part 2 (Chapter 8) Chapter Goals. Events, Event Sources, and Event Listeners. Listeners

Part I: Learn Common Graphics Components

Contents. Anaplan Connector for MuleSoft

Developing Web Views for VMware vcenter Orchestrator

CHAPTER 8 INFERENCE. The concept of Inference would be explained in the following chapter, as the CTBN

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Topic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more

Topic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun!

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Switch Web Event Handler

The JFrame Class Frame Windows GRAPHICAL USER INTERFACES. Five steps to displaying a frame: 1) Construct an object of the JFrame class

DEMYSTIFYING PROGRAMMING: CHAPTER SIX METHODS (TOC DETAILED) CHAPTER SIX: METHODS 1

Developing Web Views for VMware vcenter Orchestrator. vrealize Orchestrator 5.5

MarkLogic Server. Information Studio Developer s Guide. MarkLogic 8 February, Copyright 2015 MarkLogic Corporation. All rights reserved.

Building a GUI in Java with Swing. CITS1001 extension notes Rachel Cardell-Oliver

Systems Programming. Bachelor in Telecommunication Technology Engineering Bachelor in Communication System Engineering Carlos III University of Madrid

Africa s Gift To The World! Wanda POS ADMINISTRATOR S GUIDE. Fonyuy T. Isidore 1.0. Land of Promise. IT Kamer Company Ltd.

CS 134 Programming Exercise 7:

Moving From Studio to Atelier. Wouter Dupré Sales Engineer

for Q-CHECKER Text version 15-Feb-16 4:49 PM

Goals. Lecture 7 More GUI programming. The application. The application D&D 12. CompSci 230: Semester JFrame subclass: ListOWords

17 GUI API: Container 18 Hello world with a GUI 19 GUI API: JLabel 20 GUI API: Container: add() 21 Hello world with a GUI 22 GUI API: JFrame: setdefau

We have several alternatives now, which we need to address. Here is a list of them: 1. How to get HTML interpreted correctly.

Text version 15-Aug-12. for Q-CHECKER V4, V5 and V6

Embedding Graphics in JavaDocs (netbeans IDE)

Command-Line Applications. GUI Libraries GUI-related classes are defined primarily in the java.awt and the javax.swing packages.

PIC 20A GUI with swing

1.0. Wanda POS USER S GUIDE. Africa s Gift To The World. Fonyuy T. Isidore IT Kamer company Ltd. 1.0

COMP16121 Sample Code Lecture 1

CSC 161 SPRING 17 LAB 2-1 BORDERLAYOUT, GRIDLAYOUT, AND EVENT HANDLING

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Escenic Content Studio Plug-in Guide

Graphical User Interface (GUI)

Red Hat Application Migration Toolkit 4.2

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

To gain experience using GUI components and listeners.

Module Road Map. 7. Version Control with Subversion Introduction Terminology

CPS122 Lecture: Graphical User Interfaces and Event-Driven Programming

Java WebStart, Applets & RMI

Chapter 14. More Swing

SELENIUM TRAINING COURSE CONTENT

Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 13, 2012 Managed by UT-Battelle for the Department of Energy

Java IDE Programming-I

Global Gomoku Lab 4 in D0010E

Outline. Topic 9: Swing. GUIs Up to now: line-by-line programs: computer displays text user types text AWT. A. Basics

Java Swing. based on slides by: Walter Milner. Java Swing Walter Milner 2005: Slide 1

Getting Started with Java Development and Testing: Netbeans IDE, Ant & JUnit

Release Notes ClearSQL (build 181)

PL/SQL Developer and TOAD IDE Integration Configuration

Week Chapter Assignment SD Technology Standards. 1,2, Review Knowledge Check JP3.1. Program 5.1. Program 5.1. Program 5.2. Program 5.2. Program 5.

BPS79- Sample Reports View

Visual Editor New Class Wizard

IBM Rational Rhapsody Gateway Add On. Rhapsody Coupling Notes

Izpack installer guide

Javadocing in Netbeans (rev )

REPAST SIMPHONY SYSTEM DYNAMICS GETTING STARTED

Using LCS Help. In This Section

JAVA CODE JAVA CODE: BINOMIAL TREES OPTION PRICING BINOMIALTREE CLASS PAGE 1

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Swing from A to Z Some Simple Components. Preface

More about GUIs GEEN163

KF5008 Program Design & Development. Lecture 1 Usability GUI Design and Implementation

CS 251 Intermediate Programming GUIs: Components and Layout

Java.net - the Source for Java(tm) Technology Collaboration

Lecture 9. Lecture

The class definition is not a program by itself. It can be used by other programs in order to create objects and use them.

Flint - Eclipse Based IDE User Manual

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

CS 201 Advanced Object-Oriented Programming Lab 5 - Sudoku, Part 1 Due: March 3/4, 11:30 PM

Example: Building a Java GUI

PACS Scan Mobile. User Help. Version: Written by: Product Knowledge, R&D Date: September 2016 LX-DOC-PSM2.0.1-UH-EN-REVB

Transcription:

TECHNICAL DOCUMENTATION UNDERSTANDING THE JAVA/XML CODE BINDING IN OPENBRAVO POS AND LITTLE EDITING SPONSORED BY: IT-KAMER COMPANY LTD CEO: Dr.-Ing. Stanley Mungwe SONDI Mikael Steve jobs project Cameroon August 31, 2014

STEVE JOBS PROJECT CAMEROON http://wiki.idempiere.org/wiki/steve_jobs_project OPENBRAVO POS UNDERSTANDING THE JAVA/XML CODE BINDING IN OPENBRAVO POS AND LITTLE EDITING SONDI MIKAEL RAPHAEL wiki.idempiere.org/user:ralph August 2014 PAGE 1

PAGE 2

Introduction: Open Bravo pos is an open-source point of sale application.it can be used in various business types and sizes, to enhance the productivity of the firm/company.i hope you have read my wiki page and noticed that it is under idempiere.open bravo is supposed to work in conjunction with idempiere.this was made possible thatnks to Red1 who wrote a plugin to manage that upload/download to/from the web server (apache activemq).here, we are not goin to look at all of that, we are going to look at the POS individually.this documentation describes how the java code binds with xml to display forms, and properties.and a demo will be show by editing the xml code and explaining what is displayed when the application runs. Utilities for this documentation: eclipse ide ubuntu 12.04 LTS openbravo pos source code text editor screen shots libre office writer PAGE 3

Code Structure: Below is a snapshot of the code directories in eclipse: All directories prefixed by src are our focus in this document because they are the directories that contain the source code for openbravo pos.the main function of the application is located in the package com.openbravo.pos.forms in the directory srcpos.the main function is located in the file: StartPOS.java and is the starting point of our application. Thanks to the programmers of Openbravo pos because the file names are highly indicative of their content.below StartPOS are a set of files with the.form extension.these files are coded in xml, indicated by the tags <?xml version="1.0" encoding="utf-8"?> they each contain.this is shown below: PAGE 4

As the file name (JDlgChangePassword.form) suggests, this is the form that binds to the java code that is displayed when any user of the Openbravo pos wants to modify his/her password.i mean this: PAGE 5

It is observed that the Java code that binds to this form bears the same name, but what differs is the extention (.java and.form).but let's start by having a brief run through of the.form file. Let s Go! Lets have a run through of the form. It has the following tags: TAG Xml Form properties Property ResourceString Description Opening tag for xml files like <html></html> for html files,version and doctype Indicates that the document is an xml form that can be bound to java files Indicates the properties of the element chosen Has attributes that enable the choice of the element for the prperty to be applied on Specifies where the string resource can be found to be applied on the element chosen by the property tag PAGE 6

SyntheticProperties SyntheticProperty AuxValues AuxValue Layout SubComponents Container Constraints Constraint BorderConstraints Component Image Events EventHandler Border EmptyBorder AbsoluteConstraints Specifies the GUI properties Sub tag for the SyntheticProperties tag Specifies the secondary settings to be applied on the form Sub tag for the AuxValues Form layout Components to be embedded in the form Can be a Jpanel Restrictions to be applied on the container under which the tag appears Sub tag for Constraints Constraints for the border of the Conatiner Component on which to apply the properties Image inclusion for tag under which it appears Events that are handled in the java code Specifies what action on which the eventhandler should be triggered Border for the element ub=nder which it appears Specifies the dimensions for which the panel/button should be empty What more? Absolute constraints for the element under which the tag appears Now that we have an explanation on the xml form, let us have a look at the java file. /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN- BEGIN:initComponents private void initcomponents() { jpanel2 = new javax.swing.jpanel(); jcmdok = new javax.swing.jbutton(); jcmdcancel = new javax.swing.jbutton(); jpanel1 = new javax.swing.jpanel(); jlabel1 = new javax.swing.jlabel(); jtxtpasswordold = new javax.swing.jpasswordfield(); jlabel2 = new javax.swing.jlabel(); jtxtpasswordnew = new javax.swing.jpasswordfield(); jtxtpasswordrepeat = new javax.swing.jpasswordfield(); PAGE 7

jlabel3 = new javax.swing.jlabel(); setdefaultcloseoperation(javax.swing.windowconstants.dispose_on_close); settitle(applocal.getintstring("title.changepassword")); setresizable(false); jpanel2.setlayout(new java.awt.flowlayout(java.awt.flowlayout.right)); jcmdok.seticon(new javax.swing.imageicon(getclass().getresource("/com/openbravo/images/button_ok.png" ))); jcmdok.settext(applocal.getintstring("button.ok")); jcmdok.addactionlistener(new java.awt.event.actionlistener() { public void actionperformed(java.awt.event.actionevent evt) { jcmdokactionperformed(evt); } }); // jpanel2.add(jcmdok); jcmdcancel.seticon(new javax.swing.imageicon(getclass().getresource("/com/openbravo/images/button_cancel.p ng"))); jcmdcancel.settext(applocal.getintstring("button.cancel")); jcmdcancel.addactionlistener(new java.awt.event.actionlistener() { public void actionperformed(java.awt.event.actionevent evt) { jcmdcancelactionperformed(evt); } }); jpanel2.add(jcmdcancel); getcontentpane().add(jpanel2, java.awt.borderlayout.south); jpanel1.setlayout(null); jpanel1.setborder(new javax.swing.border.emptyborder(new java.awt.insets(5, 5, 5, 5))); jlabel1.settext(applocal.getintstring("label.passwordold")); jpanel1.add(jlabel1); jlabel1.setbounds(20, 20, 120, 14); jpanel1.add(jtxtpasswordold); jtxtpasswordold.setbounds(140, 20, 180, 20); jlabel2.settext(applocal.getintstring("label.passwordnew")); PAGE 8

jpanel1.add(jlabel2); jlabel2.setbounds(20, 50, 120, 14); jpanel1.add(jtxtpasswordnew); jtxtpasswordnew.setbounds(140, 50, 180, 20); jpanel1.add(jtxtpasswordrepeat); jtxtpasswordrepeat.setbounds(140, 80, 180, 20); jlabel3.settext(applocal.getintstring("label.passwordrepeat")); jpanel1.add(jlabel3); jlabel3.setbounds(20, 80, 120, 14); } // </editor-fold>//gen-end:initcomponents private void jcmdcancelactionperformed(java.awt.event.actionevent evt) {//GEN- FIRST:event_jcmdCancelActionPerformed dispose(); }//GEN-LAST:event_jcmdCancelActionPerformed private void jcmdokactionperformed(java.awt.event.actionevent evt) {//GEN- FIRST:event_jcmdOKActionPerformed }//GEN-LAST:event_jcmdOKActionPerformed } // Variables declaration - do not modify//gen-begin:variables private javax.swing.jlabel jlabel1; private javax.swing.jlabel jlabel2; private javax.swing.jlabel jlabel3; private javax.swing.jpanel jpanel1; private javax.swing.jpanel jpanel2; private javax.swing.jbutton jcmdcancel; private javax.swing.jbutton jcmdok; private javax.swing.jpasswordfield jtxtpasswordnew; private javax.swing.jpasswordfield jtxtpasswordold; private javax.swing.jpasswordfield jtxtpasswordrepeat; // End of variables declaration//gen-end:variables The function initcomponents() has no return type and initializes all components of the PAGE 9

dialog window.this is our point of interest because, as the first comment indicates, this can only be modified via the forms editor, and nothing else.any modification made to the java file is overwritten at run time because it is initialized though calls by the constructor. The above piece of code is used to initialize the components and variables, configure what is displayed on them,set events handling,set the titles of the panels,set the sizes and borders and add components to panels. For a better understanding, let us have a close look at one component, jcmdcancel It has this settings in the java code: jcmdcancel = new javax.swing.jbutton(); private javax.swing.jbutton jcmdcancel; private void jcmdcancelactionperformed(java.awt.event.actionevent evt) { jcmdcancel.seticon(new javax.swing.imageicon(getclass().getresource("/com/openbravo/images/button_cancel.p ng"))); jcmdcancel.settext(applocal.getintstring("button.cancel")); jcmdcancel.addactionlistener(new java.awt.event.actionlistener() { public void actionperformed(java.awt.event.actionevent evt) { jcmdcancelactionperformed(evt); And these are its configurations in the xml form: <Component class="javax.swing.jbutton" name="jcmdcancel"> <Properties> <Property name="icon" type="javax.swing.icon" editor="org.netbeans.modules.form.editors2.iconeditor"> <Image icontype="3" name="/com/openbravo/images/button_cancel.png"/> </Property> <Property name="text" type="java.lang.string" editor="org.netbeans.modules.i18n.form.formi18nstringeditor"> <ResourceString bundle="pos_messages.properties" key="button.cancel" replaceformat="applocal.getintstring("{key}")"/> </Property> </Properties> <Events> <EventHandler event="actionperformed" listener="java.awt.event.actionlistener" parameters="java.awt.event.actionevent" handler="jcmdcancelactionperformed"/> </Events> </Component> PAGE 10

The form specifies the following: Jbutton with name jcmdcancel that will have 2 properties, an icon of type 3 located in /com/openbravo/images/ and a text of type string, with the string of key Button.Cancel found in the property file pos_messages.properties.the jbutton also has an event and a listener of type actionperformed. So, if we want to edit the text that is displayed on the button, we can navigate to the pos_messages.properties file and edit the key Button.Cancel and enter the desired text.this entered text is what will appear on the button. Watch the screenshots: I will edit both buttons here, so that the Cancel button text is now No and the Ok button will be Yes. Here is the.properties file that contains the text displayed on the buttons: Now we can change what we need changed as below: PAGE 11

When the app restarts, we see our modifications; This can be used to personalise the POS, to make an apparently new gui from the old. Hope you enjoyed. Send comments at mikaelsondi@gmail.com. PAGE 12