SampleSimpleEditorDialogThe
One of the host application's functions is to request the MathML of the equation in the Style Editor. This functionality is already provided by the Simple Editor class; therefore, creating a method to access it is straightforward. public String getMathML(){
Similarly, the host application needs a way to send MathML to the Simple Editor. Again, this functionality is already provided by the Simple Editor class. Note that you will need to reset the undo stack since it is a new equation. public void setMathML(String mathml) {
The host application needs a way to retrieve an image of the MathML equation in the Simple Editor. This functionality is already provided by the class. In this case, only the point size and background color of the equation are passed in, but there are other parameters that can be used to control the look of an equation. public Image getEquationImage(int pointsize, String bgcolor) {
It is also possible to customize the about box to add additional information. See the code for the customized about box in SampleSimpleEditorAboutBox.java. protected void showAboutBox() {
Finally, when the Simple Editor is closed, it calls back to the host application to tell it to update the MathML Source and Preview Image parts of its screen. protected void closeEditorWindow() {
| ||||||||
Copyright © 1996-2016 Design Science, Inc. All rights reserved. |