git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into features/JAL-2446NCList
[jalview.git]
/
src
/
jalview
/
gui
/
DasSourceBrowser.java
diff --git
a/src/jalview/gui/DasSourceBrowser.java
b/src/jalview/gui/DasSourceBrowser.java
index
fab4cb3
..
c5ec067
100644
(file)
--- a/
src/jalview/gui/DasSourceBrowser.java
+++ b/
src/jalview/gui/DasSourceBrowser.java
@@
-20,6
+20,12
@@
*/
package jalview.gui;
*/
package jalview.gui;
+import jalview.jbgui.GDasSourceBrowser;
+import jalview.util.MessageManager;
+import jalview.util.TableSorter;
+import jalview.ws.dbsources.das.api.DasSourceRegistryI;
+import jalview.ws.dbsources.das.api.jalviewSourceI;
+
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
@@
-46,12
+52,6
@@
import org.biodas.jdas.schema.sources.COORDINATES;
import org.biodas.jdas.schema.sources.PROP;
import org.biodas.jdas.schema.sources.VERSION;
import org.biodas.jdas.schema.sources.PROP;
import org.biodas.jdas.schema.sources.VERSION;
-import jalview.jbgui.GDasSourceBrowser;
-import jalview.util.MessageManager;
-import jalview.util.TableSorter;
-import jalview.ws.dbsources.das.api.DasSourceRegistryI;
-import jalview.ws.dbsources.das.api.jalviewSourceI;
-
public class DasSourceBrowser extends GDasSourceBrowser implements
Runnable, ListSelectionListener
{
public class DasSourceBrowser extends GDasSourceBrowser implements
Runnable, ListSelectionListener
{
@@
-81,6
+81,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
ListSelectionModel rowSM = table.getSelectionModel();
rowSM.addListSelectionListener(new ListSelectionListener()
{
ListSelectionModel rowSM = table.getSelectionModel();
rowSM.addListSelectionListener(new ListSelectionListener()
{
+ @Override
public void valueChanged(ListSelectionEvent e)
{
ListSelectionModel lsm = (ListSelectionModel) e.getSource();
public void valueChanged(ListSelectionEvent e)
{
ListSelectionModel lsm = (ListSelectionModel) e.getSource();
@@
-94,10
+95,10
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
table.addMouseListener(new MouseAdapter()
{
table.addMouseListener(new MouseAdapter()
{
+ @Override
public void mouseClicked(MouseEvent evt)
{
public void mouseClicked(MouseEvent evt)
{
- if (evt.getClickCount() == 2
- || SwingUtilities.isRightMouseButton(evt))
+ if (evt.getClickCount() == 2 || evt.isPopupTrigger())
{
editRemoveLocalSource(evt);
}
{
editRemoveLocalSource(evt);
}
@@
-119,6
+120,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
this(null);
}
this(null);
}
+ @Override
public void paintComponent(java.awt.Graphics g)
{
if (sourceRegistry == null)
public void paintComponent(java.awt.Graphics g)
{
if (sourceRegistry == null)
@@
-145,6
+147,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
TableSorter sorter = (TableSorter) table.getModel();
public void run()
{
TableSorter sorter = (TableSorter) table.getModel();
@@
-282,6
+285,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
fullDetails.setText(text.toString());
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
fullDetails.setText(text.toString());
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
fullDetailsScrollpane.getVerticalScrollBar().setValue(0);
public void run()
{
fullDetailsScrollpane.getVerticalScrollBar().setValue(0);
@@
-289,6
+293,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
});
}
});
}
+ @Override
public void run()
{
loadingDasSources = true;
public void run()
{
loadingDasSources = true;
@@
-358,6
+363,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
return selected;
}
return selected;
}
+ @Override
public void refresh_actionPerformed(ActionEvent e)
{
saveProperties(jalview.bin.Cache.applicationProperties);
public void refresh_actionPerformed(ActionEvent e)
{
saveProperties(jalview.bin.Cache.applicationProperties);
@@
-411,6
+417,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
filter1.setSelectedIndex(0);
public void run()
{
filter1.setSelectedIndex(0);
@@
-420,6
+427,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
});
}
});
}
+ @Override
public void amendLocal(boolean newSource)
{
String url = "http://localhost:8080/", nickname = "";
public void amendLocal(boolean newSource)
{
String url = "http://localhost:8080/", nickname = "";
@@
-440,23
+448,23
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
seqs.setSelected(seqsrc);
JPanel panel = new JPanel(new BorderLayout());
JPanel pane12 = new JPanel(new BorderLayout());
seqs.setSelected(seqsrc);
JPanel panel = new JPanel(new BorderLayout());
JPanel pane12 = new JPanel(new BorderLayout());
- pane12.add(new JLabel(MessageManager.getString("label.name")),
+ pane12.add(new JLabel(MessageManager.getString("label.name:")),
BorderLayout.CENTER);
pane12.add(nametf, BorderLayout.EAST);
panel.add(pane12, BorderLayout.NORTH);
pane12 = new JPanel(new BorderLayout());
BorderLayout.CENTER);
pane12.add(nametf, BorderLayout.EAST);
panel.add(pane12, BorderLayout.NORTH);
pane12 = new JPanel(new BorderLayout());
- pane12.add(new JLabel(MessageManager.getString("label.url")),
+ pane12.add(new JLabel(MessageManager.getString("label.url:")),
BorderLayout.NORTH);
pane12.add(seqs, BorderLayout.SOUTH);
pane12.add(urltf, BorderLayout.EAST);
panel.add(pane12, BorderLayout.SOUTH);
BorderLayout.NORTH);
pane12.add(seqs, BorderLayout.SOUTH);
pane12.add(urltf, BorderLayout.EAST);
panel.add(pane12, BorderLayout.SOUTH);
- int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop,
+ int reply = JvOptionPane.showInternalConfirmDialog(Desktop.desktop,
panel,
MessageManager.getString("label.enter_local_das_source"),
panel,
MessageManager.getString("label.enter_local_das_source"),
- JOptionPane.OK_CANCEL_OPTION);
+ JvOptionPane.OK_CANCEL_OPTION);
- if (reply != JOptionPane.OK_OPTION)
+ if (reply != JvOptionPane.OK_OPTION)
{
return;
}
{
return;
}
@@
-503,6
+511,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
SwingUtilities.invokeLater(new Runnable()
{
SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
scrollPane.getVerticalScrollBar().setValue(
public void run()
{
scrollPane.getVerticalScrollBar().setValue(
@@
-525,22
+534,21
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
if (!sourceRegistry.getSource(nickname).isLocal())
{
if (!sourceRegistry.getSource(nickname).isLocal())
{
- JOptionPane
+ JvOptionPane
.showInternalMessageDialog(
Desktop.desktop,
MessageManager
.getString("label.you_can_only_edit_or_remove_local_das_sources"),
MessageManager.getString("label.public_das_source"),
.showInternalMessageDialog(
Desktop.desktop,
MessageManager
.getString("label.you_can_only_edit_or_remove_local_das_sources"),
MessageManager.getString("label.public_das_source"),
- JOptionPane.WARNING_MESSAGE);
+ JvOptionPane.WARNING_MESSAGE);
return;
}
return;
}
- Object[] options =
- { "Edit", "Remove", "Cancel" };
- int choice = JOptionPane.showInternalOptionDialog(Desktop.desktop,
+ Object[] options = { "Edit", "Remove", "Cancel" };
+ int choice = JvOptionPane.showInternalOptionDialog(Desktop.desktop,
"Do you want to edit or remove " + nickname + "?",
"Edit / Remove Local DAS Source",
"Do you want to edit or remove " + nickname + "?",
"Edit / Remove Local DAS Source",
- JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,
+ JvOptionPane.YES_NO_CANCEL_OPTION, JvOptionPane.QUESTION_MESSAGE,
null, options, options[2]);
switch (choice)
null, options, options[2]);
switch (choice)
@@
-572,6
+580,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
refreshTableData(data);
SwingUtilities.invokeLater(new Runnable()
{
refreshTableData(data);
SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
scrollPane.getVerticalScrollBar().setValue(
public void run()
{
scrollPane.getVerticalScrollBar().setValue(
@@
-583,6
+592,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
}
}
}
}
+ @Override
public void valueChanged(ListSelectionEvent evt)
{
// Called when the MainTable selection changes
public void valueChanged(ListSelectionEvent evt)
{
// Called when the MainTable selection changes
@@
-601,8
+611,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
// The features filter is not visible, but we must still
// filter the das source list here.
// July 2006 - only 6 sources fo not serve features
// The features filter is not visible, but we must still
// filter the das source list here.
// July 2006 - only 6 sources fo not serve features
- Object[] dummyFeatureList = new Object[]
- { "features" };
+ Object[] dummyFeatureList = new Object[] { "features" };
List<jalviewSourceI> srcs = sourceRegistry.getSources();
for (jalviewSourceI ds : srcs)
{
List<jalviewSourceI> srcs = sourceRegistry.getSources();
for (jalviewSourceI ds : srcs)
{
@@
-632,8
+641,8
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
for (int j = 0; j < coords.size(); j++)
{
for (int j = 0; j < coords.size(); j++)
{
- if (selectedInList(filter1.getSelectedValues(), new String[]
- { coords.get(j).getAuthority() })
+ if (selectedInList(filter1.getSelectedValues(),
+ new String[] { coords.get(j).getAuthority() })
&& selectedInList(filter2.getSelectedValues(), new String[]
{ coords.get(j).getSource() }))
{
&& selectedInList(filter2.getSelectedValues(), new String[]
{ coords.get(j).getSource() }))
{
@@
-693,6
+702,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
}
}
}
}
+ @Override
public void reset_actionPerformed(ActionEvent e)
{
registryURL.setText(sourceRegistry.getDasRegistryURL());
public void reset_actionPerformed(ActionEvent e)
{
registryURL.setText(sourceRegistry.getDasRegistryURL());
@@
-739,26
+749,31
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
this.data = data;
}
this.data = data;
}
- private String[] columnNames = new String[]
- { MessageManager.getString("label.nickname"), MessageManager.getString("label.use_source") };
+ private String[] columnNames = new String[] {
+ MessageManager.getString("label.nickname"),
+ MessageManager.getString("label.use_source") };
private Object[][] data;
private Object[][] data;
+ @Override
public int getColumnCount()
{
return columnNames.length;
}
public int getColumnCount()
{
return columnNames.length;
}
+ @Override
public int getRowCount()
{
return data.length;
}
public int getRowCount()
{
return data.length;
}
+ @Override
public String getColumnName(int col)
{
return columnNames[col];
}
public String getColumnName(int col)
{
return columnNames[col];
}
+ @Override
public Object getValueAt(int row, int col)
{
return data[row][col];
public Object getValueAt(int row, int col)
{
return data[row][col];
@@
-769,6
+784,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
* each cell. If we didn't implement this method, then the last column would
* contain text ("true"/"false"), rather than a check box.
*/
* each cell. If we didn't implement this method, then the last column would
* contain text ("true"/"false"), rather than a check box.
*/
+ @Override
public Class getColumnClass(int c)
{
return getValueAt(0, c).getClass();
public Class getColumnClass(int c)
{
return getValueAt(0, c).getClass();
@@
-777,6
+793,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
/*
* Don't need to implement this method unless your table's editable.
*/
/*
* Don't need to implement this method unless your table's editable.
*/
+ @Override
public boolean isCellEditable(int row, int col)
{
// Note that the data/cell address is constant,
public boolean isCellEditable(int row, int col)
{
// Note that the data/cell address is constant,
@@
-788,6
+805,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
/*
* Don't need to implement this method unless your table's data can change.
*/
/*
* Don't need to implement this method unless your table's data can change.
*/
+ @Override
public void setValueAt(Object value, int row, int col)
{
data[row][col] = value;
public void setValueAt(Object value, int row, int col)
{
data[row][col] = value;
@@
-813,6
+831,7
@@
public class DasSourceBrowser extends GDasSourceBrowser implements
Thread thr = new Thread(new Runnable()
{
Thread thr = new Thread(new Runnable()
{
+ @Override
public void run()
{
// this actually initialises the das source list
public void run()
{
// this actually initialises the das source list