com.SoftWoehr.JTOpenContrib.MEU
Class MEUTextArea

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.text.JTextComponent
                          |
                          +--javax.swing.JTextArea
                                |
                                +--com.SoftWoehr.JTOpenContrib.MEU.MEUTextArea
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable

public class MEUTextArea
extends javax.swing.JTextArea

The edit region.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JTextArea
javax.swing.JTextArea.AccessibleJTextArea
 
Inner classes inherited from class javax.swing.text.JTextComponent
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.KeyBinding
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static int offset_to_srcdta
           
 
Fields inherited from class javax.swing.text.JTextComponent
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MEUTextArea()
          Creates new MEUTextArea of default size and color.
MEUTextArea(int columns, int rows, java.awt.Color foregroundColor, java.awt.Color backgroundColor)
          Creates new MEUTextArea of specific size and specific color
MEUTextArea(MEUController mc)
          Create the text area dependend on a frame controller.
 
Method Summary
 void backspaceRowLineCommandChar(int pos, int rownum)
           
 void beep()
           
 void deleteRowLineCommandChar(int pos, int rownum)
           
 java.awt.Color getBackgroundColorFromProperty()
          Necessitated because I can't convince the IDE to stop setting the Caret color in MEUFrame.initComponents() ...
 java.awt.Color getCaretColorFromProperty()
          Necessitated because I can't convince the IDE to stop setting the Caret color in MEUFrame.initComponents() ...
 int getCurPos()
          Get the cursor position
 int getDisplayedRowNumber()
          Return the number of the row in the display the cursor is on
 java.awt.Color getForegroundColorFromProperty()
          Necessitated because I can't convince the IDE to stop setting the Caret color in MEUFrame.initComponents() ...
 boolean getInserting()
          Return insert mode (true) or typeover (false)
 int getOffsetInRow(int curpos)
          Get offset from head of row of the current position
 int getOffsetInSRCDTA(int curpos)
          Return an offset within SRCDTA, flooring and ceiling-ing it.
 boolean getRowChanged(int rownum)
          get a row changed or not
 java.lang.String getRowLineCommand(int rownum)
          get a row's line command or null
 java.util.Vector getRowLineCommands()
          get the row line commands in a vector
 boolean getRowWriteProtected(int rownum)
          Set a row write-protected or not
 java.lang.String getSRCDTAcontents(int rownum)
          Get contents of SRCDTA field
 int getSRCDTAlength()
          Return length of SRCDTA field
 void initFont()
          Init the font.
 void initSize()
          Set the rows and columns.
 java.lang.String minusTrailing(java.lang.String s)
          Removing trailing blanks
 void moveCursorBottomEnd()
          Set cursor pos
 void moveCursorDown()
          Set cursor pos
 void moveCursorEnd()
          Set cursor pos
 void moveCursorHome()
          Set cursor pos
 void moveCursorLeft()
          Set cursor pos
 void moveCursorLineArea()
          Set cursor pos
 void moveCursorPageDown()
          Set cursor pos
 void moveCursorPageUp()
          Set cursor pos
 void moveCursorRight()
           
 void moveCursorSrcdtaEnd()
          Set cursor pos
 void moveCursorTopHome()
          Set cursor pos
 void moveCursorUp()
          Set cursor pos
protected  void processKeyEvent(java.awt.event.KeyEvent e)
          Process certain key events before textedit gets 'em
 void reinit(int columns, int rows)
          Useful reinitialization of visual settings
 void reinit(int columns, int rows, java.awt.Color foregroundColor, java.awt.Color backgroundColor)
          Useful reinitialization of visual settings
 void reinit(int columns, int rows, java.awt.Color foregroundColor, java.awt.Color backgroundColor, java.awt.Color caretColor)
          Useful reinitialization of visual settings
 void replaceVisibleRow(int rownum, java.lang.String text, boolean isProtected, boolean isChanged, java.lang.String lineCommand)
          Replaces visible portion of row.
 void resetColor(java.awt.Color caretColor)
          Reset the caret color only
 void resetColor(java.awt.Color foregroundColor, java.awt.Color backgroundColor)
          Set the text colors
 void resetColor(java.awt.Color foregroundColor, java.awt.Color backgroundColor, java.awt.Color caretColor)
          Set the text colors and caret color
 void resetFont(java.awt.Font f)
          Change the font and resize
 void resetSize(int columns, int rows)
          Resize the text area to a new cols & rows.
 boolean rowHasLineCommand(int rownum)
          Get a row's having a line command
