|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel org.emboss.jemboss.editor.GraphicSequenceCollection
This class can be used to get a grapical representation of a collection of sequences.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected java.util.Hashtable |
colorScheme
Colour scheme to use |
protected boolean |
drawBlackBox
draw black square around residues |
protected boolean |
drawColorBox
colour residues |
protected boolean |
drawNumber
draw sequence position number |
protected boolean |
drawSequence
draw the sequence |
protected java.util.Vector |
graphicName
Vector containing graphical names of sequences |
protected java.util.Vector |
graphicSequence
Vector containing graphical sequences |
private int |
hgt
|
protected javax.swing.JScrollPane |
jspSequence
sequence scrollpane |
private int |
len
|
private Matrix |
mat
scoring matrix |
protected int |
MAXSEQLENGTH
longest sequence length |
protected SequenceJPanel |
numberDraw
panel for sequence numbers |
private int |
numResiduePerLine
number of residues on each line for print |
private PlotConsensus |
pc
Consensus plot |
private javax.swing.Box |
plotconsSeqBox
container for consensus plot |
private int |
plotConStrut
gap between sequences and consensus plot |
private boolean |
prettPlot
draw as per prettplot |
private PrettyPlotJFrame |
prettyPlot
pretty plot values |
private java.util.Vector |
removedSeqs
Vector of sequences removed from panel |
protected javax.swing.Box |
seqBox
container for sequences |
protected javax.swing.Box |
seqNameBox
container for sequence names |
private javax.swing.JPanel |
seqNamePanel
sequence name panel |
protected java.util.Vector |
seqs
Vector containing Sequence objects |
Fields inherited from class javax.swing.JPanel |
|
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.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
GraphicSequenceCollection(java.util.Vector seqs,
java.util.Hashtable colorScheme,
javax.swing.JScrollPane jspSequence,
boolean drawSequence,
boolean drawBlackBox,
boolean drawColorBox,
boolean drawNumber,
javax.swing.JTextField statusField)
|
|
GraphicSequenceCollection(java.util.Vector seqs,
javax.swing.JScrollPane jspSequence,
boolean drawSequence,
boolean drawBlackBox,
boolean drawColorBox,
boolean drawNumber,
javax.swing.JTextField statusField)
|
Method Summary | |
protected void |
addAnnotationSequence(Sequence s)
|
protected void |
addSequence(Sequence seq,
boolean addToSequences,
int ypad,
int fontSize)
Add a sequence to the sequence collection display and to the collection of sequences (seqs) with a specified y-padding. |
protected void |
addSequence(Sequence seq,
boolean addToSequences,
int ypad,
int fontSize,
int index)
Add a sequence at a particular index to the sequence collection display and to the collection of sequences (seqs) with a specified y-padding. |
protected void |
deleteConsensusPlot()
Remove the consensus plot from the sequence editor |
protected void |
deleteSequence(java.lang.String name)
Delete a sequence from the sequence collection display and resize the sequence panel display |
protected void |
drawNumber()
|
void |
drawSequences(java.awt.Graphics2D g2d,
java.awt.print.PageFormat format,
int pageIndex)
Draws the sequences for printing |
void |
drawSequences(java.awt.Graphics2D g2d,
java.awt.print.PageFormat format,
int pageIndex,
int numResPerLine)
Draws the sequences for printing |
private int |
findMiddle(int newResPos,
int viewWidth,
java.lang.String pat)
Locate the center of a vieport view that contains the defined position to display |
int |
findPattern(java.lang.String pat,
int oldResPosition,
boolean wrapAround)
Search sequences for a pattern and highlight matches. |
protected java.awt.Color |
getColor(java.lang.String s,
int pos,
java.lang.String seqName)
Determine the colour of a residue at a given position. |
protected Sequence |
getConsensusSequence()
Get the consensus sequence |
int |
getFontSize()
Get the font size used to display the sequences in the editor return font size |
java.util.Vector |
getGraphicSequence()
Get the vector containing the SequenceJPanel objects |
java.awt.Dimension |
getImageableSize(int numResPerLine)
Get the imageable size. |
int |
getMaxSeqLength()
Get the longest sequence length |
java.lang.String |
getName(int i)
|
int |
getNameHeight()
Get the sequence name panel height |
java.awt.Dimension |
getNameViewSize()
Get the sequence name view size |
int |
getNameWidth()
Get the sequence name panel width |
int |
getNumberPages(java.awt.print.PageFormat format)
Get the number of pages to print the alignment in a given format |
int |
getNumberPages(java.awt.print.PageFormat format,
int numResPerLine)
Get the number of pages to print the alignment in a given format and with a given number of residues per line |
protected int |
getNumberSequences()
Get the number of sequences |
int |
getPanelHeight()
Get the sequence panel height |
java.awt.Dimension |
getPanelSize()
Get the sequence view size |
int |
getPanelWidth()
Get the sequence panel width |
java.awt.Dimension |
getPreferredScrollableViewportSize()
Override for scrollable interface |
protected java.awt.Color |
getPrettyBackground(java.awt.Color textColour)
Determine the colour of a residue background |
int |
getResiduesPerLine(java.awt.print.PageFormat format)
Get the number residues per line |
int |
getResiduesPerPage(java.awt.print.PageFormat format,
int numResPerLine)
Get the number residues per page |
int |
getScrollableBlockIncrement(java.awt.Rectangle r,
int orientation,
int direction)
Override for scrollable interface |
boolean |
getScrollableTracksViewportHeight()
Override for scrollable interface |
boolean |
getScrollableTracksViewportWidth()
Override for scrollable interface |
int |
getScrollableUnitIncrement(java.awt.Rectangle r,
int orientation,
int direction)
Override for scrollable interface |
protected java.util.Vector |
getSequenceCollection()
Get the vector of Sequences |
protected java.awt.Point |
getViewPosition()
Get the position of the sequence JViewPort |
protected java.awt.Rectangle |
getViewRect()
Get the Rectangle being displayed by the sequence JViewPort |
java.awt.Dimension |
getViewSize()
Get the sequence view size |
protected void |
idSort()
Sorts the sequences and displays them by their id's |
protected boolean |
isPrettyBox()
Determine if the identities are to be boxed |
static void |
main(java.lang.String[] args)
|
protected void |
moveSequence(java.lang.String name,
int i)
Move a sequence to a new position |
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat format,
int pageIndex)
Used to print the sequence alignment |
private Sequence |
removeSequence(java.lang.String name)
Remove a sequence from the editor display |
private int |
searchSequences(int startSearch,
java.lang.String pat)
Search the sequences for the position in that matches the given pattern to search for. |
void |
setColorScheme(java.util.Hashtable colourTable)
Set the colour scheme to use |
void |
setDrawBoxes(boolean drawBlackBox)
Draw the boxes around the residues of each sequence |
void |
setDrawColor(boolean drawColorBox)
Draw the residue colours in each sequence |
void |
setFontSizeForCollection(int fs)
Set the font size of the sequences in the editor |
void |
setJScrollPaneViewportView()
Force display in the viewport |
protected void |
setMatrix(Matrix mat)
|
protected void |
setMaxSeqLength()
Calculate the longest sequence length |
protected void |
setMaxSequenceLength(int max)
Set the longest sequence length |
void |
setNamePanelWidth(int x)
Set the sequence name panel width |
protected void |
setNumberOfResiduesPerLine(int numResiduePerLine)
Set the number of residues per line to user setting |
protected void |
setNumberSize()
Set the size of the sequence number panel |
void |
setPrettyPlot(boolean bpretty,
PrettyPlotJFrame prettyPlot)
Display the sequences as per emboss prettyplot colours |
protected void |
setSequenceLock(boolean llock)
Lock/group the sequences |
protected void |
showConsensusPlot(java.io.File matrix,
int wsize)
Calculate and display the consensus plot |
protected void |
showConsensusPlot(Matrix mat,
int wsize)
Calculate and display the consensus plot |
protected int |
testUpAndDown(int pos,
Sequence seq)
|
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
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, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, 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, 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 |
private java.util.Vector removedSeqs
protected java.util.Vector seqs
protected java.util.Vector graphicSequence
protected java.util.Vector graphicName
protected java.util.Hashtable colorScheme
private PlotConsensus pc
private int hgt
private int len
protected int MAXSEQLENGTH
private int numResiduePerLine
protected SequenceJPanel numberDraw
protected javax.swing.JScrollPane jspSequence
private javax.swing.JPanel seqNamePanel
protected javax.swing.Box seqBox
protected javax.swing.Box seqNameBox
private javax.swing.Box plotconsSeqBox
protected boolean drawSequence
protected boolean drawBlackBox
protected boolean drawColorBox
protected boolean drawNumber
private boolean prettPlot
private int plotConStrut
private PrettyPlotJFrame prettyPlot
private Matrix mat
Constructor Detail |
public GraphicSequenceCollection(java.util.Vector seqs, java.util.Hashtable colorScheme, javax.swing.JScrollPane jspSequence, boolean drawSequence, boolean drawBlackBox, boolean drawColorBox, boolean drawNumber, javax.swing.JTextField statusField)
seqs
- vector of sequencescolorScheme
- sequence colour schemejspSequence
- sequence scrollpanedrawSequence
- true to draw the sequencedrawBlackBox
- true to draw black square around residuesdrawColorBox
- true to colour residuesdrawNumber
- true to draw sequence position numberstatusField
- status field in the editorpublic GraphicSequenceCollection(java.util.Vector seqs, javax.swing.JScrollPane jspSequence, boolean drawSequence, boolean drawBlackBox, boolean drawColorBox, boolean drawNumber, javax.swing.JTextField statusField)
seqs
- vector of sequencesjspSequence
- sequence scrollpanedrawSequence
- true to draw the sequencedrawBlackBox
- true to draw black square around residuesdrawColorBox
- true to colour residuesdrawNumber
- true to draw sequence position numberstatusField
- status field in the editorMethod Detail |
protected java.util.Vector getSequenceCollection()
protected Sequence getConsensusSequence()
protected int getNumberSequences()
protected java.awt.Point getViewPosition()
protected java.awt.Rectangle getViewRect()
protected void showConsensusPlot(java.io.File matrix, int wsize)
protected void showConsensusPlot(Matrix mat, int wsize)
protected void deleteConsensusPlot()
protected void setMaxSequenceLength(int max)
max
- longest sequence lengthprotected void setMaxSeqLength()
public int getMaxSeqLength()
protected void setSequenceLock(boolean llock)
protected void setNumberSize()
protected void setMatrix(Matrix mat)
protected java.awt.Color getColor(java.lang.String s, int pos, java.lang.String seqName)
s
- residue at position pospos
- residue positionseqName
- sequence name
protected java.awt.Color getPrettyBackground(java.awt.Color textColour)
protected boolean isPrettyBox()
protected int testUpAndDown(int pos, Sequence seq)
private Sequence removeSequence(java.lang.String name)
name
- name of sequence to removeprotected void deleteSequence(java.lang.String name)
name
- name of sequence to removeprotected void moveSequence(java.lang.String name, int i)
name
- name of sequence to removei
- new position in the sequence editorprotected void idSort()
protected void addSequence(Sequence seq, boolean addToSequences, int ypad, int fontSize, int index)
seq
- sequence to add to the editor displayaddToSequences
- true to add seq to the vector of sequencesypad
- sequence panel height paddingfontSize
- font sizeindex
- sequence indexprotected void addSequence(Sequence seq, boolean addToSequences, int ypad, int fontSize)
seq
- sequence to add to the editor displayaddToSequences
- true to add seq to the vector of sequencesypad
- sequence panel height paddingfontSize
- font sizepublic java.awt.Dimension getViewSize()
public java.lang.String getName(int i)
public java.awt.Dimension getNameViewSize()
public java.awt.Dimension getPanelSize()
public int getNameHeight()
public int getNameWidth()
public void setNamePanelWidth(int x)
x
- sequence name panel widthpublic int getPanelHeight()
public int getPanelWidth()
public java.util.Vector getGraphicSequence()
public void setDrawBoxes(boolean drawBlackBox)
public void setDrawColor(boolean drawColorBox)
public void setFontSizeForCollection(int fs)
public int getFontSize()
public int findPattern(java.lang.String pat, int oldResPosition, boolean wrapAround)
private int searchSequences(int startSearch, java.lang.String pat)
private int findMiddle(int newResPos, int viewWidth, java.lang.String pat)
public void setColorScheme(java.util.Hashtable colourTable)
colourTable
- colour scheme as a hashtablepublic void setPrettyPlot(boolean bpretty, PrettyPlotJFrame prettyPlot)
bpretty
- true if displaying as prettyplotpublic void setJScrollPaneViewportView()
public int getNumberPages(java.awt.print.PageFormat format)
format
- format for printing
public int getNumberPages(java.awt.print.PageFormat format, int numResPerLine)
format
- format for printingnumResPerLine
- number of residues per line
public java.awt.Dimension getImageableSize(int numResPerLine)
public int getResiduesPerLine(java.awt.print.PageFormat format)
format
- format for printing
public int getResiduesPerPage(java.awt.print.PageFormat format, int numResPerLine)
format
- format for printingnumResPerLine
- number residues per line
public int print(java.awt.Graphics g, java.awt.print.PageFormat format, int pageIndex) throws java.awt.print.PrinterException
print
in interface java.awt.print.Printable
g
- graphicsformat
- page formatpageIndex
- page number to print
java.awt.print.PrinterException
protected void setNumberOfResiduesPerLine(int numResiduePerLine)
numResiduePerLine
- number of residues per linepublic void drawSequences(java.awt.Graphics2D g2d, java.awt.print.PageFormat format, int pageIndex)
g2d
- graphicsformat
- page formatpageIndex
- page number to printpublic void drawSequences(java.awt.Graphics2D g2d, java.awt.print.PageFormat format, int pageIndex, int numResPerLine)
g2d
- graphicsformat
- page formatpageIndex
- page number to printnumResPerLine
- number of residues per linepublic java.awt.Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface javax.swing.Scrollable
public int getScrollableBlockIncrement(java.awt.Rectangle r, int orientation, int direction)
getScrollableBlockIncrement
in interface javax.swing.Scrollable
public int getScrollableUnitIncrement(java.awt.Rectangle r, int orientation, int direction)
getScrollableUnitIncrement
in interface javax.swing.Scrollable
public static void main(java.lang.String[] args)
protected void drawNumber()
protected void addAnnotationSequence(Sequence s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |