Package com.wolfram.jlink.ui
Class MathSessionPane
- java.lang.Object
- 
- java.awt.Component
- 
- java.awt.Container
- 
- javax.swing.JComponent
- 
- javax.swing.JScrollPane
- 
- com.wolfram.jlink.ui.MathSessionPane
 
 
 
 
 
- 
- All Implemented Interfaces:
- java.awt.image.ImageObserver,- java.awt.MenuContainer,- java.io.Serializable,- javax.accessibility.Accessible,- javax.swing.ScrollPaneConstants
 
 public class MathSessionPane extends javax.swing.JScrollPaneMathSessionPane is a visual component that provides a scrolling In/Out session interface to the Mathematica kernel. Much more sophisticated than the kernel's own "terminal" interface, it provides features such as full text editing of input including copy/paste and unlimited undo/redo, support for graphics, control of fonts and styles, customizable syntax coloring, and bracket matching.To use a MathSessionPane, either supply an existing KernelLink using the setLink() method, or provide a command line to create a link via the setLinkArguments() or setLinkArgumentsArray() methods. You must always arrange for the connect() method to be called, which will launch the kernel (if you supplied an appropriate command line) and cause the first In[] prompt to appear. The following key commands are supported: Ctrl-X Cut Ctrl-C Copy Ctrl-V Paste Ctrl-Z Undo Ctrl-Y Redo Ctrl-L Copy Input From Above Ctrl-B Balance Brackets Alt-. Abort Computation Alt-, Interrupt Computation (brings up dialog) (These all use the Command key on the Macintosh) Here is a simple program that uses MathSessionPane:public static void main(String[] argv) { final MathSessionPane msp = new MathSessionPane(); // Create the frame window to hold the pane. Frame frm = new Frame(); frm.setSize(500, 500); frm.add(msp); frm.setVisible(true); frm.doLayout(); frm.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { KernelLink ml = msp.getLink(); // If we're quitting while the kernel is busy, it might not die when the link // is closed. So we force the issue by calling terminateKernel(); if (ml != null) ml.terminateKernel(); System.exit(0); } }); // Modify this for your setup. msp.setLinkArgumentsArray(new String[] {"-linkmode", "launch", "-linkname", "\"d:/math41/mathkernel\" -mathlink"}); try { msp.connect(); } catch (MathLinkException e) { e.printStackTrace(); } }To see a more complete application built around a MathSessionPane, look at the SimpleFrontEnd example application in JLink/Examples/Part2/SimpleFrontEnd.- Since:
- 2.0
- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class javax.swing.JScrollPanejavax.swing.JScrollPane.AccessibleJScrollPane, javax.swing.JScrollPane.ScrollBar
 - 
Nested classes/interfaces inherited from class javax.swing.JComponentjavax.swing.JComponent.AccessibleJComponent
 
- 
 - 
Field Summary- 
Fields inherited from class javax.swing.JScrollPanecolumnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport
 - 
Fields inherited from class javax.swing.JComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 - 
Fields inherited from class java.awt.ComponentaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 - 
Fields inherited from interface java.awt.image.ImageObserverABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 - 
Fields inherited from interface javax.swing.ScrollPaneConstantsCOLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT
 
- 
 - 
