com.tensegrity.graph.view
Class VisualPortAssignmentPredicate

java.lang.Object
  extended bycom.tensegrity.graph.view.VisualPortAssignmentPredicate
Direct Known Subclasses:
VisualPortAssignmentPredicate.AnglePredicate, VisualPortAssignmentPredicate.BottomToTopPredicate, VisualPortAssignmentPredicate.CenterBothPredicate, VisualPortAssignmentPredicate.ConstrainedDenotationNamePredicate, VisualPortAssignmentPredicate.ConstrainedDirectionPredicate, VisualPortAssignmentPredicate.ConstrainedShortestDistancePredicate, VisualPortAssignmentPredicate.DenotationNamePredicate, VisualPortAssignmentPredicate.DirectionPredicate, VisualPortAssignmentPredicate.IdPredicate, VisualPortAssignmentPredicate.LeftToRightPredicate, VisualPortAssignmentPredicate.RestrictedDirectionPredicate, VisualPortAssignmentPredicate.RightToLeftPredicate, VisualPortAssignmentPredicate.ShortestDistancePredicate, VisualPortAssignmentPredicate.SubgraphDeepestNodeDenotationNamePredicate, VisualPortAssignmentPredicate.SubgraphDeepestNodeShortestDistancePredicate, VisualPortAssignmentPredicate.SubgraphInnerNodeDenotationNamePredicate, VisualPortAssignmentPredicate.TopToBottomPredicate

public abstract class VisualPortAssignmentPredicate
extends java.lang.Object

The class VisualPortAssignmentPredicate contains predefined predicates that can be used for angle or direction-based port reassignment. Custom implementations can return a certain port for a certain connection. Returning null from the predicate will inhibit that the connection is reassigned to another port.

Version:
$Id: VisualPortAssignmentPredicate.java,v 1.54 2005/09/27 12:04:04 MichaelKegel Exp $
Author:
S. Rutz, MKegel

Nested Class Summary
static class VisualPortAssignmentPredicate.AnglePredicate
          Updates the ports accourding to the angle between the center of the source node and the center of the target node.
static class VisualPortAssignmentPredicate.BottomToTopPredicate
          This class is a simple implementation of the visualport assignment predicate, that assigns bottom-to-top ports (based on source/target nodes of an edge).
static class VisualPortAssignmentPredicate.CenterBothPredicate
          This class is a simple implementation of the visualport assignment predicate, that always assigns center ports.
static class VisualPortAssignmentPredicate.ConstrainedDenotationNamePredicate
          Updates the ports accourding to the given name but allows only the specified ports and does not consider other ports that have the desired denotation name.
static class VisualPortAssignmentPredicate.ConstrainedDirectionPredicate
          Updates the ports accourding to the angle.
static class VisualPortAssignmentPredicate.ConstrainedShortestDistancePredicate
          Updates the ports according to the distance but constrained to the given VisualNode.
static class VisualPortAssignmentPredicate.DenotationNamePredicate
          Updates the ports accourding to the given name.
static class VisualPortAssignmentPredicate.DirectionPredicate
          Updates the ports accourding to the angle.
static class VisualPortAssignmentPredicate.IdPredicate
          This class is a simple implementation of the visualport assignment predicate, that assigns by id.
static class VisualPortAssignmentPredicate.LeftToRightPredicate
          This class is a simple implementation of the visualport assignment predicate, that assigns left-to-right ports (based on source/target nodes of an edge).
static class VisualPortAssignmentPredicate.RestrictedDirectionPredicate
          Updates the ports accourding to the angle with an additional restriction.
static class VisualPortAssignmentPredicate.RightToLeftPredicate
          This class is a simple implementation of the visualport assignment predicate, that assigns right-to-left ports (based on source/target nodes of an edge).
static class VisualPortAssignmentPredicate.ShortestDistancePredicate
          Updates the ports accourding to the distance.
static class VisualPortAssignmentPredicate.SubgraphDeepestNodeDenotationNamePredicate
           
static class VisualPortAssignmentPredicate.SubgraphDeepestNodeShortestDistancePredicate
           
static class VisualPortAssignmentPredicate.SubgraphInnerNodeDenotationNamePredicate
           
static class VisualPortAssignmentPredicate.TopToBottomPredicate
          This class is a simple implementation of the visualport assignment predicate, that assigns top-to-bottom ports (based on source/target nodes of an edge).
 
Constructor Summary
VisualPortAssignmentPredicate()
           
 
Method Summary
abstract  VisualPort apply(VisualGraph visualgraph, VisualEdge visualedge, VisualNode visualnode, VisualPort visualport, boolean isSource)
          This is the predicate method an implementer of this specification must provide.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisualPortAssignmentPredicate

public VisualPortAssignmentPredicate()
Method Detail

apply

public abstract VisualPort apply(VisualGraph visualgraph,
                                 VisualEdge visualedge,
                                 VisualNode visualnode,
                                 VisualPort visualport,
                                 boolean isSource)
This is the predicate method an implementer of this specification must provide. Information about the current processed edge/port (node), in other words a connection, is supplied to the method by the following arguments. In other words, this method receives a single connection of an edge to a port as its input. It then may process this connection and adjust it by returning the new desired port. The new port must be assigned to the same node as the original port. An assignment of the connection to another node is not allowed in the context of a port reassignment. You may return null if you don't want to reassign the connection to another port. Otherwise return a new port on the same node. This is the major invariant you must obey when you implement your own predicates. The new port is only valid if it is in the same VisualNode as the old port. Another invariant affects the incoming arguments of the method. The incoming port VisualPort must always be a port that is associated with the incoming VisualNode.

Parameters:
visualgraph - the VisualGraph the connection is in.
visualedge - the VisualEdge that is previously connected.
visualnode - the VisualNode that is previously connected.
visualport - the VisualPort that is previously connected.
isSource - false if the connection is a target end, true if the connection is a source end.

Find more information in the class documentation



Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.