protected  void setController(MEUController controller)
          Set the MEUController for this component, called in ctor, passed in from MEUFrame.
 boolean setCurPos(int pos)
          Set the cursor position
 void setOffsetInSRCDTA(int offset)
          Move cursor in current line but always ends up within srcdta floor/ceiling.
 void setRowChanged(boolean yesno, int rownum)
          Set a row changed or not
 void setRowLineCommand(java.lang.String c, int rownum)
          Set a row line command text
 void setRowLineCommandChar(int pos, java.lang.String c, int rownum)
          Set one char (first char of string) in one pos in row line command text
 void setRowWriteProtected(boolean yesno, int rownum)
          Set a row write-protected or not
 void setToBlank(int numberOfRows)
           
 boolean toggleInserting()
          Toggle the insert mode flag
 void wrapCursor()
          Allows frame to make sure cursor is in reasonable position e.g., after buffer is loaded and cursor is at end.
 int wrappedCursorPos(int currentCursorPos)
          Convert a cursor offset to where the cursor should be, i.e., if it's on the end of the line put it to the next line, if it's at the end of the buffer, wrap to top.
 
Methods inherited from class javax.swing.JTextArea
append, createDefaultModel, getAccessibleContext, getColumns, getColumnWidth, getLineCount, getLineEndOffset, getLineOfOffset, getLineStartOffset, getLineWrap, getPreferredScrollableViewportSize, getPreferredSize, getRowHeight, getRows, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getTabSize, getUIClassID, getWrapStyleWord, insert, isManagingFocus, paramString, replaceRange, setColumns, setFont, setLineWrap, setRows, setTabSize, setWrapStyleWord
 
Methods inherited from class javax.swing.text.JTextComponent
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getActions, getCaret, getCaretColor, getCaretPosition, getDisabledTextColor, getDocument, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getUI, isEditable, isFocusTraversable, loadKeymap, modelToView, moveCaretPosition, paste, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setDisabledTextColor, setDocument, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, write
 
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, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

offset_to_srcdta

public static final int offset_to_srcdta
Constructor Detail

MEUTextArea

public MEUTextArea(MEUController mc)
Create the text area dependend on a frame controller. This is the only runtime-useful ctor.

MEUTextArea

public MEUTextArea()
Creates new MEUTextArea of default size and color. Only used by the design tool (to load a representation of the bean).

MEUTextArea

public MEUTextArea(int columns,
                   int rows,
                   java.awt.Color foregroundColor,
                   java.awt.Color backgroundColor)
Creates new MEUTextArea of specific size and specific color
Method Detail

setController

protected void setController(MEUController controller)
Set the MEUController for this component, called in ctor, passed in from MEUFrame.

reinit

public void reinit(int columns,
                   int rows)
Useful reinitialization of visual settings

reinit

public void reinit(int columns,
                   int rows,
                   java.awt.Color foregroundColor,
                   java.awt.Color backgroundColor)
Useful reinitialization of visual settings

reinit

public void reinit(int columns,
                   int rows,
                   java.awt.Color foregroundColor,
                   java.awt.Color backgroundColor,
                   java.awt.Color caretColor)
Useful reinitialization of visual settings

initSize

public void initSize()
Set the rows and columns.

resetSize

public void resetSize(int columns,
                      int rows)
Resize the text area to a new cols & rows. Probably shouldn't ever do this with or without a changed buffer without doing a check changed and redisplay.

initFont

public void initFont()
Init the font.

resetFont

public void resetFont(java.awt.Font f)
Change the font and resize

resetColor

public void resetColor(java.awt.Color caretColor)
Reset the caret color only

resetColor

public void resetColor(java.awt.Color foregroundColor,
                       java.awt.Color backgroundColor)
Set the text colors

resetColor

public void resetColor(java.awt.Color foregroundColor,
                       java.awt.Color backgroundColor,
                       java.awt.Color caretColor)
Set the text colors and caret color

getCaretColorFromProperty

public java.awt.Color getCaretColorFromProperty()
Necessitated because I can't convince the IDE to stop setting the Caret color in MEUFrame.initComponents() ... arghh!

getForegroundColorFromProperty

public java.awt.Color getForegroundColorFromProperty()
Necessitated because I can't convince the IDE to stop setting the Caret color in MEUFrame.initComponents() ... arghh!

