package org.deidentifier.arx.gui.view.impl.analyze;

import java.awt.Panel;

import org.deidentifier.arx.DataHandle;
import org.deidentifier.arx.gui.model.Model;
import org.deidentifier.arx.gui.model.ModelEvent.ModelPart;

public abstract class ViewStatistics extends Panel{
    
    private static final long serialVersionUID = 5170104283288654748L;
    
    protected ModelPart target;
    protected Model model;

    /**
     * Returns the data handle
     * @return
     */
    protected DataHandle getHandle() {
        if (model != null){
            if (target == ModelPart.INPUT){
                DataHandle handle = model.getInputConfig().getInput().getHandle();
                if (model.getViewConfig().isSubset() && 
                    model.getOutputConfig() != null &&
                    model.getOutputConfig().getConfig() != null) {
                    handle = handle.getView();
                }
                return handle;
            } else {
                DataHandle handle = model.getOutput();
                if (model.getViewConfig().isSubset() && 
                    model.getOutputConfig() != null &&
                    model.getOutputConfig().getConfig() != null) {
                    handle = handle.getView();
                }
                return handle;
            }
        } else {
            return null;
        }
    }
}

@@ -827,32 +827,70 @@
 ).getConfig() !=
+ null &&%0A                    handle !=
  null) %7B%0A       
@@ -1220,24 +1220,62 @@
 tConfig() !=
+ null &&%0A                    handle !=
  null) %7B%0A   

Fix bug when loading projects