analyzer
Class Analyzer

java.lang.Object
  extended byanalyzer.Analyzer
Direct Known Subclasses:
DollarTechniqueAnalyzer, PairwiseAnalyzer, PlanningGameAnalyzer

public class Analyzer
extends java.lang.Object

Defines an analyzer for any technique. Each analyzer should extend this class and overide methods as needed.

Author:
Mikael Jönsson & Per Klingnäs

Field Summary
protected  int canvasHeight
           
protected  int canvasWidth
           
protected  double maxValue
           
protected  java.util.LinkedList pointList
           
protected  boolean relativeSupportLines
           
protected  RequirementList rList
           
protected  GraphPoint selectedPoint
           
 
Constructor Summary
Analyzer(RequirementList rList, int canvasWidth, int canvasHeight)
          Constructs an analyzer
 
Method Summary
 java.util.LinkedList createPoints()
          Creates and assigns the positions of all the requirements to be drawn in the GraphWindow.
 void drawRelativeSupportLines(java.awt.Graphics g, int canvasWidth, int canvasHeight)
          Draws relative support lines in the GraphWindow.
 void drawSupportLines(java.awt.Graphics g, int canvasWidth, int canvasHeight)
          Draws support lines in the GraphWindow.
 java.util.LinkedList getAllPointsAt(int x, int y)
          Returns a list with all the points at the given position.
 Requirement getSelectedPointsRequirement()
          Returns the selected point's Requirement.
 void highlightPoint(Requirement r)
          Selects and highlights the point associated with the given Requirement.
 Requirement selectPoint(int x, int y)
          Selects, highlights and returns the first Requirement at the given position.
 void setCanvasSize(int canvasWidth, int canvasHeight)
          Sets the size of the drawing area.
private  void setMaxValue()
          Calculates the highest values among the requirements
protected  void setReleaseNbrs()
          Examines how many different releases that are included and assigns each release an index.
 void toggleRelativeSupportLines()
          Changes the viewing style, i.e. whether squared boxes should be drawn or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

canvasWidth

protected int canvasWidth

canvasHeight

protected int canvasHeight

maxValue

protected double maxValue

pointList

protected java.util.LinkedList pointList

rList

protected RequirementList rList

selectedPoint

protected GraphPoint selectedPoint

relativeSupportLines

protected boolean relativeSupportLines
Constructor Detail

Analyzer

public Analyzer(RequirementList rList,
                int canvasWidth,
                int canvasHeight)
Constructs an analyzer

Parameters:
rList - list of Requirements to be analyzed
canvasWidth - the width of the drawing area
canvasHeight - the height of the drawing area
Method Detail

setMaxValue

private void setMaxValue()
Calculates the highest values among the requirements


createPoints

public java.util.LinkedList createPoints()
Creates and assigns the positions of all the requirements to be drawn in the GraphWindow.

Returns:
a list containing all the GraphPoints to be drawn

setReleaseNbrs

protected void setReleaseNbrs()
Examines how many different releases that are included and assigns each release an index. This is done because we want each release to be drawn in its own way, so we can tell them apart in the graph


highlightPoint

public void highlightPoint(Requirement r)
Selects and highlights the point associated with the given Requirement.

Parameters:
r - the requirement to be highlighted

selectPoint

public Requirement selectPoint(int x,
                               int y)
Selects, highlights and returns the first Requirement at the given position.

Parameters:
x - the x coordinate
y - the y coordinate
Returns:
the Requirement at (x, y) or null if no requirment was found

getSelectedPointsRequirement

public Requirement getSelectedPointsRequirement()
Returns the selected point's Requirement.

Returns:
the selected point's Requirement

getAllPointsAt

public java.util.LinkedList getAllPointsAt(int x,
                                           int y)
Returns a list with all the points at the given position.

Parameters:
x - the x coordinate
y - the y coordinate
Returns:
a LinkedList with all the points at (x, y)

toggleRelativeSupportLines

public void toggleRelativeSupportLines()
Changes the viewing style, i.e. whether squared boxes should be drawn or not.


drawSupportLines

public void drawSupportLines(java.awt.Graphics g,
                             int canvasWidth,
                             int canvasHeight)
Draws support lines in the GraphWindow.

Parameters:
g - the Graphics that will be drawn
canvasWidth - the width of the drawing area
canvasHeight - the height of the drawing area

drawRelativeSupportLines

public void drawRelativeSupportLines(java.awt.Graphics g,
                                     int canvasWidth,
                                     int canvasHeight)
Draws relative support lines in the GraphWindow.

Parameters:
g - the Graphics that will be drawn
canvasWidth - the width of the drawing area
canvasHeight - the height of the drawing area

setCanvasSize

public void setCanvasSize(int canvasWidth,
                          int canvasHeight)
Sets the size of the drawing area.

Parameters:
canvasWidth - the width of the drawing area
canvasHeight - the height of the drawing area