use of org.cytoscape.ding.impl.cyannotator.annotations.DingAnnotation in project cytoscape-impl by cytoscape.
the class ChangeAnnotationCanvasTaskFactory 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 ChangeAnnotationCanvasTask(networkView, annotation, canvas));
}
use of org.cytoscape.ding.impl.cyannotator.annotations.DingAnnotation 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.cyannotator.annotations.DingAnnotation 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.cyannotator.annotations.DingAnnotation 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.cyannotator.annotations.DingAnnotation 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());
}
});
}
Aggregations