import java.awt.CardLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
+import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
+import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
+import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.ListSelectionModel;
protected AlignmentPanel ap;
- protected JLabel resultLabel = new JLabel("View : ");
+ protected JLabel resultLabel = new JLabel("Select : ");
protected JButton ok = new JButton();
protected JCheckBox rememberSettings = new JCheckBox("Don't ask me again");
+ protected JCheckBox invertFilter = new JCheckBox("Invert");
+
+ protected ImageIcon loadingImage = new ImageIcon(getClass().getResource(
+ "/images/loading.gif"));
+
+ protected JLabel loadingImageLabel = new JLabel(loadingImage);
protected static final String VIEWS_FILTER = "VIEWS_FILTER";
protected JList<PDBResponseSummary> jListFoundStructures = new JList<PDBResponseSummary>();
+ // protected JScrollPane foundStructuresScroller = new JScrollPane(
+ // jListFoundStructures);
+
+ protected JTable summaryTable = new JTable();
protected JScrollPane foundStructuresScroller = new JScrollPane(
- jListFoundStructures);
+ summaryTable);
public GStructureChooser()
{
try
{
jbInit();
+ mainFrame.setVisible(false);
mainFrame.invalidate();
mainFrame.pack();
} catch (Exception e)
private void jbInit() throws Exception
{
-
ok.setFont(new java.awt.Font("Verdana", 0, 12));
- ok.setText(MessageManager.getString("action.ok"));
+ ok.setText(MessageManager.getString("action.view"));
ok.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
foundStructuresScroller
.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+ filterOptionsComboBox.setFont(new java.awt.Font("Verdana", 0, 12));
+ invertFilter.setFont(new java.awt.Font("Verdana", 0, 12));
+ rememberSettings.setFont(new java.awt.Font("Verdana", 0, 12));
+
+ filterOptionsComboBox.addItemListener(this);
+ invertFilter.addItemListener(this);
+
actionPanel.add(rememberSettings);
actionPanel.add(ok);
actionPanel.add(cancel);
- filterOptionsComboBox.addItemListener(this);
filterPanel.add(resultLabel);
filterPanel.add(filterOptionsComboBox);
+ loadingImageLabel.setVisible(false);
+
+ filterPanel.add(loadingImageLabel);
+
+ filterPanel.add(invertFilter);
idInputPanel.setLayout(new FlowLayout());
idInputPanel.add(search);
Desktop.addInternalFrame(mainFrame, frameTitle, 800, 400);
}
+
+ private ImageIcon scaleImageIcone(ImageIcon imageIcon, int width, int height)
+ {
+ Image image = imageIcon.getImage(); // transform it
+
+ Image newimg = image.getScaledInstance(width, height,
+ java.awt.Image.SCALE_SMOOTH); // scale it the smooth way
+
+ return new ImageIcon(newimg);
+ }
+
@Override
public void itemStateChanged(ItemEvent e)
{
- stateChanged();
+ stateChanged(e);
}
public class FilterOptions
this.view = view;
}
+ // public FilterOptions(PDBDocField field, String view)
+ // {
+ // this.name = "Best " + field.getName();
+ // this.value = field.getCode();
+ // this.view = view;
+ // }
+
public String getName()
{
return name;
}
}
- protected abstract void stateChanged();
+ protected abstract void stateChanged(ItemEvent e);
protected abstract void updateCurrentView();