package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.Passes.Sapfor.SapforAnalysis;
import _VisualDVM.ProjectData.SapforData.Regions.ParallelRegion;
import _VisualDVM.ProjectData.SapforData.Regions.RegionsJson;
public class SPF_GetArrayDistributionOnlyRegions extends SapforAnalysis {
    @Override
    public String phase() {
        return "FILL_PAR_REGIONS_LINES";
    }
    @Override
    protected void unpack(String packed) throws Exception {
        RegionsJson regionsJson = Utils_.gson.fromJson(packed, RegionsJson.class);
        for (ParallelRegion parallelRegion : regionsJson.allRegions) {
            parallelRegion.Init();
            target.parallelRegions.put(parallelRegion.regionId, parallelRegion);
        }
    }
    @Override
    protected boolean isAtomic() {
        return false;
    }
    @Override
    protected boolean alwaysCheck() {
        return true;
    }
    @Override
    protected void performPreparation() throws Exception {
        super.performPreparation();
        target.parallelRegions.clear();
    }
    @Override
    protected void showPreparation() {
        Global.mainModule.getUI().getMainWindow().getProjectWindow().getAnalysisWindow().ShowNoRegions();
    }
    @Override
    protected void showDone() throws Exception {
        Global.mainModule.getUI().getMainWindow().getProjectWindow().getAnalysisWindow().ShowRegions();
        super.showDone();
    }
    @Override
    protected void FocusResult() {
        Global.mainModule.getUI().getMainWindow().FocusProject();
        Global.mainModule.getUI().getMainWindow().getProjectWindow().FocusAnalysis();
    }
}
