org.problets.lib.conceptmap.view.userbuilt
Class UserBuiltLinkView

java.lang.Object
  extended by org.problets.lib.conceptmap.view.LinkView
      extended by org.problets.lib.conceptmap.view.userbuilt.UserBuiltLinkView

public class UserBuiltLinkView
extends LinkView

Derived from LinkView. Adds to the functionality of a link view in order to handle a user-built node view. User-built link views have an extra flag, isCorrect, which enable them to give feedback to the user (by being drawn red for incorrect and green for correct)

Author:
Adrian Maries

Constructor Summary
UserBuiltLinkView(UserBuiltNodeView source, UserBuiltNodeView target, UserBuiltLinkModel linkModel)
          Creates a UserBuiltLinkView object using the source and target node views and the link model as arguments.
 
Method Summary
 boolean isOnLink(int xPos, int yPos)
          Checks if any mouse event (given by the coordinates passed as arguments) occurred inside this link view.
static void main(java.lang.String[] args)
           
 
Methods inherited from class org.problets.lib.conceptmap.view.LinkView
draw, getIsHighlighted, getIsVisible, getSource, getTarget, setIsHighlighted, setIsVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserBuiltLinkView

public UserBuiltLinkView(UserBuiltNodeView source,
                         UserBuiltNodeView target,
                         UserBuiltLinkModel linkModel)
Creates a UserBuiltLinkView object using the source and target node views and the link model as arguments.

Parameters:
source - the source (originating) node view
target - the target (destinatiuon) node view
linkModel - the link model for which this view is created
Method Detail

isOnLink

public boolean isOnLink(int xPos,
                        int yPos)
Checks if any mouse event (given by the coordinates passed as arguments) occurred inside this link view.

Parameters:
x - the x-coordinate of the mouse event
y - the y-coordinate of the mouse event
Returns:
true if a mouse event occurred inside this link view, false otherwise

main

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