Cytoscape 2.8.0 API

cytoscape.actions
Class LoadNetworkTask

java.lang.Object
  extended by cytoscape.actions.LoadNetworkTask
All Implemented Interfaces:
Haltable, Task, Runnable

public class LoadNetworkTask
extends Object
implements Task

Task to load a new network.


Method Summary
 String getTitle()
          Gets the Task Title.
 void halt()
          Halts the Task: Not Currently Implemented.
static void loadFile(File file, boolean skipMessage)
          Load a network from a file.
static void loadFile(File file, boolean skipMessage, CyLayoutAlgorithm layoutAlgorithm)
          Load a network from a file.
static void loadURL(URL u, boolean skipMessage)
          Load a network from a url.
static void loadURL(URL u, boolean skipMessage, CyLayoutAlgorithm layoutAlgorithm)
          Load a network from a url.
 void run()
          Executes Task.
 void setTaskMonitor(TaskMonitor taskMonitor)
          Sets the Task Monitor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadURL

public static void loadURL(URL u,
                           boolean skipMessage)
Load a network from a url. The reader code will attempt to determine the format of the network (GML, XGMML, SIF) from the HTTP content-type header. If it is unable to figure it out from there, it will try writing the HTTP stream to a file to look at the first couple of bytes. Note that the actual opening of the HTTP stream is postponed until the task is initiated to facility the ability of the user to abort the attempt.

Parameters:
u - the URL to load the network from
skipMessage - if true, dispose of the task monitor dialog immediately

loadFile

public static void loadFile(File file,
                            boolean skipMessage)
Load a network from a file. The reader code will attempt to determine the format of the network (GML, XGMML, SIF) from the file extension. If it is unable to figure it out from there, it will try reading the the first couple of bytes from the file.

Parameters:
file - the file to load the network from
skipMessage - if true, dispose of the task monitor dialog immediately

loadURL

public static void loadURL(URL u,
                           boolean skipMessage,
                           CyLayoutAlgorithm layoutAlgorithm)
Load a network from a url. The reader code will attempt to determine the format of the network (GML, XGMML, SIF) from the HTTP content-type header. If it is unable to figure it out from there, it will try writing the HTTP stream to a file to look at the first couple of bytes. Note that the actual opening of the HTTP stream is postponed until the task is initiated to facility the ability of the user to abort the attempt.

Parameters:
u - the URL to load the network from
skipMessage - if true, dispose of the task monitor dialog immediately
layoutAlgorithm - if this is non-null, use this algorithm to lay out the network after it has been read in (provided that a view was created).

loadFile

public static void loadFile(File file,
                            boolean skipMessage,
                            CyLayoutAlgorithm layoutAlgorithm)
Load a network from a file. The reader code will attempt to determine the format of the network (GML, XGMML, SIF) from the file extension. If it is unable to figure it out from there, it will try reading the the first couple of bytes from the file.

Parameters:
file - the file to load the network from
skipMessage - if true, dispose of the task monitor dialog immediately
layoutAlgorithm - if this is non-null, use this algorithm to lay out the network after it has been read in (provided that a view was created).

run

public void run()
Executes Task.

Specified by:
run in interface Task
Specified by:
run in interface Runnable

halt

public void halt()
Halts the Task: Not Currently Implemented.

Specified by:
halt in interface Haltable
Specified by:
halt in interface Task

setTaskMonitor

public void setTaskMonitor(TaskMonitor taskMonitor)
                    throws IllegalThreadStateException
Sets the Task Monitor.

Specified by:
setTaskMonitor in interface Task
Parameters:
taskMonitor - TaskMonitor Object.
Throws:
IllegalThreadStateException - Indicates that the TaskMonitor has already been set.

getTitle

public String getTitle()
Gets the Task Title.

Specified by:
getTitle in interface Task
Returns:
Task Title.

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.