|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpsengines.GraphicsMachine
As the name of this class implies, it represents the Graphics Machine of the postscript interpreter.
The Graphics Machine is responsible for everything concerning drawing on screen, including the GUI. It has to be initialized with the Graphics Stack as its one parameter and a PipedWriter as its other. Then, using the method InitGUI(), two JFrame windows are created for the input-output and the drawing area, including JScrollPanes, a JTextField and a JTextArea. The drawing area window also uses the class DrawingArea. The Graphics Stack pointer is passed to the DrawingArea class upon its creation, which processes it and performs the drawing of the postscript graphics.
| Constructor Summary | |
GraphicsMachine()
Initializes some fields of the object. |
|
| Method Summary | |
static void |
appendToOutputText(java.lang.String str)
Adds to the output text of the GUI the one given. |
PSPath |
getGraphicsStack()
Returns the PSPath object used for input. |
java.io.PipedWriter |
getPipedWriter()
Returns the PipedWriter object used for input. |
void |
InitGUI()
Creates the GUI which consists of two windows: the console input-output and the drawing area. |
void |
keyPressed(java.awt.event.KeyEvent e)
Implements the KeyListener interface and handles the event of pressing ENTER while typing on the input text field, so that the text is processed and cleared. |
void |
keyReleased(java.awt.event.KeyEvent e)
Implements KeyListener -- NOT USED |
void |
keyTyped(java.awt.event.KeyEvent e)
Implements KeyListener -- NOT USED |
static void |
showPage()
Static method used mainly by the showpage operator to show graphics frame. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GraphicsMachine()
| Method Detail |
public void InitGUI()
public java.io.PipedWriter getPipedWriter()
public PSPath getGraphicsStack()
public static void appendToOutputText(java.lang.String str)
str - The string which represents the new text for the GUI output.public void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenere - Holds the pressed key information.public static void showPage()
public void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||