Constructor SummaryConstructors Constructor Description MathSessionPane()Creates a new MathSessionPane with vertical and horizontal scrollbars.MathSessionPane(int vsbPolicy, int hsbPolicy)Creates a new MathSessionPane with the specified policies for vertical and horizontal scrollbars.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColoredSymbols(java.lang.String[] syms, java.awt.Color c)Lets you customize syntax coloring by specifying an array of symbol names and the color you want them drawn in when they appear in input.voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)Adds a PropertyChangeListener that will be notified of changes in the computationActive property.voidbalanceBrackets()Grows the current selection to highlight the nearest matching set of delimiters.booleancanRedo()Indicates whether a redo operation is currently possible.booleancanUndo()Indicates whether an undo operation is currently possible.voidclearColoredSymbols()Wipes out all syntax coloring customizations specified by addColoredSymbols().voidcloseLink()Closes the link to Mathematica.voidconnect()Connects the link to Mathematica and prepares the pane for use.voidcopyInputFromAbove()Copies the previous input to the current cursor location.voidevaluateInput()Evaluates the current input.java.awt.ColorgetBackgroundColor()Returns the background color of the text region.java.awt.ColorgetCommentColor()Returns the color that will be used for comments in input if syntax coloring is on.intgetConnectTimeout()Returns the number of milliseconds that the connect() method will wait to connect the link to Mathematica.intgetLeftIndent()Returns the amount that input and output will be indented from the left edge.KernelLinkgetLink()Returns the link currently being used to communicate with Mathematica.java.lang.StringgetLinkArguments()Returns the string specified to create the link to Mathematica.java.lang.String[]getLinkArgumentsArray()Returns the string array specified to create the link to Mathematica.java.awt.ColorgetMessageColor()Returns the color used for Mathematica message output.java.awt.ColorgetPromptColor()Returns the color used for In[] and Out[] prompts.java.awt.ColorgetStringColor()Returns the color that will be used for literal strings in input if syntax coloring is on.java.awt.ColorgetSystemSymbolColor()Returns the color that will be used in input for symbols in the Mathematica System` context if syntax coloring is on.java.lang.StringgetText()Gives the current contents of the pane as a string.java.awt.ColorgetTextColor()Gives the color for input and output textjavax.swing.JTextPanegetTextPane()Gives the JTextPane component that is hosted within this MathSessionPane.intgetTextSize()Gives the font size currently in use.booleanisComputationActive()Indicates whether a computation is currently in progress.booleanisFitGraphics()Indicates whether graphics are set to be scaled to fit into the current visible width.booleanisFrontEndGraphics()Indicates whether the Mathematica front end will be used to assist in rendering graphics.booleanisInputBoldface()Indicates whether input is in a boldface font.booleanisShowTiming()Indicates whether evaluation timings will be shown in a timing panel at the lower left corner of the pane.booleanisSyntaxColoring()Indicates whether syntax coloring is currently enabled.voidredo()Redoes the last undone edit.voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Removes a PropertyChangeListener.voidsetBackgroundColor(java.awt.Color c)Sets the background color of the text region.voidsetCommentColor(java.awt.Color c)Sets the color that will be used for comments in input if syntax coloring is on.voidsetConnectTimeout(int timeoutMillis)Sets the number of milliseconds that the connect() method will wait to connect the link to Mathematica.voidsetFitGraphics(boolean fit)Sets whether to scale graphics so as to fit into the current visible width.voidsetFrontEndGraphics(boolean b)Sets whether to use the Mathematica front end in the background to assist in rendering graphics.voidsetInputBoldface(boolean bold)Sets whether to use boldface for Mathematica input.voidsetLeftIndent(int indent)Sets the amount that input and output will be indented from the left edge.voidsetLink(KernelLink ml)Sets the link to use for communicating with Mathematica.voidsetLinkArguments(java.lang.String linkArgs)Sets the command line to use to open a link to Mathematica.voidsetLinkArgumentsArray(java.lang.String[] linkArgs)Sets the arguments to use to open a link to Mathematica.voidsetMessageColor(java.awt.Color c)Sets the color used for Mathematica message output.voidsetPromptColor(java.awt.Color c)Sets the color used for In[] and Out[] prompts.voidsetShowTiming(boolean show)Specifies whether to display the wall-clock timing for each input in a timing panel at the lower left corner of the pane.voidsetStringColor(java.awt.Color c)Sets the color that will be used for literal strings in input if syntax coloring is on.voidsetSyntaxColoring(boolean b)Enables or disables syntax coloring of input.voidsetSystemSymbolColor(java.awt.Color c)Sets the color that will be used in input for symbols in the Mathematica System` context if syntax coloring is on.voidsetTextColor(java.awt.Color c)Sets the color for input and output text.voidsetTextSize(int size)Sets the font size for input and output text.voidundo()Undoes the last edit.- 
Methods inherited from class javax.swing.JScrollPanecreateHorizontalScrollBar, createVerticalScrollBar, createViewport, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, updateUI
 - 
Methods inherited from class javax.swing.JComponentaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 - 
Methods inherited from class java.awt.Containeradd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
 - 
