unbbayes.prs
Class Edge

java.lang.Object
  extended by unbbayes.prs.Edge
All Implemented Interfaces:
Serializable

public class Edge
extends Object
implements Serializable

This class represents an edge between two nodes.

Author:
Michael Onishi, Rommel Carvalho
See Also:
Serialized Form

Constructor Summary
Edge(Node no1, Node no2)
          Creates an edge from node1 to node2.
 
Method Summary
 void changeDirection()
          Muda a direÔøΩÔøΩo do arco.
 boolean equals(Object obj)
           
static Color getColor()
          Get the edge's color.
 Node getDestinationNode()
          Retorna o segundo nÔøΩ associado ao arco.
 Point2D.Double getDestinationPosition()
           
 Node getOriginNode()
          Retorna o primeiro nÔøΩ associado ao arco.
 Point2D.Double getOriginPosition()
           
 boolean hasDirection()
          Retorna o status de direÔøΩÔøΩo do arco.
 boolean isPointInDrawableArea(int x, int y)
           
 boolean isSelected()
           
static void setColor(int rgb)
          Set the edge's color.
 void setDestinationPosition(double x, double y)
           
 void setDirection(boolean direction)
          Modifica o status de direÔøΩÔøΩo do arco.
 void setOriginPosition(double x, double y)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Edge

public Edge(Node no1,
            Node no2)
Creates an edge from node1 to node2.

Parameters:
node1 - starting node
node2 - destination node
Method Detail

setDirection

public void setDirection(boolean direction)
Modifica o status de direÔøΩÔøΩo do arco.

Parameters:
direction - status de existÔøΩncia de direÔøΩÔøΩo.

getOriginNode

public Node getOriginNode()
Retorna o primeiro nÔøΩ associado ao arco.

Returns:
o primeiro nÔøΩ associado ao arco.

getDestinationNode

public Node getDestinationNode()
Retorna o segundo nÔøΩ associado ao arco.

Returns:
o segundo nÔøΩ associado ao arco.

hasDirection

public boolean hasDirection()
Retorna o status de direÔøΩÔøΩo do arco.

Returns:
status de direÔøΩÔøΩo.

changeDirection

public void changeDirection()
Muda a direÔøΩÔøΩo do arco. O pai vira filho e o filho vira pai


toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getColor

public static Color getColor()
Get the edge's color.

Returns:
The edge's color.

setColor

public static void setColor(int rgb)
Set the edge's color.

Parameters:
rgb - The edge's RGB color.

isPointInDrawableArea

public boolean isPointInDrawableArea(int x,
                                     int y)

isSelected

public boolean isSelected()

getOriginPosition

public Point2D.Double getOriginPosition()

setOriginPosition

public void setOriginPosition(double x,
                              double y)

getDestinationPosition

public Point2D.Double getDestinationPosition()

setDestinationPosition

public void setDestinationPosition(double x,
                                   double y)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.