Search in sources :

Example 6 with CyAnnotator

use of org.cytoscape.ding.impl.cyannotator.CyAnnotator in project cytoscape-impl by cytoscape.

the class AddArrowTaskFactory method isReady.

@Override
public boolean isReady(CyNetworkView networkView, Point2D javaPt, Point2D xformPt) {
    // We need to be over an annotation
    CyAnnotator cyAnnotator = ((DGraphView) networkView).getCyAnnotator();
    DingAnnotation annotation = cyAnnotator.getAnnotationAt(javaPt);
    if (annotation == null || annotation instanceof ArrowAnnotationImpl)
        return false;
    return true;
}
Also used : ArrowAnnotationImpl(org.cytoscape.ding.impl.cyannotator.annotations.ArrowAnnotationImpl) CyAnnotator(org.cytoscape.ding.impl.cyannotator.CyAnnotator) DingAnnotation(org.cytoscape.ding.impl.cyannotator.annotations.DingAnnotation) DGraphView(org.cytoscape.ding.impl.DGraphView)

Example 7 with CyAnnotator

use of org.cytoscape.ding.impl.cyannotator.CyAnnotator 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));
}
Also used : TaskIterator(org.cytoscape.work.TaskIterator) CyAnnotator(org.cytoscape.ding.impl.cyannotator.CyAnnotator) DingAnnotation(org.cytoscape.ding.impl.cyannotator.annotations.DingAnnotation) DGraphView(org.cytoscape.ding.impl.DGraphView)

Example 8 with CyAnnotator

use of org.cytoscape.ding.impl.cyannotator.CyAnnotator 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));
}
Also used : TaskIterator(org.cytoscape.work.TaskIterator) CyAnnotator(org.cytoscape.ding.impl.cyannotator.CyAnnotator) DingAnnotation(org.cytoscape.ding.impl.cyannotator.annotations.DingAnnotation) DGraphView(org.cytoscape.ding.impl.DGraphView)

Example 9 with CyAnnotator

use of org.cytoscape.ding.impl.cyannotator.CyAnnotator 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));
}
Also used : TaskIterator(org.cytoscape.work.TaskIterator) CyAnnotator(org.cytoscape.ding.impl.cyannotator.CyAnnotator) DingAnnotation(org.cytoscape.ding.impl.cyannotator.annotations.DingAnnotation) DGraphView(org.cytoscape.ding.impl.DGraphView)

Example 10 with CyAnnotator

use of org.cytoscape.ding.impl.cyannotator.CyAnnotator 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;
}
Also used : CyAnnotator(org.cytoscape.ding.impl.cyannotator.CyAnnotator) DingAnnotation(org.cytoscape.ding.impl.cyannotator.annotations.DingAnnotation) DGraphView(org.cytoscape.ding.impl.DGraphView)

Aggregations

DGraphView (org.cytoscape.ding.impl.DGraphView)20 CyAnnotator (org.cytoscape.ding.impl.cyannotator.CyAnnotator)20 DingAnnotation (org.cytoscape.ding.impl.cyannotator.annotations.DingAnnotation)20 TaskIterator (org.cytoscape.work.TaskIterator)8 GroupAnnotationImpl (org.cytoscape.ding.impl.cyannotator.annotations.GroupAnnotationImpl)3 JComponent (javax.swing.JComponent)2 Annotation (org.cytoscape.view.presentation.annotations.Annotation)2 ArrayList (java.util.ArrayList)1 ArrowAnnotationImpl (org.cytoscape.ding.impl.cyannotator.annotations.ArrowAnnotationImpl)1 ImageAnnotationImpl (org.cytoscape.ding.impl.cyannotator.annotations.ImageAnnotationImpl)1 ShapeAnnotationImpl (org.cytoscape.ding.impl.cyannotator.annotations.ShapeAnnotationImpl)1 GroupAnnotation (org.cytoscape.view.presentation.annotations.GroupAnnotation)1