edu.mssm.crover.domain2d
Class BetaStrandDomain

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--edu.mssm.crover.domain2d.PrintablePanel
                                |
                                +--edu.mssm.crover.domain2d.TwoEndsDomain
                                      |
                                      +--edu.mssm.crover.domain2d.TwoEndsDraggableDomain
                                            |
                                            +--edu.mssm.crover.domain2d.BetaStrandDomain
All Implemented Interfaces:
javax.accessibility.Accessible, CoolPrint, Domain2D, Drawing, java.awt.image.ImageObserver, java.awt.MenuContainer, java.util.Observer, java.io.Serializable

public class BetaStrandDomain
extends TwoEndsDraggableDomain
implements Domain2D, java.util.Observer

Graphical representation of a beta strand subunit.

Author:
Karel Konvicka
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.mssm.crover.domain2d.TwoEndsDomain
delta_end, delta_start, end, first, last, position, quickDraw, rgf, rgra, rmf, solver, start
 
Fields inherited from class edu.mssm.crover.domain2d.PrintablePanel
SVG_ANCHOR_HREF_PROPERTY
 
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
BetaStrandDomain()
           
BetaStrandDomain(ResidueModelFactory rmf, ResidueGlyphFactory rgf, ResidueGlyphRenderingAttributes rgra)
           
 
Method Summary
protected  void assignCRDcoordinates(double[] crd_x, double[] crd_y, int ncomp)
           
 java.awt.Point centerOf(java.awt.Component comp)
           
protected  void computeBetaStrandCoordinates(double[] crd_x, double[] crd_y, int ncomp, int width, int height)
           
protected  void computePreferredSize(double[] crd_x, double[] crd_y, int ncomp, int width, int height)
           
 java.awt.geom.Point2D getDirection()
          Returns the direction of drawing of this domain, defined as the vector tangent to the direction of drawing of the residue chain at the exit of the domain.
 void getSpacer(java.awt.geom.Point2D space)
           
 void hideFirst(boolean hs)
          Loop spacer adustements require that the last residue of the last domain and the first residue of the next domain not to be displayed/controlled by the other domains.
 void hideLast(boolean hs)
          see hideFirst.
 void layoutResidues()
          Layout the residues in the domain.
 void paintComponent(java.awt.Graphics g)
           
 void setDirection(java.awt.geom.Point2D direction)
          Sets the direction vector for this domain.
 void setDragging(boolean state)
          Enable/disable the dragging of a domain.
 void setModel(BetaStrandModel model)
           
protected  void setOffset(double xmin, double ymin)
           
 void setRange(BiologicalSequence seq, int start, int end)
          Instructs the domain to render the part of sequence seq made of the residues between start and end, extremities included.
 void setSpacer(java.awt.geom.Point2D space)
          Sets the spacer vector for this domain.
 void Update(java.util.Observable o, java.lang.Object arg)
           
 
Methods inherited from class edu.mssm.crover.domain2d.TwoEndsDraggableDomain
dispose, setDBSDebug, setListener
 
Methods inherited from class edu.mssm.crover.domain2d.TwoEndsDomain
calculateDeltas, connectEnd, connectPosition, connectStart, finalize, firstResiduePos, getComp, getComponent, getId, getLocation, getSurface, getX, getY, isOptimizedDrawingEnabled, lastResiduePos, paintBrushing, paintSelection, position, setId, setLocation, setLocation, suggestLocation, suggestLocation, syncLocation, update, useResidueModelFactory
 
Methods inherited from class edu.mssm.crover.domain2d.PrintablePanel
coolPrint, recurseSVGPrint, svgPrint
 
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, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, 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, 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, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.mssm.crover.domain2d.Domain2D
calculateDeltas, connectEnd, connectPosition, connectStart, dispose, firstResiduePos, getComp, getId, lastResiduePos, position, setId, useResidueModelFactory
 
Methods inherited from interface edu.mssm.crover.domain2d.Drawing
getComponent, getParent, getSurface, suggestLocation, suggestLocation
 
Methods inherited from interface java.util.Observer
update
 

Constructor Detail

BetaStrandDomain

public BetaStrandDomain()

BetaStrandDomain

public BetaStrandDomain(ResidueModelFactory rmf,
                        ResidueGlyphFactory rgf,
                        ResidueGlyphRenderingAttributes rgra)
