edu.iu.pcl.absurdist.gui
Class RelationLink

java.lang.Object
  |
  +--edu.iu.pcl.absurdist.absurdist.Relation
        |
        +--edu.iu.pcl.absurdist.gui.RelationLink
All Implemented Interfaces:
java.io.Serializable

public class RelationLink
extends Relation

Class RelationLink: Visual representation of a relation in a concept system graph.

See Also:
Serialized Form

Field Summary
static int ARROW
           
static java.awt.Color[] colors
          color set for mapping relation label types
static int PLAIN
          line styles to indicate relation direction
static int W
          maximum link width
 
Fields inherited from class edu.iu.pcl.absurdist.absurdist.Relation
concepts, model, weight
 
Constructor Summary
RelationLink(Relation relation, ConceptSystem system, ConceptGraph graph)
          Creates a relation link by encoding its relation features.
 
Method Summary
static int direct2style(boolean directed)
          Encodes relation direction into link style.
static void drawArrow(java.awt.Graphics g, int x1, int y1, int x2, int y2, int w, double l)
          Draws an arrow from point P1(x1, y1) to point P2(x2, y2).
 ConceptNode getNode1()
          Returns the 1st concept in the relation.
 ConceptNode getNode2()
          Returns the 2nd concept in the relation.
static java.awt.Color label2color(RelationModel model, java.util.Vector models)
          Encodes relation label into link color.
 void paint(java.awt.Graphics2D g)
          Paints the object.
 java.lang.String toString()
          String representation.
static int weight2width(double weight)
          Encodes relation weight into link width.
 
Methods inherited from class edu.iu.pcl.absurdist.absurdist.Relation
addNoise, compareTo, difWeight, getConcept1, getConcept2, getLabel, isDirected, isWeighted
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

colors

public static java.awt.Color[] colors
color set for mapping relation label types


PLAIN

public static final int PLAIN
line styles to indicate relation direction

See Also:
Constant Field Values

ARROW

public static final int ARROW
See Also:
Constant Field Values

W

public static final int W
maximum link width

See Also:
Constant Field Values
Constructor Detail

RelationLink

public RelationLink(Relation relation,
                    ConceptSystem system,
                    ConceptGraph graph)
Creates a relation link by encoding its relation features.

Method Detail

label2color

public static java.awt.Color label2color(RelationModel model,
                                         java.util.Vector models)
Encodes relation label into link color.


weight2width

public static int weight2width(double weight)
Encodes relation weight into link width.


direct2style

public static int direct2style(boolean directed)
Encodes relation direction into link style.


getNode1

public ConceptNode getNode1()
Returns the 1st concept in the relation.


getNode2

public ConceptNode getNode2()
Returns the 2nd concept in the relation.


drawArrow

public static void drawArrow(java.awt.Graphics g,
                             int x1,
                             int y1,
                             int x2,
                             int y2,
                             int w,
                             double l)
Draws an arrow from point P1(x1, y1) to point P2(x2, y2).

Parameters:
w - the arrow end width;
l - the ratio between arrow end length and line length.

paint

public void paint(java.awt.Graphics2D g)
Paints the object.


toString

public java.lang.String toString()
String representation.

Overrides:
toString in class Relation