com.tensegrity.graph.view
Class VisualPortAssignmentPredicate.AnglePredicate

java.lang.Object
  extended bycom.tensegrity.graph.view.VisualPortAssignmentPredicate
      extended bycom.tensegrity.graph.view.VisualPortAssignmentPredicate.AnglePredicate
Enclosing class:
VisualPortAssignmentPredicate

public static final class VisualPortAssignmentPredicate.AnglePredicate
extends VisualPortAssignmentPredicate

Updates the ports accourding to the angle between the center of the source node and the center of the target node. Depends to the organisation of visual ports in the follwing order (x/y) index 0 = center/center index 1 = center/top index 2 = center/bottom index 3 = left/center index 4 = right/center


Nested Class Summary
 
Nested classes inherited from class com.tensegrity.graph.view.VisualPortAssignmentPredicate
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
 
Constructor Summary
VisualPortAssignmentPredicate.AnglePredicate()
          Constructs a new AnglePredicate.
VisualPortAssignmentPredicate.AnglePredicate(int argument)
          Constructs a new AnglePredicate.
 
Method Summary
 VisualPort apply(VisualGraph visualgraph, VisualEdge visualedge, VisualNode visualnode, VisualPort visualport, boolean isSource)
          This is the predicate method an implementer of this specification must provide.
 void setConstraint(VisualNode visualnode)
          Sets a VisualNode that the selected port must be pointing to as a constraint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisualPortAssignmentPredicate.AnglePredicate

public VisualPortAssignmentPredicate.AnglePredicate()
Constructs a new AnglePredicate.


VisualPortAssignmentPredicate.AnglePredicate

public VisualPortAssignmentPredicate.AnglePredicate(int argument)
Constructs a new AnglePredicate.

Parameters:
argument - additional argument.
Method Detail

setConstraint

public void setConstraint(VisualNode visualnode)
Sets a VisualNode that the selected port must be pointing to as a constraint.

Parameters:
visualnode - constraining VisualNode.

apply

public VisualPort apply(VisualGraph visualgraph,
                        VisualEdge visualedge,
                        VisualNode visualnode,
                        VisualPort visualport,
                        boolean isSource)
Description copied from class: VisualPortAssignmentPredicate
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.

Specified by:
apply in class VisualPortAssignmentPredicate
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.


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