|
BioLegato 0.7.5 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.GDETextArea
public class GDETextArea
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 | |
|---|---|
GDETextArea |
blTextAreaSelf
Self-reference for inner classes. |
protected int |
column
The current column of the caret. |
protected int |
columnWidth
The width of each column in the textarea |
protected Dataset |
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 javax.swing.JPopupMenu |
popup
The right click menu for the text area. |
protected int |
row
The current row of the caret |
protected int |
rowHeight
The height of each row in the textarea |
static java.awt.Color |
SELECTBG
The BACKG colour of selected text |
static java.awt.Color |
SELECTFG
The FOREG colour of selected text |
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 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 | |
|---|---|
GDETextArea(GDECanvas canvas,
Dataset datamodel)
Creates 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. |
protected void |
changePosition(boolean select,
int newx,
int newy)
Updates/moves the cursor to the new position. |
void |
clearSelection()
Clears the current text selection |
int |
columnSize()
Returns the size of one column of the textarea. |
void |
contentsChanged(javax.swing.event.ListDataEvent e)
Called when a field in a sequence is modified. |
void |
copyClipboard()
Used to obtain all of the text selected within the document. |
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 |
void |
deleteSelection()
Used to delete the current selection before an insertion or as part of a deletion. |
boolean |
gdeleteSection()
Used to delete the current selection before an insertion or as part of a deletion. |
int |
getLineLength(int line)
Retrieves the length of a line in the document. |
void |
insert(int x,
int y,
char[] text,
boolean groupinsert)
Inserts a string into the textarea's underlying Dataset NOTE: this is a wrapper method for insert(x, y, data) |
void |
intervalAdded(javax.swing.event.ListDataEvent e)
Called when a sequence is added to a Dataset. |
void |
intervalRemoved(javax.swing.event.ListDataEvent e)
Called when a sequence is removed from a Dataset. |
boolean |
isProtectionsOn(Seq.Type type,
boolean protect_align,
boolean protect_ambig,
boolean protect_uambig,
char[] test,
int start,
int end)
Checks a string against all of a sequence's protection settings. |
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. |
boolean |
pdelete(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). |
protected void |
refreshSize()
Refreshes the size of the textarea (for scroll size purposes) |
protected int |
row2Y(int r)
Converts a row number into a Y co-ordinate |
int |
rowSize()
Returns the size of one row of the textarea. |
void |
setFont(java.awt.Font font)
Updates the font for the canvas (ensures repaint) |
void |
updateLength(int start,
int end)
Updates the internal counter storing the length of the longest line |
void |
writeOut(DataFormat format,
java.lang.Appendable dest)
Writes the selected sequences out to an appendable object |
| 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 int rowHeight
protected int columnWidth
protected boolean insertMode
protected boolean selectionMove
protected boolean selectionMouse
protected int row
protected int column
protected javax.swing.JPopupMenu popup
protected Dataset datamodel
public final GDETextArea blTextAreaSelf
public static final java.awt.Color SELECTFG
public static final java.awt.Color SELECTBG
public static final long serialVersionUID
| Constructor Detail |
|---|
public GDETextArea(GDECanvas canvas,
Dataset datamodel)
canvas - the parent canvas of the text areadatamodel - the data model to view the text from| Method Detail |
|---|
public void copyClipboard()
copyClipboard in interface GDECanvasObjectpublic void paintComponent(java.awt.Graphics gfx)
paintComponent in class javax.swing.JComponentgfx - the graphics instance to paint the window to.public final void setFont(java.awt.Font font)
setFont in class javax.swing.JComponentfont - 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 final void refreshSize()
public void paste()
paste in interface GDECanvasObjectpublic void changeCase()
changeCase in interface GDECanvasObject
public void insert(int x,
int y,
char[] text,
boolean groupinsert)
x - the X co-ordinate (column number) to insert the string at.y - the Y co-ordinate (row number) to insert the string at.text - the string 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 pdelete(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 lines)
public boolean gdeleteSection()
public void deleteSelection()
deleteSelection in interface GDECanvasObjectpublic int getLineLength(int line)
line - the line line to find the length of.
public boolean isProtectionsOn(Seq.Type type,
boolean protect_align,
boolean protect_ambig,
boolean protect_uambig,
char[] test,
int start,
int end)
type - the type of the sequence to test against.protect_align - the status of alignment character protectionprotect_ambig - the status of ambiguous character protectionprotect_uambig - the status of unambiguous character protectiontest - the text to test.start - the start index of text to testend - the end index of text to test
public void intervalAdded(javax.swing.event.ListDataEvent e)
intervalAdded in interface javax.swing.event.ListDataListenere - the list data event corresponding to the additionpublic void contentsChanged(javax.swing.event.ListDataEvent e)
contentsChanged in interface javax.swing.event.ListDataListenere - the list data event corresponding to the modificationpublic void intervalRemoved(javax.swing.event.ListDataEvent e)
intervalRemoved in interface javax.swing.event.ListDataListenere - the list data event corresponding to the deletion
protected void changePosition(boolean select,
int newx,
int newy)
select - whether 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 final void clearSelection()
public final boolean isSelectionEmpty()
protected final int row2Y(int r)
r - the row number
public int rowSize()
public int columnSize()
public void updateLength(int start,
int end)
start - the first offset to examine for the updateend - the last offset to examine for the update
public void writeOut(DataFormat format,
java.lang.Appendable dest)
throws java.io.IOException
writeOut in interface GDECanvasObjectformat - the file format to writedest - the destination of the sequence data
java.io.IOException - throws an IOException if there is any error appending the data
|
BioLegato 0.7.5 GDE plugin | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||