SampleStructureEditorDialogThe
One of the host application's functions is to request the MathML of the equation in the Structure Editor. This functionality is already provided by the Structure Editor class. public String getMathML(){
Similarly, the host application needs a way to send MathML to the Structure Editor. Again, this functionality is already provided by the Structure Editor class. Note that you need to reset the undo stack since this is a new equation. public void setMathML(String mathml) {
The host application needs to retrieve an image of the Structure equation in the Structure 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 SampleStructureEditorAboutBox.java. protected void showAboutBox() {
Finally, when the Structure 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. |