1 32 33 package com.jeantessier.dependencyfinder.gui; 34 35 import java.awt.event.*; 36 import java.util.*; 37 38 import javax.swing.*; 39 40 public class NewMetricsAction extends AbstractAction implements Runnable { 41 private OOMetrics model; 42 43 public NewMetricsAction(OOMetrics model) { 44 this.model = model; 45 46 putValue(Action.LONG_DESCRIPTION, "Clear metrics"); 47 putValue(Action.NAME, "New"); 48 putValue(Action.SMALL_ICON, new ImageIcon(getClass().getResource("icons/new.gif"))); 49 } 50 51 public void actionPerformed(ActionEvent e) { 52 new Thread (this).start(); 53 } 54 55 public void run() { 56 model.getStatusLine().showInfo(""); 57 58 model.getMetricsFactory().clear(); 59 60 model.getProjectArea().setText(""); 61 model.getGroupsModel().setMetrics(Collections.EMPTY_LIST); 62 model.getClassesModel().setMetrics(Collections.EMPTY_LIST); 63 model.getMethodsModel().setMetrics(Collections.EMPTY_LIST); 64 } 65 } 66 | Popular Tags |