本文整理汇总了Java中org.cytoscape.work.TaskMonitor.setStatusMessage方法的典型用法代码示例。如果您正苦于以下问题:Java TaskMonitor.setStatusMessage方法的具体用法?Java TaskMonitor.setStatusMessage怎么用?Java TaskMonitor.setStatusMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cytoscape.work.TaskMonitor
的用法示例。
在下文中一共展示了TaskMonitor.setStatusMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor taskMonitor) throws Exception {
taskMonitor.setTitle(BuildProperties.APP_NAME);
taskMonitor.setStatusMessage("Removing Clusters");
ShapeAnnotation shape = annotationRenderer.removeShapeAnnoation(cluster);
TextAnnotation text = annotationRenderer.removeTextAnnotation(cluster);
// invokeAndWait forces the shape to update on the current thread
if(shape != null) {
if(SwingUtilities.isEventDispatchThread()) {
shape.removeAnnotation();
} else {
SwingUtilities.invokeAndWait(shape::removeAnnotation);
}
}
if(text != null) {
if(SwingUtilities.isEventDispatchThread()) {
text.removeAnnotation();
} else {
SwingUtilities.invokeAndWait(text::removeAnnotation);
}
}
}
示例2: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor taskMonitor) {
taskMonitor.setTitle(BuildProperties.APP_NAME);
taskMonitor.setStatusMessage("Removing Annotations");
CyNetworkView networkView = networkViewSet.getNetworkView();
List<Annotation> annotations = annotationManager.getAnnotations(networkView);
if(annotations != null) { // seriously?
for(Annotation annotation : annotations) {
try {
SwingUtilities.invokeAndWait(annotation::removeAnnotation);
} catch (Exception e) {}
}
}
for(Cluster cluster : networkViewSet.getAllClusters()) {
annotationRenderer.removeShapeAnnoation(cluster);
annotationRenderer.removeTextAnnotation(cluster);
}
}
示例3: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor taskMonitor) {
taskMonitor.setTitle(BuildProperties.APP_NAME);
taskMonitor.setStatusMessage("Drawing Annotations");
try {
// So basically the task does nothing if the cluster is collapsed.
// This just saves us from having to put an if-statement in the renderer.
if(!cluster.isCollapsed()) {
drawShape();
drawLabel();
}
} catch(Exception e) {
e.printStackTrace();
}
}
示例4: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
/**
* This is fast because no events are fired while the summary network is being built.
* The summary network and view are registered at the end.
*/
@Override
public void run(TaskMonitor taskMonitor) {
taskMonitor.setTitle(BuildProperties.APP_NAME);
taskMonitor.setStatusMessage(SummaryNetworkAction.TITLE);
CyNetwork originNetwork = annotationSet.getParent().getNetwork();
List<SummaryCluster> summaryClusters = getSummaryClusters();
// create summary network
SummaryNetwork summaryNetwork = createSummaryNetwork(originNetwork, summaryClusters);
// create summary network view
CyNetworkView summaryNetworkView = createNetworkView(summaryNetwork);
// apply visual style
applyVisualStyle(annotationSet.getParent().getNetworkView(), summaryNetworkView, summaryNetwork);
// register
networkManager.addNetwork(summaryNetwork.network);
networkViewManager.addNetworkView(summaryNetworkView);
summaryNetworkView.fitContent();
resultNetwork = summaryNetwork.network;
}
示例5: createSifNodeAttr
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
private void createSifNodeAttr(Model model, CyNetwork cyNetwork,
TaskMonitor taskMonitor) throws IOException
{
taskMonitor.setStatusMessage("Updating SIF network node attributes from the BioPAX model...");
// Set the Quick Find Default Index
AttributeUtil.set(cyNetwork, cyNetwork, "quickfind.default_index", CyNetwork.NAME, String.class);
if (cancelled) return;
// Set node attributes from the Biopax Model
for (CyNode node : cyNetwork.getNodeList()) {
String uri = cyNetwork.getRow(node).get(CyNetwork.NAME, String.class);
BioPAXElement e = model.getByID(uri);
if(e instanceof EntityReference || e instanceof Entity)
{
BioPaxMapper.createAttributesFromProperties(e, model, node, cyNetwork);
} else if (e != null) {
log.warn("SIF network has an unexpected node: " + uri + " of type " + e.getModelInterface());
BioPaxMapper.createAttributesFromProperties(e, model, node, cyNetwork);
} else { //should never happen anymore...
log.error("(BUG) the biopax model does not have an object with URI=" + uri);
}
}
}
示例6: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor tm) throws Exception {
tm.setTitle("Adjacency Matrix import");
tm.setStatusMessage("Adjacency Matrix import");
CyNetwork n = readAdjFormat(inputStream, tm);
this.networks = new CyNetwork[]{n};
networkMgr.addNetwork(n);
// GraphsWithValidation gv = checkSchema(inputStream, graphReader);
// Graph[] graphs = gv.getGraphs();
// tm.setProgress(0.50);
//
// tm.setStatusMessage(format("Creating %d networks from \"%s\".", graphs.length, inputName));
// this.networks = mapNetworks(graphs);
// for (CyNetwork n : this.networks)
// networkMgr.addNetwork(n);
//
// // set up evidence table if we have cytoscape networks
// if (this.networks.length > 0) {
// CyTable table = getOrCreateEvidenceTable();
// mapGraphsToEvidenceTable(graphs, table);
// tableMgr.addTable(table);
// }
// m.setProgress(1.0);
}
示例7: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void run(TaskMonitor m) throws Exception {
m.setTitle("Import BEL JSON Graph");
m.setStatusMessage(format("Read and validate \"%s\" against the BEL JSON Graph schema.", inputName));
GraphsWithValidation gv = checkSchema(inputStream, graphReader);
Graph[] graphs = gv.getGraphs();
m.setProgress(0.50);
m.setStatusMessage(format("Creating %d networks from \"%s\".", graphs.length, inputName));
this.networks = mapNetworks(graphs);
for (CyNetwork n : this.networks)
networkMgr.addNetwork(n);
// set up evidence table if we have cytoscape networks
if (this.networks.length > 0) {
CyTable table = getOrCreateEvidenceTable();
mapGraphsToEvidenceTable(graphs, table);
tableMgr.addTable(table);
}
m.setProgress(1.0);
}
示例8: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor monitor) throws Exception {
monitor.setStatusMessage("Executing ForceAtlas2 layout");
List<ExtensionCall> calls = exec.buildExtensionCalls();
double progress = 0.0;
for(ExtensionCall call : calls){
Object callRetValue = plugin.getInteractor().executeExtensionCall(call,false);
exec.processCallResponse(call,callRetValue);
++progress;
monitor.setProgress(progress / ((double)calls.size()));
}
}
示例9: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor taskMonitor) throws Exception {
if (taskMonitor != null) {
taskMonitor.setTitle("Writing to D3-Style JSON");
taskMonitor.setStatusMessage("Writing network in D3.js format...");
taskMonitor.setProgress(-1.0);
}
network2jsonMapper.writeValue(new OutputStreamWriter(outputStream, EncodingUtil.getEncoder()), network);
outputStream.close();
if (taskMonitor != null) {
taskMonitor.setStatusMessage("Success.");
taskMonitor.setProgress(1.0);
}
}
示例10: createSifNodeAttr
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
private void createSifNodeAttr(Model model, CyNetwork cyNetwork,
TaskMonitor taskMonitor) throws IOException
{
taskMonitor.setStatusMessage("Updating SIF network node attributes from the BioPAX model...");
// Set the Quick Find Default Index
Attributes.set(cyNetwork, cyNetwork, "quickfind.default_index", CyNetwork.NAME, String.class);
if (cancelled) return;
// Set node attributes from the Biopax Model
for (CyNode node : cyNetwork.getNodeList()) {
String uri = cyNetwork.getRow(node).get(CyNetwork.NAME, String.class);
BioPAXElement e = model.getByID(uri);
if(e instanceof EntityReference || e instanceof Entity)
{
BioPaxMapper.createAttributesFromProperties(e, model, node, cyNetwork);
} else if (e != null) {
log.warn("SIF network has an unexpected node: " + uri + " of type " + e.getModelInterface());
BioPaxMapper.createAttributesFromProperties(e, model, node, cyNetwork);
} else { //should never happen anymore...
log.error("(BUG) the biopax model does not have an object with URI=" + uri);
}
}
}
示例11: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor taskMonitor) throws Exception {
taskMonitor.setTitle("SAFE: Export Reports");
EnrichmentLandscape landscape = session.getEnrichmentLandscape();
CompositeMap compositeMap = session.getCompositeMap();
AnnotationProvider annotationProvider = landscape.getAnnotationProvider();
writeReports(landscape, compositeMap, EnrichmentLandscape.TYPE_HIGHEST);
if (!annotationProvider.isBinary()) {
writeReports(landscape, compositeMap, EnrichmentLandscape.TYPE_LOWEST);
}
taskMonitor.setStatusMessage("Reports exported successfully");
}
示例12: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor taskMonitor) throws Exception {
taskMonitor.setTitle("SAFE: Export Reports");
EnrichmentLandscape landscape = session.getEnrichmentLandscape();
AnnotationProvider annotationProvider = landscape.getAnnotationProvider();
writeReports(landscape, EnrichmentLandscape.TYPE_HIGHEST);
if (!annotationProvider.isBinary()) {
writeReports(landscape, EnrichmentLandscape.TYPE_LOWEST);
}
taskMonitor.setStatusMessage("Reports exported successfully");
}
示例13: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor taskMonitor) {
taskMonitor.setTitle(BuildProperties.APP_NAME);
taskMonitor.setStatusMessage("Selecting Clusters");
AnnotationSet annotationSet = cluster.getParent();
DisplayOptions displayOptions = annotationSet.getDisplayOptions();
ShapeAnnotation shape = annotationRenderer.getShapeAnnotation(cluster);
TextAnnotation text = annotationRenderer.getTextAnnotation(cluster);
if(shape != null) {
if(select) {
shape.setBorderColor(DrawClusterTask.SELECTED_COLOR);
shape.setBorderWidth(3 * displayOptions.getBorderWidth());
} else {
shape.setBorderColor(displayOptions.getBorderColor());
shape.setBorderWidth(displayOptions.getBorderWidth());
}
shape.update();
}
if(text != null) {
if(select) {
text.setTextColor(DrawClusterTask.SELECTED_COLOR);
} else {
text.setTextColor(displayOptions.getFontColor());
}
text.update();
}
}
示例14: taskMessage
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
public static Task taskMessage(String message) {
return new AbstractTask() {
@Override
public void run(TaskMonitor taskMonitor) {
taskMonitor.setTitle(BuildProperties.APP_NAME);
taskMonitor.setStatusMessage(message);
}
};
}
示例15: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor taskMonitor) {
taskMonitor.setTitle(BuildProperties.APP_NAME);
taskMonitor.setStatusMessage("Calculating Cluster Label");
AnnotationSet annotationSet = cluster.getParent();
Collection<CyNode> nodes = cluster.getNodes();
CyNetwork network = annotationSet.getParent().getNetwork();
String labelColumn = annotationSet.getLabelColumn();
String label = labelMaker.makeLabel(network, nodes, labelColumn);
cluster.setLabel(label);
}