List of usage examples for javax.swing ListSelectionModel MULTIPLE_INTERVAL_SELECTION
int MULTIPLE_INTERVAL_SELECTION
To view the source code for javax.swing ListSelectionModel MULTIPLE_INTERVAL_SELECTION.
Click Source Link
From source file:com.googlecode.vfsjfilechooser2.filepane.VFSFilePane.java
public JPanel createList() { JPanel p = new JPanel(new BorderLayout()); final VFSJFileChooser fileChooser = getFileChooser(); final JList aList = new JList() { @Override/*from w w w . j a va2 s .com*/ public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { ListModel model = getModel(); int max = model.getSize(); if ((prefix == null) || (startIndex < 0) || (startIndex >= max)) { throw new IllegalArgumentException(); } // start search from the next element before/after the selected element boolean backwards = (bias == Position.Bias.Backward); for (int i = startIndex; backwards ? (i >= 0) : (i < max); i += (backwards ? (-1) : 1)) { String filename = fileChooser.getName((FileObject) model.getElementAt(i)); if (filename.regionMatches(true, 0, prefix, 0, prefix.length())) { return i; } } return -1; } }; aList.setCellRenderer(new FileRenderer()); aList.setLayoutOrientation(JList.VERTICAL_WRAP); // 4835633 : tell BasicListUI that this is a file list aList.putClientProperty("List.isFileList", Boolean.TRUE); if (listViewWindowsStyle) { aList.addFocusListener(repaintListener); } updateListRowCount(aList); getModel().addListDataListener(new ListDataListener() { public void intervalAdded(ListDataEvent e) { updateListRowCount(aList); } public void intervalRemoved(ListDataEvent e) { updateListRowCount(aList); } public void contentsChanged(ListDataEvent e) { if (isShowing()) { clearSelection(); } updateListRowCount(aList); } }); getModel().addPropertyChangeListener(this); if (fileChooser.isMultiSelectionEnabled()) { aList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); } else { aList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); } aList.setModel(getModel()); aList.addListSelectionListener(createListSelectionListener()); aList.addMouseListener(getMouseHandler()); JScrollPane scrollpane = new JScrollPane(aList); if (listViewBackground != null) { aList.setBackground(listViewBackground); } if (listViewBorder != null) { scrollpane.setBorder(listViewBorder); } p.add(scrollpane, BorderLayout.CENTER); return p; }
From source file:com.diversityarrays.kdxplore.curate.TrialDataEditor.java
public TrialDataEditor(CurationData cd, WindowOpener<JFrame> windowOpener, MessageLogger messageLogger, KdxploreDatabase kdxdb, IntFunction<Trait> traitProvider, SampleType[] sampleTypes) throws IOException { super(new BorderLayout()); this.traitProvider = traitProvider; this.windowOpener = windowOpener; this.curationData = cd; this.curationData.setChangeManager(changeManager); this.curationData.setKDSmartDatabase(kdxdb.getKDXploreKSmartDatabase()); inactiveTagFilterIcon = KDClientUtils.getIcon(ImageId.TAG_FILTER_24); activeTagFilterIcon = KDClientUtils.getIcon(ImageId.TAG_FILTER_ACTIVE_24); inactivePlotOrSpecimenFilterIcon = KDClientUtils.getIcon(ImageId.FILTER_PLOT_SPEC_INACTIVE); activePlotFilterIcon = KDClientUtils.getIcon(ImageId.FILTER_PLOT_ACTIVE); activeSpecimenFilterIcon = KDClientUtils.getIcon(ImageId.FILTER_SPEC_ACTIVE); updatePlotSpecimenIcon();// www . j ava 2 s . c o m TraitColorProvider traitColourProvider = new TraitColorProvider(false); this.curationData.setTraitColorProvider(traitColourProvider); curationData.addCurationDataChangeListener(new CurationDataChangeListener() { @Override public void plotActivationChanged(Object source, boolean activated, List<Plot> plots) { updateRowFilter(); if (toolController != null) { toolController.plotActivationsChanged(activated, plots); } } @Override public void editedSamplesChanged(Object source, List<CurationCellId> curationCellIds) { if (toolController != null) { toolController.editedSamplesChanged(); } } }); this.selectedValueStore = new SelectedValueStore(curationData.getTrial().getTrialName()); this.messageLogger = messageLogger; smallFont = KDClientUtils.makeSmallFont(this); // undockViewAction.putValue(Action.SHORT_DESCRIPTION, "Click to undock // this view"); KDClientUtils.initAction(ImageId.HELP_24, curationHelpAction, Msg.TOOLTIP_HELP_DATA_CURATION(), false); KDClientUtils.initAction(ImageId.SAVE_24, saveChangesAction, Msg.TOOLTIP_SAVE_CHANGES(), true); KDClientUtils.initAction(ImageId.EXPORT_24, exportCuratedData, Msg.TOOLTIP_EXPORT(), true); KDClientUtils.initAction(ImageId.UNDO_24, undoAction, Msg.TOOLTIP_UNDO(), true); KDClientUtils.initAction(ImageId.REDO_24, redoAction, Msg.TOOLTIP_REDO(), true); KDClientUtils.initAction(ImageId.FIELD_VIEW_24, showFieldViewAction, Msg.TOOLTIP_FIELD_VIEW(), false); KDClientUtils.initAction(ImageId.GET_TRIALINFO_24, importCuratedData, Msg.TOOLTIP_IMPORT_DATA(), true); Function<TraitInstance, List<KdxSample>> sampleProvider = new Function<TraitInstance, List<KdxSample>>() { @Override public List<KdxSample> apply(TraitInstance ti) { return curationData.getSampleMeasurements(ti); } }; tivrByTi = VisToolUtil.buildTraitInstanceValueRetrieverMap(curationData.getTrial(), curationData.getTraitInstances(), sampleProvider); // = = = = = = = = boolean readOnly = false; // FIXME work out if the Trial can be edited or not curationTableModel = new CurationTableModel(curationData, readOnly); // See FIXME comment in CurationTableModel.isReadOnly() curationTableSelectionModel = new CurationTableSelectionModelImpl(selectedValueStore, curationTableModel); curationTableSelectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); curationTable = new CurationTable("CurationTable-" + (++UNIQUE_CURATION_TABLE_ID), //$NON-NLS-1$ curationTableModel, curationTableSelectionModel); curationTable.setCellSelectionEnabled(true); curationTable.setAutoCreateRowSorter(true); // = = = = = = = = this.sampleSourcesTablePanel = new SampleSourcesTablePanel(curationData, curationTableModel, handler); @SuppressWarnings("unchecked") TableRowSorter<CurationTableModel> rowSorter = (TableRowSorter<CurationTableModel>) curationTable .getRowSorter(); rowSorter.setSortsOnUpdates(true); rowSorter.addRowSorterListener(rowSorterListener); curationCellRenderer = new CurationTableCellRenderer(curationTableModel, colorProviderFactory, curationTableSelectionModel); curationTable.setDefaultRenderer(Object.class, curationCellRenderer); curationTable.setDefaultRenderer(Integer.class, curationCellRenderer); curationTable.setDefaultRenderer(String.class, curationCellRenderer); curationTable.setDefaultRenderer(CurationCellValue.class, curationCellRenderer); curationTable.setDefaultRenderer(Double.class, curationCellRenderer); curationTable.setDefaultRenderer(TraitValue.class, curationCellRenderer); // If either the rows selected change or the columns selected change // then we // need to inform the visualisation tools. curationTable.getSelectionModel().addListSelectionListener(curationTableCellSelectionListener); curationTable.getColumnModel().addColumnModelListener(curationTableCellSelectionListener); fieldLayoutView = new InterceptFieldLayoutView(); this.curationCellEditor = new CurationCellEditorImpl(curationTableModel, fieldLayoutView, curationData, refreshFieldLayoutView, kdxdb, traitProvider, sampleTypes); SuppressionInfoProvider suppressionInfoProvider = new SuppressionInfoProvider(curationData, curationTableModel, curationTable); suppressionHandler = new SuppressionHandler(curationContext, curationData, curationCellEditor, suppressionInfoProvider); loadVisualisationTools(); curationMenuProvider = new CurationMenuProvider(curationContext, curationData, messages, visualisationTools, suppressionHandler); curationMenuProvider.setSuppressionInfoProvider(suppressionInfoProvider); fieldLayoutView.addTraitInstanceSelectionListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { if (ItemEvent.SELECTED == e.getStateChange()) { TraitInstance traitInstance = fieldLayoutView.getActiveTraitInstance(true); if (traitInstance == null) { curationCellEditor.setCurationCellValue(null); } else { // startEdit(HowStarted.FIELD_VIEW_CHANGED_ACTIVE_TRAIT_INSTANCE); } fieldLayoutView.updateSamplesSelectedInTable(); } } }); // = = = = = = = curationData.addUnsavedChangesListener(new UnsavedChangesListener() { @Override public void unsavedChangesExist(Object source, int nChanges) { int unsavedCount = curationData.getUnsavedChangesCount(); saveChangesAction.setEnabled(unsavedCount > 0); if (unsavedCount > 0) { statusInfoLine.setMessage("Unsaved changes: " + unsavedCount); } else { statusInfoLine.setMessage("No Unsaved changes"); } } }); // curationData.addEditedSampleChangeListener(new ChangeListener() { // @Override // public void stateChanged(ChangeEvent e) { // handleEditedSampleChanges(); // } // }); saveChangesAction.setEnabled(false); changeManager.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { updateUndoRedoActions(); } }); undoAction.setEnabled(false); redoAction.setEnabled(false); // = = = = = = = = // TODO provide one of these for each relevant device type DeviceType deviceTypeForSamples = null; StatsData statsData = curationData.getStatsData(deviceTypeForSamples); TIStatsTableModel statsTableModel = new TIStatsTableModel2(curationData, statsData, deviceTypeForSamples); traitColourProvider.generateColorMap(statsData.getTraitInstancesWithData()); Set<Integer> instanceNumbers = statsData.getInstanceNumbers(); String nonHtmlLabel; if (instanceNumbers.size() > 1) { tAndIpanelLabel = "<HTML><i>Plot Info</i> & Trait Instances"; nonHtmlLabel = "Plot Info & Trait Instances"; } else { tAndIpanelLabel = "<HTML><i>Plot Info</i> & Traits"; nonHtmlLabel = "Plot Info & Traits"; } traitsAndInstancesPanel = new TraitsAndInstancesPanel2(curationContext, smallFont, statsTableModel, instanceNumbers.size() > 1, statsData.getInvalidRuleCount(), nonHtmlLabel, curationMenuProvider, outlierConsumer); traitsAndInstancesPanel.addTraitInstanceStatsItemListener(new ItemListener() { boolean busy; @Override public void itemStateChanged(ItemEvent e) { // NOTE: we want to process both SELECTED and DESELECTED // variants if (busy) { Shared.Log.d(TAG, "***** LOOPED in traitsAndInstancesPanel.ItemListener"); //$NON-NLS-1$ } else { Shared.Log.d(TAG, "traitsAndInstancesPanel.ItemListener BEGIN"); //$NON-NLS-1$ busy = true; try { updateViewedTraitInstances(e); // !!!!! } finally { busy = false; Shared.Log.d(TAG, "traitsAndInstancesPanel.ItemListener END\n"); //$NON-NLS-1$ } } } }); // = = = = = = = = plotCellChoicesPanel = new PlotCellChoicesPanel(curationContext, curationData, deviceTypeForSamples, tAndIpanelLabel, curationMenuProvider, colorProviderFactory); // plotCellChoicesPanel.setData( // curationData.getPlotAttributes(), // traitsAndInstancesPanel.getTraitInstancesWithData()); plotCellChoicesPanel.addPlotCellChoicesListener(new PlotCellChoicesListener() { @Override public void traitInstanceChoicesChanged(Object source, boolean choiceAdded, TraitInstance[] choice, Map<Integer, Set<TraitInstance>> traitInstancesByTraitId) { traitsAndInstancesPanel.changeTraitInstanceChoice(choiceAdded, choice); } @Override public void plotAttributeChoicesChanged(Object source, List<ValueRetriever<?>> vrList) { curationTableModel.setSelectedPlotAttributes(vrList); } }); // = = = = = = = = statsAndSamplesSplit = createStatsAndSamplesTable(traitsAndInstancesPanel.getComponent()); mainTabbedPane.addTab(TAB_SAMPLES, samplesTableIcon, statsAndSamplesSplit, Msg.TOOLTIP_SAMPLES_TABLE()); // = = = = = = = = checkForInvalidTraits(); leftSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, createCurationCellEditorComponent(), plotCellChoicesPanel); leftSplit.setResizeWeight(0.5); // traitToDoTaskPaneContainer); // rightSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, // traitsAndInstancesPanel, fieldViewAndPlots); // rightSplit.setResizeWeight(0.5); // rightSplit.setOneTouchExpandable(true); leftAndRightSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftSplit, mainTabbedPane); leftAndRightSplit.setOneTouchExpandable(true); mainVerticalSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, messages, leftAndRightSplit); mainVerticalSplit.setOneTouchExpandable(true); mainVerticalSplit.setResizeWeight(0.0); add(statusInfoLine, BorderLayout.NORTH); add(mainVerticalSplit, BorderLayout.CENTER); fieldLayoutView.addCellSelectionListener(fieldViewCellSelectionListener); curationTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent me) { if (SwingUtilities.isRightMouseButton(me) && 1 == me.getClickCount()) { me.consume(); displayPopupMenu(me); } } }); }
From source file:jp.massbank.spectrumsearch.SearchPage.java
/** * ?/* w w w . java 2 s . com*/ */ private void createWindow() { // ?? ToolTipManager ttm = ToolTipManager.sharedInstance(); ttm.setInitialDelay(50); ttm.setDismissDelay(8000); // Search? JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); Border border = BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(), new EmptyBorder(1, 1, 1, 1)); mainPanel.setBorder(border); // ********************************************************************* // User File Query // ********************************************************************* DefaultTableModel fileDm = new DefaultTableModel(); fileSorter = new TableSorter(fileDm, TABLE_QUERY_FILE); queryFileTable = new JTable(fileSorter) { @Override public boolean isCellEditable(int row, int column) { // super.isCellEditable(row, column); // ?????? return false; } }; queryFileTable.addMouseListener(new TblMouseListener()); fileSorter.setTableHeader(queryFileTable.getTableHeader()); queryFileTable.setRowSelectionAllowed(true); queryFileTable.setColumnSelectionAllowed(false); queryFileTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); String[] col = { COL_LABEL_NO, COL_LABEL_NAME, COL_LABEL_ID }; ((DefaultTableModel) fileSorter.getTableModel()).setColumnIdentifiers(col); (queryFileTable.getColumn(queryFileTable.getColumnName(0))).setPreferredWidth(44); (queryFileTable.getColumn(queryFileTable.getColumnName(1))).setPreferredWidth(LEFT_PANEL_WIDTH - 44); (queryFileTable.getColumn(queryFileTable.getColumnName(2))).setPreferredWidth(70); ListSelectionModel lm = queryFileTable.getSelectionModel(); lm.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); lm.addListSelectionListener(new LmFileListener()); queryFilePane = new JScrollPane(queryFileTable); queryFilePane.addMouseListener(new PaneMouseListener()); queryFilePane.setPreferredSize(new Dimension(300, 300)); // ********************************************************************* // Result // ********************************************************************* DefaultTableModel resultDm = new DefaultTableModel(); resultSorter = new TableSorter(resultDm, TABLE_RESULT); resultTable = new JTable(resultSorter) { @Override public String getToolTipText(MouseEvent me) { // super.getToolTipText(me); // ????? Point pt = me.getPoint(); int row = rowAtPoint(pt); if (row < 0) { return null; } else { int nameCol = getColumnModel().getColumnIndex(COL_LABEL_NAME); return " " + getValueAt(row, nameCol) + " "; } } @Override public boolean isCellEditable(int row, int column) { // super.isCellEditable(row, column); // ?????? return false; } }; resultTable.addMouseListener(new TblMouseListener()); resultSorter.setTableHeader(resultTable.getTableHeader()); JPanel dbPanel = new JPanel(); dbPanel.setLayout(new BorderLayout()); resultPane = new JScrollPane(resultTable); resultPane.addMouseListener(new PaneMouseListener()); resultTable.setRowSelectionAllowed(true); resultTable.setColumnSelectionAllowed(false); resultTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); String[] col2 = { COL_LABEL_NAME, COL_LABEL_SCORE, COL_LABEL_HIT, COL_LABEL_ID, COL_LABEL_ION, COL_LABEL_CONTRIBUTOR, COL_LABEL_NO }; resultDm.setColumnIdentifiers(col2); (resultTable.getColumn(resultTable.getColumnName(0))).setPreferredWidth(LEFT_PANEL_WIDTH - 180); (resultTable.getColumn(resultTable.getColumnName(1))).setPreferredWidth(70); (resultTable.getColumn(resultTable.getColumnName(2))).setPreferredWidth(20); (resultTable.getColumn(resultTable.getColumnName(3))).setPreferredWidth(70); (resultTable.getColumn(resultTable.getColumnName(4))).setPreferredWidth(20); (resultTable.getColumn(resultTable.getColumnName(5))).setPreferredWidth(70); (resultTable.getColumn(resultTable.getColumnName(6))).setPreferredWidth(50); ListSelectionModel lm2 = resultTable.getSelectionModel(); lm2.addListSelectionListener(new LmResultListener()); resultPane.setPreferredSize(new Dimension(LEFT_PANEL_WIDTH, 200)); dbPanel.add(resultPane, BorderLayout.CENTER); // ********************************************************************* // DB Query // ********************************************************************* DefaultTableModel dbDm = new DefaultTableModel(); querySorter = new TableSorter(dbDm, TABLE_QUERY_DB); queryDbTable = new JTable(querySorter) { @Override public boolean isCellEditable(int row, int column) { // super.isCellEditable(row, column); // ?????? return false; } }; queryDbTable.addMouseListener(new TblMouseListener()); querySorter.setTableHeader(queryDbTable.getTableHeader()); queryDbPane = new JScrollPane(queryDbTable); queryDbPane.addMouseListener(new PaneMouseListener()); int h = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight(); queryDbPane.setPreferredSize(new Dimension(LEFT_PANEL_WIDTH, h)); queryDbTable.setRowSelectionAllowed(true); queryDbTable.setColumnSelectionAllowed(false); queryDbTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); String[] col3 = { COL_LABEL_ID, COL_LABEL_NAME, COL_LABEL_CONTRIBUTOR, COL_LABEL_NO }; DefaultTableModel model = (DefaultTableModel) querySorter.getTableModel(); model.setColumnIdentifiers(col3); // queryDbTable.getColumn(queryDbTable.getColumnName(0)).setPreferredWidth(70); queryDbTable.getColumn(queryDbTable.getColumnName(1)).setPreferredWidth(LEFT_PANEL_WIDTH - 70); queryDbTable.getColumn(queryDbTable.getColumnName(2)).setPreferredWidth(70); queryDbTable.getColumn(queryDbTable.getColumnName(3)).setPreferredWidth(50); ListSelectionModel lm3 = queryDbTable.getSelectionModel(); lm3.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); lm3.addListSelectionListener(new LmQueryDbListener()); // ? JPanel btnPanel = new JPanel(); btnName.addActionListener(new BtnSearchNameListener()); btnAll.addActionListener(new BtnAllListener()); btnPanel.add(btnName); btnPanel.add(btnAll); parentPanel2 = new JPanel(); parentPanel2.setLayout(new BoxLayout(parentPanel2, BoxLayout.PAGE_AXIS)); parentPanel2.add(btnPanel); parentPanel2.add(queryDbPane); // ? JPanel dispModePanel = new JPanel(); isDispSelected = dispSelected.isSelected(); isDispRelated = dispRelated.isSelected(); if (isDispSelected) { resultTable.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); } else if (isDispRelated) { resultTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); } Object[] retRadio = new Object[] { dispSelected, dispRelated }; for (int i = 0; i < retRadio.length; i++) { ((JRadioButton) retRadio[i]).addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if (isDispSelected != dispSelected.isSelected() || isDispRelated != dispRelated.isSelected()) { isDispSelected = dispSelected.isSelected(); isDispRelated = dispRelated.isSelected(); // ?? resultTable.clearSelection(); resultPlot.clear(); compPlot.setPeaks(null, 1); resultPlot.setPeaks(null, 0); setAllPlotAreaRange(); pkgView.initResultRecInfo(); if (isDispSelected) { resultTable.getSelectionModel() .setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); } else if (isDispRelated) { resultTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); } } } }); } ButtonGroup disGroup = new ButtonGroup(); disGroup.add(dispSelected); disGroup.add(dispRelated); dispModePanel.add(lbl2); dispModePanel.add(dispSelected); dispModePanel.add(dispRelated); JPanel paramPanel = new JPanel(); paramPanel.add(etcPropertyButton); etcPropertyButton.setMargin(new Insets(0, 10, 0, 10)); etcPropertyButton.addActionListener(new ActionListener() { private ParameterSetWindow ps = null; public void actionPerformed(ActionEvent e) { // ?????????? if (!isSubWindow) { ps = new ParameterSetWindow(getParentFrame()); } else { ps.requestFocus(); } } }); JPanel optionPanel = new JPanel(); optionPanel.setLayout(new BoxLayout(optionPanel, BoxLayout.Y_AXIS)); optionPanel.add(dispModePanel); optionPanel.add(paramPanel); // PackageView????? pkgView = new PackageViewPanel(); pkgView.initAllRecInfo(); queryTabPane.addTab("DB", parentPanel2); queryTabPane.setToolTipTextAt(TAB_ORDER_DB, "Query from DB."); queryTabPane.addTab("File", queryFilePane); queryTabPane.setToolTipTextAt(TAB_ORDER_FILE, "Query from user file."); queryTabPane.setSelectedIndex(TAB_ORDER_DB); queryTabPane.setFocusable(false); queryTabPane.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { // ? queryPlot.clear(); compPlot.clear(); resultPlot.clear(); queryPlot.setPeaks(null, 0); compPlot.setPeaks(null, 1); resultPlot.setPeaks(null, 0); // PackageView? pkgView.initAllRecInfo(); // DB Hit? if (resultTabPane.getTabCount() > 0) { resultTabPane.setSelectedIndex(0); } DefaultTableModel dataModel = (DefaultTableModel) resultSorter.getTableModel(); dataModel.setRowCount(0); hitLabel.setText(" "); // DB?User File?????? queryTabPane.update(queryTabPane.getGraphics()); if (queryTabPane.getSelectedIndex() == TAB_ORDER_DB) { parentPanel2.update(parentPanel2.getGraphics()); updateSelectQueryTable(queryDbTable); } else if (queryTabPane.getSelectedIndex() == TAB_ORDER_FILE) { queryFilePane.update(queryFilePane.getGraphics()); updateSelectQueryTable(queryFileTable); } } }); // JPanel queryPanel = new JPanel(); queryPanel.setLayout(new BorderLayout()); queryPanel.add(queryTabPane, BorderLayout.CENTER); queryPanel.add(optionPanel, BorderLayout.SOUTH); queryPanel.setMinimumSize(new Dimension(0, 170)); JPanel jtp2Panel = new JPanel(); jtp2Panel.setLayout(new BorderLayout()); jtp2Panel.add(dbPanel, BorderLayout.CENTER); jtp2Panel.add(hitLabel, BorderLayout.SOUTH); jtp2Panel.setMinimumSize(new Dimension(0, 70)); Color colorGreen = new Color(0, 128, 0); hitLabel.setForeground(colorGreen); resultTabPane.addTab("Result", jtp2Panel); resultTabPane.setToolTipTextAt(TAB_RESULT_DB, "Result of DB hit."); resultTabPane.setFocusable(false); queryPlot.setMinimumSize(new Dimension(0, 100)); compPlot.setMinimumSize(new Dimension(0, 120)); resultPlot.setMinimumSize(new Dimension(0, 100)); int height = initAppletHight / 3; JSplitPane jsp_cmp2db = new JSplitPane(JSplitPane.VERTICAL_SPLIT, compPlot, resultPlot); JSplitPane jsp_qry2cmp = new JSplitPane(JSplitPane.VERTICAL_SPLIT, queryPlot, jsp_cmp2db); jsp_cmp2db.setDividerLocation(height); jsp_qry2cmp.setDividerLocation(height - 25); jsp_qry2cmp.setMinimumSize(new Dimension(190, 0)); viewTabPane.addTab("Compare View", jsp_qry2cmp); viewTabPane.addTab("Package View", pkgView); viewTabPane.setToolTipTextAt(TAB_VIEW_COMPARE, "Comparison of query and result spectrum."); viewTabPane.setToolTipTextAt(TAB_VIEW_PACKAGE, "Package comparison of query and result spectrum."); viewTabPane.setSelectedIndex(TAB_VIEW_COMPARE); viewTabPane.setFocusable(false); JSplitPane jsp = new JSplitPane(JSplitPane.VERTICAL_SPLIT, queryPanel, resultTabPane); jsp.setDividerLocation(310); jsp.setMinimumSize(new Dimension(180, 0)); jsp.setOneTouchExpandable(true); JSplitPane jsp2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jsp, viewTabPane); int divideSize = (int) (initAppletWidth * 0.4); divideSize = (divideSize >= 180) ? divideSize : 180; jsp2.setDividerLocation(divideSize); jsp2.setOneTouchExpandable(true); mainPanel.add(jsp2, BorderLayout.CENTER); add(mainPanel); queryPlot.setSearchPage(this); compPlot.setSearchPage(this); resultPlot.setSearchPage(this); setJMenuBar(MenuBarGenerator.generateMenuBar(this)); }
From source file:com.diversityarrays.kdxplore.trialmgr.trait.TraitExplorerPanel.java
public TraitExplorerPanel(MessagePrinter mp, OfflineData od, DALClientProvider clientProvider, // KdxUploadHandler uploadHandler, BackgroundRunner backgroundRunner, ImageIcon addBarcodeIcon, Transformer<Trial, Boolean> checkIfEditorActive) { super(new BorderLayout()); this.backgroundRunner = backgroundRunner; this.clientProvider = clientProvider; // this.uploadHandler = uploadHandler; this.messagePrinter = mp; this.offlineData = od; this.checkIfEditorActive = checkIfEditorActive; offlineData.addOfflineDataChangeListener(offlineDataListener); editingLocked.setIcon(KDClientUtils.getIcon(ImageId.LOCKED)); editingLocked.addActionListener(new ActionListener() { @Override//from w ww .j av a 2 s . c o m public void actionPerformed(ActionEvent e) { changeEditable(editingLocked.isSelected(), DONT_OVERRIDE); } }); changeManager.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { updateUndoRedoActions(); } }); KDClientUtils.initAction(ImageId.TRASH_24, deleteTraitsAction, "Remove Trait"); deleteTraitsAction.setEnabled(false); KDClientUtils.initAction(ImageId.REFRESH_24, refreshAction, "Refresh Data"); KDClientUtils.initAction(ImageId.PLUS_BLUE_24, addNewTraitAction, "Add Trait"); KDClientUtils.initAction(ImageId.UPLOAD_24, uploadTraitsAction, "Upload Traits"); KDClientUtils.initAction(ImageId.ADD_TRIALS_24, importTraitsAction, "Import Traits"); KDClientUtils.initAction(ImageId.EXPORT_24, exportTraitsAction, "Export Traits"); try { Class.forName("com.diversityarrays.kdxplore.upload.TraitUploadTask"); } catch (ClassNotFoundException e1) { uploadTraitsAction.setEnabled(false); if (RunMode.getRunMode().isDeveloper()) { new Toast((JComponent) null, "<HTML>Developer Warning<BR>" + "Trait Upload currently unavailable<BR>", 4000) .showAsError(); } } traitPropertiesTable .setTransferHandler(TableTransferHandler.initialiseForCopySelectAll(traitPropertiesTable, true)); traitPropertiesTableModel.addTableModelListener(new TableModelListener() { @Override public void tableChanged(TableModelEvent e) { if (traitPropertiesTableModel.getRowCount() > 0) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { GuiUtil.initialiseTableColumnWidths(traitPropertiesTable); } }); traitPropertiesTableModel.removeTableModelListener(this); } } }); traitTableModel.addTableModelListener(new TableModelListener() { @Override public void tableChanged(TableModelEvent e) { showCorrectCard(); } }); TrialManagerPreferences preferences = TrialManagerPreferences.getInstance(); preferences.addChangeListener(TrialManagerPreferences.BAD_FOR_CALC, badForCalcColorChangeListener); badForCalc.setForeground(preferences.getBadForCalcColor()); badForCalc.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (SwingUtilities.isLeftMouseButton(e)) { KdxPreference<Color> pref = TrialManagerPreferences.BAD_FOR_CALC; String title = pref.getName(); KdxplorePreferenceEditor.startEditorDialog(TraitExplorerPanel.this, title, pref); } } }); traitsTable.setAutoCreateRowSorter(true); int index = traitTableModel.getTraitNameColumnIndex(); if (index >= 0) { traitsTable.getColumnModel().getColumn(index).setCellRenderer(traitNameCellRenderer); } traitsTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (SwingUtilities.isLeftMouseButton(e) && 2 == e.getClickCount()) { e.consume(); int vrow = traitsTable.rowAtPoint(e.getPoint()); if (vrow >= 0) { int mrow = traitsTable.convertRowIndexToModel(vrow); if (mrow >= 0) { Trait trait = traitTableModel.getTraitAtRow(mrow); Integer selectViewRow = null; if (!traitTrialsTableModel.isSelectedTrait(trait)) { selectViewRow = vrow; } if (traitsEditable) { startEditingTraitInternal(trait, selectViewRow, null); } else { warnEditingLocked(); } } } } } }); traitsTable.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); traitsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { List<Trait> selectedTraits = getSelectedTraits(); traitTrialsTableModel.setSelectedTraits(selectedTraits); if (selectedTraits.size() == 1) { Trait trait = null; int vrow = traitsTable.getSelectedRow(); if (vrow >= 0) { int mrow = traitsTable.convertRowIndexToModel(vrow); if (mrow >= 0) { trait = traitTableModel.getEntityAt(mrow); } } showTraitDetails(trait); } deleteTraitsAction.setEnabled(selectedTraits.size() > 0); showCorrectCard(); } } }); TraitTableModel.initValidationExpressionRenderer(traitsTable); if (RunMode.getRunMode().isDeveloper()) { TraitTableModel.initTableForRawExpression(traitsTable); } cardPanel.add(noTraitsComponent, CARD_NO_TRAITS); cardPanel.add(selectTraitComponent, CARD_SELECT_TO_EDIT); cardPanel.add(new JScrollPane(traitPropertiesTable), CARD_TRAIT_EDITOR); JButton undoButton = initAction(undoAction, ImageId.UNDO_24, "Undo", KeyStroke.getKeyStroke('Z', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); JButton redoButton = initAction(redoAction, ImageId.REDO_24, "Redo", KeyStroke.getKeyStroke('Y', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); Box undoRedoButtons = Box.createHorizontalBox(); undoRedoButtons.add(undoButton); undoRedoButtons.add(redoButton); JPanel detailsPanel = new JPanel(new BorderLayout()); detailsPanel.add(GuiUtil.createLabelSeparator("Details", undoRedoButtons), BorderLayout.NORTH); detailsPanel.add(cardPanel, BorderLayout.CENTER); detailsPanel.add(legendPanel, BorderLayout.SOUTH); PromptScrollPane scrollPane = new PromptScrollPane(traitsTable, "Drag/Drop Traits CSV file or use 'Import Traits'"); TableTransferHandler tth = TableTransferHandler.initialiseForCopySelectAll(traitsTable, true); traitsTable.setTransferHandler(new ChainingTransferHandler(flth, tth)); scrollPane.setTransferHandler(flth); if (addBarcodeIcon == null) { barcodesMenuAction.putValue(Action.NAME, "Barcodes..."); } else { barcodesMenuAction.putValue(Action.SMALL_ICON, addBarcodeIcon); } italicsForProtectedCheckbox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { traitNameCellRenderer.setUseItalicsForProtected(italicsForProtectedCheckbox.isSelected()); traitsTable.repaint(); } }); Box leftTopControls = Box.createHorizontalBox(); leftTopControls.add(importTraitsButton); leftTopControls.add(barcodesMenuButton); leftTopControls.add(new JButton(addNewTraitAction)); leftTopControls.add(new JButton(uploadTraitsAction)); leftTopControls.add(new JButton(exportTraitsAction)); leftTopControls.add(Box.createHorizontalGlue()); leftTopControls.add(editingLocked); leftTopControls.add(fixTraitLevelsButton); leftTopControls.add(refreshButton); leftTopControls.add(Box.createHorizontalStrut(8)); leftTopControls.add(new JButton(deleteTraitsAction)); // leftTopControls.add(Box.createHorizontalStrut(4)); Box explanations = Box.createHorizontalBox(); explanations.add(italicsForProtectedCheckbox); explanations.add(badForCalc); explanations.add(Box.createHorizontalGlue()); fixTraitLevelsButton.setToolTipText("Fix Traits with " + TraitLevel.UNDECIDABLE.visible + " 'Level'"); fixTraitLevelsButton.setVisible(false); JPanel leftTop = new JPanel(new BorderLayout()); leftTop.add(leftTopControls, BorderLayout.NORTH); leftTop.add(scrollPane, BorderLayout.CENTER); leftTop.add(explanations, BorderLayout.SOUTH); JPanel leftBot = new JPanel(new BorderLayout()); leftBot.add(GuiUtil.createLabelSeparator("Used by Trials"), BorderLayout.NORTH); leftBot.add(new PromptScrollPane(traitTrialsTable, "Any Trials using selected Traits appear here")); JSplitPane leftSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, leftTop, leftBot); leftSplit.setResizeWeight(0.5); splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftSplit, detailsPanel); splitPane.setOneTouchExpandable(true); splitPane.setResizeWeight(0.5); add(splitPane, BorderLayout.CENTER); }
From source file:cs.cirg.cida.CIDAView.java
/** This method is called from within the constructor to * initialize the form.//ww w .j a v a2 s.co m * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { mainPanel = new javax.swing.JPanel(); testPanel = new javax.swing.JTabbedPane(); homePanel = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); synopsisTable = new javax.swing.JTable(); experimentsLabel = new javax.swing.JLabel(); loadExperimentButton = new javax.swing.JButton(); experimentsComboBox = new javax.swing.JComboBox(); editResultsNameCheckBox = new javax.swing.JCheckBox(); addToTestButton = new javax.swing.JButton(); variablesLabel = new javax.swing.JLabel(); variablesComboBox = new javax.swing.JComboBox(); addAllRowsCheckBox = new javax.swing.JCheckBox(); exportTableButton = new javax.swing.JButton(); addToAnalysisPanel = new javax.swing.JPanel(); addOneVariableAnalysis = new javax.swing.JButton(); addAllExperimentsAnalysis = new javax.swing.JButton(); jLabel5 = new javax.swing.JLabel(); addToAnalysisPanel1 = new javax.swing.JPanel(); addAllVariablesAnalysis = new javax.swing.JButton(); jLabel4 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); addToAnalysisPanel2 = new javax.swing.JPanel(); addAllAnalysis = new javax.swing.JButton(); jLabel6 = new javax.swing.JLabel(); rawPanel = new javax.swing.JPanel(); rawPanelToolbar = new javax.swing.JToolBar(); exportDataButton = new javax.swing.JButton(); rawScrollPane = new javax.swing.JScrollPane(); rawTable = new javax.swing.JTable(); analysisPanel = new javax.swing.JPanel(); analysisToolbar = new javax.swing.JToolBar(); plotButton = new javax.swing.JButton(); clearAnalysisButton = new javax.swing.JButton(); exportAnalysisButton = new javax.swing.JButton(); analysisScrollPane = new javax.swing.JScrollPane(); analysisTable = new javax.swing.JTable(); chartHomePanel = new javax.swing.JPanel(); chartToolbar = new javax.swing.JToolBar(); toggleLineTicksButton = new javax.swing.JToggleButton(); lineTickIntervalLabel = new javax.swing.JLabel(); lineTickIntervalInput = new javax.swing.JTextField(); lineSeriesComboBox = new javax.swing.JComboBox(); seriesColorButton = new javax.swing.JButton(); seriesNameButton = new javax.swing.JButton(); exportPNGButton = new javax.swing.JButton(); exportEPSButton = new javax.swing.JButton(); chartScrollPane = new javax.swing.JScrollPane(); chartPanel = new ChartPanel(null, true, true, false, true, true); jPanel1 = new javax.swing.JPanel(); testToolbar = new javax.swing.JToolBar(); jLabel1 = new javax.swing.JLabel(); variablesTestComboBox = new javax.swing.JComboBox(); jLabel2 = new javax.swing.JLabel(); hypothesisComboBox = new javax.swing.JComboBox(); mannWhitneyUTestButton = new javax.swing.JButton(); testExperimentsScrollPane = new javax.swing.JScrollPane(); testExperimentsTable = new javax.swing.JTable(); testResultsScrollPane = new javax.swing.JScrollPane(); testResultsTable = new javax.swing.JTable(); menuBar = new javax.swing.JMenuBar(); javax.swing.JMenu fileMenu = new javax.swing.JMenu(); javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem(); javax.swing.JMenu helpMenu = new javax.swing.JMenu(); javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem(); statusPanel = new javax.swing.JPanel(); javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator(); statusMessageLabel = new javax.swing.JLabel(); statusAnimationLabel = new javax.swing.JLabel(); progressBar = new javax.swing.JProgressBar(); mainPanel.setName("mainPanel"); // NOI18N mainPanel.setPreferredSize(new java.awt.Dimension(1024, 768)); testPanel.setAutoscrolls(true); testPanel.setName("testPanel"); // NOI18N testPanel.setPreferredSize(new java.awt.Dimension(1024, 768)); homePanel.setAutoscrolls(true); homePanel.setName("homePanel"); // NOI18N jScrollPane1.setName("jScrollPane1"); // NOI18N synopsisTable.setAutoCreateRowSorter(true); synopsisTable.setModel(new SynopsisTableModel()); synopsisTable.setColumnSelectionAllowed(true); synopsisTable.setName("synopsisTable"); // NOI18N jScrollPane1.setViewportView(synopsisTable); synopsisTable.getColumnModel().getSelectionModel() .setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application .getInstance(cs.cirg.cida.CIDAApplication.class).getContext().getResourceMap(CIDAView.class); experimentsLabel.setText(resourceMap.getString("experimentsLabel.text")); // NOI18N experimentsLabel.setName("experimentsLabel"); // NOI18N javax.swing.ActionMap actionMap = org.jdesktop.application.Application .getInstance(cs.cirg.cida.CIDAApplication.class).getContext().getActionMap(CIDAView.class, this); loadExperimentButton.setAction(actionMap.get("loadExperiment")); // NOI18N loadExperimentButton.setText(resourceMap.getString("loadExperimentButton.text")); // NOI18N loadExperimentButton.setMaximumSize(new java.awt.Dimension(110, 29)); loadExperimentButton.setMinimumSize(new java.awt.Dimension(110, 29)); loadExperimentButton.setName("loadExperimentButton"); // NOI18N loadExperimentButton.setPreferredSize(new java.awt.Dimension(110, 29)); experimentsComboBox.setModel(new javax.swing.DefaultComboBoxModel()); experimentsComboBox.setName("experimentsComboBox"); // NOI18N experimentsComboBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { experimentsComboBoxActionPerformed(evt); } }); editResultsNameCheckBox.setSelected(true); editResultsNameCheckBox.setText(resourceMap.getString("editResultsNameCheckBox.text")); // NOI18N editResultsNameCheckBox.setName("editResultsNameCheckBox"); // NOI18N addToTestButton.setAction(actionMap.get("addExperimentToTest")); // NOI18N addToTestButton.setText(resourceMap.getString("addToTestButton.text")); // NOI18N addToTestButton.setMaximumSize(new java.awt.Dimension(110, 29)); addToTestButton.setMinimumSize(new java.awt.Dimension(110, 29)); addToTestButton.setName("addToTestButton"); // NOI18N addToTestButton.setPreferredSize(new java.awt.Dimension(110, 29)); variablesLabel.setText(resourceMap.getString("variablesLabel.text")); // NOI18N variablesLabel.setName("variablesLabel"); // NOI18N variablesComboBox.setName("variablesComboBox"); // NOI18N addAllRowsCheckBox.setSelected(true); addAllRowsCheckBox.setText(resourceMap.getString("addAllRowsCheckBox.text")); // NOI18N addAllRowsCheckBox.setName("addAllRowsCheckBox"); // NOI18N exportTableButton.setAction(actionMap.get("exportSynopsisTable")); // NOI18N exportTableButton.setText(resourceMap.getString("exportTableButton.text")); // NOI18N exportTableButton.setName("exportTableButton"); // NOI18N addToAnalysisPanel.setName("addToAnalysisPanel"); // NOI18N addOneVariableAnalysis.setAction(actionMap.get("addVariableAnalysis")); // NOI18N addOneVariableAnalysis.setText(resourceMap.getString("addOneVariableAnalysis.text")); // NOI18N addOneVariableAnalysis.setName("addOneVariableAnalysis"); // NOI18N addAllExperimentsAnalysis.setAction(actionMap.get("addAllExperimentsAnalysis")); // NOI18N addAllExperimentsAnalysis.setText(resourceMap.getString("addAllExperimentsAnalysis.text")); // NOI18N addAllExperimentsAnalysis.setName("addAllExperimentsAnalysis"); // NOI18N jLabel5.setFont(resourceMap.getFont("jLabel5.font")); // NOI18N jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N jLabel5.setName("jLabel5"); // NOI18N org.jdesktop.layout.GroupLayout addToAnalysisPanelLayout = new org.jdesktop.layout.GroupLayout( addToAnalysisPanel); addToAnalysisPanel.setLayout(addToAnalysisPanelLayout); addToAnalysisPanelLayout .setHorizontalGroup( addToAnalysisPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(addToAnalysisPanelLayout.createSequentialGroup().add(addToAnalysisPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(addOneVariableAnalysis, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(addAllExperimentsAnalysis, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE) .addContainerGap())); addToAnalysisPanelLayout.setVerticalGroup(addToAnalysisPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(addToAnalysisPanelLayout.createSequentialGroup().add(jLabel5).add(8, 8, 8) .add(addToAnalysisPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(addOneVariableAnalysis, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(addAllExperimentsAnalysis, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))); addToAnalysisPanel1.setName("addToAnalysisPanel1"); // NOI18N addAllVariablesAnalysis.setAction(actionMap.get("addAllVariablesAnalysis")); // NOI18N addAllVariablesAnalysis.setText(resourceMap.getString("addAllVariablesAnalysis.text")); // NOI18N addAllVariablesAnalysis.setName("addAllVariablesAnalysis"); // NOI18N jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N jLabel4.setName("jLabel4"); // NOI18N org.jdesktop.layout.GroupLayout addToAnalysisPanel1Layout = new org.jdesktop.layout.GroupLayout( addToAnalysisPanel1); addToAnalysisPanel1.setLayout(addToAnalysisPanel1Layout); addToAnalysisPanel1Layout.setHorizontalGroup(addToAnalysisPanel1Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(addToAnalysisPanel1Layout.createSequentialGroup().add(jLabel4) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add(addAllVariablesAnalysis, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)); addToAnalysisPanel1Layout.setVerticalGroup( addToAnalysisPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(addToAnalysisPanel1Layout.createSequentialGroup().add(jLabel4) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(addAllVariablesAnalysis, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jLabel3.setFont(resourceMap.getFont("jLabel3.font")); // NOI18N jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N jLabel3.setName("jLabel3"); // NOI18N addToAnalysisPanel2.setName("addToAnalysisPanel2"); // NOI18N addAllAnalysis.setAction(actionMap.get("addAllAnalysis")); // NOI18N addAllAnalysis.setText(resourceMap.getString("addAllAnalysis.text")); // NOI18N addAllAnalysis.setName("addAllAnalysis"); // NOI18N jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N jLabel6.setName("jLabel6"); // NOI18N org.jdesktop.layout.GroupLayout addToAnalysisPanel2Layout = new org.jdesktop.layout.GroupLayout( addToAnalysisPanel2); addToAnalysisPanel2.setLayout(addToAnalysisPanel2Layout); addToAnalysisPanel2Layout.setHorizontalGroup( addToAnalysisPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(addToAnalysisPanel2Layout.createSequentialGroup() .add(addToAnalysisPanel2Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(jLabel6) .add(addAllAnalysis)) .addContainerGap(95, Short.MAX_VALUE))); addToAnalysisPanel2Layout.setVerticalGroup( addToAnalysisPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(addToAnalysisPanel2Layout.createSequentialGroup().add(jLabel6) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(addAllAnalysis, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); org.jdesktop.layout.GroupLayout homePanelLayout = new org.jdesktop.layout.GroupLayout(homePanel); homePanel.setLayout(homePanelLayout); homePanelLayout.setHorizontalGroup(homePanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(homePanelLayout.createSequentialGroup().addContainerGap().add(homePanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 976, Short.MAX_VALUE) .add(homePanelLayout.createSequentialGroup().add(homePanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(homePanelLayout.createSequentialGroup().add(variablesLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(variablesComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 341, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(org.jdesktop.layout.GroupLayout.LEADING, homePanelLayout .createSequentialGroup() .add(experimentsComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 348, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(homePanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(homePanelLayout.createSequentialGroup().add(18, 18, 18).add( addToTestButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(homePanelLayout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(loadExperimentButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(homePanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(editResultsNameCheckBox).add(jLabel3) .add(addToAnalysisPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(exportTableButton) .add(addToAnalysisPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(addToAnalysisPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(addAllRowsCheckBox)) .add(experimentsLabel)).addContainerGap())); homePanelLayout.setVerticalGroup(homePanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(homePanelLayout.createSequentialGroup().addContainerGap().add(homePanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(homePanelLayout.createSequentialGroup().add(experimentsLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(homePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(editResultsNameCheckBox) .add(experimentsComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(loadExperimentButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) .add(addToTestButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) .add(homePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(variablesComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(variablesLabel).add(jLabel3)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(addToAnalysisPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(12, 12, 12)) .add(addAllRowsCheckBox)).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(addToAnalysisPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) .add(addToAnalysisPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(18, 18, 18).add(exportTableButton).add(18, 18, 18) .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) .addContainerGap())); testPanel.addTab(resourceMap.getString("homePanel.TabConstraints.tabTitle"), homePanel); // NOI18N rawPanel.setName("rawPanel"); // NOI18N rawPanelToolbar.setRollover(true); rawPanelToolbar.setName("rawPanelToolbar"); // NOI18N exportDataButton.setAction(actionMap.get("exportRaw")); // NOI18N exportDataButton.setText(resourceMap.getString("exportDataButton.text")); // NOI18N exportDataButton.setFocusable(false); exportDataButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); exportDataButton.setName("exportDataButton"); // NOI18N exportDataButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); rawPanelToolbar.add(exportDataButton); rawScrollPane.setName("rawScrollPane"); // NOI18N rawTable.setAutoCreateRowSorter(true); rawTable.setModel(new IOBridgeTableModel()); rawTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); rawTable.setColumnSelectionAllowed(true); rawTable.setName("rawTable"); // NOI18N rawScrollPane.setViewportView(rawTable); rawTable.getColumnModel().getSelectionModel() .setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); org.jdesktop.layout.GroupLayout rawPanelLayout = new org.jdesktop.layout.GroupLayout(rawPanel); rawPanel.setLayout(rawPanelLayout); rawPanelLayout .setHorizontalGroup(rawPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(rawPanelToolbar, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1000, Short.MAX_VALUE) .add(rawScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1000, Short.MAX_VALUE)); rawPanelLayout.setVerticalGroup(rawPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(rawPanelLayout.createSequentialGroup() .add(rawPanelToolbar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(rawScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 670, Short.MAX_VALUE) .addContainerGap())); testPanel.addTab(resourceMap.getString("rawPanel.TabConstraints.tabTitle"), rawPanel); // NOI18N analysisPanel.setName("analysisPanel"); // NOI18N analysisToolbar.setRollover(true); analysisToolbar.setName("analysisToolbar"); // NOI18N plotButton.setAction(actionMap.get("plotGraph")); // NOI18N plotButton.setText(resourceMap.getString("plotButton.text")); // NOI18N plotButton.setFocusable(false); plotButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); plotButton.setName("plotButton"); // NOI18N plotButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); analysisToolbar.add(plotButton); clearAnalysisButton.setAction(actionMap.get("clearAnalysisTable")); // NOI18N clearAnalysisButton.setText(resourceMap.getString("clearAnalysisButton.text")); // NOI18N clearAnalysisButton.setFocusable(false); clearAnalysisButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); clearAnalysisButton.setName("clearAnalysisButton"); // NOI18N clearAnalysisButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); analysisToolbar.add(clearAnalysisButton); exportAnalysisButton.setAction(actionMap.get("exportAnalysis")); // NOI18N exportAnalysisButton.setText(resourceMap.getString("exportAnalysisButton.text")); // NOI18N exportAnalysisButton.setFocusable(false); exportAnalysisButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); exportAnalysisButton.setName("exportAnalysisButton"); // NOI18N exportAnalysisButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); analysisToolbar.add(exportAnalysisButton); analysisScrollPane.setName("analysisScrollPane"); // NOI18N ListSelectionModel listSelectionModel = analysisTable.getSelectionModel(); listSelectionModel.addListSelectionListener(new SelectionListener(userSelectedRows)); analysisTable.setSelectionModel(listSelectionModel); analysisTable.setAutoCreateRowSorter(true); analysisTable.setModel(new IOBridgeTableModel()); analysisTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); analysisTable.setColumnSelectionAllowed(true); analysisTable.setName("analysisTable"); // NOI18N analysisScrollPane.setViewportView(analysisTable); analysisTable.getColumnModel().getSelectionModel() .setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); listSelectionModel = analysisTable.getColumnModel().getSelectionModel(); listSelectionModel.addListSelectionListener(new SelectionListener(userSelectedColumns)); analysisTable.getColumnModel().setSelectionModel(listSelectionModel); org.jdesktop.layout.GroupLayout analysisPanelLayout = new org.jdesktop.layout.GroupLayout(analysisPanel); analysisPanel.setLayout(analysisPanelLayout); analysisPanelLayout.setHorizontalGroup(analysisPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, analysisPanelLayout.createSequentialGroup() .add(analysisPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, analysisScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 988, Short.MAX_VALUE) .add(analysisToolbar, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 988, Short.MAX_VALUE)) .addContainerGap())); analysisPanelLayout.setVerticalGroup(analysisPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(analysisPanelLayout.createSequentialGroup() .add(analysisToolbar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(analysisScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 670, Short.MAX_VALUE) .addContainerGap())); testPanel.addTab(resourceMap.getString("analysisPanel.TabConstraints.tabTitle"), analysisPanel); // NOI18N chartHomePanel.setName("chartHomePanel"); // NOI18N chartToolbar.setRollover(true); chartToolbar.setName("chartToolbar"); // NOI18N toggleLineTicksButton.setAction(actionMap.get("toggleLineTicks")); // NOI18N toggleLineTicksButton.setText(resourceMap.getString("toggleLineTicksButton.text")); // NOI18N toggleLineTicksButton.setFocusable(false); toggleLineTicksButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); toggleLineTicksButton.setName("toggleLineTicksButton"); // NOI18N toggleLineTicksButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); chartToolbar.add(toggleLineTicksButton); lineTickIntervalLabel.setText(resourceMap.getString("lineTickIntervalLabel.text")); // NOI18N lineTickIntervalLabel.setName("lineTickIntervalLabel"); // NOI18N chartToolbar.add(lineTickIntervalLabel); lineTickIntervalInput.setText(resourceMap.getString("lineTickIntervalInput.text")); // NOI18N lineTickIntervalInput.setMinimumSize(new java.awt.Dimension(60, 27)); lineTickIntervalInput.setName("lineTickIntervalInput"); // NOI18N lineTickIntervalInput.setPreferredSize(new java.awt.Dimension(60, 27)); chartToolbar.add(lineTickIntervalInput); lineSeriesComboBox.setModel(new javax.swing.DefaultComboBoxModel()); lineSeriesComboBox.setName("lineSeriesComboBox"); // NOI18N chartToolbar.add(lineSeriesComboBox); seriesColorButton.setAction(actionMap.get("changeSeriesColor")); // NOI18N seriesColorButton.setText(resourceMap.getString("seriesColorButton.text")); // NOI18N seriesColorButton.setFocusable(false); seriesColorButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); seriesColorButton.setName("seriesColorButton"); // NOI18N seriesColorButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); chartToolbar.add(seriesColorButton); seriesNameButton.setAction(actionMap.get("changeSeriesName")); // NOI18N seriesNameButton.setText(resourceMap.getString("seriesNameButton.text")); // NOI18N seriesNameButton.setFocusable(false); seriesNameButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); seriesNameButton.setName("seriesNameButton"); // NOI18N seriesNameButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); chartToolbar.add(seriesNameButton); exportPNGButton.setAction(actionMap.get("savePlotPNG")); // NOI18N exportPNGButton.setText(resourceMap.getString("exportPNGButton.text")); // NOI18N exportPNGButton.setFocusable(false); exportPNGButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); exportPNGButton.setName("exportPNGButton"); // NOI18N exportPNGButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); chartToolbar.add(exportPNGButton); exportEPSButton.setAction(actionMap.get("savePlotEPS")); // NOI18N exportEPSButton.setText(resourceMap.getString("exportEPSButton.text")); // NOI18N exportEPSButton.setFocusable(false); exportEPSButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); exportEPSButton.setName("exportEPSButton"); // NOI18N exportEPSButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); chartToolbar.add(exportEPSButton); chartScrollPane.setName("chartScrollPane"); // NOI18N chartPanel.setName("chartPanel"); // NOI18N org.jdesktop.layout.GroupLayout chartPanelLayout = new org.jdesktop.layout.GroupLayout(chartPanel); chartPanel.setLayout(chartPanelLayout); chartPanelLayout.setHorizontalGroup(chartPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 2735, Short.MAX_VALUE)); chartPanelLayout.setVerticalGroup(chartPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 1168, Short.MAX_VALUE)); chartScrollPane.setViewportView(chartPanel); org.jdesktop.layout.GroupLayout chartHomePanelLayout = new org.jdesktop.layout.GroupLayout(chartHomePanel); chartHomePanel.setLayout(chartHomePanelLayout); chartHomePanelLayout.setHorizontalGroup( chartHomePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(chartToolbar, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1000, Short.MAX_VALUE) .add(chartScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1000, Short.MAX_VALUE)); chartHomePanelLayout .setVerticalGroup(chartHomePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(chartHomePanelLayout.createSequentialGroup() .add(chartToolbar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(chartScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 682, Short.MAX_VALUE))); testPanel.addTab(resourceMap.getString("chartHomePanel.TabConstraints.tabTitle"), chartHomePanel); // NOI18N jPanel1.setName("jPanel1"); // NOI18N testToolbar.setRollover(true); testToolbar.setName("testToolbar"); // NOI18N jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N jLabel1.setName("jLabel1"); // NOI18N testToolbar.add(jLabel1); variablesTestComboBox.setModel(new javax.swing.DefaultComboBoxModel()); variablesTestComboBox.setName("variablesTestComboBox"); // NOI18N testToolbar.add(variablesTestComboBox); jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N jLabel2.setName("jLabel2"); // NOI18N testToolbar.add(jLabel2); hypothesisComboBox.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Not Equal", "Less Than", "Greater Than" })); hypothesisComboBox.setName("hypothesisComboBox"); // NOI18N testToolbar.add(hypothesisComboBox); mannWhitneyUTestButton.setAction(actionMap.get("runMannWhitneyUTest")); // NOI18N mannWhitneyUTestButton.setText(resourceMap.getString("mannWhitneyUTestButton.text")); // NOI18N mannWhitneyUTestButton.setFocusable(false); mannWhitneyUTestButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); mannWhitneyUTestButton.setName("mannWhitneyUTestButton"); // NOI18N mannWhitneyUTestButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); testToolbar.add(mannWhitneyUTestButton); testExperimentsScrollPane.setName("testExperimentsScrollPane"); // NOI18N testExperimentsTable.setAutoCreateRowSorter(true); testExperimentsTable.setModel(new SynopsisTableModel()); testExperimentsTable.setColumnSelectionAllowed(true); testExperimentsTable.setName("testExperimentsTable"); // NOI18N testExperimentsScrollPane.setViewportView(testExperimentsTable); testExperimentsTable.getColumnModel().getSelectionModel() .setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); testResultsScrollPane.setName("testResultsScrollPane"); // NOI18N testResultsTable.setAutoCreateRowSorter(true); testResultsTable.setModel(new SynopsisTableModel()); testResultsTable.setName("testResultsTable"); // NOI18N testResultsScrollPane.setViewportView(testResultsTable); testResultsTable.getColumnModel().getSelectionModel() .setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(testToolbar, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1000, Short.MAX_VALUE) .add(testExperimentsScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1000, Short.MAX_VALUE) .add(testResultsScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1000, Short.MAX_VALUE)); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel1Layout.createSequentialGroup() .add(testToolbar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(testExperimentsScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 277, Short.MAX_VALUE) .add(128, 128, 128).add(testResultsScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 277, Short.MAX_VALUE))); testPanel.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N org.jdesktop.layout.GroupLayout mainPanelLayout = new org.jdesktop.layout.GroupLayout(mainPanel); mainPanel.setLayout(mainPanelLayout); mainPanelLayout .setHorizontalGroup(mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(mainPanelLayout.createSequentialGroup() .add(testPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1012, Short.MAX_VALUE) .addContainerGap())); mainPanelLayout .setVerticalGroup(mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(mainPanelLayout.createSequentialGroup() .add(testPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 756, Short.MAX_VALUE) .addContainerGap())); menuBar.setName("menuBar"); // NOI18N fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N fileMenu.setName("fileMenu"); // NOI18N exitMenuItem.setName("exitMenuItem"); // NOI18N fileMenu.add(exitMenuItem); menuBar.add(fileMenu); helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N helpMenu.setName("helpMenu"); // NOI18N aboutMenuItem.setName("aboutMenuItem"); // NOI18N helpMenu.add(aboutMenuItem); menuBar.add(helpMenu); statusPanel.setName("statusPanel"); // NOI18N statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N statusMessageLabel.setName("statusMessageLabel"); // NOI18N statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N progressBar.setName("progressBar"); // NOI18N org.jdesktop.layout.GroupLayout statusPanelLayout = new org.jdesktop.layout.GroupLayout(statusPanel); statusPanel.setLayout(statusPanelLayout); statusPanelLayout.setHorizontalGroup(statusPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(statusPanelSeparator, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1446, Short.MAX_VALUE) .add(statusPanelLayout.createSequentialGroup().addContainerGap().add(statusMessageLabel) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 1262, Short.MAX_VALUE) .add(progressBar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(statusAnimationLabel) .addContainerGap())); statusPanelLayout .setVerticalGroup(statusPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(statusPanelLayout.createSequentialGroup() .add(statusPanelSeparator, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(statusPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(statusMessageLabel).add(statusAnimationLabel).add(progressBar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(3, 3, 3))); setComponent(mainPanel); }
From source file:eu.crisis_economics.abm.dashboard.Page_Parameters.java
@SuppressWarnings("serial") private JPanel createParamsweepGUI() { // left/*from w w w .j ava 2 s.c o m*/ parameterList = new JList(); parameterList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); new ListAction(parameterList, new AbstractAction() { public void actionPerformed(final ActionEvent event) { final AvailableParameter selectedParameter = (AvailableParameter) parameterList.getSelectedValue(); addParameterToTree(new AvailableParameter[] { selectedParameter }, parameterTreeBranches.get(0)); enableDisableParameterCombinationButtons(); } }); parameterList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { if (!parameterList.isSelectionEmpty()) { boolean success = true; if (editedNode != null) success = modify(); if (success) { cancelAllSelectionBut(parameterList); resetSettings(); updateDescriptionField(parameterList.getSelectedValues()); enableDisableParameterCombinationButtons(); } else parameterList.clearSelection(); } } }); final JScrollPane parameterListPane = new JScrollPane(parameterList); parameterListPane.setBorder(BorderFactory.createTitledBorder("")); // for rounded border parameterListPane.setPreferredSize(new Dimension(300, 300)); final JPanel parametersPanel = FormsUtils.build("p ' p:g", "[DialogBorder]00||" + "12||" + "34||" + // "56||" + "55||" + "66 f:p:g", new FormsUtils.Separator("<html><b>General parameters</b></html>"), NUMBER_OF_TURNS_LABEL_TEXT, numberOfTurnsFieldPSW, NUMBER_OF_TIMESTEPS_TO_IGNORE_LABEL_TEXT, numberTimestepsIgnoredPSW, // UPDATE_CHARTS_LABEL_TEXT,onLineChartsCheckBoxPSW, new FormsUtils.Separator("<html><b>Model parameters</b></html>"), parameterListPane).getPanel(); combinationsPanel = new JPanel(new GridLayout(0, 1, 5, 5)); combinationsScrPane = new JScrollPane(combinationsPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); combinationsScrPane.setBorder(null); combinationsScrPane.setPreferredSize(new Dimension(550, 500)); parameterDescriptionLabel = new JXLabel(); parameterDescriptionLabel.setLineWrap(true); parameterDescriptionLabel.setVerticalAlignment(SwingConstants.TOP); final JScrollPane descriptionScrollPane = new JScrollPane(parameterDescriptionLabel); descriptionScrollPane.setBorder(BorderFactory.createTitledBorder(null, "Description", TitledBorder.LEADING, TitledBorder.BELOW_TOP)); descriptionScrollPane.setPreferredSize( new Dimension(PARAMETER_DESCRIPTION_LABEL_WIDTH, PARAMETER_DESCRIPTION_LABEL_HEIGHT)); descriptionScrollPane.setViewportBorder(null); final JButton addNewBoxButton = new JButton("Add new combination"); addNewBoxButton.setActionCommand(ACTIONCOMMAND_ADD_BOX); final JPanel left = FormsUtils.build("p ~ f:p:g ~ p", "011 f:p:g ||" + "0_2 p", parametersPanel, combinationsScrPane, addNewBoxButton).getPanel(); left.setBorder(BorderFactory.createTitledBorder(null, "Specify parameter combinations", TitledBorder.LEADING, TitledBorder.BELOW_TOP)); Style.registerCssClasses(left, Dashboard.CSS_CLASS_COMMON_PANEL); final JPanel leftAndDesc = new JPanel(new BorderLayout()); leftAndDesc.add(left, BorderLayout.CENTER); leftAndDesc.add(descriptionScrollPane, BorderLayout.SOUTH); Style.registerCssClasses(leftAndDesc, Dashboard.CSS_CLASS_COMMON_PANEL); // right editedParameterText = new JLabel(ORIGINAL_TEXT); editedParameterText.setPreferredSize(new Dimension(280, 40)); constDef = new JRadioButton("Constant"); listDef = new JRadioButton("List"); incrDef = new JRadioButton("Increment"); final JPanel rightTop = FormsUtils.build("p:g", "[DialogBorder]0||" + "1||" + "2||" + "3", editedParameterText, constDef, listDef, incrDef).getPanel(); Style.registerCssClasses(rightTop, Dashboard.CSS_CLASS_COMMON_PANEL); constDefField = new JTextField(); final JPanel constDefPanel = FormsUtils .build("p ~ p:g", "[DialogBorder]01 p", "Constant value: ", CellConstraints.TOP, constDefField) .getPanel(); listDefArea = new JTextArea(); final JScrollPane listDefScr = new JScrollPane(listDefArea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); final JPanel listDefPanel = FormsUtils.build("p ~ p:g", "[DialogBorder]01|" + "_1 f:p:g||" + "_2 p", "Value list: ", listDefScr, "(Separate values with spaces!)").getPanel(); incrStartValueField = new JTextField(); incrEndValueField = new JTextField(); incrStepField = new JTextField(); final JPanel incrDefPanel = FormsUtils.build("p ~ p:g", "[DialogBorder]01||" + "23||" + "45", "Start value: ", incrStartValueField, "End value: ", incrEndValueField, "Step: ", incrStepField) .getPanel(); enumDefBox = new JComboBox(new DefaultComboBoxModel()); final JPanel enumDefPanel = FormsUtils .build("p ~ p:g", "[DialogBorder]01 p", "Constant value:", CellConstraints.TOP, enumDefBox) .getPanel(); submodelTypeBox = new JComboBox(); final JPanel submodelTypePanel = FormsUtils .build("p ~ p:g", "[DialogBorder]01", "Constant value:", CellConstraints.TOP, submodelTypeBox) .getPanel(); fileTextField = new JTextField(); fileTextField.addKeyListener(new KeyAdapter() { public void keyTyped(final KeyEvent e) { final char character = e.getKeyChar(); final File file = new File(Character.isISOControl(character) ? fileTextField.getText() : fileTextField.getText() + character); fileTextField.setToolTipText(file.getAbsolutePath()); } }); fileBrowseButton = new JButton(BROWSE_BUTTON_TEXT); fileBrowseButton.setActionCommand(ACTIONCOMMAND_BROWSE); final JPanel fileDefPanel = FormsUtils .build("p ~ p:g ~p", "[DialogBorder]012", "File:", fileTextField, fileBrowseButton).getPanel(); constDefPanel.setName("CONST"); listDefPanel.setName("LIST"); incrDefPanel.setName("INCREMENT"); enumDefPanel.setName("ENUM"); submodelTypePanel.setName("SUBMODEL"); fileDefPanel.setName("FILE"); Style.registerCssClasses(constDefPanel, Dashboard.CSS_CLASS_COMMON_PANEL); Style.registerCssClasses(listDefPanel, Dashboard.CSS_CLASS_COMMON_PANEL); Style.registerCssClasses(incrDefPanel, Dashboard.CSS_CLASS_COMMON_PANEL); Style.registerCssClasses(enumDefPanel, Dashboard.CSS_CLASS_COMMON_PANEL); Style.registerCssClasses(submodelTypePanel, Dashboard.CSS_CLASS_COMMON_PANEL); Style.registerCssClasses(fileDefPanel, Dashboard.CSS_CLASS_COMMON_PANEL); rightMiddle = new JPanel(new CardLayout()); Style.registerCssClasses(rightMiddle, Dashboard.CSS_CLASS_COMMON_PANEL); rightMiddle.add(constDefPanel, constDefPanel.getName()); rightMiddle.add(listDefPanel, listDefPanel.getName()); rightMiddle.add(incrDefPanel, incrDefPanel.getName()); rightMiddle.add(enumDefPanel, enumDefPanel.getName()); rightMiddle.add(submodelTypePanel, submodelTypePanel.getName()); rightMiddle.add(fileDefPanel, fileDefPanel.getName()); modifyButton = new JButton("Modify"); cancelButton = new JButton("Cancel"); final JPanel rightBottom = FormsUtils .build("p:g p ~ p ~ p:g", "[DialogBorder]_01_ p", modifyButton, cancelButton).getPanel(); Style.registerCssClasses(rightBottom, Dashboard.CSS_CLASS_COMMON_PANEL); final JPanel right = new JPanel(new BorderLayout()); right.add(rightTop, BorderLayout.NORTH); right.add(rightMiddle, BorderLayout.CENTER); right.add(rightBottom, BorderLayout.SOUTH); right.setBorder(BorderFactory.createTitledBorder(null, "Parameter settings", TitledBorder.LEADING, TitledBorder.BELOW_TOP)); Style.registerCssClasses(right, Dashboard.CSS_CLASS_COMMON_PANEL); // the whole paramsweep panel final JPanel content = FormsUtils.build("p:g p", "01 f:p:g", leftAndDesc, right).getPanel(); Style.registerCssClasses(content, Dashboard.CSS_CLASS_COMMON_PANEL); sweepPanel = new JPanel(); Style.registerCssClasses(sweepPanel, Dashboard.CSS_CLASS_COMMON_PANEL); sweepPanel.setLayout(new BorderLayout()); final JScrollPane sp = new JScrollPane(content); sp.setBorder(null); sp.setViewportBorder(null); sweepPanel.add(sp, BorderLayout.CENTER); GUIUtils.createButtonGroup(constDef, listDef, incrDef); constDef.setSelected(true); constDef.setActionCommand("CONST"); listDef.setActionCommand("LIST"); incrDef.setActionCommand("INCREMENT"); constDefField.setActionCommand("CONST_FIELD"); incrStartValueField.setActionCommand("START_FIELD"); incrEndValueField.setActionCommand("END_FIELD"); incrStepField.setActionCommand("STEP_FIELD"); modifyButton.setActionCommand("EDIT"); cancelButton.setActionCommand("CANCEL"); listDefArea.setLineWrap(true); listDefArea.setWrapStyleWord(true); listDefScr.setPreferredSize(new Dimension(100, 200)); GUIUtils.addActionListener(this, modifyButton, cancelButton, constDef, listDef, incrDef, constDefField, incrStartValueField, incrEndValueField, incrStepField, addNewBoxButton, submodelTypeBox, fileBrowseButton); return sweepPanel; }
From source file:au.org.ala.delta.intkey.Intkey.java
/** * Creates and shows the GUI. Called by the swing application framework *//*from w w w . ja v a 2s.c o m*/ @Override protected void startup() { final JFrame mainFrame = getMainFrame(); _defaultGlassPane = mainFrame.getGlassPane(); mainFrame.setTitle("Intkey"); mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH); mainFrame.setIconImages(IconHelper.getRedIconList()); _helpController = new HelpController(HELPSET_PATH); _taxonformatter = new ItemFormatter(false, CommentStrippingMode.STRIP_ALL, AngleBracketHandlingMode.REMOVE, true, false, true); _context = new IntkeyContext(new IntkeyUIInterceptor(this), new DirectivePopulatorInterceptor(this)); _advancedModeOnlyDynamicButtons = new ArrayList<JButton>(); _normalModeOnlyDynamicButtons = new ArrayList<JButton>(); _activeOnlyWhenCharactersUsedButtons = new ArrayList<JButton>(); _dynamicButtonsFullHelp = new HashMap<JButton, String>(); ActionMap actionMap = getContext().getActionMap(); _rootPanel = new JPanel(); _rootPanel.setAlignmentX(Component.LEFT_ALIGNMENT); _rootPanel.setBackground(SystemColor.control); _rootPanel.setLayout(new BorderLayout(0, 0)); _globalOptionBar = new JPanel(); _globalOptionBar.setBorder(new EmptyBorder(0, 5, 0, 5)); _rootPanel.add(_globalOptionBar, BorderLayout.NORTH); _globalOptionBar.setLayout(new BorderLayout(0, 0)); _pnlDynamicButtons = new JPanel(); FlowLayout flowLayout_1 = (FlowLayout) _pnlDynamicButtons.getLayout(); flowLayout_1.setVgap(0); flowLayout_1.setHgap(0); _globalOptionBar.add(_pnlDynamicButtons, BorderLayout.WEST); _btnContextHelp = new JButton(); _btnContextHelp.setMinimumSize(new Dimension(30, 30)); _btnContextHelp.setMaximumSize(new Dimension(30, 30)); _btnContextHelp.setAction(actionMap.get("btnContextHelp")); _btnContextHelp.setPreferredSize(new Dimension(30, 30)); _btnContextHelp.setMargin(new Insets(2, 5, 2, 5)); _btnContextHelp.addActionListener(actionMap.get("btnContextHelp")); _globalOptionBar.add(_btnContextHelp, BorderLayout.EAST); _rootSplitPane = new JSplitPane(); _rootSplitPane.setDividerSize(3); _rootSplitPane.setResizeWeight(0.5); _rootSplitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT); _rootSplitPane.setContinuousLayout(true); _rootPanel.add(_rootSplitPane); _innerSplitPaneLeft = new JSplitPane(); _innerSplitPaneLeft.setMinimumSize(new Dimension(25, 25)); _innerSplitPaneLeft.setAlignmentX(Component.CENTER_ALIGNMENT); _innerSplitPaneLeft.setDividerSize(3); _innerSplitPaneLeft.setResizeWeight(0.5); _innerSplitPaneLeft.setContinuousLayout(true); _innerSplitPaneLeft.setOrientation(JSplitPane.VERTICAL_SPLIT); _rootSplitPane.setLeftComponent(_innerSplitPaneLeft); _pnlAvailableCharacters = new JPanel(); _innerSplitPaneLeft.setLeftComponent(_pnlAvailableCharacters); _pnlAvailableCharacters.setLayout(new BorderLayout(0, 0)); _sclPaneAvailableCharacters = new JScrollPane(); _pnlAvailableCharacters.add(_sclPaneAvailableCharacters, BorderLayout.CENTER); _listAvailableCharacters = new JList(); // _listAvailableCharacters.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); _listAvailableCharacters.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); _listAvailableCharacters.setCellRenderer(_availableCharactersListCellRenderer); _listAvailableCharacters.addMouseListener(new MouseInputAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() >= 2) { int selectedIndex = _listAvailableCharacters.getSelectedIndex(); if (selectedIndex >= 0) { try { Character ch = (Character) _availableCharacterListModel.getElementAt(selectedIndex); executeDirective(new UseDirective(), Integer.toString(ch.getCharacterId())); } catch (Exception ex) { ex.printStackTrace(); } } } } }); _sclPaneAvailableCharacters.setViewportView(_listAvailableCharacters); _pnlAvailableCharactersHeader = new JPanel(); _pnlAvailableCharacters.add(_pnlAvailableCharactersHeader, BorderLayout.NORTH); _pnlAvailableCharactersHeader.setLayout(new BorderLayout(0, 0)); _lblNumAvailableCharacters = new JLabel(); _lblNumAvailableCharacters.setBorder(new EmptyBorder(0, 5, 0, 0)); _lblNumAvailableCharacters.setFont(new Font("Tahoma", Font.PLAIN, 15)); _lblNumAvailableCharacters.setText(MessageFormat.format(availableCharactersCaption, 0)); _pnlAvailableCharactersHeader.add(_lblNumAvailableCharacters, BorderLayout.WEST); _pnlAvailableCharactersButtons = new JPanel(); FlowLayout flowLayout = (FlowLayout) _pnlAvailableCharactersButtons.getLayout(); flowLayout.setVgap(2); flowLayout.setHgap(2); _pnlAvailableCharactersHeader.add(_pnlAvailableCharactersButtons, BorderLayout.EAST); // All toolbar buttons should be disabled until a dataset is loaded. _btnRestart = new JButton(); _btnRestart.setAction(actionMap.get("btnRestart")); _btnRestart.setPreferredSize(new Dimension(30, 30)); _btnRestart.setEnabled(false); _pnlAvailableCharactersButtons.add(_btnRestart); _btnBestOrder = new JButton(); _btnBestOrder.setAction(actionMap.get("btnBestOrder")); _btnBestOrder.setPreferredSize(new Dimension(30, 30)); _btnBestOrder.setEnabled(false); _pnlAvailableCharactersButtons.add(_btnBestOrder); _btnSeparate = new JButton(); _btnSeparate.setAction(actionMap.get("btnSeparate")); _btnSeparate.setVisible(_advancedMode); _btnSeparate.setPreferredSize(new Dimension(30, 30)); _btnSeparate.setEnabled(false); _pnlAvailableCharactersButtons.add(_btnSeparate); _btnNaturalOrder = new JButton(); _btnNaturalOrder.setAction(actionMap.get("btnNaturalOrder")); _btnNaturalOrder.setPreferredSize(new Dimension(30, 30)); _btnNaturalOrder.setEnabled(false); _pnlAvailableCharactersButtons.add(_btnNaturalOrder); _btnDiffSpecimenTaxa = new JButton(); _btnDiffSpecimenTaxa.setAction(actionMap.get("btnDiffSpecimenTaxa")); _btnDiffSpecimenTaxa.setEnabled(false); _btnDiffSpecimenTaxa.setPreferredSize(new Dimension(30, 30)); _pnlAvailableCharactersButtons.add(_btnDiffSpecimenTaxa); _btnSetTolerance = new JButton(); _btnSetTolerance.setAction(actionMap.get("btnSetTolerance")); _btnSetTolerance.setPreferredSize(new Dimension(30, 30)); _btnSetTolerance.setEnabled(false); _pnlAvailableCharactersButtons.add(_btnSetTolerance); _btnSetMatch = new JButton(); _btnSetMatch.setAction(actionMap.get("btnSetMatch")); _btnSetMatch.setVisible(_advancedMode); _btnSetMatch.setPreferredSize(new Dimension(30, 30)); _btnSetMatch.setEnabled(false); _pnlAvailableCharactersButtons.add(_btnSetMatch); _btnSubsetCharacters = new JButton(); _btnSubsetCharacters.setAction(actionMap.get("btnSubsetCharacters")); _btnSubsetCharacters.setPreferredSize(new Dimension(30, 30)); _btnSubsetCharacters.setEnabled(false); _pnlAvailableCharactersButtons.add(_btnSubsetCharacters); _btnFindCharacter = new JButton(); _btnFindCharacter.setAction(actionMap.get("btnFindCharacter")); _btnFindCharacter.setPreferredSize(new Dimension(30, 30)); _btnFindCharacter.setEnabled(false); _pnlAvailableCharactersButtons.add(_btnFindCharacter); _pnlAvailableCharactersButtons.setEnabled(false); _pnlUsedCharacters = new JPanel(); _innerSplitPaneLeft.setRightComponent(_pnlUsedCharacters); _pnlUsedCharacters.setLayout(new BorderLayout(0, 0)); _sclPnUsedCharacters = new JScrollPane(); _pnlUsedCharacters.add(_sclPnUsedCharacters, BorderLayout.CENTER); _listUsedCharacters = new JList(); _listUsedCharacters.setCellRenderer(_usedCharactersListCellRenderer); _listUsedCharacters.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); _listUsedCharacters.addMouseListener(new MouseInputAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() >= 2) { int selectedIndex = _listUsedCharacters.getSelectedIndex(); if (selectedIndex >= 0) { try { Attribute attr = (Attribute) _usedCharacterListModel.getElementAt(selectedIndex); if (_context.charactersFixed() && _context.getFixedCharactersList() .contains(attr.getCharacter().getCharacterId())) { return; } executeDirective(new ChangeDirective(), Integer.toString(attr.getCharacter().getCharacterId())); } catch (Exception ex) { ex.printStackTrace(); } } } } }); _sclPnUsedCharacters.setViewportView(_listUsedCharacters); _pnlUsedCharactersHeader = new JPanel(); _pnlUsedCharacters.add(_pnlUsedCharactersHeader, BorderLayout.NORTH); _pnlUsedCharactersHeader.setLayout(new BorderLayout(0, 0)); _lblNumUsedCharacters = new JLabel(); _lblNumUsedCharacters.setBorder(new EmptyBorder(7, 5, 7, 0)); _lblNumUsedCharacters.setFont(new Font("Tahoma", Font.PLAIN, 15)); _lblNumUsedCharacters.setText(MessageFormat.format(usedCharactersCaption, 0)); _pnlUsedCharactersHeader.add(_lblNumUsedCharacters, BorderLayout.WEST); _innerSplitPaneRight = new JSplitPane(); _innerSplitPaneRight.setMinimumSize(new Dimension(25, 25)); _innerSplitPaneRight.setDividerSize(3); _innerSplitPaneRight.setResizeWeight(0.5); _innerSplitPaneRight.setContinuousLayout(true); _innerSplitPaneRight.setOrientation(JSplitPane.VERTICAL_SPLIT); _rootSplitPane.setRightComponent(_innerSplitPaneRight); _pnlRemainingTaxa = new JPanel(); _innerSplitPaneRight.setLeftComponent(_pnlRemainingTaxa); _pnlRemainingTaxa.setLayout(new BorderLayout(0, 0)); _sclPnRemainingTaxa = new JScrollPane(); _pnlRemainingTaxa.add(_sclPnRemainingTaxa, BorderLayout.CENTER); _listRemainingTaxa = new JList(); _listRemainingTaxa.addMouseListener(new MouseInputAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() >= 2) { displayInfoForSelectedTaxa(); } } }); _sclPnRemainingTaxa.setViewportView(_listRemainingTaxa); _pnlRemainingTaxaHeader = new JPanel(); _pnlRemainingTaxa.add(_pnlRemainingTaxaHeader, BorderLayout.NORTH); _pnlRemainingTaxaHeader.setLayout(new BorderLayout(0, 0)); _lblNumRemainingTaxa = new JLabel(); _lblNumRemainingTaxa.setBorder(new EmptyBorder(0, 5, 0, 0)); _lblNumRemainingTaxa.setFont(new Font("Tahoma", Font.PLAIN, 15)); _lblNumRemainingTaxa.setText(MessageFormat.format(remainingTaxaCaption, 0)); _pnlRemainingTaxaHeader.add(_lblNumRemainingTaxa, BorderLayout.WEST); _pnlRemainingTaxaButtons = new JPanel(); FlowLayout fl_pnlRemainingTaxaButtons = (FlowLayout) _pnlRemainingTaxaButtons.getLayout(); fl_pnlRemainingTaxaButtons.setVgap(2); fl_pnlRemainingTaxaButtons.setHgap(2); _pnlRemainingTaxaHeader.add(_pnlRemainingTaxaButtons, BorderLayout.EAST); // All toolbar buttons should be disabled until a dataset is loaded. _btnTaxonInfo = new JButton(); _btnTaxonInfo.setAction(actionMap.get("btnTaxonInfo")); _btnTaxonInfo.setPreferredSize(new Dimension(30, 30)); _btnTaxonInfo.setEnabled(false); _pnlRemainingTaxaButtons.add(_btnTaxonInfo); _btnDiffTaxa = new JButton(); _btnDiffTaxa.setAction(actionMap.get("btnDiffTaxa")); _btnDiffTaxa.setPreferredSize(new Dimension(30, 30)); _btnDiffTaxa.setEnabled(false); _pnlRemainingTaxaButtons.add(_btnDiffTaxa); _btnSubsetTaxa = new JButton(); _btnSubsetTaxa.setAction(actionMap.get("btnSubsetTaxa")); _btnSubsetTaxa.setPreferredSize(new Dimension(30, 30)); _btnSubsetTaxa.setEnabled(false); _pnlRemainingTaxaButtons.add(_btnSubsetTaxa); _btnFindTaxon = new JButton(); _btnFindTaxon.setAction(actionMap.get("btnFindTaxon")); _btnFindTaxon.setPreferredSize(new Dimension(30, 30)); _btnFindTaxon.setEnabled(false); _pnlRemainingTaxaButtons.add(_btnFindTaxon); _pnlEliminatedTaxa = new JPanel(); _innerSplitPaneRight.setRightComponent(_pnlEliminatedTaxa); _pnlEliminatedTaxa.setLayout(new BorderLayout(0, 0)); _sclPnEliminatedTaxa = new JScrollPane(); _pnlEliminatedTaxa.add(_sclPnEliminatedTaxa, BorderLayout.CENTER); _listEliminatedTaxa = new JList(); _listEliminatedTaxa.addMouseListener(new MouseInputAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() >= 2) { displayInfoForSelectedTaxa(); } } }); _sclPnEliminatedTaxa.setViewportView(_listEliminatedTaxa); _pnlEliminatedTaxaHeader = new JPanel(); _pnlEliminatedTaxa.add(_pnlEliminatedTaxaHeader, BorderLayout.NORTH); _pnlEliminatedTaxaHeader.setLayout(new BorderLayout(0, 0)); _lblEliminatedTaxa = new JLabel(); _lblEliminatedTaxa.setBorder(new EmptyBorder(7, 5, 7, 0)); _lblEliminatedTaxa.setFont(new Font("Tahoma", Font.PLAIN, 15)); _lblEliminatedTaxa.setText(MessageFormat.format(eliminatedTaxaCaption, 0)); _pnlEliminatedTaxaHeader.add(_lblEliminatedTaxa, BorderLayout.WEST); JMenuBar menuBar = buildMenus(_advancedMode); getMainView().setMenuBar(menuBar); _txtFldCmdBar = new JTextField(); _txtFldCmdBar.setCaretColor(Color.WHITE); _txtFldCmdBar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { String cmdStr = _txtFldCmdBar.getText(); cmdStr = cmdStr.trim(); if (_cmdMenus.containsKey(cmdStr)) { JMenu cmdMenu = _cmdMenus.get(cmdStr); cmdMenu.doClick(); } else { _context.parseAndExecuteDirective(cmdStr); } _txtFldCmdBar.setText(null); } }); _txtFldCmdBar.setFont(new Font("Courier New", Font.BOLD, 13)); _txtFldCmdBar.setForeground(SystemColor.text); _txtFldCmdBar.setBackground(Color.BLACK); _txtFldCmdBar.setOpaque(true); _txtFldCmdBar.setVisible(_advancedMode); _rootPanel.add(_txtFldCmdBar, BorderLayout.SOUTH); _txtFldCmdBar.setColumns(10); _logDialog = new RtfReportDisplayDialog(getMainFrame(), new SimpleRtfEditorKit(null), null, logDialogTitle); // Set context-sensitive help keys for toolbar buttons _helpController.setHelpKeyForComponent(_btnRestart, HELP_ID_CHARACTERS_TOOLBAR_RESTART); _helpController.setHelpKeyForComponent(_btnBestOrder, HELP_ID_CHARACTERS_TOOLBAR_BEST); _helpController.setHelpKeyForComponent(_btnSeparate, HELP_ID_CHARACTERS_TOOLBAR_SEPARATE); _helpController.setHelpKeyForComponent(_btnNaturalOrder, HELP_ID_CHARACTERS_TOOLBAR_NATURAL); _helpController.setHelpKeyForComponent(_btnDiffSpecimenTaxa, HELP_ID_CHARACTERS_TOOLBAR_DIFF_SPECIMEN_REMAINING); _helpController.setHelpKeyForComponent(_btnSetTolerance, HELP_ID_CHARACTERS_TOOLBAR_TOLERANCE); _helpController.setHelpKeyForComponent(_btnSetMatch, HELP_ID_CHARACTERS_TOOLBAR_SET_MATCH); _helpController.setHelpKeyForComponent(_btnSubsetCharacters, HELP_ID_CHARACTERS_TOOLBAR_SUBSET_CHARACTERS); _helpController.setHelpKeyForComponent(_btnFindCharacter, HELP_ID_CHARACTERS_TOOLBAR_FIND_CHARACTERS); _helpController.setHelpKeyForComponent(_btnTaxonInfo, HELP_ID_TAXA_TOOLBAR_INFO); _helpController.setHelpKeyForComponent(_btnDiffTaxa, HELP_ID_TAXA_TOOLBAR_DIFF_TAXA); _helpController.setHelpKeyForComponent(_btnSubsetTaxa, HELP_ID_TAXA_TOOLBAR_SUBSET_TAXA); _helpController.setHelpKeyForComponent(_btnFindTaxon, HELP_ID_TAXA_TOOLBAR_FIND_TAXA); // This mouse listener on the default glasspane is to assist with // context senstive help. It intercepts the mouse events, // determines what component was being clicked on, then takes the // appropriate action to provide help for the component _defaultGlassPane.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { // Determine what point has been clicked on Point glassPanePoint = e.getPoint(); Point containerPoint = SwingUtilities.convertPoint(getMainFrame().getGlassPane(), glassPanePoint, getMainFrame().getContentPane()); Component component = SwingUtilities.getDeepestComponentAt(getMainFrame().getContentPane(), containerPoint.x, containerPoint.y); // Get the java help ID for this component. If none has been // defined, this will be null String helpID = _helpController.getHelpKeyForComponent(component); // change the cursor back to the normal one and take down the // classpane mainFrame.setCursor(Cursor.getDefaultCursor()); mainFrame.getGlassPane().setVisible(false); // If a help ID was found, display the related help page in the // help viewer if (_helpController.getHelpKeyForComponent(component) != null) { _helpController.helpAction().actionPerformed(new ActionEvent(component, 0, null)); _helpController.displayHelpTopic(mainFrame, helpID); } else { // If a dynamically-defined toolbar button was clicked, show // the help for this button in the ToolbarHelpDialog. if (component instanceof JButton) { JButton button = (JButton) component; if (_dynamicButtonsFullHelp.containsKey(button)) { String fullHelpText = _dynamicButtonsFullHelp.get(button); if (fullHelpText == null) { fullHelpText = noHelpAvailableCaption; } RTFBuilder builder = new RTFBuilder(); builder.startDocument(); builder.appendText(fullHelpText); builder.endDocument(); ToolbarHelpDialog dlg = new ToolbarHelpDialog(mainFrame, builder.toString(), button.getIcon()); show(dlg); } } } } }); show(_rootPanel); }
From source file:com.diversityarrays.kdxplore.curate.fieldview.FieldLayoutViewPanel.java
private void initFieldLayoutTable() { rhtTableRowResizer.addRowHeightChangeListener(rowHeightChangeListener); rowHeaderTable.setDefaultRenderer(String.class, new RowHeaderTableCellRenderer()); fieldLayoutTable.getTableHeader().setReorderingAllowed(false); fieldLayoutTable.setResizable(true, true); tableColumnResizer = fieldLayoutTable.getTableColumnResizer(); tableColumnResizer.addPropertyChangeListener(TableColumnResizer.PROPERTY_WIDTH, tableColumnWidthListener); plotCellRenderer.updateTableRowHeight(fieldLayoutTable); fieldLayoutTable.setDefaultRenderer(Plot.class, plotCellRenderer); fieldLayoutTable.setCellSelectionEnabled(true); fieldLayoutTable.getColumnModel().addColumnModelListener(cellSelectionListener); fieldLayoutTable.getSelectionModel().addListSelectionListener(cellSelectionListener); fieldLayoutTable.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); }
From source file:com.googlecode.vfsjfilechooser2.filepane.VFSFilePane.java
private void doMultiSelectionChanged(PropertyChangeEvent e) { if (getFileChooser().isMultiSelectionEnabled()) { listSelectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); } else {// ww w . j av a 2 s . c o m listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); clearSelection(); getFileChooser().setSelectedFiles(null); } }
From source file:com.archivas.clienttools.arcmover.gui.panels.ProfilePanel.java
private void setFileList(final List<String> colsToDisplay, final List<ArcMoverFile> files, final boolean isVersionList, int badElementCnt, String dirPath) { fileListModel = new FileListTableModel(new ArrayList<String>(colsToDisplay)); fileList.setModel(fileListModel);/*from ww w.ja v a 2 s .c o m*/ fileList.setColumnCellRenderers(); fileList.setListData(new ArrayList<ArcMoverFile>(files)); if (isVersionList) { fileList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); } else { fileList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); } if (badElementCnt > 0) { String errMsg = String.format("Warning: omitted %d unsupported filename(s) in directory listing for %s", badElementCnt, profileModel.getSelectedProfile().decode(dirPath)); LOG.log(Level.WARNING, errMsg); if (HCPMoverProperties.DISPLAY_WARNINGS_FOR_BAD_ELEMENTS_IN_DIRECTORY_LISTINGS.getAsBoolean()) { GUIHelper.showMessageDialog(this, errMsg, "", JOptionPane.WARNING_MESSAGE); } } }