BioLegato 0.7.0 GDE Canvas plugin

org.biolegato.gdesupport.canvas.list
Class GDEList

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JList
                  extended by org.biolegato.gdesupport.canvas.list.GDEList
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.Scrollable, Editable

public class GDEList
extends javax.swing.JList
implements java.awt.event.MouseListener, java.awt.event.FocusListener, Editable

The JList of sequences in the GDE canvas.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JList
javax.swing.JList.AccessibleJList
 
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 getInfoAction
          The menu item "Get info..."
protected  javax.swing.JPopupMenu popup
          The right click menu for the GDE sequence list.
 javax.swing.AbstractAction selectByNameAction
          The abstract action "Select sequence by name"
 javax.swing.AbstractAction selectGroupAction
          The menu item "Select group"
 
Fields inherited from class javax.swing.JList
HORIZONTAL_WRAP, VERTICAL, VERTICAL_WRAP
 
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
GDEList(GDECanvas canvas)
          Constructs a new GDEList
 
Method Summary
 void addPopupMenuItem(javax.swing.JMenuItem item)
          Adds an item to the GDEList's popup menu
 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.
 int column2X(int c)
          Converts a column number into a X co-ordinate
 void copy()
          Copies content from the current Editable object.
 void cut()
          Cuts content from the current Editable object.
 void delete()
          Displays a window to edit the currently selected sequence's properties
 void focusGained(java.awt.event.FocusEvent e)
          Used to control list display (when focused the list is colourful)
 void focusLost(java.awt.event.FocusEvent e)
          Used to control list display (when not focused the list is greyed out)
 org.biolegato.core.data.sequence.Sequence[] getData()
          Returns the currently selected data in the list.
 void getInfo()
          Displays a window to edit the currently selected sequence's properties
 SequenceListModel getListModel()
          Returns the current list model.
 void mouseClicked(java.awt.event.MouseEvent event)
          Checks for double clicks.
 void mouseEntered(java.awt.event.MouseEvent event)
          Currently does nothing
 void mouseExited(java.awt.event.MouseEvent event)
          Currently does nothing
 void mousePressed(java.awt.event.MouseEvent event)
          Checks for right clicks.
 void mouseReleased(java.awt.event.MouseEvent event)
          Checks for right clicks.
 void paste()
          Pastes content into the current Editable object.
 int row2Y(int r)
          Converts a row number into a Y co-ordinate
 void selectAll()
          Selects all the sequences within the list.
 void selectGroup()
          Selects the group members of the currently selected sequence(s)
 void setFont(java.awt.Font font)
          Updates the font for the canvas (ensures repaint)
 int X2Column(int X)
          Converts a X co-ordinate into a column number
 int Y2Row(int Y)
          Converts a Y co-ordinate into a row number
 
Methods inherited from class javax.swing.JList
addListSelectionListener, addSelectionInterval, clearSelection, createSelectionModel, ensureIndexIsVisible, fireSelectionValueChanged, getAccessibleContext, getAnchorSelectionIndex, getCellBounds, getCellRenderer, getDragEnabled, getFirstVisibleIndex, getFixedCellHeight, getFixedCellWidth, getLastVisibleIndex, getLayoutOrientation, getLeadSelectionIndex, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getModel, getNextMatch, getPreferredScrollableViewportSize, getPrototypeCellValue, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedIndex, getSelectedIndices, getSelectedValue, getSelectedValues, getSelectionBackground, getSelectionForeground, getSelectionMode, getSelectionModel, getToolTipText, getUI, getUIClassID, getValueIsAdjusting, getVisibleRowCount, indexToLocation, isSelectedIndex, isSelectionEmpty, locationToIndex, paramString, removeListSelectionListener, removeSelectionInterval, setCellRenderer, setDragEnabled, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setListData, setListData, setModel, setPrototypeCellValue, setSelectedIndex, setSelectedIndices, setSelectedValue, setSelectionBackground, setSelectionForeground, setSelectionInterval, setSelectionMode, setSelectionModel, setUI, setValueIsAdjusting, setVisibleRowCount, updateUI
 
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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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
 
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

popup

protected javax.swing.JPopupMenu popup
The right click menu for the GDE sequence list.


selectGroupAction

public final javax.swing.AbstractAction selectGroupAction
The menu item "Select group"


getInfoAction

public final javax.swing.AbstractAction getInfoAction
The menu item "Get info..."


selectByNameAction

public final javax.swing.AbstractAction selectByNameAction
The abstract action "Select sequence by name"

Constructor Detail

GDEList

public GDEList(GDECanvas canvas)
Constructs a new GDEList

Method Detail

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent event)
Checks for double clicks. On a double click, this method opens up a sequence properties window.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
event - the mouse event to check for the double click.

mousePressed

public void mousePressed(java.awt.event.MouseEvent event)
Checks for right clicks. On a right click, this method opens up a popup menu

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
event - the mouse event to check for the right click.

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent event)
Checks for right clicks. On a right click, this method opens up a popup menu

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
event - the mouse event to check for the right click.

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent event)
Currently does nothing

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
event - ignored.

mouseExited

public void mouseExited(java.awt.event.MouseEvent event)
Currently does nothing

Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
event - ignored.

row2Y

public int row2Y(int r)
Converts a row number into a Y co-ordinate

Parameters:
r - the row number
Returns:
the corresponding Y value

column2X

public int column2X(int c)
Converts a column number into a X co-ordinate

Parameters:
c - the column number
Returns:
the corresponding X value

Y2Row

public int Y2Row(int Y)
Converts a Y co-ordinate into a row number

Parameters:
Y - the Y value
Returns:
the corresponding row number

X2Column

public int X2Column(int X)
Converts a X co-ordinate into a column number

Parameters:
X - the X value
Returns:
the corresponding column number

copy

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

Specified by:
copy in interface Editable

cut

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

Specified by:
cut in interface Editable

paste

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

Specified by:
paste in interface Editable

selectAll

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


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.


setFont

public void setFont(java.awt.Font font)
Updates the font for the canvas (ensures repaint)

Overrides:
setFont in class javax.swing.JComponent
Parameters:
font - the new font to handle.

addPopupMenuItem

public void addPopupMenuItem(javax.swing.JMenuItem item)
Adds an item to the GDEList's popup menu

Parameters:
item - the menu item to add.

getInfo

public void getInfo()
Displays a window to edit the currently selected sequence's properties


delete

public void delete()
Displays a window to edit the currently selected sequence's properties


focusGained

public void focusGained(java.awt.event.FocusEvent e)
Used to control list display (when focused the list is colourful)

Specified by:
focusGained in interface java.awt.event.FocusListener
Parameters:
e - the focus event object.

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Used to control list display (when not focused the list is greyed out)

Specified by:
focusLost in interface java.awt.event.FocusListener
Parameters:
e - the focus event object.

getListModel

public SequenceListModel getListModel()
Returns the current list model.

Returns:
the current sequence list model.

getData

public org.biolegato.core.data.sequence.Sequence[] getData()
Returns the currently selected data in the list.

Returns:
the current data for usage by commands

selectGroup

public void selectGroup()
Selects the group members of the currently selected sequence(s)


BioLegato 0.7.0 GDE Canvas plugin

Copyright © 2008-2010 University of Manitoba.