drvgraph.j2d
Class Connection

java.lang.Object
  extended by java.awt.geom.Line2D
      extended by java.awt.geom.Line2D.Double
          extended by drvgraph.j2d.Connection
All Implemented Interfaces:
java.awt.Shape, java.io.Serializable, java.lang.Cloneable

public class Connection
extends java.awt.geom.Line2D.Double

Represents an arc in the rule graph.
The Connection is identified by the "incoming" graph element (i.e. the graph element the arc commences from) and the "outgoing" graph element (i.e. the graph element the arc "lands" on).
Connections can only belong to one of the following types:

The specific class represents only arrow-like connections, but can be easily extended to represent other connection types as well (e.g. superiority relationships in defeasible reasoning).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Line2D
java.awt.geom.Line2D.Double, java.awt.geom.Line2D.Float
 
Field Summary
 
Fields inherited from class java.awt.geom.Line2D.Double
x1, x2, y1, y2
 
Constructor Summary
Connection(ClassPattern in, boolean neg, Rule out)
          Constructs a connection commencing from a class pattern and landing on a rule circle.
Connection(ClassPattern in, Naf out)
          Constructs a connection commencing from a class pattern and landing on a naf triangle.
Connection(Naf in, Rule out)
          Constructs a connection commencing from a naf triangle and landing on a rule circle.
Connection(Rule in, ClassPattern out, boolean neg)
          Constructs a connection commencing from a rule circle and landing on a class pattern.
Connection(Rule in, Rule out)
           
 
Method Summary
 void paint(java.awt.Graphics g)
          Draws the connection.
 
Methods inherited from class java.awt.geom.Line2D.Double
getBounds2D, getP1, getP2, getX1, getX2, getY1, getY2, setLine
 
Methods inherited from class java.awt.geom.Line2D
clone, contains, contains, contains, contains, getBounds, getPathIterator, getPathIterator, intersects, intersects, intersectsLine, intersectsLine, linesIntersect, ptLineDist, ptLineDist, ptLineDist, ptLineDistSq, ptLineDistSq, ptLineDistSq, ptSegDist, ptSegDist, ptSegDist, ptSegDistSq, ptSegDistSq, ptSegDistSq, relativeCCW, relativeCCW, relativeCCW, setLine, setLine
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Connection

public Connection(ClassPattern in,
                  boolean neg,
                  Rule out)
Constructs a connection commencing from a class pattern and landing on a rule circle. The boolean variable indicates whether the class pattern is negated or not.

Parameters:
in - the class pattern the arrow commences from
neg - the boolean variable indicating whether the class pattern is negated or not
out - the rule circle the connection lands on
See Also:
ClassPattern, Rule

Connection

public Connection(Rule in,
                  ClassPattern out,
                  boolean neg)
Constructs a connection commencing from a rule circle and landing on a class pattern. The boolean variable indicates whether the class pattern is negated or not.

Parameters:
in - the rule circle the arrow commences from
out - the class pattern the connection lands on
neg - the boolean variable indicating whether the class pattern is negated or not
See Also:
Rule, ClassPattern

Connection

public Connection(Rule in,
                  Rule out)

Connection

public Connection(ClassPattern in,
                  Naf out)
Constructs a connection commencing from a class pattern and landing on a naf triangle. This time there is no boolean variable indicating whether the class pattern is negated or not, since the arrow always commences from the positive part of the class pattern.

Parameters:
in - the class pattern the arrow commences from
out - the naf triangle the arrow lands on
See Also:
ClassPattern, Naf

Connection

public Connection(Naf in,
                  Rule out)
Constructs a connection commencing from a naf triangle and landing on a rule circle.

Parameters:
in - the naf triangle the arrow commences from
out - the rule circle the connection lands on
See Also:
Naf, Rule
Method Detail

paint

public void paint(java.awt.Graphics g)
Draws the connection.

Parameters:
g - the Graphics component that draws the connection
See Also:
Graphics