getBackgroundColorFromProperty

public java.awt.Color getBackgroundColorFromProperty()
Necessitated because I can't convince the IDE to stop setting the Caret color in MEUFrame.initComponents() ... arghh!

getOffsetInRow

public int getOffsetInRow(int curpos)
Get offset from head of row of the current position

getOffsetInSRCDTA

public int getOffsetInSRCDTA(int curpos)
Return an offset within SRCDTA, flooring and ceiling-ing it.

setOffsetInSRCDTA

public void setOffsetInSRCDTA(int offset)
Move cursor in current line but always ends up within srcdta floor/ceiling.

getDisplayedRowNumber

public int getDisplayedRowNumber()
Return the number of the row in the display the cursor is on

getSRCDTAlength

public int getSRCDTAlength()
Return length of SRCDTA field

getSRCDTAcontents

public java.lang.String getSRCDTAcontents(int rownum)
Get contents of SRCDTA field

minusTrailing

public java.lang.String minusTrailing(java.lang.String s)
Removing trailing blanks

wrappedCursorPos

public int wrappedCursorPos(int currentCursorPos)
Convert a cursor offset to where the cursor should be, i.e., if it's on the end of the line put it to the next line, if it's at the end of the buffer, wrap to top.

getCurPos

public int getCurPos()
Get the cursor position

setCurPos

public boolean setCurPos(int pos)
Set the cursor position

wrapCursor

public void wrapCursor()
Allows frame to make sure cursor is in reasonable position e.g., after buffer is loaded and cursor is at end.

moveCursorUp

public void moveCursorUp()
Set cursor pos

moveCursorDown

public void moveCursorDown()
Set cursor pos

moveCursorLeft

public void moveCursorLeft()
Set cursor pos

moveCursorRight

public void moveCursorRight()

moveCursorHome

public void moveCursorHome()
Set cursor pos

moveCursorEnd

public void moveCursorEnd()
Set cursor pos

moveCursorTopHome

public void moveCursorTopHome()
Set cursor pos

moveCursorBottomEnd

public void moveCursorBottomEnd()
Set cursor pos

moveCursorPageUp

public void moveCursorPageUp()
Set cursor pos

moveCursorPageDown

public void moveCursorPageDown()
Set cursor pos

moveCursorLineArea

public void moveCursorLineArea()
Set cursor pos

moveCursorSrcdtaEnd

public void moveCursorSrcdtaEnd()
Set cursor pos

setRowWriteProtected

public void setRowWriteProtected(boolean yesno,
                                 int rownum)
Set a row write-protected or not

setRowChanged

public void setRowChanged(boolean yesno,
                          int rownum)
Set a row changed or not

setRowLineCommand

public void setRowLineCommand(java.lang.String c,
                              int rownum)
Set a row line command text

setRowLineCommandChar

public void setRowLineCommandChar(int pos,
                                  java.lang.String c,
                                  int rownum)
Set one char (first char of string) in one pos in row line command text

deleteRowLineCommandChar

public void deleteRowLineCommandChar(int pos,
                                     int rownum)

backspaceRowLineCommandChar

public void backspaceRowLineCommandChar(int pos,
                                        int rownum)

getRowWriteProtected

public boolean getRowWriteProtected(int rownum)
Set a row write-protected or not

getRowChanged

public boolean getRowChanged(int rownum)
get a row changed or not

getRowLineCommand

public java.lang.String getRowLineCommand(int rownum)
get a row's line command or null

getRowLineCommands

public java.util.Vector getRowLineCommands()
get the row line commands in a vector

rowHasLineCommand

public boolean rowHasLineCommand(int rownum)
Get a row's having a line command

setToBlank

public void setToBlank(int numberOfRows)

replaceVisibleRow

public void replaceVisibleRow(int rownum,
                              java.lang.String text,
                              boolean isProtected,
                              boolean isChanged,
                              java.lang.String lineCommand)
Replaces visible portion of row. Caller better be right about length!

getInserting

public boolean getInserting()
Return insert mode (true) or typeover (false)

toggleInserting

public boolean toggleInserting()
Toggle the insert mode flag

processKeyEvent

protected void processKeyEvent(java.awt.event.KeyEvent e)
Process certain key events before textedit gets 'em
Overrides:
processKeyEvent in class javax.swing.JTextArea

beep

public void beep()