Method Detail

setDragging

public void setDragging(boolean state)
Description copied from interface: Domain2D
Enable/disable the dragging of a domain. Most of the time this is a convenient method to access the DBS model and turn the dragging on/off.

Specified by:
setDragging in interface Domain2D
See Also:
domain2d.DBSModel

hideFirst

public void hideFirst(boolean hs)
Description copied from interface: Domain2D
Loop spacer adustements require that the last residue of the last domain and the first residue of the next domain not to be displayed/controlled by the other domains. To do so, the loop domain uses hideFirst and hideLast on its previous and follower domain.

Specified by:
hideFirst in interface Domain2D
Overrides:
hideFirst in class TwoEndsDomain

hideLast

public void hideLast(boolean hs)
Description copied from interface: Domain2D
see hideFirst.

Specified by:
hideLast in interface Domain2D
Overrides:
hideLast in class TwoEndsDomain

setModel

public void setModel(BetaStrandModel model)

paintComponent

public void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

centerOf

public java.awt.Point centerOf(java.awt.Component comp)

layoutResidues

public void layoutResidues()
Description copied from interface: Domain2D
Layout the residues in the domain. Determine the size of the domain and set it. After this method has executed the positions of the first and last residue are know relatively to the domain position.

Specified by:
layoutResidues in interface Domain2D
See Also:
Domain2D.firstResiduePos(), Domain2D.lastResiduePos()

setRange

public void setRange(BiologicalSequence seq,
                     int start,
                     int end)
              throws InvalidRange
Description copied from interface: Domain2D
Instructs the domain to render the part of sequence seq made of the residues between start and end, extremities included.
Calling this method could be expensive as the number of residues may be altered and the layout recalculated. Implementors are advised to optimize their code to enable a dynamic adjustement of the range of the domain provided by the diagram editor (yet to be written). Interestingly, it has to be noted that this kind of dynamic adjustement is likely to translate the range over the sequence, add or remove a residue from the range. So some implementations can be choosen to accomodate these local changes that will reuse the previous layout and residues (from the previous invocation of setRange()).

Specified by:
setRange in interface Domain2D
InvalidRange

setSpacer

public void setSpacer(java.awt.geom.Point2D space)
Description copied from interface: Domain2D
Sets the spacer vector for this domain. The spacer is only indicative: different implementations of Domain2D can interpret it differently. For instance, loops will try to adjust to fit the spacer vector as closely as possible, helices will change the direction of their drawing to fit the direction of the indicated spacer.

Specified by:
setSpacer in interface Domain2D

getSpacer

public void getSpacer(java.awt.geom.Point2D space)

setDirection

public void setDirection(java.awt.geom.Point2D direction)
Description copied from interface: Domain2D
Sets the direction vector for this domain. Some domain display depend on the value of direction (general direction of drawing), other do not. The choice is left to the domain implementor. Helices should adjust to allow rotations of the domain. Loops are highly constrained by surrounding domains and aesthetic constrained, so are unlikely to adjust their display to this parameter.

Specified by:
setDirection in interface Domain2D

getDirection

public java.awt.geom.Point2D getDirection()
Description copied from interface: Domain2D
Returns the direction of drawing of this domain, defined as the vector tangent to the direction of drawing of the residue chain at the exit of the domain.
This is used by loops to determine their tangential orientation when connecting two domains. Stricly, there should be two directions: a entry direction and an exit direction. At the moment, for helices and strands it is not expected that the directions will be different so we conveniently keep only one method. This could change as needed.

Specified by:
getDirection in interface Domain2D

Update

public void Update(java.util.Observable o,
                   java.lang.Object arg)

computePreferredSize

protected void computePreferredSize(double[] crd_x,
                                    double[] crd_y,
                                    int ncomp,
                                    int width,
                                    int height)

computeBetaStrandCoordinates

protected void computeBetaStrandCoordinates(double[] crd_x,
                                            double[] crd_y,
                                            int ncomp,
                                            int width,
                                            int height)

assignCRDcoordinates

protected void assignCRDcoordinates(double[] crd_x,
                                    double[] crd_y,
                                    int ncomp)

setOffset

protected void setOffset(double xmin,
                         double ymin)


Copyright @ 2003 Mount Sinai School of Medicine. All Rights Reserved.