analyzer
Class GraphPoint

java.lang.Object
  extended byanalyzer.GraphPoint

public class GraphPoint
extends java.lang.Object

In the graph a GraphPoint is the graphical representation of a Requirement.

Author:
Mikael Jönsson & Per Klingnäs

Field Summary
private  java.awt.Color color
           
private  boolean hiddenText
           
private  boolean highlighted
           
private  int release
           
private  Requirement requirement
           
private  int x
           
private  int y
           
 
Constructor Summary
GraphPoint(Requirement requirement)
          Constructs a GraphPoint for the passed Requirement.
 
Method Summary
private  void circle(int cx, int cy, int radius, java.awt.Graphics g)
          Each GraphPoint is represented by one or more circles, this method draws those circles.
 void draw(java.awt.Graphics g)
          Draws the GraphPoint and Requirement text.
 Requirement getRequirement()
          Returns the Requirement for this GraphPoint.
 int getX()
          Returns the x coordinate of the GraphPoint.
 int getY()
          Returns the y coordinate of the GraphPoint.
 void hideText(boolean hiddenText)
          Sets whether or not the requirement text sould be hidden in the GraphWindow.
 void highlight()
          Highlights the GraphPoint
 void invertPoint(int canvasWidth, int canvasHeight)
          Inverts a point in the graph by switching the x-axis with the y-axis.
 boolean isHighLighted()
          Checks whether or not the GraphPoint is highlighted.
 boolean selectedBy(int xPos, int yPos)
          Returns true if (xPos, yPos) is within the GraphPoint's outer circle.
 void setRelease(int release)
          Sets internal release number.
 void setX(int x)
          Sets the x coordinate for the GraphPoint.
 void setY(int y)
          Sets the y coordinate for the GraphPoint.
 void unhighlight()
          Unhighlights the GraphPoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

requirement

private Requirement requirement

x

private int x

y

private int y

highlighted

private boolean highlighted

color

private java.awt.Color color

release

private int release

hiddenText

private boolean hiddenText
Constructor Detail

GraphPoint

public GraphPoint(Requirement requirement)
Constructs a GraphPoint for the passed Requirement.

Parameters:
requirement - the requirement for which the GraphPoint will be created
Method Detail

getX

public int getX()
Returns the x coordinate of the GraphPoint.

Returns:
the x coordinate of the GraphPoint

setX

public void setX(int x)
Sets the x coordinate for the GraphPoint.

Parameters:
x - the x coordinate

getY

public int getY()
Returns the y coordinate of the GraphPoint.

Returns:
the y coordinate of the GraphPoint

setY

public void setY(int y)
Sets the y coordinate for the GraphPoint.

Parameters:
y - the y coordinate

setRelease

public void setRelease(int release)
Sets internal release number. The internal release number is used for assigning different graphical representation for each release.

Parameters:
release - the internal release number

hideText

public void hideText(boolean hiddenText)
Sets whether or not the requirement text sould be hidden in the GraphWindow.

Parameters:
hiddenText - set to true to hide the text

getRequirement

public Requirement getRequirement()
Returns the Requirement for this GraphPoint.

Returns:
the GraphPoint's Requirement

draw

public void draw(java.awt.Graphics g)
Draws the GraphPoint and Requirement text.

Parameters:
g - the Graphics to draw upon

circle

private void circle(int cx,
                    int cy,
                    int radius,
                    java.awt.Graphics g)
Each GraphPoint is represented by one or more circles, this method draws those circles.

Parameters:
cx - the circle's x coordinate
cy - the circle's y coordinate
radius - the circle's radius
g - the Graphics to draw upon

selectedBy

public boolean selectedBy(int xPos,
                          int yPos)
Returns true if (xPos, yPos) is within the GraphPoint's outer circle.

Parameters:
xPos - x coordinate
yPos - y coordinate
Returns:
true if the GraphPoint can be selected from the position (xPos, yPos)

highlight

public void highlight()
Highlights the GraphPoint


unhighlight

public void unhighlight()
Unhighlights the GraphPoint


isHighLighted

public boolean isHighLighted()
Checks whether or not the GraphPoint is highlighted.

Returns:
true if GraphPoint is highlighted

invertPoint

public void invertPoint(int canvasWidth,
                        int canvasHeight)
Inverts a point in the graph by switching the x-axis with the y-axis.

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