1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-06-05 01:50:49 +00:00
This commit is contained in:
Arnaud Roques 2022-02-24 19:18:19 +01:00
parent 5d0d2bb8da
commit 87cbe82cd0
22 changed files with 144 additions and 104 deletions

View File

@ -62,18 +62,23 @@ public class PSystemDitaa extends AbstractPSystem {
private final String data;
private final float scale;
private final boolean performSeparationOfCommonEdges;
private final boolean allCornersAreRound;
public PSystemDitaa(UmlSource source, String data, boolean performSeparationOfCommonEdges, boolean dropShadows, float scale) {
public PSystemDitaa(UmlSource source, String data, boolean performSeparationOfCommonEdges, boolean dropShadows,
boolean allCornersAreRound, float scale) {
super(source);
this.data = data;
this.dropShadows = dropShadows;
this.performSeparationOfCommonEdges = performSeparationOfCommonEdges;
this.allCornersAreRound = allCornersAreRound;
try {
this.processingOptions = Class.forName("org.stathissideris.ascii2image.core.ProcessingOptions")
.newInstance();
// this.processingOptions.setPerformSeparationOfCommonEdges(performSeparationOfCommonEdges);
this.processingOptions.getClass().getMethod("setPerformSeparationOfCommonEdges", boolean.class)
.invoke(this.processingOptions, performSeparationOfCommonEdges);
this.processingOptions.getClass().getMethod("setAllCornersAreRound", boolean.class)
.invoke(this.processingOptions, allCornersAreRound);
} catch (Exception e) {
e.printStackTrace();
this.processingOptions = null;
@ -82,7 +87,8 @@ public class PSystemDitaa extends AbstractPSystem {
}
PSystemDitaa add(String line) {
return new PSystemDitaa(getSource(), data + line + BackSlash.NEWLINE, performSeparationOfCommonEdges, dropShadows, scale);
return new PSystemDitaa(getSource(), data + line + BackSlash.NEWLINE, performSeparationOfCommonEdges,
dropShadows, allCornersAreRound, scale);
}
public DiagramDescription getDescription() {

View File

@ -65,14 +65,18 @@ public class PSystemDitaaFactory extends PSystemBasicFactory<PSystemDitaa> {
if (startLine != null && (startLine.contains("-S") || startLine.contains("--no-shadows")))
dropShadows = false;
boolean allCornersAreRound = false;
if (startLine != null && (startLine.contains("-r") || startLine.contains("--round-corners")))
allCornersAreRound = true;
final float scale = extractScale(startLine);
if (getDiagramType() == DiagramType.UML) {
if (getDiagramType() == DiagramType.UML)
return null;
} else if (getDiagramType() == DiagramType.DITAA) {
return new PSystemDitaa(source, "", performSeparationOfCommonEdges, dropShadows, scale);
} else {
else if (getDiagramType() == DiagramType.DITAA)
return new PSystemDitaa(source, "", performSeparationOfCommonEdges, dropShadows, allCornersAreRound, scale);
else
throw new IllegalStateException(getDiagramType().name());
}
}
@Override
@ -86,8 +90,12 @@ public class PSystemDitaaFactory extends PSystemBasicFactory<PSystemDitaa> {
if (line.contains("-S") || line.contains("--no-shadows"))
dropShadows = false;
boolean allCornersAreRound = false;
if (line.contains("-r") || line.contains("--round-corners"))
allCornersAreRound = true;
final float scale = extractScale(line);
return new PSystemDitaa(source, "", performSeparationOfCommonEdges, dropShadows, scale);
return new PSystemDitaa(source, "", performSeparationOfCommonEdges, dropShadows, allCornersAreRound, scale);
}
if (system == null)
return null;

View File

@ -290,7 +290,7 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
final HColor borderColor = HColorUtils.BLACK;
decoration.drawU(ug.apply(new UTranslate(corner)), backColor, borderColor, shadowing, roundCorner,
skinParam.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false, null),
skinParam.getStereotypeAlignment());
skinParam.getStereotypeAlignment(), 0);
// // Print a simple rectangle right now
// ug.apply(HColorUtils.BLACK).apply(new UStroke(1.5)).apply(new UTranslate(corner)).draw(rect);

View File

@ -72,12 +72,15 @@ public class SymbolContext {
}
public UGraphic applyColors(UGraphic ug) {
ug = ug.apply(foreColor);
if (backColor == null) {
if (foreColor == null)
ug = ug.apply(new HColorNone());
else
ug = ug.apply(foreColor);
if (backColor == null)
ug = ug.apply(new HColorNone().bg());
} else {
else
ug = ug.apply(backColor.bg());
}
return ug;
}

View File

@ -108,7 +108,7 @@ class USymbolRectangle extends USymbol {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = symbolContext.apply(ug);
drawRect(ug, dim.getWidth(), dim.getHeight(), symbolContext.getDeltaShadow(),
symbolContext.getRoundCorner(), 0);
symbolContext.getRoundCorner(), symbolContext.getDiagonalCorner());
final Dimension2D dimStereo = stereotype.calculateDimension(ug.getStringBounder());
final double posStereoX;
final double posStereoY;

View File

@ -51,7 +51,7 @@ class Branch implements UDrawable {
private Finger finger;
void initRoot(StyleBuilder styleBuilder, HColor backColor, Display label, IdeaShape shape, String stereotype) {
root = new Idea(styleBuilder, backColor, label, shape, stereotype);
root = Idea.createIdeaSimple(styleBuilder, backColor, label, shape, stereotype);
last = root;
}
@ -61,9 +61,9 @@ class Branch implements UDrawable {
Idea getParentOfLast(int nb) {
Idea result = last;
for (int i = 0; i < nb; i++) {
for (int i = 0; i < nb; i++)
result = result.getParent();
}
return result;
}

View File

@ -114,10 +114,9 @@ public class FingerImpl implements Finger, UDrawable {
public static FingerImpl build(Idea idea, ISkinParam skinParam, Direction direction) {
final FingerImpl result = new FingerImpl(idea.getStyleBuilder(), idea.getBackColor(), idea.getLabel(),
skinParam, idea.getShape(), direction, idea.getLevel(), idea.getStereotype());
for (Idea child : idea.getChildren()) {
for (Idea child : idea.getChildren())
result.addInNail(build(child, skinParam, direction));
}
// System.err.println("End of build for " + idea);
return result;
}
@ -156,7 +155,7 @@ public class FingerImpl implements Finger, UDrawable {
for (int i = 0; i < nail.size(); i++) {
final FingerImpl child = nail.get(i);
final SymetricalTeePositioned stp = tetris(stringBounder).getElements().get(i);
final SymetricalTeePositioned stp = getTetris(stringBounder).getElements().get(i);
final double x = direction == Direction.RIGHT ? dimPhalanx.getWidth() + getX12()
: -dimPhalanx.getWidth() - getX12();
final Point2D p2 = new Point2D.Double(x, stp.getY());
@ -189,12 +188,12 @@ public class FingerImpl implements Finger, UDrawable {
ug.draw(path);
}
private Tetris tetris(StringBounder stringBounder) {
private Tetris getTetris(StringBounder stringBounder) {
if (tetris == null) {
tetris = new Tetris(label.toString());
for (FingerImpl child : nail) {
for (FingerImpl child : nail)
tetris.add(child.asSymetricalTee(stringBounder));
}
tetris.balance();
}
return tetris;
@ -203,9 +202,9 @@ public class FingerImpl implements Finger, UDrawable {
private SymetricalTee asSymetricalTee(StringBounder stringBounder) {
final double thickness1 = getPhalanxThickness(stringBounder);
final double elongation1 = getPhalanxElongation(stringBounder);
if (nail.size() == 0) {
if (nail.size() == 0)
return new SymetricalTee(thickness1, elongation1, 0, 0);
}
final double thickness2 = getNailThickness(stringBounder);
final double elongation2 = getNailElongation(stringBounder);
return new SymetricalTee(thickness1, elongation1 + getX1(), thickness2, getX2() + elongation2);
@ -232,9 +231,9 @@ public class FingerImpl implements Finger, UDrawable {
}
private TextBlock getPhalanx() {
if (drawPhalanx == false) {
if (drawPhalanx == false)
return TextBlockUtils.empty(0, 0);
}
if (shape == IdeaShape.BOX) {
final ISkinParam foo = new SkinParamColors(skinParam, Colors.empty().add(ColorType.BACK, backColor));
final TextBlock box = FtileBoxOld.createMindMap(styleBuilder, foo, label, getDefaultStyleDefinitionNode());
@ -246,18 +245,18 @@ public class FingerImpl implements Finger, UDrawable {
final TextBlock text = label.create0(
styleNode.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()),
styleNode.getHorizontalAlignment(), skinParam, styleNode.wrapWidth(), CreoleMode.FULL, null, null);
if (direction == Direction.RIGHT) {
if (direction == Direction.RIGHT)
return TextBlockUtils.withMargin(text, 3, 0, 1, 1);
}
return TextBlockUtils.withMargin(text, 0, 3, 1, 1);
}
public double getNailThickness(StringBounder stringBounder) {
return tetris(stringBounder).getHeight();
return getTetris(stringBounder).getHeight();
}
public double getNailElongation(StringBounder stringBounder) {
return tetris(stringBounder).getWidth();
return getTetris(stringBounder).getWidth();
}
public double getFullThickness(StringBounder stringBounder) {

View File

@ -55,8 +55,9 @@ class Idea {
private final StyleBuilder styleBuilder;
private final String stereotype;
public Idea(StyleBuilder styleBuilder, HColor backColor, Display label, IdeaShape shape, String stereotype) {
this(styleBuilder, backColor, 0, null, label, shape, stereotype);
public static Idea createIdeaSimple(StyleBuilder styleBuilder, HColor backColor, Display label, IdeaShape shape,
String stereotype) {
return new Idea(styleBuilder, backColor, 0, null, label, shape, stereotype);
}
public Idea createIdea(StyleBuilder styleBuilder, HColor backColor, int newLevel, Display newDisplay,

View File

@ -134,9 +134,9 @@ public class MindMapDiagram extends UmlDiagram {
public CommandExecutionResult addIdea(HColor backColor, int level, Display label, IdeaShape shape,
Direction direction) {
String stereotype = label.getEndingStereotype();
if (stereotype != null) {
if (stereotype != null)
label = label.removeEndingStereotype();
}
if (last().isFull(level))
this.mindmaps.add(new MindMap(getSkinParam()));
@ -154,25 +154,25 @@ public class MindMapDiagram extends UmlDiagram {
private String first;
public int getSmartLevel(String type) {
if (first == null) {
if (first == null)
first = type;
}
if (type.endsWith("**")) {
if (type.endsWith("**"))
type = type.replace('\t', ' ').trim();
}
type = type.replace('\t', ' ');
if (type.contains(" ") == false) {
if (type.contains(" ") == false)
return type.length() - 1;
}
if (type.endsWith(first)) {
if (type.endsWith(first))
return type.length() - first.length();
}
if (type.trim().length() == 1) {
if (type.trim().length() == 1)
return type.length() - 1;
}
if (type.startsWith(first)) {
if (type.startsWith(first))
return type.length() - first.length();
}
throw new UnsupportedOperationException("type=<" + type + ">[" + first + "]");
}

View File

@ -57,20 +57,19 @@ public class StripeFrontier {
}
public boolean contains(double x, double y) {
for (Stripe stripe : stripes) {
if (stripe.contains(x)) {
for (Stripe stripe : stripes)
if (stripe.contains(x))
return y <= stripe.getValue();
}
}
throw new UnsupportedOperationException();
}
public double getContact(double x1, double x2) {
final SortedSet<Stripe> collisions = collisionning(x1, x2);
double result = -Double.MAX_VALUE;
for (Stripe strip : collisions) {
for (Stripe strip : collisions)
result = Math.max(result, strip.getValue());
}
return result;
}
@ -104,35 +103,35 @@ public class StripeFrontier {
}
private void addSingleInternal(double x1, double x2, double value, final Stripe touch) {
if (value <= touch.getValue()) {
if (value <= touch.getValue())
return;
}
final boolean ok = this.stripes.remove(touch);
assert ok;
if (touch.getStart() != x1) {
if (touch.getStart() != x1)
this.stripes.add(new Stripe(touch.getStart(), x1, touch.getValue()));
}
this.stripes.add(new Stripe(x1, x2, value));
if (x2 != touch.getEnd()) {
if (x2 != touch.getEnd())
this.stripes.add(new Stripe(x2, touch.getEnd(), touch.getValue()));
}
assert checkConsistent();
}
private boolean checkConsistent() {
Stripe last = null;
for (Stripe stripe : stripes) {
if (last == null && stripe.getStart() != -Double.MAX_VALUE) {
if (last == null && stripe.getStart() != -Double.MAX_VALUE)
return false;
}
if (last != null && last.getEnd() != stripe.getStart()) {
if (last != null && last.getEnd() != stripe.getStart())
return false;
}
last = stripe;
}
if (last.getEnd() != Double.MAX_VALUE) {
if (last.getEnd() != Double.MAX_VALUE)
return false;
}
return true;
}
@ -140,13 +139,13 @@ public class StripeFrontier {
final SortedSet<Stripe> result = new TreeSet<>();
for (Iterator<Stripe> it = stripes.iterator(); it.hasNext();) {
Stripe stripe = it.next();
if (x1 >= stripe.getEnd()) {
if (x1 >= stripe.getEnd())
continue;
}
result.add(stripe);
if (x2 <= stripe.getEnd()) {
if (x2 <= stripe.getEnd())
return result;
}
}
throw new UnsupportedOperationException();
}

View File

@ -105,12 +105,12 @@ public class SymetricalTeePositioned {
}
public SymetricalTeePositioned getMax(SymetricalTeePositioned other) {
if (this.tee != other.tee) {
if (this.tee != other.tee)
throw new IllegalArgumentException();
}
if (other.y > this.y) {
if (other.y > this.y)
return other;
}
return this;
}

View File

@ -58,35 +58,35 @@ public class Tetris {
}
public void balance() {
if (elements.size() == 0) {
if (elements.size() == 0)
return;
}
if (minY != Double.MAX_VALUE) {
if (minY != Double.MAX_VALUE)
throw new IllegalStateException();
}
for (SymetricalTeePositioned element : elements) {
minY = Math.min(minY, element.getMinY());
maxY = Math.max(maxY, element.getMaxY());
}
final double mean = (minY + maxY) / 2;
for (SymetricalTeePositioned stp : elements) {
for (SymetricalTeePositioned stp : elements)
stp.move(-mean);
}
// System.err.println("Balanced=" + this + " " + elements);
}
public double getHeight() {
if (elements.size() == 0) {
if (elements.size() == 0)
return 0;
}
return maxY - minY;
}
public double getWidth() {
double result = 0;
for (SymetricalTeePositioned tee : elements) {
for (SymetricalTeePositioned tee : elements)
result = Math.max(result, tee.getMaxX());
}
return result;
}
@ -126,9 +126,9 @@ public class Tetris {
assert b1.getY1() == b1.getY2();
final Line2D b2 = result.getSegmentB2();
if (b2.getX1() != b2.getX2()) {
if (b2.getX1() != b2.getX2())
frontier.addSegment(b2.getX1(), b2.getX2(), b2.getY1());
}
assert b2.getY1() == b2.getY2();
}

View File

@ -96,7 +96,10 @@ public class ComponentRoseParticipant extends AbstractTextualComponent {
protected void drawInternalU(UGraphic ug, Area area) {
final StringBounder stringBounder = ug.getStringBounder();
ug = ug.apply(UTranslate.dx(padding));
ug = ug.apply(back.bg()).apply(foregroundColor);
if (foregroundColor != null)
ug = ug.apply(foregroundColor);
if (back != null)
ug = ug.apply(back.bg());
ug = ug.apply(stroke);
final Shadowable rect = new URectangle(getTextWidth(stringBounder), getTextHeight(stringBounder))
.rounded(roundCorner).diagonalCorner(diagonalCorner);

View File

@ -216,6 +216,8 @@ public class FromSkinparamToStyle {
addConvert(cleanName + "BackgroundColor", PName.BackGroundColor, sname);
addConvert(cleanName + "BorderColor", PName.LineColor, sname);
addConvert(cleanName + "BorderThickness", PName.LineThickness, sname);
addConvert(cleanName + "RoundCorner", PName.RoundCorner, sname);
addConvert(cleanName + "DiagonalCorner", PName.DiagonalCorner, sname);
addConFont(cleanName, sname);
}

View File

@ -110,7 +110,7 @@ public class StyleLoader {
}
private final static String KEYNAMES = "[.\\w(), ]+?";
private final static String KEYNAMES = "[-.\\w(), ]+?";
private final static Pattern2 keyName = MyPattern.cmpile("^[:]?(" + KEYNAMES + ")([%s]+\\*)?[%s]*\\{$");
private final static Pattern2 propertyAndValue = MyPattern.cmpile("^([\\w]+):?[%s]+(.*?);?$");
private final static Pattern2 closeBracket = MyPattern.cmpile("^\\}$");

View File

@ -86,7 +86,7 @@ public class StyleSignature {
if (s == null)
return this;
if (s.contains("*") || s.contains("&") || s.contains("-"))
if (s.contains("*") || s.contains("&"))
throw new IllegalArgumentException();
final Set<String> result = new LinkedHashSet<>(names);

View File

@ -318,6 +318,7 @@ public class Cluster implements Moveable {
HColor borderColor;
Style style = null;
final double rounded;
final double diagonalCorner;
final double shadowing;
if (UseStyle.useBetaStyle()) {
final USymbol uSymbol = group.getUSymbol() == null ? USymbols.PACKAGE : group.getUSymbol();
@ -329,10 +330,8 @@ public class Cluster implements Moveable {
else
borderColor = style.value(PName.LineColor).asColor(skinParam2.getThemeStyle(),
skinParam2.getIHtmlColorSet());
if (umlDiagramType == UmlDiagramType.STATE)
rounded = style.value(PName.RoundCorner).asDouble();
else
rounded = IEntityImage.CORNER;
rounded = style.value(PName.RoundCorner).asDouble();
diagonalCorner = style.value(PName.DiagonalCorner).asDouble();
} else {
if (group.getUSymbol() == null)
@ -347,10 +346,10 @@ public class Cluster implements Moveable {
borderColor = getColor(ColorParam.packageBorder, skinParam, group.getStereotype());
else
borderColor = getColor(ColorParam.packageBorder, skinParam, group.getStereotype());
diagonalCorner = 0;
}
ug.startGroup(Collections.singletonMap(UGroupType.ID, "cluster_" + fullName));
final Url url = group.getUrl99();
@ -399,14 +398,18 @@ public class Cluster implements Moveable {
backColor = getBackColor(backColor, skinParam2, group.getStereotype(), umlDiagramType.getStyleName(),
group.getUSymbol());
if (ztitle != null || zstereo != null) {
final double roundCorner = group.getUSymbol() == null ? 0
: group.getUSymbol().getSkinParameter().getRoundCorner(skinParam, group.getStereotype());
final double roundCorner;
if (UseStyle.useBetaStyle())
roundCorner = rounded;
else
roundCorner = group.getUSymbol() == null ? 0
: group.getUSymbol().getSkinParameter().getRoundCorner(skinParam, group.getStereotype());
final ClusterDecoration decoration = new ClusterDecoration(packageStyle, group.getUSymbol(), ztitle,
zstereo, minX, minY, maxX, maxY, stroke);
decoration.drawU(ug, backColor, borderColor, shadowing, roundCorner,
skinParam2.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false, null),
skinParam2.getStereotypeAlignment());
skinParam2.getStereotypeAlignment(), diagonalCorner);
return;
}
final URectangle rect = new URectangle(maxX - minX, maxY - minY);

View File

@ -77,13 +77,13 @@ public class ClusterDecoration {
}
public void drawU(UGraphic ug, HColor backColor, HColor borderColor, double shadowing, double roundCorner,
HorizontalAlignment titleAlignment, HorizontalAlignment stereoAlignment) {
HorizontalAlignment titleAlignment, HorizontalAlignment stereoAlignment, double diagonalCorner) {
final SymbolContext biColor = new SymbolContext(backColor, borderColor);
if (symbol == null) {
if (symbol == null)
throw new UnsupportedOperationException();
}
final SymbolContext symbolContext = biColor.withShadow(shadowing).withStroke(defaultStroke)
.withCorner(roundCorner, 0);
.withCorner(roundCorner, diagonalCorner);
symbol.asBig(title, titleAlignment, stereo, maxX - minX, maxY - minY, symbolContext, stereoAlignment)
.drawU(ug.apply(new UTranslate(minX, minY)));
}

View File

@ -101,6 +101,7 @@ import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.USymbolHexagon;
import net.sourceforge.plantuml.graphic.USymbolInterface;
import net.sourceforge.plantuml.graphic.USymbols;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
@ -705,10 +706,18 @@ public final class GeneralImageBuilder {
final FontConfiguration fontConfiguration;
if (UseStyle.useBetaStyle()) {
final SName sname = dotData.getUmlDiagramType().getStyleName();
final Style style = StyleSignature.of(SName.root, SName.element, sname, SName.title) //
final StyleSignature signature;
final USymbol uSymbol = g.getUSymbol();
if (uSymbol == USymbols.RECTANGLE)
signature = StyleSignature.of(SName.root, SName.element, sname, uSymbol.getSName(), SName.title);
else
signature = StyleSignature.of(SName.root, SName.element, sname, SName.title);
final Style style = signature //
.with(g.getStereotype()) //
.with(g.getStereostyles()) //
.getMergedStyle(skinParam.getCurrentStyleBuilder());
fontConfiguration = style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
} else
fontConfiguration = g.getFontConfigurationForTitle(skinParam);

View File

@ -88,6 +88,7 @@ public class EntityImageEmptyPackage extends AbstractEntityImage {
private final HColor borderColor;
private final UStroke stroke;
private final double roundCorner;
private final double diagonalCorner;
private final HColor back;
private Style getStyle() {
@ -117,6 +118,7 @@ public class EntityImageEmptyPackage extends AbstractEntityImage {
this.shadowing = style.value(PName.Shadowing).asDouble();
this.stroke = style.getStroke(colors);
this.roundCorner = style.value(PName.RoundCorner).asDouble();
this.diagonalCorner = style.value(PName.DiagonalCorner).asDouble();
if (specificBackColor == null) {
this.back = style.value(PName.BackGroundColor).asColor(getSkinParam().getThemeStyle(),
getSkinParam().getIHtmlColorSet());
@ -127,6 +129,7 @@ public class EntityImageEmptyPackage extends AbstractEntityImage {
getSkinParam().getIHtmlColorSet());
titleHorizontalAlignment = style.getHorizontalAlignment();
} else {
this.diagonalCorner = 0;
this.borderColor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.packageBorder);
this.shadowing = getSkinParam().shadowing(getEntity().getStereotype()) ? 3 : 0;
this.stroke = GeneralImageBuilder.getForcedStroke(getEntity().getStereotype(), getSkinParam());
@ -182,7 +185,8 @@ public class EntityImageEmptyPackage extends AbstractEntityImage {
.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false, null);
final HorizontalAlignment stereotypeAlignment = getSkinParam().getStereotypeAlignment();
decoration.drawU(ug, back, borderColor, shadowing, roundCorner, horizontalAlignment, stereotypeAlignment);
decoration.drawU(ug, back, borderColor, shadowing, roundCorner, horizontalAlignment, stereotypeAlignment,
diagonalCorner);
if (url != null) {
ug.closeUrl();

View File

@ -95,6 +95,9 @@ public class DriverTextSvg implements UDriver<UText, SvgGraphics> {
}
String text = shape.getText();
if (text.matches("^\\s*$"))
text = text.replace(' ', (char)160);
if (text.startsWith(" ")) {
final double space = stringBounder.calculateDimension(font, " ").getWidth();
while (text.startsWith(" ")) {

View File

@ -80,7 +80,7 @@ public class Version {
}
public static int beta() {
final int beta = 6;
final int beta = 8;
return beta;
}