jadex.swing.map
Class DisplayControl

java.lang.Object
  |
  +--jadex.swing.map.DisplayControl
All Implemented Interfaces:
java.util.EventListener, java.beans.PropertyChangeListener
Direct Known Subclasses:
CloneControl, LocusControl

public abstract class DisplayControl
extends java.lang.Object
implements java.beans.PropertyChangeListener

This is a control class for LocusDisplay. All control activities will be placed here. It can listen to "zoom" property change event


Field Summary
 java.awt.Color HIGHLIGHT_COLOR
           
 java.awt.Color NORMAL_COLOR
           
static int NUMBER_PER_COLUMN
           
protected  java.lang.String pattern
           
protected  java.lang.String[] patterns
           
protected  int showNumber
           
protected  LocusUI[] sLoci
           
protected  MapPoint[] sPoints
           
protected  MapPoint[] tPoints
           
 
Constructor Summary
DisplayControl()
          Default constructor.
DisplayControl(DisplayModel m)
          An overloaded constructor.
 
Method Summary
 void checkKnobs()
          Check the arrow of two knobs.
protected  void checkMapRange(MapRange r)
          See if the maprange is out of the full scale.
 void deSearch()
          Remove all label and close all extra locusUI.
 void doSearch(java.lang.String pat)
          Consider to change this method in the future.
abstract  MapPointDisplay getDisplay()
          Display should be provided by subclass.
 MapControl getMapControl()
          Get the central controller.
 DisplayModel getModel()
          Get the DisplayModel this control controlled.
 int getShowNumber()
          Get the number of shown LocusUI.
 MapRange getTotalMapRange()
          Get the total MapRange.
 int getTotalShowNumber()
          Get the TotalShowNumber in this displayed maprange.
 void movingDown()
          Moving down the displayed range by knob.
 void movingUp()
          Moving up the displayed range by knob.
 void propertyChange(java.beans.PropertyChangeEvent e)
          PropertyChangeListener method: for zoom property fired by mapcontrol
 void reset()
          Reset to the whole chromosome range.
protected abstract  void resetUI()
          UI should be reset after total points or showing points in range have been changed.
 void setKnobs(Knob top, Knob bottom)
          set knobs in this display: Assume all display have knobs.
 void setMapControl(MapControl c)
          MapControl is always the central controller.
 void setMapRange(MapRange r)
          MapRange is set by this control class.
 void setModel(DisplayModel m)
          DisplayModel can be set: A property of this class
 void setShowNumber(int number)
          Showing mappoint with the total number of number.
 void setTotalMapRange(MapRange r)
          Set the total maprange.
 void showLess()
          Show less.
 void showMore()
          Show more.
 void showReset()
          Show reset.
abstract  void updateUI()
          Update UI after search or desearch
 void zoom(MapRange r)
          Do zooming.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUMBER_PER_COLUMN

public static int NUMBER_PER_COLUMN

HIGHLIGHT_COLOR

public java.awt.Color HIGHLIGHT_COLOR

NORMAL_COLOR

public java.awt.Color NORMAL_COLOR

showNumber

protected int showNumber

tPoints

protected MapPoint[] tPoints

sPoints

protected MapPoint[] sPoints

sLoci

protected LocusUI[] sLoci

pattern

protected java.lang.String pattern

patterns

protected java.lang.String[] patterns
Constructor Detail

DisplayControl

public DisplayControl()
Default constructor.

DisplayControl

public DisplayControl(DisplayModel m)
An overloaded constructor.
Parameters:
m - the DisplayModel.
Method Detail

setKnobs

public void setKnobs(Knob top,
                     Knob bottom)
set knobs in this display: Assume all display have knobs.
Parameters:
top - the top knob.
bottom - the bottom knob.

setModel

public void setModel(DisplayModel m)
DisplayModel can be set: A property of this class
Parameters:
m - the DisplayModel.

getModel

public DisplayModel getModel()
Get the DisplayModel this control controlled.
Returns:
the model used in this Control.

setMapControl

public void setMapControl(MapControl c)
MapControl is always the central controller.
Parameters:
c - the central controller for all zooming activities.

getMapControl

public MapControl getMapControl()
Get the central controller.
Returns:
the MapControl used in this DisplayControl.

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
PropertyChangeListener method: for zoom property fired by mapcontrol
Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Following copied from interface: java.beans.PropertyChangeListener
Parameters:
evt - A PropertyChangeEvent object describing the event source and the property that has changed.

zoom

public void zoom(MapRange r)
Do zooming.
Parameters:
r - the maprange to be zoomed in.

setTotalMapRange

public void setTotalMapRange(MapRange r)
Set the total maprange.
Parameters:
t - the total MapRange in this DisplayControl.

getTotalMapRange

public MapRange getTotalMapRange()
Get the total MapRange.
Returns:
get the total MapRange used in this control.

setMapRange

public void setMapRange(MapRange r)
MapRange is set by this control class.
Parameters:
r - the MapRange will be be displayed.

checkMapRange

protected void checkMapRange(MapRange r)
See if the maprange is out of the full scale. If yes, convert the ends

getTotalShowNumber

public int getTotalShowNumber()
Get the TotalShowNumber in this displayed maprange.
Returns:
the totalshowNumber in this displayed maprange.

reset

public void reset()
Reset to the whole chromosome range.

showMore

public void showMore()
Show more.

showLess

public void showLess()
Show less.

showReset

public void showReset()
Show reset. Show the default number of MapPoints.

setShowNumber

public void setShowNumber(int number)
Showing mappoint with the total number of number.
Parameters:
number - the showing number of mappoints.

movingUp

public void movingUp()
Moving up the displayed range by knob.

movingDown

public void movingDown()
Moving down the displayed range by knob.

checkKnobs

public void checkKnobs()
Check the arrow of two knobs.

getDisplay

public abstract MapPointDisplay getDisplay()
Display should be provided by subclass.
Returns:
a MapPointDisplay showing mappoint data.

doSearch

public void doSearch(java.lang.String pat)
Consider to change this method in the future. Probably a new SelectionModel class is needed for search purpose.

deSearch

public void deSearch()
Remove all label and close all extra locusUI.

getShowNumber

public int getShowNumber()
Get the number of shown LocusUI.
Returns:
the number of shown LocusUI.

resetUI

protected abstract void resetUI()
UI should be reset after total points or showing points in range have been changed.

updateUI

public abstract void updateUI()
Update UI after search or desearch