next_inactive up previous

Graphical calculator for MIDP enabled devices(jxCalc)

Nagy Zoltan



Today, almost every people owns a handheld cellphone, and nearly all of them is capable to run programs written for the j2me platform, this project's main objective is to provide an application for all of these devices. With the following expectations:

Using the calculator

to get started when someone starts the calculator, is as easy as taking in hand a usual calculator - with one exception, the device's keyboard is remapped in some cases, but the program is capable of displaying a picture which should be identical to the device keyboard, and displays the key mappings on the screen.
I've introduced two mode buttons to extended the availibe variations:

the only thing which is not obvoius: the menu is accessible thru: ALPHA+[SELECT]

note: i've moved the backspace to the top-left button on the phone, because it's never was logical to put anywhere else(in my point of view ;) - but it can be moved anywhere as any other functionality, because the keyboard mapping are defined in a configuration file, which can be altered

Program design

because the program is built up from 95 classes not counting the parser's classes, i would like to give an overview of the whole system.
the program's main components are:



a tree based menu-system can be build from the integer/enum options.


The console renders the lines from the actual editor to the screen, and provides a way to scroll the lines, and shows the actual mode setting at the bottom.


My first implementation was to introduce breakable lines and some tricky classes to split the lines where they should. But i found this concept to be very fragile, because it's very hard to extend a system which is specialized by default - and when i wanted some more intresting features, i've decided to move forward to something else, and i've came up with a marker based design - which is a lot more precise, and dynamicly extendable, which i've find the right way to go.
I've groupped the markers into 4 different classes, based on there nature:

With these concept's the rendering of editor's content is simplifyed to marker-to-marker content part renders, and some interpretations of the markers.

I think that this concept is capable of drawing structured formulas as well, and support to render the entered formula into something like latex can do - and maybe it can be made editable as well.


The parser can read an entered formula and build up it's AST tree, then it's possible to execute directly the tree.
All the function are built into directly to the parser(for now) because i've wanted to usable as soon as possible.


The FunctionMapper can read a keyboard configuration file, which describes where should be which functionality - because the parser 'reads' the lines - the functions are not special entites like in normal calculators
this is a part of the file:
        M_R    =    MOVE_RIGHT
        M_S    =    EXECUTE
    @   M_S    =    MENU
    !   M_S    =    RETURN

    !   1      =    sin(
    !@  1      =    asin(
    !   2      =    cos(
the lines are build up from 3 parts

Media/device meta data

the program supports devices in a way that anyone can add make the application run on a new device, by creating a picture of it's screen, and giving some hints about the device's button coordinates
this is a part from the motorola-razr-v3 handset's configuration

#	jxcalc
#	keyboard mapping for the v3 handset

F_L	=	13,8
F_C	=	35,10
F_R	=	57,8
F_X	=	10,41

$F_L$ gives the coordinates of the center of the top-left (Function-Left) button


currently just function plotting is supported (given in $y=f(x)$ style in the editor)
with this formula, the plotter initializes the parser, and resets the sequencer, and launches a thread to calculate all the values to display the (partial) result.
because the formula interpret is running on a double virtual machine, and these devices doesn't have much horsepower, incremental/tactial plotting can save time for the user, because of this observation i've detached the sequencer and the metric function from the plotter, so it's only provides a frame to these constructs to iteract with eachother.


the implementation of the markers have been not yet finished, and that's way i can't move forward to implement 'nicer' things.


the source can be downloaded from it's svn repository

the project has a page on

the program's trac page can be found at:

About this document ...

Graphical calculator for MIDP enabled devices(jxCalc)

This document was generated using the LaTeX2HTML translator Version 2002-2-1 (1.71)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were:
latex2html -split 0 jxcalc.tex

The translation was initiated by on 2008-04-12

next_inactive up previous