jadex.swing.map
Class LocusDisplay

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

public class LocusDisplay
extends LocusShow
implements MapPointDisplay, java.awt.event.MouseListener, Zoomable

An implementation of MapPointDisplay for displaying Loci.

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
 
Field Summary
protected  java.awt.Color highLightColor
           
protected  java.awt.Color nColor
           
 
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
protected LocusDisplay()
          This constructor can only be used by classes in the same package
  LocusDisplay(MapRange r)
          Initialize the total range by the constructor.
 
Method Summary
 void doSearch(java.lang.String pattern)
          Search loci with names containg pattern.
 void doZooming()
          Actual zooming method.
 LocusControl getLocusControl()
          Get the LocusControl used by this display.
 DisplayModel getModel()
          Get the displaymodel.
 LocusLayout getNameLayout()
          Get the Layout for Names.
 DisplayPopup getPopup()
          Get the JPopupMenu used by this Display.
 float getVerticalPosition()
          Get the position of the Chromosome line.
 boolean isConnectShown()
          Get the flag of connecting lines.
static void main(java.lang.String[] args)
           
 void mouseClicked(java.awt.event.MouseEvent e)
          Do nothing.
 void mouseDragged(java.awt.event.MouseEvent e)
          Do nothing.
 void mouseEntered(java.awt.event.MouseEvent e)
          Do nothing.
 void mouseExited(java.awt.event.MouseEvent e)
          Do nothing.
 void mouseMoved(java.awt.event.MouseEvent e)
          Do nothing.
 void mousePressed(java.awt.event.MouseEvent e)
          Showing popup menu.
 void mouseReleased(java.awt.event.MouseEvent e)
          Showing popup menu.
 void paintComponent(java.awt.Graphics g)
          All painting activities are here.
 void setConnectShown(boolean b)
          The connecting line can be turn on or off by this method.
protected  void setLocusUI(LocusUI[] ui)
          loci will be shown by this method.
 void setModel(DisplayModel m)
          set locus model, which is the data class of locus display.
 void setMouseInName(java.lang.String name)
          Set the name for lightening up label and line when mouse is in.
 void setNameLayout(LocusLayout l)
          Set the Layout for the name labels for LocusUI.
 void setNameLayout(java.lang.String name)
          Set up a NameLayout by their names.
 void setPopup(javax.swing.JPopupMenu pop)
          Set up a JPopupMenu for controlling this locus display.
 void setRange(MapRange r)
          Set up the displaying MapRange.
protected  void setTotalLocus(MapPoint[] t)
          Set the total loci in a specific range.
 void setZoom(java.awt.geom.Rectangle2D.Float zoom)
          Set a rectangel for zooming.
 
Methods inherited from class jadex.swing.map.LocusShow
addPoint, propertyChange, setMapCartoon
 
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
 

Field Detail

nColor

protected java.awt.Color nColor

highLightColor

protected java.awt.Color highLightColor
Constructor Detail

LocusDisplay

protected LocusDisplay()
This constructor can only be used by classes in the same package

LocusDisplay

public LocusDisplay(MapRange r)
Initialize the total range by the constructor.
Parameters:
r - the total MapRange to be displayed.
Method Detail

setModel

public void setModel(DisplayModel m)
set locus model, which is the data class of locus display.
Overrides:
setModel in class LocusShow
Parameters:
m - the DataModel to for this display.

getLocusControl

public LocusControl getLocusControl()
Get the LocusControl used by this display.
Overrides:
getLocusControl in class LocusShow
Returns:
the LocusControl used by this Display.

setPopup

public void setPopup(javax.swing.JPopupMenu pop)
Set up a JPopupMenu for controlling this locus display.
Overrides:
setPopup in class LocusShow

getPopup

public DisplayPopup getPopup()
Get the JPopupMenu used by this Display.

setNameLayout

public void setNameLayout(LocusLayout l)
Set the Layout for the name labels for LocusUI.
Parameters:
l - a LocusLayout will be used for layout names for the displayed LocusUIs.

setNameLayout

public void setNameLayout(java.lang.String name)
Set up a NameLayout by their names.
Specified by:
setNameLayout in interface MapPointDisplay
Parameters:
name - the name of the LayoutModel. Now only two names are supported, columnLayout and smartLayout.

setConnectShown

public void setConnectShown(boolean b)
The connecting line can be turn on or off by this method.
Specified by:
setConnectShown in interface MapPointDisplay
Parameters:
b - true for turning on, false for turning off the connecting lines.

isConnectShown

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

setRange

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

getModel

public DisplayModel getModel()
Get the displaymodel.
Returns:
the DisplayModel used by this Display.

setLocusUI

protected void setLocusUI(LocusUI[] ui)
loci will be shown by this method.
Parameters:
ui - the LocusUI data to be displayed.

getNameLayout

public LocusLayout getNameLayout()
Get the Layout for Names.
Specified by:
getNameLayout in interface MapPointDisplay
Returns:
the namelayout currently used in this Dislay.

setMouseInName

public void setMouseInName(java.lang.String name)
Set the name for lightening up label and line when mouse is in.
Specified by:
setMouseInName in interface MapPointDisplay
Parameters:
name - the name of the LocusUI where mouse is in.

setTotalLocus

protected void setTotalLocus(MapPoint[] t)
Set the total loci in a specific range.
Parameters:
t - the total MapPoints in the specified Range.

getVerticalPosition

public float getVerticalPosition()
Get the position of the Chromosome line. This method is for implementation of Zoomable.
Specified by:
getVerticalPosition in interface Zoomable
Returns:
the position fo the chromosome line.

setZoom

public void setZoom(java.awt.geom.Rectangle2D.Float zoom)
Set a rectangel for zooming.
Specified by:
setZoom in interface Zoomable
Parameters:
zoom - the Rectangnle for zooming.

paintComponent

public void paintComponent(java.awt.Graphics g)
All painting activities are here.
Overrides:
paintComponent in class javax.swing.JComponent
Following copied from class: javax.swing.JComponent
See Also:
JComponent.paint(java.awt.Graphics)

mouseEntered

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

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Showing popup menu.
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Showing popup menu.
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseClicked

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

mouseExited

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

doSearch

public void doSearch(java.lang.String pattern)
Search loci with names containg pattern.
Overrides:
doSearch in class LocusShow
Parameters:
pattern - the searching key.

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Do nothing.

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Do nothing.

doZooming

public void doZooming()
Actual zooming method. zoom based on the rectangle drawed by the mouse.
Specified by:
doZooming in interface Zoomable

main

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