JSlider transparency = new JSlider();\r
\r
JPanel transPanel = new JPanel(new FlowLayout());\r
- boolean alignmentHasFeatures = false;\r
\r
public FeatureSettings(AlignFrame af)\r
{\r
ex.printStackTrace();\r
}\r
\r
+ table = new JTable();\r
+ table.getTableHeader().setFont(new Font("Verdana", Font.PLAIN, 12));\r
+ table.setFont(new Font("Verdana", Font.PLAIN, 12));\r
+ table.setDefaultRenderer(Color.class,\r
+ new ColorRenderer());\r
+\r
+ table.setDefaultEditor(Color.class,\r
+ new ColorEditor());\r
+\r
+ table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
+\r
+ table.addMouseListener(new MouseAdapter()\r
+ {\r
+ public void mousePressed(MouseEvent evt)\r
+ {\r
+ selectedRow = table.rowAtPoint(evt.getPoint());\r
+ }\r
+ });\r
+\r
+ table.addMouseMotionListener(new MouseMotionAdapter()\r
+ {\r
+ public void mouseDragged(MouseEvent evt)\r
+ {\r
+ int newRow = table.rowAtPoint(evt.getPoint());\r
+ if (newRow != selectedRow\r
+ && selectedRow != -1\r
+ && newRow != -1)\r
+ {\r
+ Object[] temp = new Object[3];\r
+ temp[0] = table.getValueAt(selectedRow, 0);\r
+ temp[1] = table.getValueAt(selectedRow, 1);\r
+ temp[2] = table.getValueAt(selectedRow, 2);\r
+\r
+ table.setValueAt(table.getValueAt(newRow, 0), selectedRow, 0);\r
+ table.setValueAt(table.getValueAt(newRow, 1), selectedRow, 1);\r
+ table.setValueAt(table.getValueAt(newRow, 2), selectedRow, 2);\r
+\r
+ table.setValueAt(temp[0], newRow, 0);\r
+ table.setValueAt(temp[1], newRow, 1);\r
+ table.setValueAt(temp[2], newRow, 2);\r
+\r
+ selectedRow = newRow;\r
+ }\r
+ }\r
+ });\r
+\r
+ scrollPane.setViewportView(table);\r
+\r
dassourceBrowser = new DasSourceBrowser();\r
dasSettingsPane.add(dassourceBrowser, BorderLayout.CENTER);\r
\r
\r
synchronized public void setTableData()\r
{\r
- alignmentHasFeatures = false;\r
-\r
if (fr.featureGroups == null)\r
fr.featureGroups = new Hashtable();\r
\r
if (af.getViewport().alignment.getSequenceAt(i).getDatasetSequence().getSequenceFeatures() == null)\r
continue;\r
\r
- alignmentHasFeatures = true;\r
-\r
tmpfeatures = af.getViewport().alignment.getSequenceAt(i).getDatasetSequence().getSequenceFeatures();\r
\r
int index = 0;\r
}\r
}\r
\r
-\r
- if(!alignmentHasFeatures)\r
- {\r
- // try\r
- // { frame.setClosed(true); }\r
- // catch (Exception ex){}\r
-\r
- // JOptionPane.showInternalMessageDialog(\r
- /// Desktop.desktop, "No features have been added to this alignment!",\r
- //\r
- // return;\r
- }\r
-\r
resetTable(false);\r
}\r
\r
System.arraycopy(data,0,originalData,0,data.length);\r
}\r
\r
- table = new JTable(new FeatureTableModel(data));\r
- scrollPane.setViewportView(table);\r
- table.getTableHeader().setFont(new Font("Verdana", Font.PLAIN, 12));\r
- table.setFont(new Font("Verdana", Font.PLAIN, 12));\r
- table.setDefaultRenderer(Color.class,\r
- new ColorRenderer());\r
-\r
- table.setDefaultEditor(Color.class,\r
- new ColorEditor());\r
-\r
+ table.setModel(new FeatureTableModel(data));\r
table.getColumnModel().getColumn(0).setPreferredWidth(200);\r
\r
- table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
-\r
- table.addMouseListener(new MouseAdapter()\r
- {\r
- public void mousePressed(MouseEvent evt)\r
- {\r
- selectedRow = table.rowAtPoint(evt.getPoint());\r
- }\r
- });\r
-\r
- table.addMouseMotionListener(new MouseMotionAdapter()\r
- {\r
- public void mouseDragged(MouseEvent evt)\r
- {\r
- int newRow = table.rowAtPoint(evt.getPoint());\r
- if(newRow!=selectedRow\r
- && selectedRow!=-1\r
- && newRow!=-1)\r
- {\r
- Object[] temp = new Object[3];\r
- temp[0] = table.getValueAt(selectedRow, 0);\r
- temp[1] = table.getValueAt(selectedRow, 1);\r
- temp[2] = table.getValueAt(selectedRow, 2);\r
-\r
- table.setValueAt(table.getValueAt(newRow, 0), selectedRow, 0);\r
- table.setValueAt(table.getValueAt(newRow, 1), selectedRow, 1);\r
- table.setValueAt(table.getValueAt(newRow, 2), selectedRow, 2);\r
-\r
- table.setValueAt(temp[0], newRow, 0);\r
- table.setValueAt(temp[1], newRow, 1);\r
- table.setValueAt(temp[2], newRow, 2);\r
-\r
- selectedRow = newRow;\r
- }\r
- }\r
- });\r
\r
if (groupPanel != null)\r
{\r