if (d.getUserObject() instanceof ImageData) { ViewCmd cmd = new ViewCmd(parent);
Object o = d.getUserObject(); if (o instanceof ImageData) { ViewCmd cmd = new ViewCmd(parent, (ImageData) o);
    void viewDataObject()    {        TreeImageDisplay d  = getLastSelectedDisplay();        if (d == null) return;        if (d.getUserObject() instanceof ImageData) {            ViewCmd cmd = new ViewCmd(parent);            cmd.execute();        }    }