BioLegato 0.7.3 GDE 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.gdesupport.canvas.GDECanvas
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ListSelectionListener, org.biolegato.core.plugintypes.DataCanvas, org.biolegato.core.properties.PropertiesListener, CursorListener, ModeListener

public class GDECanvas
extends javax.swing.Box
implements org.biolegato.core.plugintypes.DataCanvas, javax.swing.event.ListSelectionListener, CursorListener, 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 joinAction
          Action for joining split canvases
 javax.swing.AbstractAction pasteAction
          The action "Paste"
 javax.swing.AbstractAction redoAction
          The action "Redo"
 javax.swing.AbstractAction undoAction
          The action "Undo"
 
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.
static Cell[] getClipboard()
          Obtains the current contents of the clipboard (null if empty).
 Cell[] getData()
          Returns the current/selected data in the canvas.
 GDEModel getDataModel()
          Passes the current datamodel to any GDE canvas related components
 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)
 void readFile(java.lang.String format, java.io.File currentFile)
          Reads a file into the canvas
 boolean redo()
          Redoes data modification.
 void selectionMade(GDETextArea source)
          Manages mutual exclusion between the textarea and the list
static void setClipboard(Cell[] copy)
          Changes the current contents of the clipboard.
 boolean undo()
          Undoes data modification.
 void valueChanged(javax.swing.event.ListSelectionEvent e)
          Clears the data collector when an item is selected from the sequence list
 void writeFile(java.lang.String format, java.io.File currentFile)
          Writes a file out from the canvas
 
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"


gdeCanvasSelf

public final GDECanvas gdeCanvasSelf
Self-reference for inner classes.

Constructor Detail

GDECanvas

public GDECanvas()
Creates a new instance of BLGDECanvas

Method Detail

getTabName

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

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

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.


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.

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
Clears the data collector when an item is selected from the sequence list

Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener
Parameters:
e - currently ignored

selectionMade

public void selectionMade(GDETextArea source)
Manages mutual exclusion between the textarea and the list

Parameters:
source - the source of the event

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.

getClipboard

public static Cell[] getClipboard()
Obtains the current contents of the clipboard (null if empty).

Returns:
the current contents of the clipboard.

setClipboard

public static void setClipboard(Cell[] copy)
Changes the current contents of the clipboard.

Parameters:
copy - the new content for the clipboard.

getDataModel

public GDEModel getDataModel()
Passes the current datamodel to any GDE canvas related components


getData

public Cell[] getData()
Returns the current/selected data in the canvas.

Returns:
the current data for usage by commands

readFile

public void readFile(java.lang.String format,
                     java.io.File currentFile)
Reads a file into the canvas

Specified by:
readFile in interface org.biolegato.core.plugintypes.DataCanvas
Parameters:
format - the file format to use for parsing the file.
currentFile - the file to read in.

writeFile

public void writeFile(java.lang.String format,
                      java.io.File currentFile)
Writes a file out from the canvas

Specified by:
writeFile in interface org.biolegato.core.plugintypes.DataCanvas
Parameters:
format - the file format to use for writing the file.
currentFile - the file to write out.

BioLegato 0.7.3 GDE plugin

Copyright © 2008-2010 University of Manitoba.