Class GraphCanvas.DirectionDisplayPredicate

  • All Implemented Interfaces:
    org.apache.commons.collections15.Predicate
    Enclosing class:
    GraphCanvas

    protected static final class GraphCanvas.DirectionDisplayPredicate
    extends java.lang.Object
    implements org.apache.commons.collections15.Predicate
    A prdicate class that shows arrows for directed edges and hides them for undirected edges.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean show_d
      Show arrows for directed edges
      protected boolean show_u
      Show arrows for undirected edges (on both sides)
    • Constructor Summary

      Constructors 
      Constructor Description
      DirectionDisplayPredicate​(boolean show_d, boolean show_u)
      Creates the predicate.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean evaluate​(java.lang.Object context)
      Use the specified parameter to perform a test that returns true or false.
      void showDirected​(boolean b)
      Set the predicate for directed edges.
      void showUndirected​(boolean b)
      Set the predicate for undirected edges.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • show_d

        protected boolean show_d
        Show arrows for directed edges
      • show_u

        protected boolean show_u
        Show arrows for undirected edges (on both sides)
    • Constructor Detail

      • DirectionDisplayPredicate

        public DirectionDisplayPredicate​(boolean show_d,
                                         boolean show_u)
        Creates the predicate.
        Parameters:
        show_d - true if arrows are shown for directed edges.
        show_u - true if arrows are shown for undirected edges.
    • Method Detail

      • showDirected

        public void showDirected​(boolean b)
        Set the predicate for directed edges.
        Parameters:
        b - true if arrows are shown for directed edges.
      • showUndirected

        public void showUndirected​(boolean b)
        Set the predicate for undirected edges.
        Parameters:
        b - true if arrows are shown for undirected edges.
      • evaluate

        public boolean evaluate​(java.lang.Object context)
        Use the specified parameter to perform a test that returns true or false. Returns true if the arrow ought to be shown, else false.
        Specified by:
        evaluate in interface org.apache.commons.collections15.Predicate