Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.mindbright.terminal
Class DisplaySwing

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  javax.swing.JPanel
                      com.mindbright.terminal.DisplaySwing

All Implemented Interfaces:
  javax.accessibility.Accessible, java.awt.event.AdjustmentListener, java.awt.event.ComponentListener, DisplayView, java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable

public class DisplaySwing
extends javax.swing.JPanel
implements DisplayView, java.awt.event.AdjustmentListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ComponentListener, java.awt.event.FocusListener, java.awt.image.ImageObserver

See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class javax.swing.JPanel
`javax.swing.JPanel.AccessibleJPanel`

Nested classes inherited from class javax.swing.JComponent
`javax.swing.JComponent.AccessibleJComponent`

Nested classes inherited from class java.awt.Container
`java.awt.Container.AccessibleAWTContainer`

Nested classes inherited from class java.awt.Component
`java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

Field Summary
`protected boolean` | `haveScrollbar`
`static int` | `MAX_COLS`
`static int` | `MAX_ROWS`
`static int` | `MIN_COLS`
`static int` | `MIN_ROWS`
`protected java.awt.Container` | `myPanel`

Fields inherited from class javax.swing.JComponent
`accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW`

Fields inherited from class java.awt.Component
`BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

Fields inherited from interface com.mindbright.terminal.DisplayView
`COLOR_BLACK, COLOR_BLUE, COLOR_CYAN, COLOR_GREEN, COLOR_I_BLACK, COLOR_I_BLUE, COLOR_I_CYAN, COLOR_I_GREEN, COLOR_I_MAGENTA, COLOR_I_RED, COLOR_I_WHITE, COLOR_I_YELLOW, COLOR_MAGENTA, COLOR_RED, COLOR_WHITE, COLOR_YELLOW, termColorNames, termColors`

Fields inherited from interface java.awt.image.ImageObserver
`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

Constructor Summary
`DisplaySwing(java.awt.Frame ownerFrame)`

Method Summary
`protected void` | `addScrollbarToPanel(java.lang.String where)`
`void` | `adjustmentValueChanged(java.awt.event.AdjustmentEvent e)`
`void` | `componentHidden(java.awt.event.ComponentEvent e)`
`void` | `componentMoved(java.awt.event.ComponentEvent e)`
`void` | `componentResized(java.awt.event.ComponentEvent e)`
`void` | `componentShown(java.awt.event.ComponentEvent e)`
`void` | `delKeyListener(java.awt.event.KeyListener keyListener)`
`void` | `doBell()`
`void` | `doBell(boolean visualBell)`
`void` | `emulateComponentShown()`
`void` | `focusGained(java.awt.event.FocusEvent e)`
`void` | `focusLost(java.awt.event.FocusEvent e)`
`java.awt.Component` | `getAWTComponent()`
`java.awt.Dimension` | `getDimensionOfText(int rows, int cols)`
`java.awt.Image` | `getLogo()`
`java.awt.Dimension` | `getMaximumSize()`
`java.awt.Dimension` | `getMinimumSize()`
`DisplayModel` | `getModel()`
`java.awt.Container` | `getPanelWithScrollbar(java.lang.String scrollPos)`
`java.awt.Dimension` | `getPreferredSize()`
`protected java.awt.Dimension` | `getScrollbarSize()`
`static java.awt.Color` | `getTermColor(java.lang.String name)`
`static java.awt.Color` | `getTermRGBColor(java.lang.String value)`
`void` | `hideLogo()`
`boolean` | `imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)`
`boolean` | `isFocusTraversable()`
`boolean` | `isWide(char c)` Check if the give character is wider than normal for the font.
`java.awt.Component` | `mkButton(java.lang.String label, java.lang.String cmd, java.awt.event.ActionListener listener)`
`void` | `mouseClicked(java.awt.event.MouseEvent e)`
`void` | `mouseDragged(java.awt.event.MouseEvent e)`
`void` | `mouseEntered(java.awt.event.MouseEvent e)`
`void` | `mouseExited(java.awt.event.MouseEvent e)`
`void` | `mouseMoved(java.awt.event.MouseEvent e)`
`void` | `mousePressed(java.awt.event.MouseEvent e)`
`void` | `mouseReleased(java.awt.event.MouseEvent e)`
`void` | `moveScrollbar(java.lang.String scrollPos)`
`void` | `paintComponent(java.awt.Graphics g)`
`protected void` | `removeScrollbarFromPanel()`
`void` | `repaint()`
`void` | `repaint(boolean force)`
`void` | `resetSelection()`
`void` | `reverseColors()`
`void` | `setBackgroundColor(java.awt.Color c)`
`void` | `setController(com.mindbright.terminal.DisplayController controller)`
`void` | `setCursorColor(java.awt.Color c)`
`void` | `setCursorPosition(int row, int col)`
`void` | `setFont(java.awt.Font font)`
`void` | `setFont(java.lang.String name, int size)`
`void` | `setForegroundColor(java.awt.Color c)`
`void` | `setGeometry(int row, int col)`
`void` | `setIgnoreClose()`
`void` | `setKeyListener(java.awt.event.KeyListener keyListener)`
`void` | `setLineSpaceDelta(int delta)`
`void` | `setLogo(java.awt.Image logoImg, int x, int y, int w, int h)`
`void` | `setModel(DisplayModel model)`
`void` | `setNoCursor()`
`void` | `setPendingVisTopChange(int visTop)`
`void` | `setPosition(int x, int y)`
`void` | `setSelection(int row1, int col1, int row2, int col2)`
`void` | `setVisTop(int visTop)`
`void` | `setVisTop(int visTop, boolean changeAllowed)`
`void` | `setVisTopChangeAllowed(boolean set)`
`void` | `setVisTopDelta(int delta)`
`void` | `setVisTopDelta(int delta, boolean changeAllowed)`
`boolean` | `showLogo()`
`void` | `updateDirtyArea(int top, int left, int bottom, int right)`
`void` | `updateScrollbarValues()`
`protected void` | `updateScrollbarValues(int val, int ext, int min, int max)`
`void` | `windowClosed()`

Methods inherited from class javax.swing.JPanel
`getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI`

Methods inherited from class javax.swing.JComponent
`addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update`

Methods inherited from class java.awt.Container
`add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree`

Methods inherited from class java.awt.Component
`action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface com.mindbright.terminal.DisplayView
`requestFocus`

