uk.ac.man.bioinf.gui.viewer
Class JAlignmentViewer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--uk.ac.man.bioinf.gui.viewer.JAlignmentViewer
All Implemented Interfaces:
AlignmentListener, AlignmentSelectionListener, EventListener, ImageObserver, MenuContainer, SequenceListener, Serializable
Direct Known Subclasses:
PrintableJAlignmentViewer

public class JAlignmentViewer
extends JComponent
implements AlignmentListener, SequenceListener, AlignmentSelectionListener

JAlignmentViewer.java Created: Tue Mar 14 16:28:59 2000

Version:
$Id: JAlignmentViewer.java,v 1.28 2002/03/08 14:53:57 lord Exp $
Author:
Phillip Lord
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  boolean readonly
           
static String uiClassID
           
 
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
JAlignmentViewer()
           
JAlignmentViewer(SequenceAlignment alignment)
           
 
Method Summary
 void addCursorChangeListener(ChangeListener listener)
           
 void changeOccurred(AlignmentEvent event)
          method signalled after a change has occured to a multiple alignment
 void changeOccurred(SequenceEvent event)
          Method called when a change occurs
 void clearSelection()
           
 void deleteGapsAt(int x, int y, int sizeOfGap)
           
 void deleteGapsAt(SequenceAlignmentPoint point, int sizeOfGap)
           
 void deleteGapsAtCursor(int sizeOfGap)
           
 void ensureSequencePointIsVisible(SequenceAlignmentPoint point)
           
 void extendSelection(SequenceAlignmentPoint point)
           
 AlignmentSelectionRenderer getAlignmentSelectionRenderer()
           
 Rectangle getCellBounds(SequenceAlignmentPoint point)
           
 int getCellHeight()
           
 AlignmentViewerCellRenderer getCellRenderer()
           
 int getCellWidth()
           
 ColorMap getColorMap()
          Returns the current color map.
 SequenceCursor getCursorModel()
           
 FastAlignmentViewerCellRenderer getFastCellRenderer()
           
 SequenceAlignmentPoint getMark()
           
 Dimension getMaximumSize()
           
 Dimension getMinimumSize()
           
 SequenceAlignmentPoint getPoint()
           
 Point getPointAtSequencePoint(int x, int y)
           
 Dimension getPreferredScrollableViewportSize()
           
 Dimension getPreferredSize()
           
 Rectangle getRectangleForSequenceRectangle(SequenceAlignmentRectangle seqRect)
           
 int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
           
 boolean getScrollableTracksViewportHeight()
           
 boolean getScrollableTracksViewportWidth()
           
 int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
           
 AlignmentSelectionModel getSelectionModel()
           
 SequenceAlignment getSequenceAlignment()
           
 SequenceAlignmentPoint getSequencePointAtPoint(int x, int y)
           
 SequenceAlignmentPoint getSequencePointAtPoint(Point point)
           
 String getUIClassID()
           
 SequenceAlignmentRectangle getVisibleSequenceRectangle()
           
 void insertGapsAt(int x, int y, int sizeOfGap)
           
 void insertGapsAt(SequenceAlignmentPoint point, int sizeOfGap)
           
 void insertGapsAtCursor(int sizeOfGap)
           
 boolean isReadonly()
           
 void moveCursor(SequenceAlignmentPoint newPoint)
           
 void moveCursorBeginningOfAlignment()
           
 void moveCursorBeginningOfSequence()
           
 void moveCursorDown(int number)
           
 void moveCursorEndOfAlignment()
           
 void moveCursorEndOfSequence()
           
 void moveCursorLeft(int number)
           
 void moveCursorPageDown()
           
 void moveCursorPageLeft()
           
 void moveCursorPageRight()
           
 void moveCursorPageUp()
           
 void moveCursorRight(int number)
           
 void moveCursorToSequencePoint(int x, int y)
           
 void moveCursorToSequencePoint(SequenceAlignmentPoint point)
           
 void moveCursorUp(int number)
           
 void removeCursorChangeListener(ChangeListener listener)
           
 void setAlignmentSelectionRenderer(AlignmentSelectionRenderer selectionRenderer)
           
 void setCellHeight(int height)
           
 void setCellRenderer(AlignmentViewerCellRenderer renderer)
           
 void setCellWidth(int width)
           
 void setColorMap(ColorMap colorMap)
          Changes the color map and notifies of change.
 void setCursorModel(SequenceCursor cursor)
           
 void setFastCellRenderer(FastAlignmentViewerCellRenderer renderer)
           
 void setMark()
           
 void setPoint(SequenceAlignmentPoint point)
           
 void setReadonly(boolean readonly)
           
 void setSelectionModel(AlignmentSelectionModel selectionModel)
           
 void setSequenceAlignment(SequenceAlignment msa)
           
 void setUI(AlignmentViewerUI ui)
           
 void stopSelection(SequenceAlignmentPoint point)
           
 void updateUI()
           
 void valueChanged(AlignmentSelectionEvent event)
           
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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

