BioLegato 0.7.0 GDE Canvas plugin

org.biolegato.gdesupport.canvas
Class GDECanvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.Box
                  extended by org.biolegato.core.plugintypes.DataCanvas
                      extended by org.biolegato.gdesupport.canvas.GDECanvas
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener, org.biolegato.core.properties.PropertiesListener, CursorListener, ModeListener

public class GDECanvas
extends org.biolegato.core.plugintypes.DataCanvas
implements CursorListener, java.awt.event.FocusListener, ModeListener, org.biolegato.core.properties.PropertiesListener

The GDE-style sequence-based canvas class

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

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.Box
javax.swing.Box.AccessibleBox, javax.swing.Box.Filler
 
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
 javax.swing.AbstractAction changeCaseAction
          The action "Change Case"
 javax.swing.AbstractAction copyAction
          The action "Copy"
 javax.swing.AbstractAction cutAction
          The action "Cut"
 GDECanvas gdeCanvasSelf
          Self-reference for inner classes.
 javax.swing.AbstractAction groupAction
          Action for grouping sequences in the canvas
 javax.swing.AbstractAction joinAction
          Action for joining split canvases
 javax.swing.AbstractAction pasteAction
          The action "Paste"
 javax.swing.AbstractAction redoAction
          The action "Redo"
 javax.swing.AbstractAction selectAllAction
          The action "Select All"
 javax.swing.AbstractAction undoAction
          The action "Undo"
 javax.swing.AbstractAction ungroupAction
          Action for ungrouping sequences in the canvas
 
Fields inherited from class javax.swing.Box
accessibleContext
 
Fields inherited from class javax.swing.JComponent
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
GDECanvas()
          Creates a new instance of BLGDECanvas
 
Method Summary
 void addUndo(Undoable undo)
          Adds an undoable object to the undo stack.
 void copy()
          Copies content from the current Editable object to the clipboads.
 void cursorChange(BLTextArea source, int column, int row)
          Receives cursor updates for use in the status bar.
 void cut()
          Cuts content from the current Editable object to the clipboads.
 void focusGained(java.awt.event.FocusEvent event)
          This function is used to determine whether to return the data in the JTextArea or JList when getData is called.
 void focusLost(java.awt.event.FocusEvent event)
          This function is currently unused.
 org.biolegato.core.data.sequence.Sequence[] getData()
          Returns the current/selected data in the canvas.
 java.lang.String getTabName()
          Returns the name to display in the canvas tab for
 void insertionMode(boolean mode)
          Receives insertion mode change updates for use in the status bar.
 void paste()
          Pastes the current clipboard into the current Editable object.
 void propertiesUpdate(java.lang.String key, java.lang.String value)
          Used to intercept font size changes (since the font size is stored in the properties)
 boolean redo()
          Redoes data modification.
 void selectAll()
          Selects all the sequences within the canvas.
 void stateChanged(javax.swing.event.ChangeEvent event)
          Refreshes the canvas on tab changes.
 boolean undo()
          Undoes data modification.
 
Methods inherited from class org.biolegato.core.plugintypes.DataCanvas
getAllData
 
Methods inherited from class javax.swing.Box
createGlue, createHorizontalBox, createHorizontalGlue, createHorizontalStrut, createRigidArea, createVerticalBox, createVerticalGlue, createVerticalStrut, getAccessibleContext, setLayout
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, paintComponent, 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, setFont, 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, 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

joinAction

public final javax.swing.AbstractAction joinAction
Action for joining split canvases


cutAction

public final javax.swing.AbstractAction cutAction
The action "Cut"


copyAction

public final javax.swing.AbstractAction copyAction
The action "Copy"


pasteAction

public final javax.swing.AbstractAction pasteAction
The action "Paste"


undoAction

public final javax.swing.AbstractAction undoAction
The action "Undo"


redoAction

public final javax.swing.AbstractAction redoAction
The action "Redo"


changeCaseAction

public final javax.swing.AbstractAction changeCaseAction
The action "Change Case"


selectAllAction

public final javax.swing.AbstractAction selectAllAction
The action "Select All"


groupAction

public final javax.swing.AbstractAction groupAction
Action for grouping sequences in the canvas


ungroupAction

public final javax.swing.AbstractAction ungroupAction
Action for ungrouping sequences in the canvas


gdeCanvasSelf

public final GDECanvas gdeCanvasSelf
Self-reference for inner classes.

Constructor Detail

GDECanvas

public GDECanvas()
Creates a new instance of BLGDECanvas

Method Detail

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent event)
Refreshes the canvas on tab changes.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener
Overrides:
stateChanged in class org.biolegato.core.plugintypes.DataCanvas
Parameters:
event - used to determine whether or not to refresh

getData

public org.biolegato.core.data.sequence.Sequence[] getData()
Returns the current/selected data in the canvas.

Overrides:
getData in class org.biolegato.core.plugintypes.DataCanvas
Returns:
the current data for usage by commands

getTabName

public java.lang.String getTabName()
Returns the name to display in the canvas tab for

Specified by:
getTabName in class org.biolegato.core.plugintypes.DataCanvas
Returns:
"GDE"

focusGained

public void focusGained(java.awt.event.FocusEvent event)
This function is used to determine whether to return the data in the JTextArea or JList when getData is called.

Specified by:
focusGained in interface java.awt.event.FocusListener
Parameters:
event - the focus event to process

focusLost

public void focusLost(java.awt.event.FocusEvent event)
This function is currently unused.

Specified by:
focusLost in interface java.awt.event.FocusListener
Parameters:
event - the focus event to process

copy

public void copy()
Copies content from the current Editable object to the clipboads.


cut

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


paste

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


selectAll

public void selectAll()
Selects all the sequences within the canvas.


cursorChange

public void cursorChange(BLTextArea source,
                         int column,
                         int row)
Receives cursor updates for use in the status bar.

Specified by:
cursorChange in interface CursorListener
Parameters:
source - the source of the cursor change.
column - the new column of the cursor.
row - the new row of the cursor.

insertionMode

public void insertionMode(boolean mode)
Receives insertion mode change updates for use in the status bar.

Specified by:
insertionMode in interface ModeListener
Parameters:
mode - the new insertion mode status.

propertiesUpdate

public void propertiesUpdate(java.lang.String key,
                             java.lang.String value)
Used to intercept font size changes (since the font size is stored in the properties)

Specified by:
propertiesUpdate in interface org.biolegato.core.properties.PropertiesListener
Parameters:
key - the key of the property changed.
value - the new value of the property.

undo

public boolean undo()
Undoes data modification.

Returns:
whether or not the undo was successful.

redo

public boolean redo()
Redoes data modification.

Returns:
whether or not the redo was successful.

addUndo

public void addUndo(Undoable undo)
Adds an undoable object to the undo stack.

Parameters:
undo - the object to add to the stack.

BioLegato 0.7.0 GDE Canvas plugin

Copyright © 2008-2010 University of Manitoba.