Field Detail

### MIN_ROWS

    public static final int MIN_ROWS

See Also:
  Constant Field Values

### MIN_COLS

    public static final int MIN_COLS

See Also:
  Constant Field Values

### MAX_COLS

    public static final int MAX_COLS

See Also:
  Constant Field Values

### MAX_ROWS

    public static final int MAX_ROWS

See Also:
  Constant Field Values

### haveScrollbar

    protected boolean haveScrollbar

### myPanel

    protected java.awt.Container myPanel

Constructor Detail

### DisplaySwing

    public DisplaySwing(java.awt.Frame ownerFrame)

Method Detail

### setModel

    public void setModel(DisplayModel model)

  Specified by:
    `setModel` in interface `DisplayView`

### getModel

    public DisplayModel getModel()

  Specified by:
    `getModel` in interface `DisplayView`

### setController

    public void setController(com.mindbright.terminal.DisplayController controller)

  Specified by:
    `setController` in interface `DisplayView`

### setKeyListener

    public void setKeyListener(java.awt.event.KeyListener keyListener)

  Specified by:
    `setKeyListener` in interface `DisplayView`

### delKeyListener

    public void delKeyListener(java.awt.event.KeyListener keyListener)

  Specified by:
    `delKeyListener` in interface `DisplayView`

### setLogo

    public void setLogo(java.awt.Image logoImg,
                        int x,
                        int y,
                        int w,
                        int h)

  Specified by:
    `setLogo` in interface `DisplayView`

### getLogo

    public java.awt.Image getLogo()

  Specified by:
    `getLogo` in interface `DisplayView`

### showLogo

    public boolean showLogo()

  Specified by:
    `showLogo` in interface `DisplayView`

### hideLogo

    public void hideLogo()

  Specified by:
    `hideLogo` in interface `DisplayView`

### getTermRGBColor

    public static java.awt.Color getTermRGBColor(java.lang.String value)
                                          throws java.lang.NumberFormatException

  Throws:
    `java.lang.NumberFormatException`

