Class Experiment2GraphHelper
java.lang.Object
de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.layout_control.helper_classes.Experiment2GraphHelper
- All Implemented Interfaces:
BackgroundTaskStatusProvider
,BackgroundTaskStatusProviderSupportingExternalCall
,HelperClass
public class Experiment2GraphHelper extends Object implements BackgroundTaskStatusProviderSupportingExternalCall, HelperClass
- Author:
- klukas To change the template for this generated type comment go to Window - Preferences - Java - Code Generation - Code and Comments
-
Field Summary
Fields Modifier and Type Field Description static String
mapFolder
static String
mapVarName
-
Constructor Summary
Constructors Constructor Description Experiment2GraphHelper()
-
Method Summary
Modifier and Type Method Description static void
addExperimentNameInfoToAllLinesForThisSubstanceNode(Node xmlSubstanceNode)
static void
addMappingData2Node(SubstanceInterface xmlSubstanceNode, GraphElement graphNode, String diagramStyle)
static void
addMappingData2Node(SubstanceInterface xmlSubstanceNode, Node graphNode)
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 ExperimentInterface
getMappedDataListFromGraphElement(GraphElement graphElement)
Get a list of mapped xml data that has been assigned to a node (or other GraphElement).static ExperimentInterface
getMappedDataListFromGraphElement(GraphElement graphElement, String mapVarName)
static Integer
getMappedDataListSizeFromGraphElement(GraphElement graphElement)
static XMLAttribute
getXMLdataAttribute(GraphElement graphElement)
MapResult
mapDataToGraphElements(boolean mapAlsoInCaseOfEmptyDataset, ExperimentInterface md, Collection<GraphElement> targetGraphElements, Graph addNewGraphElementsToThisGraph, boolean doUserMapping, String diagramStyle, int minimumLines, boolean considerEnzymeDb, boolean considerMappingToKEGGmapNodes, boolean selectResult)
MapResult
mapDataToGraphElements(boolean mapAlsoInCaseOfEmptyDataset, ExperimentInterface mappingData, Collection<GraphElement> targetGraphElements, Graph addNewGraphElementsToThisGraph, boolean doUserMapping, String diagramStyle, int minimumLines, int diagramsPerRow, boolean considerEnzymeDb, boolean considerMappingToKEGGmapNodes, boolean selectResult)
Maps the data from the XML document to the list of nodesvoid
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
setCurrentStatusText1(String status)
void
setCurrentStatusText2(String status)
void
setCurrentStatusValue(int value)
Override this method and pass a implementor of this interface to any other service method.void
setCurrentStatusValueFine(double value)
void
setCurrentStatusValueFineAdd(double smallProgressStep)
boolean
wantsToStop()
-
Field Details
-
mapFolder
-
mapVarName
-
-
Constructor Details
-
Experiment2GraphHelper
public Experiment2GraphHelper()
-
-
Method Details
-
getMappedDataListFromGraphElement
Get a list of mapped xml data that has been assigned to a node (or other GraphElement).- Returns:
- A list of mapped data or null, if no mapping data is available.
-
getMappedDataListFromGraphElement
public static ExperimentInterface getMappedDataListFromGraphElement(GraphElement graphElement, String mapVarName) -
getXMLdataAttribute
-
getMappedDataListSizeFromGraphElement
-
mapDataToGraphElements
public MapResult mapDataToGraphElements(boolean mapAlsoInCaseOfEmptyDataset, ExperimentInterface md, Collection<GraphElement> targetGraphElements, Graph addNewGraphElementsToThisGraph, boolean doUserMapping, String diagramStyle, int minimumLines, boolean considerEnzymeDb, boolean considerMappingToKEGGmapNodes, boolean selectResult) -
mapDataToGraphElements
public MapResult mapDataToGraphElements(boolean mapAlsoInCaseOfEmptyDataset, ExperimentInterface mappingData, Collection<GraphElement> targetGraphElements, Graph addNewGraphElementsToThisGraph, boolean doUserMapping, String diagramStyle, int minimumLines, int diagramsPerRow, boolean considerEnzymeDb, boolean considerMappingToKEGGmapNodes, boolean selectResult)Maps the data from the XML document to the list of nodes- Parameters:
mapAlsoInCaseOfEmptyDataset
- If true, a mapping will be done although no data points are in the data set. This creates also empty diagrams.doc
- The XML Document with the experimental data.targetGraphElements
- The node list where the data should be mapped.addNewGraphElementsToThisGraph
- If not null, new nodes will be added to this graph if one or more mappings are done for a node, if set to false, each time a mapping is done, the count will be increased. Set this to true, to find out, how many nodes have data mapped.validTimePoints
-validConditons
-- Returns:
- MapResult
-
addMappingData2Node
public static void addMappingData2Node(SubstanceInterface xmlSubstanceNode, GraphElement graphNode, String diagramStyle) -
addMappingData2Node
-
addExperimentNameInfoToAllLinesForThisSubstanceNode
-
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.
-
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
-
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).
-
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
-
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
-
setCurrentStatusValueFine
public void setCurrentStatusValueFine(double value)- Specified by:
setCurrentStatusValueFine
in interfaceBackgroundTaskStatusProviderSupportingExternalCall
-
wantsToStop
public boolean wantsToStop()- Specified by:
wantsToStop
in interfaceBackgroundTaskStatusProviderSupportingExternalCall
-
setCurrentStatusText1
- Specified by:
setCurrentStatusText1
in interfaceBackgroundTaskStatusProviderSupportingExternalCall
-
setCurrentStatusText2
- Specified by:
setCurrentStatusText2
in interfaceBackgroundTaskStatusProviderSupportingExternalCall
-
setCurrentStatusValueFineAdd
public void setCurrentStatusValueFineAdd(double smallProgressStep)- Specified by:
setCurrentStatusValueFineAdd
in interfaceBackgroundTaskStatusProviderSupportingExternalCall
-