Methods inherited from class java.awt.Componentaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
- 
 
- 
- 
- 
Constructor Detail- 
MathSessionPanepublic MathSessionPane() Creates a new MathSessionPane with vertical and horizontal scrollbars.
 - 
MathSessionPanepublic MathSessionPane(int vsbPolicy, int hsbPolicy)Creates a new MathSessionPane with the specified policies for vertical and horizontal scrollbars.- Parameters:
- vsbPolicy- vertical scrollbar policy (see the Swing JScrollPane class)
- hsbPolicy- horizontal scrollbar policy (see the Swing JScrollPane class)
 
 
- 
 - 
Method Detail- 
setLinkpublic void setLink(KernelLink ml) Sets the link to use for communicating with Mathematica. Use this method if you already have a link you want to use, or you want to open the link manually. Most programmers will use setLinkArguments() or setLinkArgumentsArray instead and let this class open the link itself. Even if you open the link yourself and call setLink(), you must still call the connect() method of this class to prepare the pane to be used.- Parameters:
- ml-
- See Also:
- setLinkArguments(String),- setLinkArgumentsArray(String[]),- connect()
 
 - 
getLinkpublic KernelLink getLink() Returns the link currently being used to communicate with Mathematica. Null if no link is open yet.
 - 
setLinkArgumentspublic void setLinkArguments(java.lang.String linkArgs) Sets the command line to use to open a link to Mathematica. The string is in the same form as you would pass to MathLinkFactory.createKernelLink(), for example:"-linkmode launch -linkname \"c:/program files/wolfram research/mathematica/5.1/mathkernel.exe\"" (Windows) "-linkmode launch -linkname 'math -mathlink'" (UNIX) "-linkmode launch -linkname '\"/Applications/Mathematica 4.1.app/Contents/MacOS/MathKernel\" -mathlink'" (Mac OS X)The actual creation of the link will happen when you call connect().- Parameters:
- linkArgs- the command line to create the link
- See Also:
- setLinkArgumentsArray(String[]),- setLink(KernelLink),- connect(),- closeLink()
 
 - 
setLinkArgumentsArraypublic void setLinkArgumentsArray(java.lang.String[] linkArgs) Sets the arguments to use to open a link to Mathematica. The string array is in the same form as you would pass to MathLinkFactory.createKernelLink(), for example:String[] args = {"-linkmode", "launch", "-linkname", "c:\\program files\\wolfram research\\mathematica\\5.1\\mathkernel.exe"}; (Windows) String[] args = {"-linkmode", "launch", "-linkname", "math -mathlink"}; (UNIX) String[] args = {"-linkmode", "launch", "-linkname", \"/Applications/Mathematica 5.1.app/Contents/MacOS/MathKernel\" -mathlink"}; (Mac OS X)The actual creation of the link will happen when you call connect().- Parameters:
- linkArgs- the command line to create the link
- See Also:
- setLinkArguments(String),- setLink(KernelLink),- connect(),- closeLink()
 
 - 
getLinkArgumentspublic java.lang.String getLinkArguments() Returns the string specified to create the link to Mathematica.- See Also:
- setLinkArguments(String)
 
 - 
getLinkArgumentsArraypublic java.lang.String[] getLinkArgumentsArray() Returns the string array specified to create the link to Mathematica.- See Also:
- setLinkArgumentsArray(String[])
 
 - 
setConnectTimeoutpublic void setConnectTimeout(int timeoutMillis) Sets the number of milliseconds that the connect() method will wait to connect the link to Mathematica. If the timeout expires, connect() will throw a MathLinkException. You can use this timeout to prevent your program from hanging indefinitely in certain circumstances if the kernel does not launch properly. The default value is very large, effectively no timeout.- See Also:
- getConnectTimeout()
 
 - 
getConnectTimeoutpublic int getConnectTimeout() Returns the number of milliseconds that the connect() method will wait to connect the link to Mathematica.- See Also:
- setConnectTimeout(int)
 
 - 
getTextpublic java.lang.String getText() Gives the current contents of the pane as a string.
 - 
