Class LayoutDecorator<V,​E>

  • All Implemented Interfaces:
    Layout<V,​E>, IterativeContext, org.apache.commons.collections4.Transformer<V,​java.awt.geom.Point2D>

    public abstract class LayoutDecorator<V,​E>
    extends java.lang.Object
    implements Layout<V,​E>, IterativeContext
    a pure decorator for the Layout interface. Intended to be overridden to provide specific behavior decoration
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Layout<V,​E> delegate  
    • Constructor Summary

      Constructors 
      Constructor Description
      LayoutDecorator​(Layout<V,​E> delegate)
      Creates an instance backed by the specified delegate layout.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean done()
      Returns true if this iterative process is finished, and false otherwise.
      Layout<V,​E> getDelegate()
      Returns the backing (delegate) layout.
      edu.uci.ics.jung.graph.Graph<V,​E> getGraph()
      Returns the full graph (the one that was passed in at construction time) that this Layout refers to.
      java.awt.Dimension getSize()
      Returns the current size of the visualization's space.
      void initialize()
      Initializes fields in the node that may not have been set during the constructor.
      boolean isLocked​(V v)
      Returns true if the position of vertex v is locked.
      void lock​(V v, boolean state)
      Sets a flag which fixes this vertex in place.
      void reset()  
      void setDelegate​(Layout<V,​E> delegate)
      Sets the backing (delegate) layout.
      void setGraph​(edu.uci.ics.jung.graph.Graph<V,​E> graph)
      setter for graph
      void setInitializer​(org.apache.commons.collections4.Transformer<V,​java.awt.geom.Point2D> initializer)
      provides initial locations for all vertices.
      void setLocation​(V v, java.awt.geom.Point2D location)
      set the location of a vertex
      void setSize​(java.awt.Dimension d)  
      void step()
      Advances one step.
      java.awt.geom.Point2D transform​(V v)  
      • Methods inherited from class java.lang.Object

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

      • delegate

        protected Layout<V,​E> delegate
    • Constructor Detail

      • LayoutDecorator

        public LayoutDecorator​(Layout<V,​E> delegate)
        Creates an instance backed by the specified delegate layout.
    • Method Detail

      • getDelegate

        public Layout<V,​E> getDelegate()
        Returns the backing (delegate) layout.
      • setDelegate

        public void setDelegate​(Layout<V,​E> delegate)
        Sets the backing (delegate) layout.
      • initialize

        public void initialize()
        Description copied from interface: Layout
        Initializes fields in the node that may not have been set during the constructor. Must be called before the iterations begin.
        Specified by:
        initialize in interface Layout<V,​E>
        See Also:
        Layout.initialize()
      • getSize

        public java.awt.Dimension getSize()
        Description copied from interface: Layout
        Returns the current size of the visualization's space.
        Specified by:
        getSize in interface Layout<V,​E>
        See Also:
        Layout.getSize()
      • getGraph

        public edu.uci.ics.jung.graph.Graph<V,​E> getGraph()
        Description copied from interface: Layout
        Returns the full graph (the one that was passed in at construction time) that this Layout refers to.
        Specified by:
        getGraph in interface Layout<V,​E>
        See Also:
        Layout.getGraph()
      • transform

        public java.awt.geom.Point2D transform​(V v)
        Specified by:
        transform in interface org.apache.commons.collections4.Transformer<V,​E>
        See Also:
        Transformer.transform(Object)
      • lock

        public void lock​(V v,
                         boolean state)
        Description copied from interface: Layout
        Sets a flag which fixes this vertex in place.
        Specified by:
        lock in interface Layout<V,​E>
        Parameters:
        v - vertex
        See Also:
        Layout.lock(Object, boolean)
      • setGraph

        public void setGraph​(edu.uci.ics.jung.graph.Graph<V,​E> graph)
        Description copied from interface: Layout
        setter for graph
        Specified by:
        setGraph in interface Layout<V,​E>