uiClassID

public static final String uiClassID
See Also:
Constant Field Values

readonly

protected boolean readonly
Constructor Detail

JAlignmentViewer

public JAlignmentViewer()

JAlignmentViewer

public JAlignmentViewer(SequenceAlignment alignment)
Method Detail

setCellRenderer

public void setCellRenderer(AlignmentViewerCellRenderer renderer)

getCellRenderer

public AlignmentViewerCellRenderer getCellRenderer()

setFastCellRenderer

public void setFastCellRenderer(FastAlignmentViewerCellRenderer renderer)

getFastCellRenderer

public FastAlignmentViewerCellRenderer getFastCellRenderer()

setAlignmentSelectionRenderer

public void setAlignmentSelectionRenderer(AlignmentSelectionRenderer selectionRenderer)

getAlignmentSelectionRenderer

public AlignmentSelectionRenderer getAlignmentSelectionRenderer()

setCellHeight

public void setCellHeight(int height)

getCellHeight

public int getCellHeight()

setCellWidth

public void setCellWidth(int width)

getCellWidth

public int getCellWidth()

getPreferredSize

public Dimension getPreferredSize()
Overrides:
getPreferredSize in class JComponent

getMinimumSize

public Dimension getMinimumSize()
Overrides:
getMinimumSize in class JComponent

getMaximumSize

public Dimension getMaximumSize()
Overrides:
getMaximumSize in class JComponent

setColorMap

public void setColorMap(ColorMap colorMap)
Changes the color map and notifies of change.

Parameters:
colorMap - the new color map

getColorMap

public ColorMap getColorMap()
Returns the current color map.

Returns:
the color map

setCursorModel

public void setCursorModel(SequenceCursor cursor)

getCursorModel

public SequenceCursor getCursorModel()

addCursorChangeListener

public void addCursorChangeListener(ChangeListener listener)

removeCursorChangeListener

public void removeCursorChangeListener(ChangeListener listener)

setPoint

public void setPoint(SequenceAlignmentPoint point)

setMark

public void setMark()

moveCursor

public void moveCursor(SequenceAlignmentPoint newPoint)

moveCursorUp

public void moveCursorUp(int number)

moveCursorDown

public void moveCursorDown(int number)

moveCursorPageUp

public void moveCursorPageUp()

moveCursorPageDown

public void moveCursorPageDown()

moveCursorBeginningOfAlignment

public void moveCursorBeginningOfAlignment()

moveCursorEndOfAlignment

public void moveCursorEndOfAlignment()

moveCursorRight

public void moveCursorRight(int number)

moveCursorLeft

public void moveCursorLeft(int number)

moveCursorPageRight

public void moveCursorPageRight()

moveCursorPageLeft

public void moveCursorPageLeft()

moveCursorBeginningOfSequence

public void moveCursorBeginningOfSequence()

moveCursorEndOfSequence

public void moveCursorEndOfSequence()

moveCursorToSequencePoint

public void moveCursorToSequencePoint(int x,
                                      int y)

moveCursorToSequencePoint

public void moveCursorToSequencePoint(SequenceAlignmentPoint point)

getPoint

public SequenceAlignmentPoint getPoint()

getMark

public SequenceAlignmentPoint getMark()

getSequencePointAtPoint

public SequenceAlignmentPoint getSequencePointAtPoint(int x,
                                                      int y)

getSequencePointAtPoint

