jadex.swing.sequence
Class CloneDisplay

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--jadex.swing.sequence.CloneDisplay
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, MapPointDisplay, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable, Zoomable

public class CloneDisplay
extends javax.swing.JPanel
implements MapPointDisplay, Zoomable, java.awt.event.MouseListener

This is the class used to show clones in the chromosome. Many methods of this class are from LocusDisplay. Therefore, LocusDisplay and this class should be refactored.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
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
CloneDisplay()
          Default constructor
CloneDisplay(CloneControl control)
          Second constructor: CloneControl as the argument
CloneDisplay(DisplayModel model)
          Third constructor: DisplayModel as the argument
 
Method Summary
 void doZooming()
          Do zooming.
 LocusLayout getNameLayout()
          Get the name layout used in this CloneDisplay.
 DisplayPopup getPopup()
          Get the PopupMenu used in this CloneDisplay.
 float getVerticalPosition()
          Get the position of the chromosome line.
 boolean isConnectShown()
          Get the status of the connecting lines.
static void main(java.lang.String[] args)
           
 void mouseClicked(java.awt.event.MouseEvent p1)
          Do nothing.
 void mouseEntered(java.awt.event.MouseEvent p1)
          Do nothing.
 void mouseExited(java.awt.event.MouseEvent p1)
          Invoked when the mouse exits a component.
 void mousePressed(java.awt.event.MouseEvent p1)
          Show popup menu.
 void mouseReleased(java.awt.event.MouseEvent p1)
          Show popup menu.
 void paintComponent(java.awt.Graphics g)
          The most important method in this class.
 void setCloneControl(CloneControl ctl)
          Set the control of the display.
 void setClones(java.util.List list)
          Set the clones.
 void setConnectShown(boolean b)
          Set if the connecting lines should be displayed.
 void setMouseInName(java.lang.String name)
          Set the name in which the mouse is in.
 void setNameLayout(LocusLayout l)
          Set the nameLayout.
 void setNameLayout(java.lang.String name)
          Set the name layout by layout name.
 void setRange(MapRange r)
          Set the current maprange.
 void setShowNames(LocusUI[] l)
          Names will be shown in this range.
 void setZoom(java.awt.geom.Rectangle2D.Float zoom)
          Zoom range should be passed from magnifier to here.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, 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, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jadex.swing.util.Zoomable
addMouseListener, addMouseMotionListener, repaint, setCursor
 

Constructor Detail

CloneDisplay

public CloneDisplay()
Default constructor

CloneDisplay

public CloneDisplay(CloneControl control)
Second constructor: CloneControl as the argument

CloneDisplay

public CloneDisplay(DisplayModel model)
Third constructor: DisplayModel as the argument
Method Detail

getPopup

public DisplayPopup getPopup()
Get the PopupMenu used in this CloneDisplay.

setCloneControl

public void setCloneControl(CloneControl ctl)
Set the control of the display.
Parameters:
ctl - the CloneControl used for this CloneDisplay.

setClones

public void setClones(java.util.List list)
Set the clones.
Parameters:
list - the clones to be displayed.

setRange

public void setRange(MapRange r)
Set the current maprange.
Specified by:
setRange in interface MapPointDisplay
Parameters:
r - the current MapRange to be displayed.

setNameLayout

public void setNameLayout(LocusLayout l)
Set the nameLayout.
Parameters:
l - the name layout for layouting names of clones in the display.

setNameLayout

public void setNameLayout(java.lang.String name)
Set the name layout by layout name. LocusLayout can also be set by their names.
Specified by:
setNameLayout in interface MapPointDisplay
Parameters:
name - the name of the layout to be used in this CloneDisplay.

setConnectShown

public void setConnectShown(boolean b)
Set if the connecting lines should be displayed.
Specified by:
setConnectShown in interface MapPointDisplay
Parameters:
b - showing the connecting lines if true.

isConnectShown

public boolean isConnectShown()
Get the status of the connecting lines.
Specified by:
isConnectShown in interface MapPointDisplay
Returns:
true if the connecting lines are shown.

setShowNames

public void setShowNames(LocusUI[] l)
Names will be shown in this range. Repaint() should be called explicitily.
Parameters:
the - names of clones will be displayed.

paintComponent

public void paintComponent(java.awt.Graphics g)
The most important method in this class. All displaying activities are here.
Overrides:
paintComponent in class javax.swing.JComponent
Following copied from class: javax.swing.JComponent
See Also:
JComponent.paint(java.awt.Graphics)

getVerticalPosition

public float getVerticalPosition()
Get the position of the chromosome line.
Specified by:
getVerticalPosition in interface Zoomable
Returns:
the position of the chromosome line.

setZoom

public void setZoom(java.awt.geom.Rectangle2D.Float zoom)
Zoom range should be passed from magnifier to here. After zooming, zoom should be clear up, i.e., zoom = null.
Specified by:
setZoom in interface Zoomable
Parameters:
zoom - the rectangle to be zoomed.

doZooming

public void doZooming()
Do zooming.
Specified by:
doZooming in interface Zoomable

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent p1)
Show popup menu. For windows.
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent p1)
Do nothing.
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent p1)
Do nothing.
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent p1)
Show popup menu. For linux.
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent p1)
Description copied from interface: java.awt.event.MouseListener
Invoked when the mouse exits a component.
Specified by:
mouseExited in interface java.awt.event.MouseListener

main

public static void main(java.lang.String[] args)

getNameLayout

public LocusLayout getNameLayout()
Get the name layout used in this CloneDisplay.
Specified by:
getNameLayout in interface MapPointDisplay
Returns:
the name layout currently used in this clonedisplay.

setMouseInName

public void setMouseInName(java.lang.String name)
Set the name in which the mouse is in.
Specified by:
setMouseInName in interface MapPointDisplay
Parameters:
name - the name in which the mouse is in.