|
22 | 22 | package org.gitools.ui.app.heatmap.header.wizard.coloredlabels; |
23 | 23 |
|
24 | 24 | import org.gitools.heatmap.header.ColoredLabel; |
| 25 | +import org.gitools.ui.core.utils.FileChoose; |
| 26 | +import org.gitools.ui.core.utils.FileChooserUtils; |
25 | 27 | import org.gitools.ui.platform.wizard.AbstractWizardPage; |
26 | 28 | import org.gitools.utils.color.ColorRegistry; |
27 | 29 |
|
|
38 | 40 |
|
39 | 41 | public class ColoredLabelsGroupsPage extends AbstractWizardPage { |
40 | 42 |
|
41 | | - private void setSync() { |
| 43 | + private void runToClipboard() { |
42 | 44 | ColorRegistry cr = ColorRegistry.get(); |
43 | 45 | for (ColoredLabel cl : getColoredLabels()) { |
44 | | - cr.registerId(cl.getValue(), cl.getColor()); |
| 46 | + cr.registerId(cl.getDisplayedLabel(), cl.getColor()); |
45 | 47 | } |
46 | 48 | } |
47 | 49 |
|
48 | | - private void sync() { |
| 50 | + private void runFromClipboard() { |
49 | 51 | java.util.List<ColoredLabel> oldList = getColoredLabels(); |
50 | 52 | java.util.List<ColoredLabel> newList = new ArrayList<>(); |
51 | 53 | ColorRegistry cr = ColorRegistry.get(); |
52 | 54 | for (ColoredLabel cl : oldList) { |
53 | | - newList.add(new ColoredLabel(cl.getValue(), cl.getDisplayedLabel(), cr.getColor(cl.getValue(), cl.getColor()))); |
| 55 | + newList.add(new ColoredLabel(cl.getValue(), cl.getDisplayedLabel(), cr.getColor(cl.getDisplayedLabel(), cl.getColor()))); |
54 | 56 | } |
55 | 57 | setColoredLabels(newList); |
56 | 58 | } |
@@ -289,16 +291,16 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { |
289 | 291 | } |
290 | 292 | }); |
291 | 293 |
|
292 | | - syncBtn.setText("Get colors"); |
293 | | - syncBtn.setToolTipText("Get value-color relations with other heatmaps whithin the current Gitools instance"); |
| 294 | + syncBtn.setText("From clipboard"); |
| 295 | + syncBtn.setToolTipText("Apply display-color relations from Gitools clipboard"); |
294 | 296 | syncBtn.addActionListener(new java.awt.event.ActionListener() { |
295 | 297 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
296 | 298 | syncBtnActionPerformed(evt); |
297 | 299 | } |
298 | 300 | }); |
299 | 301 |
|
300 | | - syncBtn1.setText("Set colors"); |
301 | | - syncBtn1.setToolTipText("Set value-color relations so other heatmaps can sync"); |
| 302 | + syncBtn1.setText("To clipboard"); |
| 303 | + syncBtn1.setToolTipText("Copy display-color relations to Gitools clipboard"); |
302 | 304 | syncBtn1.addActionListener(new java.awt.event.ActionListener() { |
303 | 305 | public void actionPerformed(java.awt.event.ActionEvent evt) { |
304 | 306 | syncBtn1ActionPerformed(evt); |
@@ -327,7 +329,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { |
327 | 329 | .addComponent(removeBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
328 | 330 | .addComponent(syncBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
329 | 331 | .addComponent(tableAddBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
330 | | - .addComponent(syncBtn1, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))) |
| 332 | + .addComponent(syncBtn1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) |
331 | 333 | ); |
332 | 334 | layout.setVerticalGroup( |
333 | 335 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
@@ -361,17 +363,18 @@ private void removeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR |
361 | 363 | }//GEN-LAST:event_removeBtnActionPerformed |
362 | 364 |
|
363 | 365 | private void syncBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_syncBtnActionPerformed |
364 | | - sync(); |
| 366 | + runFromClipboard(); |
365 | 367 | }//GEN-LAST:event_syncBtnActionPerformed |
366 | 368 |
|
367 | 369 | private void syncBtn1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_syncBtn1ActionPerformed |
368 | | - setSync(); |
| 370 | + runToClipboard(); |
369 | 371 | }//GEN-LAST:event_syncBtn1ActionPerformed |
370 | 372 |
|
371 | 373 |
|
372 | 374 | // Variables declaration - do not modify//GEN-BEGIN:variables |
373 | 375 | private javax.swing.JScrollPane jScrollPane2; |
374 | 376 | private javax.swing.JButton removeBtn; |
| 377 | + private javax.swing.JButton importBtn; |
375 | 378 | private javax.swing.JButton syncBtn; |
376 | 379 | private javax.swing.JButton syncBtn1; |
377 | 380 | private javax.swing.JTable table; |
|
0 commit comments