getTextPanepublic javax.swing.JTextPane getTextPane() Gives the JTextPane component that is hosted within this MathSessionPane. The JTextPane is the actual component that handles all text input and output. Advanced programmers might want access to the JTextPane to call methods directly on it.
 - 
isComputationActivepublic boolean isComputationActive() Indicates whether a computation is currently in progress. Programmers might want to know this for several reasons. First, they might want to disable/enable parts of their user interface, and second, they might want to know whether the Mathematica kernel is currently busy. This latter consideration is particularly important if other parts of the program want to use the same link. Programmers who are considering using this method might find it preferable instead to use a PropertyChangeListener to monitor the changes in the computationActive property.- Returns:
- true, if a computation is active, false otherwise
 
 - 
getTextSizepublic int getTextSize() Gives the font size currently in use.
 - 
setTextSizepublic void setTextSize(int size) Sets the font size for input and output text.- Parameters:
- size- the font size, in points
 
 - 
isSyntaxColoringpublic boolean isSyntaxColoring() Indicates whether syntax coloring is currently enabled.- Returns:
- true, if syntax coloring is on, false otherwise
 
 - 
setSyntaxColoringpublic void setSyntaxColoring(boolean b) Enables or disables syntax coloring of input. The default is true.- Parameters:
- b-
 
 - 
getTextColorpublic java.awt.Color getTextColor() Gives the color for input and output text
 - 
setTextColorpublic void setTextColor(java.awt.Color c) Sets the color for input and output text. This color is used for input except when syntax coloring is on and the characters are in a syntax class that is specially colored. The default is black.- Parameters:
- c-
 
 - 
getStringColorpublic java.awt.Color getStringColor() Returns the color that will be used for literal strings in input if syntax coloring is on.
 - 
setStringColorpublic void setStringColor(java.awt.Color c) Sets the color that will be used for literal strings in input if syntax coloring is on. The default is a shade of blue.- Parameters:
- c-
 
 - 
getCommentColorpublic java.awt.Color getCommentColor() Returns the color that will be used for comments in input if syntax coloring is on.
 - 
setCommentColorpublic void setCommentColor(java.awt.Color c) Sets the color that will be used for comments in input if syntax coloring is on. The default is a shade of green.- Parameters:
- c-
 
 - 
getSystemSymbolColorpublic java.awt.Color getSystemSymbolColor() Returns the color that will be used in input for symbols in the Mathematica System` context if syntax coloring is on.
 - 
setSystemSymbolColorpublic void setSystemSymbolColor(java.awt.Color c) Sets the color that will be used in input for symbols in the Mathematica System` context if syntax coloring is on. The default is a shade of purple.- Parameters:
- c-
 
 - 
getBackgroundColorpublic java.awt.Color getBackgroundColor() Returns the background color of the text region.
 - 
setBackgroundColorpublic void setBackgroundColor(java.awt.Color c) Sets the background color of the text region.- Parameters:
- c-
 
 - 
getPromptColorpublic java.awt.Color getPromptColor() Returns the color used for In[] and Out[] prompts.
 - 
setPromptColorpublic void setPromptColor(java.awt.Color c) Sets the color used for In[] and Out[] prompts. The default is blue.- Parameters:
- c-
 
 - 
getMessageColorpublic java.awt.Color getMessageColor() Returns the color used for Mathematica message output.
 - 
setMessageColorpublic void setMessageColor(java.awt.Color c) Sets the color used for Mathematica message output. The default is red.- Parameters:
- c-
 
 - 
getLeftIndentpublic int getLeftIndent() Returns the amount that input and output will be indented from the left edge.- Returns:
- the indent amount, in pixels
 
 - 
setLeftIndentpublic void setLeftIndent(int indent) Sets the amount that input and output will be indented from the left edge. The default is 20.- Parameters:
- indent- the indentation amount in pixels
 
 - 
isInputBoldfacepublic boolean isInputBoldface() Indicates whether input is in a boldface font.
 - 
setInputBoldfacepublic void setInputBoldface(boolean bold) Sets whether to use boldface for Mathematica input. The default is true.- Parameters:
- bold-
 
 - 
