Back to index

wims  3.65+svn20090927
Public Member Functions | Private Attributes
ptolemy.plot.PlotBox.CommandListener Class Reference
Inheritance diagram for ptolemy.plot.PlotBox.CommandListener:
Inheritance graph
[legend]
Collaboration diagram for ptolemy.plot.PlotBox.CommandListener:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void keyPressed (KeyEvent e)
void keyReleased (KeyEvent e)
void keyTyped (KeyEvent e)

Private Attributes

boolean _control = false
boolean _shift = false

Detailed Description

Definition at line 4200 of file PlotBox.java.


Member Function Documentation

void ptolemy.plot.PlotBox.CommandListener.keyPressed ( KeyEvent  e) [inline]

Definition at line 4201 of file PlotBox.java.

                                           {
            int keycode = e.getKeyCode();

            switch (keycode) {
            case KeyEvent.VK_CONTROL:
                _control = true;
                break;

            case KeyEvent.VK_SHIFT:
                _shift = true;
                break;

            case KeyEvent.VK_C:

                if (_control) {
                    // The "null" sends the output to the clipboard.
                    export(null);

                    String message = "Encapsulated PostScript (EPS) "
                            + "exported to clipboard.";
                    JOptionPane.showMessageDialog(PlotBox.this, message,
                            "Ptolemy Plot Message",
                            JOptionPane.INFORMATION_MESSAGE);
                }

                break;

            case KeyEvent.VK_D:

                if (!_control && _shift) {
                    write(System.out);

                    String message = "Plot data sent to standard out.";
                    JOptionPane.showMessageDialog(PlotBox.this, message,
                            "Ptolemy Plot Message",
                            JOptionPane.INFORMATION_MESSAGE);
                }

                if (_control) {
                    // xgraph and many other Unix apps use Control-D to exit
                    StringUtilities.exit(1);
                }

                break;

            case KeyEvent.VK_E:

                if (!_control && _shift) {
                    export(System.out);

                    String message = "Encapsulated PostScript (EPS) "
                            + "exported to standard out.";
                    JOptionPane.showMessageDialog(PlotBox.this, message,
                            "Ptolemy Plot Message",
                            JOptionPane.INFORMATION_MESSAGE);
                }

                break;

            case KeyEvent.VK_F:

                if (!_control && _shift) {
                    fillPlot();
                }

                break;

            case KeyEvent.VK_H:

                if (!_control && _shift) {
                    _help();
                }

                break;

            case KeyEvent.VK_Q:

                if (!_control) {
                    // xv uses q to quit.
                    StringUtilities.exit(1);
                }

                break;

            case KeyEvent.VK_SLASH:

                if (_shift) {
                    // Question mark is SHIFT-SLASH
                    _help();
                }

                break;

            default:
                // None
            }
        }

Here is the call graph for this function:

void ptolemy.plot.PlotBox.CommandListener.keyReleased ( KeyEvent  e) [inline]

Definition at line 4299 of file PlotBox.java.

                                            {
            int keycode = e.getKeyCode();

            switch (keycode) {
            case KeyEvent.VK_CONTROL:
                _control = false;
                break;

            case KeyEvent.VK_SHIFT:
                _shift = false;
                break;

            default:
                // None
            }
        }
void ptolemy.plot.PlotBox.CommandListener.keyTyped ( KeyEvent  e) [inline]

Definition at line 4318 of file PlotBox.java.

                                         {
        }

Member Data Documentation

Definition at line 4321 of file PlotBox.java.

Definition at line 4323 of file PlotBox.java.


The documentation for this class was generated from the following file: