Added: #2370 Snap align border space, object spacing, center alignment,

Setting for color and snap accuracy for guides, grid, 
Dialogs for editing grid, guides and snapping
This commit is contained in:
Jindra Petřík
2025-05-08 00:17:36 +02:00
parent 3d9e44d3f1
commit c63ce2a26e
16 changed files with 1073 additions and 51 deletions

View File

@@ -17,6 +17,8 @@
package com.jpexs.decompiler.flash.configuration;
import com.jpexs.decompiler.flash.ApplicationInfo;
import com.jpexs.decompiler.flash.configuration.enums.GridSnapAccuracy;
import com.jpexs.decompiler.flash.configuration.enums.GuidesSnapAccuracy;
import com.jpexs.decompiler.flash.exporters.modes.ExeExportMode;
import com.jpexs.decompiler.flash.helpers.CodeFormatting;
import com.jpexs.decompiler.flash.helpers.FontHelper;
@@ -1110,6 +1112,34 @@ public final class Configuration {
@ConfigurationCategory("display")
public static ConfigurationItem<Color> guidesColor = null;
@ConfigurationCategory("display")
@ConfigurationDefaultString("NORMAL")
public static ConfigurationItem<GridSnapAccuracy> gridSnapAccuracy = null;
@ConfigurationCategory("display")
@ConfigurationDefaultString("NORMAL")
public static ConfigurationItem<GuidesSnapAccuracy> guidesSnapAccuracy = null;
@ConfigurationDefaultInt(0)
@ConfigurationCategory("display")
public static ConfigurationItem<Integer> snapAlignObjectHorizontalSpace = null;
@ConfigurationDefaultInt(0)
@ConfigurationCategory("display")
public static ConfigurationItem<Integer> snapAlignObjectVerticalSpace = null;
@ConfigurationDefaultInt(0)
@ConfigurationCategory("display")
public static ConfigurationItem<Integer> snapAlignStageBorder = null;
@ConfigurationDefaultBoolean(false)
@ConfigurationCategory("display")
public static ConfigurationItem<Boolean> snapAlignCenterAlignmentHorizontal = null;
@ConfigurationDefaultBoolean(false)
@ConfigurationCategory("display")
public static ConfigurationItem<Boolean> snapAlignCenterAlignmentVertical = null;
private enum OSId {
WINDOWS, OSX, UNIX
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) 2010-2024 JPEXS, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
package com.jpexs.decompiler.flash.configuration.enums;
/**
*
* @author JPEXS
*/
public enum GridSnapAccuracy {
MUST_BE_CLOSE(5),
NORMAL(10),
CAN_BE_DISTANT(15),
ALWAYS_SNAP(Integer.MAX_VALUE);
private final int distance;
private GridSnapAccuracy(int value) {
this.distance = value;
}
public int getDistance() {
return distance;
}
}

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2010-2024 JPEXS, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
package com.jpexs.decompiler.flash.configuration.enums;
/**
*
* @author JPEXS
*/
public enum GuidesSnapAccuracy {
MUST_BE_CLOSE(5),
NORMAL(10),
CAN_BE_DISTANT(15);
private final int distance;
private GuidesSnapAccuracy(int value) {
this.distance = value;
}
public int getDistance() {
return distance;
}
}