edu.iastate.metnet.birdseyeview.cellview
Class PanelLocationsFactory

java.lang.Object
  extended by edu.iastate.metnet.birdseyeview.cellview.PanelLocationsFactory

public class PanelLocationsFactory
extends java.lang.Object

The PanelLocationsFactory Class handles the functionality surrounding the locations of gene panels in the cell view relative to the parent component (i.e. the cell image). The gene panels must be placed on the correct cell compartment.

Author:
Matt Studham Created Jan 25, 2005

Constructor Summary
PanelLocationsFactory(Database db)
          Constructor.
 
Method Summary
 CellularLocation getCellLocation(java.lang.String name)
           
 java.awt.Point getPanelLocation(java.lang.String name)
          This method returns the next available gene panel location for the given cellular location (compartment).
static java.util.ArrayList getPointsInRectangle(java.awt.Rectangle rawBounds)
          This method returns a list of points for gene panel locations inside the given rectangle.
static void main(java.lang.String[] args)
          This method tests the PanelLocationsFactory class.
 void resetPanelLocations()
          This method resets all the points for all the cellular locations.
 void setAnnotationtoLocation(java.lang.String name, Annotation ann)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PanelLocationsFactory

public PanelLocationsFactory(Database db)
Constructor. Use the database to get the cellular location names and create the cellular location objects. Also, set all the available points for all the cellular locations.

Parameters:
db - Database object
Method Detail

getPanelLocation

public java.awt.Point getPanelLocation(java.lang.String name)
This method returns the next available gene panel location for the given cellular location (compartment). If the given cellular location is unknown or if there aren't any available locations, null is returned.

Parameters:
name - String - cellular location name
Returns:
Point Next available location; may be null

getCellLocation

public CellularLocation getCellLocation(java.lang.String name)

setAnnotationtoLocation

public void setAnnotationtoLocation(java.lang.String name,
                                    Annotation ann)

resetPanelLocations

public void resetPanelLocations()
This method resets all the points for all the cellular locations. This means that all gene panel location points are available for all cellular locations.


getPointsInRectangle

public static java.util.ArrayList getPointsInRectangle(java.awt.Rectangle rawBounds)
This method returns a list of points for gene panel locations inside the given rectangle. The list is sorted in ascending order based on the distance from the center of the rectangle.

Parameters:
rawBounds - Rectangle which will hold the gene panels
Returns:
ArrayList Sorted list of Point objects

main

public static void main(java.lang.String[] args)
This method tests the PanelLocationsFactory class.

Parameters:
args -