### getTermColor

    public static java.awt.Color getTermColor(java.lang.String name)
                                       throws java.lang.IllegalArgumentException

  Throws:
    `java.lang.IllegalArgumentException`

### setFont

    public void setFont(java.lang.String name,
                        int size)

  Specified by:
    `setFont` in interface `DisplayView`

### setLineSpaceDelta

    public void setLineSpaceDelta(int delta)

  Specified by:
    `setLineSpaceDelta` in interface `DisplayView`

### setFont

    public void setFont(java.awt.Font font)

### setVisTopChangeAllowed

    public void setVisTopChangeAllowed(boolean set)

  Specified by:
    `setVisTopChangeAllowed` in interface `DisplayView`

### setVisTopDelta

    public void setVisTopDelta(int delta)

  Specified by:
    `setVisTopDelta` in interface `DisplayView`

### setVisTopDelta

    public void setVisTopDelta(int delta,
                               boolean changeAllowed)

  Specified by:
    `setVisTopDelta` in interface `DisplayView`

### setVisTop

    public void setVisTop(int visTop)

  Specified by:
    `setVisTop` in interface `DisplayView`

### setVisTop

    public void setVisTop(int visTop,
                          boolean changeAllowed)

  Specified by:
    `setVisTop` in interface `DisplayView`

### setPendingVisTopChange

    public void setPendingVisTopChange(int visTop)

  Specified by:
    `setPendingVisTopChange` in interface `DisplayView`

### updateScrollbarValues

    public void updateScrollbarValues()

  Specified by:
    `updateScrollbarValues` in interface `DisplayView`

### updateScrollbarValues

    protected void updateScrollbarValues(int val,
                                         int ext,
                                         int min,
                                         int max)

### getScrollbarSize

    protected java.awt.Dimension getScrollbarSize()

### addScrollbarToPanel

    protected void addScrollbarToPanel(java.lang.String where)

### removeScrollbarFromPanel

    protected void removeScrollbarFromPanel()

### getPanelWithScrollbar

    public java.awt.Container getPanelWithScrollbar(java.lang.String scrollPos)

  Specified by:
    `getPanelWithScrollbar` in interface `DisplayView`

### moveScrollbar

    public void moveScrollbar(java.lang.String scrollPos)

  Specified by:
    `moveScrollbar` in interface `DisplayView`

### updateDirtyArea

    public void updateDirtyArea(int top,
                                int left,
                                int bottom,
                                int right)

  Specified by:
    `updateDirtyArea` in interface `DisplayView`

### focusGained

    public void focusGained(java.awt.event.FocusEvent e)

  Specified by:
    `focusGained` in interface `java.awt.event.FocusListener`

### focusLost

    public void focusLost(java.awt.event.FocusEvent e)

  Specified by:
    `focusLost` in interface `java.awt.event.FocusListener`

### isFocusTraversable

    public boolean isFocusTraversable()

### componentMoved

    public void componentMoved(java.awt.event.ComponentEvent e)

  Specified by:
    `componentMoved` in interface `java.awt.event.ComponentListener`

### emulateComponentShown

    public void emulateComponentShown()

  Specified by:
    `emulateComponentShown` in interface `DisplayView`

### componentShown

    public void componentShown(java.awt.event.ComponentEvent e)

  Specified by:
    `componentShown` in interface `java.awt.event.ComponentListener`

### componentHidden

    public void componentHidden(java.awt.event.ComponentEvent e)

  Specified by:
    `componentHidden` in interface `java.awt.event.ComponentListener`

### componentResized

    public void componentResized(java.awt.event.ComponentEvent e)

  Specified by:
    `componentResized` in interface `java.awt.event.ComponentListener`

### adjustmentValueChanged

    public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)

  Specified by:
    `adjustmentValueChanged` in interface `java.awt.event.AdjustmentListener`

### mouseMoved

    public void mouseMoved(java.awt.event.MouseEvent e)

  Specified by:
    `mouseMoved` in interface `java.awt.event.MouseMotionListener`

### mouseEntered

    public void mouseEntered(java.awt.event.MouseEvent e)

  Specified by:
    `mouseEntered` in interface `java.awt.event.MouseListener`

