if (object != null) new AnnotateCmd(object).execute();
if (object != null) { AnnotateCmd cmd = new AnnotateCmd(model.getParentModel(), clipBoard.getSelectedNode()); cmd.execute(); }
    public void actionPerformed(ActionEvent e)    {        int index = -1;        DataObject object;        try {            index = Integer.parseInt(e.getActionCommand());            object = clipBoard.getDataObject();            switch (index) {                 case PROPERTIES:                    if (object != null) new PropertiesCmd(object).execute();                    break;                case ANNOTATE:                    if (object != null) new AnnotateCmd(object).execute();                    break;                case CLASSIFY:                    if (object instanceof ImageData) {                        ClassifyCmd cmd = new ClassifyCmd((ImageData) object,                                 Classifier.CLASSIFICATION_MODE, null);                        cmd.execute();                    }                    break;                case DECLASSIFY:                    if (object instanceof ImageData) {                        ClassifyCmd cmd = new ClassifyCmd((ImageData) object,                                 Classifier.DECLASSIFICATION_MODE, null);                        cmd.execute();                    }                    break;                case VIEW:                    if (object != null) new ViewCmd(object).execute();                    break;            }         } catch(NumberFormatException nfe) {            throw new Error("Invalid Action ID "+index, nfe);        }     }