Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Orbit, a versatile image analysis software for biological image-based quantification.
* Copyright (C) 2009 - 2017 Actelion Pharmaceuticals Ltd., Gewerbestrasse 16, CH-4123 Allschwil, Switzerland.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
*/
package com.actelion.research.orbit.imageAnalysis.components;
import com.actelion.research.orbit.gui.IntInputVerifier;
import com.actelion.research.orbit.imageAnalysis.dal.DALConfig;
import com.actelion.research.orbit.imageAnalysis.models.ModelAnnotation;
import com.actelion.research.orbit.imageAnalysis.models.OrbitModel;
import com.actelion.research.orbit.imageAnalysis.utils.OrbitUtils;
import com.actelion.research.orbit.utils.RawUtilsCommon;
import org.jdesktop.swingx.JXSearchField;
import javax.swing.*;
import javax.swing.table.*;
import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
public class ModelBrowser {
private OrbitModel selectedModel;
public static void main(String[] args) throws Exception {
ModelBrowser browser = new ModelBrowser();
browser.showModelBrowser(null, "orbit");
}
public void showModelBrowser(final Frame owner, final String username) throws Exception {
showModelBrowser(owner,username,true);
}
public void showModelBrowser(final Frame owner, final String username, final boolean loadInOrbit) throws Exception {
List modelList = OrbitModel.LoadFromOrbitUser(null);
for (ModelAnnotation modelAnnotation : modelList) {
System.out.println("model: " + modelAnnotation.getDescription() + " (" + modelAnnotation.getRawAnnotationId() + ")");
}
// display
final JDialog frame = new JDialog(owner, "Orbit Models", true);
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.setSize(1024, 800);
frame.setLayout(new BorderLayout());
frame.setModal(true);
final TableModel tableModel = new OrbitModelTableModel(modelList);
final JTable table = new JTable(tableModel);
table.setAutoCreateRowSorter(true);
table.getColumnModel().getColumn(4).setCellRenderer(tableCellRenderer);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
final JXSearchField searchFieldName = new JXSearchField("name");
final JXSearchField searchFieldElb = new JXSearchField("elb");
final JXSearchField searchFieldId = new JXSearchField("id");
searchFieldName.setRecentSearchesSaveKey("com.actelion.research.orbit.OrbitImageAnalysis.searchfield.modelBrowser.name");
searchFieldElb.setRecentSearchesSaveKey("com.actelion.research.orbit.OrbitImageAnalysis.searchfield.modelBrowser.elb");
searchFieldId.setRecentSearchesSaveKey("com.actelion.research.orbit.OrbitImageAnalysis.searchfield.modelBrowser.Id");
prepareSearchfield(searchFieldName);
prepareSearchfield(searchFieldElb);
prepareSearchfield(searchFieldId);
searchFieldName.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("find action name: " + searchFieldName.getText());
table.getRowSorter().allRowsChanged();
}
});
searchFieldElb.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("find action elb: " + searchFieldElb.getText());
table.getRowSorter().allRowsChanged();
}
});
searchFieldId.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("find action id: " + searchFieldId.getText());
table.getRowSorter().allRowsChanged();
}
});
searchFieldId.setInputVerifier(new IntInputVerifier(0));
final JCheckBox onlyMine = new JCheckBox("only mine", false);
onlyMine.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.out.println("only mine: " + onlyMine.isSelected());
table.getRowSorter().allRowsChanged();
}
});
// filter
TableRowSorter sorter = new TableRowSorter<>(tableModel);
RowFilter