55 lines
2.0 KiB
Java
55 lines
2.0 KiB
Java
package _VisualDVM.Passes.All;
|
||
import Common.Visual.UI;
|
||
import _VisualDVM.Global;
|
||
import _VisualDVM.Passes.PassCode;
|
||
import _VisualDVM.Passes.Project.CurrentProjectPass;
|
||
|
||
import java.math.BigInteger;
|
||
public class GenerateParallelVariants extends CurrentProjectPass {
|
||
boolean all_variants;
|
||
@Override
|
||
public String getIconPath() {
|
||
return "/icons/ParallelVariants.png";
|
||
}
|
||
@Override
|
||
protected PassCode necessary() {
|
||
return PassCode.SPF_GetArrayDistribution;
|
||
}
|
||
@Override
|
||
protected void FocusBeforeStart() {
|
||
Global.mainModule.getUI().getMainWindow().getProjectWindow().FocusVersions();
|
||
}
|
||
@Override
|
||
protected boolean canStart(Object... args) throws Exception {
|
||
if (super.canStart(args)) {
|
||
all_variants = (boolean) args[0];
|
||
BigInteger amount = all_variants ? target.getFilteredVariantsCount() : BigInteger.valueOf(target.getVariantsCoverageCount());
|
||
if (amount.compareTo(BigInteger.valueOf(1600)) > 0) {
|
||
Log.Writeln_("Количество вариантов " + amount + "\nпревышает 1600. Отображение запрещено.");
|
||
return false;
|
||
}
|
||
return UI.Question("Будет отображено " + amount + " вариантов. Хотите продолжить");
|
||
}
|
||
return false;
|
||
}
|
||
@Override
|
||
protected void performPreparation() throws Exception {
|
||
target.parallelVariants.clear();
|
||
}
|
||
@Override
|
||
protected void showPreparation() throws Exception {
|
||
Global.mainModule.getUI().getVersionsWindow().getVariantsWindow().ShowNoVariants();
|
||
}
|
||
@Override
|
||
protected void body() throws Exception {
|
||
if (all_variants)
|
||
target.gen_variants_vectors();
|
||
else
|
||
target.gen_variants_coverage();
|
||
}
|
||
@Override
|
||
protected void showDone() throws Exception {
|
||
Global.mainModule.getUI().getVersionsWindow().getVariantsWindow().ShowVariants();
|
||
}
|
||
}
|