Search in sources :

Example 1 with TableColumnTaskFactory

use of org.cytoscape.task.TableColumnTaskFactory in project cytoscape-impl by cytoscape.

the class PopupMenuHelper method createColumnHeaderMenu.

public void createColumnHeaderMenu(final CyColumn column, final Class<? extends CyIdentifiable> tableType, final Component invoker, final int x, final int y) {
    if (tableColumnFactoryMap.isEmpty())
        return;
    final JPopupMenu menu = new JPopupMenu();
    final PopupMenuGravityTracker tracker = new PopupMenuGravityTracker(menu);
    for (final Map.Entry<TableColumnTaskFactory, Map<?, ?>> mapEntry : tableColumnFactoryMap.entrySet()) {
        TableColumnTaskFactory taskFactory = mapEntry.getKey();
        TaskFactory provisioner = factoryProvisioner.createFor(taskFactory, column);
        createMenuItem(provisioner, tracker, mapEntry.getValue(), tableType);
    }
    if (menu.getSubElements().length > 0)
        menu.show(invoker, x, y);
}
Also used : PopupMenuGravityTracker(org.cytoscape.util.swing.PopupMenuGravityTracker) TaskFactory(org.cytoscape.work.TaskFactory) TableColumnTaskFactory(org.cytoscape.task.TableColumnTaskFactory) TableCellTaskFactory(org.cytoscape.task.TableCellTaskFactory) TableColumnTaskFactory(org.cytoscape.task.TableColumnTaskFactory) HashMap(java.util.HashMap) Map(java.util.Map) JPopupMenu(javax.swing.JPopupMenu)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 JPopupMenu (javax.swing.JPopupMenu)1 TableCellTaskFactory (org.cytoscape.task.TableCellTaskFactory)1 TableColumnTaskFactory (org.cytoscape.task.TableColumnTaskFactory)1 PopupMenuGravityTracker (org.cytoscape.util.swing.PopupMenuGravityTracker)1 TaskFactory (org.cytoscape.work.TaskFactory)1