### mouseExited

    public void mouseExited(java.awt.event.MouseEvent e)

  Specified by:
    `mouseExited` in interface `java.awt.event.MouseListener`

### mouseClicked

    public void mouseClicked(java.awt.event.MouseEvent e)

  Specified by:
    `mouseClicked` in interface `java.awt.event.MouseListener`

### mousePressed

    public void mousePressed(java.awt.event.MouseEvent e)

  Specified by:
    `mousePressed` in interface `java.awt.event.MouseListener`

### mouseReleased

    public void mouseReleased(java.awt.event.MouseEvent e)

  Specified by:
    `mouseReleased` in interface `java.awt.event.MouseListener`

### mouseDragged

    public void mouseDragged(java.awt.event.MouseEvent e)

  Specified by:
    `mouseDragged` in interface `java.awt.event.MouseMotionListener`

### isWide

    public boolean isWide(char c)

  Description copied from interface: `DisplayView`
  Check if the give character is wider than normal for the font. This is meant to catch certain asian characters which are double-width, even in a monospaced font:-(

  Specified by:
    `isWide` in interface `DisplayView`

### getDimensionOfText

    public java.awt.Dimension getDimensionOfText(int rows,
                                                 int cols)

### getPreferredSize

    public java.awt.Dimension getPreferredSize()

### getMinimumSize

    public java.awt.Dimension getMinimumSize()

### getMaximumSize

    public java.awt.Dimension getMaximumSize()

### repaint

    public void repaint()

  Specified by:
    `repaint` in interface `DisplayView`

### repaint

    public void repaint(boolean force)

  Specified by:
    `repaint` in interface `DisplayView`

### paintComponent

    public void paintComponent(java.awt.Graphics g)

### setPosition

    public void setPosition(int x,
                            int y)

  Specified by:
    `setPosition` in interface `DisplayView`

### setGeometry

    public void setGeometry(int row,
                            int col)

  Specified by:
    `setGeometry` in interface `DisplayView`

### resetSelection

    public void resetSelection()

  Specified by:
    `resetSelection` in interface `DisplayView`

### setSelection

    public void setSelection(int row1,
                             int col1,
                             int row2,
                             int col2)

  Specified by:
    `setSelection` in interface `DisplayView`

### setNoCursor

    public void setNoCursor()

  Specified by:
    `setNoCursor` in interface `DisplayView`

### setCursorPosition

    public void setCursorPosition(int row,
                                  int col)

  Specified by:
    `setCursorPosition` in interface `DisplayView`

### setBackgroundColor

    public void setBackgroundColor(java.awt.Color c)

  Specified by:
    `setBackgroundColor` in interface `DisplayView`

### setForegroundColor

    public void setForegroundColor(java.awt.Color c)

  Specified by:
    `setForegroundColor` in interface `DisplayView`

### setCursorColor

    public void setCursorColor(java.awt.Color c)

  Specified by:
    `setCursorColor` in interface `DisplayView`

### reverseColors

    public void reverseColors()

  Specified by:
    `reverseColors` in interface `DisplayView`

### doBell

    public void doBell()

  Specified by:
    `doBell` in interface `DisplayView`

### doBell

    public void doBell(boolean visualBell)

  Specified by:
    `doBell` in interface `DisplayView`

### getAWTComponent

    public java.awt.Component getAWTComponent()

  Specified by:
    `getAWTComponent` in interface `DisplayView`

### setIgnoreClose

    public void setIgnoreClose()

  Specified by:
    `setIgnoreClose` in interface `DisplayView`

### windowClosed

    public void windowClosed()

  Specified by:
    `windowClosed` in interface `DisplayView`

### mkButton

    public java.awt.Component mkButton(java.lang.String label,
                                       java.lang.String cmd,
                                       java.awt.event.ActionListener listener)

  Specified by:
    `mkButton` in interface `DisplayView`

### imageUpdate

    public boolean imageUpdate(java.awt.Image img,
                               int infoflags,
                               int x,
                               int y,
                               int width,
                               int height)

  Specified by:
    `imageUpdate` in interface `java.awt.image.ImageObserver`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD