BioLegato 0.7.3 GDE plugin

org.biolegato.gdesupport.canvas.textarea
Class UndoableGDETextArea

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by org.biolegato.gdesupport.canvas.textarea.BLComponent
                  extended by org.biolegato.gdesupport.canvas.textarea.BLTextArea
                      extended by org.biolegato.gdesupport.canvas.textarea.GDETextArea
                          extended by org.biolegato.gdesupport.canvas.textarea.UndoableGDETextArea
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, GDEModelListener, GDECanvasObject

public class UndoableGDETextArea
extends GDETextArea

Custom text area for allowing box selection

Author:
Graham Alvare, Brian Fristensky
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 UndoableGDETextArea ugdeTextAreaSelf
          Self-reference for inner classes.
 
Fields inherited from class org.biolegato.gdesupport.canvas.textarea.BLTextArea
blTextAreaSelf, column, currentMap, cursorListeners, datamodel, insertMode, invalidzone, modeListeners, popup, row, selectionMouse, selectionMove
 
Fields inherited from class org.biolegato.gdesupport.canvas.textarea.BLComponent
columnWidth, rowHeight
 
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
UndoableGDETextArea(GDECanvas canvas)
          Constructs a new instance of GDETextArea.
 
Method Summary
 void changeCase()
          Changes the case of the currently selected sequence (if the sequence is of inconsistent case, the case of the entire sequence is changed to the opposite case of the first character in the sequence.
 void cut()
          Cuts content from the current Editable object.
 void keyPressed(java.awt.event.KeyEvent event)
          Processes key presses within the text area
 void keyTyped(java.awt.event.KeyEvent event)
          Processes the typing of keys within the text area
 void paste()
          Pastes content into the current Editable object.
 Undoable uchangePosition(int newColumn, int newRow)
          The undoable version of the "changePosition" function
 Undoable udelete(int x, int y, int w, int h)
          Removes text from a document.
 Undoable udeleteSelection()
          The undoable version of the "deleteSelection" function
 Undoable uinsert(int x, int y, Cell[] sequences)
          Inserts an array of sequences into the textarea's underlying SeqDoc
 Undoable uinsert(int x, int y, java.lang.String text)
          Inserts a string into the textarea's underlying SeqDoc (NOTE: this should ONLY be called by sub-methods)
 Undoable updelete(int x, int y, int w, int h)
          Removes text from one line of a document (doesn't do any group processing - permission processing only).
 Undoable updeleteSelection()
          The undoable version of the "deleteSelection" function
 
Methods inherited from class org.biolegato.gdesupport.canvas.textarea.GDETextArea
changePosition, delete, getProtectAlignment, getProtectAmbiguous, getProtectUnambiguous, insert, isProtectionsOn, isSelectedLine, linkCanvas, pdelete, pdeleteSelection
 
Methods inherited from class org.biolegato.gdesupport.canvas.textarea.BLTextArea
addCursorListener, addModeListener, addPopupMenuItem, clearSelection, copy, deleteSelection, getData, getDataModel, getInsertMode, getMaxSX, getMaxSY, getMinSX, getMinSY, insert, isSelectionEmpty, keyReleased, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paintComponent, refreshSize, removePopupMenuItem, sequenceAdded, sequenceChanged, sequenceRemoved, setColourMap, setFont
 
Methods inherited from class org.biolegato.gdesupport.canvas.textarea.BLComponent
column2X, columnSize, maxColumns, maxRows, row2Y, rowSize, X2Column, Y2Row
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, updateUI
 
Methods inherited from class java.awt.Container
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, 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, 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, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, 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, 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 org.biolegato.gdesupport.canvas.GDECanvasObject
copy, getData
 

Field Detail

ugdeTextAreaSelf

public final UndoableGDETextArea ugdeTextAreaSelf
Self-reference for inner classes.

Constructor Detail

UndoableGDETextArea

public UndoableGDETextArea(GDECanvas canvas)
Constructs a new instance of GDETextArea.

Method Detail

changeCase

public void changeCase()
Changes the case of the currently selected sequence (if the sequence is of inconsistent case, the case of the entire sequence is changed to the opposite case of the first character in the sequence.

Specified by:
changeCase in interface GDECanvasObject
Overrides:
changeCase in class GDETextArea

cut

public void cut()
Cuts content from the current Editable object.

Specified by:
cut in interface GDECanvasObject
Overrides:
cut in class GDETextArea

paste

public void paste()
Pastes content into the current Editable object.

Specified by:
paste in interface GDECanvasObject
Overrides:
paste in class GDETextArea

keyTyped

public void keyTyped(java.awt.event.KeyEvent event)
Processes the typing of keys within the text area

Specified by:
keyTyped in interface java.awt.event.KeyListener
Overrides:
keyTyped in class BLTextArea
Parameters:
event - the KeyEvent for the key typed

keyPressed

public void keyPressed(java.awt.event.KeyEvent event)
Processes key presses within the text area

Specified by:
keyPressed in interface java.awt.event.KeyListener
Overrides:
keyPressed in class BLTextArea
Parameters:
event - the KeyEvent for the key pressed

uinsert

public Undoable uinsert(int x,
                        int y,
                        java.lang.String text)
Inserts a string into the textarea's underlying SeqDoc (NOTE: this should ONLY be called by sub-methods)

Parameters:
x - the X co-ordinate (column number) to insert the character at.
y - the Y co-ordinate (row number) to insert the character at.
text - the character to insert.
Returns:
whether or not the insertion was successful.

uinsert

public Undoable uinsert(int x,
                        int y,
                        Cell[] sequences)
Inserts an array of sequences into the textarea's underlying SeqDoc

Parameters:
x - the X co-ordinate (column number) to insert the sequences at.
y - the Y co-ordinate (row number) to insert the sequences at.
sequences - the array of sequences to insert.
Returns:
whether or not the insertion was successful.

udelete

public Undoable udelete(int x,
                        int y,
                        int w,
                        int h)
Removes text from a document.

Parameters:
x - the X-offset/column number to start the deletion from.
y - the Y-offset/line number to delete characters from.
w - the width of the deletion (measured in characters along the X-axis).
h - the height of the deletion (measured in sequences along the Y-axis).
Returns:
whether the deletion was a success.

updelete

public Undoable updelete(int x,
                         int y,
                         int w,
                         int h)
Removes text from one line of a document (doesn't do any group processing - permission processing only).

Parameters:
x - the X-offset/column number to start the deletion from.
y - the Y-offset/line number to delete characters from.
w - the width of the deletion (measured in characters along the X-axis).
Returns:
an undoable object corresponding to the deletion

updeleteSelection

public Undoable updeleteSelection()
The undoable version of the "deleteSelection" function

Returns:
creates an undoable object to undo selection deleteions.

udeleteSelection

public Undoable udeleteSelection()
The undoable version of the "deleteSelection" function

Returns:
creates an undoable object to undo selection deleteions.

uchangePosition

public Undoable uchangePosition(int newColumn,
                                int newRow)
The undoable version of the "changePosition" function

Parameters:
newColumn - the column co-ordinate of the new position.
newRow - the row co-ordinate of the new position.
Returns:
creates an undoable object to undo position changes.

BioLegato 0.7.3 GDE plugin

Copyright © 2008-2010 University of Manitoba.