Class FitGraphToViewJob<V extends VisualVertex,​E extends VisualEdge<V>>

  • Type Parameters:
    V - the vertex type
    E - the edge type
    All Implemented Interfaces:
    GraphJob

    public class FitGraphToViewJob<V extends VisualVertex,​E extends VisualEdge<V>>
    extends java.lang.Object
    implements GraphJob
    A job to scale one or more viewers such that the contained graph will fit entirely inside the viewing area.
    • Constructor Summary

      Constructors 
      Constructor Description
      FitGraphToViewJob​(edu.uci.ics.jung.visualization.VisualizationServer<V,​E>... viewers)  
      FitGraphToViewJob​(edu.uci.ics.jung.visualization.VisualizationServer<V,​E> viewer, boolean onlyResizeWhenTooBig)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canShortcut()
      Returns true if the job can be told to stop running, but to still perform any final work before being done.
      void dispose()
      Call to immediately stop this job, ignoring any exceptions or state issues that arise.
      void execute​(GraphJobListener listener)
      Tells this job to do its work.
      boolean isFinished()
      Returns true if this job has finished its work
      void shortcut()
      Tells this job to stop running, but to still perform any final work before being done.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • FitGraphToViewJob

        @SafeVarargs
        public FitGraphToViewJob​(edu.uci.ics.jung.visualization.VisualizationServer<V,​E>... viewers)
      • FitGraphToViewJob

        public FitGraphToViewJob​(edu.uci.ics.jung.visualization.VisualizationServer<V,​E> viewer,
                                 boolean onlyResizeWhenTooBig)
    • Method Detail

      • canShortcut

        public boolean canShortcut()
        Description copied from interface: GraphJob
        Returns true if the job can be told to stop running, but to still perform any final work before being done.
        Specified by:
        canShortcut in interface GraphJob
        Returns:
        true if the job can be shortcut
      • execute

        public void execute​(GraphJobListener listener)
        Description copied from interface: GraphJob
        Tells this job to do its work. This call will be on the Swing thread. It is required that the given listener be called on the Swing thread when the job is finished.
        Specified by:
        execute in interface GraphJob
        Parameters:
        listener - the listener this job is expected to call when its work is finished
      • isFinished

        public boolean isFinished()
        Description copied from interface: GraphJob
        Returns true if this job has finished its work
        Specified by:
        isFinished in interface GraphJob
        Returns:
        true if this job has finished its work
      • shortcut

        public void shortcut()
        Description copied from interface: GraphJob
        Tells this job to stop running, but to still perform any final work before being done.

        Note: if your job is multi-threaded, then you must make sure to end your thread and work before returning from this method. If that cannot be done in a timely manner, then your GraphJob.canShortcut() should return false.

        Specified by:
        shortcut in interface GraphJob
      • dispose

        public void dispose()
        Description copied from interface: GraphJob
        Call to immediately stop this job, ignoring any exceptions or state issues that arise.
        Specified by:
        dispose in interface GraphJob
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object