Class KeggService
java.lang.Object
de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.layout_control.kegg.KeggService
- All Implemented Interfaces:
BackgroundTaskStatusProvider
,HelperClass
public class KeggService extends Object implements BackgroundTaskStatusProvider, HelperClass
-
Constructor Summary
Constructors Constructor Description KeggService()
-
Method Summary
Modifier and Type Method Description static void
colorizeEnzymesGlycansCompounds(Graph graph, String mapName, Color enzymeColor, boolean markNotPresent, boolean orthologs, boolean enzymes, boolean glycans, boolean compounds, boolean convertTypeToGeneWhenProcessingOrthologs)
String
getCurrentStatusMessage1()
Returns a status message on what is going on.String
getCurrentStatusMessage2()
Returns a status message on what is going on.int
getCurrentStatusValue()
Returns the completion status.double
getCurrentStatusValueFine()
Same asgetCurrentStatusValue()
, but this method should return a finer granted progress value.static Color
getDefaultEnzymeColor()
static Graph
getKeggPathwayGravistoGraph(KeggPathwayEntry myEntry, boolean showErrorMessages, Color enzymeColors)
static Graph
getKeggPathwayGravistoGraph(KeggPathwayEntry myEntry, boolean showErrorMessages, Color enzymeColors, boolean includeMapNodes)
static boolean
loadKeggPathwayIntoEditor(KeggPathwayEntry myEntry, Graph loadBlockingIntoThisGraph, Color enzymeColor, boolean separateClusters)
If loadBlockingIntoThisGraph is != null, this method adds the loaded graph to the given graph instance.static void
loadKeggPathwayIntoGraph(InputStream in, Graph g, Color enzymeColor)
static void
loadPathway(KeggPathwayEntry myEntry, boolean processLabels)
static void
loadPathway(KeggPathwayEntry myEntry, Graph targetGraph, boolean processLabels)
static void
loadPathway(KeggPathwayEntry myEntry, Graph targetGraph, Node initialMapNode, boolean processLabels)
static void
loadPathway(KeggPathwayEntry myEntry, Graph targetGraph, Node initialMapNode, boolean askForNewWindow, boolean separateClusters)
static void
mergeKeggGraphs(Graph mergeIntoThisGraph, Graph newGraph, Vector2d centerOfNewGraph, boolean linkToExistingMaps, boolean clusterSeparation)
void
pleaseContinueRun()
This method is called as soon as the user indicates that he is comfortable to let the algorithm continue its work.void
pleaseStop()
If this method is called on the status provider, the linked work task should stop its execution as soon as possible.boolean
pluginWaitsForUser()
void
processKeggTree(JTree keggTree, HashMap<KeggPathwayEntry,DefaultMutableTreeNode> pathwayToTreeNodeMap)
void
setCurrentStatusValue(int value)
Override this method and pass a implementor of this interface to any other service method.
-
Constructor Details
-
KeggService
public KeggService()
-
-
Method Details
-
loadKeggPathwayIntoEditor
public static boolean loadKeggPathwayIntoEditor(KeggPathwayEntry myEntry, Graph loadBlockingIntoThisGraph, Color enzymeColor, boolean separateClusters)If loadBlockingIntoThisGraph is != null, this method adds the loaded graph to the given graph instance. If this parameter is NULL (default), then this method returns immediately and opens a new graph window editor.- Parameters:
myEntry
-loadBlockingIntoThisGraph
-
-
mergeKeggGraphs
-
loadPathway
-
loadPathway
-
loadPathway
public static void loadPathway(KeggPathwayEntry myEntry, Graph targetGraph, Node initialMapNode, boolean processLabels) -
loadPathway
public static void loadPathway(KeggPathwayEntry myEntry, Graph targetGraph, Node initialMapNode, boolean askForNewWindow, boolean separateClusters) -
getKeggPathwayGravistoGraph
public static Graph getKeggPathwayGravistoGraph(KeggPathwayEntry myEntry, boolean showErrorMessages, Color enzymeColors) throws org.jdom2.JDOMException, IOException, MalformedURLException- Throws:
org.jdom2.JDOMException
IOException
MalformedURLException
-
getKeggPathwayGravistoGraph
public static Graph getKeggPathwayGravistoGraph(KeggPathwayEntry myEntry, boolean showErrorMessages, Color enzymeColors, boolean includeMapNodes) throws org.jdom2.JDOMException, IOException, MalformedURLException- Throws:
org.jdom2.JDOMException
IOException
MalformedURLException
-
colorizeEnzymesGlycansCompounds
-
processKeggTree
public void processKeggTree(JTree keggTree, HashMap<KeggPathwayEntry,DefaultMutableTreeNode> pathwayToTreeNodeMap)- Parameters:
keggTree
-keggTree
-
-
getCurrentStatusValue
public int getCurrentStatusValue()Description copied from interface:BackgroundTaskStatusProvider
Returns the completion status. WARNING: This method must be Thread-Safe!- Specified by:
getCurrentStatusValue
in interfaceBackgroundTaskStatusProvider
- Returns:
- A number from 0..100 which represents the completion status. If -1 is returned, the progress bar is set to "indeterminate", which means, that the progress bar will float from left to right and reverse. (Useful if status can not be determined) Other values let the progressbar disappear.
-
getCurrentStatusValueFine
public double getCurrentStatusValueFine()Description copied from interface:BackgroundTaskStatusProvider
Same asgetCurrentStatusValue()
, but this method should return a finer granted progress value. If this is not needed, the code forgetCurrentStatusValue()
could be reused by the client.- Specified by:
getCurrentStatusValueFine
in interfaceBackgroundTaskStatusProvider
- Returns:
- The current progress value (fine).
-
getCurrentStatusMessage1
Description copied from interface:BackgroundTaskStatusProvider
Returns a status message on what is going on. WARNING: This method must be Thread-Safe!- Specified by:
getCurrentStatusMessage1
in interfaceBackgroundTaskStatusProvider
- Returns:
- A status message, or null if not needed.
-
getCurrentStatusMessage2
Description copied from interface:BackgroundTaskStatusProvider
Returns a status message on what is going on. Is used the same likegetCurrentStatusMessage1
. This second message adds flexibility. If not needed, the first message should be used and this should return null if not needed. WARNING: This method must be Thread-Safe!- Specified by:
getCurrentStatusMessage2
in interfaceBackgroundTaskStatusProvider
- Returns:
- A status message, or null if not needed.
-
pleaseStop
public void pleaseStop()Description copied from interface:BackgroundTaskStatusProvider
If this method is called on the status provider, the linked work task should stop its execution as soon as possible.- Specified by:
pleaseStop
in interfaceBackgroundTaskStatusProvider
-
pluginWaitsForUser
public boolean pluginWaitsForUser()- Specified by:
pluginWaitsForUser
in interfaceBackgroundTaskStatusProvider
- Returns:
- Let this method return true in order to show a "Continue" button in
the GUI. When this buttons is clicked, the method
pleaseContinueRun
is called. Use these two methods to let the user interact with the GUI while the algorithm is waiting for the user to be ready for the continued work of the algorithm.
-
pleaseContinueRun
public void pleaseContinueRun()Description copied from interface:BackgroundTaskStatusProvider
This method is called as soon as the user indicates that he is comfortable to let the algorithm continue its work.- Specified by:
pleaseContinueRun
in interfaceBackgroundTaskStatusProvider
-
loadKeggPathwayIntoGraph
-
setCurrentStatusValue
public void setCurrentStatusValue(int value)Description copied from interface:BackgroundTaskStatusProvider
Override this method and pass a implementor of this interface to any other service method. This method can use this call to update the status value.- Specified by:
setCurrentStatusValue
in interfaceBackgroundTaskStatusProvider
-
getDefaultEnzymeColor
-