com.mindbright.terminal
public class DisplayWindow 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, java.awt.event.MouseWheelListener
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected boolean |
haveScrollbar |
static int |
MAX_COLS |
static int |
MAX_ROWS |
static int |
MIN_COLS |
static int |
MIN_ROWS |
protected javax.swing.JPanel |
myPanel |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
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
Constructor and Description |
---|
DisplayWindow() |
Modifier and Type | Method and Description |
---|---|
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 |
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 |
isFocusable() |
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 |
mouseWheelMoved(java.awt.event.MouseWheelEvent 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 |
setResizable(boolean resizable) |
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() |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, 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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, 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, setLayout, transferFocusDownCycle, validate, validateTree
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, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, 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, removePropertyChangeListener, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
requestFocus
public static final int MIN_ROWS
public static final int MIN_COLS
public static final int MAX_COLS
public static final int MAX_ROWS
protected boolean haveScrollbar
protected javax.swing.JPanel myPanel
public void setModel(DisplayModel model)
setModel
in interface DisplayView
public DisplayModel getModel()
getModel
in interface DisplayView
public void setController(com.mindbright.terminal.DisplayController controller)
setController
in interface DisplayView
public void setKeyListener(java.awt.event.KeyListener keyListener)
setKeyListener
in interface DisplayView
public void delKeyListener(java.awt.event.KeyListener keyListener)
delKeyListener
in interface DisplayView
public void setLogo(java.awt.Image logoImg, int x, int y, int w, int h)
setLogo
in interface DisplayView
public java.awt.Image getLogo()
getLogo
in interface DisplayView
public boolean showLogo()
showLogo
in interface DisplayView
public void hideLogo()
hideLogo
in interface DisplayView
public static java.awt.Color getTermRGBColor(java.lang.String value) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static java.awt.Color getTermColor(java.lang.String name) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void setFont(java.lang.String name, int size)
setFont
in interface DisplayView
public void setLineSpaceDelta(int delta)
setLineSpaceDelta
in interface DisplayView
public void setFont(java.awt.Font font)
setFont
in class javax.swing.JComponent
public void setVisTopChangeAllowed(boolean set)
setVisTopChangeAllowed
in interface DisplayView
public void setVisTopDelta(int delta)
setVisTopDelta
in interface DisplayView
public void setVisTopDelta(int delta, boolean changeAllowed)
setVisTopDelta
in interface DisplayView
public void setVisTop(int visTop)
setVisTop
in interface DisplayView
public void setVisTop(int visTop, boolean changeAllowed)
setVisTop
in interface DisplayView
public void setPendingVisTopChange(int visTop)
setPendingVisTopChange
in interface DisplayView
public void updateScrollbarValues()
updateScrollbarValues
in interface DisplayView
protected void updateScrollbarValues(int val, int ext, int min, int max)
protected java.awt.Dimension getScrollbarSize()
protected void addScrollbarToPanel(java.lang.String where)
protected void removeScrollbarFromPanel()
public java.awt.Container getPanelWithScrollbar(java.lang.String scrollPos)
getPanelWithScrollbar
in interface DisplayView
public void moveScrollbar(java.lang.String scrollPos)
moveScrollbar
in interface DisplayView
public void updateDirtyArea(int top, int left, int bottom, int right)
updateDirtyArea
in interface DisplayView
public void focusGained(java.awt.event.FocusEvent e)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent e)
focusLost
in interface java.awt.event.FocusListener
public boolean isFocusable()
isFocusable
in class java.awt.Component
public void componentMoved(java.awt.event.ComponentEvent e)
componentMoved
in interface java.awt.event.ComponentListener
public void componentShown(java.awt.event.ComponentEvent e)
componentShown
in interface java.awt.event.ComponentListener
public void componentHidden(java.awt.event.ComponentEvent e)
componentHidden
in interface java.awt.event.ComponentListener
public void componentResized(java.awt.event.ComponentEvent e)
componentResized
in interface java.awt.event.ComponentListener
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged
in interface java.awt.event.AdjustmentListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
public boolean isWide(char c)
DisplayView
isWide
in interface DisplayView
public java.awt.Dimension getDimensionOfText(int rows, int cols)
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public java.awt.Dimension getMaximumSize()
getMaximumSize
in class javax.swing.JComponent
public void repaint()
repaint
in interface DisplayView
repaint
in class java.awt.Component
public void repaint(boolean force)
repaint
in interface DisplayView
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public void setPosition(int x, int y)
setPosition
in interface DisplayView
public void setGeometry(int row, int col)
setGeometry
in interface DisplayView
public void setResizable(boolean resizable)
setResizable
in interface DisplayView
public void resetSelection()
resetSelection
in interface DisplayView
public void setSelection(int row1, int col1, int row2, int col2)
setSelection
in interface DisplayView
public void setNoCursor()
setNoCursor
in interface DisplayView
public void setCursorPosition(int row, int col)
setCursorPosition
in interface DisplayView
public void setBackgroundColor(java.awt.Color c)
setBackgroundColor
in interface DisplayView
public void setForegroundColor(java.awt.Color c)
setForegroundColor
in interface DisplayView
public void setCursorColor(java.awt.Color c)
setCursorColor
in interface DisplayView
public void reverseColors()
reverseColors
in interface DisplayView
public void doBell()
doBell
in interface DisplayView
public void doBell(boolean visualBell)
doBell
in interface DisplayView
public java.awt.Component getAWTComponent()
getAWTComponent
in interface DisplayView
public void setIgnoreClose()
setIgnoreClose
in interface DisplayView
public void windowClosed()
windowClosed
in interface DisplayView
public java.awt.Component mkButton(java.lang.String label, java.lang.String cmd, java.awt.event.ActionListener listener)
mkButton
in interface DisplayView
public boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)
imageUpdate
in interface java.awt.image.ImageObserver
imageUpdate
in class java.awt.Component