本文整理汇总了Java中org.cytoscape.work.TaskMonitor.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java TaskMonitor.setTitle方法的具体用法?Java TaskMonitor.setTitle怎么用?Java TaskMonitor.setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cytoscape.work.TaskMonitor
的用法示例。
在下文中一共展示了TaskMonitor.setTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor tm) throws Exception {
tm.setTitle(TITLE);
List<Cluster> clusters = new ArrayList<>(as.getClusters());
clusters.sort(Comparator.comparing(Cluster::getNodeCount).thenComparing(Cluster::getLabel).reversed());
try(BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
writer.append("Cluster").append("\t").append("Nodes");
writer.newLine();
for(Cluster cluster : clusters) {
writer.append(cluster.getLabel()).append("\t").append(String.valueOf(cluster.getNodeCount()));
writer.newLine();
}
}
}
示例2: 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);
}
}
}
示例3: 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);
}
}
示例4: 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();
}
}
示例5: 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;
}
示例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 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);
}
}
示例9: 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");
}
示例10: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor monitor) throws Exception {
monitor.setTitle("SAFE: Compute Composite Map");
CompositeMapBuilder builder = session.getEnrichmentLandscape()
.getCompositeMapBuilder();
CyProgressReporter progressReporter = new CyProgressReporter(monitor);
CompositeMap compositeMap = builder.setGroupingMethod(session.getGroupingMethod())
.setRestrictionMethod(session.getRestrictionMethod())
.setMinimumLandscapeSize(session.getMinimumLandscapeSize())
.setProgressReporter(progressReporter)
.build();
consumer.accept(compositeMap);
boolean hasHighestDomains = compositeMap.getDomains(EnrichmentLandscape.TYPE_HIGHEST) != null;
boolean hasLowestDomains = compositeMap.getDomains(EnrichmentLandscape.TYPE_LOWEST) != null;
EnrichmentLandscape landscape = session.getEnrichmentLandscape();
AnnotationProvider annotationProvider = landscape.getAnnotationProvider();
boolean hasDomains = annotationProvider.isBinary() && hasHighestDomains;
hasDomains = hasDomains || !annotationProvider.isBinary() && hasHighestDomains && hasLowestDomains;
if (!hasDomains) {
throw new Exception("No domains were found");
}
}
示例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();
AnnotationProvider annotationProvider = landscape.getAnnotationProvider();
writeReports(landscape, EnrichmentLandscape.TYPE_HIGHEST);
if (!annotationProvider.isBinary()) {
writeReports(landscape, EnrichmentLandscape.TYPE_LOWEST);
}
taskMonitor.setStatusMessage("Reports exported successfully");
}
示例12: 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();
}
}
示例13: 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);
}
};
}
示例14: 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);
}
示例15: run
import org.cytoscape.work.TaskMonitor; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor taskMonitor) {
taskMonitor.setTitle(BuildProperties.APP_NAME);
taskMonitor.setStatusMessage("Calculating clusterMaker edgeCutOff attribute.");
CyTable table = network.getDefaultEdgeTable();
CyColumn column = table.getColumn(edgeAttribute);
double min = Double.MAX_VALUE;
boolean updated = false;
if(column != null) {
Class<?> type = column.getType();
if(Number.class.isAssignableFrom(type)) {
for(CyRow row : table.getAllRows()) {
Number value = (Number) row.get(edgeAttribute, type);
if(value != null) {
double doubleValue = value.doubleValue();
if(Double.isFinite(doubleValue)) {
min = Math.min(doubleValue, min);
updated = true;
}
}
}
}
}
result = updated ? min : null;
}