use of org.cytoscape.ding.impl.DGraphView in project cytoscape-impl by cytoscape.
the class RemoveAnnotationTaskFactory 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 SelectAnnotationTaskFactory 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 SelectAnnotationTask(networkView, annotation));
}
use of org.cytoscape.ding.impl.DGraphView in project cytoscape-impl by cytoscape.
the class UngroupAnnotationsTaskFactory 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 UngroupAnnotationsTask(networkView, annotation));
}
use of org.cytoscape.ding.impl.DGraphView in project cytoscape-impl by cytoscape.
the class UngroupAnnotationsTaskFactory 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 && annotation instanceof GroupAnnotationImpl)
return true;
return false;
}
use of org.cytoscape.ding.impl.DGraphView in project cytoscape-impl by cytoscape.
the class AddAnnotationTask method run.
@Override
public void run(TaskMonitor tm) throws Exception {
if (view instanceof DGraphView && annotationFactory instanceof AbstractDingAnnotationFactory) {
SwingUtilities.invokeLater(() -> {
final JDialog dialog = ((AbstractDingAnnotationFactory<?>) annotationFactory).createAnnotationDialog((DGraphView) view, location);
dialog.setLocation((int) location.getX(), (int) location.getY());
dialog.setVisible(true);
});
}
}
Aggregations