Documentation of 'medusa.dataio.DataLoader' Java class
DataLoader
medusa.dataio

Class DataLoader

  • All Implemented Interfaces:
    java.lang.Runnable


    public class DataLoader
    extends java.lang.Object
    implements java.lang.Runnable
    Class for saving, loading and exporting Graph objects to text file formats. Also writes graphs to postscript and pajek formats.
    • Constructor Detail

      • DataLoader

        public DataLoader(int x,
                          int y)
        Constructs a new DataLoader and passes the graph size information. Usually, graphs are 600x600 in size.
        Parameters:
        width -
        height -
      • DataLoader

        public DataLoader(int x,
                          int y,
                          java.lang.String fileName)
        Parameters:
        width -
        height -
        fileName -
      • DataLoader

        public DataLoader()
    • Method Detail

      • setLoadType

        public void setLoadType(int loadType)
      • start

        public void start()
      • stop

        public void stop()
      • getGraph

        public Graph getGraph()
        Returns:
        the graph object
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • isDone

        public boolean isDone()
      • getStatus

        public java.lang.String getStatus()
      • getProgress

        public int getProgress()
      • isBusy

        public boolean isBusy()
        Lets other methods know if the DataLoader is busy.
        Returns:
        true if busy
      • setFileName

        public void setFileName(java.lang.String fileName)
        The file to load. Set this before running the load thread.
        Parameters:
        fileName -
      • save

        public void save(BasicGraph graph,
                         java.lang.String fileName)
                  throws java.io.IOException
        Writes the graph to file
        Parameters:
        graph -
        fileName -
        Throws:
        java.io.IOException
      • save

        public void save(Graph graph,
                         java.lang.String fileName,
                         double scale)
                  throws java.io.IOException
        This method is not very nice... will need to be rewritten. The scale function is generally messy.
        Throws:
        java.io.IOException
      • load

        public Graph load(java.lang.String fileName)
                   throws java.io.IOException,
                          DataFormatException
        Loads a medusa format file.
        Parameters:
        fileName - File to load
        Returns:
        returns a Graph object which is passed to Medusa
        Throws:
        java.io.IOException
        DataFormatException
      • loadSimplest

        public Graph loadSimplest(java.lang.String fileName)
                           throws java.io.IOException,
                                  DataFormatException
        Loads the simplest possible file of three columns: node1 node2 identity This can be used for instance by biologists who run BLAST searches with the -m 8 option. If identity is greater than 1.0, it is rescaled.
        Parameters:
        fileName -
        Returns:
        Throws:
        java.io.IOException
        DataFormatException
      • readParameters

        public Graph readParameters(java.lang.String edges,
                                    java.lang.String nodes)
        For applets. Get parameter lines, e.g nodes and edges, from the applet context and create a new graph.
        Parameters:
        edges -
        nodes -
        Returns:
      • convertToRealDistances

        public void convertToRealDistances(Graph g)
      • normalizePositions

        public void normalizePositions(Graph g)
      • saveAsPS

        public void saveAsPS(Graph g,
                             java.lang.String saveFileName,
                             MedusaSettings ss)
                      throws java.io.IOException
        Draw the graph to postscript format
        Throws:
        java.io.IOException
      • saveAsPS

        public void saveAsPS(Graph g,
                             java.lang.String saveFileName,
                             MedusaSettings ss,
                             int nodeSize,
                             int fontSize)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • saveAsEPS

        public void saveAsEPS(Graph g,
                              java.lang.String saveFileName,
                              MedusaSettings ss,
                              int nodeSize,
                              int fontSize)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • saveAsPajek

        public void saveAsPajek(Graph g,
                                java.lang.String saveFileName)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • saveAsArena3D

        public void saveAsArena3D(Graph g,
                                  java.lang.String saveFileName)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • saveAsBiolayout

        public void saveAsBiolayout(Graph g,
                                    java.lang.String saveFileName)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • saveAsCytoscape

        public void saveAsCytoscape(Graph g,
                                    java.lang.String saveFileName)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • saveAsGraphViz

        public void saveAsGraphViz(Graph g,
                                   java.lang.String saveFileName)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • saveHTMLParameters

        public void saveHTMLParameters(Graph g,
                                       java.lang.String fileName)
                                throws java.io.IOException
        Throws:
        java.io.IOException

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.