|
||||||||||
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.SequenceJPanel
Sequence panel for drawing a sequence or the sequence numbers
Nested Class Summary | |
(package private) class |
SequenceJPanel.PopupListener
Popup listener |
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 | |
private int |
boundWidth
boundary width around each residue |
protected int |
boundWidth2
half boundary width (boundWidth/2) |
private java.awt.Color |
col
|
private java.util.Hashtable |
colorTable
colour scheme |
private boolean |
drawBlackBox
draw a black box around residues |
private boolean |
drawColorBox
colour the residues |
protected boolean |
drawNumber
draw the sequence numbers |
private boolean |
drawSequence
draw the sequence |
private java.awt.Font |
font
font |
private int |
fontSize
font size |
private boolean |
highlightPattern
high light search pattern |
protected int |
interval
sequence numbering interval |
private java.util.Vector |
observers
observer panels in this group |
private java.lang.String |
padChar
pad/gap character |
private java.lang.String |
pattern
pattern to search for |
private javax.swing.JPopupMenu |
popup
pop up menu |
private int |
pressedResidue
residue number when pressed by mouse |
private boolean |
prettyPlot
colour as per prettyplot |
protected int |
resWidth
residue width |
protected Sequence |
seq
sequence to display |
protected int |
seqHeight
sequence height |
private int |
seqLength
sequence length |
protected javax.swing.JComponent |
viewPane
sequence alignment panel |
private int |
ypad
sequence height pad |
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.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
SequenceJPanel(int interval,
int seqLength)
Constructor for sequence numbering |
|
SequenceJPanel(Sequence seq,
javax.swing.JComponent viewPane,
boolean drawSequence,
boolean drawBlackBox,
boolean drawColorBox,
java.util.Hashtable colorTable,
int ypad)
Constructor with default font size. |
|
SequenceJPanel(Sequence seq,
javax.swing.JComponent viewPane,
boolean drawSequence,
boolean drawBlackBox,
boolean drawColorBox,
java.util.Hashtable colorTable,
int fontSize,
int ypad)
|
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Override actionPerformed for popup menu actions |
protected void |
attach(SequenceJPanel sjp)
Attach sequence display to the same group |
protected void |
detach(SequenceJPanel sjp)
Detach sequence display from this group |
protected void |
detachAll()
Detach all sequence displays from this group |
private java.awt.Color |
getColor(java.lang.String s)
Get a residue colour |
int |
getFontSize()
Get the font size |
java.lang.String |
getName()
Get the sequence name associated with this display |
void |
getNamePrintGraphic(java.awt.Graphics g2d)
Render the sequence name graphic |
private java.util.Vector |
getPatternPositions(int istart,
int istop,
java.lang.String seqS)
Find all occurences of the pattern in the sequence between the start and stop positions. |
private java.util.Vector |
getPatternPositions(int subseqStart,
java.lang.String subseq)
Find all occurences of the pattern in the sequence between the start and stop positions. |
java.awt.Dimension |
getPreferredSize()
Get the preferred size dimension |
int |
getResidueWidth()
Get the width of a residue |
int |
getSequenceHeight()
Get the sequence panel height |
void |
getSequencePrintGraphic(java.awt.Graphics g2d,
int MAXSEQNAME,
int istart,
int istop)
Render the sequence graphic |
int |
getSequenceResidueWidth()
Get the width of a residue |
int |
getSequenceWidth()
Get the sequence panel width |
java.awt.Point |
getToolTipLocation(java.awt.event.MouseEvent e)
Get the tool tip location |
java.lang.String |
getToolTipText(java.awt.event.MouseEvent e)
Determine the tool tip to display |
void |
init()
Add the mouse listener's |
boolean |
isPrettyPlot()
Determine if using prettyplot display |
protected void |
notifyGroup(int res,
int pressed)
Update all observers |
void |
paintComponent(java.awt.Graphics g)
Override paintComponent |
private boolean |
prettyDraw(int i,
int ipos,
int istop,
java.lang.String res,
int seqHeight,
int resWidth,
boolean leftResidue,
java.awt.Graphics g)
|
void |
setColorScheme(java.util.Hashtable colorHash)
Set the colour scheme |
void |
setDefaultColorHashtable()
Set a default colour scheme |
void |
setDrawBoxes(boolean drawBlackBox)
Set whether to draw boxes around residues |
void |
setDrawColor(boolean drawColorBox)
Set whether to colour residues |
void |
setFontSize(int size)
Set the font size and set the size |
void |
setPrettyPlot(boolean prettyPlot)
Set prettyplot display |
void |
setSequenceLength(int s)
Set the sequence length |
protected void |
showPattern(java.lang.String pattern)
Set pattern to high light |
protected void |
update(int resPos,
int pressed)
Implement update() for observers i.e. |
protected void |
viewPaneResize()
Re-size the sequence alignment panel if the width of this sequence pane increases |
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, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, 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.awt.Color col
protected Sequence seq
private int fontSize
private java.awt.Font font
private int boundWidth
protected int boundWidth2
protected int resWidth
protected int seqHeight
private int pressedResidue
protected int interval
private int seqLength
private int ypad
private java.util.Hashtable colorTable
private java.lang.String padChar
private java.lang.String pattern
private boolean drawSequence
private boolean drawBlackBox
private boolean drawColorBox
protected boolean drawNumber
private boolean prettyPlot
private boolean highlightPattern
protected javax.swing.JComponent viewPane
private javax.swing.JPopupMenu popup
private java.util.Vector observers
Constructor Detail |
public SequenceJPanel(Sequence seq, javax.swing.JComponent viewPane, boolean drawSequence, boolean drawBlackBox, boolean drawColorBox, java.util.Hashtable colorTable, int fontSize, int ypad)
seq
- sequence to displayviewPane
- sequence alignment paneldrawSequence
- draw the sequence if truedrawBlackBox
- draw a black box around residuesdrawColorBox
- colour the residuescolorTable
- colour schemefontSize
- font sizeypad
- sequence height padpublic SequenceJPanel(Sequence seq, javax.swing.JComponent viewPane, boolean drawSequence, boolean drawBlackBox, boolean drawColorBox, java.util.Hashtable colorTable, int ypad)
seq
- sequence to displayviewPane
- sequence alignment paneldrawSequence
- draw the sequence if truedrawBlackBox
- draw a black box around residuesdrawColorBox
- colour the residuescolorTable
- colour schemeypad
- sequence height padpublic SequenceJPanel(int interval, int seqLength)
interval
- numbering intervalseqLength
- length of the sequenceMethod Detail |
public void init()
protected void update(int resPos, int pressed)
protected void attach(SequenceJPanel sjp)
protected void detach(SequenceJPanel sjp)
protected void detachAll()
protected void notifyGroup(int res, int pressed)
public void paintComponent(java.awt.Graphics g)
g
- graphicsprivate boolean prettyDraw(int i, int ipos, int istop, java.lang.String res, int seqHeight, int resWidth, boolean leftResidue, java.awt.Graphics g)
i
- residue numberipos
- x positionres
- residueseqHeight
- sequence heightresWidth
- sequence widthleftResidue
- true if the left residue is an identical matchg
- graphicsprivate java.util.Vector getPatternPositions(int istart, int istop, java.lang.String seqS)
istart
- start search fromistop
- stop search fromseqS
- sequence string to search
private java.util.Vector getPatternPositions(int subseqStart, java.lang.String subseq)
subseqStart
- index of the start of the (sub)sequencesubseq
- sequence string to search
protected void showPattern(java.lang.String pattern)
pattern
- pattern to high lightpublic void setPrettyPlot(boolean prettyPlot)
prettyPlot
- true if the prettyplot display is to
be usedpublic boolean isPrettyPlot()
public java.lang.String getToolTipText(java.awt.event.MouseEvent e)
e
- mouse event
public java.awt.Point getToolTipLocation(java.awt.event.MouseEvent e)
e
- mouse event
private java.awt.Color getColor(java.lang.String s)
s
- residue
public void setDefaultColorHashtable()
public void setDrawBoxes(boolean drawBlackBox)
drawBlackBox
- true to draw boxespublic void setDrawColor(boolean drawColorBox)
drawColorBox
- true to colour residuespublic void setFontSize(int size)
size
- font sizepublic int getResidueWidth()
public void setColorScheme(java.util.Hashtable colorHash)
colorHash
- colour scheme to usepublic int getFontSize()
public java.awt.Dimension getPreferredSize()
protected void viewPaneResize()
public int getSequenceHeight()
public int getSequenceWidth()
public int getSequenceResidueWidth()
public void setSequenceLength(int s)
s
- sequence lengthpublic java.lang.String getName()
public void getNamePrintGraphic(java.awt.Graphics g2d)
g2d
- graphicpublic void getSequencePrintGraphic(java.awt.Graphics g2d, int MAXSEQNAME, int istart, int istop)
g2d
- graphicMAXSEQNAME
- maximum size for a sequence nameistart
- sequence start position for graphicistop
- sequence stop position for graphicpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- action event
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |