use of org.cytoscape.ding.impl.DGraphView in project cytoscape-impl by cytoscape.
the class EditAnnotationTaskFactory method createTaskIterator.
@Override
public TaskIterator createTaskIterator(CyNetworkView networkView, Point2D javaPt, Point2D xformPt) {
CyAnnotator cyAnnotator = ((DGraphView) networkView).getCyAnnotator();
DingAnnotation annotation = cyAnnotator.getAnnotationAt(javaPt);
return new TaskIterator(new EditAnnotationTask(networkView, annotation, javaPt));
}
use of org.cytoscape.ding.impl.DGraphView in project cytoscape-impl by cytoscape.
the class MoveAnnotationTaskFactory method createTaskIterator.
@Override
public TaskIterator createTaskIterator(CyNetworkView networkView, Point2D javaPt, Point2D xformPt) {
CyAnnotator cyAnnotator = ((DGraphView) networkView).getCyAnnotator();
DingAnnotation annotation = cyAnnotator.getAnnotationAt(javaPt);
return new TaskIterator(new MoveAnnotationTask(networkView, annotation, javaPt));
}
use of org.cytoscape.ding.impl.DGraphView in project cytoscape-impl by cytoscape.
the class MoveAnnotationTaskFactory method isReady.
@Override
public boolean isReady(CyNetworkView networkView, Point2D javaPt, Point2D xformPt) {
CyAnnotator cyAnnotator = ((DGraphView) networkView).getCyAnnotator();
DingAnnotation annotation = cyAnnotator.getAnnotationAt(javaPt);
if (annotation != null)
return true;
return false;
}
use of org.cytoscape.ding.impl.DGraphView in project cytoscape-impl by cytoscape.
the class UngroupAnnotationsTask method run.
@Override
public void run(TaskMonitor tm) throws Exception {
if (view instanceof DGraphView) {
DGraphView dView = (DGraphView) view;
CyAnnotator cyAnnotator = dView.getCyAnnotator();
for (Annotation child : group.getMembers()) {
group.removeMember(child);
child.setSelected(true);
}
group.removeAnnotation();
}
}
use of org.cytoscape.ding.impl.DGraphView in project cytoscape-impl by cytoscape.
the class DNetworkViewTest method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
when(spacialFactory.createSpacialIndex2D()).thenReturn(spacialIndex2D);
when(serviceRegistrar.getService(UndoSupport.class)).thenReturn(undoSupport);
when(serviceRegistrar.getService(SpacialIndex2DFactory.class)).thenReturn(spacialFactory);
when(serviceRegistrar.getService(DialogTaskManager.class)).thenReturn(dialogTaskManager);
when(serviceRegistrar.getService(CyEventHelper.class)).thenReturn(eventHelper);
when(serviceRegistrar.getService(IconManager.class)).thenReturn(iconManager);
when(serviceRegistrar.getService(VisualMappingManager.class)).thenReturn(visualMappingManager);
when(serviceRegistrar.getService(CyNetworkViewManager.class)).thenReturn(networkViewManager);
buildNetwork();
view = new DGraphView(network, dingLexicon, vtfListener, annotationFactoryManager, dingGraphLOD, handleFactory, serviceRegistrar);
}
Aggregations