Package org.broad.igv.ui

Examples of org.broad.igv.ui.AttributeSelectionDialog


        UIUtilities.invokeOnEventThread(new Runnable() {

            public void run() {

                final AttributeSelectionDialog dlg = new AttributeSelectionDialog(mainFrame.getMainFrame(), true);

                List<String> attributeKeys = AttributeManager.getInstance().getVisibleAttributes();


                // Sorting disabled -- order will match the order in the panel.  If sorting is desired make a copy
                // of the array so the panel is not affected.

                //if (attributeKeys != null) {
                //    Collections.sort(attributeKeys,
                //            AttributeManager.getInstance().getAttributeComparator());
                //}

                ArrayList<String> selections = new ArrayList(attributeKeys);

                selections.add(0, "None");
                String[] selArray = selections.toArray(new String[]{});

                dlg.setModel(new javax.swing.DefaultComboBoxModel(selArray));
                dlg.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);

                String currentSelection = IGV.getInstance().getGroupByAttribute();
                if (currentSelection == null) {
                    dlg.setSelectedIndex(0);
                } else {
                    dlg.setSelectedItem(currentSelection);
                }

                dlg.setVisible(true);

                if (!dlg.isCanceled()) {
                    int selIndex = dlg.getSelectedIndex();
                    String selectedAttribute = (selIndex == 0 ? null : selArray[selIndex]);
                    IGV.getInstance().setGroupByAttribute(selectedAttribute);
                    mainFrame.doRefresh();

                }
View Full Code Here

TOP

Related Classes of org.broad.igv.ui.AttributeSelectionDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.