@@ -62,7 +62,6 @@ public class DataSetSelector extends JPanel {
62
62
private JTable table ;
63
63
private JScrollPane tableScrollPane ;
64
64
private JButton addButton ;
65
- private JButton removeButton ;
66
65
private JButton selectAllButton ;
67
66
private JButton selectNoneButton ;
68
67
@@ -104,7 +103,6 @@ public void update() {
104
103
105
104
updateTable ();
106
105
updateSelectionButtons ();
107
- updateRemoveButton ();
108
106
}
109
107
110
108
public Set <AbstractDataSet > getAllItems () {
@@ -153,7 +151,9 @@ public Set<AbstractDataSet> getSelectedItems() {
153
151
}
154
152
155
153
private void init () {
156
- LookAndFeelUtil .equalizeSize (getAddButton (), getRemoveButton ());
154
+ JLabel titleLabel = new JLabel ("Data Sets:" );
155
+ makeSmall (titleLabel );
156
+
157
157
LookAndFeelUtil .equalizeSize (getSelectAllButton (), getSelectNoneButton ());
158
158
159
159
final GroupLayout layout = new GroupLayout (this );
@@ -162,23 +162,22 @@ private void init() {
162
162
layout .setAutoCreateGaps (!LookAndFeelUtil .isAquaLAF ());
163
163
164
164
layout .setHorizontalGroup (layout .createParallelGroup (CENTER , true )
165
- .addComponent (getTableScrollPane (), DEFAULT_SIZE , DEFAULT_SIZE , Short .MAX_VALUE )
166
- .addGroup (layout .createSequentialGroup ()
167
- .addComponent (getAddButton (), PREFERRED_SIZE , DEFAULT_SIZE , PREFERRED_SIZE )
168
- .addComponent (getRemoveButton (), PREFERRED_SIZE , DEFAULT_SIZE , PREFERRED_SIZE )
169
- .addGap (20 , 20 , Short .MAX_VALUE )
165
+ .addGroup (layout .createSequentialGroup ()
166
+ .addComponent (titleLabel , DEFAULT_SIZE , DEFAULT_SIZE , Short .MAX_VALUE )
170
167
.addComponent (getSelectAllButton (), PREFERRED_SIZE , DEFAULT_SIZE , PREFERRED_SIZE )
171
168
.addComponent (getSelectNoneButton (), PREFERRED_SIZE , DEFAULT_SIZE , PREFERRED_SIZE )
172
169
)
170
+ .addComponent (getTableScrollPane (), DEFAULT_SIZE , DEFAULT_SIZE , Short .MAX_VALUE )
171
+ .addComponent (getAddButton (), PREFERRED_SIZE , DEFAULT_SIZE , PREFERRED_SIZE )
173
172
);
174
173
layout .setVerticalGroup (layout .createSequentialGroup ()
175
- .addComponent (getTableScrollPane (), DEFAULT_SIZE , DEFAULT_SIZE , Short .MAX_VALUE )
176
174
.addGroup (layout .createParallelGroup (CENTER , false )
177
- .addComponent (getAddButton (), DEFAULT_SIZE , DEFAULT_SIZE , Short .MAX_VALUE )
178
- .addComponent (getRemoveButton (), DEFAULT_SIZE , DEFAULT_SIZE , Short .MAX_VALUE )
179
- .addComponent (getSelectAllButton (), DEFAULT_SIZE , DEFAULT_SIZE , Short .MAX_VALUE )
180
- .addComponent (getSelectNoneButton (), DEFAULT_SIZE , DEFAULT_SIZE , Short .MAX_VALUE )
175
+ .addComponent (titleLabel , PREFERRED_SIZE , DEFAULT_SIZE , PREFERRED_SIZE )
176
+ .addComponent (getSelectAllButton (), PREFERRED_SIZE , DEFAULT_SIZE , PREFERRED_SIZE )
177
+ .addComponent (getSelectNoneButton (), PREFERRED_SIZE , DEFAULT_SIZE , PREFERRED_SIZE )
181
178
)
179
+ .addComponent (getTableScrollPane (), DEFAULT_SIZE , DEFAULT_SIZE , Short .MAX_VALUE )
180
+ .addComponent (getAddButton (), PREFERRED_SIZE , DEFAULT_SIZE , PREFERRED_SIZE )
182
181
);
183
182
184
183
if (isAquaLAF ())
@@ -238,26 +237,6 @@ private void updateSelectionButtons() {
238
237
getSelectNoneButton ().setEnabled (hasChecked );
239
238
}
240
239
241
- private void updateRemoveButton () {
242
- boolean onlySignatureSelected = true ;
243
- int [] selectedRows = getTable ().getSelectedRows ();
244
-
245
- if (selectedRows .length > 0 ) {
246
- for (int r : selectedRows ) {
247
- AbstractDataSet ds = (AbstractDataSet ) table .getModel ().getValueAt (r , NAME_COL_IDX );
248
-
249
- if (ds instanceof EMSignatureDataSet == false ) {
250
- onlySignatureSelected = false ;
251
- break ;
252
- }
253
- }
254
- } else {
255
- onlySignatureSelected = false ;
256
- }
257
-
258
- getRemoveButton ().setEnabled (onlySignatureSelected );
259
- }
260
-
261
240
JTable getTable () {
262
241
if (table == null ) {
263
242
final DefaultSelectorTableCellRenderer defRenderer = new DefaultSelectorTableCellRenderer ();
@@ -281,7 +260,6 @@ public TableCellRenderer getCellRenderer(int row, int column) {
281
260
282
261
table .getSelectionModel ().addListSelectionListener (e -> {
283
262
if (!e .getValueIsAdjusting ()) {
284
- updateRemoveButton ();
285
263
// Workaround for preventing a click on the check-box in a selected row
286
264
// from changing the selection when multiple table rows are already selected
287
265
if (table .getSelectedRowCount () > 0 )
@@ -340,9 +318,8 @@ public void mousePressed(MouseEvent e) {
340
318
341
319
JButton getAddButton () {
342
320
if (addButton == null ) {
343
- addButton = new JButton (" " + IconManager .ICON_PLUS + " " );
344
- addButton .setFont (serviceRegistrar .getService (IconManager .class ).getIconFont (11.0f ));
345
- addButton .setToolTipText ("Add Signature Gene Sets..." );
321
+ addButton = new JButton ("Add Signature Gene Sets..." );
322
+ addButton .setToolTipText ("Post Analysis" );
346
323
makeSmall (addButton );
347
324
348
325
if (isAquaLAF ())
@@ -352,20 +329,6 @@ JButton getAddButton() {
352
329
return addButton ;
353
330
}
354
331
355
- JButton getRemoveButton () {
356
- if (removeButton == null ) {
357
- removeButton = new JButton (IconManager .ICON_TRASH_O );
358
- removeButton .setFont (serviceRegistrar .getService (IconManager .class ).getIconFont (14.0f ));
359
- removeButton .setToolTipText ("Remove Signature Gene Sets" );
360
- makeSmall (removeButton );
361
-
362
- if (isAquaLAF ())
363
- removeButton .putClientProperty ("JButton.buttonType" , "gradient" );
364
- }
365
-
366
- return removeButton ;
367
- }
368
-
369
332
JButton getSelectAllButton () {
370
333
if (selectAllButton == null ) {
371
334
selectAllButton = new JButton ("Select All" );
0 commit comments