public SequenceAlignmentPoint getSequencePointAtPoint(Point point)

getPointAtSequencePoint

public Point getPointAtSequencePoint(int x,
                                     int y)

getRectangleForSequenceRectangle

public Rectangle getRectangleForSequenceRectangle(SequenceAlignmentRectangle seqRect)

getCellBounds

public Rectangle getCellBounds(SequenceAlignmentPoint point)

ensureSequencePointIsVisible

public void ensureSequencePointIsVisible(SequenceAlignmentPoint point)

setReadonly

public void setReadonly(boolean readonly)

isReadonly

public boolean isReadonly()

insertGapsAt

public void insertGapsAt(SequenceAlignmentPoint point,
                         int sizeOfGap)
                  throws SequenceVetoException,
                         AlignmentVetoException,
                         ReadonlyException
SequenceVetoException
AlignmentVetoException
ReadonlyException

insertGapsAt

public void insertGapsAt(int x,
                         int y,
                         int sizeOfGap)
                  throws SequenceVetoException,
                         AlignmentVetoException,
                         ReadonlyException
SequenceVetoException
AlignmentVetoException
ReadonlyException

deleteGapsAt

public void deleteGapsAt(SequenceAlignmentPoint point,
                         int sizeOfGap)
                  throws NoGapAtThisPositionException,
                         SequenceVetoException,
                         AlignmentVetoException,
                         ReadonlyException
NoGapAtThisPositionException
SequenceVetoException
AlignmentVetoException
ReadonlyException

deleteGapsAt

public void deleteGapsAt(int x,
                         int y,
                         int sizeOfGap)
                  throws NoGapAtThisPositionException,
                         SequenceVetoException,
                         AlignmentVetoException,
                         ReadonlyException
NoGapAtThisPositionException
SequenceVetoException
AlignmentVetoException
ReadonlyException

insertGapsAtCursor

public void insertGapsAtCursor(int sizeOfGap)
                        throws SequenceVetoException,
                               AlignmentVetoException,
                               ReadonlyException
SequenceVetoException
AlignmentVetoException
ReadonlyException

deleteGapsAtCursor

public void deleteGapsAtCursor(int sizeOfGap)
                        throws NoGapAtThisPositionException,
                               SequenceVetoException,
                               AlignmentVetoException,
                               ReadonlyException
NoGapAtThisPositionException
SequenceVetoException
AlignmentVetoException
ReadonlyException

getVisibleSequenceRectangle

public SequenceAlignmentRectangle getVisibleSequenceRectangle()

getSelectionModel

public AlignmentSelectionModel getSelectionModel()

setSelectionModel

public void setSelectionModel(AlignmentSelectionModel selectionModel)

extendSelection

public void extendSelection(SequenceAlignmentPoint point)

stopSelection

public void stopSelection(SequenceAlignmentPoint point)

clearSelection

public void clearSelection()

setSequenceAlignment

public void setSequenceAlignment(SequenceAlignment msa)

getSequenceAlignment

public SequenceAlignment getSequenceAlignment()

changeOccurred

public void changeOccurred(AlignmentEvent event)
Description copied from interface: AlignmentListener
method signalled after a change has occured to a multiple alignment

Specified by:
changeOccurred in interface AlignmentListener
Parameters:
event - the event type

changeOccurred

public void changeOccurred(SequenceEvent event)
Description copied from interface: SequenceListener
Method called when a change occurs

Specified by:
changeOccurred in interface SequenceListener
Parameters:
event -

valueChanged

public void valueChanged(AlignmentSelectionEvent event)
Specified by:
valueChanged in interface AlignmentSelectionListener

getPreferredScrollableViewportSize

public Dimension getPreferredScrollableViewportSize()

getScrollableUnitIncrement

public int getScrollableUnitIncrement(Rectangle visibleRect,
                                      int orientation,
                                      int direction)

getScrollableBlockIncrement

public int getScrollableBlockIncrement(Rectangle visibleRect,
                                       int orientation,
                                       int direction)

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()

getUIClassID

public String getUIClassID()
Overrides:
getUIClassID in class JComponent

setUI

public void setUI(AlignmentViewerUI ui)

updateUI

public void updateUI()
Overrides:
updateUI in class JComponent