1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-24 13:57:33 +00:00

Refactoring about colors

This commit is contained in:
Arnaud Roques 2022-08-19 18:34:21 +02:00
parent 9da0fd0939
commit b5a6684cd1
171 changed files with 625 additions and 573 deletions

View File

@ -215,6 +215,9 @@ stateDiagram {
state {
RoundCorner 25
}
stateBody {
BackGroundColor transparent
}
element {
title {
FontStyle plain

View File

@ -38,62 +38,62 @@ package net.sourceforge.plantuml;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
@HaxeIgnored
public enum ColorParam {
background(HColorUtils.WHITE, true, ColorType.BACK),
hyperlink(HColorUtils.BLUE),
background(HColors.WHITE, true, ColorType.BACK),
hyperlink(HColors.BLUE),
activityBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
activityBorder(HColorUtils.MY_RED, ColorType.LINE),
activityBackground(HColors.MY_YELLOW, true, ColorType.BACK),
activityBorder(HColors.MY_RED, ColorType.LINE),
classBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
classBackground(HColors.MY_YELLOW, true, ColorType.BACK),
classBorder(HColorUtils.MY_RED, ColorType.LINE),
classBorder(HColors.MY_RED, ColorType.LINE),
arrowHead(HColorUtils.MY_RED, null),
arrowHead(HColors.MY_RED, null),
stateBorder(HColorUtils.MY_RED, ColorType.LINE),
stateBorder(HColors.MY_RED, ColorType.LINE),
noteBackground(HColorUtils.COL_FBFB77, true, ColorType.BACK),
noteBorder(HColorUtils.MY_RED, ColorType.LINE),
noteBackground(HColors.COL_FBFB77, true, ColorType.BACK),
noteBorder(HColors.MY_RED, ColorType.LINE),
diagramBorder(null, ColorType.LINE),
actorBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
actorBorder(HColorUtils.MY_RED, ColorType.LINE),
sequenceGroupBodyBackground(HColorUtils.RED, true, ColorType.BACK),
sequenceReferenceHeaderBackground(HColorUtils.COL_EEEEEE, true, ColorType.BACK),
sequenceReferenceBackground(HColorUtils.WHITE, true, ColorType.BACK),
sequenceLifeLineBorder(HColorUtils.MY_RED, ColorType.LINE),
sequenceNewpageSeparator(HColorUtils.BLACK, ColorType.LINE),
sequenceBoxBorder(HColorUtils.MY_RED, ColorType.LINE),
actorBackground(HColors.MY_YELLOW, true, ColorType.BACK),
actorBorder(HColors.MY_RED, ColorType.LINE),
sequenceGroupBodyBackground(HColors.RED, true, ColorType.BACK),
sequenceReferenceHeaderBackground(HColors.COL_EEEEEE, true, ColorType.BACK),
sequenceReferenceBackground(HColors.WHITE, true, ColorType.BACK),
sequenceLifeLineBorder(HColors.MY_RED, ColorType.LINE),
sequenceNewpageSeparator(HColors.BLACK, ColorType.LINE),
sequenceBoxBorder(HColors.MY_RED, ColorType.LINE),
iconPrivate(HColorUtils.COL_C82930),
iconPrivateBackground(HColorUtils.COL_F24D5C),
iconPackage(HColorUtils.COL_1963A0),
iconPackageBackground(HColorUtils.COL_4177AF),
iconProtected(HColorUtils.COL_B38D22),
iconProtectedBackground(HColorUtils.COL_FFFF44),
iconPublic(HColorUtils.COL_038048),
iconPublicBackground(HColorUtils.COL_84BE84),
iconIEMandatory(HColorUtils.BLACK),
iconPrivate(HColors.COL_C82930),
iconPrivateBackground(HColors.COL_F24D5C),
iconPackage(HColors.COL_1963A0),
iconPackageBackground(HColors.COL_4177AF),
iconProtected(HColors.COL_B38D22),
iconProtectedBackground(HColors.COL_FFFF44),
iconPublic(HColors.COL_038048),
iconPublicBackground(HColors.COL_84BE84),
iconIEMandatory(HColors.BLACK),
arrowLollipop(HColorUtils.WHITE),
arrowLollipop(HColors.WHITE),
machineBackground(HColorUtils.WHITE),
machineBorder(HColorUtils.BLACK, ColorType.LINE),
requirementBackground(HColorUtils.WHITE),
requirementBorder(HColorUtils.BLACK, ColorType.LINE),
designedBackground(HColorUtils.WHITE),
designedBorder(HColorUtils.BLACK, ColorType.LINE),
domainBackground(HColorUtils.WHITE),
domainBorder(HColorUtils.BLACK, ColorType.LINE),
lexicalBackground(HColorUtils.WHITE),
lexicalBorder(HColorUtils.BLACK, ColorType.LINE),
biddableBackground(HColorUtils.WHITE),
biddableBorder(HColorUtils.BLACK, ColorType.LINE);
machineBackground(HColors.WHITE),
machineBorder(HColors.BLACK, ColorType.LINE),
requirementBackground(HColors.WHITE),
requirementBorder(HColors.BLACK, ColorType.LINE),
designedBackground(HColors.WHITE),
designedBorder(HColors.BLACK, ColorType.LINE),
domainBackground(HColors.WHITE),
domainBorder(HColors.BLACK, ColorType.LINE),
lexicalBackground(HColors.WHITE),
lexicalBorder(HColors.BLACK, ColorType.LINE),
biddableBackground(HColors.WHITE),
biddableBorder(HColors.BLACK, ColorType.LINE);
private final boolean isBackground;
private final HColor defaultValue;

View File

@ -52,7 +52,7 @@ import net.sourceforge.plantuml.png.PngSplitter;
import net.sourceforge.plantuml.project.GanttDiagram;
import net.sourceforge.plantuml.security.SFile;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class PSystemUtils {
@ -179,7 +179,7 @@ public class PSystemUtils {
fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null,
diagram.getSkinParam().getDpi(),
diagram instanceof GanttDiagram
? new SplitParam(HColorUtils.BLACK, null, 5) // for backwards compatibility
? new SplitParam(HColors.BLACK, null, 5) // for backwards compatibility
: diagram.getSkinParam().getSplitParam()
).getFiles();

View File

@ -142,4 +142,3 @@ public class ProgressBar {
}
}
}

View File

@ -88,7 +88,7 @@ import net.sourceforge.plantuml.ugraphic.color.ColorMapperReverse;
import net.sourceforge.plantuml.ugraphic.color.ColorOrder;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException;
public class SkinParam implements ISkinParam {
@ -251,14 +251,14 @@ public class SkinParam implements ISkinParam {
public HColor getHyperlinkColor() {
final HColor result = getHtmlColor(ColorParam.hyperlink, null, false);
if (result == null)
return HColorUtils.BLUE;
return HColors.BLUE;
return result;
}
public HColor getBackgroundColor() {
final HColor result = getHtmlColor(ColorParam.background, null, false);
return result != null ? result : HColorUtils.WHITE;
return result != null ? result : HColors.WHITE;
}
public String getValue(String key) {
@ -316,7 +316,7 @@ public class SkinParam implements ISkinParam {
}
if ((param == ColorParam.background || param == ColorParam.arrowHead)
&& (value.equalsIgnoreCase("transparent") || value.equalsIgnoreCase("none"))) {
return HColorUtils.transparent();
return HColors.transparent();
}
if (param == ColorParam.background) {
return getIHtmlColorSet().getColorOrWhite(themeStyle, value);

View File

@ -61,7 +61,7 @@ import net.sourceforge.plantuml.style.StyleLoader;
import net.sourceforge.plantuml.style.StyleSignatureBasic;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public abstract class TitledDiagram extends AbstractPSystem implements Diagram, Annotated {
@ -281,7 +281,7 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram,
HColor backgroundColor = style.value(PName.BackGroundColor).asColor(this.getSkinParam().getThemeStyle(),
this.getSkinParam().getIHtmlColorSet());
if (backgroundColor == null)
backgroundColor = HColorUtils.transparent();
backgroundColor = HColors.transparent();
return backgroundColor;
}

View File

@ -46,7 +46,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleStart;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class InstructionEnd extends MonoSwimable implements Instruction {
@ -59,7 +59,7 @@ public class InstructionEnd extends MonoSwimable implements Instruction {
@Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileCircleStart(stringBounder, skinParam, HColorUtils.BLACK, getSwimlaneIn());
return new GtileCircleStart(stringBounder, skinParam, HColors.BLACK, getSwimlaneIn());
}
@Override

View File

@ -54,7 +54,7 @@ import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class InstructionGroup extends AbstractInstruction implements Instruction, InstructionCollection {
@ -96,7 +96,7 @@ public class InstructionGroup extends AbstractInstruction implements Instruction
@Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
Gtile tmp = list.createGtile(skinParam, stringBounder);
return new GtileGroup(tmp, title, null, HColorUtils.BLUE, backColor, titleColor, tmp.skinParam(), borderColor,
return new GtileGroup(tmp, title, null, HColors.BLUE, backColor, titleColor, tmp.skinParam(), borderColor,
type, roundCorner);
}

View File

@ -46,7 +46,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleStart;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class InstructionStart extends MonoSwimable implements Instruction {
@ -64,7 +64,7 @@ public class InstructionStart extends MonoSwimable implements Instruction {
@Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileCircleStart(stringBounder, skinParam, HColorUtils.BLACK, getSwimlaneIn());
return new GtileCircleStart(stringBounder, skinParam, HColors.BLACK, getSwimlaneIn());
}
@Override

View File

@ -46,7 +46,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleStart;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class InstructionStop extends MonoSwimable implements Instruction {
@ -64,7 +64,7 @@ public class InstructionStop extends MonoSwimable implements Instruction {
@Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileCircleStart(stringBounder, skinParam, HColorUtils.BLACK, getSwimlaneIn());
return new GtileCircleStart(stringBounder, skinParam, HColors.BLACK, getSwimlaneIn());
}
@Override

View File

@ -57,7 +57,7 @@ import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignatureBasic;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException;
public class CommandPartition3 extends SingleLineCommand2<ActivityDiagram3> {
@ -133,7 +133,7 @@ public class CommandPartition3 extends SingleLineCommand2<ActivityDiagram3> {
backColor = stylePartition.value(PName.BackGroundColor).asColor(diagram.getSkinParam().getThemeStyle(),
diagram.getSkinParam().getIHtmlColorSet());
final HColor titleColor = HColorUtils.BLUE;// stylePartition.value(PName.FontColor).asColor(diagram.getSkinParam().getIHtmlColorSet());
final HColor titleColor = HColors.BLUE;// stylePartition.value(PName.FontColor).asColor(diagram.getSkinParam().getIHtmlColorSet());
final double roundCorner = stylePartition.value(PName.RoundCorner).asDouble();
diagram.startGroup(Display.getWithNewlines(partitionTitle), backColor, titleColor, borderColor, symbol,

View File

@ -55,7 +55,7 @@ import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
@HaxeIgnored
public class CollisionDetector extends UGraphicNo {
@ -98,7 +98,7 @@ public class CollisionDetector extends UGraphicNo {
if (collision(minmax))
minmax.drawGray(ug);
final HColor color = HColorUtils.BLACK;
final HColor color = HColors.BLACK;
ug = ug.apply(color).apply(new UStroke(5));
for (Snake snake : snakes)
for (Line2D line : snake.getHorizontalLines())

View File

@ -49,7 +49,7 @@ import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class UGraphicInterceptorUDrawable2 extends UGraphicDelegator {
@ -91,7 +91,7 @@ public class UGraphicInterceptorUDrawable2 extends UGraphicDelegator {
}
private void drawGoto(FtileGoto ftile) {
final HColor gotoColor = HColorUtils.MY_RED;
final HColor gotoColor = HColors.MY_RED;
final FtileGeometry geom = ftile.calculateDimension(getStringBounder());
final Point2D pt = geom.getPointIn();

View File

@ -40,7 +40,7 @@ import java.util.List;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class Zad {
@ -53,7 +53,7 @@ public class Zad {
}
public void drawDebug(UGraphic ug) {
ug = ug.apply(HColorUtils.BLUE.bg()).apply(HColorUtils.RED_LIGHT);
ug = ug.apply(HColors.BLUE.bg()).apply(HColors.RED_LIGHT);
for (MinMax minMax : rectangles) {
System.err.println("minmax=" + minMax);
minMax.drawGray(ug);

View File

@ -50,7 +50,7 @@ import net.sourceforge.plantuml.ugraphic.UChange;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class UGraphicInterceptorOneSwimlane extends UGraphicDelegator {
@ -109,7 +109,7 @@ public class UGraphicInterceptorOneSwimlane extends UGraphicDelegator {
}
private void drawGoto() {
final UGraphic ugGoto = getUg().apply(HColorUtils.GREEN).apply(HColorUtils.GREEN.bg());
final UGraphic ugGoto = getUg().apply(HColors.GREEN).apply(HColors.GREEN.bg());
ugGoto.draw(new ULine(100, 100));
}

View File

@ -74,7 +74,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class FtileBox extends AbstractFtile {
@ -196,12 +196,12 @@ public class FtileBox extends AbstractFtile {
final UStroke thickness = style.getStroke();
if (borderColor == null)
ug = ug.apply(new HColorNone());
ug = ug.apply(HColors.none());
else
ug = ug.apply(borderColor);
if (backColor == null)
ug = ug.apply(new HColorNone().bg());
ug = ug.apply(HColors.none().bg());
else
ug = ug.apply(backColor.bg());

View File

@ -75,7 +75,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class FtileBox2 extends AbstractFtile {
@ -201,12 +201,12 @@ public class FtileBox2 extends AbstractFtile {
final UStroke thickness = style.getStroke();
if (borderColor == null)
ug = ug.apply(new HColorNone());
ug = ug.apply(HColors.none());
else
ug = ug.apply(borderColor);
if (backColor == null)
ug = ug.apply(new HColorNone().bg());
ug = ug.apply(HColors.none().bg());
else
ug = ug.apply(backColor.bg());

View File

@ -64,7 +64,6 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
@ -73,7 +72,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class FtileBoxOld extends AbstractFtile {
@ -197,12 +196,12 @@ public class FtileBoxOld extends AbstractFtile {
final UStroke thickness = style.getStroke();
if (borderColor == null)
ug = ug.apply(new HColorNone());
ug = ug.apply(HColors.none());
else
ug = ug.apply(borderColor);
if (backColor == null)
ug = ug.apply(new HColorNone().bg());
ug = ug.apply(HColors.none().bg());
else
ug = ug.apply(backColor.bg());

View File

@ -50,7 +50,7 @@ import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class FtileCircleStart extends AbstractFtile {
@ -65,7 +65,7 @@ public class FtileCircleStart extends AbstractFtile {
super(skinParam);
this.swimlane = swimlane;
this.backColor = backColor;
this.borderColor = new HColorNone();
this.borderColor = HColors.none();
this.shadowing = style.value(PName.Shadowing).asDouble();
this.backColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());

View File

@ -51,7 +51,7 @@ import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorMiddle;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class FtileCircleStop extends AbstractFtile {
@ -104,7 +104,7 @@ public class FtileCircleStop extends AbstractFtile {
// if (skinParam().shadowing(null)) {
// circleSmall.setDeltaShadow(3);
// }
ug.apply(new HColorMiddle(borderColor, backColor)).apply(borderColor.bg()).apply(new UTranslate(delta, delta))
ug.apply(HColors.middle(borderColor, backColor)).apply(borderColor.bg()).apply(new UTranslate(delta, delta))
.draw(circleSmall);
}

View File

@ -51,7 +51,7 @@ import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class FtileThinSplit extends AbstractFtile {
@ -88,7 +88,7 @@ public class FtileThinSplit extends AbstractFtile {
final UShape rect = ULine.hline(last - first);
ug = ug.apply(UTranslate.dx(first));
if (colorBar == null) {
ug = ug.apply(new HColorNone());
ug = ug.apply(HColors.none());
} else {
ug = ug.apply(colorBar);
}

View File

@ -68,7 +68,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class GtileBox extends AbstractGtile {
@ -173,12 +173,12 @@ public class GtileBox extends AbstractGtile {
final UStroke thickness = style.getStroke();
if (borderColor == null)
ug = ug.apply(new HColorNone());
ug = ug.apply(HColors.none());
else
ug = ug.apply(borderColor);
if (backColor == null)
ug = ug.apply(new HColorNone().bg());
ug = ug.apply(HColors.none().bg());
else
ug = ug.apply(backColor.bg());

View File

@ -47,7 +47,7 @@ import net.sourceforge.plantuml.style.StyleSignatureBasic;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class GtileCircleStart extends AbstractGtile {
@ -72,7 +72,7 @@ public class GtileCircleStart extends AbstractGtile {
protected void drawUInternal(UGraphic ug) {
final UEllipse circle = new UEllipse(SIZE, SIZE);
circle.setDeltaShadow(shadowing);
ug.apply(new HColorNone()).apply(backColor.bg()).draw(circle);
ug.apply(HColors.none()).apply(backColor.bg()).draw(circle);
}
@Override

View File

@ -62,7 +62,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
import net.sourceforge.plantuml.utils.MathUtils;
public class GtileGroup extends AbstractGtileRoot {
@ -96,9 +96,9 @@ public class GtileGroup extends AbstractGtileRoot {
super(inner.getStringBounder(), skinParam);
this.roundCorner = roundCorner;
this.type = type;
this.backColor = backColor == null ? HColorUtils.WHITE : backColor;
this.backColor = backColor == null ? HColors.WHITE : backColor;
this.inner = inner;
this.borderColor = borderColor == null ? HColorUtils.BLACK : borderColor;
this.borderColor = borderColor == null ? HColors.BLACK : borderColor;
final Style style = getDefaultStyleDefinitionPartition().getMergedStyle(skinParam.getCurrentStyleBuilder());
final FontConfiguration fc = style.getFontConfiguration(skinParam.getThemeStyle(),

View File

@ -44,7 +44,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.StyleSignatureBasic;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class GtileWhile extends GtileTopDown3 {
@ -58,7 +58,7 @@ public class GtileWhile extends GtileTopDown3 {
private static Gtile getShape1(Gtile toto, Swimlane swimlane, Display test, Display yes) {
GtileHexagonInside tmp0 = Gtiles.hexagonInside(swimlane, toto.getStringBounder(), toto.skinParam(),
getDefaultStyleDefinitionDiamond(), HColorUtils.BLUE, test);
getDefaultStyleDefinitionDiamond(), HColors.BLUE, test);
// final TextBlock tmp0 = branches.get(0).getTextBlockPositive();
// return Gtiles.withSouthMargin(tmp.withSouthLabel(tmp0), 10);

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;

View File

@ -60,7 +60,7 @@ import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class BoardDiagram extends UmlDiagram {
@ -120,7 +120,7 @@ public class BoardDiagram extends UmlDiagram {
for (int i = 0; i < getMaxStage(); i++) {
final double dy = (i + 1) * PostIt.getHeight() - 10;
ug.apply(HColorUtils.BLACK).apply(new UStroke(5, 5, 0.5)).apply(UTranslate.dy(dy)).draw(line);
ug.apply(HColors.BLACK).apply(new UStroke(5, 5, 0.5)).apply(UTranslate.dy(dy)).draw(line);
}
}

View File

@ -48,7 +48,7 @@ import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class CardBox extends AbstractTextBlock {
@ -72,7 +72,7 @@ public class CardBox extends AbstractTextBlock {
final URectangle rect = new URectangle(calculateDimension(ug.getStringBounder()));
rect.setDeltaShadow(1);
ug.apply(HColorUtils.BLACK).apply(HColorUtils.LIGHT_GRAY.bg()).draw(rect);
ug.apply(HColors.BLACK).apply(HColors.LIGHT_GRAY.bg()).draw(rect);
label.create(FontConfiguration.blackBlueTrue(UFont.sansSerif(14)), HorizontalAlignment.LEFT, skinParam)
.drawU(ug.apply(new UTranslate(3, 3)));

View File

@ -59,7 +59,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzzle {
@ -99,7 +99,7 @@ public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzz
public void drawU(UGraphic ug) {
raw.drawU(ug);
ug = ug.apply(HColorUtils.RED);
ug = ug.apply(HColors.RED);
for (Where w : Where.values()) {
if (have(w)) {
drawLine(ug, w, raw.calculateDimension(ug.getStringBounder()));
@ -148,7 +148,7 @@ public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzz
public TextBlock toTextBlockInternal(ISkinParam skinParam) {
if (type == BpmElementType.START) {
return new FtileCircleStart(skinParam, HColorUtils.BLACK, null, getStyle(skinParam));
return new FtileCircleStart(skinParam, HColors.BLACK, null, getStyle(skinParam));
}
if (type == BpmElementType.MERGE) {
final HColor borderColor = SkinParamUtils.getColor(skinParam, null, ColorParam.activityBorder);
@ -160,7 +160,7 @@ public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzz
return FtileBox.create(skinParam, display, null, BoxStyle.PLAIN, null);
}
final UFont font = UFont.serif(14);
final FontConfiguration fc = FontConfiguration.create(font, HColorUtils.RED, HColorUtils.RED, false);
final FontConfiguration fc = FontConfiguration.create(font, HColors.RED, HColors.RED, false);
if (Display.isNull(display)) {
return Display.getWithNewlines(type.toString()).create(fc, HorizontalAlignment.LEFT, skinParam);
}

View File

@ -47,7 +47,7 @@ import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class ConnectorPuzzleEmpty extends AbstractConnectorPuzzle implements Placeable, TextBlock, ConnectorPuzzle {
@ -88,7 +88,7 @@ public class ConnectorPuzzleEmpty extends AbstractConnectorPuzzle implements Pla
public void drawU(UGraphic ug) {
// System.err.println("DRAWING " + toString());
ug = ug.apply(HColorUtils.BLUE);
ug = ug.apply(HColors.BLUE);
for (Where w : Where.values()) {
if (have(w)) {
drawLine(ug, w);

View File

@ -44,7 +44,7 @@ import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class GridArray implements UDrawable {
@ -154,7 +154,7 @@ public class GridArray implements UDrawable {
for (int c = 0; c < cols; c++) {
widthMax += getWidthOfCol(ug.getStringBounder(), c) + margin;
}
ug = ug.apply(HColorUtils.BLACK);
ug = ug.apply(HColors.BLACK);
double y = 0;
for (int l = 0; l < lines; l++) {
ug.apply(UTranslate.dy(y)).draw(ULine.hline(widthMax));
@ -169,7 +169,7 @@ public class GridArray implements UDrawable {
}
private void drawArrow(UGraphic ug, Point2D pt1, Point2D pt2) {
ug = ug.apply(HColorUtils.BLUE);
ug = ug.apply(HColors.BLUE);
final ULine line = new ULine(pt2.getX() - pt1.getX(), pt2.getY() - pt1.getY());
ug.apply(new UTranslate(pt1)).draw(line);
}

View File

@ -42,7 +42,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class BrailleDrawer implements UDrawable {
@ -64,7 +64,7 @@ public class BrailleDrawer implements UDrawable {
ug.apply(UTranslate.dy(y * step + spotSize + 1))
.draw(ULine.hline((grid.getMaxX() - grid.getMinX()) * step));
}
ug = ug.apply(HColorUtils.BLACK).apply(HColorUtils.BLACK.bg());
ug = ug.apply(HColors.BLACK).apply(HColors.BLACK.bg());
for (int x = grid.getMinX(); x <= grid.getMaxX(); x++) {
for (int y = grid.getMinY(); y <= grid.getMaxY(); y++) {
if (grid.getState(x, y)) {

View File

@ -36,13 +36,11 @@
package net.sourceforge.plantuml.creole;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class Position {
@ -97,7 +95,7 @@ public class Position {
}
public void drawDebug(UGraphic ug) {
ug = ug.apply(HColorUtils.BLACK).apply(new HColorNone().bg());
ug = ug.apply(HColors.BLACK).apply(HColors.none().bg());
ug = ug.apply(new UTranslate(x, y));
ug.draw(new URectangle(dim));
}

View File

@ -51,7 +51,7 @@ import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class AtomTable extends AbstractAtom implements Atom {
@ -107,7 +107,7 @@ public class AtomTable extends AbstractAtom implements Atom {
final double y2 = getStartingY(i + 1);
final double x1 = getStartingX(0);
final double x2 = getStartingX(getNbCols());
ug.apply(new HColorNone()).apply(line.lineBackColor.bg()).apply(new UTranslate(x1, y1))
ug.apply(HColors.none()).apply(line.lineBackColor.bg()).apply(new UTranslate(x1, y1))
.draw(new URectangle(x2 - x1, y2 - y1));
}
for (int j = 0; j < getNbCols(); j++) {
@ -126,7 +126,7 @@ public class AtomTable extends AbstractAtom implements Atom {
if (cellBackColor != null) {
final double y1 = getStartingY(i);
final double y2 = getStartingY(i + 1);
ug.apply(new HColorNone()).apply(cellBackColor.bg()).apply(new UTranslate(x1, y1))
ug.apply(HColors.none()).apply(cellBackColor.bg()).apply(new UTranslate(x1, y1))
.draw(new URectangle(x2 - x1, y2 - y1));
}
final Position pos = positions.get(cell);

View File

@ -58,8 +58,8 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UText;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorAutomatic;
import net.sourceforge.plantuml.ugraphic.color.HColorAutomaticLegacy;
import net.sourceforge.plantuml.ugraphic.color.HColorScheme;
import net.sourceforge.plantuml.ugraphic.color.HColorAutomagic;
import net.sourceforge.plantuml.ugraphic.color.HColorSimple;
import net.sourceforge.plantuml.utils.CharHidder;
@ -79,9 +79,8 @@ public final class AtomText extends AbstractAtom implements Atom {
protected AtomText(String text, FontConfiguration style, Url url, DelayedDouble marginLeft,
DelayedDouble marginRight, boolean manageSpecialChars) {
if (text.contains("" + BackSlash.hiddenNewLine())) {
if (text.contains("" + BackSlash.hiddenNewLine()))
throw new IllegalArgumentException(text);
}
// if (text.length() > 0) {
// final VisibilityModifier visibilityModifier = VisibilityModifier.getByUnicode(text.charAt(0));
@ -118,23 +117,22 @@ public final class AtomText extends AbstractAtom implements Atom {
Log.debug("g2d=" + rect);
Log.debug("Size for " + text + " is " + rect);
double h = rect.getHeight();
if (h < 10) {
if (h < 10)
h = 10;
}
double width = text.indexOf("\t") == -1 ? rect.getWidth() : getWidth(stringBounder, text);
final double left = marginLeft.getDouble(stringBounder);
final double right = marginRight.getDouble(stringBounder);
if (visibility != null) {
if (visibility != null)
width += visibility.calculateDimension(stringBounder).getWidth();
}
return new Dimension2DDouble(width + left + right, h);
}
public void drawU(UGraphic ug) {
if (url != null) {
if (url != null)
ug.startUrl(url);
}
if (ug.matchesProperty("SPECIALTXT")) {
ug.draw(this);
} else {
@ -145,21 +143,21 @@ public final class AtomText extends AbstractAtom implements Atom {
}
HColor textColor = fontConfiguration.getColor();
FontConfiguration useFontConfiguration = fontConfiguration;
if (textColor instanceof HColorAutomaticLegacy && ug.getParam().getBackcolor() != null) {
if (textColor instanceof HColorAutomagic && ug.getParam().getBackcolor() != null) {
textColor = ((HColorSimple) ug.getParam().getBackcolor()).opposite();
useFontConfiguration = fontConfiguration.changeColor(textColor);
}
if (textColor instanceof HColorAutomatic) {
if (textColor instanceof HColorScheme) {
HColor backcolor = ug.getParam().getBackcolor();
if (backcolor == null) {
if (backcolor == null)
backcolor = ug.getDefaultBackground();
}
textColor = ((HColorAutomatic) textColor).getAppropriateColor(backcolor);
textColor = ((HColorScheme) textColor).getAppropriateColor(backcolor);
useFontConfiguration = fontConfiguration.changeColor(textColor);
}
if (marginLeft != AtomTextUtils.ZERO) {
if (marginLeft != AtomTextUtils.ZERO)
ug = ug.apply(UTranslate.dx(marginLeft.getDouble(ug.getStringBounder())));
}
final StringTokenizer tokenizer = new StringTokenizer(text, "\t", true);
@ -186,9 +184,9 @@ public final class AtomText extends AbstractAtom implements Atom {
}
}
}
if (url != null) {
if (url != null)
ug.closeUrl();
}
}
private double getWidth(StringBounder stringBounder, String text) {
@ -210,9 +208,9 @@ public final class AtomText extends AbstractAtom implements Atom {
private String tabString() {
final int nb = fontConfiguration.getTabSize();
if (nb >= 1 && nb < 7) {
if (nb >= 1 && nb < 7)
return " ".substring(0, nb);
}
return " ";
}
@ -268,9 +266,9 @@ public final class AtomText extends AbstractAtom implements Atom {
public List<Atom> getSplitted(StringBounder stringBounder, LineBreakStrategy maxWidthAsString) {
final double maxWidth = maxWidthAsString.getMaxWidth();
if (maxWidth == 0) {
if (maxWidth == 0)
throw new IllegalStateException();
}
final List<Atom> result = new ArrayList<>();
final StringTokenizer st = new StringTokenizer(text, " ", true);
final StringBuilder currentLine = new StringBuilder();
@ -281,9 +279,9 @@ public final class AtomText extends AbstractAtom implements Atom {
if (w > maxWidth) {
result.add(withText(currentLine.toString()));
currentLine.setLength(0);
if (tmp.startsWith(" ") == false) {
if (tmp.startsWith(" ") == false)
currentLine.append(tmp);
}
} else {
currentLine.append(tmp);
}
@ -300,9 +298,8 @@ public final class AtomText extends AbstractAtom implements Atom {
if (tmp.length() > 0 && getWidth(stringBounder, tmp.toString() + token) > width) {
final Atom part1 = withText(tmp.toString());
String remain = text.substring(tmp.length());
while (remain.startsWith(" ")) {
while (remain.startsWith(" "))
remain = remain.substring(1);
}
final Atom part2 = withText(remain);
return Arrays.asList(part1, part2);

View File

@ -47,7 +47,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class LinkConstraint {
@ -85,7 +85,7 @@ public class LinkConstraint {
if (x2 == 0 && y2 == 0) {
return;
}
ug = ug.apply(HColorUtils.BLACK);
ug = ug.apply(HColors.BLACK);
// ug.apply(new UTranslate(x1, y1)).draw(new URectangle(10, 10));
// ug.apply(new UTranslate(x2, y2)).draw(new URectangle(10, 10));

View File

@ -53,7 +53,7 @@ import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.sprite.SpriteUtils;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException;
public class StereotypeDecoration {
@ -155,7 +155,7 @@ public class StereotypeDecoration {
final String colName = mCircleSprite.get("COLOR", 0);
final HColor col = colName == null ? null : htmlColorSet.getColorLEGACY(colName);
htmlColor = col == null ? HColorUtils.BLACK : col;
htmlColor = col == null ? HColors.BLACK : col;
character = '\0';
spriteName = mCircleSprite.get("NAME", 0);
spriteScale = Parser.getScale(mCircleSprite.get("SCALE", 0), 1);

View File

@ -50,7 +50,7 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class PSystemDefinition extends PlainDiagram implements UDrawable {
@ -73,7 +73,7 @@ public class PSystemDefinition extends PlainDiagram implements UDrawable {
public void drawU(UGraphic ug) {
final UFont font = UFont.sansSerif(14);
final FontConfiguration fc = FontConfiguration.create(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
final FontConfiguration fc = FontConfiguration.create(font, HColors.BLACK, HColors.BLACK, false);
Display.getWithNewlines(startLine).create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()).drawU(ug);
}

View File

@ -35,9 +35,8 @@
*/
package net.sourceforge.plantuml.descdiagram;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@ -47,7 +46,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class BoxedCharacter extends AbstractTextBlock implements TextBlock {
@ -72,7 +71,7 @@ public class BoxedCharacter extends AbstractTextBlock implements TextBlock {
ug = ug.apply(circle);
}
if (innerCircle == null) {
ug = ug.apply(new HColorNone().bg());
ug = ug.apply(HColors.none().bg());
} else {
ug = ug.apply(innerCircle.bg());
}

View File

@ -35,8 +35,6 @@
*/
package net.sourceforge.plantuml.descdiagram;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
@ -45,6 +43,7 @@ import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.Stereotype;

View File

@ -35,8 +35,6 @@
*/
package net.sourceforge.plantuml.descdiagram;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
@ -45,6 +43,7 @@ import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.Stereotype;

View File

@ -35,8 +35,6 @@
*/
package net.sourceforge.plantuml.descdiagram;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
@ -45,6 +43,7 @@ import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.Stereotype;

View File

@ -50,7 +50,7 @@ import net.sourceforge.plantuml.png.PngIO;
import net.sourceforge.plantuml.ugraphic.UChange;
import net.sourceforge.plantuml.ugraphic.UMotif;
import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d;
public class GraphicsPath {
@ -75,10 +75,10 @@ public class GraphicsPath {
final BufferedImage im = builder.getBufferedImage();
final Graphics2D g2d = builder.getGraphics2D();
final UGraphicG2d ug = new UGraphicG2d(HColorUtils.WHITE, colorMapper, stringBounder, g2d, 1.0);
final UGraphicG2d ug = new UGraphicG2d(HColors.WHITE, colorMapper, stringBounder, g2d, 1.0);
ug.setBufferedImage(im);
final UMotif motif = new UMotif(path);
motif.drawHorizontal(ug.apply((UChange) HColorUtils.BLACK), 20, 20, 1);
motif.drawHorizontal(ug.apply((UChange) HColors.BLACK), 20, 20, 1);
g2d.dispose();
return im;

View File

@ -64,7 +64,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorSimple;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
// http://www.redblobgames.com/grids/hexagons/
public class PSystemColors extends PlainDiagram implements UDrawable {
@ -169,7 +169,7 @@ public class PSystemColors extends PlainDiagram implements UDrawable {
continue;
}
final String candidat = colorName.substring(0, i) + BackSlash.BS_BS_N + colorName.substring(i);
final TextBlock tt = getTextName(font, candidat, (HColorSimple) HColorUtils.BLACK);
final TextBlock tt = getTextName(font, candidat, (HColorSimple) HColors.BLACK);
final double width = tt.calculateDimension(stringBounder).getWidth();
if (width < min) {
result = candidat;
@ -239,7 +239,7 @@ public class PSystemColors extends PlainDiagram implements UDrawable {
private void drawFull(UGraphic ug) {
final UFont font = UFont.sansSerif(14).bold();
ug = ug.apply(HColorUtils.BLACK);
ug = ug.apply(HColors.BLACK);
int i = 0;
int j = 0;
for (String name : colors.names()) {
@ -260,7 +260,7 @@ public class PSystemColors extends PlainDiagram implements UDrawable {
private TextBlock getTextName(final UFont font, String name, final HColorSimple color) {
final HColorSimple opposite = color.opposite();
final FontConfiguration fc = FontConfiguration.create(font, opposite, HColorUtils.BLUE, true);
final FontConfiguration fc = FontConfiguration.create(font, opposite, HColors.BLUE, true);
final TextBlock tt = Display.getWithNewlines(name).create(fc, HorizontalAlignment.CENTER,
new SpriteContainerEmpty());
return tt;

View File

@ -131,7 +131,7 @@ import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
/*
* Some notes:
@ -263,8 +263,9 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
final UStroke stroke = Cluster.getStrokeInternal(group, style);
HColor backColor = getBackColor(umlDiagramType);
backColor = Cluster.getBackColor(backColor, skinParam, group.getStereotype(), umlDiagramType.getStyleName(),
group.getUSymbol());
backColor = Cluster.getBackColor(backColor, group.getStereotype(), umlDiagramType.getStyleName(),
group.getUSymbol(), skinParam.getCurrentStyleBuilder(), skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet());
final double roundCorner = style.value(PName.RoundCorner).asDouble();
// final double roundCorner = group.getUSymbol() == null ? 0
@ -276,7 +277,7 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
final ClusterDecoration decoration = new ClusterDecoration(packageStyle, group.getUSymbol(), ztitle,
zstereo, 0, 0, elkNode.getWidth(), elkNode.getHeight(), stroke);
final HColor borderColor = HColorUtils.BLACK;
final HColor borderColor = HColors.BLACK;
decoration.drawU(ug.apply(new UTranslate(corner)), backColor, borderColor, shadowing, roundCorner,
skinParam.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false, null),
skinParam.getStereotypeAlignment(), 0);

View File

@ -82,7 +82,7 @@ import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class ElkPath implements UDrawable {
@ -151,8 +151,8 @@ public class ElkPath implements UDrawable {
drawSections(ug, sections);
}
final UDrawable extremityFactory1 = getDecors(link.getType().getDecor1(), Math.PI / 2, HColorUtils.WHITE);
final UDrawable extremityFactory2 = getDecors(link.getType().getDecor2(), -Math.PI / 2, HColorUtils.WHITE);
final UDrawable extremityFactory1 = getDecors(link.getType().getDecor1(), Math.PI / 2, HColors.WHITE);
final UDrawable extremityFactory2 = getDecors(link.getType().getDecor2(), -Math.PI / 2, HColors.WHITE);
if (extremityFactory1 != null) {
final double x = sections.get(0).getEndX();

View File

@ -22,9 +22,9 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.ColorChangerMonochrome;
import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorSimple;
import net.sourceforge.plantuml.ugraphic.color.HColors;
// Emojji from https://twemoji.twitter.com/
// Shorcut from https://api.github.com/emojis
@ -129,7 +129,7 @@ public class SvgNanoParser implements Sprite {
final String strokeString = extractData("stroke", s);
if (strokeString == null)
return ugs;
ugs = ugs.apply(new HColorNone().bg());
ugs = ugs.apply(HColors.none().bg());
final HColor stroke = getTrueColor(strokeString, colorForMonochrome);
ugs = ugs.apply(stroke);
final String strokeWidth = extractData("stroke-width", s);

View File

@ -90,7 +90,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorSimple;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
import net.sourceforge.plantuml.ugraphic.txt.UGraphicTxt;
import net.sourceforge.plantuml.version.LicenseInfo;
import net.sourceforge.plantuml.version.PSystemVersion;
@ -147,16 +147,16 @@ public abstract class PSystemError extends PlainDiagram {
}
private TextBlockBackcolored getGraphicalFormatted() {
final FontConfiguration fc0 = GraphicStrings.sansSerif14(HColorUtils.BLACK).bold();
final FontConfiguration fc1 = GraphicStrings.sansSerif14(HColorUtils.MY_GREEN).bold();
final FontConfiguration fc2 = GraphicStrings.sansSerif14(HColorUtils.RED).bold();
final FontConfiguration fc4 = GraphicStrings.sansSerif12(HColorUtils.MY_GREEN).bold().italic();
final FontConfiguration fc0 = GraphicStrings.sansSerif14(HColors.BLACK).bold();
final FontConfiguration fc1 = GraphicStrings.sansSerif14(HColors.MY_GREEN).bold();
final FontConfiguration fc2 = GraphicStrings.sansSerif14(HColors.RED).bold();
final FontConfiguration fc4 = GraphicStrings.sansSerif12(HColors.MY_GREEN).bold().italic();
final List<String> fullBody = getTextFullBody();
final TextBlock result0 = TextBlockUtils.addBackcolor(
TextBlockUtils.withMargin(new TextBlockRaw(getTextFromStack(), fc0), 1, 1, 1, 4), HColorUtils.MY_GREEN);
TextBlockUtils.withMargin(new TextBlockRaw(getTextFromStack(), fc0), 1, 1, 1, 4), HColors.MY_GREEN);
final TextBlock result1 = new TextBlockRaw(allButLast(fullBody), fc1);
final TextBlock result2 = new TextBlockRaw(onlyLast(fullBody), fc1.wave(HColorUtils.RED));
final TextBlock result2 = new TextBlockRaw(onlyLast(fullBody), fc1.wave(HColors.RED));
final TextBlock result3 = new TextBlockRaw(getTextError(), fc2);
final TextBlock result4 = TextBlockUtils.withMargin(new TextBlockRaw(header(), fc4), 0, 2, 0, 8);
TextBlock result = result0;
@ -165,7 +165,7 @@ public abstract class PSystemError extends PlainDiagram {
result = TextBlockUtils.mergeTB(result, result3, HorizontalAlignment.LEFT);
result = TextBlockUtils.mergeTB(result4, result, HorizontalAlignment.LEFT);
result = TextBlockUtils.withMargin(result, 5, 5);
return TextBlockUtils.addBackcolor(result, HColorUtils.BLACK);
return TextBlockUtils.addBackcolor(result, HColors.BLACK);
}
private List<String> header() {
@ -353,7 +353,7 @@ public abstract class PSystemError extends PlainDiagram {
"Details on <i>[[https://plantuml.com/dedication]]");
final UFont font = UFont.sansSerif(14);
final FontConfiguration fc = FontConfiguration.create(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
final FontConfiguration fc = FontConfiguration.create(font, HColors.BLACK, HColors.BLACK, false);
final TextBlock text = TextBlockUtils
.withMargin(disp.create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()), 10, 0);
final TextBlock result;
@ -374,7 +374,7 @@ public abstract class PSystemError extends PlainDiagram {
"Details on <i>[[http://plantuml.com/adopt]]", " ");
final UFont font = UFont.sansSerif(14);
final FontConfiguration fc = FontConfiguration.create(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
final FontConfiguration fc = FontConfiguration.create(font, HColors.BLACK, HColors.BLACK, false);
final TextBlock text = TextBlockUtils
.withMargin(disp.create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()), 10, 0);
final TextBlock result;

View File

@ -52,7 +52,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class ActivityBox extends AbstractTextBlock {
@ -92,8 +92,8 @@ public class ActivityBox extends AbstractTextBlock {
final double widthTotal = dimTotal.getWidth();
final double heightTotal = dimTotal.getHeight();
final Shadowable rect = new URectangle(widthTotal, heightTotal).rounded(CORNER);
ug = ug.apply(HColorUtils.MY_RED);
ug = ug.apply(HColorUtils.MY_YELLOW.bg());
ug = ug.apply(HColors.MY_RED);
ug = ug.apply(HColors.MY_YELLOW.bg());
ug.apply(new UStroke(1.5)).draw(rect);
tb.drawU(ug.apply(new UTranslate(MARGIN, MARGIN)));

View File

@ -71,7 +71,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class FlowDiagram extends UmlDiagram implements TextBlock {
@ -157,8 +157,8 @@ public class FlowDiagram extends UmlDiagram implements TextBlock {
box.drawU(ug.apply(
new UTranslate((x + xmin * SINGLE_SIZE_X + deltaX / 2), (y + ymin * SINGLE_SIZE_Y + deltaY / 2))));
}
ug = ug.apply(HColorUtils.MY_RED);
ug = ug.apply(HColorUtils.MY_RED.bg());
ug = ug.apply(HColors.MY_RED);
ug = ug.apply(HColors.MY_RED.bg());
final UShape arrow = new UEllipse(7, 7);
for (Path p : field.getPaths()) {
final TileArea start = p.getStart();

View File

@ -53,7 +53,7 @@ import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class Tile extends AbstractTextBlock implements TextBlock {
@ -78,7 +78,7 @@ public class Tile extends AbstractTextBlock implements TextBlock {
}
public void drawU(UGraphic ug) {
ug = ug.apply(HColorUtils.BLACK);
ug = ug.apply(HColors.BLACK);
final TextBlock n = Display.create("" + num).create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty());
final Dimension2D dimNum = n.calculateDimension(ug.getStringBounder());
final Dimension2D dimTotal = calculateDimension(ug.getStringBounder());

View File

@ -51,7 +51,7 @@ import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class TilesField extends AbstractTextBlock implements TextBlock {
@ -250,7 +250,7 @@ public class TilesField extends AbstractTextBlock implements TextBlock {
final double yt = p.getYmin() * dimSingle.getHeight() / 2;
t.drawU(ug.apply(new UTranslate((x + xt), (y + yt))));
}
ug = ug.apply(HColorUtils.RED);
ug = ug.apply(HColors.RED);
for (Path p : paths) {
final TileArea start = p.getStart();
final TileArea dest = p.getDest();

View File

@ -43,7 +43,7 @@ import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorAutomatic;
import net.sourceforge.plantuml.ugraphic.color.HColorScheme;
public class CircledCharacter extends AbstractTextBlock implements TextBlock {
@ -61,8 +61,8 @@ public class CircledCharacter extends AbstractTextBlock implements TextBlock {
this.font = font;
this.spotBackColor = spotBackColor;
this.spotBorder = spotBorder;
if (fontColor instanceof HColorAutomatic)
this.fontColor = ((HColorAutomatic) fontColor).getAppropriateColor(spotBackColor);
if (fontColor instanceof HColorScheme)
this.fontColor = ((HColorScheme) fontColor).getAppropriateColor(spotBackColor);
else
this.fontColor = fontColor;
}

View File

@ -49,7 +49,7 @@ import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class FontConfiguration {
@ -82,7 +82,7 @@ public class FontConfiguration {
}
public static FontConfiguration blackBlueTrue(UFont font) {
return create(font, HColorUtils.BLACK.withDark(HColorUtils.WHITE), HColorUtils.BLUE, true, 8);
return create(font, HColors.BLACK.withDark(HColors.WHITE), HColors.BLUE, true, 8);
}
public static FontConfiguration create(ISkinParam skinParam, FontParam fontParam, Stereotype stereo) {

View File

@ -54,7 +54,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class GraphicStrings extends AbstractTextBlock implements IEntityImage {
@ -62,7 +62,7 @@ public class GraphicStrings extends AbstractTextBlock implements IEntityImage {
private final HColor background;
private final static HColor hyperlinkColor = HColorUtils.BLUE;
private final static HColor hyperlinkColor = HColors.BLUE;
private final static boolean useUnderlineForHyperlink = true;
@ -82,36 +82,36 @@ public class GraphicStrings extends AbstractTextBlock implements IEntityImage {
private static HColor getForeColor(boolean useRed) {
if (useRed) {
return HColorUtils.BLACK;
return HColors.BLACK;
}
return HColorUtils.MY_GREEN;
return HColors.MY_GREEN;
}
private static HColor getBackColor(boolean useRed) {
if (useRed) {
return HColorUtils.RED_LIGHT;
return HColors.RED_LIGHT;
}
return HColorUtils.BLACK;
return HColors.BLACK;
}
public static TextBlockBackcolored createGreenOnBlackMonospaced(List<String> strings) {
return new GraphicStrings(strings, monospaced14(HColorUtils.GREEN), HColorUtils.BLACK, null, null,
return new GraphicStrings(strings, monospaced14(HColors.GREEN), HColors.BLACK, null, null,
CreoleMode.SIMPLE_LINE);
}
public static TextBlockBackcolored createBlackOnWhite(List<String> strings) {
return new GraphicStrings(strings, sansSerif12(HColorUtils.BLACK), HColorUtils.WHITE, null, null,
return new GraphicStrings(strings, sansSerif12(HColors.BLACK), HColors.WHITE, null, null,
CreoleMode.FULL);
}
public static TextBlockBackcolored createBlackOnWhiteMonospaced(List<String> strings) {
return new GraphicStrings(strings, monospaced14(HColorUtils.BLACK), HColorUtils.WHITE, null, null,
return new GraphicStrings(strings, monospaced14(HColors.BLACK), HColors.WHITE, null, null,
CreoleMode.FULL);
}
public static TextBlockBackcolored createBlackOnWhite(List<String> strings, BufferedImage image,
GraphicPosition position) {
return new GraphicStrings(strings, sansSerif12(HColorUtils.BLACK), HColorUtils.WHITE, image, position,
return new GraphicStrings(strings, sansSerif12(HColors.BLACK), HColors.WHITE, image, position,
CreoleMode.FULL);
}

View File

@ -48,7 +48,7 @@ import net.sourceforge.plantuml.style.Value;
import net.sourceforge.plantuml.style.ValueNull;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException;
public class Rainbow {
@ -90,7 +90,7 @@ public class Rainbow {
else
colorHead = head.asColor(themeStyle, set);
if (colorHead == null)
colorHead = HColorUtils.transparent();
colorHead = HColors.transparent();
return fromColor(color, colorHead);
}

View File

@ -39,7 +39,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorBackground;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class SymbolContext {
@ -73,11 +73,11 @@ public class SymbolContext {
public UGraphic applyColors(UGraphic ug) {
if (foreColor == null)
ug = ug.apply(new HColorNone());
ug = ug.apply(HColors.none());
else
ug = ug.apply(foreColor);
if (backColor == null)
ug = ug.apply(new HColorNone().bg());
ug = ug.apply(HColors.none().bg());
else
ug = ug.apply(backColor.bg());

View File

@ -45,7 +45,7 @@ import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class TextBlockBordered extends AbstractTextBlock implements TextBlock {
@ -118,13 +118,13 @@ public class TextBlockBordered extends AbstractTextBlock implements TextBlock {
polygon.setDeltaShadow(4);
if (backgroundColor == null)
ug = ug.apply(new HColorNone().bg());
ug = ug.apply(HColors.none().bg());
else
ug = ug.apply(backgroundColor.bg());
HColor color = noBorder() ? backgroundColor : borderColor;
if (color == null)
color = new HColorNone();
color = HColors.none();
ug = ug.apply(color);
ug = applyStroke(ug);

View File

@ -44,7 +44,7 @@ import net.sourceforge.plantuml.svek.WithPorts;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UHorizontalLine;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class TextBlockLineBefore extends AbstractTextBlock implements TextBlock, WithPorts {
@ -84,7 +84,7 @@ public class TextBlockLineBefore extends AbstractTextBlock implements TextBlock,
textBlock.drawU(ug);
if (color == null)
ug = ug.apply(new HColorNone());
ug = ug.apply(HColors.none());
else
ug = ug.apply(color);

View File

@ -44,7 +44,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UHorizontalLine;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
class USymbolDatabase extends USymbol {
@ -68,7 +68,7 @@ class USymbolDatabase extends USymbol {
ug.draw(shape);
final UPath closing = getClosingPath(width);
ug.apply(new HColorNone().bg()).draw(closing);
ug.apply(HColors.none().bg()).draw(closing);
ug.apply(new UTranslate(width, height)).draw(new UEmpty(10, 10));
}
@ -99,9 +99,9 @@ class USymbolDatabase extends USymbol {
protected void drawHline(UGraphic ug, UHorizontalLine line, UTranslate translate) {
final UPath closing = getClosingPath(endingX);
ug = ug.apply(translate);
ug.apply(line.getStroke()).apply(new HColorNone().bg()).apply(UTranslate.dy(-15)).draw(closing);
ug.apply(line.getStroke()).apply(HColors.none().bg()).apply(UTranslate.dy(-15)).draw(closing);
if (line.isDouble()) {
ug.apply(line.getStroke()).apply(new HColorNone().bg()).apply(UTranslate.dy(-15 + 2)).draw(closing);
ug.apply(line.getStroke()).apply(HColors.none().bg()).apply(UTranslate.dy(-15 + 2)).draw(closing);
}
line.drawTitleInternal(ug, 0, endingX, 0, true);
}

View File

@ -44,7 +44,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
class USymbolFrame extends USymbol {
@ -80,7 +80,7 @@ class USymbolFrame extends USymbol {
polygon.lineTo(textWidth - cornersize, textHeight);
polygon.lineTo(0, textHeight);
ug.apply(new HColorNone().bg()).draw(polygon);
ug.apply(HColors.none().bg()).draw(polygon);
}

View File

@ -45,7 +45,7 @@ import net.sourceforge.plantuml.ugraphic.UHorizontalLine;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
class USymbolNode extends USymbol {
@ -112,7 +112,7 @@ class USymbolNode extends USymbol {
}
private void drawHlineInternal(UGraphic ug, UHorizontalLine line) {
ug = ug.apply(line.getStroke()).apply(new HColorNone().bg());
ug = ug.apply(line.getStroke()).apply(HColors.none().bg());
ug.draw(ULine.hline(endingX - 10));
ug.apply(UTranslate.dx(endingX - 10)).draw(new ULine(10, -10));
}

View File

@ -44,7 +44,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UHorizontalLine;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
class USymbolQueue extends USymbol {
@ -71,7 +71,7 @@ class USymbolQueue extends USymbol {
ug.draw(shape);
final UPath closing = getClosingPath(width, height);
ug.apply(new HColorNone().bg()).draw(closing);
ug.apply(HColors.none().bg()).draw(closing);
}

View File

@ -45,7 +45,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
class USymbolStack extends USymbol {
@ -58,7 +58,7 @@ class USymbolStack extends USymbol {
final double border = 15;
final URectangle rect = new URectangle(width - 2 * border, height).rounded(roundCorner);
ug.apply(new HColorNone()).apply(UTranslate.dx(border)).draw(rect);
ug.apply(HColors.none()).apply(UTranslate.dx(border)).draw(rect);
final UPath path = new UPath();
if (roundCorner == 0) {
@ -81,7 +81,7 @@ class USymbolStack extends USymbol {
path.lineTo(width, 0);
}
path.setDeltaShadow(shadowing);
ug.apply(new HColorNone().bg()).draw(path);
ug.apply(HColors.none().bg()).draw(path);
}
private Margin getMargin() {

View File

@ -54,7 +54,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.png.PngIO;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d;
public class PSystemLogo extends AbstractPSystem {
@ -73,7 +73,7 @@ public class PSystemLogo extends AbstractPSystem {
final StringBounder stringBounder = FileFormat.PNG.getDefaultStringBounder();
final EmptyImageBuilder builder = new EmptyImageBuilder(fileFormat.getWatermark(), width, height, Color.WHITE, stringBounder);
final BufferedImage im = builder.getBufferedImage();
final UGraphic ug = new UGraphicG2d(HColorUtils.WHITE, new ColorMapperIdentity(), stringBounder, builder.getGraphics2D(), 1.0);
final UGraphic ug = new UGraphicG2d(HColors.WHITE, new ColorMapperIdentity(), stringBounder, builder.getGraphics2D(), 1.0);
((UGraphicG2d) ug).setBufferedImage(im);
final TurtleGraphicsPane turtleGraphicsPane = new TurtleGraphicsPane(width, height);

View File

@ -53,7 +53,7 @@ import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
class TurtleGraphicsPane {
final private double width;
@ -63,7 +63,7 @@ class TurtleGraphicsPane {
private double turtleDirection = 90;
private boolean penIsDown = true;
private boolean showTurtle = true;
private HColor penColor = HColorUtils.BLACK;
private HColor penColor = HColors.BLACK;
private List<Rectangle2D.Double> lines = new ArrayList<Rectangle2D.Double>();
private List<HColor> colors = new ArrayList<>();

View File

@ -34,7 +34,6 @@
*/
package net.sourceforge.plantuml.nwdiag;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.io.OutputStream;
@ -51,6 +50,7 @@ import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.api.ThemeStyle;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;

View File

@ -39,7 +39,7 @@ import java.util.Set;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class VerticalLine implements UDrawable {
@ -54,7 +54,7 @@ public class VerticalLine implements UDrawable {
}
public void drawU(UGraphic ug) {
ug = ug.apply(new HColorNone().bg());
ug = ug.apply(HColors.none().bg());
boolean drawn = false;
double current = y1;
UPath path = new UPath();

View File

@ -53,7 +53,7 @@ import net.sourceforge.plantuml.openiconic.data.DummyIcon;
import net.sourceforge.plantuml.security.SFile;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorAutomaticLegacy;
import net.sourceforge.plantuml.ugraphic.color.HColorAutomagic;
import net.sourceforge.plantuml.ugraphic.color.HColorSimple;
public class OpenIcon {
@ -136,7 +136,7 @@ public class OpenIcon {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
HColor textColor = color;
if (textColor instanceof HColorAutomaticLegacy && ug.getParam().getBackcolor() != null) {
if (textColor instanceof HColorAutomagic && ug.getParam().getBackcolor() != null) {
textColor = ((HColorSimple) ug.getParam().getBackcolor()).opposite();
}
svgPath.drawMe(ug.apply(textColor), factor);

View File

@ -41,7 +41,7 @@ import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.UmlSource;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class PSystemOpenIconic extends PlainDiagram {
@ -59,7 +59,7 @@ public class PSystemOpenIconic extends PlainDiagram {
final OpenIcon icon = OpenIcon.retrieve(iconName);
// final Dimension2D dim = new Dimension2DDouble(100, 100);
return icon.asTextBlock(HColorUtils.BLACK, factor);
return icon.asTextBlock(HColors.BLACK, factor);
// UGraphic2 ug = fileFormat.createUGraphic(dim);
// ug = (UGraphic2) ug.apply(new UTranslate(10, 10));

View File

@ -115,7 +115,7 @@ import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprite {
@ -227,7 +227,7 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit
final HColor back = timelineStyle.value(PName.BackGroundColor)
.asColor(getSkinParam().getThemeStyle(), getIHtmlColorSet());
if (HColorUtils.isTransparent(back) == false) {
if (HColors.isTransparent(back) == false) {
final URectangle rect1 = new URectangle(calculateDimension(ug.getStringBounder()).getWidth(),
timeHeader.getTimeHeaderHeight());
ug.apply(back.bg()).draw(rect1);
@ -388,10 +388,17 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit
}
}
public void closeDayOfWeek(DayOfWeek day) {
public void closeDayOfWeek(DayOfWeek day, String task) {
openClose.close(day);
}
public void openDayOfWeek(DayOfWeek day, String task) {
if (task.length() == 0)
openClose.open(day);
else
getOpenCloseForTask(task).open(day);
}
public void closeDayAsDate(Day day, String task) {
if (task.length() == 0)
openClose.close(day);
@ -634,10 +641,24 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit
private TaskGroup currentGroup = null;
public void addGroup(String comment) {
TaskGroup group = new TaskGroup(getSkinParam().getCurrentStyleBuilder(), comment);
currentGroup = group;
public CommandExecutionResult addGroup(String name) {
TaskGroup group = new TaskGroup(this.currentGroup, getSkinParam().getCurrentStyleBuilder(), name);
if (this.currentGroup != null)
this.currentGroup.addTask(group);
this.currentGroup = group;
tasks.put(group.getCode(), group);
return CommandExecutionResult.ok();
}
public CommandExecutionResult endGroup() {
if (this.currentGroup == null)
return CommandExecutionResult.error("No group to be closed");
this.currentGroup = this.currentGroup.getParent();
return CommandExecutionResult.ok();
}
public void addContraint(GanttConstraint constraint) {
@ -771,7 +792,7 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit
}
public CommandExecutionResult deleteTask(Task task) {
task.setColors(new CenterBorderColor(HColorUtils.WHITE, HColorUtils.BLACK));
task.setColors(new CenterBorderColor(HColors.WHITE, HColors.BLACK));
return CommandExecutionResult.ok();
}

View File

@ -47,6 +47,7 @@ import net.sourceforge.plantuml.project.time.DayOfWeek;
public class OpenClose implements Histogram, LoadPlanable {
private final Collection<DayOfWeek> closedDayOfWeek = EnumSet.noneOf(DayOfWeek.class);
private final Collection<DayOfWeek> openedDayOfWeek = EnumSet.noneOf(DayOfWeek.class);
private final Collection<Day> closedDays = new HashSet<>();
private final Collection<Day> openedDays = new HashSet<>();
private Day startingDay;
@ -97,6 +98,11 @@ public class OpenClose implements Histogram, LoadPlanable {
closedDayOfWeek.add(day);
}
public void open(DayOfWeek day) {
closedDayOfWeek.remove(day);
openedDayOfWeek.add(day);
}
public void close(Day day) {
closedDays.add(day);
}
@ -178,6 +184,8 @@ public class OpenClose implements Histogram, LoadPlanable {
return 100;
if (except.closedDays.contains(instant))
return 0;
if (except.openedDayOfWeek.size() > 0 && except.openedDayOfWeek.contains(instant.getDayOfWeek()))
return 100;
return OpenClose.this.getLoadAt(instant);
}
};

View File

@ -62,7 +62,7 @@ public class CommandGroupEnd extends SingleLineCommand2<GanttDiagram> {
@Override
protected CommandExecutionResult executeArg(GanttDiagram diagram, LineLocation location, RegexResult arg) {
return CommandExecutionResult.ok();
return diagram.endGroup();
}
}

View File

@ -64,8 +64,7 @@ public class CommandGroupStart extends SingleLineCommand2<GanttDiagram> {
@Override
protected CommandExecutionResult executeArg(GanttDiagram diagram, LineLocation location, RegexResult arg) {
final String name = arg.get("NAME", 0);
diagram.addGroup(name);
return CommandExecutionResult.ok();
return diagram.addGroup(name);
}
}

View File

@ -48,10 +48,12 @@ import net.sourceforge.plantuml.style.StyleBuilder;
public class TaskGroup extends AbstractTask implements Task {
private final TaskGroup parent;
private final List<Task> children = new ArrayList<>();
public TaskGroup(StyleBuilder styleBuilder, String comment) {
super(styleBuilder, new TaskCode(comment));
public TaskGroup(TaskGroup parent, StyleBuilder styleBuilder, String name) {
super(styleBuilder, new TaskCode(name));
this.parent = parent;
}
public Day getStart() {
@ -133,4 +135,8 @@ public class TaskGroup extends AbstractTask implements Task {
children.add(child);
}
public final TaskGroup getParent() {
return parent;
}
}

View File

@ -56,7 +56,7 @@ import net.sourceforge.plantuml.style.StyleBuilder;
import net.sourceforge.plantuml.style.StyleSignatureBasic;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public abstract class AbstractTaskDraw implements TaskDraw {
@ -107,7 +107,7 @@ public abstract class AbstractTaskDraw implements TaskDraw {
.asColor(getStyleBuilder().getSkinParam().getThemeStyle(), getColorSet());
final HColor regular = getStyle().value(PName.LineColor)
.asColor(getStyleBuilder().getSkinParam().getThemeStyle(), getColorSet());
return HColorUtils.unlinear(unstarted, regular, completion);
return HColors.unlinear(unstarted, regular, completion);
}
final protected HColor getBackgroundColor() {
@ -115,7 +115,7 @@ public abstract class AbstractTaskDraw implements TaskDraw {
.asColor(getStyleBuilder().getSkinParam().getThemeStyle(), getColorSet());
final HColor regular = getStyle().value(PName.BackGroundColor)
.asColor(getStyleBuilder().getSkinParam().getThemeStyle(), getColorSet());
return HColorUtils.unlinear(unstarted, regular, completion);
return HColors.unlinear(unstarted, regular, completion);
}
final protected FontConfiguration getFontConfiguration() {

View File

@ -47,7 +47,7 @@ import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class RectangleTask {
@ -113,11 +113,11 @@ public class RectangleTask {
ug.apply(UTranslate.dx(segment.getPos1())).draw(partial);
} else {
final double x1 = width * completion / 100;
ug.apply(new HColorNone()).apply(UTranslate.dx(segment.getPos1()))
ug.apply(HColors.none()).apply(UTranslate.dx(segment.getPos1()))
.draw(PathUtils.UtoLeft(x1, height, round));
ug.apply(documentBackground.bg()).apply(new HColorNone()).apply(UTranslate.dx(segment.getPos1() + x1))
ug.apply(documentBackground.bg()).apply(HColors.none()).apply(UTranslate.dx(segment.getPos1() + x1))
.draw(PathUtils.UtoRight(width * (100 - completion) / 100, height, round));
ug.apply(new HColorNone().bg()).apply(UTranslate.dx(segment.getPos1())).draw(partial);
ug.apply(HColors.none().bg()).apply(UTranslate.dx(segment.getPos1())).draw(partial);
}
}
@ -197,7 +197,7 @@ public class RectangleTask {
width++;
}
if (width > 0) {
drawRect(widthCompletion, ug.apply(new HColorNone()).apply(UTranslate.dx(segment.getPos1())),
drawRect(widthCompletion, ug.apply(HColors.none()).apply(UTranslate.dx(segment.getPos1())),
documentBackground, width, height);
}

View File

@ -50,7 +50,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class ResourceDraw implements UDrawable {
@ -75,7 +75,7 @@ public class ResourceDraw implements UDrawable {
HorizontalAlignment.LEFT, new SpriteContainerEmpty());
title.drawU(ug);
final ULine line = ULine.hline(timeScale.getEndingPosition(max) - timeScale.getStartingPosition(min));
ug.apply(HColorUtils.BLACK).apply(UTranslate.dy(title.calculateDimension(ug.getStringBounder()).getHeight()))
ug.apply(HColors.BLACK).apply(UTranslate.dy(title.calculateDimension(ug.getStringBounder()).getHeight()))
.draw(line);
double startingPosition = -1;
@ -89,7 +89,7 @@ public class ResourceDraw implements UDrawable {
if (totalLoad > 0) {
final boolean over = totalLoad > totalLimit;
final FontConfiguration fontConfiguration = getFontConfiguration(9,
over ? HColorUtils.RED : HColorUtils.BLACK);
over ? HColors.RED : HColors.BLACK);
final TextBlock value = Display.getWithNewlines("" + totalLoad).create(fontConfiguration,
HorizontalAlignment.LEFT, new SpriteContainerEmpty());
if (startingPosition == -1)
@ -111,7 +111,7 @@ public class ResourceDraw implements UDrawable {
}
private FontConfiguration getFontConfiguration(int size) {
return getFontConfiguration(size, HColorUtils.BLACK);
return getFontConfiguration(size, HColors.BLACK);
}
private FontConfiguration getFontConfiguration(int size, HColor color) {

View File

@ -57,10 +57,8 @@ import net.sourceforge.plantuml.style.StyleBuilder;
import net.sourceforge.plantuml.style.StyleSignatureBasic;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class TaskDrawGroup extends AbstractTaskDraw {
@ -79,7 +77,17 @@ public class TaskDrawGroup extends AbstractTaskDraw {
protected double getShapeHeight(StringBounder stringBounder) {
final Style style = getStyle();
final ClockwiseTopRightBottomLeft padding = style.getPadding();
return padding.getTop() + getTitle().calculateDimension(stringBounder).getHeight() + padding.getBottom() + 8;
// return padding.getTop() +
// getTitle().calculateDimension(stringBounder).getHeight() +
// padding.getBottom() + 8;
final double pos1 = timeScale.getStartingPosition(start) + 6;
final double pos2 = timeScale.getEndingPosition(end) - 6;
final TextBlock title = getTitle();
final Dimension2D dim = title.calculateDimension(stringBounder);
if (pos2 - pos1 > dim.getWidth())
return dim.getHeight() + 2;
else
return dim.getHeight();
}
@Override
@ -92,27 +100,19 @@ public class TaskDrawGroup extends AbstractTaskDraw {
final ClockwiseTopRightBottomLeft margin = style.getMargin();
final ClockwiseTopRightBottomLeft padding = style.getPadding();
ug = ug.apply(UTranslate.dy(margin.getTop() + padding.getTop()));
// if (labelStrategy.titleInFirstColumn()) {
// if (labelStrategy.rightAligned())
// title.drawU(ug.apply(UTranslate.dx(colTitles - dim.getWidth() - margin.getRight())));
// else
// title.drawU(ug.apply(UTranslate.dx(margin.getLeft())));
// return;
// } else if (labelStrategy.titleInLastColumn()) {
// title.drawU(ug.apply(UTranslate.dx(colBars + margin.getLeft())));
// return;
// }
//
final double pos1 = timeScale.getStartingPosition(start) + 6;
final double pos2 = timeScale.getEndingPosition(end) - 6;
final double pos;
if (pos2 - pos1 > dim.getWidth())
final double y;
if (pos2 - pos1 > dim.getWidth()) {
pos = pos1 + (pos2 - pos1 - dim.getWidth()) / 2;
else
pos = pos2 + 3;
title.drawU(ug.apply(UTranslate.dx(pos)));
// y = margin.getTop() + padding.getTop();
y = 0;
} else {
pos = pos2 + 6;
y = (getFullHeightTask(stringBounder) - dim.getHeight());
}
title.drawU(ug.apply(new UTranslate(pos, y)));
}
@Override
@ -127,7 +127,7 @@ public class TaskDrawGroup extends AbstractTaskDraw {
}
public void drawU(UGraphic ug) {
final double startPos = timeScale.getStartingPosition(start);
// final double startPos = timeScale.getStartingPosition(start);
ug = applyColors(ug);
drawShape(ug);
}
@ -183,9 +183,9 @@ public class TaskDrawGroup extends AbstractTaskDraw {
ug.startUrl(url);
// ug = ug.apply(UTranslate.dy(margin.getTop() + 7));
ug = ug.apply(UTranslate.dy(getShapeHeight(ug.getStringBounder()) - 10));
ug = ug.apply(UTranslate.dy(getFullHeightTask(ug.getStringBounder()) - height));
ug = ug.apply(HColorUtils.BLACK).apply(HColorUtils.BLACK.bg());
ug = ug.apply(HColors.BLACK).apply(HColors.BLACK.bg());
ug.draw(getShape(startPos, endPos));
if (url != null)
@ -193,10 +193,11 @@ public class TaskDrawGroup extends AbstractTaskDraw {
}
final private double height = 10;
private UPath getShape(final double startPos, final double endPos) {
final UPath rect = new UPath();
final double height = 10;
final double thick = 2;
final double y1 = (height - thick) / 2;
final double y2 = height - (height - thick) / 2;

View File

@ -63,7 +63,7 @@ import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class TaskDrawSeparator implements TaskDraw {
@ -142,7 +142,7 @@ public class TaskDrawSeparator implements TaskDraw {
final HColor backColor = getStyle().value(PName.BackGroundColor)
.asColor(styleBuilder.getSkinParam().getThemeStyle(), colorSet);
if (HColorUtils.isTransparent(backColor) == false) {
if (HColors.isTransparent(backColor) == false) {
final double height = padding.getTop() + getTextHeight(stringBounder) + padding.getBottom();
if (height > 0) {
final URectangle rect = new URectangle(end - start, height);

View File

@ -54,9 +54,8 @@ import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public abstract class TimeHeader {
@ -173,13 +172,13 @@ public abstract class TimeHeader {
if (height == 0)
return;
ug = ug.apply(new HColorNone());
ug = ug.apply(HColors.none());
ug = ug.apply(new UTranslate(x1, getFullHeaderHeight()));
ug.draw(new URectangle(x2 - x1, height));
}
protected final UGraphic goBold(UGraphic ug) {
return ug.apply(HColorUtils.BLACK).apply(new UStroke(2));
return ug.apply(HColors.BLACK).apply(new UStroke(2));
}

View File

@ -37,7 +37,7 @@ package net.sourceforge.plantuml.project.lang;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class CenterBorderColor {
@ -81,8 +81,8 @@ public class CenterBorderColor {
}
public CenterBorderColor unlinearTo(CenterBorderColor other, int completion) {
final HColor newCenter = HColorUtils.unlinear(this.center, other.center, completion);
final HColor newBorder = HColorUtils.unlinear(this.border, other.border, completion);
final HColor newCenter = HColors.unlinear(this.center, other.center, completion);
final HColor newBorder = HColors.unlinear(this.border, other.border, completion);
return new CenterBorderColor(newCenter, newBorder, style);
}

View File

@ -59,7 +59,20 @@ public class SubjectDayOfWeek implements Subject {
}
public Collection<? extends SentenceSimple> getSentences() {
return Arrays.asList(new AreClose(), new InColor());
return Arrays.asList(new AreClose(), new AreOpen(), new InColor());
}
class AreOpen extends SentenceSimple {
public AreOpen() {
super(SubjectDayOfWeek.this, Verbs.are(), new ComplementOpen());
}
@Override
public CommandExecutionResult execute(GanttDiagram project, Object subject, Object complement) {
final DayOfWeek day = (DayOfWeek) subject;
project.openDayOfWeek(day, (String) complement);
return CommandExecutionResult.ok();
}
}
class AreClose extends SentenceSimple {
@ -71,7 +84,7 @@ public class SubjectDayOfWeek implements Subject {
@Override
public CommandExecutionResult execute(GanttDiagram project, Object subject, Object complement) {
final DayOfWeek day = (DayOfWeek) subject;
project.closeDayOfWeek(day);
project.closeDayOfWeek(day, (String) complement);
return CommandExecutionResult.ok();
}

View File

@ -90,7 +90,7 @@ import net.sourceforge.plantuml.svek.TextBlockBackcolored;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException;
public class PSystemSalt extends TitledDiagram implements WithSprite {
@ -261,6 +261,6 @@ public class PSystemSalt extends TitledDiagram implements WithSprite {
}
private HColor getBlack() {
return HColorUtils.BLACK;
return HColors.BLACK;
}
}

View File

@ -40,12 +40,12 @@ import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorSimple;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public abstract class AbstractElement implements Element {
final protected HColor getBlack() {
return HColorUtils.BLACK.withDark(HColorUtils.WHITE);
return HColors.BLACK.withDark(HColors.WHITE);
}
final protected HColor getColor88() {
@ -69,7 +69,7 @@ public abstract class AbstractElement implements Element {
}
final protected HColor getWhite() {
return HColorUtils.WHITE.withDark(HColorUtils.BLACK);
return HColors.WHITE.withDark(HColors.BLACK);
}
private HColor buildColor(String color1, String color2) {

View File

@ -52,7 +52,7 @@ import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class ElementDroplist extends AbstractElementText implements Element {
@ -106,7 +106,7 @@ public class ElementDroplist extends AbstractElementText implements Element {
final Dimension2D dimText = getPureTextDimension(ug.getStringBounder());
poly.addPoint((box - 6) / 2, dimText.getHeight() - 8);
ug.apply(HColorUtils.changeBack(ug)).apply(new UTranslate(xline + 3, 6)).draw(poly);
ug.apply(HColors.changeBack(ug)).apply(new UTranslate(xline + 3, 6)).draw(poly);
}
if (openDrop != null) {

View File

@ -52,7 +52,7 @@ import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class ElementRadioCheckbox extends AbstractElement {
@ -104,7 +104,7 @@ public class ElementRadioCheckbox extends AbstractElement {
poly.addPoint(3, 3);
poly.addPoint(10, -6);
poly.addPoint(3, 1);
ug = ug.apply(HColorUtils.changeBack(ug));
ug = ug.apply(HColors.changeBack(ug));
ug = ug.apply(new UTranslate(3, 6));
ug.draw(poly);
}
@ -113,7 +113,7 @@ public class ElementRadioCheckbox extends AbstractElement {
private void drawRadio(UGraphic ug, final double height) {
ug.apply(new UTranslate(2, (height - ELLIPSE) / 2)).draw(new UEllipse(ELLIPSE, ELLIPSE));
if (checked) {
ug = ug.apply(HColorUtils.changeBack(ug));
ug = ug.apply(HColors.changeBack(ug));
ug = ug.apply(new UTranslate(2 + (ELLIPSE - ELLIPSE2) / 2, (height - ELLIPSE2) / 2));
ug.draw(new UEllipse(ELLIPSE2, ELLIPSE2));
}

View File

@ -62,8 +62,7 @@ import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
import smetana.core.Macro;
public class SmetanaPath implements UDrawable {
@ -181,7 +180,7 @@ public class SmetanaPath implements UDrawable {
}
private void printDebug(UGraphic ug) {
ug = ug.apply(HColorUtils.BLUE).apply(HColorUtils.BLUE.bg());
ug = ug.apply(HColors.BLUE).apply(HColors.BLUE.bg());
final ST_splines splines = getSplines(edge);
final ST_bezier beziers = splines.list.get__(0);
for (int i = 0; i < beziers.size; i++) {
@ -192,7 +191,7 @@ public class SmetanaPath implements UDrawable {
ug.apply(new UTranslate(pt).compose(new UTranslate(-1, -1))).draw(new UEllipse(3, 3));
}
if (getLabelRectangleTranslate("label") != null && getLabelURectangle() != null) {
ug = ug.apply(HColorUtils.BLUE).apply(new HColorNone().bg());
ug = ug.apply(HColors.BLUE).apply(HColors.none().bg());
ug.apply(getLabelRectangleTranslate("label")).draw(getLabelURectangle());
}

View File

@ -51,7 +51,7 @@ import net.sourceforge.plantuml.ugraphic.UClip;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class PlayingSpaceWithParticipants extends AbstractTextBlock implements TextBlock {
@ -130,7 +130,7 @@ public class PlayingSpaceWithParticipants extends AbstractTextBlock implements T
}
private void drawNewPages(UGraphic ug) {
ug = ug.apply(HColorUtils.BLUE);
ug = ug.apply(HColors.BLUE);
for (Double change : yNewPages()) {
if (change == 0 || change == Double.MAX_VALUE) {
continue;

View File

@ -35,9 +35,8 @@
*/
package net.sourceforge.plantuml.skin;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignatureBasic;

View File

@ -35,9 +35,8 @@
*/
package net.sourceforge.plantuml.skin;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;

View File

@ -35,9 +35,8 @@
*/
package net.sourceforge.plantuml.skin;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;

View File

@ -35,10 +35,10 @@
*/
package net.sourceforge.plantuml.skin;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
@ -48,7 +48,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class ActorStickMan extends AbstractTextBlock implements TextBlock {
@ -93,7 +93,7 @@ public class ActorStickMan extends AbstractTextBlock implements TextBlock {
if (actorBusiness) {
specialBusiness(ug.apply(new UTranslate(startX + headDiam / 2, thickness() + headDiam / 2)));
}
ug.apply(new UTranslate(centerX, headDiam + thickness())).apply(new HColorNone().bg()).draw(path);
ug.apply(new UTranslate(centerX, headDiam + thickness())).apply(HColors.none().bg()).draw(path);
}
private void specialBusiness(UGraphic ug) {

View File

@ -35,9 +35,8 @@
*/
package net.sourceforge.plantuml.skin;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
public class Area {

View File

@ -35,9 +35,9 @@
*/
package net.sourceforge.plantuml.skin;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder;
public interface ArrowComponent extends Component {

View File

@ -36,7 +36,6 @@
package net.sourceforge.plantuml.skin;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.WithStyle;
import net.sourceforge.plantuml.ugraphic.UGraphic;

View File

@ -35,9 +35,8 @@
*/
package net.sourceforge.plantuml.skin;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@ -45,7 +44,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class Padder {
@ -119,12 +118,12 @@ public class Padder {
ug = ug.apply(new UTranslate(margin, margin));
UGraphic ug2 = ug;
if (borderColor == null) {
ug2 = ug2.apply(new HColorNone());
ug2 = ug2.apply(HColors.none());
} else {
ug2 = ug2.apply(borderColor);
}
if (backgroundColor == null) {
ug2 = ug2.apply(new HColorNone().bg());
ug2 = ug2.apply(HColors.none().bg());
} else {
ug2 = ug2.apply(backgroundColor.bg());
}

View File

@ -35,12 +35,12 @@
*/
package net.sourceforge.plantuml.skin;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
@ -54,7 +54,7 @@ import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public enum VisibilityModifier {
PRIVATE_FIELD(StringUtils.PRIVATE_FIELD, ColorParam.iconPrivate, null),
@ -108,7 +108,7 @@ public enum VisibilityModifier {
public void drawU(UGraphic ug) {
if (withInvisibleRectanble)
ug.apply(new HColorNone()).draw(new URectangle(size * 2, size));
ug.apply(HColors.none()).draw(new URectangle(size * 2, size));
drawInternal(ug, size, foregroundColor, backgoundColor, 0, 0);
}
@ -118,7 +118,7 @@ public enum VisibilityModifier {
private void drawInternal(UGraphic ug, int size, final HColor foregroundColor, final HColor backgoundColor,
double x, double y) {
if (backgoundColor == null)
ug = ug.apply(new HColorNone().bg());
ug = ug.apply(HColors.none().bg());
else
ug = ug.apply(backgoundColor.bg());

View File

@ -53,8 +53,7 @@ import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorBackground;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class ComponentRoseGroupingElse extends AbstractTextualComponent {
@ -76,11 +75,11 @@ public class ComponentRoseGroupingElse extends AbstractTextualComponent {
if (backgroundColor instanceof HColorBackground)
return;
if (HColorUtils.isTransparent(backgroundColor))
if (HColors.isTransparent(backgroundColor))
return;
final Dimension2D dimensionToUse = area.getDimensionToUse();
ug = ug.apply(new HColorNone()).apply(backgroundColor.bg());
ug = ug.apply(HColors.none()).apply(backgroundColor.bg());
final double width = dimensionToUse.getWidth();
final double height = dimensionToUse.getHeight();
final UShape rect;

View File

@ -59,7 +59,7 @@ import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.ugraphic.color.HColors;
public class ListSpriteDiagram extends UmlDiagram {
@ -94,7 +94,7 @@ public class ListSpriteDiagram extends UmlDiagram {
final Sprite sprite = getSkinParam().getSprite(n);
TextBlock blockName = Display.create(n).create(FontConfiguration.blackBlueTrue(UFont.sansSerif(14)),
HorizontalAlignment.LEFT, getSkinParam());
TextBlock tb = sprite.asTextBlock(HColorUtils.BLACK, 1.0, getSkinParam().getColorMapper());
TextBlock tb = sprite.asTextBlock(HColors.BLACK, 1.0, getSkinParam().getColorMapper());
tb = TextBlockUtils.mergeTB(tb, blockName, HorizontalAlignment.CENTER);
tb.drawU(ug.apply(new UTranslate(x, y)));
final Dimension2D dim = tb.calculateDimension(ug.getStringBounder());

Some files were not shown because too many files have changed in this diff Show More