setFitGraphicspublic void setFitGraphics(boolean fit) Sets whether to scale graphics so as to fit into the current visible width. The default is false.- Parameters:
- fit-
 
 - 
isFitGraphicspublic boolean isFitGraphics() Indicates whether graphics are set to be scaled to fit into the current visible width.
 - 
setFrontEndGraphicspublic void setFrontEndGraphics(boolean b) Sets whether to use the Mathematica front end in the background to assist in rendering graphics. This must be set to true if you want typeset output (such as plot labels) in your graphics. It will also improve the quality of most images, particularly surface graphics. Setting this to true will cause the front end to launch. The default is false.- Parameters:
- b-
 
 - 
isFrontEndGraphicspublic boolean isFrontEndGraphics() Indicates whether the Mathematica front end will be used to assist in rendering graphics.
 - 
addColoredSymbolspublic void addColoredSymbols(java.lang.String[] syms, java.awt.Color c)Lets you customize syntax coloring by specifying an array of symbol names and the color you want them drawn in when they appear in input. As an example, you could use this to specify that all the symbols from a certain context should be rendered in red. You can call this method as many times as you like, specifying many different combinations of symbols and colors.- Parameters:
- syms- The symbols to be specially colored, for example {"If", "For", "Do"}
- c-
- See Also:
- clearColoredSymbols()
 
 - 
clearColoredSymbolspublic void clearColoredSymbols() Wipes out all syntax coloring customizations specified by addColoredSymbols().- See Also:
- addColoredSymbols(String[],Color)
 
 - 
setShowTimingpublic void setShowTiming(boolean show) Specifies whether to display the wall-clock timing for each input in a timing panel at the lower left corner of the pane. The default is true.- Parameters:
- show-
 
 - 
isShowTimingpublic boolean isShowTiming() Indicates whether evaluation timings will be shown in a timing panel at the lower left corner of the pane.
 - 
evaluateInputpublic void evaluateInput() Evaluates the current input. This operation is automatically mapped to the Shift-Enter key combination.
 - 
undopublic void undo() Undoes the last edit. This operation is automatically mapped to the Ctrl-Z key combination (Cmd-Z on Macintosh).
 - 
redopublic void redo() Redoes the last undone edit. This operation is automatically mapped to the Ctrl-Y key combination (Cmd-Y on Macintosh).
 - 
canRedopublic boolean canRedo() Indicates whether a redo operation is currently possible.
 - 
canUndopublic boolean canUndo() Indicates whether an undo operation is currently possible.
 - 
copyInputFromAbovepublic void copyInputFromAbove() Copies the previous input to the current cursor location. This operation is automatically mapped to the Ctrl-L key combination (Cmd-L on Macintosh).
 - 
balanceBracketspublic void balanceBrackets() Grows the current selection to highlight the nearest matching set of delimiters. This is done in a way that respects Mathematica syntax, meaning that delimiters within comments and strings are ignored. This operation is automatically mapped to the Ctrl-B key combination (Cmd-B on Macintosh).
 - 
addPropertyChangeListenerpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener) Adds a PropertyChangeListener that will be notified of changes in the computationActive property. You can use this to receive notifications when computations start and end. For eample, you might want to enable or disable parts of your user interface, or lock out other parts of your program from trying to use the link.- Overrides:
- addPropertyChangeListenerin class- java.awt.Container
- Parameters:
- listener-
 
 - 
removePropertyChangeListenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener) Removes a PropertyChangeListener.- Overrides:
- removePropertyChangeListenerin class- java.awt.Component
- Parameters:
- listener-
 
 - 
connectpublic void connect() throws MathLinkExceptionConnects the link to Mathematica and prepares the pane for use. The first In[] prompt will not appear and the pane will not be editable until this method has been called, even if you have supplied a preexisting link using the setLink() method. If you used setLinkArguments() or setLinkArgumentsArray() to specify link parameters, then the link will be created and connected at this time. The Mathematica kernel will be launched if appropriate.Do not call this until after the pane has been made visible. - Throws:
- MathLinkException
 
 - 
closeLinkpublic void closeLink() Closes the link to Mathematica. The link is not automatically closed anywhere in this class, so you must arrange for this method to be called.
 
- 
 
-