Search in sources :

Example 1 with AbstractDingAnnotationFactory

use of org.cytoscape.ding.impl.cyannotator.create.AbstractDingAnnotationFactory 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);
        });
    }
}
Also used : AbstractDingAnnotationFactory(org.cytoscape.ding.impl.cyannotator.create.AbstractDingAnnotationFactory) JDialog(javax.swing.JDialog) DGraphView(org.cytoscape.ding.impl.DGraphView)

Example 2 with AbstractDingAnnotationFactory

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

the class AddArrowTask 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);
        });
    }
}
Also used : AbstractDingAnnotationFactory(org.cytoscape.ding.impl.cyannotator.create.AbstractDingAnnotationFactory) JDialog(javax.swing.JDialog) DGraphView(org.cytoscape.ding.impl.DGraphView)

Aggregations

JDialog (javax.swing.JDialog)2 DGraphView (org.cytoscape.ding.impl.DGraphView)2 AbstractDingAnnotationFactory (org.cytoscape.ding.impl.cyannotator.create.AbstractDingAnnotationFactory)2