How to show math equations in a GUI

S

stacey

Hello everyone!

I am making a help program, similar to those used from excel. So there
is main menu on the left panel..and depending on what you click,
different text is shown on the right panel.
I have to show some mathematical equations, like x^2 = (xi- xj) /
(S(x))^1/2 .. something like that.
but this way is not easy readable.. I want to make it like the
equation editor or mathtype in word.
A proper math type!

Any idea on how to do this???
Is there a ways i can format an equation? Otherwise, how can i insert
a picture? cause i am a bit confused on how this help menu works. (i
have done it using a jSplitPanel that has 2 jScrollPanels).

Thank you very much,

Regards,

Stacey
 
O

Oliver Wong

stacey said:
Hello everyone!

I am making a help program, similar to those used from excel. So there
is main menu on the left panel..and depending on what you click,
different text is shown on the right panel.
I have to show some mathematical equations, like x^2 = (xi- xj) /
(S(x))^1/2 .. something like that.
but this way is not easy readable.. I want to make it like the
equation editor or mathtype in word.
A proper math type!

Any idea on how to do this???
Is there a ways i can format an equation? Otherwise, how can i insert
a picture? cause i am a bit confused on how this help menu works. (i
have done it using a jSplitPanel that has 2 jScrollPanels).

By "help program", do you mean a program which displays mainly fixed,
static content in an attempt to teach the user something (e.g. some
mathematical principles)? If so, you may find it much easier to make the
bulk of your "program" in HTML, and use a couple of cleverly placed Java
applets for any interactive parts (quizzes? virtual experiments? interactive
diagrams? etc.)

While you can do what you want in pure Java, it won't be easy.

- Oliver
 
S

stacey

By "help program", do you mean a program which displays mainly fixed,
static content in an attempt to teach the user something (e.g. some
mathematical principles)? If so, you may find it much easier to make the
bulk of your "program" in HTML, and use a couple of cleverly placed Java
applets for any interactive parts (quizzes? virtual experiments? interactive
diagrams? etc.)

While you can do what you want in pure Java, it won't be easy.

- Oliver

Well, i have made a tool in Java, and i want to make another help
application for it, to explain each step, and yes some mathematical
principles, but only mathematical equations.

It wont be easy huh? Cause i don't want to spend a looot of time. The
main program is of more importance!
Can you give me a guideline as to where i should turn to in order to
make it work as i said?

Thank you very much for your quick answer.

Stacey,
 
S

Stefan Schmiedl

Well, i have made a tool in Java, and i want to make another help
application for it, to explain each step, and yes some mathematical
principles, but only mathematical equations.

The question is more like: Do you know the formulas before you deploy
the application or do you need to generate the displays "on the fly"
during run time?
It wont be easy huh? Cause i don't want to spend a looot of time. The
main program is of more importance!
Can you give me a guideline as to where i should turn to in order to
make it work as i said?

Depends on what you can install on the computer running your program.

One possible solution for a-priori-generation of formulas is to use
LaTeX or Lout for the typesetting part and just use the images.

Or you try to find a renderer for MathML.

OpenOffice.org has a formula editor (and renderer) buried somewhere
in the huge bulk that it is. Since it is open source, you might be
able to get some inspiration from there, too.

s.
 
S

stacey

The question is more like: Do you know the formulas before you deploy
the application or do you need to generate the displays "on the fly"
during run time?

No, i know the formulas. There are several standard that i will use.
The problem is how i ll represent them.
Depends on what you can install on the computer running your program.

One possible solution for a-priori-generation of formulas is to use
LaTeX or Lout for the typesetting part and just use the images.

Or you try to find a renderer for MathML.

OpenOffice.org has a formula editor (and renderer) buried somewhere
in the huge bulk that it is. Since it is open source, you might be
able to get some inspiration from there, too.

s.
I cannot install anything while running the problem. i wouldn't
suggest it, and i don't think they will let me.
So i ll try to find a renderer for MathML and if that fails i ll look
into the openoffice editor.

Thank you very much for your help Stefan, and you Andrew and Daniel
and for your quick answer!
If i encounter any problems, i will ask again :)

best regards,
Stacey Venturas.
 
R

Rogan Dawes

stacey said:
Hello everyone!

I am making a help program, similar to those used from excel. So there
is main menu on the left panel..and depending on what you click,
different text is shown on the right panel.
I have to show some mathematical equations, like x^2 = (xi- xj) /
(S(x))^1/2 .. something like that.
but this way is not easy readable.. I want to make it like the
equation editor or mathtype in word.
A proper math type!

Any idea on how to do this???
Is there a ways i can format an equation? Otherwise, how can i insert
a picture? cause i am a bit confused on how this help menu works. (i
have done it using a jSplitPanel that has 2 jScrollPanels).

Thank you very much,

Regards,

Stacey

Take a look at JavaHelp (maybe a bit heavy duty, but that's your call)

You can include images in the HTML that you present to your users.

Rogan
 
R

robert maas, see http://tinyurl.com/uh3t

(I trimmed off half your four newsgroups.)
From: "stacey" <[email protected]>
I have to show some mathematical equations, like
x^2 = (xi- xj) / (S(x))^1/2 ..
something like that. but this way is not easy readable.. I want
to make it like the equation editor or mathtype in word.

So you want it to display something like this?
2 (xi - xj)
x = --------------
1/2
(S(x)) ..

First you must have the internal representation of the mathematical
formulas in nested-list format, such as:
(= (expt x 2) (/ (- xi xj) (+ (expt (S x) 1/2) ..)))

Next you build panes bottom-up, first to contain atomic symbols
such as S and 1/2 and xi (or was that supposed to be
x-subscript-i??), then each layer combining lower layers together
into composite panes, with their parts arranged per some layout
manager. When you reach the top, you have the entire formula nicely
displayed in a master pane, which you can then display somewhere in
your window.

That's letting java do most of the work of managing layout.

If that's too slow (repainting such a complicated tree of panes
every time something moves or resizes), and you really do want to
spend the effort to lay out the entire equation in a single image
instead of nested panes, what you do is build virtual bitmap images
bottom-up, computing the size of each leaf (actual bitmap image),
computing the x,y offset of each small image within the next larger
*virtual* image, until you have a tree of such mostly-virtual
images. Then you build a bitmap pane big enough to whole the entire
toplevel virtual image, then traverse your tree copying each leaf
image through the various x,y offsets up to the top to paint it
into the one big collage-image.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top