use of org.cytoscape.ding.impl.DGraphView in project cytoscape-impl by cytoscape.
the class PerfTest method visualizeNetworks.
private void visualizeNetworks() {
try {
CyNetworkView[] views = getViews("A50-50.sif");
JFrame frame = new JFrame();
frame.setPreferredSize(new Dimension(800, 800));
JPanel panel = new JPanel();
panel.setPreferredSize(new Dimension(800, 800));
panel.setBackground(Color.blue);
InnerCanvas jc = ((DGraphView) (views[0])).getCanvas();
jc.setVisible(true);
jc.setPreferredSize(new Dimension(800, 800));
panel.add(jc);
frame.getContentPane().add(panel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.cytoscape.ding.impl.DGraphView in project cytoscape-impl by cytoscape.
the class ShowGraphicsDetailsTask method run.
@Override
public void run(TaskMonitor taskMonitor) {
if (view instanceof DGraphView) {
final GraphLOD lod = ((DGraphView) view).getGraphLOD();
if (lod instanceof DingGraphLODAll)
((DGraphView) view).setGraphLOD(dingGraphLOD);
else
((DGraphView) view).setGraphLOD(dingGraphLODAll);
view.updateView();
}
}
use of org.cytoscape.ding.impl.DGraphView in project cytoscape-impl by cytoscape.
the class GroupAnnotationFactory method createAnnotation.
@Override
public GroupAnnotation createAnnotation(Class<? extends GroupAnnotation> type, CyNetworkView view, Map<String, String> argMap) {
if (!(view instanceof DGraphView))
return null;
DGraphView dView = (DGraphView) view;
if (type.equals(GroupAnnotation.class)) {
final GroupAnnotationImpl a = new GroupAnnotationImpl(dView, argMap, getActiveWindow());
a.update();
return (GroupAnnotation) a;
} else {
return null;
}
}
use of org.cytoscape.ding.impl.DGraphView in project cytoscape-impl by cytoscape.
the class AnnotationManagerImpl method addAnnotation.
/**
********************************************************************************
* AnnotationManager implementation methods *
*********************************************************************************
*/
@Override
public void addAnnotation(final Annotation annotation) {
if (!(annotation instanceof DingAnnotation))
return;
DingAnnotation dAnnotation = (DingAnnotation) annotation;
CyNetworkView view = annotation.getNetworkView();
invokeOnEDTAndWait(() -> {
((DGraphView) view).getCyAnnotator().addAnnotation(annotation);
if (dAnnotation.getCanvas() != null) {
dAnnotation.getCanvas().add(dAnnotation.getComponent());
} else {
((DGraphView) view).getCyAnnotator().getForeGroundCanvas().add(dAnnotation.getComponent());
}
});
}
use of org.cytoscape.ding.impl.DGraphView in project cytoscape-impl by cytoscape.
the class AnnotationManagerImpl method removeAnnotation.
@Override
public void removeAnnotation(final Annotation annotation) {
CyNetworkView view = annotation.getNetworkView();
if (!(view instanceof DGraphView))
return;
invokeOnEDTAndWait(() -> {
annotation.removeAnnotation();
((DGraphView) view).getCyAnnotator().removeAnnotation(annotation);
});
}
Aggregations