|
BioLegato 0.7.3 GDE plugin | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
org.biolegato.gdesupport.canvas.textarea.BLComponent
org.biolegato.gdesupport.canvas.textarea.BLTextArea
public class BLTextArea
A general canvas with more functionality support than JTextArea. This canvas was originally created to support the rectangular selection model, and has since supported rectangular selections, different colour schemes, sequence documents, and many other features. Please add more generic feature support as necessary. Also if you wish to add any functionality or handling specific to a plugin, please feel free to subclass this textarea.
| 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 | |
|---|---|
BLTextArea |
blTextAreaSelf
Self-reference for inner classes. |
protected int |
column
The current column of the caret. |
protected ColourMap |
currentMap
Handles printing text |
protected java.util.List<CursorListener> |
cursorListeners
Linked list to store all cursor listeners |
protected GDEModel |
datamodel
Used for the relationship between the data model and the text area |
protected boolean |
insertMode
If true new text will overwrite existing text. |
protected java.awt.Color |
invalidzone
The colour of invalid areas in the textarea. |
protected java.util.List<ModeListener> |
modeListeners
Linked list to store all mode change listeners |
protected javax.swing.JPopupMenu |
popup
The right click menu for the text area. |
protected int |
row
The current row of the caret |
protected boolean |
selectionMouse
Used to track mouse holds and releases. |
protected boolean |
selectionMove
Used to track the shift key. |
static long |
serialVersionUID
This constant is used for serialization purposes. |
| 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 | |
|---|---|
BLTextArea(GDEModel datamodel)
Creates a new instance of BLTextArea |
|
| Method Summary | |
|---|---|
void |
addCursorListener(CursorListener listener)
Adds a cursor listener to the BLTextArea. |
void |
addModeListener(ModeListener listener)
Adds a cursor listener to the BLTextArea. |
void |
addPopupMenuItem(javax.swing.JMenuItem act)
Adds an item to the BLTextArea's right-click popup menu. |
protected void |
changePosition(boolean select,
int newx,
int newy)
Updates/moves the cursor to the new position. |
void |
clearSelection()
Clears the current text selection |
void |
copy()
Copies content from the current Editable object. |
void |
cut()
Cuts content from the current Editable object. |
boolean |
delete(int x,
int y,
int w,
int h)
Deletes characters from the textarea's underlying Dataset NOTE: deletions are performed in a sequential manner |
boolean |
deleteSelection()
Used to delete the current selection before an insertion or as part of a deletion. |
Cell[] |
getData()
Used to obtain all of the text selected within the document. |
GDEModel |
getDataModel()
Returns the Dataset associated with the BLTextArea |
boolean |
getInsertMode()
Returns the insertion mode status of the textarea. |
protected int |
getMaxSX()
Gets the maximum X co-ordinate of the selection area. |
protected int |
getMaxSY()
Gets the maximum Y co-ordinate of the selection area. |
protected int |
getMinSX()
Gets the minimum X co-ordinate of the selection area. |
protected int |
getMinSY()
Gets the minimum Y co-ordinate of the selection area. |
boolean |
insert(int col,
int y,
Cell[] data)
Inserts an array of sequences into the textarea's underlying Dataset |
boolean |
insert(int col,
int y,
java.lang.String data)
Inserts a string into the textarea's underlying Dataset NOTE: this is a wrapper method for insert(x, y, data) |
protected boolean |
isSelectedLine(int y)
This function is used to test if a line is selected. |
boolean |
isSelectionEmpty()
Tests if the selection shape is empty |
void |
keyPressed(java.awt.event.KeyEvent event)
Processes key presses within the text area |
void |
keyReleased(java.awt.event.KeyEvent event)
Processes key releases within the text area |
void |
keyTyped(java.awt.event.KeyEvent event)
Processes the typing of keys within the text area |
void |
mouseClicked(java.awt.event.MouseEvent event)
Handles mouse clicks. |
void |
mouseDragged(java.awt.event.MouseEvent event)
Handles mouse drags. |
void |
mouseEntered(java.awt.event.MouseEvent event)
Handles the mouse entering the component. |
void |
mouseExited(java.awt.event.MouseEvent event)
Handles the mouse exiting the component. |
void |
mouseMoved(java.awt.event.MouseEvent event)
Handles mouse movements. |
void |
mousePressed(java.awt.event.MouseEvent event)
Handles mouse button presses. |
void |
mouseReleased(java.awt.event.MouseEvent event)
Handles mouse button releases. |
void |
paintComponent(java.awt.Graphics gfx)
Paints the current textarea (this uses the current clip bounds to determine the area to paint. |
void |
paste()
Pastes content into the current Editable object. |
protected void |
refreshSize()
Refreshes the size of the textarea (for scroll size purposes) |
void |
removePopupMenuItem(javax.swing.JMenuItem act)
Removes an item from the BLTextArea's right-click popup menu. |
void |
sequenceAdded(GDEModel source,
int index,
Cell sequence)
Called when a sequence is added to a Dataset. |
void |
sequenceChanged(GDEModel source,
int index,
Cell sequence,
java.lang.String key)
Called when a field in a sequence is modified. |
void |
sequenceRemoved(GDEModel source,
int index,
Cell sequence)
Called when a sequence is removed from a Dataset. |
void |
setColourMap(ColourMap newMap)
Changes the current colour map for unselected text. |
void |
setFont(java.awt.Font font)
Updates the font for the canvas (ensures repaint) |
| 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 |
| Field Detail |
|---|
protected boolean insertMode
protected boolean selectionMove
protected boolean selectionMouse
protected int row
protected int column
protected ColourMap currentMap
protected javax.swing.JPopupMenu popup
protected java.util.List<CursorListener> cursorListeners
protected java.util.List<ModeListener> modeListeners
protected GDEModel datamodel
protected final java.awt.Color invalidzone
public final BLTextArea blTextAreaSelf
public static final long serialVersionUID
| Constructor Detail |
|---|
public BLTextArea(GDEModel datamodel)
| Method Detail |
|---|
public void addCursorListener(CursorListener listener)
listener - the cursor listener to add.public void addModeListener(ModeListener listener)
listener - the cursor listener to add.public GDEModel getDataModel()
public void setColourMap(ColourMap newMap)
newMap - the colour map to usepublic Cell[] getData()
public void paintComponent(java.awt.Graphics gfx)
paintComponent in class javax.swing.JComponentgfx - the graphics instance to paint the window to.public void setFont(java.awt.Font font)
setFont in class BLComponentfont - the new font to handle.public void keyTyped(java.awt.event.KeyEvent event)
keyTyped in interface java.awt.event.KeyListenerevent - the KeyEvent for the key typedpublic void keyPressed(java.awt.event.KeyEvent event)
keyPressed in interface java.awt.event.KeyListenerevent - the KeyEvent for the key pressedpublic void keyReleased(java.awt.event.KeyEvent event)
keyReleased in interface java.awt.event.KeyListenerevent - the KeyEvent for the key releasedpublic void mouseClicked(java.awt.event.MouseEvent event)
mouseClicked in interface java.awt.event.MouseListenerevent - the MouseEvent object corresponding to the click.public void mousePressed(java.awt.event.MouseEvent event)
mousePressed in interface java.awt.event.MouseListenerevent - the MouseEvent object corresponding to the press.public void mouseReleased(java.awt.event.MouseEvent event)
mouseReleased in interface java.awt.event.MouseListenerevent - the MouseEvent object corresponding to the release.public void mouseEntered(java.awt.event.MouseEvent event)
mouseEntered in interface java.awt.event.MouseListenerevent - the MouseEvent object corresponding to the enter.public void mouseExited(java.awt.event.MouseEvent event)
mouseExited in interface java.awt.event.MouseListenerevent - the MouseEvent object corresponding to the exit.public void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged in interface java.awt.event.MouseMotionListenerevent - the MouseEvent object corresponding to the drag.public void mouseMoved(java.awt.event.MouseEvent event)
mouseMoved in interface java.awt.event.MouseMotionListenerevent - the MouseEvent object corresponding to the movement.protected void refreshSize()
refreshSize in class BLComponentpublic void addPopupMenuItem(javax.swing.JMenuItem act)
act - the menu item to add.public void removePopupMenuItem(javax.swing.JMenuItem act)
act - the menu item to remove.public void copy()
public void cut()
public void paste()
public boolean insert(int col,
int y,
java.lang.String data)
x - the X co-ordinate (column number) to insert the string at.y - the Y co-ordinate (row number) to insert the string at.data - the string to insert.
public boolean insert(int col,
int y,
Cell[] data)
x - the X co-ordinate (column number) to insert the sequences at.y - the Y co-ordinate (row number) to insert the sequences at.data - the array of sequences to insert.
public boolean delete(int x,
int y,
int w,
int h)
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).
public boolean deleteSelection()
public boolean getInsertMode()
public void sequenceAdded(GDEModel source,
int index,
Cell sequence)
sequenceAdded in interface GDEModelListenerindex - the location the sequence was added.sequence - the sequence added.source - the source of the sequence insertion event.
public void sequenceChanged(GDEModel source,
int index,
Cell sequence,
java.lang.String key)
sequenceChanged in interface GDEModelListenerindex - the location of the sequence.sequence - the sequence modified.key - the value modified.source - the source of the sequence alteration message.
public void sequenceRemoved(GDEModel source,
int index,
Cell sequence)
sequenceRemoved in interface GDEModelListenerindex - the location (line number) where the sequence was removed from.sequence - the sequence removed from the SeDatasetsource - the source of the sequence removal message.
protected void changePosition(boolean select,
int newx,
int newy)
select - whether or not the position should maintain selection status (i.e. true for SHIFT key).newx - the column co-ordinate of the new position.newy - the row co-ordinate of the new position.public void clearSelection()
public boolean isSelectionEmpty()
protected int getMinSX()
protected int getMaxSX()
protected int getMinSY()
protected int getMaxSY()
protected boolean isSelectedLine(int y)
y - the Y co-ordinate (or line number) to test.
|
BioLegato 0.7.3 GDE plugin | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||