diff --git a/pom.xml b/pom.xml
index dfa4ca19a..fd82e8e7a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,7 @@
net.sourceforge.plantuml
plantuml
- 1.2020.3-SNAPSHOT
+ 1.2020.4-SNAPSHOT
jar
PlantUML
diff --git a/src/net/sourceforge/plantuml/AnnotatedWorker.java b/src/net/sourceforge/plantuml/AnnotatedWorker.java
index 7f7996a1b..5c86cc8f7 100644
--- a/src/net/sourceforge/plantuml/AnnotatedWorker.java
+++ b/src/net/sourceforge/plantuml/AnnotatedWorker.java
@@ -44,8 +44,6 @@ import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.cucadiagram.DisplaySection;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
@@ -60,6 +58,8 @@ import net.sourceforge.plantuml.svek.TextBlockBackcolored;
import net.sourceforge.plantuml.ugraphic.MinMax;
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.HColorUtils;
public class AnnotatedWorker {
@@ -97,7 +97,7 @@ public class AnnotatedWorker {
final double y1 = 10;
final double y2 = 10;
- final SymbolContext symbolContext = new SymbolContext(getSkinParam().getBackgroundColor(), HtmlColorUtils.BLACK)
+ final SymbolContext symbolContext = new SymbolContext(getSkinParam().getBackgroundColor(), HColorUtils.BLACK)
.withShadow(getSkinParam().shadowing(null) ? 3 : 0);
final MinMax originalMinMax = TextBlockUtils.getMinMax(original, stringBounder);
final TextBlock title = mainFrame.create(new FontConfiguration(getSkinParam(), FontParam.CAPTION, null),
@@ -112,7 +112,7 @@ public class AnnotatedWorker {
return new TextBlockBackcolored() {
public void drawU(UGraphic ug) {
- frame.drawU(ug.apply(new UTranslate(originalMinMax.getMinX(), 0)));
+ frame.drawU(ug.apply(UTranslate.dx(originalMinMax.getMinX())));
original.drawU(ug.apply(new UTranslate(x1, y1 + dimTitle.getHeight())));
// original.drawU(ug);
}
@@ -131,7 +131,7 @@ public class AnnotatedWorker {
return original.calculateDimension(stringBounder);
}
- public HtmlColor getBackcolor() {
+ public HColor getBackcolor() {
return symbolContext.getBackColor();
}
};
diff --git a/src/net/sourceforge/plantuml/BlockUml.java b/src/net/sourceforge/plantuml/BlockUml.java
index 4d49c9c7f..d4547ef68 100644
--- a/src/net/sourceforge/plantuml/BlockUml.java
+++ b/src/net/sourceforge/plantuml/BlockUml.java
@@ -40,7 +40,9 @@ import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import net.sourceforge.plantuml.code.AsciiEncoder;
import net.sourceforge.plantuml.code.Transcoder;
@@ -49,6 +51,7 @@ import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.error.PSystemErrorPreprocessor;
import net.sourceforge.plantuml.preproc.Defines;
+import net.sourceforge.plantuml.preproc.FileWithSuffix;
import net.sourceforge.plantuml.preproc2.PreprocessorModeSet;
import net.sourceforge.plantuml.tim.TimLoader;
import net.sourceforge.plantuml.utils.StartUtils;
@@ -61,6 +64,11 @@ public class BlockUml {
private Diagram system;
private final Defines localDefines;
private final ISkinSimple skinParam;
+ private final Set included = new HashSet();
+
+ public Set getIncluded() {
+ return Collections.unmodifiableSet(included);
+ }
BlockUml(String... strings) {
this(convert(strings), Defines.createEmpty(), null, null);
@@ -111,7 +119,7 @@ public class BlockUml {
} else {
final TimLoader timLoader = new TimLoader(mode.getImportedFiles(), defines, mode.getCharset(),
(DefinitionsContainer) mode);
- timLoader.load(strings);
+ this.included.addAll(timLoader.load(strings));
this.data = timLoader.getResultList();
this.debug = timLoader.getDebug();
this.preprocessorError = timLoader.isPreprocessorError();
diff --git a/src/net/sourceforge/plantuml/BlockUmlBuilder.java b/src/net/sourceforge/plantuml/BlockUmlBuilder.java
index 92319e1ca..b103ea1bc 100644
--- a/src/net/sourceforge/plantuml/BlockUmlBuilder.java
+++ b/src/net/sourceforge/plantuml/BlockUmlBuilder.java
@@ -75,7 +75,7 @@ public final class BlockUmlBuilder implements DefinitionsContainer {
} finally {
if (includer != null) {
includer.close();
- usedFiles = includer.getFilesUsed();
+ // usedFiles = includer.getFilesUsedTOBEREMOVED();
}
readerInit.close();
}
@@ -120,7 +120,9 @@ public final class BlockUmlBuilder implements DefinitionsContainer {
if (paused) {
current2.add(s);
}
- blocks.add(new BlockUml(current2, defines.cloneMe(), null, this));
+ final BlockUml uml = new BlockUml(current2, defines.cloneMe(), null, this);
+ usedFiles.addAll(uml.getIncluded());
+ blocks.add(uml);
current2 = null;
reader.setPaused(false);
}
diff --git a/src/net/sourceforge/plantuml/ColorParam.java b/src/net/sourceforge/plantuml/ColorParam.java
index b1b8b0b9c..36c5ddacb 100644
--- a/src/net/sourceforge/plantuml/ColorParam.java
+++ b/src/net/sourceforge/plantuml/ColorParam.java
@@ -35,164 +35,164 @@
*/
package net.sourceforge.plantuml;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.color.ColorType;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public enum ColorParam {
- background(HtmlColorUtils.WHITE, true, ColorType.BACK),
- hyperlink(HtmlColorUtils.BLUE),
+ background(HColorUtils.WHITE, true, ColorType.BACK),
+ hyperlink(HColorUtils.BLUE),
- activityDiamondBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- activityDiamondBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- activityBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- activityBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- activityStart(HtmlColorUtils.BLACK),
- activityEnd(HtmlColorUtils.BLACK),
- activityBar(HtmlColorUtils.BLACK),
- swimlaneBorder(HtmlColorUtils.BLACK),
+ activityDiamondBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ activityDiamondBorder(HColorUtils.MY_RED, ColorType.LINE),
+ activityBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ activityBorder(HColorUtils.MY_RED, ColorType.LINE),
+ activityStart(HColorUtils.BLACK),
+ activityEnd(HColorUtils.BLACK),
+ activityBar(HColorUtils.BLACK),
+ swimlaneBorder(HColorUtils.BLACK),
swimlaneTitleBackground(null),
- usecaseBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- usecaseBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
+ usecaseBorder(HColorUtils.MY_RED, ColorType.LINE),
+ usecaseBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
- objectBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- objectBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ objectBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ objectBorder(HColorUtils.MY_RED, ColorType.LINE),
classHeaderBackground(null, true, ColorType.BACK),
- classBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- enumBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- classBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- stereotypeCBackground(HtmlColorUtils.COL_ADD1B2),
- stereotypeNBackground(HtmlColorUtils.COL_E3664A),
- stereotypeABackground(HtmlColorUtils.COL_A9DCDF),
- stereotypeIBackground(HtmlColorUtils.COL_B4A7E5),
- stereotypeEBackground(HtmlColorUtils.COL_EB937F),
+ classBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ enumBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ classBorder(HColorUtils.MY_RED, ColorType.LINE),
+ stereotypeCBackground(HColorUtils.COL_ADD1B2),
+ stereotypeNBackground(HColorUtils.COL_E3664A),
+ stereotypeABackground(HColorUtils.COL_A9DCDF),
+ stereotypeIBackground(HColorUtils.COL_B4A7E5),
+ stereotypeEBackground(HColorUtils.COL_EB937F),
stereotypeCBorder(null),
stereotypeNBorder(null),
stereotypeABorder(null),
stereotypeIBorder(null),
stereotypeEBorder(null),
- packageBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- packageBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ packageBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ packageBorder(HColorUtils.BLACK, ColorType.LINE),
- partitionBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- partitionBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ partitionBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ partitionBorder(HColorUtils.BLACK, ColorType.LINE),
- componentBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- componentBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- interfaceBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- interfaceBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- arrow(HtmlColorUtils.MY_RED, ColorType.ARROW),
+ componentBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ componentBorder(HColorUtils.MY_RED, ColorType.LINE),
+ interfaceBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ interfaceBorder(HColorUtils.MY_RED, ColorType.LINE),
+ arrow(HColorUtils.MY_RED, ColorType.ARROW),
- stateBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- stateBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- stateStart(HtmlColorUtils.BLACK),
- stateEnd(HtmlColorUtils.BLACK),
+ stateBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ stateBorder(HColorUtils.MY_RED, ColorType.LINE),
+ stateStart(HColorUtils.BLACK),
+ stateEnd(HColorUtils.BLACK),
- noteBackground(HtmlColorUtils.COL_FBFB77, true, ColorType.BACK),
- noteBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ noteBackground(HColorUtils.COL_FBFB77, true, ColorType.BACK),
+ noteBorder(HColorUtils.MY_RED, ColorType.LINE),
- legendBackground(HtmlColorUtils.COL_DDDDDD, true, ColorType.BACK),
- legendBorder(HtmlColorUtils.BLACK, ColorType.LINE),
+ legendBackground(HColorUtils.COL_DDDDDD, true, ColorType.BACK),
+ legendBorder(HColorUtils.BLACK, ColorType.LINE),
titleBackground(null, true, ColorType.BACK),
titleBorder(null, ColorType.LINE),
diagramBorder(null, ColorType.LINE),
- actorBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- actorBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- participantBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- participantBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- sequenceGroupBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- sequenceGroupBackground(HtmlColorUtils.COL_EEEEEE, true, ColorType.BACK),
- sequenceGroupBodyBackground(HtmlColorUtils.RED, true, ColorType.BACK),
- sequenceReferenceBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- sequenceReferenceHeaderBackground(HtmlColorUtils.COL_EEEEEE, true, ColorType.BACK),
- sequenceReferenceBackground(HtmlColorUtils.WHITE, true, ColorType.BACK),
- sequenceDividerBackground(HtmlColorUtils.COL_EEEEEE, true, ColorType.BACK),
- sequenceDividerBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- sequenceLifeLineBackground(HtmlColorUtils.WHITE, true, ColorType.BACK),
- sequenceLifeLineBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- sequenceNewpageSeparator(HtmlColorUtils.BLACK, ColorType.LINE),
- sequenceBoxBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- sequenceBoxBackground(HtmlColorUtils.COL_DDDDDD, true, ColorType.BACK),
+ actorBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ actorBorder(HColorUtils.MY_RED, ColorType.LINE),
+ participantBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ participantBorder(HColorUtils.MY_RED, ColorType.LINE),
+ sequenceGroupBorder(HColorUtils.BLACK, ColorType.LINE),
+ sequenceGroupBackground(HColorUtils.COL_EEEEEE, true, ColorType.BACK),
+ sequenceGroupBodyBackground(HColorUtils.RED, true, ColorType.BACK),
+ sequenceReferenceBorder(HColorUtils.BLACK, ColorType.LINE),
+ sequenceReferenceHeaderBackground(HColorUtils.COL_EEEEEE, true, ColorType.BACK),
+ sequenceReferenceBackground(HColorUtils.WHITE, true, ColorType.BACK),
+ sequenceDividerBackground(HColorUtils.COL_EEEEEE, true, ColorType.BACK),
+ sequenceDividerBorder(HColorUtils.BLACK, ColorType.LINE),
+ sequenceLifeLineBackground(HColorUtils.WHITE, true, ColorType.BACK),
+ sequenceLifeLineBorder(HColorUtils.MY_RED, ColorType.LINE),
+ sequenceNewpageSeparator(HColorUtils.BLACK, ColorType.LINE),
+ sequenceBoxBorder(HColorUtils.MY_RED, ColorType.LINE),
+ sequenceBoxBackground(HColorUtils.COL_DDDDDD, true, ColorType.BACK),
- artifactBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- artifactBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- cloudBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- cloudBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- queueBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- queueBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- stackBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- stackBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- databaseBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- databaseBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- folderBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- folderBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- fileBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- fileBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- frameBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- frameBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- nodeBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- nodeBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- rectangleBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- rectangleBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- archimateBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- archimateBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- cardBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- cardBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- agentBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- agentBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- storageBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- storageBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- boundaryBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- boundaryBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- collectionsBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- collectionsBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- controlBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- controlBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
- entityBackground(HtmlColorUtils.MY_YELLOW, true, ColorType.BACK),
- entityBorder(HtmlColorUtils.MY_RED, ColorType.LINE),
+ artifactBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ artifactBorder(HColorUtils.BLACK, ColorType.LINE),
+ cloudBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ cloudBorder(HColorUtils.BLACK, ColorType.LINE),
+ queueBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ queueBorder(HColorUtils.MY_RED, ColorType.LINE),
+ stackBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ stackBorder(HColorUtils.MY_RED, ColorType.LINE),
+ databaseBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ databaseBorder(HColorUtils.BLACK, ColorType.LINE),
+ folderBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ folderBorder(HColorUtils.BLACK, ColorType.LINE),
+ fileBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ fileBorder(HColorUtils.BLACK, ColorType.LINE),
+ frameBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ frameBorder(HColorUtils.BLACK, ColorType.LINE),
+ nodeBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ nodeBorder(HColorUtils.BLACK, ColorType.LINE),
+ rectangleBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ rectangleBorder(HColorUtils.BLACK, ColorType.LINE),
+ archimateBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ archimateBorder(HColorUtils.BLACK, ColorType.LINE),
+ cardBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ cardBorder(HColorUtils.BLACK, ColorType.LINE),
+ agentBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ agentBorder(HColorUtils.MY_RED, ColorType.LINE),
+ storageBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ storageBorder(HColorUtils.BLACK, ColorType.LINE),
+ boundaryBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ boundaryBorder(HColorUtils.MY_RED, ColorType.LINE),
+ collectionsBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ collectionsBorder(HColorUtils.MY_RED, ColorType.LINE),
+ controlBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ controlBorder(HColorUtils.MY_RED, ColorType.LINE),
+ entityBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
+ entityBorder(HColorUtils.MY_RED, ColorType.LINE),
- iconPrivate(HtmlColorUtils.COL_C82930),
- iconPrivateBackground(HtmlColorUtils.COL_F24D5C),
- iconPackage(HtmlColorUtils.COL_1963A0),
- iconPackageBackground(HtmlColorUtils.COL_4177AF),
- iconProtected(HtmlColorUtils.COL_B38D22),
- iconProtectedBackground(HtmlColorUtils.COL_FFFF44),
- iconPublic(HtmlColorUtils.COL_038048),
- iconPublicBackground(HtmlColorUtils.COL_84BE84),
- iconIEMandatory(HtmlColorUtils.BLACK),
+ 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),
- arrowLollipop(HtmlColorUtils.WHITE),
+ arrowLollipop(HColorUtils.WHITE),
- machineBackground(HtmlColorUtils.WHITE),
- machineBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- requirementBackground(HtmlColorUtils.WHITE),
- requirementBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- designedBackground(HtmlColorUtils.WHITE),
- designedBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- domainBackground(HtmlColorUtils.WHITE),
- domainBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- lexicalBackground(HtmlColorUtils.WHITE),
- lexicalBorder(HtmlColorUtils.BLACK, ColorType.LINE),
- biddableBackground(HtmlColorUtils.WHITE),
- biddableBorder(HtmlColorUtils.BLACK, ColorType.LINE);
+ 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);
private final boolean isBackground;
- private final HtmlColor defaultValue;
+ private final HColor defaultValue;
private final ColorType colorType;
- private ColorParam(HtmlColor defaultValue, ColorType colorType) {
+ private ColorParam(HColor defaultValue, ColorType colorType) {
this(defaultValue, false, colorType);
}
- private ColorParam(HtmlColor defaultValue) {
+ private ColorParam(HColor defaultValue) {
this(defaultValue, false, null);
}
@@ -204,7 +204,7 @@ public enum ColorParam {
this(null, isBackground, null);
}
- private ColorParam(HtmlColor defaultValue, boolean isBackground, ColorType colorType) {
+ private ColorParam(HColor defaultValue, boolean isBackground, ColorType colorType) {
this.isBackground = isBackground;
this.defaultValue = defaultValue;
this.colorType = colorType;
@@ -218,7 +218,7 @@ public enum ColorParam {
return isBackground;
}
- public final HtmlColor getDefaultValue() {
+ public final HColor getDefaultValue() {
return defaultValue;
}
diff --git a/src/net/sourceforge/plantuml/EmbeddedDiagram.java b/src/net/sourceforge/plantuml/EmbeddedDiagram.java
index d6409ed2f..b7294982e 100644
--- a/src/net/sourceforge/plantuml/EmbeddedDiagram.java
+++ b/src/net/sourceforge/plantuml/EmbeddedDiagram.java
@@ -45,7 +45,7 @@ import java.util.List;
import javax.imageio.ImageIO;
import net.sourceforge.plantuml.core.Diagram;
-import net.sourceforge.plantuml.creole.Atom;
+import net.sourceforge.plantuml.creole.atom.Atom;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
diff --git a/src/net/sourceforge/plantuml/EmptyImageBuilder.java b/src/net/sourceforge/plantuml/EmptyImageBuilder.java
index e11dac0ed..a7801f8ff 100644
--- a/src/net/sourceforge/plantuml/EmptyImageBuilder.java
+++ b/src/net/sourceforge/plantuml/EmptyImageBuilder.java
@@ -41,8 +41,8 @@ import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import net.sourceforge.plantuml.cucadiagram.dot.GraphvizUtils;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.UAntiAliasing;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d;
public class EmptyImageBuilder {
diff --git a/src/net/sourceforge/plantuml/ISkinParam.java b/src/net/sourceforge/plantuml/ISkinParam.java
index 1016c718d..92ae31cf0 100644
--- a/src/net/sourceforge/plantuml/ISkinParam.java
+++ b/src/net/sourceforge/plantuml/ISkinParam.java
@@ -41,7 +41,6 @@ import net.sourceforge.plantuml.cucadiagram.Rankdir;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.DotSplines;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.SkinParameter;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.ActorStyle;
@@ -54,22 +53,23 @@ import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.svek.PackageStyle;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public interface ISkinParam extends ISkinSimple {
public static final int SWIMLANE_WIDTH_SAME = -1;
- public HtmlColor getHyperlinkColor();
+ public HColor getHyperlinkColor();
public boolean useUnderlineForHyperlink();
- public HtmlColor getBackgroundColor();
+ public HColor getBackgroundColor();
- public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable);
+ public HColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable);
public Colors getColors(ColorParam param, Stereotype stereotype);
- public HtmlColor getFontHtmlColor(Stereotype stereotype, FontParam... param);
+ public HColor getFontHtmlColor(Stereotype stereotype, FontParam... param);
public UStroke getThickness(LineParam param, Stereotype stereotype);
@@ -156,7 +156,7 @@ public interface ISkinParam extends ISkinSimple {
public UmlDiagramType getUmlDiagramType();
- public HtmlColor getHoverPathColor();
+ public HColor getHoverPathColor();
public TikzFontDistortion getTikzFontDistortion();
diff --git a/src/net/sourceforge/plantuml/ISkinSimple.java b/src/net/sourceforge/plantuml/ISkinSimple.java
index b008383e8..5a86337d5 100644
--- a/src/net/sourceforge/plantuml/ISkinSimple.java
+++ b/src/net/sourceforge/plantuml/ISkinSimple.java
@@ -37,8 +37,8 @@ package net.sourceforge.plantuml;
import java.util.Map;
-import net.sourceforge.plantuml.graphic.IHtmlColorSet;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public interface ISkinSimple extends SpriteContainer {
@@ -52,7 +52,7 @@ public interface ISkinSimple extends SpriteContainer {
public int getTabSize();
- public IHtmlColorSet getIHtmlColorSet();
+ public HColorSet getIHtmlColorSet();
public int getDpi();
diff --git a/src/net/sourceforge/plantuml/LineConfigurable.java b/src/net/sourceforge/plantuml/LineConfigurable.java
index 8358bc886..b55381981 100644
--- a/src/net/sourceforge/plantuml/LineConfigurable.java
+++ b/src/net/sourceforge/plantuml/LineConfigurable.java
@@ -35,15 +35,15 @@
*/
package net.sourceforge.plantuml;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public interface LineConfigurable {
public Colors getColors(ISkinParam skinParam);
- public void setSpecificColorTOBEREMOVED(ColorType type, HtmlColor color);
+ public void setSpecificColorTOBEREMOVED(ColorType type, HColor color);
diff --git a/src/net/sourceforge/plantuml/LineParam.java b/src/net/sourceforge/plantuml/LineParam.java
index bebacc0e3..3b3704394 100644
--- a/src/net/sourceforge/plantuml/LineParam.java
+++ b/src/net/sourceforge/plantuml/LineParam.java
@@ -58,6 +58,7 @@ public enum LineParam {
archimateBorder,
componentBorder,
cardBorder,
+ queueBorder,
agentBorder,
domainBorder, designedDomainBorder, machineBorder, requirementBorder;
// sequenceBoxBorder(0.1);
diff --git a/src/net/sourceforge/plantuml/PSystemUtils.java b/src/net/sourceforge/plantuml/PSystemUtils.java
index c3fe74f62..0dff2f50a 100644
--- a/src/net/sourceforge/plantuml/PSystemUtils.java
+++ b/src/net/sourceforge/plantuml/PSystemUtils.java
@@ -49,11 +49,11 @@ import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.html.CucaDiagramHtmlMaker;
import net.sourceforge.plantuml.png.PngSplitter;
import net.sourceforge.plantuml.project.GanttDiagram;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class PSystemUtils {
@@ -300,7 +300,7 @@ public class PSystemUtils {
List result = Arrays.asList(suggestedFile.getFile(0));
if (fileFormat.getFileFormat() == FileFormat.PNG) {
- final SplitParam splitParam = new SplitParam(HtmlColorUtils.BLACK, null, 5);
+ final SplitParam splitParam = new SplitParam(HColorUtils.BLACK, null, 5);
result = new PngSplitter(suggestedFile, system.getHorizontalPages(), system.getVerticalPages(),
system.getMetadata(), system.getDpi(fileFormat), fileFormat.isWithMetadata(), splitParam)
.getFiles();
diff --git a/src/net/sourceforge/plantuml/Run.java b/src/net/sourceforge/plantuml/Run.java
index 9715273b2..4964007ec 100644
--- a/src/net/sourceforge/plantuml/Run.java
+++ b/src/net/sourceforge/plantuml/Run.java
@@ -291,8 +291,8 @@ public class Run {
}
final String name = getSpriteName(fileName);
- final String s = compressed ? SpriteUtils.encodeCompressed(im, name, level) : SpriteUtils.encode(im, name,
- level);
+ final String s = compressed ? SpriteUtils.encodeCompressed(im, name, level)
+ : SpriteUtils.encode(im, name, level);
System.out.println(s);
}
@@ -326,8 +326,8 @@ public class Run {
public static void printFonts() {
final Font fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
for (Font f : fonts) {
- System.out.println("f=" + f + "/" + f.getPSName() + "/" + f.getName() + "/" + f.getFontName() + "/"
- + f.getFamily());
+ System.out.println(
+ "f=" + f + "/" + f.getPSName() + "/" + f.getName() + "/" + f.getFontName() + "/" + f.getFamily());
}
final String name[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
for (String n : name) {
@@ -458,8 +458,8 @@ public class Run {
ProgressBar.incTotal(nb);
}
- private static void manageFileInternal(File f, Option option, ErrorStatus error) throws IOException,
- InterruptedException {
+ private static void manageFileInternal(File f, Option option, ErrorStatus error)
+ throws IOException, InterruptedException {
Log.info("Working on " + f.getAbsolutePath());
if (OptionFlags.getInstance().isExtractFromMetadata()) {
System.out.println("------------------------");
@@ -540,9 +540,19 @@ public class Run {
final File file = suggested.getFile(0);
Log.info("Export preprocessing source to " + file.getAbsolutePath());
final PrintWriter pw = charset == null ? new PrintWriter(file) : new PrintWriter(file, charset);
- for (CharSequence s : blockUml.getDefinition(true)) {
+ int level = 0;
+ for (CharSequence cs : blockUml.getDefinition(true)) {
+ String s = cs.toString();
if (cypher != null) {
- s = cypher.cypher(s.toString());
+ if (s.contains("skinparam") && s.contains("{")) {
+ level++;
+ }
+ if (level == 0 && s.contains("skinparam") == false) {
+ s = cypher.cypher(s);
+ }
+ if (level > 0 && s.contains("}")) {
+ level--;
+ }
}
pw.println(s);
}
diff --git a/src/net/sourceforge/plantuml/SkinParam.java b/src/net/sourceforge/plantuml/SkinParam.java
index f98652eb4..5b3b82ae8 100644
--- a/src/net/sourceforge/plantuml/SkinParam.java
+++ b/src/net/sourceforge/plantuml/SkinParam.java
@@ -52,16 +52,12 @@ import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
-import net.sourceforge.plantuml.creole.CommandCreoleMonospaced;
+import net.sourceforge.plantuml.creole.command.CommandCreoleMonospaced;
import net.sourceforge.plantuml.cucadiagram.LinkStyle;
import net.sourceforge.plantuml.cucadiagram.Rankdir;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.DotSplines;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.graphic.IHtmlColorSet;
import net.sourceforge.plantuml.graphic.SkinParameter;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.ActorStyle;
@@ -76,13 +72,17 @@ import net.sourceforge.plantuml.style.StyleLoader;
import net.sourceforge.plantuml.svek.ConditionEndStyle;
import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.svek.PackageStyle;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
-import net.sourceforge.plantuml.ugraphic.ColorMapperMonochrome;
-import net.sourceforge.plantuml.ugraphic.ColorMapperReverse;
-import net.sourceforge.plantuml.ugraphic.ColorOrder;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperLightnessInverse;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperMonochrome;
+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;
public class SkinParam implements ISkinParam {
@@ -255,18 +255,18 @@ public class SkinParam implements ISkinParam {
return s.replaceAll(src, target);
}
- public HtmlColor getHyperlinkColor() {
- final HtmlColor result = getHtmlColor(ColorParam.hyperlink, null, false);
+ public HColor getHyperlinkColor() {
+ final HColor result = getHtmlColor(ColorParam.hyperlink, null, false);
if (result == null) {
- return HtmlColorUtils.BLUE;
+ return HColorUtils.BLUE;
}
return result;
}
- public HtmlColor getBackgroundColor() {
- final HtmlColor result = getHtmlColor(ColorParam.background, null, false);
+ public HColor getBackgroundColor() {
+ final HColor result = getHtmlColor(ColorParam.background, null, false);
if (result == null) {
- return HtmlColorUtils.WHITE;
+ return HColorUtils.WHITE;
}
return result;
}
@@ -296,7 +296,7 @@ public class SkinParam implements ISkinParam {
return sb.toString();
}
- public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
+ public HColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
if (stereotype != null) {
checkStereotype(stereotype);
for (String s : stereotype.getMultipleLabels()) {
@@ -310,9 +310,16 @@ public class SkinParam implements ISkinParam {
if (value == null) {
return null;
}
- final boolean acceptTransparent = param == ColorParam.background
- || param == ColorParam.sequenceGroupBodyBackground || param == ColorParam.sequenceBoxBackground;
- return getIHtmlColorSet().getColorIfValid(value, acceptTransparent);
+ if (param == ColorParam.background && value.equalsIgnoreCase("transparent")) {
+ return null;
+ }
+ if (param == ColorParam.background) {
+ return getIHtmlColorSet().getColorIfValid(value);
+ }
+ assert param != ColorParam.background;
+// final boolean acceptTransparent = param == ColorParam.background
+// || param == ColorParam.sequenceGroupBodyBackground || param == ColorParam.sequenceBoxBackground;
+ return getIHtmlColorSet().getColorIfValid(value, getBackgroundColor());
}
public char getCircledCharacter(Stereotype stereotype) {
@@ -352,7 +359,8 @@ public class SkinParam implements ISkinParam {
}
private void checkStereotype(Stereotype stereotype) {
- // if (stereotype.startsWith("<<") == false || stereotype.endsWith(">>") == false) {
+ // if (stereotype.startsWith("<<") == false || stereotype.endsWith(">>") ==
+ // false) {
// throw new IllegalArgumentException();
// }
}
@@ -399,7 +407,7 @@ public class SkinParam implements ISkinParam {
return param[0].getDefaultFamily();
}
- public HtmlColor getFontHtmlColor(Stereotype stereotype, FontParam... param) {
+ public HColor getFontHtmlColor(Stereotype stereotype, FontParam... param) {
String value = null;
if (stereotype != null) {
checkStereotype(stereotype);
@@ -684,6 +692,9 @@ public class SkinParam implements ISkinParam {
if (value == null) {
return new ColorMapperIdentity();
}
+ if ("dark".equalsIgnoreCase(value)) {
+ return new ColorMapperLightnessInverse();
+ }
final ColorOrder order = ColorOrder.fromString(value);
if (order == null) {
return new ColorMapperIdentity();
@@ -876,14 +887,14 @@ public class SkinParam implements ISkinParam {
if (stereotype != null) {
checkStereotype(stereotype);
- final String styleValue = getValue(param.name() + "style"
- + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
+ final String styleValue = getValue(
+ param.name() + "style" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
if (styleValue != null) {
style = LinkStyle.fromString2(styleValue);
}
- final String value2 = getValue(param.name() + "thickness"
- + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
+ final String value2 = getValue(
+ param.name() + "thickness" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
if (value2 != null && value2.matches("[\\d.]+")) {
if (style == null) {
style = LinkStyle.NORMAL();
@@ -1000,9 +1011,9 @@ public class SkinParam implements ISkinParam {
return false;
}
- private final IHtmlColorSet htmlColorSet = new HtmlColorSetSimple();
+ private final HColorSet htmlColorSet = HColorSet.instance();
- public IHtmlColorSet getIHtmlColorSet() {
+ public HColorSet getIHtmlColorSet() {
return htmlColorSet;
}
@@ -1116,12 +1127,12 @@ public class SkinParam implements ISkinParam {
return type;
}
- public HtmlColor getHoverPathColor() {
+ public HColor getHoverPathColor() {
final String value = getValue("pathhovercolor");
if (value == null) {
return null;
}
- return getIHtmlColorSet().getColorIfValid(value, false);
+ return getIHtmlColorSet().getColorIfValid(value, null);
}
public double getPadding() {
@@ -1199,8 +1210,8 @@ public class SkinParam implements ISkinParam {
if (padding == 0 && margin == 0 && borderColor == null && backgroundColor == null) {
return Padder.NONE;
}
- final HtmlColor border = getIHtmlColorSet().getColorIfValid(borderColor);
- final HtmlColor background = getIHtmlColorSet().getColorIfValid(backgroundColor);
+ final HColor border = getIHtmlColorSet().getColorIfValid(borderColor);
+ final HColor background = getIHtmlColorSet().getColorIfValid(backgroundColor);
final double roundCorner = getRoundCorner(CornerParam.DEFAULT, null);
return Padder.NONE.withMargin(margin).withPadding(padding).withBackgroundColor(background)
.withBorderColor(border).withRoundCorner(roundCorner);
diff --git a/src/net/sourceforge/plantuml/SkinParamBackcolored.java b/src/net/sourceforge/plantuml/SkinParamBackcolored.java
index fb19cb225..fe4e7a983 100644
--- a/src/net/sourceforge/plantuml/SkinParamBackcolored.java
+++ b/src/net/sourceforge/plantuml/SkinParamBackcolored.java
@@ -39,23 +39,23 @@ import java.util.EnumMap;
import java.util.Map;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class SkinParamBackcolored extends SkinParamDelegator {
- final private HtmlColor backColorElement;
- final private HtmlColor backColorGeneral;
+ final private HColor backColorElement;
+ final private HColor backColorGeneral;
final private boolean forceClickage;
- public SkinParamBackcolored(ISkinParam skinParam, HtmlColor backColorElement) {
+ public SkinParamBackcolored(ISkinParam skinParam, HColor backColorElement) {
this(skinParam, backColorElement, null, false);
}
- public SkinParamBackcolored(ISkinParam skinParam, HtmlColor backColorElement, boolean forceClickage) {
+ public SkinParamBackcolored(ISkinParam skinParam, HColor backColorElement, boolean forceClickage) {
this(skinParam, backColorElement, null, forceClickage);
}
- public SkinParamBackcolored(ISkinParam skinParam, HtmlColor backColorElement, HtmlColor backColorGeneral) {
+ public SkinParamBackcolored(ISkinParam skinParam, HColor backColorElement, HColor backColorGeneral) {
this(skinParam, backColorElement, backColorGeneral, false);
}
@@ -64,7 +64,7 @@ public class SkinParamBackcolored extends SkinParamDelegator {
return super.toString() + " " + backColorElement + " " + backColorGeneral;
}
- public SkinParamBackcolored(ISkinParam skinParam, HtmlColor backColorElement, HtmlColor backColorGeneral,
+ public SkinParamBackcolored(ISkinParam skinParam, HColor backColorElement, HColor backColorGeneral,
boolean forceClickage) {
super(skinParam);
this.forceClickage = forceClickage;
@@ -73,7 +73,7 @@ public class SkinParamBackcolored extends SkinParamDelegator {
}
@Override
- public HtmlColor getBackgroundColor() {
+ public HColor getBackgroundColor() {
if (backColorGeneral != null) {
return backColorGeneral;
}
@@ -81,27 +81,27 @@ public class SkinParamBackcolored extends SkinParamDelegator {
}
@Override
- public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
+ public HColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
if (param.isBackground() && backColorElement != null) {
return backColorElement;
}
if (forceClickage) {
- final HtmlColor c1 = super.getHtmlColor(param, stereotype, true);
+ final HColor c1 = super.getHtmlColor(param, stereotype, true);
if (c1 != null) {
return c1;
}
// clickable = true;
}
- final HtmlColor forcedColor = forced.get(param);
+ final HColor forcedColor = forced.get(param);
if (forcedColor != null) {
return forcedColor;
}
return super.getHtmlColor(param, stereotype, clickable);
}
- private final Map forced = new EnumMap(ColorParam.class);
+ private final Map forced = new EnumMap(ColorParam.class);
- public void forceColor(ColorParam param, HtmlColor color) {
+ public void forceColor(ColorParam param, HColor color) {
forced.put(param, color);
}
diff --git a/src/net/sourceforge/plantuml/SkinParamBackcoloredReference.java b/src/net/sourceforge/plantuml/SkinParamBackcoloredReference.java
index 79c5d112b..1c5092f4d 100644
--- a/src/net/sourceforge/plantuml/SkinParamBackcoloredReference.java
+++ b/src/net/sourceforge/plantuml/SkinParamBackcoloredReference.java
@@ -36,22 +36,22 @@
package net.sourceforge.plantuml;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class SkinParamBackcoloredReference extends SkinParamDelegator {
- final private HtmlColor sequenceReferenceHeaderBackground;
- final private HtmlColor sequenceReferenceBackground;
+ final private HColor sequenceReferenceHeaderBackground;
+ final private HColor sequenceReferenceBackground;
- public SkinParamBackcoloredReference(ISkinParam skinParam, HtmlColor sequenceReferenceHeaderBackground,
- HtmlColor sequenceReferenceBackground) {
+ public SkinParamBackcoloredReference(ISkinParam skinParam, HColor sequenceReferenceHeaderBackground,
+ HColor sequenceReferenceBackground) {
super(skinParam);
this.sequenceReferenceBackground = sequenceReferenceBackground;
this.sequenceReferenceHeaderBackground = sequenceReferenceHeaderBackground;
}
@Override
- public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
+ public HColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
if (param == ColorParam.sequenceReferenceHeaderBackground && sequenceReferenceHeaderBackground != null) {
return sequenceReferenceHeaderBackground;
}
diff --git a/src/net/sourceforge/plantuml/SkinParamColors.java b/src/net/sourceforge/plantuml/SkinParamColors.java
index 4233e68eb..bd278ab6d 100644
--- a/src/net/sourceforge/plantuml/SkinParamColors.java
+++ b/src/net/sourceforge/plantuml/SkinParamColors.java
@@ -36,9 +36,9 @@
package net.sourceforge.plantuml;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class SkinParamColors extends SkinParamDelegator {
@@ -67,8 +67,8 @@ public class SkinParamColors extends SkinParamDelegator {
}
@Override
- public HtmlColor getFontHtmlColor(Stereotype stereotype, FontParam... param) {
- final HtmlColor value = colors.getColor(ColorType.TEXT);
+ public HColor getFontHtmlColor(Stereotype stereotype, FontParam... param) {
+ final HColor value = colors.getColor(ColorType.TEXT);
if (value == null) {
return super.getFontHtmlColor(stereotype, param);
}
@@ -76,12 +76,12 @@ public class SkinParamColors extends SkinParamDelegator {
}
@Override
- public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
+ public HColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
final ColorType type = param.getColorType();
if (type == null) {
return super.getHtmlColor(param, stereotype, clickable);
}
- final HtmlColor value = colors.getColor(type);
+ final HColor value = colors.getColor(type);
if (value != null) {
return value;
}
diff --git a/src/net/sourceforge/plantuml/SkinParamDelegator.java b/src/net/sourceforge/plantuml/SkinParamDelegator.java
index 618eb708b..665653c83 100644
--- a/src/net/sourceforge/plantuml/SkinParamDelegator.java
+++ b/src/net/sourceforge/plantuml/SkinParamDelegator.java
@@ -42,8 +42,6 @@ import net.sourceforge.plantuml.cucadiagram.Rankdir;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.DotSplines;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.IHtmlColorSet;
import net.sourceforge.plantuml.graphic.SkinParameter;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.ActorStyle;
@@ -55,9 +53,11 @@ import net.sourceforge.plantuml.style.StyleBuilder;
import net.sourceforge.plantuml.svek.ConditionEndStyle;
import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.svek.PackageStyle;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class SkinParamDelegator implements ISkinParam {
@@ -67,11 +67,11 @@ public class SkinParamDelegator implements ISkinParam {
this.skinParam = skinParam;
}
- public HtmlColor getHyperlinkColor() {
+ public HColor getHyperlinkColor() {
return skinParam.getHyperlinkColor();
}
- public HtmlColor getBackgroundColor() {
+ public HColor getBackgroundColor() {
return skinParam.getBackgroundColor();
}
@@ -83,11 +83,11 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.getFont(stereotype, false, fontParam);
}
- public HtmlColor getFontHtmlColor(Stereotype stereotype, FontParam... param) {
+ public HColor getFontHtmlColor(Stereotype stereotype, FontParam... param) {
return skinParam.getFontHtmlColor(stereotype, param);
}
- public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
+ public HColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
return skinParam.getHtmlColor(param, stereotype, clickable);
}
@@ -204,7 +204,7 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.useOctagonForActivity(stereotype);
}
- public IHtmlColorSet getIHtmlColorSet() {
+ public HColorSet getIHtmlColorSet() {
return skinParam.getIHtmlColorSet();
}
@@ -276,7 +276,7 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.getUmlDiagramType();
}
- public HtmlColor getHoverPathColor() {
+ public HColor getHoverPathColor() {
return skinParam.getHoverPathColor();
}
diff --git a/src/net/sourceforge/plantuml/SkinParamForceColor.java b/src/net/sourceforge/plantuml/SkinParamForceColor.java
index 428e653c3..f7c4a5cb0 100644
--- a/src/net/sourceforge/plantuml/SkinParamForceColor.java
+++ b/src/net/sourceforge/plantuml/SkinParamForceColor.java
@@ -36,21 +36,21 @@
package net.sourceforge.plantuml;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class SkinParamForceColor extends SkinParamDelegator {
final private ColorParam colorParam;;
- final private HtmlColor color;
+ final private HColor color;
- public SkinParamForceColor(ISkinParam skinParam, ColorParam colorParam, HtmlColor color) {
+ public SkinParamForceColor(ISkinParam skinParam, ColorParam colorParam, HColor color) {
super(skinParam);
this.color = color;
this.colorParam = colorParam;
}
@Override
- public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
+ public HColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
if (colorParam == param) {
return color;
}
diff --git a/src/net/sourceforge/plantuml/SkinParamForecolored.java b/src/net/sourceforge/plantuml/SkinParamForecolored.java
index c773cc4b2..082308ecc 100644
--- a/src/net/sourceforge/plantuml/SkinParamForecolored.java
+++ b/src/net/sourceforge/plantuml/SkinParamForecolored.java
@@ -36,19 +36,19 @@
package net.sourceforge.plantuml;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class SkinParamForecolored extends SkinParamDelegator {
- final private HtmlColor forecolor;
+ final private HColor forecolor;
- public SkinParamForecolored(ISkinParam skinParam, HtmlColor forecolor) {
+ public SkinParamForecolored(ISkinParam skinParam, HColor forecolor) {
super(skinParam);
this.forecolor = forecolor;
}
@Override
- public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
+ public HColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
return forecolor;
}
diff --git a/src/net/sourceforge/plantuml/SkinParamUtils.java b/src/net/sourceforge/plantuml/SkinParamUtils.java
index d92c235c6..c324c5cf3 100644
--- a/src/net/sourceforge/plantuml/SkinParamUtils.java
+++ b/src/net/sourceforge/plantuml/SkinParamUtils.java
@@ -36,9 +36,9 @@
package net.sourceforge.plantuml;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class SkinParamUtils {
@@ -48,11 +48,11 @@ public class SkinParamUtils {
return skinParam.getFont(stereo, false, fontParam);
}
- public static HtmlColor getFontColor(ISkinParam skinParam, FontParam fontParam, Stereotype stereo) {
+ public static HColor getFontColor(ISkinParam skinParam, FontParam fontParam, Stereotype stereo) {
return skinParam.getFontHtmlColor(stereo, fontParam);
}
- public static HtmlColor getColor(ISkinParam skinParam, Stereotype stereo, ColorParam... colorParam) {
+ public static HColor getColor(ISkinParam skinParam, Stereotype stereo, ColorParam... colorParam) {
return rose.getHtmlColor(skinParam, stereo, colorParam);
}
diff --git a/src/net/sourceforge/plantuml/SourceStringReader.java b/src/net/sourceforge/plantuml/SourceStringReader.java
index 8338002fe..d2bcbbac2 100644
--- a/src/net/sourceforge/plantuml/SourceStringReader.java
+++ b/src/net/sourceforge/plantuml/SourceStringReader.java
@@ -51,8 +51,8 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
public class SourceStringReader {
diff --git a/src/net/sourceforge/plantuml/SplitParam.java b/src/net/sourceforge/plantuml/SplitParam.java
index f11f76dfc..ee83ed390 100644
--- a/src/net/sourceforge/plantuml/SplitParam.java
+++ b/src/net/sourceforge/plantuml/SplitParam.java
@@ -37,20 +37,20 @@ package net.sourceforge.plantuml;
import java.awt.Color;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSimple;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSimple;
public class SplitParam {
- private final HtmlColor borderColor;
- private final HtmlColor externalColor;
+ private final HColor borderColor;
+ private final HColor externalColor;
private final int externalMargin;
public SplitParam() {
this(null, null, 0);
}
- public SplitParam(HtmlColor borderColor, HtmlColor externalColor, int externalMargin) {
+ public SplitParam(HColor borderColor, HColor externalColor, int externalMargin) {
if (borderColor != null && externalMargin == 0) {
externalMargin = 1;
}
@@ -71,14 +71,14 @@ public class SplitParam {
if (borderColor == null) {
return null;
}
- return ((HtmlColorSimple) borderColor).getColor999();
+ return ((HColorSimple) borderColor).getColor999();
}
public Color getExternalColor() {
if (externalColor == null) {
return null;
}
- return ((HtmlColorSimple) externalColor).getColor999();
+ return ((HColorSimple) externalColor).getColor999();
}
}
\ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/SpriteContainerEmpty.java b/src/net/sourceforge/plantuml/SpriteContainerEmpty.java
index b217641d1..063a82a84 100644
--- a/src/net/sourceforge/plantuml/SpriteContainerEmpty.java
+++ b/src/net/sourceforge/plantuml/SpriteContainerEmpty.java
@@ -37,13 +37,12 @@ package net.sourceforge.plantuml;
import java.util.Map;
-import net.sourceforge.plantuml.creole.CommandCreoleMonospaced;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
-import net.sourceforge.plantuml.graphic.IHtmlColorSet;
+import net.sourceforge.plantuml.creole.command.CommandCreoleMonospaced;
import net.sourceforge.plantuml.sprite.Sprite;
import net.sourceforge.plantuml.sprite.SpriteImage;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class SpriteContainerEmpty implements SpriteContainer, ISkinSimple {
@@ -71,8 +70,8 @@ public class SpriteContainerEmpty implements SpriteContainer, ISkinSimple {
return 8;
}
- public IHtmlColorSet getIHtmlColorSet() {
- return new HtmlColorSetSimple();
+ public HColorSet getIHtmlColorSet() {
+ return HColorSet.instance();
}
public int getDpi() {
diff --git a/src/net/sourceforge/plantuml/StringUtils.java b/src/net/sourceforge/plantuml/StringUtils.java
index 54a16fb76..5231c61b5 100644
--- a/src/net/sourceforge/plantuml/StringUtils.java
+++ b/src/net/sourceforge/plantuml/StringUtils.java
@@ -49,9 +49,9 @@ import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorTransparent;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorBackground;
// Do not move
public class StringUtils {
@@ -371,7 +371,9 @@ public class StringUtils {
public static List splitComma(String s) {
s = trin(s);
- // if (s.matches("([\\p{L}0-9_.]+|[%g][^%g]+[%g])(\\s*,\\s*([\\p{L}0-9_.]+|[%g][^%g]+[%g]))*") == false) {
+ // if
+ // (s.matches("([\\p{L}0-9_.]+|[%g][^%g]+[%g])(\\s*,\\s*([\\p{L}0-9_.]+|[%g][^%g]+[%g]))*")
+ // == false) {
// throw new IllegalArgumentException();
// }
final List result = new ArrayList();
@@ -390,12 +392,12 @@ public class StringUtils {
return getAsHtml(color.getRGB());
}
- public static String getAsSvg(ColorMapper mapper, HtmlColor color) {
+ public static String getAsSvg(ColorMapper mapper, HColor color) {
if (color == null) {
return "none";
}
- if (color instanceof HtmlColorTransparent) {
- return "#FFFFFF";
+ if (color instanceof HColorBackground) {
+ return ((HColorBackground) color).getSvg(mapper);
}
return getAsHtml(mapper.getMappedColor(color));
}
diff --git a/src/net/sourceforge/plantuml/SvgString.java b/src/net/sourceforge/plantuml/SvgString.java
index 080a85397..3264516bc 100644
--- a/src/net/sourceforge/plantuml/SvgString.java
+++ b/src/net/sourceforge/plantuml/SvgString.java
@@ -47,6 +47,10 @@ public class SvgString {
this.svg = svg;
this.scale = scale;
}
+
+ public String getMD5Hex() {
+ return SignatureUtils.getMD5Hex(svg);
+ }
public String getSvg(boolean raw) {
String result = svg;
diff --git a/src/net/sourceforge/plantuml/UmlDiagram.java b/src/net/sourceforge/plantuml/UmlDiagram.java
index 2254c09b7..3e54ebd25 100644
--- a/src/net/sourceforge/plantuml/UmlDiagram.java
+++ b/src/net/sourceforge/plantuml/UmlDiagram.java
@@ -70,8 +70,6 @@ import net.sourceforge.plantuml.flashcode.FlashCodeUtils;
import net.sourceforge.plantuml.fun.IconLoader;
import net.sourceforge.plantuml.graphic.GraphicPosition;
import net.sourceforge.plantuml.graphic.GraphicStrings;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.mjpeg.MJPEGGenerator;
import net.sourceforge.plantuml.pdf.PdfConverter;
@@ -79,11 +77,13 @@ import net.sourceforge.plantuml.sprite.Sprite;
import net.sourceforge.plantuml.svek.EmptySvgException;
import net.sourceforge.plantuml.svek.GraphvizCrash;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.version.Version;
public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annotated, WithSprite {
@@ -182,7 +182,7 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
final protected ImageData exportDiagramNow(OutputStream os, int index, FileFormatOption fileFormatOption, long seed)
throws IOException {
- final HtmlColor hover = getSkinParam().getHoverPathColor();
+ final HColor hover = getSkinParam().getHoverPathColor();
if (fileFormatOption.getSvgLinkTarget() == null || fileFormatOption.getSvgLinkTarget().equals("_top")) {
fileFormatOption = fileFormatOption.withSvgLinkTarget(getSkinParam().getSvgLinkTarget());
}
@@ -227,7 +227,7 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
strings.addAll(CommandExecutionResult.getStackTrace(exception));
- final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.WHITE,
+ final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HColorUtils.WHITE,
metadata, null, 0, 0, null, false);
final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
@@ -246,7 +246,7 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
public void drawU(UGraphic ug) {
graphicStrings.drawU(ug);
final double height = graphicStrings.calculateDimension(ug.getStringBounder()).getHeight();
- ug = ug.apply(new UTranslate(0, height));
+ ug = ug.apply(UTranslate.dy(height));
ug.draw(new UImage(im).scaleNearestNeighbor(3));
}
});
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java
index f1c2c1c72..ca4695275 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java
@@ -54,7 +54,6 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockRecentred;
@@ -63,6 +62,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.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.comp.CompressionMode;
import net.sourceforge.plantuml.ugraphic.comp.TextBlockCompressedOnXorY;
@@ -86,7 +86,7 @@ public class ActivityDiagram3 extends UmlDiagram {
}
}
- public CommandExecutionResult swimlane(String name, HtmlColor color, Display label) {
+ public CommandExecutionResult swimlane(String name, HColor color, Display label) {
if (swimlaneStrategy == null) {
swimlaneStrategy = SwimlaneStrategy.SWIMLANE_ALLOWED;
}
@@ -122,7 +122,7 @@ public class ActivityDiagram3 extends UmlDiagram {
}
}
- public void addSpot(String spot, HtmlColor color) {
+ public void addSpot(String spot, HColor color) {
final InstructionSpot ins = new InstructionSpot(spot, color, nextLinkRenderer(), swinlanes.getCurrentSwimlane());
current().add(ins);
setNextLinkRendererInternal(LinkRendering.none());
@@ -295,7 +295,7 @@ public class ActivityDiagram3 extends UmlDiagram {
return CommandExecutionResult.error("Cannot find split");
}
- public void startSwitch(Display test, HtmlColor color) {
+ public void startSwitch(Display test, HColor color) {
manageSwimlaneStrategy();
final InstructionSwitch instructionSwitch = new InstructionSwitch(swinlanes.getCurrentSwimlane(), current(),
test, nextLinkRenderer(), color, getSkinParam());
@@ -327,7 +327,7 @@ public class ActivityDiagram3 extends UmlDiagram {
return CommandExecutionResult.error("Cannot find switch");
}
- public void startIf(Display test, Display whenThen, HtmlColor color, Url url) {
+ public void startIf(Display test, Display whenThen, HColor color, Url url) {
manageSwimlaneStrategy();
final InstructionIf instructionIf = new InstructionIf(swinlanes.getCurrentSwimlane(), current(), test,
whenThen, nextLinkRenderer(), color, getSkinParam(), url);
@@ -336,7 +336,7 @@ public class ActivityDiagram3 extends UmlDiagram {
setCurrent(instructionIf);
}
- public CommandExecutionResult elseIf(Display inlabel, Display test, Display whenThen, HtmlColor color) {
+ public CommandExecutionResult elseIf(Display inlabel, Display test, Display whenThen, HColor color) {
if (current() instanceof InstructionIf) {
final boolean ok = ((InstructionIf) current()).elseIf(inlabel, test, whenThen, nextLinkRenderer(), color);
if (ok == false) {
@@ -371,7 +371,7 @@ public class ActivityDiagram3 extends UmlDiagram {
return CommandExecutionResult.error("Cannot find if");
}
- public void startRepeat(HtmlColor color, Display label, BoxStyle boxStyleIn, Colors colors) {
+ public void startRepeat(HColor color, Display label, BoxStyle boxStyleIn, Colors colors) {
manageSwimlaneStrategy();
final InstructionRepeat instructionRepeat = new InstructionRepeat(swinlanes.getCurrentSwimlane(), current(),
nextLinkRenderer(), color, label, boxStyleIn, colors);
@@ -410,7 +410,7 @@ public class ActivityDiagram3 extends UmlDiagram {
}
- public void doWhile(Display test, Display yes, HtmlColor color) {
+ public void doWhile(Display test, Display yes, HColor color) {
manageSwimlaneStrategy();
final InstructionWhile instructionWhile = new InstructionWhile(swinlanes.getCurrentSwimlane(), current(), test,
nextLinkRenderer(), yes, color, getSkinParam());
@@ -435,7 +435,7 @@ public class ActivityDiagram3 extends UmlDiagram {
return CommandExecutionResult.ok();
}
- public void startGroup(Display name, HtmlColor backColor, HtmlColor titleColor, HtmlColor borderColor,
+ public void startGroup(Display name, HColor backColor, HColor titleColor, HColor borderColor,
USymbol type, double roundCorner) {
manageSwimlaneStrategy();
final InstructionGroup instructionGroup = new InstructionGroup(current(), name, backColor, titleColor,
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/Branch.java b/src/net/sourceforge/plantuml/activitydiagram3/Branch.java
index 79b742408..af64a0b24 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/Branch.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/Branch.java
@@ -44,7 +44,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.WeldingPoint;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
@@ -54,6 +53,7 @@ import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleBuilder;
import net.sourceforge.plantuml.style.StyleSignature;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class Branch {
@@ -61,7 +61,7 @@ public class Branch {
private final Display labelTest;
private final Display labelPositive;
private final Display inlabel;
- private final HtmlColor color;
+ private final HColor color;
private LinkRendering inlinkRendering = LinkRendering.none();
private Ftile ftile;
@@ -79,7 +79,7 @@ public class Branch {
}
public Branch(StyleBuilder styleBuilder, Swimlane swimlane, Display labelPositive, Display labelTest,
- HtmlColor color, Display inlabel) {
+ HColor color, Display inlabel) {
if (labelPositive == null) {
throw new IllegalArgumentException();
}
@@ -162,7 +162,7 @@ public class Branch {
return ftile.skinParam();
}
- public final HtmlColor getColor() {
+ public final HColor getColor() {
return color;
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java
index 4fe8d574e..4848679a9 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionGroup.java
@@ -43,19 +43,19 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileWithNotes;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.USymbol;
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;
public class InstructionGroup implements Instruction, InstructionCollection {
private final InstructionList list;
private final Instruction parent;
- private final HtmlColor backColor;
- private final HtmlColor borderColor;
- private final HtmlColor titleColor;
+ private final HColor backColor;
+ private final HColor borderColor;
+ private final HColor titleColor;
private final LinkRendering linkRendering;
private final USymbol type;
@@ -67,8 +67,8 @@ public class InstructionGroup implements Instruction, InstructionCollection {
return list.containsBreak();
}
- public InstructionGroup(Instruction parent, Display test, HtmlColor backColor, HtmlColor titleColor,
- Swimlane swimlane, HtmlColor borderColor, LinkRendering linkRendering, USymbol type, double roundCorner) {
+ public InstructionGroup(Instruction parent, Display test, HColor backColor, HColor titleColor,
+ Swimlane swimlane, HColor borderColor, LinkRendering linkRendering, USymbol type, double roundCorner) {
this.list = new InstructionList(swimlane);
this.type = type;
this.linkRendering = linkRendering;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionIf.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionIf.java
index b19a94c39..c78b47392 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionIf.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionIf.java
@@ -50,10 +50,10 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.WeldingPoint;
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileWithNoteOpale;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
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;
public class InstructionIf extends WithNote implements Instruction, InstructionCollection {
@@ -84,7 +84,7 @@ public class InstructionIf extends WithNote implements Instruction, InstructionC
}
public InstructionIf(Swimlane swimlane, Instruction parent, Display labelTest, Display whenThen,
- LinkRendering inlinkRendering, HtmlColor color, ISkinParam skinParam, Url url) {
+ LinkRendering inlinkRendering, HColor color, ISkinParam skinParam, Url url) {
this.url = url;
this.parent = parent;
this.skinParam = skinParam;
@@ -142,7 +142,7 @@ public class InstructionIf extends WithNote implements Instruction, InstructionC
}
public boolean elseIf(Display inlabel, Display test, Display whenThen, LinkRendering nextLinkRenderer,
- HtmlColor color) {
+ HColor color) {
if (elseBranch != null) {
return false;
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java
index 40467e168..5ff0153ae 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java
@@ -43,10 +43,10 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileKilled;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
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;
public class InstructionRepeat implements Instruction {
@@ -73,7 +73,7 @@ public class InstructionRepeat implements Instruction {
return repeatList.containsBreak();
}
- public InstructionRepeat(Swimlane swimlane, Instruction parent, LinkRendering nextLinkRenderer, HtmlColor color,
+ public InstructionRepeat(Swimlane swimlane, Instruction parent, LinkRendering nextLinkRenderer, HColor color,
Display startLabel, BoxStyle boxStyleIn, Colors colors) {
this.boxStyleIn = boxStyleIn;
this.startLabel = startLabel;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSpot.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSpot.java
index 03a1fde31..3261fd0d6 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSpot.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSpot.java
@@ -39,20 +39,20 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileKilled;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class InstructionSpot extends MonoSwimable implements Instruction {
private boolean killed = false;
private final LinkRendering inlinkRendering;
private final String spot;
- private final HtmlColor color;
+ private final HColor color;
public boolean containsBreak() {
return false;
}
- public InstructionSpot(String spot, HtmlColor color, LinkRendering inlinkRendering, Swimlane swimlane) {
+ public InstructionSpot(String spot, HColor color, LinkRendering inlinkRendering, Swimlane swimlane) {
super(swimlane);
this.spot = spot;
this.inlinkRendering = inlinkRendering;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSwitch.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSwitch.java
index 63ca781e4..270dca865 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSwitch.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSwitch.java
@@ -46,7 +46,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class InstructionSwitch extends WithNote implements Instruction, InstructionCollection {
@@ -72,7 +72,7 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
}
public InstructionSwitch(Swimlane swimlane, Instruction parent, Display labelTest, LinkRendering inlinkRendering,
- HtmlColor color, ISkinParam skinParam) {
+ HColor color, ISkinParam skinParam) {
this.topInlinkRendering = inlinkRendering;
this.parent = parent;
this.skinParam = skinParam;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionWhile.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionWhile.java
index ca3ecb52f..9a8b27227 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionWhile.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionWhile.java
@@ -44,17 +44,17 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileKilled;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileWithNoteOpale;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
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;
public class InstructionWhile extends WithNote implements Instruction, InstructionCollection {
private final InstructionList repeatList = new InstructionList();
private final Instruction parent;
private final LinkRendering nextLinkRenderer;
- private final HtmlColor color;
+ private final HColor color;
private boolean killed = false;
private final Display test;
@@ -73,7 +73,7 @@ public class InstructionWhile extends WithNote implements Instruction, Instructi
}
public InstructionWhile(Swimlane swimlane, Instruction parent, Display test, LinkRendering nextLinkRenderer,
- Display yes, HtmlColor color, ISkinParam skinParam) {
+ Display yes, HColor color, ISkinParam skinParam) {
if (test == null) {
throw new IllegalArgumentException();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandCircleSpot3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandCircleSpot3.java
index 6e822a853..f71501cf5 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandCircleSpot3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandCircleSpot3.java
@@ -43,8 +43,8 @@ import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandCircleSpot3 extends SingleLineCommand2 {
@@ -62,7 +62,7 @@ public class CommandCircleSpot3 extends SingleLineCommand2 {
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
- final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
+ final HColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
diagram.addSpot(arg.get("SPOT", 0), color);
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf2.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf2.java
index 236c045fa..680a3c749 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf2.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf2.java
@@ -45,8 +45,8 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandElseIf2 extends SingleLineCommand2 {
@@ -80,7 +80,7 @@ public class CommandElseIf2 extends SingleLineCommand2 {
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
- final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
+ final HColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
String test = arg.get("TEST", 0);
if (test.length() == 0) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2.java
index 933e562d7..e264ff25f 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2.java
@@ -48,8 +48,8 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandIf2 extends SingleLineCommand2 {
@@ -79,7 +79,7 @@ public class CommandIf2 extends SingleLineCommand2 {
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
- final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
+ final HColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
String test = arg.get("TEST", 0);
if (test.length() == 0) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf4.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf4.java
index b309b0935..c6719a4a5 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf4.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf4.java
@@ -44,8 +44,8 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandIf4 extends SingleLineCommand2 {
@@ -76,7 +76,7 @@ public class CommandIf4 extends SingleLineCommand2 {
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
- final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
+ final HColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
String test = arg.get("TEST", 0);
if (test.length() == 0) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandLink3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandLink3.java
index b4b99b2df..1a702ab9a 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandLink3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandLink3.java
@@ -43,8 +43,8 @@ import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandLink3 extends SingleLineCommand2 {
@@ -63,7 +63,7 @@ public class CommandLink3 extends SingleLineCommand2 {
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
- final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
+ final HColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
if (color != null) {
diagram.setColorNextArrow(Rainbow.fromColor(color));
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java
index 77d479830..928d622ce 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java
@@ -49,8 +49,6 @@ import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
@@ -59,6 +57,8 @@ import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignature;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class CommandPartition3 extends SingleLineCommand2 {
@@ -129,20 +129,20 @@ public class CommandPartition3 extends SingleLineCommand2 {
final String stereo = arg.get("STEREO", 0);
final Stereotype stereotype = stereo == null ? null : new Stereotype(stereo);
- final HtmlColor backColorInSkinparam = diagram.getSkinParam().getHtmlColor(getColorParamBack(symbol),
+ final HColor backColorInSkinparam = diagram.getSkinParam().getHtmlColor(getColorParamBack(symbol),
stereotype, false);
- HtmlColor backColor;
+ HColor backColor;
if (backColorInSkinparam == null) {
backColor = colors.getColor(ColorType.BACK);
} else {
backColor = backColorInSkinparam;
}
- HtmlColor titleColor = colors.getColor(ColorType.HEADER);
+ HColor titleColor = colors.getColor(ColorType.HEADER);
// Warning : titleColor unused in FTileGroupW
- HtmlColor borderColor = diagram.getSkinParam().getHtmlColor(getColorParamBorder(symbol), stereotype, false);
+ HColor borderColor = diagram.getSkinParam().getHtmlColor(getColorParamBorder(symbol), stereotype, false);
if (borderColor == null) {
- borderColor = HtmlColorUtils.BLACK;
+ borderColor = HColorUtils.BLACK;
}
double roundCorner = symbol.getSkinParameter().getRoundCorner(diagram.getSkinParam(), stereotype);
@@ -155,7 +155,7 @@ public class CommandPartition3 extends SingleLineCommand2 {
backColor = stylePartition.value(PName.BackGroundColor).asColor(
diagram.getSkinParam().getIHtmlColorSet());
}
- titleColor = HtmlColorUtils.BLUE;// stylePartition.value(PName.FontColor).asColor(diagram.getSkinParam().getIHtmlColorSet());
+ titleColor = HColorUtils.BLUE;// stylePartition.value(PName.FontColor).asColor(diagram.getSkinParam().getIHtmlColorSet());
roundCorner = stylePartition.value(PName.RoundCorner).asDouble();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeat3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeat3.java
index 929768ce3..2812bac5c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeat3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeat3.java
@@ -48,10 +48,10 @@ import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandRepeat3 extends SingleLineCommand2 {
@@ -77,7 +77,7 @@ public class CommandRepeat3 extends SingleLineCommand2 {
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
- final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
+ final HColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
final Display label = Display.getWithNewlines(arg.get("LABEL", 0));
final BoxStyle boxStyle;
final String styleString = arg.get("STYLE", 0);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane.java
index 15b580bbc..a8044eac1 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane.java
@@ -44,8 +44,8 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandSwimlane extends SingleLineCommand2 {
@@ -65,7 +65,7 @@ public class CommandSwimlane extends SingleLineCommand2 {
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
- final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
+ final HColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
final String name = arg.get("SWIMLANE", 0);
final Display label = Display.getWithNewlines(arg.get("LABEL", 0));
return diagram.swimlane(name, color, label);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane2.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane2.java
index 5a1ba1462..30b783d66 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane2.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane2.java
@@ -45,8 +45,8 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandSwimlane2 extends SingleLineCommand2 {
@@ -73,7 +73,7 @@ public class CommandSwimlane2 extends SingleLineCommand2 {
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
- final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
+ final HColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
final String name = arg.get("SWIMLANE", 0);
final Display label = Display.getWithNewlines(arg.get("LABEL", 0));
return diagram.swimlane(name, color, label);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwitch.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwitch.java
index 5586b603e..84f199f9d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwitch.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwitch.java
@@ -44,8 +44,8 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandSwitch extends SingleLineCommand2 {
@@ -67,7 +67,7 @@ public class CommandSwitch extends SingleLineCommand2 {
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
- final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
+ final HColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
String test = arg.get("TEST", 0);
if (test.length() == 0) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhile3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhile3.java
index 38c4a80d6..324e3cc98 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhile3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhile3.java
@@ -45,8 +45,8 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorParser;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandWhile3 extends SingleLineCommand2 {
@@ -73,7 +73,7 @@ public class CommandWhile3 extends SingleLineCommand2 {
@Override
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg) {
- final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
+ final HColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
diagram.doWhile(Display.getWithNewlines(arg.get("TEST", 0)), Display.getWithNewlines(arg.get("YES", 0)), color);
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java
index 0977926b7..69cadd9fb 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/AbstractFtile.java
@@ -45,11 +45,11 @@ import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.IHtmlColorSet;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public abstract class AbstractFtile extends AbstractTextBlock implements Ftile {
@@ -66,7 +66,7 @@ public abstract class AbstractFtile extends AbstractTextBlock implements Ftile {
return skinParam;
}
- final public IHtmlColorSet getIHtmlColorSet() {
+ final public HColorSet getIHtmlColorSet() {
return skinParam.getIHtmlColorSet();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/BoxStyle.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/BoxStyle.java
index 4bddf93a3..ae4646549 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/BoxStyle.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/BoxStyle.java
@@ -50,7 +50,7 @@ public enum BoxStyle {
PLAIN {
@Override
protected Shadowable getShape(double width, double height, double roundCorner) {
- return new URectangle(width, height, roundCorner, roundCorner);
+ return new URectangle(width, height).rounded(roundCorner);
}
},
SDL_INPUT('<') {
@@ -83,9 +83,9 @@ public enum BoxStyle {
final URectangle rect = new URectangle(width, height);
rect.setDeltaShadow(shadowing);
ug.draw(rect);
- final ULine vline = new ULine(0, height);
- ug.apply(new UTranslate(PADDING, 0)).draw(vline);
- ug.apply(new UTranslate(width - PADDING, 0)).draw(vline);
+ final ULine vline = ULine.vline(height);
+ ug.apply(UTranslate.dx(PADDING)).draw(vline);
+ ug.apply(UTranslate.dx(width - PADDING)).draw(vline);
}
},
SDL_SAVE('\\') {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/CollisionDetector.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/CollisionDetector.java
index 32a5c29e7..e0b1923f3 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/CollisionDetector.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/CollisionDetector.java
@@ -40,10 +40,7 @@ import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.Url;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChange;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
@@ -57,6 +54,9 @@ import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class CollisionDetector implements UGraphic {
@@ -88,7 +88,7 @@ public class CollisionDetector implements UGraphic {
minmax.drawGrey(ug);
}
}
- final HtmlColor color = HtmlColorUtils.BLACK;
+ final HColor color = HColorUtils.BLACK;
ug = ug.apply(new UChangeColor(color)).apply(new UStroke(5));
for (Snake snake : snakes) {
for (Line2D line : snake.getHorizontalLines()) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java
index 28e07855b..59e0a826c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/EntityImageLegend.java
@@ -42,11 +42,11 @@ import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class EntityImageLegend {
@@ -55,8 +55,8 @@ public class EntityImageLegend {
final TextBlock textBlock = note.create(new FontConfiguration(skinParam, FontParam.LEGEND, null),
HorizontalAlignment.LEFT, skinParam);
final Rose rose = new Rose();
- final HtmlColor legendBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.legendBackground);
- final HtmlColor legendColor = rose.getHtmlColor(skinParam, ColorParam.legendBorder);
+ final HColor legendBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.legendBackground);
+ final HColor legendColor = rose.getHtmlColor(skinParam, ColorParam.legendBorder);
final UStroke stroke = skinParam.getThickness(LineParam.legendBorder, null);
final int cornersize = 10;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java
index cbb78ae95..5af01bed8 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileAssemblySimple.java
@@ -133,7 +133,7 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
private UTranslate getTranslated1(StringBounder stringBounder) {
final double left = calculateDimension(stringBounder).getLeft();
- return new UTranslate(left - tile1.calculateDimension(stringBounder).getLeft(), 0);
+ return UTranslate.dx(left - tile1.calculateDimension(stringBounder).getLeft());
}
private UTranslate getTranslated2(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java
index 3ad653946..77c927698 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactory.java
@@ -46,10 +46,10 @@ import net.sourceforge.plantuml.activitydiagram3.Instruction;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.Colors;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public interface FtileFactory {
@@ -63,7 +63,7 @@ public interface FtileFactory {
public Ftile end(Swimlane swimlane);
- public Ftile spot(Swimlane swimlane, String spot, HtmlColor color);
+ public Ftile spot(Swimlane swimlane, String spot, HColor color);
public Ftile activity(Display label, Swimlane swimlane, BoxStyle style, Colors colors);
@@ -82,7 +82,7 @@ public interface FtileFactory {
Ftile backward, boolean noOut);
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
- LinkRendering afterEndwhile, HtmlColor color, Instruction specialOut);
+ LinkRendering afterEndwhile, HColor color, Instruction specialOut);
public Ftile createIf(Swimlane swimlane, List thens, Branch elseBranch, LinkRendering afterEndwhile,
LinkRendering topInlinkRendering, Url url);
@@ -92,7 +92,7 @@ public interface FtileFactory {
public Ftile createParallel(List all, ForkStyle style, String label, Swimlane in, Swimlane out);
- public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note,
- HtmlColor borderColor, USymbol type, double roundCorner);
+ public Ftile createGroup(Ftile list, Display name, HColor backColor, HColor titleColor, PositionedNote note,
+ HColor borderColor, USymbol type, double roundCorner);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java
index fce49ae03..927b5e9ca 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileFactoryDelegator.java
@@ -51,7 +51,6 @@ import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -61,6 +60,7 @@ import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignature;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class FtileFactoryDelegator implements FtileFactory {
@@ -145,7 +145,7 @@ public class FtileFactoryDelegator implements FtileFactory {
return factory.stop(swimlane);
}
- public Ftile spot(Swimlane swimlane, String spot, HtmlColor color) {
+ public Ftile spot(Swimlane swimlane, String spot, HColor color) {
return factory.spot(swimlane, spot, color);
}
@@ -187,7 +187,7 @@ public class FtileFactoryDelegator implements FtileFactory {
}
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
- LinkRendering afterEndwhile, HtmlColor color, Instruction specialOut) {
+ LinkRendering afterEndwhile, HColor color, Instruction specialOut) {
return factory.createWhile(swimlane, whileBlock, test, yes, out, afterEndwhile, color, specialOut);
}
@@ -205,8 +205,8 @@ public class FtileFactoryDelegator implements FtileFactory {
return factory.createParallel(all, style, label, in, out);
}
- public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note,
- HtmlColor borderColor, USymbol type, double roundCorner) {
+ public Ftile createGroup(Ftile list, Display name, HColor backColor, HColor titleColor, PositionedNote note,
+ HColor borderColor, USymbol type, double roundCorner) {
return factory.createGroup(list, name, backColor, titleColor, note, borderColor, type, roundCorner);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileHeightFixed.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileHeightFixed.java
index d5ee3b610..48034d41b 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileHeightFixed.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileHeightFixed.java
@@ -86,7 +86,7 @@ public class FtileHeightFixed extends AbstractFtile {
if (dim.getHeight() > fixedHeight) {
throw new IllegalStateException();
}
- return new UTranslate(0, (fixedHeight - dim.getHeight()) / 2);
+ return UTranslate.dy((fixedHeight - dim.getHeight()) / 2);
}
public void drawU(UGraphic ug) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMarged.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMarged.java
index 304cf07a3..e73d0687e 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMarged.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMarged.java
@@ -102,7 +102,7 @@ public class FtileMarged extends AbstractFtile {
}
private UTranslate getTranslate() {
- return new UTranslate(margin1, 0);
+ return UTranslate.dx(margin1);
}
public void drawU(UGraphic ug) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedVertically.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedVertically.java
index 4a5651b4b..9c10f91b9 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedVertically.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMargedVertically.java
@@ -53,7 +53,7 @@ public class FtileMargedVertically extends FtileDecorate {
public void drawU(UGraphic ug) {
if (margin1 > 0) {
- ug = ug.apply(new UTranslate(0, margin1));
+ ug = ug.apply(UTranslate.dy(margin1));
}
ug.draw(getFtileDelegated());
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMinWidth.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMinWidth.java
index fac071ab8..dec42bb76 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMinWidth.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/FtileMinWidth.java
@@ -87,7 +87,7 @@ public class FtileMinWidth extends FtileDecorate {
private UTranslate getUTranslateInternal(final StringBounder stringBounder) {
final Dimension2D dimTile = getFtileDelegated().calculateDimension(stringBounder);
final Dimension2D dimTotal = getDimensionInternal(stringBounder);
- final UTranslate change = new UTranslate((dimTotal.getWidth() - dimTile.getWidth()) / 2, 0);
+ final UTranslate change = UTranslate.dx((dimTotal.getWidth() - dimTile.getWidth()) / 2);
return change;
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java
index 23f2d56a0..bc6079179 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Snake.java
@@ -68,8 +68,8 @@ public class Snake implements UShape {
private Direction emphasizeDirection;
private final HorizontalAlignment horizontalAlignment;
- public final void setIgnoreForCompression(boolean ignoreForCompression) {
- this.worm.setIgnoreForCompression(ignoreForCompression);
+ public final void setIgnoreForCompression() {
+ this.worm.setIgnoreForCompression();
}
public Snake transformX(CompressionTransform compressionTransform) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java
index cb3aa282e..ab0e6297c 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java
@@ -38,11 +38,11 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SpecificBackcolorable;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class Swimlane implements SpecificBackcolorable {
@@ -88,7 +88,7 @@ public class Swimlane implements SpecificBackcolorable {
return colors;
}
- public void setSpecificColorTOBEREMOVED(ColorType type, HtmlColor color) {
+ public void setSpecificColorTOBEREMOVED(ColorType type, HColor color) {
if (color != null) {
this.colors = colors.add(type, color);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesA.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesA.java
index 9dc8909eb..710362303 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesA.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesA.java
@@ -57,7 +57,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.UGraphicIntercep
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.VCompactFactory;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -77,6 +76,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.comp.SlotSet;
import net.sourceforge.plantuml.utils.MathUtils;
@@ -126,7 +126,7 @@ public class SwimlanesA extends AbstractTextBlock implements TextBlock, Styleabl
return factory;
}
- public void swimlane(String name, HtmlColor color, Display label) {
+ public void swimlane(String name, HColor color, Display label) {
currentSwimlane = getOrCreate(name);
if (color != null) {
currentSwimlane.setSpecificColorTOBEREMOVED(ColorType.BACK, color);
@@ -203,7 +203,7 @@ public class SwimlanesA extends AbstractTextBlock implements TextBlock, Styleabl
drawWhenSwimlanes(ug, full);
}
- static private void printDebug(UGraphic ug, SlotSet slot, HtmlColor col, TextBlock full) {
+ static private void printDebug(UGraphic ug, SlotSet slot, HColor col, TextBlock full) {
slot.drawDebugX(ug.apply(new UChangeColor(col)).apply(new UChangeBackColor(col)),
full.calculateDimension(ug.getStringBounder()).getHeight());
@@ -218,13 +218,12 @@ public class SwimlanesA extends AbstractTextBlock implements TextBlock, Styleabl
double x2 = 0;
for (Swimlane swimlane : swimlanes) {
- final HtmlColor back = swimlane.getColors(skinParam).getColor(ColorType.BACK);
+ final HColor back = swimlane.getColors(skinParam).getColor(ColorType.BACK);
if (back != null) {
final UGraphic background = ug.apply(new UChangeBackColor(back)).apply(new UChangeColor(back))
- .apply(new UTranslate(x2, 0));
+ .apply(UTranslate.dx(x2));
final URectangle rectangle = new URectangle(swimlane.getActualWidth(), dimensionFull.getHeight()
- + titleHeightTranslate.getDy());
- rectangle.setIgnoreForCompression(true);
+ + titleHeightTranslate.getDy()).ignoreForCompression();
background.draw(rectangle);
}
@@ -270,8 +269,8 @@ public class SwimlanesA extends AbstractTextBlock implements TextBlock, Styleabl
for (Swimlane swimlane : swimlanes) {
final double swimlaneActualWidth = swimlaneActualWidth(ug.getStringBounder(), swimlaneWidth, swimlane);
- final UTranslate translate = new UTranslate(x1 - swimlane.getMinMax().getMinX() + separationMargin
- + (swimlaneActualWidth - rawDrawingWidth(swimlane)) / 2.0, 0);
+ final UTranslate translate = UTranslate.dx(x1 - swimlane.getMinMax().getMinX() + separationMargin
+ + (swimlaneActualWidth - rawDrawingWidth(swimlane)) / 2.0);
swimlane.setTranslateAndWidth(translate, swimlaneActualWidth);
x1 += swimlaneActualWidth;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesB.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesB.java
index 2a33556e8..d973307b3 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesB.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesB.java
@@ -43,7 +43,6 @@ import net.sourceforge.plantuml.Pragma;
import net.sourceforge.plantuml.SkinParam;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.style.PName;
@@ -52,6 +51,7 @@ import net.sourceforge.plantuml.ugraphic.UChangeColor;
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.utils.MathUtils;
public class SwimlanesB extends SwimlanesA {
@@ -67,21 +67,20 @@ public class SwimlanesB extends SwimlanesA {
final StringBounder stringBounder = ug.getStringBounder();
- HtmlColor color = skinParam.getHtmlColor(ColorParam.swimlaneTitleBackground, null, false);
+ HColor color = skinParam.getHtmlColor(ColorParam.swimlaneTitleBackground, null, false);
if (SkinParam.USE_STYLES()) {
color = getStyle().value(PName.BackGroundColor).asColor(skinParam.getIHtmlColorSet());
}
if (color != null) {
final double titleHeight = getTitlesHeight(stringBounder);
- final URectangle back = new URectangle(getTitlesWidth(stringBounder), titleHeight);
- back.setIgnoreForCompression(true);
+ final URectangle back = new URectangle(getTitlesWidth(stringBounder), titleHeight).ignoreForCompression();
ug.apply(new UChangeBackColor(color)).apply(new UChangeColor(color)).draw(back);
}
for (Swimlane swimlane : swimlanes) {
final TextBlock swTitle = getTitle(swimlane);
final double titleWidth = swTitle.calculateDimension(stringBounder).getWidth();
final double posTitle = x2 + (swimlane.getActualWidth() - titleWidth) / 2;
- swTitle.drawU(ug.apply(new UTranslate(posTitle, 0)));
+ swTitle.drawU(ug.apply(UTranslate.dx(posTitle)));
x2 += swimlane.getActualWidth();
}
}
@@ -132,7 +131,7 @@ public class SwimlanesB extends SwimlanesA {
@Override
protected UTranslate getTitleHeightTranslate(final StringBounder stringBounder) {
double titlesHeight = getTitlesHeight(stringBounder);
- return new UTranslate(0, titlesHeight > 0 ? titlesHeight + 5 : 0);
+ return UTranslate.dy(titlesHeight > 0 ? titlesHeight + 5 : 0);
}
private double getTitlesHeight(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesC.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesC.java
index b84c49cf8..679519bad 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesC.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/SwimlanesC.java
@@ -42,7 +42,6 @@ import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.Pragma;
import net.sourceforge.plantuml.SkinParam;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.rose.Rose;
@@ -52,6 +51,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.HColor;
public class SwimlanesC extends SwimlanesB {
@@ -70,17 +70,17 @@ public class SwimlanesC extends SwimlanesB {
final UTranslate titleHeightTranslate = getTitleHeightTranslate(stringBounder);
for (Swimlane swimlane : swimlanes) {
- drawSeparation(ug.apply(new UTranslate(x2, 0)), dimensionFull.getHeight() + titleHeightTranslate.getDy());
+ drawSeparation(ug.apply(UTranslate.dx(x2)), dimensionFull.getHeight() + titleHeightTranslate.getDy());
x2 += swimlane.getActualWidth();
}
- drawSeparation(ug.apply(new UTranslate(x2, 0)), dimensionFull.getHeight() + titleHeightTranslate.getDy());
+ drawSeparation(ug.apply(UTranslate.dx(x2)), dimensionFull.getHeight() + titleHeightTranslate.getDy());
}
private void drawSeparation(UGraphic ug, double height) {
- HtmlColor color = skinParam.getHtmlColor(ColorParam.swimlaneBorder, null, false);
+ HColor color = skinParam.getHtmlColor(ColorParam.swimlaneBorder, null, false);
if (color == null) {
color = ColorParam.swimlaneBorder.getDefaultValue();
}
@@ -89,7 +89,7 @@ public class SwimlanesC extends SwimlanesB {
color = getStyle().value(PName.LineColor).asColor(skinParam.getIHtmlColorSet());
thickness = getStyle().getStroke();
}
- ug.apply(thickness).apply(new UChangeColor(color)).draw(new ULine(0, height));
+ ug.apply(thickness).apply(new UChangeColor(color)).draw(ULine.vline(height));
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/UGraphicInterceptorUDrawable2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/UGraphicInterceptorUDrawable2.java
index 670600614..14051bb81 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/UGraphicInterceptorUDrawable2.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/UGraphicInterceptorUDrawable2.java
@@ -38,7 +38,6 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
import java.awt.geom.Point2D;
import java.util.Map;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.graphic.UGraphicDelegator;
import net.sourceforge.plantuml.svek.UGraphicForSnake;
@@ -50,6 +49,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;
public class UGraphicInterceptorUDrawable2 extends UGraphicDelegator {
@@ -89,8 +89,8 @@ public class UGraphicInterceptorUDrawable2 extends UGraphicDelegator {
private void drawGoto(FtileGoto ftile) {
final FtileGeometry geom = ftile.calculateDimension(getStringBounder());
final Point2D pt = geom.getPointIn();
- UGraphic ugGoto = getUg().apply(new UChangeColor(HtmlColorUtils.GREEN)).apply(
- new UChangeBackColor(HtmlColorUtils.GREEN));
+ UGraphic ugGoto = getUg().apply(new UChangeColor(HColorUtils.GREEN)).apply(
+ new UChangeBackColor(HColorUtils.GREEN));
ugGoto = ugGoto.apply(new UTranslate(pt));
final UTranslate posNow = getPosition();
final UTranslate dest = positions.get(ftile.getName());
@@ -98,8 +98,8 @@ public class UGraphicInterceptorUDrawable2 extends UGraphicDelegator {
final double dy = dest.getDy() - posNow.getDy();
ugGoto.draw(new UEllipse(3, 3));
ugGoto.apply(new UTranslate(dx, dy)).draw(new UEllipse(3, 3));
- ugGoto.draw(new ULine(dx, 0));
- ugGoto.apply(new UTranslate(dx, 0)).draw(new ULine(0, dy));
+ ugGoto.draw(ULine.hline(dx));
+ ugGoto.apply(UTranslate.dx(dx)).draw(ULine.vline(dy));
// ugGoto.draw(new ULine(dx, dy));
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java
index 911fd434b..76a6a6fbd 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java
@@ -45,7 +45,6 @@ import java.util.List;
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.cucadiagram.LinkStyle;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
@@ -55,6 +54,7 @@ import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.comp.CompressionMode;
public class Worm implements Iterable {
@@ -67,13 +67,13 @@ public class Worm implements Iterable {
private boolean ignoreForCompression;
- public final void setIgnoreForCompression(boolean ignoreForCompression) {
- this.ignoreForCompression = ignoreForCompression;
+ public final void setIgnoreForCompression() {
+ this.ignoreForCompression = true;
}
public void drawInternalOneColor(UPolygon startDecoration, UGraphic ug, HtmlColorAndStyle color, double stroke,
Direction emphasizeDirection, UPolygon endDecoration) {
- final HtmlColor color2 = color.getColor();
+ final HColor color2 = color.getColor();
if (color2 == null) {
throw new IllegalArgumentException();
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormMutation.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormMutation.java
index d5891d158..0bd0cf827 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormMutation.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/WormMutation.java
@@ -135,19 +135,19 @@ public class WormMutation {
private static UTranslate translation(int type, double delta) {
switch (type) {
case 1:
- return new UTranslate(0, -delta);
+ return UTranslate.dy(-delta);
case 2:
return new UTranslate(delta, -delta);
case 3:
- return new UTranslate(delta, 0);
+ return UTranslate.dx(delta);
case 4:
return new UTranslate(delta, delta);
case 5:
- return new UTranslate(0, delta);
+ return UTranslate.dy(delta);
case 6:
return new UTranslate(-delta, delta);
case 7:
- return new UTranslate(-delta, 0);
+ return UTranslate.dx(-delta);
case 8:
return new UTranslate(-delta, -delta);
}
@@ -182,7 +182,7 @@ public class WormMutation {
for (UTranslate tr : translations) {
result.append(tr.getDx());
}
- return new UTranslate(result.getExtreme() * (size - 1), 0);
+ return UTranslate.dx(result.getExtreme() * (size - 1));
}
public boolean isDxNegative() {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Zad.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Zad.java
index 97af63ff0..c6eb486c1 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Zad.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Zad.java
@@ -38,11 +38,11 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
import java.util.ArrayList;
import java.util.List;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class Zad {
@@ -55,7 +55,7 @@ public class Zad {
}
public void drawDebug(UGraphic ug) {
- ug = ug.apply(new UChangeBackColor(HtmlColorUtils.BLUE)).apply(new UChangeColor(HtmlColorUtils.RED_LIGHT));
+ ug = ug.apply(new UChangeBackColor(HColorUtils.BLUE)).apply(new UChangeColor(HColorUtils.RED_LIGHT));
for (MinMax minMax : rectangles) {
System.err.println("minmax=" + minMax);
minMax.drawGrey(ug);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/ZadBuilder.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/ZadBuilder.java
index 2bc8e2828..e744042da 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/ZadBuilder.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/ZadBuilder.java
@@ -37,7 +37,6 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChange;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
@@ -49,6 +48,7 @@ import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
public class ZadBuilder implements UGraphic {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java
index 0670a2b58..3da553f1f 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FloatingNote.java
@@ -51,13 +51,13 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.svek.image.Opale;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class FloatingNote extends AbstractTextBlock implements Stencil, TextBlock {
@@ -67,8 +67,8 @@ public class FloatingNote extends AbstractTextBlock implements Stencil, TextBloc
final Rose rose = new Rose();
- final HtmlColor noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
- final HtmlColor borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
+ final HColor noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
+ final HColor borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
final FontConfiguration fc = new FontConfiguration(skinParam, FontParam.NOTE, null);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java
index 883f449d7..bed47c9e1 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorCreateGroup.java
@@ -43,9 +43,9 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.skin.rose.Rose;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class FtileFactoryDelegatorCreateGroup extends FtileFactoryDelegator {
@@ -56,9 +56,9 @@ public class FtileFactoryDelegatorCreateGroup extends FtileFactoryDelegator {
}
@Override
- public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note,
- HtmlColor borderColor, USymbol type, double roundCorner) {
- final HtmlColor arrowColor = rose.getHtmlColor(skinParam(), ColorParam.arrow);
+ public Ftile createGroup(Ftile list, Display name, HColor backColor, HColor titleColor, PositionedNote note,
+ HColor borderColor, USymbol type, double roundCorner) {
+ final HColor arrowColor = rose.getHtmlColor(skinParam(), ColorParam.arrow);
Ftile result = new FtileGroup(list, name, null, arrowColor, backColor, titleColor, skinParam(), borderColor,
type, roundCorner);
if (note != null) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java
index af97283dd..57b2763fd 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java
@@ -50,12 +50,12 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond.ConditionalBuilder;
import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.svek.ConditionEndStyle;
import net.sourceforge.plantuml.svek.ConditionStyle;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
@@ -74,8 +74,8 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
final ConditionEndStyle conditionEndStyle = skinParam().getConditionEndStyle();
final Branch branch0 = thens.get(0);
- final HtmlColor borderColor;
- final HtmlColor backColor;
+ final HColor borderColor;
+ final HColor backColor;
final Rainbow arrowColor;
final FontConfiguration fcTest;
final FontParam testParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
@@ -113,7 +113,7 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
conditionEndStyle, thens.get(0), elseBranch, skinParam(), getStringBounder(), fcArrow, fcTest, url);
}
- private HtmlColor fontColor(FontParam param) {
+ private HColor fontColor(FontParam param) {
return skinParam().getFontHtmlColor(null, param);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java
index 2086d28ea..702038be8 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorRepeat.java
@@ -57,7 +57,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.WeldingPoint;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
@@ -66,6 +65,7 @@ import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
@@ -80,8 +80,8 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
final ConditionStyle conditionStyle = skinParam().getConditionStyle();
- final HtmlColor borderColor;
- final HtmlColor diamondColor;
+ final HColor borderColor;
+ final HColor diamondColor;
final Rainbow arrowColor;
final FontConfiguration fcDiamond;
final FontConfiguration fcArrow;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorSwitch.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorSwitch.java
index 2897197c4..83ce01867 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorSwitch.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorSwitch.java
@@ -55,10 +55,10 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInsi
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator {
@@ -113,8 +113,8 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator {
}
private Ftile getDiamond1(Swimlane swimlane, Branch branch0, Display test) {
- final HtmlColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
- final HtmlColor backColor = branch0.getColor() == null ? getRose().getHtmlColor(skinParam(),
+ final HColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
+ final HColor backColor = branch0.getColor() == null ? getRose().getHtmlColor(skinParam(),
ColorParam.activityDiamondBackground) : branch0.getColor();
final FontConfiguration fcDiamond = new FontConfiguration(skinParam(), FontParam.ACTIVITY_DIAMOND, null);
@@ -126,14 +126,14 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator {
}
private Ftile getDiamond2(Swimlane swimlane, Branch branch0) {
- final HtmlColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
- final HtmlColor backColor = branch0.getColor() == null ? getRose().getHtmlColor(skinParam(),
+ final HColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
+ final HColor backColor = branch0.getColor() == null ? getRose().getHtmlColor(skinParam(),
ColorParam.activityDiamondBackground) : branch0.getColor();
return new FtileDiamondInside(branch0.skinParam(), backColor, borderColor, swimlane, TextBlockUtils.empty(0, 0));
}
- private HtmlColor fontColor(FontParam param) {
+ private HColor fontColor(FontParam param) {
return skinParam().getFontHtmlColor(null, param);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java
index dd2c6704d..f735197c1 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorWhile.java
@@ -56,13 +56,13 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.WeldingPoint;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
@@ -72,10 +72,10 @@ public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
@Override
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
- LinkRendering afterEndwhile, HtmlColor color, Instruction specialOut) {
+ LinkRendering afterEndwhile, HColor color, Instruction specialOut) {
- final HtmlColor borderColor;
- final HtmlColor backColor;
+ final HColor borderColor;
+ final HColor backColor;
final Rainbow arrowColor;
final FontConfiguration fontArrow;
final FontConfiguration fcTest;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java
index da520dfea..b267c779a 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInner.java
@@ -87,7 +87,7 @@ class FtileForkInner extends AbstractFtile {
double xpos = 0;
for (Ftile ftile : forks) {
- ug.apply(new UTranslate(xpos, 0)).draw(ftile);
+ ug.apply(UTranslate.dx(xpos)).draw(ftile);
final Dimension2D dim = ftile.calculateDimension(stringBounder);
xpos += dim.getWidth();
}
@@ -112,7 +112,7 @@ class FtileForkInner extends AbstractFtile {
double xpos = 0;
for (Ftile ftile : forks) {
if (ftile == searched) {
- return new UTranslate(xpos, 0);
+ return UTranslate.dx(xpos);
}
final Dimension2D dim = ftile.calculateDimension(stringBounder);
xpos += dim.getWidth();
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInnerOverlapped.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInnerOverlapped.java
index 065170005..5076cf749 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInnerOverlapped.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileForkInnerOverlapped.java
@@ -87,7 +87,7 @@ class FtileForkInnerOverlapped extends AbstractFtile {
final double xpos = 0;
for (Ftile ftile : forks) {
- ug.apply(new UTranslate(xpos, 0)).draw(ftile);
+ ug.apply(UTranslate.dx(xpos)).draw(ftile);
// final Dimension2D dim = ftile.calculateDimension(stringBounder);
// xpos += dim.getWidth();
}
@@ -113,7 +113,7 @@ class FtileForkInnerOverlapped extends AbstractFtile {
final double xpos = 0;
for (Ftile ftile : forks) {
if (ftile == searched) {
- return new UTranslate(xpos, 0);
+ return UTranslate.dx(xpos);
}
// final Dimension2D dim = ftile.calculateDimension(stringBounder);
// xpos += dim.getWidth();
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java
index 978acf8e1..d21e36fa8 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileGroup.java
@@ -53,8 +53,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -72,6 +70,8 @@ import net.sourceforge.plantuml.ugraphic.UFont;
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.utils.MathUtils;
public class FtileGroup extends AbstractFtile {
@@ -80,8 +80,8 @@ public class FtileGroup extends AbstractFtile {
private final Ftile inner;
private final TextBlock name;
private final TextBlock headerNote;
- private final HtmlColor borderColor;
- private final HtmlColor backColor;
+ private final HColor borderColor;
+ private final HColor backColor;
private final double shadowing;
private final UStroke stroke;
private final USymbol type;
@@ -91,14 +91,14 @@ public class FtileGroup extends AbstractFtile {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.partition);
}
- public FtileGroup(Ftile inner, Display title, Display displayNote, HtmlColor arrowColor, HtmlColor backColor,
- HtmlColor titleColor, ISkinParam skinParam, HtmlColor borderColor, USymbol type, double roundCorner) {
+ public FtileGroup(Ftile inner, Display title, Display displayNote, HColor arrowColor, HColor backColor,
+ HColor titleColor, ISkinParam skinParam, HColor borderColor, USymbol type, double roundCorner) {
super(inner.skinParam());
this.roundCorner = roundCorner;
this.type = type;
- this.backColor = backColor == null ? HtmlColorUtils.WHITE : backColor;
+ this.backColor = backColor == null ? HColorUtils.WHITE : backColor;
this.inner = FtileUtils.addHorizontalMargin(inner, 10);
- this.borderColor = borderColor == null ? HtmlColorUtils.BLACK : borderColor;
+ this.borderColor = borderColor == null ? HColorUtils.BLACK : borderColor;
final FontConfiguration fc;
if (SkinParam.USE_STYLES()) {
@@ -107,7 +107,7 @@ public class FtileGroup extends AbstractFtile {
this.shadowing = style.value(PName.Shadowing).asDouble();
} else {
final UFont font = skinParam.getFont(null, false, FontParam.PARTITION);
- final HtmlColor fontColor = skinParam.getFontHtmlColor(null, FontParam.PARTITION);
+ final HColor fontColor = skinParam.getFontHtmlColor(null, FontParam.PARTITION);
fc = new FontConfiguration(font, fontColor, skinParam.getHyperlinkColor(),
skinParam.useUnderlineForHyperlink(), skinParam.getTabSize());
this.shadowing = skinParam().shadowing(null) ? 3 : 0;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java
index 6a1e91e40..02eda2028 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfAndStop.java
@@ -68,13 +68,13 @@ import net.sourceforge.plantuml.creole.SheetBlock2;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
class FtileIfAndStop extends AbstractFtile {
@@ -111,7 +111,7 @@ class FtileIfAndStop extends AbstractFtile {
return getSwimlaneIn();
}
- static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, Rainbow arrowColor,
+ static Ftile create(Swimlane swimlane, HColor borderColor, HColor backColor, Rainbow arrowColor,
FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch nonStop, ISkinParam skinParam,
StringBounder stringBounder, Display labelTest) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java
index fd68b59c3..b2da362f2 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongHorizontal.java
@@ -67,13 +67,13 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInsi
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
class FtileIfLongHorizontal extends AbstractFtile {
@@ -141,7 +141,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
return getSwimlaneIn();
}
- static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, Rainbow arrowColor,
+ static Ftile create(Swimlane swimlane, HColor borderColor, HColor backColor, Rainbow arrowColor,
FtileFactory ftileFactory, ConditionStyle conditionStyle, List thens, Branch branch2,
FontConfiguration fcArrow, LinkRendering topInlinkRendering, LinkRendering afterEndwhile,
FontConfiguration fcTest) {
@@ -164,7 +164,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
final TextBlock tbTest = branch.getLabelTest().create(fcTest,
ftileFactory.skinParam().getDefaultTextAlignment(HorizontalAlignment.LEFT),
ftileFactory.skinParam());
- final HtmlColor diamondColor = branch.getColor() == null ? backColor : branch.getColor();
+ final HColor diamondColor = branch.getColor() == null ? backColor : branch.getColor();
FtileDiamondInside2 diamond = new FtileDiamondInside2(branch.skinParam(), diamondColor, borderColor,
swimlane, tbTest);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java
index b52e05952..b001bd70d 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileIfLongVertical.java
@@ -63,13 +63,13 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside3;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
class FtileIfLongVertical extends AbstractFtile {
@@ -127,7 +127,7 @@ class FtileIfLongVertical extends AbstractFtile {
return getSwimlaneIn();
}
- static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, Rainbow arrowColor,
+ static Ftile create(Swimlane swimlane, HColor borderColor, HColor backColor, Rainbow arrowColor,
FtileFactory ftileFactory, ConditionStyle conditionStyle, List thens, Branch branch2,
FontConfiguration fc, LinkRendering topInlinkRendering, LinkRendering afterEndwhile) {
final List tiles = new ArrayList();
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java
index d8e2d5c11..0efb9abed 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileNoteAlone.java
@@ -58,7 +58,6 @@ import net.sourceforge.plantuml.creole.Stencil;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.rose.Rose;
@@ -70,6 +69,7 @@ import net.sourceforge.plantuml.style.Styleable;
import net.sourceforge.plantuml.svek.image.Opale;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable {
@@ -107,8 +107,8 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable
this.withOutPoint = withOutPoint;
final Rose rose = new Rose();
- final HtmlColor noteBackgroundColor;
- final HtmlColor borderColor;
+ final HColor noteBackgroundColor;
+ final HColor borderColor;
final double shadowing;
if (SkinParam.USE_STYLES()) {
final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder());
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java
index 3fe4b96fd..dbc07e722 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileRepeat.java
@@ -66,7 +66,6 @@ import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -75,6 +74,7 @@ import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
class FtileRepeat extends AbstractFtile {
@@ -111,8 +111,8 @@ class FtileRepeat extends AbstractFtile {
}
public static Ftile create(LinkRendering backRepeatLinkRendering, Swimlane swimlane, Swimlane swimlaneOut,
- Ftile entry, Ftile repeat, Display test, Display yes, Display out, HtmlColor borderColor,
- HtmlColor diamondColor, Rainbow arrowColor, Rainbow endRepeatLinkColor, ConditionStyle conditionStyle,
+ Ftile entry, Ftile repeat, Display test, Display yes, Display out, HColor borderColor,
+ HColor diamondColor, Rainbow arrowColor, Rainbow endRepeatLinkColor, ConditionStyle conditionStyle,
ISkinSimple spriteContainer, FontConfiguration fcDiamond, FontConfiguration fcArrow, Ftile backward,
boolean noOut) {
@@ -579,7 +579,7 @@ class FtileRepeat extends AbstractFtile {
private UTranslate getTranslateDiamond1(StringBounder stringBounder) {
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
final double left = getLeft(stringBounder);
- return new UTranslate(left - dimDiamond1.getWidth() / 2, 0);
+ return UTranslate.dx(left - dimDiamond1.getWidth() / 2);
}
private UTranslate getTranslateBackward(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java
index e32ad35b4..bfede99f6 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSplit1.java
@@ -111,7 +111,7 @@ class FtileSplit1 extends AbstractFtile {
public UTranslate getTranslateFor(Ftile searched, StringBounder stringBounder) {
final Dimension2D dim = searched.calculateDimension(stringBounder);
final double xpos = calculateDimension(stringBounder).getWidth() - dim.getWidth();
- return new UTranslate(xpos / 2, 0);
+ return UTranslate.dx(xpos / 2);
}
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSwitch.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSwitch.java
index b20a5d439..14802f4fa 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSwitch.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileSwitch.java
@@ -56,13 +56,13 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInsi
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.svek.ConditionStyle;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
class FtileSwitch extends AbstractFtile {
@@ -95,7 +95,7 @@ class FtileSwitch extends AbstractFtile {
return getSwimlaneIn();
}
- static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, Rainbow arrowColor,
+ static Ftile create(Swimlane swimlane, HColor borderColor, HColor backColor, Rainbow arrowColor,
FtileFactory ftileFactory, ConditionStyle conditionStyle, List thens, FontConfiguration fcArrow,
LinkRendering topInlinkRendering, LinkRendering afterEndwhile, FontConfiguration fcTest) {
if (afterEndwhile == null) {
@@ -114,7 +114,7 @@ class FtileSwitch extends AbstractFtile {
final TextBlock tbTest = branch.getLabelTest().create(fcTest,
ftileFactory.skinParam().getDefaultTextAlignment(HorizontalAlignment.LEFT),
ftileFactory.skinParam());
- final HtmlColor diamondColor = branch.getColor() == null ? backColor : branch.getColor();
+ final HColor diamondColor = branch.getColor() == null ? backColor : branch.getColor();
FtileDiamondInside2 diamond = new FtileDiamondInside2(branch.skinParam(), diamondColor, borderColor,
swimlane, tbTest);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java
index 1cf69898a..38da22c79 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWhile.java
@@ -66,7 +66,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInsi
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -77,6 +76,7 @@ import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UEmpty;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
class FtileWhile extends AbstractFtile {
@@ -113,8 +113,8 @@ class FtileWhile extends AbstractFtile {
this.specialOut = specialOut;
}
- public static Ftile create(Swimlane swimlane, Ftile whileBlock, Display test, HtmlColor borderColor,
- HtmlColor backColor, Rainbow arrowColor, Display yes, Display out2, Rainbow endInlinkColor,
+ public static Ftile create(Swimlane swimlane, Ftile whileBlock, Display test, HColor borderColor,
+ HColor backColor, Rainbow arrowColor, Display yes, Display out2, Rainbow endInlinkColor,
LinkRendering afterEndwhile, FontConfiguration fontArrow, FtileFactory ftileFactory,
ConditionStyle conditionStyle, FontConfiguration fcTest, Instruction specialOut) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java
index c68cfff91..7a4b0a9ca 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNoteOpale.java
@@ -62,7 +62,6 @@ import net.sourceforge.plantuml.creole.SheetBlock2;
import net.sourceforge.plantuml.creole.Stencil;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
@@ -77,6 +76,7 @@ import net.sourceforge.plantuml.svek.image.Opale;
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;
public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Styleable {
@@ -138,8 +138,8 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
final Rose rose = new Rose();
- final HtmlColor noteBackgroundColor;
- final HtmlColor borderColor;
+ final HColor noteBackgroundColor;
+ final HColor borderColor;
final FontConfiguration fc;
final double shadowing;
@@ -189,7 +189,7 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
final double yForNote = (dimTotal.getHeight() - dimNote.getHeight()) / 2;
if (notePosition == NotePosition.LEFT) {
- return new UTranslate(0, yForNote);
+ return UTranslate.dy(yForNote);
}
final double dx = dimTotal.getWidth() - dimNote.getWidth();
return new UTranslate(dx, yForNote);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java
index b8d499d41..ef52afe82 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileWithNotes.java
@@ -58,7 +58,6 @@ import net.sourceforge.plantuml.creole.SheetBlock2;
import net.sourceforge.plantuml.creole.Stencil;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -72,6 +71,7 @@ import net.sourceforge.plantuml.svek.image.Opale;
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.utils.MathUtils;
public class FtileWithNotes extends AbstractFtile {
@@ -110,8 +110,8 @@ public class FtileWithNotes extends AbstractFtile {
if (note.getColors() != null) {
skinParam2 = note.getColors().mute(skinParam2);
}
- final HtmlColor noteBackgroundColor;
- final HtmlColor borderColor;
+ final HColor noteBackgroundColor;
+ final HColor borderColor;
final FontConfiguration fc;
final double shadowing;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java
index f936c139a..c8060dc6b 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java
@@ -123,7 +123,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
final List conns = new ArrayList();
double x = 0;
for (Ftile tmp : getList()) {
- final UTranslate translate0 = new UTranslate(0, barHeight);
+ final UTranslate translate0 = UTranslate.dy(barHeight);
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
final Rainbow def;
if (SkinParam.USE_STYLES()) {
@@ -154,7 +154,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
}
public void drawU(UGraphic ug) {
- ug = ug.apply(new UTranslate(x, 0));
+ ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder());
final Snake snake = new Snake(arrowHorizontalAlignment(), arrowColor, Arrows.asToDown());
if (Display.isNull(label) == false) {
@@ -166,7 +166,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
}
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
- ug = ug.apply(new UTranslate(x, 0));
+ ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder());
final Point2D p1 = new Point2D.Double(geo.getLeft(), 0);
final Point2D p2 = new Point2D.Double(geo.getLeft(), geo.getInY());
@@ -182,7 +182,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
snake.addPoint(mp1a.getX(), middle);
snake.addPoint(mp2b.getX(), middle);
snake.addPoint(mp2b);
- snake.setIgnoreForCompression(true);
+ snake.setIgnoreForCompression();
ug.draw(snake);
}
}
@@ -206,7 +206,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
}
public void drawU(UGraphic ug) {
- ug = ug.apply(new UTranslate(x, 0));
+ ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile1().calculateDimension(getStringBounder());
if (geo.hasPointOut() == false) {
return;
@@ -223,7 +223,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
}
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
- ug = ug.apply(new UTranslate(x, 0));
+ ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile1().calculateDimension(getStringBounder());
if (geo.hasPointOut() == false) {
return;
@@ -242,7 +242,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
snake.addPoint(mp1a.getX(), middle);
snake.addPoint(mp2b.getX(), middle);
snake.addPoint(mp2b);
- snake.setIgnoreForCompression(true);
+ snake.setIgnoreForCompression();
ug.draw(snake);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java
index c908b5359..e76311e94 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderMerge.java
@@ -55,13 +55,13 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBlackBlock;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
@@ -73,7 +73,7 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
protected Ftile doStep1() {
Ftile result = getMiddle();
final List conns = new ArrayList();
- final HtmlColor colorBar = getRose().getHtmlColor(skinParam(), ColorParam.activityBar);
+ final HColor colorBar = getRose().getHtmlColor(skinParam(), ColorParam.activityBar);
final Ftile black = new FtileBlackBlock(skinParam(), colorBar, getList().get(0).getSwimlaneIn());
double x = 0;
@@ -100,8 +100,8 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
@Override
protected Ftile doStep2(Ftile result) {
- final HtmlColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
- final HtmlColor backColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground);
+ final HColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
+ final HColor backColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground);
final Ftile out = new FtileDiamond(skinParam(), backColor, borderColor, swimlaneOutForStep2());
result = new FtileAssemblySimple(result, out);
final List conns = new ArrayList();
@@ -198,7 +198,7 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
}
public void drawU(UGraphic ug) {
- ug = ug.apply(new UTranslate(x, 0));
+ ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder());
final Snake snake = new Snake(arrowHorizontalAlignment(), arrowColor, Arrows.asToDown());
if (Display.isNull(label) == false) {
@@ -210,7 +210,7 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
}
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
- ug = ug.apply(new UTranslate(x, 0));
+ ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder());
final Point2D p1 = new Point2D.Double(geo.getLeft(), 0);
final Point2D p2 = new Point2D.Double(geo.getLeft(), geo.getInY());
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java
index ae15edbde..d56e794b0 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderSplit.java
@@ -55,7 +55,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileThinSplit;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.SName;
@@ -63,6 +62,7 @@ import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
@@ -123,7 +123,7 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
return new FtileAssemblySimple(thin, result);
}
- private HtmlColor getThin1Color(final Rainbow thinColor) {
+ private HColor getThin1Color(final Rainbow thinColor) {
for (Ftile tmp : getList()) {
final Rainbow rainbow;
final LinkRendering inLinkRendering = tmp.getInLinkRendering();
@@ -174,7 +174,7 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
double first = 0;
double last = 0;
for (Ftile tmp : getList()) {
- final UTranslate translate0 = new UTranslate(0, 1.5);
+ final UTranslate translate0 = UTranslate.dy(1.5);
final FtileGeometry dim = tmp.calculateDimension(getStringBounder());
if (dim.hasPointOut()) {
if (first == 0) {
@@ -220,7 +220,7 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
}
public void drawU(UGraphic ug) {
- ug = ug.apply(new UTranslate(x, 0));
+ ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder());
final Snake snake = new Snake(arrowHorizontalAlignment(), arrowColor, Arrows.asToDown());
if (Display.isNull(label) == false) {
@@ -232,7 +232,7 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
}
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
- ug = ug.apply(new UTranslate(x, 0));
+ ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder());
final Point2D p1 = new Point2D.Double(geo.getLeft(), 0);
final Point2D p2 = new Point2D.Double(geo.getLeft(), geo.getInY());
@@ -271,7 +271,7 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
}
public void drawU(UGraphic ug) {
- ug = ug.apply(new UTranslate(x, 0));
+ ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile1().calculateDimension(getStringBounder());
if (geo.hasPointOut() == false) {
return;
@@ -288,7 +288,7 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
}
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
- ug = ug.apply(new UTranslate(x, 0));
+ ug = ug.apply(UTranslate.dx(x));
final FtileGeometry geo = getFtile1().calculateDimension(getStringBounder());
if (geo.hasPointOut() == false) {
return;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/UGraphicInterceptorOneSwimlane.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/UGraphicInterceptorOneSwimlane.java
index 68c23a9bd..be2c75358 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/UGraphicInterceptorOneSwimlane.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/UGraphicInterceptorOneSwimlane.java
@@ -40,7 +40,6 @@ import java.util.Set;
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.UGraphicDelegator;
import net.sourceforge.plantuml.ugraphic.UChange;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
@@ -48,6 +47,7 @@ import net.sourceforge.plantuml.ugraphic.UChangeColor;
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;
public class UGraphicInterceptorOneSwimlane extends UGraphicDelegator {
@@ -88,8 +88,8 @@ public class UGraphicInterceptorOneSwimlane extends UGraphicDelegator {
}
private void drawGoto() {
- final UGraphic ugGoto = getUg().apply(new UChangeColor(HtmlColorUtils.GREEN)).apply(
- new UChangeBackColor(HtmlColorUtils.GREEN));
+ final UGraphic ugGoto = getUg().apply(new UChangeColor(HColorUtils.GREEN)).apply(
+ new UChangeBackColor(HColorUtils.GREEN));
ugGoto.draw(new ULine(100, 100));
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java
index 3dedf46a4..212b963fd 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/VCompactFactory.java
@@ -62,7 +62,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileCircleStop;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorateIn;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorateOut;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.Colors;
@@ -73,6 +72,7 @@ import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleBuilder;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class VCompactFactory implements FtileFactory {
@@ -98,7 +98,7 @@ public class VCompactFactory implements FtileFactory {
}
public Ftile start(Swimlane swimlane) {
- final HtmlColor color;
+ final HColor color;
Style style = null;
if (SkinParam.USE_STYLES()) {
style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam.getCurrentStyleBuilder());
@@ -110,7 +110,7 @@ public class VCompactFactory implements FtileFactory {
}
public Ftile stop(Swimlane swimlane) {
- final HtmlColor color;
+ final HColor color;
Style style = null;
if (SkinParam.USE_STYLES()) {
style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam.getCurrentStyleBuilder());
@@ -121,7 +121,7 @@ public class VCompactFactory implements FtileFactory {
return new FtileCircleStop(skinParam(), color, swimlane, style);
}
- public Ftile spot(Swimlane swimlane, String spot, HtmlColor color) {
+ public Ftile spot(Swimlane swimlane, String spot, HColor color) {
// final HtmlColor color = rose.getHtmlColor(skinParam,
// ColorParam.activityBackground);
final UFont font = skinParam.getFont(null, false, FontParam.ACTIVITY);
@@ -129,7 +129,7 @@ public class VCompactFactory implements FtileFactory {
}
public Ftile end(Swimlane swimlane) {
- final HtmlColor color;
+ final HColor color;
Style style = null;
if (SkinParam.USE_STYLES()) {
style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam.getCurrentStyleBuilder());
@@ -169,7 +169,7 @@ public class VCompactFactory implements FtileFactory {
}
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
- LinkRendering afterEndwhile, HtmlColor color, Instruction specialOut) {
+ LinkRendering afterEndwhile, HColor color, Instruction specialOut) {
return whileBlock;
}
@@ -196,8 +196,8 @@ public class VCompactFactory implements FtileFactory {
return new FtileForkInner(all);
}
- public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note,
- HtmlColor borderColor, USymbol type, double roundCorner) {
+ public Ftile createGroup(Ftile list, Display name, HColor backColor, HColor titleColor, PositionedNote note,
+ HColor borderColor, USymbol type, double roundCorner) {
return list;
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java
index 67f5ca270..01d80f3bc 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java
@@ -61,7 +61,6 @@ import net.sourceforge.plantuml.creole.SheetBlock2;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -71,12 +70,13 @@ import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.svek.ConditionEndStyle;
import net.sourceforge.plantuml.svek.ConditionStyle;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class ConditionalBuilder {
private final Swimlane swimlane;
- private final HtmlColor borderColor;
- private final HtmlColor backColor;
+ private final HColor borderColor;
+ private final HColor backColor;
private final Rainbow arrowColor;
private final FtileFactory ftileFactory;
private final ConditionStyle conditionStyle;
@@ -100,7 +100,7 @@ public class ConditionalBuilder {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow);
}
- public ConditionalBuilder(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, Rainbow arrowColor,
+ public ConditionalBuilder(Swimlane swimlane, HColor borderColor, HColor backColor, Rainbow arrowColor,
FtileFactory ftileFactory, ConditionStyle conditionStyle, ConditionEndStyle conditionEndStyle,
Branch branch1, Branch branch2, ISkinParam skinParam, StringBounder stringBounder,
FontConfiguration fontArrow, FontConfiguration fontTest, Url url) {
@@ -137,7 +137,7 @@ public class ConditionalBuilder {
}
- static public Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, Rainbow arrowColor,
+ static public Ftile create(Swimlane swimlane, HColor borderColor, HColor backColor, Rainbow arrowColor,
FtileFactory ftileFactory, ConditionStyle conditionStyle, ConditionEndStyle conditionEndStyle,
Branch branch1, Branch branch2, ISkinParam skinParam, StringBounder stringBounder,
FontConfiguration fcArrow, FontConfiguration fcTest, Url url) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithDiamonds.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithDiamonds.java
index 1e60d7d47..8b277349b 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithDiamonds.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileIfWithDiamonds.java
@@ -116,14 +116,14 @@ public class FtileIfWithDiamonds extends FtileIfNude {
protected UTranslate getTranslate1(StringBounder stringBounder) {
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
return super.getTranslate1(stringBounder).compose(
- new UTranslate(0, dimDiamond1.getHeight() + getYdelta1a(stringBounder)));
+ UTranslate.dy(dimDiamond1.getHeight() + getYdelta1a(stringBounder)));
}
@Override
protected UTranslate getTranslate2(StringBounder stringBounder) {
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
return super.getTranslate2(stringBounder).compose(
- new UTranslate(0, dimDiamond1.getHeight() + getYdelta1a(stringBounder)));
+ UTranslate.dy(dimDiamond1.getHeight() + getYdelta1a(stringBounder)));
}
protected UTranslate getTranslateDiamond1(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchNude.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchNude.java
index 347ad7615..e18c640df 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchNude.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchNude.java
@@ -100,7 +100,7 @@ public class FtileSwitchNude extends FtileDimensionMemoize {
for (Ftile candidate : tiles) {
final FtileGeometry dim1 = candidate.calculateDimension(stringBounder);
if (candidate == tile) {
- return new UTranslate(x1, 0);
+ return UTranslate.dx(x1);
}
x1 += dim1.getWidth() + xSeparation;
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithDiamonds.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithDiamonds.java
index f69ffd62a..c12357381 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithDiamonds.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/FtileSwitchWithDiamonds.java
@@ -155,14 +155,14 @@ public class FtileSwitchWithDiamonds extends FtileSwitchNude {
final double suppx = (w13 - w9) / (tiles.size() - 1);
for (int i = 0; i < tiles.size() - 1; i++) {
if (tile == tiles.get(i)) {
- return main.compose(new UTranslate(dx, 0));
+ return main.compose(UTranslate.dx(dx));
}
dx += tiles.get(i).calculateDimension(stringBounder).getWidth() + suppx;
}
if (tile == tiles.get(tiles.size() - 1)) {
final double dx9 = tiles.get(0).calculateDimension(stringBounder).getWidth() + w13 + SUPP15 + SUPP15;
- return main.compose(new UTranslate(dx9, 0));
+ return main.compose(UTranslate.dx(dx9));
}
throw new IllegalArgumentException();
@@ -173,7 +173,7 @@ public class FtileSwitchWithDiamonds extends FtileSwitchNude {
protected UTranslate getTranslateMain(StringBounder stringBounder) {
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
final double dy1 = dimDiamond1.getHeight() + getYdelta1a(stringBounder);
- return new UTranslate(0, dy1);
+ return UTranslate.dy(dy1);
}
protected UTranslate getTranslateDiamond1(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java
index c9a65d431..f925a61b7 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBlackBlock.java
@@ -43,7 +43,6 @@ import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -52,6 +51,7 @@ import net.sourceforge.plantuml.ugraphic.UChangeColor;
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;
public class FtileBlackBlock extends AbstractFtile {
@@ -60,10 +60,10 @@ public class FtileBlackBlock extends AbstractFtile {
private double width;
private double height;
private TextBlock label = TextBlockUtils.empty(0, 0);
- private final HtmlColor colorBar;
+ private final HColor colorBar;
private final Swimlane swimlane;
- public FtileBlackBlock(ISkinParam skinParam, HtmlColor colorBar, Swimlane swimlane) {
+ public FtileBlackBlock(ISkinParam skinParam, HColor colorBar, Swimlane swimlane) {
super(skinParam);
this.colorBar = colorBar;
this.swimlane = swimlane;
@@ -91,8 +91,7 @@ public class FtileBlackBlock extends AbstractFtile {
}
public void drawU(UGraphic ug) {
- final URectangle rect = new URectangle(width, height, 5, 5);
- rect.setIgnoreForCompression(true);
+ final URectangle rect = new URectangle(width, height).rounded(5).ignoreForCompression();
if (skinParam().shadowing(null)) {
rect.setDeltaShadow(3);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java
index 40080df27..3993ff281 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileBox.java
@@ -63,7 +63,6 @@ import net.sourceforge.plantuml.creole.Stencil;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -80,6 +79,7 @@ import net.sourceforge.plantuml.ugraphic.UChangeColor;
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;
public class FtileBox extends AbstractFtile {
@@ -98,8 +98,8 @@ public class FtileBox extends AbstractFtile {
private final Swimlane swimlane;
private final BoxStyle boxStyle;
- private final HtmlColor borderColor;
- private final HtmlColor backColor;
+ private final HColor borderColor;
+ private final HColor backColor;
private final Style style;
static public StyleSignature getDefaultStyleDefinitionActivity() {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java
index 6ea30151a..2ba8f2edb 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleEnd.java
@@ -45,8 +45,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style;
@@ -57,12 +55,14 @@ 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.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class FtileCircleEnd extends AbstractFtile {
private static final int SIZE = 20;
- private final HtmlColor backColor;
+ private final HColor backColor;
private final Swimlane swimlane;
private double shadowing;
@@ -71,7 +71,7 @@ public class FtileCircleEnd extends AbstractFtile {
return Collections.emptyList();
}
- public FtileCircleEnd(ISkinParam skinParam, HtmlColor backColor, Swimlane swimlane, Style style) {
+ public FtileCircleEnd(ISkinParam skinParam, HColor backColor, Swimlane swimlane, Style style) {
super(skinParam);
this.backColor = backColor;
this.swimlane = swimlane;
@@ -109,7 +109,7 @@ public class FtileCircleEnd extends AbstractFtile {
circle.setDeltaShadow(shadowing);
ug = ug.apply(new UChangeColor(backColor));
final double thickness = 2.5;
- ug.apply(new UChangeBackColor(HtmlColorUtils.WHITE)).apply(new UStroke(1.5))
+ ug.apply(new UChangeBackColor(HColorUtils.WHITE)).apply(new UStroke(1.5))
.apply(new UTranslate(xTheoricalPosition, yTheoricalPosition)).draw(circle);
final double size2 = (SIZE - thickness) / Math.sqrt(2);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java
index 796c0dd50..e1613eeb6 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleSpot.java
@@ -48,7 +48,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UCenteredCharacter;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
@@ -57,6 +56,7 @@ import net.sourceforge.plantuml.ugraphic.UEllipse;
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;
public class FtileCircleSpot extends AbstractFtile {
@@ -65,9 +65,9 @@ public class FtileCircleSpot extends AbstractFtile {
private final Swimlane swimlane;
private final String spot;
private final FontConfiguration fc;
- private final HtmlColor backColor;
+ private final HColor backColor;
- public FtileCircleSpot(ISkinParam skinParam, Swimlane swimlane, String spot, UFont font, HtmlColor backColor) {
+ public FtileCircleSpot(ISkinParam skinParam, Swimlane swimlane, String spot, UFont font, HColor backColor) {
super(skinParam);
this.spot = spot;
this.swimlane = swimlane;
@@ -97,8 +97,8 @@ public class FtileCircleSpot extends AbstractFtile {
public void drawU(UGraphic ug) {
- final HtmlColor borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder);
- final HtmlColor backColor = this.backColor == null ? SkinParamUtils.getColor(skinParam(), null,
+ final HColor borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder);
+ final HColor backColor = this.backColor == null ? SkinParamUtils.getColor(skinParam(), null,
ColorParam.activityBackground) : this.backColor;
final UEllipse circle = new UEllipse(SIZE, SIZE);
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java
index a192adf47..87b2f59af 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStart.java
@@ -45,7 +45,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style;
@@ -53,16 +52,17 @@ import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class FtileCircleStart extends AbstractFtile {
private static final int SIZE = 20;
- private final HtmlColor backColor;
+ private final HColor backColor;
private final Swimlane swimlane;
private double shadowing;
- public FtileCircleStart(ISkinParam skinParam, HtmlColor backColor, Swimlane swimlane, Style style) {
+ public FtileCircleStart(ISkinParam skinParam, HColor backColor, Swimlane swimlane, Style style) {
super(skinParam);
this.backColor = backColor;
this.swimlane = swimlane;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java
index 12b1dedd3..c1110736b 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileCircleStop.java
@@ -45,9 +45,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorMiddle;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style;
@@ -56,12 +53,15 @@ import net.sourceforge.plantuml.ugraphic.UChangeColor;
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.HColorUtils;
public class FtileCircleStop extends AbstractFtile {
private static final int SIZE = 22;
- private final HtmlColor backColor;
+ private final HColor backColor;
private final Swimlane swimlane;
private double shadowing;
@@ -70,7 +70,7 @@ public class FtileCircleStop extends AbstractFtile {
return Collections.emptyList();
}
- public FtileCircleStop(ISkinParam skinParam, HtmlColor backColor, Swimlane swimlane, Style style) {
+ public FtileCircleStop(ISkinParam skinParam, HColor backColor, Swimlane swimlane, Style style) {
super(skinParam);
this.backColor = backColor;
this.swimlane = swimlane;
@@ -101,14 +101,14 @@ public class FtileCircleStop extends AbstractFtile {
public void drawU(UGraphic ug) {
final UEllipse circle = new UEllipse(SIZE, SIZE);
circle.setDeltaShadow(shadowing);
- ug.apply(new UChangeColor(backColor)).apply(new UChangeBackColor(HtmlColorUtils.WHITE)).draw(circle);
+ ug.apply(new UChangeColor(backColor)).apply(new UChangeBackColor(HColorUtils.WHITE)).draw(circle);
final double delta = 5;
final UEllipse circleSmall = new UEllipse(SIZE - delta * 2, SIZE - delta * 2);
// if (skinParam().shadowing(null)) {
// circleSmall.setDeltaShadow(3);
// }
- ug.apply(new UChangeColor(new HtmlColorMiddle(backColor, HtmlColorUtils.WHITE)))
+ ug.apply(new UChangeColor(new HColorMiddle(backColor, HColorUtils.WHITE)))
.apply(new UChangeBackColor(backColor)).apply(new UTranslate(delta, delta)).draw(circleSmall);
}
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java
index 66f880166..e03362158 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamond.java
@@ -48,7 +48,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -60,11 +59,12 @@ import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class FtileDiamond extends AbstractFtile {
- private final HtmlColor backColor;
- private final HtmlColor borderColor;
+ private final HColor backColor;
+ private final HColor borderColor;
private final Swimlane swimlane;
private final TextBlock north;
private final TextBlock south;
@@ -72,7 +72,7 @@ public class FtileDiamond extends AbstractFtile {
private final TextBlock east1;
private final double shadowing;
- public FtileDiamond(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane) {
+ public FtileDiamond(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane) {
this(skinParam, backColor, borderColor, swimlane, TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0),
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
}
@@ -108,7 +108,7 @@ public class FtileDiamond extends AbstractFtile {
return new FtileDiamond(skinParam(), backColor, borderColor, swimlane, north, south, east1, west1);
}
- private FtileDiamond(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
+ private FtileDiamond(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane,
TextBlock north, TextBlock south, TextBlock east1, TextBlock west1) {
super(skinParam);
if (SkinParam.USE_STYLES()) {
@@ -145,7 +145,7 @@ public class FtileDiamond extends AbstractFtile {
public void drawU(UGraphic ug) {
final double suppY1 = north.calculateDimension(ug.getStringBounder()).getHeight();
- ug = ug.apply(new UTranslate(0, suppY1));
+ ug = ug.apply(UTranslate.dy(suppY1));
ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor))
.draw(Diamond.asPolygon(shadowing));
// final Dimension2D dimNorth = north.calculateDimension(ug.getStringBounder());
@@ -161,7 +161,7 @@ public class FtileDiamond extends AbstractFtile {
final Dimension2D dimEast1 = east1.calculateDimension(ug.getStringBounder());
east1.drawU(ug.apply(new UTranslate(Diamond.diamondHalfSize * 2, -dimEast1.getHeight()
- + Diamond.diamondHalfSize)));
+ + Diamond.diamondHalfSize)));
}
@Override
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondFoo1.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondFoo1.java
index c3e200758..bae905836 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondFoo1.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondFoo1.java
@@ -45,7 +45,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -53,18 +52,19 @@ import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class FtileDiamondFoo1 extends AbstractFtile {
- private final HtmlColor backColor;
- private final HtmlColor borderColor;
+ private final HColor backColor;
+ private final HColor borderColor;
private final Swimlane swimlane;
private final TextBlock label;
private final TextBlock west;
private final TextBlock east;
private final TextBlock north;
- public FtileDiamondFoo1(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
+ public FtileDiamondFoo1(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane,
TextBlock label) {
this(skinParam, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0),
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
@@ -82,7 +82,7 @@ public class FtileDiamondFoo1 extends AbstractFtile {
return new FtileDiamondFoo1(skinParam(), backColor, borderColor, swimlane, label, north, west, east);
}
- private FtileDiamondFoo1(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
+ private FtileDiamondFoo1(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane,
TextBlock label, TextBlock north, TextBlock west, TextBlock east) {
super(skinParam);
this.backColor = backColor;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java
index 14d6b47e6..de68a93cb 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside.java
@@ -48,7 +48,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -61,11 +60,12 @@ import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class FtileDiamondInside extends AbstractFtile implements Styleable {
- private final HtmlColor backColor;
- private final HtmlColor borderColor;
+ private final HColor backColor;
+ private final HColor borderColor;
private final Swimlane swimlane;
private final TextBlock label;
private final TextBlock west;
@@ -83,7 +83,7 @@ public class FtileDiamondInside extends AbstractFtile implements Styleable {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond);
}
- public FtileDiamondInside(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
+ public FtileDiamondInside(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane,
TextBlock label) {
this(skinParam, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0),
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
@@ -109,7 +109,7 @@ public class FtileDiamondInside extends AbstractFtile implements Styleable {
return new FtileDiamondInside(skinParam(), backColor, borderColor, swimlane, label, north, south, west, east);
}
- private FtileDiamondInside(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
+ private FtileDiamondInside(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane,
TextBlock label, TextBlock north, TextBlock south, TextBlock west, TextBlock east) {
super(skinParam);
if (SkinParam.USE_STYLES()) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java
index d32b92e79..b55b210a5 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside2.java
@@ -46,7 +46,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -58,11 +57,12 @@ import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class FtileDiamondInside2 extends AbstractFtile {
- private final HtmlColor backColor;
- private final HtmlColor borderColor;
+ private final HColor backColor;
+ private final HColor borderColor;
private final Swimlane swimlane;
private final TextBlock label;
private final TextBlock west;
@@ -71,7 +71,7 @@ public class FtileDiamondInside2 extends AbstractFtile {
private final TextBlock south;
private final double shadowing;
- public FtileDiamondInside2(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
+ public FtileDiamondInside2(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane,
TextBlock label) {
this(skinParam, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0),
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
@@ -97,7 +97,7 @@ public class FtileDiamondInside2 extends AbstractFtile {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond);
}
- private FtileDiamondInside2(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
+ private FtileDiamondInside2(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane,
TextBlock label, TextBlock north, TextBlock south, TextBlock west, TextBlock east) {
super(skinParam);
if (SkinParam.USE_STYLES()) {
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside3.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside3.java
index 71848e5ba..49caf7230 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside3.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileDiamondInside3.java
@@ -46,7 +46,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileOverpassing;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -54,12 +53,13 @@ import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.utils.MathUtils;
public class FtileDiamondInside3 extends AbstractFtile implements FtileOverpassing {
- private final HtmlColor backColor;
- private final HtmlColor borderColor;
+ private final HColor backColor;
+ private final HColor borderColor;
private final Swimlane swimlane;
private final TextBlock label;
private final TextBlock west;
@@ -67,7 +67,7 @@ public class FtileDiamondInside3 extends AbstractFtile implements FtileOverpassi
private final TextBlock north;
private final TextBlock south;
- public FtileDiamondInside3(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
+ public FtileDiamondInside3(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane,
TextBlock label) {
this(skinParam, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0),
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
@@ -89,7 +89,7 @@ public class FtileDiamondInside3 extends AbstractFtile implements FtileOverpassi
return new FtileDiamondInside3(skinParam(), backColor, borderColor, swimlane, label, north, south, west, east);
}
- private FtileDiamondInside3(ISkinParam skinParam, HtmlColor backColor, HtmlColor borderColor, Swimlane swimlane,
+ private FtileDiamondInside3(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane,
TextBlock label, TextBlock north, TextBlock south, TextBlock west, TextBlock east) {
super(skinParam);
this.backColor = backColor;
diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileThinSplit.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileThinSplit.java
index a32255939..3745f7451 100644
--- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileThinSplit.java
+++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vertical/FtileThinSplit.java
@@ -42,7 +42,6 @@ import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
@@ -50,6 +49,7 @@ import net.sourceforge.plantuml.ugraphic.ULine;
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;
public class FtileThinSplit extends AbstractFtile {
@@ -57,10 +57,10 @@ public class FtileThinSplit extends AbstractFtile {
private double first;
private double last;
private final double height = 1.5;
- private final HtmlColor colorBar;
+ private final HColor colorBar;
private final Swimlane swimlane;
- public FtileThinSplit(ISkinParam skinParam, HtmlColor colorBar, Swimlane swimlane) {
+ public FtileThinSplit(ISkinParam skinParam, HColor colorBar, Swimlane swimlane) {
super(skinParam);
this.colorBar = colorBar;
this.swimlane = swimlane;
@@ -78,8 +78,8 @@ public class FtileThinSplit extends AbstractFtile {
}
public void drawU(UGraphic ug) {
- final UShape rect = new ULine(last - first, 0);
- ug = ug.apply(new UTranslate(first, 0));
+ final UShape rect = ULine.hline(last - first);
+ ug = ug.apply(UTranslate.dx(first));
ug.apply(new UChangeColor(colorBar)).apply(new UStroke(1.5)).draw(rect);
}
diff --git a/src/net/sourceforge/plantuml/bpm/BpmElement.java b/src/net/sourceforge/plantuml/bpm/BpmElement.java
index 5e293534f..0d35d9463 100644
--- a/src/net/sourceforge/plantuml/bpm/BpmElement.java
+++ b/src/net/sourceforge/plantuml/bpm/BpmElement.java
@@ -47,8 +47,6 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -58,6 +56,8 @@ import net.sourceforge.plantuml.ugraphic.UFont;
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;
public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzzle {
@@ -97,7 +97,7 @@ public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzz
public void drawU(UGraphic ug) {
raw.drawU(ug);
- ug = ug.apply(new UChangeColor(HtmlColorUtils.RED));
+ ug = ug.apply(new UChangeColor(HColorUtils.RED));
for (Where w : Where.values()) {
if (have(w)) {
drawLine(ug, w, raw.calculateDimension(ug.getStringBounder()));
@@ -123,26 +123,26 @@ public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzz
final double width = total.getWidth();
final double height = total.getHeight();
if (w == Where.WEST) {
- ug.apply(new UTranslate(-10, height / 2)).draw(new ULine(10, 0));
+ ug.apply(new UTranslate(-10, height / 2)).draw(ULine.hline(10));
}
if (w == Where.EAST) {
- ug.apply(new UTranslate(width, height / 2)).draw(new ULine(10, 0));
+ ug.apply(new UTranslate(width, height / 2)).draw(ULine.hline(10));
}
if (w == Where.NORTH) {
- ug.apply(new UTranslate(width / 2, -10)).draw(new ULine(0, 10));
+ ug.apply(new UTranslate(width / 2, -10)).draw(ULine.vline(10));
}
if (w == Where.SOUTH) {
- ug.apply(new UTranslate(width / 2, height)).draw(new ULine(0, 10));
+ ug.apply(new UTranslate(width / 2, height)).draw(ULine.vline(10));
}
}
public TextBlock toTextBlockInternal(ISkinParam skinParam) {
if (type == BpmElementType.START) {
- return new FtileCircleStart(skinParam, HtmlColorUtils.BLACK, null, null);
+ return new FtileCircleStart(skinParam, HColorUtils.BLACK, null, null);
}
if (type == BpmElementType.MERGE) {
- final HtmlColor borderColor = SkinParamUtils.getColor(skinParam, null, ColorParam.activityBorder);
- final HtmlColor backColor = SkinParamUtils.getColor(skinParam, null, ColorParam.activityBackground);
+ final HColor borderColor = SkinParamUtils.getColor(skinParam, null, ColorParam.activityBorder);
+ final HColor backColor = SkinParamUtils.getColor(skinParam, null, ColorParam.activityBackground);
return new FtileDiamond(skinParam, backColor, borderColor, null);
}
if (type == BpmElementType.DOCKED_EVENT) {
@@ -150,7 +150,7 @@ public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzz
return FtileBox.create(skinParam, display, null, BoxStyle.PLAIN);
}
final UFont font = UFont.serif(14);
- final FontConfiguration fc = new FontConfiguration(font, HtmlColorUtils.RED, HtmlColorUtils.RED, false);
+ final FontConfiguration fc = new FontConfiguration(font, HColorUtils.RED, HColorUtils.RED, false);
if (Display.isNull(display)) {
return Display.getWithNewlines(type.toString()).create(fc, HorizontalAlignment.LEFT, skinParam);
}
diff --git a/src/net/sourceforge/plantuml/bpm/ConnectorPuzzleEmpty.java b/src/net/sourceforge/plantuml/bpm/ConnectorPuzzleEmpty.java
index 8d40b59d9..e360e0989 100644
--- a/src/net/sourceforge/plantuml/bpm/ConnectorPuzzleEmpty.java
+++ b/src/net/sourceforge/plantuml/bpm/ConnectorPuzzleEmpty.java
@@ -40,7 +40,6 @@ import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -49,6 +48,7 @@ import net.sourceforge.plantuml.ugraphic.UChangeColor;
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;
public class ConnectorPuzzleEmpty extends AbstractConnectorPuzzle implements Placeable, TextBlock, ConnectorPuzzle {
@@ -89,7 +89,7 @@ public class ConnectorPuzzleEmpty extends AbstractConnectorPuzzle implements Pla
public void drawU(UGraphic ug) {
// System.err.println("DRAWING " + toString());
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLUE));
+ ug = ug.apply(new UChangeColor(HColorUtils.BLUE));
for (Where w : Where.values()) {
if (have(w)) {
drawLine(ug, w);
@@ -100,16 +100,16 @@ public class ConnectorPuzzleEmpty extends AbstractConnectorPuzzle implements Pla
private void drawLine(UGraphic ug, Where w) {
if (w == Where.WEST) {
- ug.apply(new UTranslate(0, 10)).draw(new ULine(10, 0));
+ ug.apply(UTranslate.dy(10)).draw(ULine.hline(10));
}
if (w == Where.EAST) {
- ug.apply(new UTranslate(10, 10)).draw(new ULine(10, 0));
+ ug.apply(new UTranslate(10, 10)).draw(ULine.hline(10));
}
if (w == Where.NORTH) {
- ug.apply(new UTranslate(10, 0)).draw(new ULine(0, 10));
+ ug.apply(UTranslate.dx(10)).draw(ULine.vline(10));
}
if (w == Where.SOUTH) {
- ug.apply(new UTranslate(10, 10)).draw(new ULine(0, 10));
+ ug.apply(new UTranslate(10, 10)).draw(ULine.vline(10));
}
}
diff --git a/src/net/sourceforge/plantuml/bpm/GridArray.java b/src/net/sourceforge/plantuml/bpm/GridArray.java
index 64e931401..f3fb987e2 100644
--- a/src/net/sourceforge/plantuml/bpm/GridArray.java
+++ b/src/net/sourceforge/plantuml/bpm/GridArray.java
@@ -39,13 +39,13 @@ import java.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
import net.sourceforge.plantuml.ISkinParam;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
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;
public class GridArray implements UDrawable {
@@ -137,7 +137,7 @@ public class GridArray implements UDrawable {
cell.toTextBlock(skinParam).drawU(
ug.apply(new UTranslate(dx + (widthOfCol + margin - dim.getWidth()) / 2, dy
- + (heightOfLine + margin - dim.getHeight()) / 2)));
+ + (heightOfLine + margin - dim.getHeight()) / 2)));
}
dx += widthOfCol + margin;
}
@@ -155,22 +155,22 @@ public class GridArray implements UDrawable {
for (int c = 0; c < cols; c++) {
widthMax += getWidthOfCol(ug.getStringBounder(), c) + margin;
}
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
+ ug = ug.apply(new UChangeColor(HColorUtils.BLACK));
double y = 0;
for (int l = 0; l < lines; l++) {
- ug.apply(new UTranslate(0, y)).draw(new ULine(widthMax, 0));
+ ug.apply(UTranslate.dy(y)).draw(ULine.hline(widthMax));
y += getHeightOfLine(ug.getStringBounder(), l) + margin;
}
double x = 0;
for (int c = 0; c < cols; c++) {
- ug.apply(new UTranslate(x, 0)).draw(new ULine(0, heightMax));
+ ug.apply(UTranslate.dx(x)).draw(ULine.vline(heightMax));
x += getWidthOfCol(ug.getStringBounder(), c) + margin;
}
}
private void drawArrow(UGraphic ug, Point2D pt1, Point2D pt2) {
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLUE));
+ ug = ug.apply(new UChangeColor(HColorUtils.BLUE));
final ULine line = new ULine(pt2.getX() - pt1.getX(), pt2.getY() - pt1.getY());
ug.apply(new UTranslate(pt1)).draw(line);
}
diff --git a/src/net/sourceforge/plantuml/braille/BrailleDrawer.java b/src/net/sourceforge/plantuml/braille/BrailleDrawer.java
index 37672536e..c20b619e1 100644
--- a/src/net/sourceforge/plantuml/braille/BrailleDrawer.java
+++ b/src/net/sourceforge/plantuml/braille/BrailleDrawer.java
@@ -35,8 +35,6 @@
*/
package net.sourceforge.plantuml.braille;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -44,6 +42,8 @@ import net.sourceforge.plantuml.ugraphic.UEllipse;
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;
public class BrailleDrawer implements UDrawable {
@@ -56,16 +56,16 @@ public class BrailleDrawer implements UDrawable {
}
public void drawU(UGraphic ug) {
- ug = ug.apply(new UChangeColor(new HtmlColorSetSimple().getColorIfValid("#F0F0F0")));
+ ug = ug.apply(new UChangeColor(HColorSet.instance().getColorIfValid("#F0F0F0")));
for (int x = grid.getMinX(); x <= grid.getMaxX(); x++) {
- ug.apply(new UTranslate(x * step + spotSize + 1, 0)).draw(
- new ULine(0, (grid.getMaxY() - grid.getMinY()) * step));
+ ug.apply(UTranslate.dx(x * step + spotSize + 1)).draw(
+ ULine.vline((grid.getMaxY() - grid.getMinY()) * step));
}
for (int y = grid.getMinY(); y <= grid.getMaxY(); y++) {
- ug.apply(new UTranslate(0, y * step + spotSize + 1)).draw(
- new ULine((grid.getMaxX() - grid.getMinX()) * step, 0));
+ ug.apply(UTranslate.dy(y * step + spotSize + 1)).draw(
+ ULine.hline((grid.getMaxX() - grid.getMinX()) * step));
}
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK)).apply(new UChangeBackColor(HtmlColorUtils.BLACK));
+ ug = ug.apply(new UChangeColor(HColorUtils.BLACK)).apply(new UChangeBackColor(HColorUtils.BLACK));
for (int x = grid.getMinX(); x <= grid.getMaxX(); x++) {
for (int y = grid.getMinY(); y <= grid.getMaxY(); y++) {
if (grid.getState(x, y)) {
diff --git a/src/net/sourceforge/plantuml/braille/DriverCenteredCharacterBraille.java b/src/net/sourceforge/plantuml/braille/DriverCenteredCharacterBraille.java
index 08c6f62da..e83b04771 100644
--- a/src/net/sourceforge/plantuml/braille/DriverCenteredCharacterBraille.java
+++ b/src/net/sourceforge/plantuml/braille/DriverCenteredCharacterBraille.java
@@ -35,11 +35,11 @@
*/
package net.sourceforge.plantuml.braille;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UCenteredCharacter;
import net.sourceforge.plantuml.ugraphic.UDriver;
import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.UShape;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
public class DriverCenteredCharacterBraille implements UDriver {
diff --git a/src/net/sourceforge/plantuml/braille/DriverDotPathBraille.java b/src/net/sourceforge/plantuml/braille/DriverDotPathBraille.java
index 53238cec7..6fcb3f8e8 100644
--- a/src/net/sourceforge/plantuml/braille/DriverDotPathBraille.java
+++ b/src/net/sourceforge/plantuml/braille/DriverDotPathBraille.java
@@ -36,10 +36,10 @@
package net.sourceforge.plantuml.braille;
import net.sourceforge.plantuml.posimo.DotPath;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UDriver;
import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.UShape;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
public class DriverDotPathBraille implements UDriver {
diff --git a/src/net/sourceforge/plantuml/braille/DriverLineBraille.java b/src/net/sourceforge/plantuml/braille/DriverLineBraille.java
index d136cfbca..002924241 100644
--- a/src/net/sourceforge/plantuml/braille/DriverLineBraille.java
+++ b/src/net/sourceforge/plantuml/braille/DriverLineBraille.java
@@ -37,12 +37,12 @@ package net.sourceforge.plantuml.braille;
import java.awt.geom.Line2D;
import net.sourceforge.plantuml.ugraphic.ClipContainer;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UClip;
import net.sourceforge.plantuml.ugraphic.UDriver;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.UShape;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
public class DriverLineBraille implements UDriver {
diff --git a/src/net/sourceforge/plantuml/braille/DriverNoneBraille.java b/src/net/sourceforge/plantuml/braille/DriverNoneBraille.java
index 54f64c5df..6e132b68a 100644
--- a/src/net/sourceforge/plantuml/braille/DriverNoneBraille.java
+++ b/src/net/sourceforge/plantuml/braille/DriverNoneBraille.java
@@ -34,10 +34,10 @@
*/
package net.sourceforge.plantuml.braille;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UDriver;
import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.UShape;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
public class DriverNoneBraille implements UDriver {
diff --git a/src/net/sourceforge/plantuml/braille/DriverPolygonBraille.java b/src/net/sourceforge/plantuml/braille/DriverPolygonBraille.java
index d3f2802bd..fe9024712 100644
--- a/src/net/sourceforge/plantuml/braille/DriverPolygonBraille.java
+++ b/src/net/sourceforge/plantuml/braille/DriverPolygonBraille.java
@@ -39,13 +39,13 @@ import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.ugraphic.ClipContainer;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UClip;
import net.sourceforge.plantuml.ugraphic.UDriver;
import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
public class DriverPolygonBraille implements UDriver {
diff --git a/src/net/sourceforge/plantuml/braille/DriverRectangleBraille.java b/src/net/sourceforge/plantuml/braille/DriverRectangleBraille.java
index 7b54d2bc5..37fa98977 100644
--- a/src/net/sourceforge/plantuml/braille/DriverRectangleBraille.java
+++ b/src/net/sourceforge/plantuml/braille/DriverRectangleBraille.java
@@ -37,12 +37,12 @@ package net.sourceforge.plantuml.braille;
import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.ugraphic.ClipContainer;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UClip;
import net.sourceforge.plantuml.ugraphic.UDriver;
import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UShape;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
public class DriverRectangleBraille implements UDriver {
diff --git a/src/net/sourceforge/plantuml/braille/DriverTextBraille.java b/src/net/sourceforge/plantuml/braille/DriverTextBraille.java
index 8e7f775c2..e20f090c3 100644
--- a/src/net/sourceforge/plantuml/braille/DriverTextBraille.java
+++ b/src/net/sourceforge/plantuml/braille/DriverTextBraille.java
@@ -34,11 +34,11 @@
*/
package net.sourceforge.plantuml.braille;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UDriver;
import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UText;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
public class DriverTextBraille implements UDriver {
diff --git a/src/net/sourceforge/plantuml/braille/UGraphicBraille.java b/src/net/sourceforge/plantuml/braille/UGraphicBraille.java
index a8eb23eb6..d7d72db46 100644
--- a/src/net/sourceforge/plantuml/braille/UGraphicBraille.java
+++ b/src/net/sourceforge/plantuml/braille/UGraphicBraille.java
@@ -41,14 +41,11 @@ import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.Url;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.posimo.DotPath;
import net.sourceforge.plantuml.ugraphic.AbstractCommonUGraphic;
import net.sourceforge.plantuml.ugraphic.AbstractUGraphic;
import net.sourceforge.plantuml.ugraphic.ClipContainer;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UCenteredCharacter;
import net.sourceforge.plantuml.ugraphic.UEllipse;
@@ -59,6 +56,9 @@ import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UText;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
// https://www.branah.com/braille-translator
public class UGraphicBraille extends AbstractUGraphic implements ClipContainer, UGraphic2 {
@@ -128,7 +128,7 @@ public class UGraphicBraille extends AbstractUGraphic implements Cl
}
public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException {
- final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.WHITE,
+ final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HColorUtils.WHITE,
metadata, null, 0, 0, null, false);
imageBuilder.setUDrawable(new BrailleDrawer(getGraphicObject()));
diff --git a/src/net/sourceforge/plantuml/classdiagram/FullLayout.java b/src/net/sourceforge/plantuml/classdiagram/FullLayout.java
index f4428caa3..e05db0af4 100644
--- a/src/net/sourceforge/plantuml/classdiagram/FullLayout.java
+++ b/src/net/sourceforge/plantuml/classdiagram/FullLayout.java
@@ -53,7 +53,7 @@ public class FullLayout implements UDrawable {
public void drawU(UGraphic ug) {
double y = 0;
for (RowLayout rawLayout : all) {
- rawLayout.drawU(ug.apply(new UTranslate(0, y)));
+ rawLayout.drawU(ug.apply(UTranslate.dy(y)));
y += rawLayout.getHeight(ug.getStringBounder()) + 20;
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/RowLayout.java b/src/net/sourceforge/plantuml/classdiagram/RowLayout.java
index 72239fe15..92e26d285 100644
--- a/src/net/sourceforge/plantuml/classdiagram/RowLayout.java
+++ b/src/net/sourceforge/plantuml/classdiagram/RowLayout.java
@@ -63,7 +63,7 @@ public class RowLayout implements UDrawable {
public void drawU(UGraphic ug) {
double x = 0;
for (TextBlock leaf : all) {
- leaf.drawU(ug.apply(new UTranslate(x, 0)));
+ leaf.drawU(ug.apply(UTranslate.dx(x)));
x += leaf.calculateDimension(ug.getStringBounder()).getWidth() + 20;
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java
index 94cd9821a..8bd36ec23 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java
@@ -58,10 +58,10 @@ import net.sourceforge.plantuml.cucadiagram.Ident;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Stereotag;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandCreateClass extends SingleLineCommand2 {
@@ -174,7 +174,7 @@ public class CommandCreateClass extends SingleLineCommand2 {
Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
- final HtmlColor lineColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1));
+ final HColor lineColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINECOLOR", 1));
if (lineColor != null) {
colors = colors.add(ColorType.LINE, lineColor);
}
diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java
index b6da5b900..04285202f 100644
--- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java
+++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java
@@ -64,11 +64,11 @@ import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.cucadiagram.Stereotag;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.VisibilityModifier;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandCreateClassMultilines extends CommandMultilines2 {
@@ -280,7 +280,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2 {
@@ -145,7 +145,7 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
final NoteStyle style = NoteStyle.getNoteStyle(line0.get("STYLE", 0));
final Display display = diagram.manageVariable(lines.toDisplay());
final String backcolor0 = line0.get("COLOR", 0);
- Colors colors = Colors.empty().add(ColorType.BACK, HtmlColorSet.getInstance().getColorIfValid(backcolor0));
+ Colors colors = Colors.empty().add(ColorType.BACK, HColorSet.instance().getColorIfValid(backcolor0));
final Note note = new Note(display, position, style, diagram.getSkinParam().getCurrentStyleBuilder());
final String stereotypeString = line0.get("STEREO", 0);
if (stereotypeString != null) {
diff --git a/src/net/sourceforge/plantuml/creole/CreoleHorizontalLine.java b/src/net/sourceforge/plantuml/creole/CreoleHorizontalLine.java
index a5a5b0801..e929c4b8a 100644
--- a/src/net/sourceforge/plantuml/creole/CreoleHorizontalLine.java
+++ b/src/net/sourceforge/plantuml/creole/CreoleHorizontalLine.java
@@ -36,12 +36,12 @@
package net.sourceforge.plantuml.creole;
import java.awt.geom.Dimension2D;
-import java.util.Arrays;
-import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.LineBreakStrategy;
+import net.sourceforge.plantuml.creole.atom.AbstractAtom;
+import net.sourceforge.plantuml.creole.atom.Atom;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
@@ -92,7 +92,7 @@ public class CreoleHorizontalLine extends AbstractAtom implements Atom {
public void drawU(UGraphic ug) {
// ug = ug.apply(new UChangeColor(fontConfiguration.getColor()));
final Dimension2D dim = calculateDimension(ug.getStringBounder());
- ug = ug.apply(new UTranslate(0, dim.getHeight() / 2));
+ ug = ug.apply(UTranslate.dy(dim.getHeight() / 2));
ug.draw(getHorizontalLine());
}
diff --git a/src/net/sourceforge/plantuml/creole/CreoleParser.java b/src/net/sourceforge/plantuml/creole/CreoleParser.java
index 6fed7d687..f4f99c889 100644
--- a/src/net/sourceforge/plantuml/creole/CreoleParser.java
+++ b/src/net/sourceforge/plantuml/creole/CreoleParser.java
@@ -41,6 +41,7 @@ import java.util.List;
import net.sourceforge.plantuml.EmbeddedDiagram;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.creole.atom.Atom;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.FontConfiguration;
@@ -75,7 +76,7 @@ public class CreoleParser {
FontConfiguration fontConfiguration) {
if (lastStripe instanceof StripeTable && isTableLine(line)) {
final StripeTable table = (StripeTable) lastStripe;
- table.analyzeAndAddNormal(line);
+ table.analyzeAndAddLine(line);
return null;
} else if (lastStripe instanceof StripeTree && isTreeStart(StringUtils.trinNoTrace(line))) {
final StripeTree tree = (StripeTree) lastStripe;
@@ -95,7 +96,7 @@ public class CreoleParser {
}
public static boolean doesStartByColor(String line) {
- return line.matches("^(\\<#\\w+(,#?\\w+)?\\>).*");
+ return line.matches("^\\=?\\s*(\\<#\\w+(,#?\\w+)?\\>).*");
}
public static boolean isTreeStart(String line) {
diff --git a/src/net/sourceforge/plantuml/creole/Fission.java b/src/net/sourceforge/plantuml/creole/Fission.java
index 78cd9ed98..fc21f3b43 100644
--- a/src/net/sourceforge/plantuml/creole/Fission.java
+++ b/src/net/sourceforge/plantuml/creole/Fission.java
@@ -43,6 +43,9 @@ import java.util.Collections;
import java.util.List;
import net.sourceforge.plantuml.LineBreakStrategy;
+import net.sourceforge.plantuml.creole.atom.AbstractAtom;
+import net.sourceforge.plantuml.creole.atom.Atom;
+import net.sourceforge.plantuml.creole.atom.AtomText;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
diff --git a/src/net/sourceforge/plantuml/creole/PSystemCreole.java b/src/net/sourceforge/plantuml/creole/PSystemCreole.java
index b3c1c8842..fbc3aaef8 100644
--- a/src/net/sourceforge/plantuml/creole/PSystemCreole.java
+++ b/src/net/sourceforge/plantuml/creole/PSystemCreole.java
@@ -50,9 +50,9 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
public class PSystemCreole extends AbstractPSystem {
@@ -86,7 +86,7 @@ public class PSystemCreole extends AbstractPSystem {
// final Dimension2D dim = TextBlockUtils.getDimension(sheetBlock);
// final UGraphic2 ug = fileFormat.createUGraphic(new ColorMapperIdentity(), 1, dim, null, false);
- // // sheetBlock.drawU(ug.apply(new UTranslate(0, 10)));
+ // // sheetBlock.drawU(ug.apply(UTranslate.dy(10)));
// sheetBlock.drawU(ug);
// ug.writeImageTOBEMOVED(os, null, 96);
// return new ImageDataSimple(dim);
diff --git a/src/net/sourceforge/plantuml/creole/Position.java b/src/net/sourceforge/plantuml/creole/Position.java
index 3863a21ab..0938b8fd5 100644
--- a/src/net/sourceforge/plantuml/creole/Position.java
+++ b/src/net/sourceforge/plantuml/creole/Position.java
@@ -37,13 +37,13 @@ package net.sourceforge.plantuml.creole;
import java.awt.geom.Dimension2D;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
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;
public class Position {
@@ -99,7 +99,7 @@ public class Position {
public void drawDebug(UGraphic ug) {
// ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK)).apply(new UChangeBackColor(HtmlColorUtils.LIGHT_GRAY));
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK)).apply(new UChangeBackColor(null));
+ ug = ug.apply(new UChangeColor(HColorUtils.BLACK)).apply(new UChangeBackColor(null));
ug = ug.apply(new UTranslate(x, y));
ug.draw(new URectangle(dim));
}
diff --git a/src/net/sourceforge/plantuml/creole/Sea.java b/src/net/sourceforge/plantuml/creole/Sea.java
index 7c352560d..d00a7128e 100644
--- a/src/net/sourceforge/plantuml/creole/Sea.java
+++ b/src/net/sourceforge/plantuml/creole/Sea.java
@@ -39,6 +39,7 @@ import java.awt.geom.Dimension2D;
import java.util.HashMap;
import java.util.Map;
+import net.sourceforge.plantuml.creole.atom.Atom;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.MinMax;
diff --git a/src/net/sourceforge/plantuml/creole/SheetBlock1.java b/src/net/sourceforge/plantuml/creole/SheetBlock1.java
index 2fbae6928..0ee09d468 100644
--- a/src/net/sourceforge/plantuml/creole/SheetBlock1.java
+++ b/src/net/sourceforge/plantuml/creole/SheetBlock1.java
@@ -44,6 +44,7 @@ import java.util.Map;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.LineBreakStrategy;
+import net.sourceforge.plantuml.creole.atom.Atom;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.InnerStrategy;
diff --git a/src/net/sourceforge/plantuml/creole/SheetBlock2.java b/src/net/sourceforge/plantuml/creole/SheetBlock2.java
index 49587671e..1a87ba729 100644
--- a/src/net/sourceforge/plantuml/creole/SheetBlock2.java
+++ b/src/net/sourceforge/plantuml/creole/SheetBlock2.java
@@ -39,6 +39,7 @@ import java.awt.geom.Dimension2D;
import java.awt.geom.Rectangle2D;
import java.util.List;
+import net.sourceforge.plantuml.creole.atom.Atom;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
diff --git a/src/net/sourceforge/plantuml/creole/Stripe.java b/src/net/sourceforge/plantuml/creole/Stripe.java
index 3a2dc82a0..ccbd039a9 100644
--- a/src/net/sourceforge/plantuml/creole/Stripe.java
+++ b/src/net/sourceforge/plantuml/creole/Stripe.java
@@ -37,6 +37,8 @@ package net.sourceforge.plantuml.creole;
import java.util.List;
+import net.sourceforge.plantuml.creole.atom.Atom;
+
public interface Stripe {
public Atom getHeader();
diff --git a/src/net/sourceforge/plantuml/creole/StripeSimple.java b/src/net/sourceforge/plantuml/creole/StripeSimple.java
index 00f0fb43e..60863765d 100644
--- a/src/net/sourceforge/plantuml/creole/StripeSimple.java
+++ b/src/net/sourceforge/plantuml/creole/StripeSimple.java
@@ -42,15 +42,39 @@ import java.util.List;
import net.sourceforge.plantuml.BackSlash;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.creole.atom.Atom;
+import net.sourceforge.plantuml.creole.atom.AtomImg;
+import net.sourceforge.plantuml.creole.atom.AtomMath;
+import net.sourceforge.plantuml.creole.atom.AtomOpenIcon;
+import net.sourceforge.plantuml.creole.atom.AtomSpace;
+import net.sourceforge.plantuml.creole.atom.AtomSprite;
+import net.sourceforge.plantuml.creole.atom.AtomText;
+import net.sourceforge.plantuml.creole.command.Command;
+import net.sourceforge.plantuml.creole.command.CommandCreoleColorAndSizeChange;
+import net.sourceforge.plantuml.creole.command.CommandCreoleColorChange;
+import net.sourceforge.plantuml.creole.command.CommandCreoleExposantChange;
+import net.sourceforge.plantuml.creole.command.CommandCreoleFontFamilyChange;
+import net.sourceforge.plantuml.creole.command.CommandCreoleImg;
+import net.sourceforge.plantuml.creole.command.CommandCreoleLatex;
+import net.sourceforge.plantuml.creole.command.CommandCreoleMath;
+import net.sourceforge.plantuml.creole.command.CommandCreoleMonospaced;
+import net.sourceforge.plantuml.creole.command.CommandCreoleOpenIcon;
+import net.sourceforge.plantuml.creole.command.CommandCreoleQrcode;
+import net.sourceforge.plantuml.creole.command.CommandCreoleSizeChange;
+import net.sourceforge.plantuml.creole.command.CommandCreoleSpace;
+import net.sourceforge.plantuml.creole.command.CommandCreoleSprite;
+import net.sourceforge.plantuml.creole.command.CommandCreoleStyle;
+import net.sourceforge.plantuml.creole.command.CommandCreoleSvgAttributeChange;
+import net.sourceforge.plantuml.creole.command.CommandCreoleUrl;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.FontPosition;
import net.sourceforge.plantuml.graphic.FontStyle;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.ImgValign;
import net.sourceforge.plantuml.math.ScientificEquationSafe;
import net.sourceforge.plantuml.openiconic.OpenIcon;
import net.sourceforge.plantuml.sprite.Sprite;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.utils.CharHidder;
public class StripeSimple implements Stripe {
@@ -202,14 +226,14 @@ public class StripeSimple implements Stripe {
atoms.add(AtomText.createUrl(url, fontConfiguration, skinParam));
}
- public void addSprite(String src, double scale, HtmlColor color) {
+ public void addSprite(String src, double scale, HColor color) {
final Sprite sprite = skinParam.getSprite(src);
if (sprite != null) {
atoms.add(new AtomSprite(color, scale, fontConfiguration, sprite, null));
}
}
- public void addOpenIcon(String src, double scale, HtmlColor color) {
+ public void addOpenIcon(String src, double scale, HColor color) {
final OpenIcon openIcon = OpenIcon.retrieve(src);
if (openIcon != null) {
atoms.add(new AtomOpenIcon(color, scale, openIcon, fontConfiguration, null));
diff --git a/src/net/sourceforge/plantuml/creole/StripeStyle.java b/src/net/sourceforge/plantuml/creole/StripeStyle.java
index b3ed0e4b1..53107ca63 100644
--- a/src/net/sourceforge/plantuml/creole/StripeStyle.java
+++ b/src/net/sourceforge/plantuml/creole/StripeStyle.java
@@ -35,6 +35,9 @@
*/
package net.sourceforge.plantuml.creole;
+import net.sourceforge.plantuml.creole.atom.Atom;
+import net.sourceforge.plantuml.creole.atom.AtomText;
+import net.sourceforge.plantuml.creole.atom.Bullet;
import net.sourceforge.plantuml.graphic.FontConfiguration;
public class StripeStyle {
diff --git a/src/net/sourceforge/plantuml/creole/StripeTable.java b/src/net/sourceforge/plantuml/creole/StripeTable.java
index a4f941e2b..a06b83f34 100644
--- a/src/net/sourceforge/plantuml/creole/StripeTable.java
+++ b/src/net/sourceforge/plantuml/creole/StripeTable.java
@@ -43,9 +43,12 @@ import java.util.StringTokenizer;
import net.sourceforge.plantuml.BackSlash;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.LineBreakStrategy;
+import net.sourceforge.plantuml.creole.atom.Atom;
+import net.sourceforge.plantuml.creole.atom.AtomTable;
+import net.sourceforge.plantuml.creole.atom.AtomWithMargin;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class StripeTable implements Stripe {
@@ -53,7 +56,7 @@ public class StripeTable implements Stripe {
HEADER, NORMAL
};
- private FontConfiguration fontConfiguration;
+ final private FontConfiguration fontConfiguration;
final private ISkinSimple skinParam;
final private AtomTable table;
final private Atom marged;
@@ -62,19 +65,19 @@ public class StripeTable implements Stripe {
public StripeTable(FontConfiguration fontConfiguration, ISkinSimple skinParam, String line) {
this.skinParam = skinParam;
this.fontConfiguration = fontConfiguration;
- HtmlColor lineColor = getBackOrFrontColor(line, 1);
+ HColor lineColor = getBackOrFrontColor(line, 1);
if (lineColor == null) {
lineColor = fontConfiguration.getColor();
}
this.table = new AtomTable(lineColor);
this.marged = new AtomWithMargin(table, 2, 2);
- analyzeAndAddInternal(line, Mode.HEADER);
+ analyzeAndAddInternal(line);
}
public List getAtoms() {
- return Collections. singletonList(marged);
+ return Collections.singletonList(marged);
}
-
+
public Atom getHeader() {
return null;
}
@@ -87,7 +90,7 @@ public class StripeTable implements Stripe {
return new SheetBlock1(sheet, LineBreakStrategy.NONE, padding);
}
- private HtmlColor getBackOrFrontColor(String line, int idx) {
+ private HColor getBackOrFrontColor(String line, int idx) {
if (CreoleParser.doesStartByColor(line)) {
final int idx1 = line.indexOf('#');
final int idx2 = line.indexOf('>');
@@ -112,27 +115,29 @@ public class StripeTable implements Stripe {
private static final String hiddenBar = "\uE000";
- private void analyzeAndAddInternal(String line, Mode mode) {
+ private void analyzeAndAddInternal(String line) {
line = line.replace("\\|", hiddenBar);
- HtmlColor lineBackColor = getBackOrFrontColor(line, 0);
+ HColor lineBackColor = getBackOrFrontColor(line, 0);
if (lineBackColor != null) {
line = withouBackColor(line);
}
table.newLine(lineBackColor);
for (final StringTokenizer st = new StringTokenizer(line, "|"); st.hasMoreTokens();) {
+ Mode mode = Mode.NORMAL;
String v = st.nextToken().replace(hiddenBar.charAt(0), '|');
- HtmlColor cellBackColor = getBackOrFrontColor(v, 0);
+ if (v.startsWith("=")) {
+ v = v.substring(1);
+ mode = Mode.HEADER;
+ }
+ HColor cellBackColor = getBackOrFrontColor(v, 0);
if (cellBackColor != null) {
v = withouBackColor(v);
}
- if (mode == Mode.HEADER && v.startsWith("=")) {
- v = v.substring(1);
- }
final List lines = getWithNewlinesInternal(v);
final List cells = new ArrayList();
for (String s : lines) {
- final StripeSimple cell = new StripeSimple(getFontConfiguration(mode), stripeStyle,
- new CreoleContext(), skinParam, CreoleMode.FULL);
+ final StripeSimple cell = new StripeSimple(getFontConfiguration(mode), stripeStyle, new CreoleContext(),
+ skinParam, CreoleMode.FULL);
if (s.startsWith("")) {
cell.setCellAlignment(HorizontalAlignment.RIGHT);
s = s.substring("".length());
@@ -179,8 +184,8 @@ public class StripeTable implements Stripe {
return fontConfiguration.bold();
}
- public void analyzeAndAddNormal(String line) {
- analyzeAndAddInternal(line, Mode.NORMAL);
+ public void analyzeAndAddLine(String line) {
+ analyzeAndAddInternal(line);
}
}
diff --git a/src/net/sourceforge/plantuml/creole/StripeTree.java b/src/net/sourceforge/plantuml/creole/StripeTree.java
index c95572082..edbcd482e 100644
--- a/src/net/sourceforge/plantuml/creole/StripeTree.java
+++ b/src/net/sourceforge/plantuml/creole/StripeTree.java
@@ -39,6 +39,9 @@ import java.util.Collections;
import java.util.List;
import net.sourceforge.plantuml.ISkinSimple;
+import net.sourceforge.plantuml.creole.atom.Atom;
+import net.sourceforge.plantuml.creole.atom.AtomTree;
+import net.sourceforge.plantuml.creole.atom.AtomWithMargin;
import net.sourceforge.plantuml.graphic.FontConfiguration;
public class StripeTree implements Stripe {
diff --git a/src/net/sourceforge/plantuml/creole/AbstractAtom.java b/src/net/sourceforge/plantuml/creole/atom/AbstractAtom.java
similarity index 97%
rename from src/net/sourceforge/plantuml/creole/AbstractAtom.java
rename to src/net/sourceforge/plantuml/creole/atom/AbstractAtom.java
index 0abfe3f5c..37898c6ca 100644
--- a/src/net/sourceforge/plantuml/creole/AbstractAtom.java
+++ b/src/net/sourceforge/plantuml/creole/atom/AbstractAtom.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.util.Arrays;
import java.util.List;
diff --git a/src/net/sourceforge/plantuml/creole/Atom.java b/src/net/sourceforge/plantuml/creole/atom/Atom.java
similarity index 97%
rename from src/net/sourceforge/plantuml/creole/Atom.java
rename to src/net/sourceforge/plantuml/creole/atom/Atom.java
index 5c7404176..39457944d 100644
--- a/src/net/sourceforge/plantuml/creole/Atom.java
+++ b/src/net/sourceforge/plantuml/creole/atom/Atom.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.awt.geom.Dimension2D;
import java.util.List;
diff --git a/src/net/sourceforge/plantuml/creole/AtomHorizontalTexts.java b/src/net/sourceforge/plantuml/creole/atom/AtomHorizontalTexts.java
similarity index 96%
rename from src/net/sourceforge/plantuml/creole/AtomHorizontalTexts.java
rename to src/net/sourceforge/plantuml/creole/atom/AtomHorizontalTexts.java
index 251112365..3e80d5a3f 100644
--- a/src/net/sourceforge/plantuml/creole/AtomHorizontalTexts.java
+++ b/src/net/sourceforge/plantuml/creole/atom/AtomHorizontalTexts.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.awt.geom.Dimension2D;
import java.util.List;
@@ -72,7 +72,7 @@ public class AtomHorizontalTexts extends AbstractAtom implements Atom {
double x = 0;
for (Atom text : all) {
final Dimension2D dim = text.calculateDimension(ug.getStringBounder());
- text.drawU(ug.apply(new UTranslate(x, 0)));
+ text.drawU(ug.apply(UTranslate.dx(x)));
x += dim.getWidth();
}
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomImg.java b/src/net/sourceforge/plantuml/creole/atom/AtomImg.java
similarity index 98%
rename from src/net/sourceforge/plantuml/creole/AtomImg.java
rename to src/net/sourceforge/plantuml/creole/atom/AtomImg.java
index 7f23d9df3..a5b25605f 100644
--- a/src/net/sourceforge/plantuml/creole/AtomImg.java
+++ b/src/net/sourceforge/plantuml/creole/atom/AtomImg.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.awt.Color;
import java.awt.geom.Dimension2D;
@@ -45,8 +45,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
-import java.util.Arrays;
-import java.util.List;
import javax.imageio.ImageIO;
diff --git a/src/net/sourceforge/plantuml/creole/AtomImgSvg.java b/src/net/sourceforge/plantuml/creole/atom/AtomImgSvg.java
similarity index 97%
rename from src/net/sourceforge/plantuml/creole/AtomImgSvg.java
rename to src/net/sourceforge/plantuml/creole/atom/AtomImgSvg.java
index e5e78774d..31650f466 100644
--- a/src/net/sourceforge/plantuml/creole/AtomImgSvg.java
+++ b/src/net/sourceforge/plantuml/creole/atom/AtomImgSvg.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.awt.geom.Dimension2D;
diff --git a/src/net/sourceforge/plantuml/creole/AtomMath.java b/src/net/sourceforge/plantuml/creole/atom/AtomMath.java
similarity index 86%
rename from src/net/sourceforge/plantuml/creole/AtomMath.java
rename to src/net/sourceforge/plantuml/creole/atom/AtomMath.java
index 4815d8735..e8d4b87e5 100644
--- a/src/net/sourceforge/plantuml/creole/AtomMath.java
+++ b/src/net/sourceforge/plantuml/creole/atom/AtomMath.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.awt.Color;
import java.awt.geom.Dimension2D;
@@ -41,24 +41,24 @@ import java.awt.image.BufferedImage;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.SvgString;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSimple;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.math.ScientificEquationSafe;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UImageSvg;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSimple;
public class AtomMath extends AbstractAtom implements Atom {
private final double scale;
private final ScientificEquationSafe math;
- private final HtmlColor foreground;
- private final HtmlColor background;
+ private final HColor foreground;
+ private final HColor background;
private final ColorMapper colorMapper;
- public AtomMath(ScientificEquationSafe math, HtmlColor foreground, HtmlColor background, double scale,
+ public AtomMath(ScientificEquationSafe math, HColor foreground, HColor background, double scale,
ColorMapper colorMapper) {
this.math = math;
this.colorMapper = colorMapper;
@@ -104,8 +104,8 @@ public class AtomMath extends AbstractAtom implements Atom {
}
}
- private Color getColor(HtmlColor color, Color defaultValue) {
- if (color instanceof HtmlColorSimple) {
+ private Color getColor(HColor color, Color defaultValue) {
+ if (color instanceof HColorSimple) {
return colorMapper.getMappedColor(color);
// return ((HtmlColorSimple) color).getColor999();
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomOpenIcon.java b/src/net/sourceforge/plantuml/creole/atom/AtomOpenIcon.java
similarity index 91%
rename from src/net/sourceforge/plantuml/creole/AtomOpenIcon.java
rename to src/net/sourceforge/plantuml/creole/atom/AtomOpenIcon.java
index 1f51ce092..181e6dba0 100644
--- a/src/net/sourceforge/plantuml/creole/AtomOpenIcon.java
+++ b/src/net/sourceforge/plantuml/creole/atom/AtomOpenIcon.java
@@ -33,27 +33,27 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.openiconic.OpenIcon;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class AtomOpenIcon extends AbstractAtom implements Atom {
private final OpenIcon openIcon;
private final double factor;
private final Url url;
- private final HtmlColor color;
+ private final HColor color;
- public AtomOpenIcon(HtmlColor newColor, double scale, OpenIcon openIcon, FontConfiguration fontConfiguration,
+ public AtomOpenIcon(HColor newColor, double scale, OpenIcon openIcon, FontConfiguration fontConfiguration,
Url url) {
this.url = url;
this.openIcon = openIcon;
diff --git a/src/net/sourceforge/plantuml/creole/AtomSpace.java b/src/net/sourceforge/plantuml/creole/atom/AtomSpace.java
similarity index 97%
rename from src/net/sourceforge/plantuml/creole/AtomSpace.java
rename to src/net/sourceforge/plantuml/creole/atom/AtomSpace.java
index 2f73c298b..83378de3b 100644
--- a/src/net/sourceforge/plantuml/creole/AtomSpace.java
+++ b/src/net/sourceforge/plantuml/creole/atom/AtomSpace.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.awt.geom.Dimension2D;
diff --git a/src/net/sourceforge/plantuml/creole/AtomSprite.java b/src/net/sourceforge/plantuml/creole/atom/AtomSprite.java
similarity index 88%
rename from src/net/sourceforge/plantuml/creole/AtomSprite.java
rename to src/net/sourceforge/plantuml/creole/atom/AtomSprite.java
index 7aa15b1a0..04a8c0cd1 100644
--- a/src/net/sourceforge/plantuml/creole/AtomSprite.java
+++ b/src/net/sourceforge/plantuml/creole/atom/AtomSprite.java
@@ -33,27 +33,25 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.awt.geom.Dimension2D;
-import java.util.Arrays;
-import java.util.List;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.sprite.Sprite;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class AtomSprite extends AbstractAtom implements Atom {
private final Sprite sprite;
private final double scale;
private final Url url;
- private final HtmlColor color;
+ private final HColor color;
- public AtomSprite(HtmlColor newColor, double scale, FontConfiguration fontConfiguration, Sprite sprite, Url url) {
+ public AtomSprite(HColor newColor, double scale, FontConfiguration fontConfiguration, Sprite sprite, Url url) {
this.scale = scale;
this.sprite = sprite;
this.url = url;
diff --git a/src/net/sourceforge/plantuml/creole/AtomTable.java b/src/net/sourceforge/plantuml/creole/atom/AtomTable.java
similarity index 87%
rename from src/net/sourceforge/plantuml/creole/AtomTable.java
rename to src/net/sourceforge/plantuml/creole/atom/AtomTable.java
index 6022d5a82..84f0a4153 100644
--- a/src/net/sourceforge/plantuml/creole/AtomTable.java
+++ b/src/net/sourceforge/plantuml/creole/atom/AtomTable.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.awt.geom.Dimension2D;
import java.util.ArrayList;
@@ -42,8 +42,9 @@ import java.util.List;
import java.util.Map;
import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.creole.Position;
+import net.sourceforge.plantuml.creole.SheetBlock1;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -51,19 +52,20 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
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;
public class AtomTable extends AbstractAtom implements Atom {
class Line {
private final List cells = new ArrayList();
- private final List cellsBackColor = new ArrayList();
- private final HtmlColor lineBackColor;
+ private final List cellsBackColor = new ArrayList();
+ private final HColor lineBackColor;
- private Line(HtmlColor lineBackColor) {
+ private Line(HColor lineBackColor) {
this.lineBackColor = lineBackColor;
}
- public void add(Atom cell, HtmlColor cellBackColor) {
+ public void add(Atom cell, HColor cellBackColor) {
cells.add(cell);
cellsBackColor.add(cellBackColor);
}
@@ -80,9 +82,9 @@ public class AtomTable extends AbstractAtom implements Atom {
private final List lines = new ArrayList();
private final Map positions = new HashMap();
- private final HtmlColor lineColor;
+ private final HColor lineColor;
- public AtomTable(HtmlColor lineColor) {
+ public AtomTable(HColor lineColor) {
this.lineColor = lineColor;
}
@@ -118,7 +120,7 @@ public class AtomTable extends AbstractAtom implements Atom {
if (cell instanceof SheetBlock1) {
align = ((SheetBlock1) cell).getCellAlignment();
}
- final HtmlColor cellBackColor = line.cellsBackColor.get(j);
+ final HColor cellBackColor = line.cellsBackColor.get(j);
final double x1 = getStartingX(j);
final double x2 = getStartingX(j + 1);
final double cellWidth = x2 - x1;
@@ -136,17 +138,17 @@ public class AtomTable extends AbstractAtom implements Atom {
} else {
dx = 0;
}
- cell.drawU(ug.apply(pos.getTranslate().compose(new UTranslate(dx, 0))));
+ cell.drawU(ug.apply(pos.getTranslate().compose(UTranslate.dx(dx))));
}
}
ug = ug.apply(new UChangeColor(lineColor));
- final ULine hline = new ULine(getEndingX(getNbCols() - 1), 0);
+ final ULine hline = ULine.hline(getEndingX(getNbCols() - 1));
for (int i = 0; i <= getNbLines(); i++) {
- ug.apply(new UTranslate(0, getStartingY(i))).draw(hline);
+ ug.apply(UTranslate.dy(getStartingY(i))).draw(hline);
}
- final ULine vline = new ULine(0, getEndingY(getNbLines() - 1));
+ final ULine vline = ULine.vline(getEndingY(getNbLines() - 1));
for (int i = 0; i <= getNbCols(); i++) {
- ug.apply(new UTranslate(getStartingX(i), 0)).draw(vline);
+ ug.apply(UTranslate.dx(getStartingX(i))).draw(vline);
}
}
@@ -256,12 +258,12 @@ public class AtomTable extends AbstractAtom implements Atom {
return lines.get(lines.size() - 1);
}
- public void addCell(Atom cell, HtmlColor cellBackColor) {
+ public void addCell(Atom cell, HColor cellBackColor) {
lastLine().add(cell, cellBackColor);
positions.clear();
}
- public void newLine(HtmlColor lineBackColor) {
+ public void newLine(HColor lineBackColor) {
lines.add(new Line(lineBackColor));
}
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomText.java b/src/net/sourceforge/plantuml/creole/atom/AtomText.java
similarity index 95%
rename from src/net/sourceforge/plantuml/creole/AtomText.java
rename to src/net/sourceforge/plantuml/creole/atom/AtomText.java
index 2d1b61d4b..872c95ada 100644
--- a/src/net/sourceforge/plantuml/creole/AtomText.java
+++ b/src/net/sourceforge/plantuml/creole/atom/AtomText.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.awt.font.LineMetrics;
import java.awt.geom.Dimension2D;
@@ -53,11 +53,9 @@ import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.creole.command.CommandCreoleImg;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorAutomatic;
-import net.sourceforge.plantuml.graphic.HtmlColorSimple;
import net.sourceforge.plantuml.graphic.ImgValign;
import net.sourceforge.plantuml.graphic.Splitter;
import net.sourceforge.plantuml.graphic.StringBounder;
@@ -67,6 +65,9 @@ import net.sourceforge.plantuml.sprite.Sprite;
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.HColorSimple;
import net.sourceforge.plantuml.utils.CharHidder;
public class AtomText extends AbstractAtom implements Atom {
@@ -240,14 +241,14 @@ public class AtomText extends AbstractAtom implements Atom {
if (ug.matchesProperty("SPECIALTXT")) {
ug.draw(this);
} else {
- HtmlColor textColor = fontConfiguration.getColor();
+ HColor textColor = fontConfiguration.getColor();
FontConfiguration useFontConfiguration = fontConfiguration;
- if (textColor instanceof HtmlColorAutomatic && ug.getParam().getBackcolor() != null) {
- textColor = ((HtmlColorSimple) ug.getParam().getBackcolor()).opposite();
+ if (textColor instanceof HColorAutomatic && ug.getParam().getBackcolor() != null) {
+ textColor = ((HColorSimple) ug.getParam().getBackcolor()).opposite();
useFontConfiguration = fontConfiguration.changeColor(textColor);
}
if (marginLeft != ZERO) {
- ug = ug.apply(new UTranslate(marginLeft.getDouble(ug.getStringBounder()), 0));
+ ug = ug.apply(UTranslate.dx(marginLeft.getDouble(ug.getStringBounder())));
}
final StringTokenizer tokenizer = new StringTokenizer(text, "\t", true);
diff --git a/src/net/sourceforge/plantuml/creole/AtomTree.java b/src/net/sourceforge/plantuml/creole/atom/AtomTree.java
similarity index 90%
rename from src/net/sourceforge/plantuml/creole/AtomTree.java
rename to src/net/sourceforge/plantuml/creole/atom/AtomTree.java
index 17c5fbf82..c5d32b6d1 100644
--- a/src/net/sourceforge/plantuml/creole/AtomTree.java
+++ b/src/net/sourceforge/plantuml/creole/atom/AtomTree.java
@@ -33,31 +33,30 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.awt.geom.Dimension2D;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.sourceforge.plantuml.Dimension2DDouble;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.salt.element.Skeleton2;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class AtomTree extends AbstractAtom implements Atom {
- private final HtmlColor lineColor;
+ private final HColor lineColor;
private final List cells = new ArrayList();
private final Map levels = new HashMap();
private final double margin = 2;
- public AtomTree(HtmlColor lineColor) {
+ public AtomTree(HColor lineColor) {
this.lineColor = lineColor;
}
@@ -84,10 +83,10 @@ public class AtomTree extends AbstractAtom implements Atom {
UGraphic ug = ugInit;
for (Atom cell : cells) {
final int level = getLevel(cell);
- cell.drawU(ug.apply(new UTranslate(margin + skeleton.getXEndForLevel(level), 0)));
+ cell.drawU(ug.apply(UTranslate.dx(margin + skeleton.getXEndForLevel(level))));
final Dimension2D dim = cell.calculateDimension(ug.getStringBounder());
skeleton.add(level, y + dim.getHeight() / 2);
- ug = ug.apply(new UTranslate(0, dim.getHeight()));
+ ug = ug.apply(UTranslate.dy(dim.getHeight()));
y += dim.getHeight();
}
skeleton.draw(ugInit.apply(new UChangeColor(this.lineColor)));
diff --git a/src/net/sourceforge/plantuml/creole/AtomVerticalTexts.java b/src/net/sourceforge/plantuml/creole/atom/AtomVerticalTexts.java
similarity index 96%
rename from src/net/sourceforge/plantuml/creole/AtomVerticalTexts.java
rename to src/net/sourceforge/plantuml/creole/atom/AtomVerticalTexts.java
index 649829540..ddc6942d3 100644
--- a/src/net/sourceforge/plantuml/creole/AtomVerticalTexts.java
+++ b/src/net/sourceforge/plantuml/creole/atom/AtomVerticalTexts.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.awt.geom.Dimension2D;
import java.util.List;
@@ -69,7 +69,7 @@ public class AtomVerticalTexts extends AbstractAtom implements Atom {
double y = 0;
for (Atom text : all) {
final Dimension2D dim = text.calculateDimension(ug.getStringBounder());
- text.drawU(ug.apply(new UTranslate(0, y)));
+ text.drawU(ug.apply(UTranslate.dy(y)));
y += dim.getHeight();
}
}
diff --git a/src/net/sourceforge/plantuml/creole/AtomWithMargin.java b/src/net/sourceforge/plantuml/creole/atom/AtomWithMargin.java
similarity index 93%
rename from src/net/sourceforge/plantuml/creole/AtomWithMargin.java
rename to src/net/sourceforge/plantuml/creole/atom/AtomWithMargin.java
index 806c85949..7fe4e2d84 100644
--- a/src/net/sourceforge/plantuml/creole/AtomWithMargin.java
+++ b/src/net/sourceforge/plantuml/creole/atom/AtomWithMargin.java
@@ -33,11 +33,10 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.awt.geom.Dimension2D;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -46,7 +45,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-class AtomWithMargin extends AbstractAtom implements Atom {
+public class AtomWithMargin extends AbstractAtom implements Atom {
private final double marginY1;
private final double marginY2;
@@ -85,7 +84,7 @@ class AtomWithMargin extends AbstractAtom implements Atom {
}
public void drawU(UGraphic ug) {
- atom.drawU(ug.apply(new UTranslate(0, marginY1)));
+ atom.drawU(ug.apply(UTranslate.dy(marginY1)));
}
}
diff --git a/src/net/sourceforge/plantuml/creole/Bullet.java b/src/net/sourceforge/plantuml/creole/atom/Bullet.java
similarity index 92%
rename from src/net/sourceforge/plantuml/creole/Bullet.java
rename to src/net/sourceforge/plantuml/creole/atom/Bullet.java
index 40f2e404f..0293cfbe1 100644
--- a/src/net/sourceforge/plantuml/creole/Bullet.java
+++ b/src/net/sourceforge/plantuml/creole/atom/Bullet.java
@@ -33,13 +33,12 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.atom;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -48,6 +47,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.HColor;
public class Bullet extends AbstractAtom implements Atom {
@@ -80,10 +80,10 @@ public class Bullet extends AbstractAtom implements Atom {
}
private void drawU0(UGraphic ug) {
- final HtmlColor color = fontConfiguration.getColor();
+ final HColor color = fontConfiguration.getColor();
ug = ug.apply(new UChangeColor(color)).apply(new UChangeBackColor(color)).apply(new UStroke(0));
// final double width = getWidth(ug.getStringBounder());
- ug = ug.apply(new UTranslate(3, 0));
+ ug = ug.apply(UTranslate.dx(3));
ug.draw(new UEllipse(5, 5));
}
@@ -96,10 +96,10 @@ public class Bullet extends AbstractAtom implements Atom {
}
private void drawU1(UGraphic ug) {
- final HtmlColor color = fontConfiguration.getColor();
+ final HColor color = fontConfiguration.getColor();
ug = ug.apply(new UChangeColor(color)).apply(new UChangeBackColor(color)).apply(new UStroke(0));
final double width = getWidth(ug.getStringBounder());
- ug = ug.apply(new UTranslate(width - 5, 0));
+ ug = ug.apply(UTranslate.dx(width - 5));
ug.draw(new URectangle(3.5, 3.5));
}
diff --git a/src/net/sourceforge/plantuml/creole/Command.java b/src/net/sourceforge/plantuml/creole/command/Command.java
similarity index 93%
rename from src/net/sourceforge/plantuml/creole/Command.java
rename to src/net/sourceforge/plantuml/creole/command/Command.java
index 205438144..5c8f87b54 100644
--- a/src/net/sourceforge/plantuml/creole/Command.java
+++ b/src/net/sourceforge/plantuml/creole/command/Command.java
@@ -33,7 +33,9 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
+
+import net.sourceforge.plantuml.creole.StripeSimple;
public interface Command {
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleColorAndSizeChange.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleColorAndSizeChange.java
similarity index 91%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleColorAndSizeChange.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleColorAndSizeChange.java
index 9eecad2f6..ca2c3a0d6 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleColorAndSizeChange.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleColorAndSizeChange.java
@@ -33,14 +33,15 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.creole.StripeSimple;
import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class CommandCreoleColorAndSizeChange implements Command {
@@ -84,7 +85,7 @@ public class CommandCreoleColorAndSizeChange implements Command {
fc2 = fc2.changeSize(Integer.parseInt(m.group(2)));
}
if (m.group(3) != null) {
- final HtmlColor color = HtmlColorSet.getInstance().getColorIfValid(m.group(3));
+ final HColor color = HColorSet.instance().getColorIfValid(m.group(3));
fc2 = fc2.changeColor(color);
}
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleColorChange.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleColorChange.java
similarity index 90%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleColorChange.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleColorChange.java
index 189618e60..495f6b8aa 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleColorChange.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleColorChange.java
@@ -33,15 +33,16 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.creole.StripeSimple;
import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.Splitter;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class CommandCreoleColorChange implements Command {
@@ -74,7 +75,7 @@ public class CommandCreoleColorChange implements Command {
throw new IllegalStateException();
}
final FontConfiguration fc1 = stripe.getActualFontConfiguration();
- final HtmlColor color = HtmlColorSet.getInstance().getColorIfValid(m.group(2));
+ final HColor color = HColorSet.instance().getColorIfValid(m.group(2));
final FontConfiguration fc2 = fc1.changeColor(color);
stripe.setActualFontConfiguration(fc2);
stripe.analyzeAndAdd(m.group(3));
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleExposantChange.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleExposantChange.java
similarity index 96%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleExposantChange.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleExposantChange.java
index 9d8bd96d1..5c86e93f6 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleExposantChange.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleExposantChange.java
@@ -33,11 +33,12 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.creole.StripeSimple;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.FontPosition;
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleFontFamilyChange.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleFontFamilyChange.java
similarity index 96%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleFontFamilyChange.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleFontFamilyChange.java
index 76c36602e..55fbe1bb6 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleFontFamilyChange.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleFontFamilyChange.java
@@ -33,11 +33,12 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.creole.StripeSimple;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.Splitter;
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleImg.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleImg.java
similarity index 96%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleImg.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleImg.java
index 2369ff8fe..c41b92560 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleImg.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleImg.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -42,6 +42,7 @@ import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.creole.StripeSimple;
import net.sourceforge.plantuml.graphic.Splitter;
public class CommandCreoleImg implements Command {
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleLatex.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleLatex.java
similarity index 95%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleLatex.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleLatex.java
index 32a0a3608..185494b3f 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleLatex.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleLatex.java
@@ -33,11 +33,12 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.creole.StripeSimple;
import net.sourceforge.plantuml.graphic.Splitter;
import net.sourceforge.plantuml.math.ScientificEquationSafe;
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleMath.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleMath.java
similarity index 95%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleMath.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleMath.java
index 1dd2ac3ca..27ad87fad 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleMath.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleMath.java
@@ -33,11 +33,12 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.creole.StripeSimple;
import net.sourceforge.plantuml.graphic.Splitter;
import net.sourceforge.plantuml.math.ScientificEquationSafe;
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleMonospaced.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleMonospaced.java
similarity index 96%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleMonospaced.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleMonospaced.java
index 019308e29..d5b46f2a5 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleMonospaced.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleMonospaced.java
@@ -33,11 +33,12 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.creole.StripeSimple;
import net.sourceforge.plantuml.graphic.FontConfiguration;
public class CommandCreoleMonospaced implements Command {
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleOpenIcon.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleOpenIcon.java
similarity index 86%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleOpenIcon.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleOpenIcon.java
index cb4a87213..74fe4e281 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleOpenIcon.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleOpenIcon.java
@@ -33,26 +33,27 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.IHtmlColorSet;
+import net.sourceforge.plantuml.creole.StripeSimple;
import net.sourceforge.plantuml.graphic.Splitter;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class CommandCreoleOpenIcon implements Command {
private final Pattern2 pattern;
- private final IHtmlColorSet colorSet;
+ private final HColorSet colorSet;
- private CommandCreoleOpenIcon(IHtmlColorSet colorSet, String p) {
+ private CommandCreoleOpenIcon(HColorSet colorSet, String p) {
this.pattern = MyPattern.cmpile(p);
this.colorSet = colorSet;
}
- public static Command create(IHtmlColorSet colorSet) {
+ public static Command create(HColorSet colorSet) {
return new CommandCreoleOpenIcon(colorSet, "^(?i)(" + Splitter.openiconPattern + ")");
}
@@ -72,7 +73,7 @@ public class CommandCreoleOpenIcon implements Command {
final String src = m.group(2);
final double scale = CommandCreoleImg.getScale(m.group(3), 1);
final String colorName = CommandCreoleImg.getColor(m.group(3));
- HtmlColor color = null;
+ HColor color = null;
if (colorName != null) {
color = colorSet.getColorIfValid(colorName);
}
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleQrcode.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleQrcode.java
similarity index 95%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleQrcode.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleQrcode.java
index 94a27f34e..8160ce0e0 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleQrcode.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleQrcode.java
@@ -33,11 +33,12 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.creole.StripeSimple;
import net.sourceforge.plantuml.graphic.Splitter;
public class CommandCreoleQrcode implements Command {
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleSizeChange.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleSizeChange.java
similarity index 96%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleSizeChange.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleSizeChange.java
index d8d1ca9f6..b1289f931 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleSizeChange.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleSizeChange.java
@@ -33,11 +33,12 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.creole.StripeSimple;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.Splitter;
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleSpace.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleSpace.java
similarity index 96%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleSpace.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleSpace.java
index cb9188491..b667c2492 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleSpace.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleSpace.java
@@ -33,11 +33,12 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.creole.StripeSimple;
public class CommandCreoleSpace implements Command {
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleSprite.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleSprite.java
similarity index 86%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleSprite.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleSprite.java
index 34d585215..dbed01ccc 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleSprite.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleSprite.java
@@ -33,26 +33,27 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.IHtmlColorSet;
+import net.sourceforge.plantuml.creole.StripeSimple;
import net.sourceforge.plantuml.graphic.Splitter;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class CommandCreoleSprite implements Command {
private final Pattern2 pattern;
- private final IHtmlColorSet colorSet;
+ private final HColorSet colorSet;
- private CommandCreoleSprite(IHtmlColorSet colorSet, String p) {
+ private CommandCreoleSprite(HColorSet colorSet, String p) {
this.pattern = MyPattern.cmpile(p);
this.colorSet = colorSet;
}
- public static Command create(IHtmlColorSet colorSet) {
+ public static Command create(HColorSet colorSet) {
return new CommandCreoleSprite(colorSet, "^(?i)(" + Splitter.spritePattern2 + ")");
}
@@ -72,7 +73,7 @@ public class CommandCreoleSprite implements Command {
final String src = m.group(2);
final double scale = CommandCreoleImg.getScale(m.group(3), 1);
final String colorName = CommandCreoleImg.getColor(m.group(3));
- HtmlColor color = null;
+ HColor color = null;
if (colorName != null) {
color = colorSet.getColorIfValid(colorName);
}
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleStyle.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleStyle.java
similarity index 94%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleStyle.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleStyle.java
index 5a924e549..7cff02729 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleStyle.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleStyle.java
@@ -33,15 +33,16 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.creole.StripeSimple;
import net.sourceforge.plantuml.graphic.AddStyle;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.FontStyle;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandCreoleStyle implements Command {
@@ -70,7 +71,7 @@ public class CommandCreoleStyle implements Command {
this.tryExtendedColor = tryExtendedColor;
}
- private HtmlColor getExtendedColor(Matcher2 m) {
+ private HColor getExtendedColor(Matcher2 m) {
if (tryExtendedColor) {
return style.getExtendedColor(m.group(2));
}
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleSvgAttributeChange.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleSvgAttributeChange.java
similarity index 96%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleSvgAttributeChange.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleSvgAttributeChange.java
index 7430f3b55..68e62d76d 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleSvgAttributeChange.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleSvgAttributeChange.java
@@ -33,11 +33,12 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.creole.StripeSimple;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.Splitter;
import net.sourceforge.plantuml.graphic.SvgAttributes;
diff --git a/src/net/sourceforge/plantuml/creole/CommandCreoleUrl.java b/src/net/sourceforge/plantuml/creole/command/CommandCreoleUrl.java
similarity index 96%
rename from src/net/sourceforge/plantuml/creole/CommandCreoleUrl.java
rename to src/net/sourceforge/plantuml/creole/command/CommandCreoleUrl.java
index 6d2d3bde8..da90515af 100644
--- a/src/net/sourceforge/plantuml/creole/CommandCreoleUrl.java
+++ b/src/net/sourceforge/plantuml/creole/command/CommandCreoleUrl.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.creole;
+package net.sourceforge.plantuml.creole.command;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.Url;
@@ -42,6 +42,7 @@ import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.creole.StripeSimple;
public class CommandCreoleUrl implements Command {
diff --git a/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java b/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java
index 754c848a9..977ccde6a 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java
@@ -64,7 +64,7 @@ import net.sourceforge.plantuml.skin.VisibilityModifier;
import net.sourceforge.plantuml.statediagram.StateDiagram;
import net.sourceforge.plantuml.svek.CucaDiagramFileMaker;
import net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
import net.sourceforge.plantuml.xmi.CucaDiagramXmiMaker;
import net.sourceforge.plantuml.xmlsc.StateDiagramScxmlMaker;
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Display.java b/src/net/sourceforge/plantuml/cucadiagram/Display.java
index ddde2d883..ef1fa872a 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Display.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Display.java
@@ -64,7 +64,6 @@ import net.sourceforge.plantuml.creole.SheetBlock2;
import net.sourceforge.plantuml.graphic.CircledCharacter;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockSprited;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -75,6 +74,7 @@ import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class Display implements Iterable {
@@ -102,6 +102,16 @@ public class Display implements Iterable {
return result;
}
+ public Stereotype getStereotypeIfAny() {
+ for (CharSequence cs : displayData) {
+ if (cs instanceof Stereotype) {
+ return (Stereotype) cs;
+ }
+ }
+ return null;
+
+ }
+
public Display replaceBackslashT() {
final Display result = new Display(this, defaultCreoleMode);
for (int i = 0; i < result.displayData.size(); i++) {
@@ -464,7 +474,7 @@ public class Display implements Iterable {
public TextBlock create(FontConfiguration fontConfiguration, HorizontalAlignment horizontalAlignment,
ISkinSimple spriteContainer, LineBreakStrategy maxMessageSize, CreoleMode creoleMode,
- UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
+ UFont fontForStereotype, HColor htmlColorForStereotype) {
if (maxMessageSize == null) {
throw new IllegalArgumentException();
}
@@ -493,7 +503,7 @@ public class Display implements Iterable {
}
private TextBlock createStereotype(FontConfiguration fontConfiguration, HorizontalAlignment horizontalAlignment,
- SpriteContainer spriteContainer, int position, UFont fontForStereotype, HtmlColor htmlColorForStereotype,
+ SpriteContainer spriteContainer, int position, UFont fontForStereotype, HColor htmlColorForStereotype,
LineBreakStrategy maxMessageSize, CreoleMode creoleMode) {
final Stereotype stereotype = (Stereotype) get(position);
TextBlock circledCharacter = null;
diff --git a/src/net/sourceforge/plantuml/cucadiagram/EntityPosition.java b/src/net/sourceforge/plantuml/cucadiagram/EntityPosition.java
index 3efe0fc45..01ebf4c9a 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/EntityPosition.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/EntityPosition.java
@@ -76,17 +76,17 @@ public enum EntityPosition {
if (rankdir == Rankdir.TOP_TO_BOTTOM) {
final Shadowable rectangle = new URectangle(RADIUS * 2 * 4, RADIUS * 2);
ug.draw(rectangle);
- final ULine vline = new ULine(0, RADIUS * 2);
- ug.apply(new UTranslate(RADIUS * 2, 0)).draw(vline);
- ug.apply(new UTranslate(RADIUS * 2 * 2, 0)).draw(vline);
- ug.apply(new UTranslate(RADIUS * 2 * 3, 0)).draw(vline);
+ final ULine vline = ULine.vline(RADIUS * 2);
+ ug.apply(UTranslate.dx(RADIUS * 2)).draw(vline);
+ ug.apply(UTranslate.dx(RADIUS * 2 * 2)).draw(vline);
+ ug.apply(UTranslate.dx(RADIUS * 2 * 3)).draw(vline);
} else {
final Shadowable rectangle = new URectangle(RADIUS * 2, RADIUS * 2 * 4);
- ug.apply(new UTranslate(0, 0)).draw(rectangle);
- final ULine hline = new ULine(RADIUS * 2, 0);
- ug.apply(new UTranslate(0, RADIUS * 2)).draw(hline);
- ug.apply(new UTranslate(0, RADIUS * 2 * 2)).draw(hline);
- ug.apply(new UTranslate(0, RADIUS * 2 * 3)).draw(hline);
+ ug.apply(UTranslate.dy(0)).draw(rectangle);
+ final ULine hline = ULine.hline(RADIUS * 2);
+ ug.apply(UTranslate.dy(RADIUS * 2)).draw(hline);
+ ug.apply(UTranslate.dy(RADIUS * 2 * 2)).draw(hline);
+ ug.apply(UTranslate.dy(RADIUS * 2 * 3)).draw(hline);
}
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java b/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java
index dd3d93789..b76d83e91 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java
@@ -47,7 +47,6 @@ import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.cucadiagram.entity.EntityFactory;
import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.ColorType;
@@ -56,6 +55,7 @@ import net.sourceforge.plantuml.svek.IEntityImage;
import net.sourceforge.plantuml.svek.PackageStyle;
import net.sourceforge.plantuml.svek.SingleStrategy;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class GroupRoot implements IGroup {
@@ -251,7 +251,7 @@ public class GroupRoot implements IGroup {
throw new UnsupportedOperationException();
}
- public void setSpecificColorTOBEREMOVED(ColorType type, HtmlColor color) {
+ public void setSpecificColorTOBEREMOVED(ColorType type, HColor color) {
throw new UnsupportedOperationException();
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Ident.java b/src/net/sourceforge/plantuml/cucadiagram/Ident.java
index 077b023b4..54faf3639 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Ident.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Ident.java
@@ -85,7 +85,7 @@ public class Ident implements Code {
}
public static Ident empty() {
- return new Ident(Collections. emptyList());
+ return new Ident(Collections.emptyList());
}
public String getLast() {
@@ -150,7 +150,7 @@ public class Ident implements Code {
static private Ident from(String full, String separator) {
final Ident result = new Ident(new ArrayList());
- if (separator == null || full.contains(separator + separator)) {
+ if (isOdd(full, separator)) {
result.parts.add(full);
return result;
}
@@ -168,12 +168,17 @@ public class Ident implements Code {
}
}
+ private static boolean isOdd(String full, String separator) {
+ return separator == null || full.contains(separator + separator) || full.endsWith(separator);
+ }
+
private void checkResult(String separator) {
for (String s : this.parts) {
if (s.length() == 0) {
throw new IllegalStateException(toString());
}
- if (separator != null && s.contains(separator) && s.contains(separator + separator) == false) {
+ if (separator != null && s.contains(separator) && s.endsWith(separator) == false
+ && s.contains(separator + separator) == false) {
throw new IllegalStateException(toString());
}
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Link.java b/src/net/sourceforge/plantuml/cucadiagram/Link.java
index ad74b7850..7861fc0e3 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Link.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Link.java
@@ -46,7 +46,6 @@ import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.command.Position;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.USymbolInterface;
@@ -56,6 +55,7 @@ import net.sourceforge.plantuml.style.StyleBuilder;
import net.sourceforge.plantuml.svek.Bibliotekon;
import net.sourceforge.plantuml.ugraphic.UComment;
import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.utils.UniqueSequence;
public class Link extends WithLinkType implements Hideable, Removeable {
@@ -131,7 +131,7 @@ public class Link extends WithLinkType implements Hideable, Removeable {
}
public Link(IEntity cl1, IEntity cl2, LinkType type, Display label, int length, String qualifier1,
- String qualifier2, String labeldistance, String labelangle, HtmlColor specificColor,
+ String qualifier2, String labeldistance, String labelangle, HColor specificColor,
StyleBuilder styleBuilder) {
if (length < 1) {
throw new IllegalArgumentException();
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LinkConstraint.java b/src/net/sourceforge/plantuml/cucadiagram/LinkConstraint.java
index fc5dba195..c174a292c 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LinkConstraint.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LinkConstraint.java
@@ -42,13 +42,13 @@ import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
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;
public class LinkConstraint {
@@ -86,7 +86,7 @@ public class LinkConstraint {
if (x2 == 0 && y2 == 0) {
return;
}
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
+ ug = ug.apply(new UChangeColor(HColorUtils.BLACK));
// ug.apply(new UTranslate(x1, y1)).draw(new URectangle(10, 10));
// ug.apply(new UTranslate(x2, y2)).draw(new URectangle(10, 10));
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LinkDecor.java b/src/net/sourceforge/plantuml/cucadiagram/LinkDecor.java
index 617056967..65ff0ab60 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LinkDecor.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LinkDecor.java
@@ -36,7 +36,6 @@
package net.sourceforge.plantuml.cucadiagram;
import net.sourceforge.plantuml.OptionFlags;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.svek.extremity.ExtremityFactory;
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryArrow;
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryArrowAndCircle;
@@ -55,6 +54,7 @@ import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryParenthesis;
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryPlus;
import net.sourceforge.plantuml.svek.extremity.ExtremityFactorySquarre;
import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryTriangle;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public enum LinkDecor {
@@ -93,7 +93,7 @@ public enum LinkDecor {
return arrowSize;
}
- public ExtremityFactory getExtremityFactory(HtmlColor backgroundColor) {
+ public ExtremityFactory getExtremityFactory(HColor backgroundColor) {
if (this == LinkDecor.PLUS) {
return new ExtremityFactoryPlus();
} else if (this == LinkDecor.HALF_ARROW) {
diff --git a/src/net/sourceforge/plantuml/cucadiagram/LinkMiddleDecor.java b/src/net/sourceforge/plantuml/cucadiagram/LinkMiddleDecor.java
index 81994a9cf..f368b643b 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/LinkMiddleDecor.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/LinkMiddleDecor.java
@@ -35,17 +35,17 @@
*/
package net.sourceforge.plantuml.cucadiagram;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.svek.extremity.MiddleCircleCircledMode;
import net.sourceforge.plantuml.svek.extremity.MiddleFactory;
import net.sourceforge.plantuml.svek.extremity.MiddleFactoryCircle;
import net.sourceforge.plantuml.svek.extremity.MiddleFactoryCircleCircled;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public enum LinkMiddleDecor {
NONE, CIRCLE, CIRCLE_CIRCLED, CIRCLE_CIRCLED1, CIRCLE_CIRCLED2;
- public MiddleFactory getMiddleFactory(HtmlColor backColor) {
+ public MiddleFactory getMiddleFactory(HColor backColor) {
if (this == CIRCLE) {
return new MiddleFactoryCircle(backColor);
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java b/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java
index cfc30daaf..0503a7b31 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java
@@ -49,7 +49,6 @@ import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -67,6 +66,7 @@ import net.sourceforge.plantuml.ugraphic.PlacementStrategyY1Y2Center;
import net.sourceforge.plantuml.ugraphic.PlacementStrategyY1Y2Left;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULayoutGroup;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.utils.CharHidder;
public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlockWidth, TextBlock, WithPorts {
@@ -77,8 +77,8 @@ public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlockW
private final FontParam fontParam;
private final ISkinParam skinParam;
- private final HtmlColor color;
- private final HtmlColor hyperlinkColor;
+ private final HColor color;
+ private final HColor hyperlinkColor;
private final boolean useUnderlineForHyperlink;
private final Rose rose = new Rose();
private final List members = new ArrayList();
@@ -221,9 +221,9 @@ public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlockW
}
};
}
- final HtmlColor back = modifier.getBackground() == null ? null : rose.getHtmlColor(skinParam,
+ final HColor back = modifier.getBackground() == null ? null : rose.getHtmlColor(skinParam,
modifier.getBackground());
- final HtmlColor fore = rose.getHtmlColor(skinParam, modifier.getForeground());
+ final HColor fore = rose.getHtmlColor(skinParam, modifier.getForeground());
final TextBlock uBlock = modifier.getUBlock(skinParam.classAttributeIconSize(), fore, back, url != null);
return TextBlockWithUrl.withUrl(uBlock, url);
diff --git a/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java b/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java
index b6efbb7ee..8fe30c666 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/Stereotype.java
@@ -53,10 +53,7 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.creole.CommandCreoleImg;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.graphic.IHtmlColorSet;
+import net.sourceforge.plantuml.creole.command.CommandCreoleImg;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.sprite.Sprite;
import net.sourceforge.plantuml.sprite.SpriteUtils;
@@ -64,6 +61,9 @@ import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleBuilder;
import net.sourceforge.plantuml.svek.PackageStyle;
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.HColorUtils;
public class Stereotype implements CharSequence {
private final static RegexComposed circleChar = new RegexConcat( //
@@ -103,12 +103,12 @@ public class Stereotype implements CharSequence {
private final boolean automaticPackageStyle;
private String label;
- private HtmlColor htmlColor;
+ private HColor htmlColor;
private char character;
private String spriteName;
private double spriteScale;
- public Stereotype(String label, double radius, UFont circledFont, IHtmlColorSet htmlColorSet) {
+ public Stereotype(String label, double radius, UFont circledFont, HColorSet htmlColorSet) {
this(label, radius, circledFont, true, htmlColorSet);
}
@@ -129,7 +129,7 @@ public class Stereotype implements CharSequence {
}
public Stereotype(String label, double radius, UFont circledFont, boolean automaticPackageStyle,
- IHtmlColorSet htmlColorSet) {
+ HColorSet htmlColorSet) {
if (label == null) {
throw new IllegalArgumentException();
}
@@ -153,8 +153,8 @@ public class Stereotype implements CharSequence {
local = null;
}
final String colName = mCircleSprite.get("COLOR", 0);
- final HtmlColor col = htmlColorSet.getColorIfValid(colName);
- this.htmlColor = col == null ? HtmlColorUtils.BLACK : col;
+ final HColor col = htmlColorSet.getColorIfValid(colName);
+ this.htmlColor = col == null ? HColorUtils.BLACK : col;
this.spriteName = mCircleSprite.get("NAME", 0);
this.character = '\0';
this.spriteScale = CommandCreoleImg.getScale(mCircleSprite.get("SCALE", 0), 1);
@@ -182,7 +182,7 @@ public class Stereotype implements CharSequence {
this(label, true);
}
- public HtmlColor getHtmlColor() {
+ public HColor getHtmlColor() {
return htmlColor;
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/WithLinkType.java b/src/net/sourceforge/plantuml/cucadiagram/WithLinkType.java
index 12e88ccaf..baf299459 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/WithLinkType.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/WithLinkType.java
@@ -40,10 +40,10 @@ import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public abstract class WithLinkType {
@@ -55,15 +55,15 @@ public abstract class WithLinkType {
private List supplementary = new ArrayList();
- public final HtmlColor getSpecificColor() {
+ public final HColor getSpecificColor() {
return colors.getColor(ColorType.LINE);
}
- public final void setSpecificColor(HtmlColor specificColor) {
+ public final void setSpecificColor(HColor specificColor) {
setSpecificColor(specificColor, 0);
}
- public final void setSpecificColor(HtmlColor specificColor, int i) {
+ public final void setSpecificColor(HColor specificColor, int i) {
if (i == 0) {
colors = colors.add(ColorType.LINE, specificColor);
} else {
@@ -147,7 +147,7 @@ public abstract class WithLinkType {
} else if (s.startsWith("thickness=")) {
this.goThickness(Double.parseDouble(s.substring("thickness=".length())));
} else {
- final HtmlColor tmp = HtmlColorSet.getInstance().getColorIfValid(s);
+ final HColor tmp = HColorSet.instance().getColorIfValid(s);
setSpecificColor(tmp, i);
}
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramTxtMaker.java b/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramTxtMaker.java
index 8fe64afda..61de74ea4 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramTxtMaker.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/CucaDiagramTxtMaker.java
@@ -122,7 +122,7 @@ public final class CucaDiagramTxtMaker {
printClass(
ent,
(UGraphicTxt) globalUg.apply(new UTranslate(p.getX() / getXPixelPerChar(), p.getY()
- / getYPixelPerChar())));
+ / getYPixelPerChar())));
}
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/DotData.java b/src/net/sourceforge/plantuml/cucadiagram/dot/DotData.java
index 803ba1e53..261dce13d 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/DotData.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/DotData.java
@@ -55,7 +55,7 @@ import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.PortionShower;
import net.sourceforge.plantuml.cucadiagram.entity.EntityFactory;
import net.sourceforge.plantuml.svek.DotMode;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
final public class DotData implements PortionShower {
diff --git a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java
index be3c760fc..cf8794179 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityFactory.java
@@ -63,10 +63,10 @@ import net.sourceforge.plantuml.cucadiagram.Ident;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.SuperGroup;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.skin.VisibilityModifier;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public final class EntityFactory {
@@ -125,7 +125,7 @@ public final class EntityFactory {
}
if (g.getColors(skinParam).getColor(ColorType.BACK) == null) {
final ColorParam param = symbol == null ? ColorParam.packageBackground : symbol.getColorParamBack();
- final HtmlColor c1 = skinParam.getHtmlColor(param, g.getStereotype(), false);
+ final HColor c1 = skinParam.getHtmlColor(param, g.getStereotype(), false);
folder.setSpecificColorTOBEREMOVED(ColorType.BACK, c1 == null ? skinParam.getBackgroundColor() : c1);
} else {
folder.setSpecificColorTOBEREMOVED(ColorType.BACK, g.getColors(skinParam).getColor(ColorType.BACK));
diff --git a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java
index 019e5cbf7..fb8dd611e 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/entity/EntityImpl.java
@@ -71,7 +71,6 @@ import net.sourceforge.plantuml.cucadiagram.Stereotag;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.Neighborhood;
import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
@@ -80,6 +79,7 @@ import net.sourceforge.plantuml.svek.IEntityImage;
import net.sourceforge.plantuml.svek.PackageStyle;
import net.sourceforge.plantuml.svek.SingleStrategy;
import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.utils.UniqueSequence;
final public class EntityImpl implements ILeaf, IGroup {
@@ -683,7 +683,7 @@ final public class EntityImpl implements ILeaf, IGroup {
public FontConfiguration getFontConfigurationForTitle(final ISkinParam skinParam) {
final FontParam fontParam = getTitleFontParam();
- final HtmlColor fontHtmlColor = skinParam.getFontHtmlColor(getStereotype(), fontParam, FontParam.PACKAGE);
+ final HColor fontHtmlColor = skinParam.getFontHtmlColor(getStereotype(), fontParam, FontParam.PACKAGE);
final UFont font = skinParam.getFont(getStereotype(), true, fontParam, FontParam.PACKAGE);
final FontConfiguration fontConfiguration = new FontConfiguration(font, fontHtmlColor,
skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink(), skinParam.getTabSize());
@@ -732,7 +732,7 @@ final public class EntityImpl implements ILeaf, IGroup {
this.colors = colors;
}
- public void setSpecificColorTOBEREMOVED(ColorType type, HtmlColor color) {
+ public void setSpecificColorTOBEREMOVED(ColorType type, HColor color) {
if (color != null) {
this.colors = colors.add(type, color);
}
diff --git a/src/net/sourceforge/plantuml/cute/CutePath.java b/src/net/sourceforge/plantuml/cute/CutePath.java
index 67e01ca0e..ffd3f0f94 100644
--- a/src/net/sourceforge/plantuml/cute/CutePath.java
+++ b/src/net/sourceforge/plantuml/cute/CutePath.java
@@ -40,11 +40,11 @@ import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPath;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class CutePath {
@@ -141,7 +141,7 @@ public class CutePath {
for (int i = 0; i < arcs.size(); i++) {
final BetweenCorners betweenCorners = new BetweenCorners(getCorner(i), getCorner(i + 1), arcs.get(i)
.getTension());
- betweenCorners.debugMe(ug.apply(new UChangeColor(HtmlColorUtils.BLACK)).apply(new UChangeBackColor(null)));
+ betweenCorners.debugMe(ug.apply(new UChangeColor(HColorUtils.BLACK)).apply(new UChangeBackColor(null)));
}
}
diff --git a/src/net/sourceforge/plantuml/cute/PSystemCute.java b/src/net/sourceforge/plantuml/cute/PSystemCute.java
index e71939c4d..a8d04fddb 100644
--- a/src/net/sourceforge/plantuml/cute/PSystemCute.java
+++ b/src/net/sourceforge/plantuml/cute/PSystemCute.java
@@ -44,8 +44,8 @@ import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
public class PSystemCute extends AbstractPSystem {
diff --git a/src/net/sourceforge/plantuml/cute/PositionnedImpl.java b/src/net/sourceforge/plantuml/cute/PositionnedImpl.java
index c5a6a42f8..45dda3277 100644
--- a/src/net/sourceforge/plantuml/cute/PositionnedImpl.java
+++ b/src/net/sourceforge/plantuml/cute/PositionnedImpl.java
@@ -35,18 +35,18 @@
*/
package net.sourceforge.plantuml.cute;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
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.HColorUtils;
public class PositionnedImpl implements Positionned {
private final CuteShape cuteShape;
- private final HtmlColor color;
+ private final HColor color;
private final UTranslate position;
private final RotationZoom rotationZoom;
@@ -62,7 +62,7 @@ public class PositionnedImpl implements Positionned {
this.rotationZoom = RotationZoom.fromVarArgs(args);
}
- private PositionnedImpl(CuteShape cuteShape, HtmlColor color, UTranslate position, RotationZoom rotationZoom) {
+ private PositionnedImpl(CuteShape cuteShape, HColor color, UTranslate position, RotationZoom rotationZoom) {
this.cuteShape = cuteShape;
this.color = color;
this.position = position;
@@ -71,14 +71,14 @@ public class PositionnedImpl implements Positionned {
public PositionnedImpl(Group group, RotationZoom rotation) {
this.cuteShape = group;
- this.color = HtmlColorUtils.BLACK;
+ this.color = HColorUtils.BLACK;
this.position = new UTranslate();
this.rotationZoom = rotation;
}
public PositionnedImpl(Group group, UTranslate translation) {
this.cuteShape = group;
- this.color = HtmlColorUtils.BLACK;
+ this.color = HColorUtils.BLACK;
this.position = translation;
this.rotationZoom = RotationZoom.none();
}
diff --git a/src/net/sourceforge/plantuml/cute/VarArgs.java b/src/net/sourceforge/plantuml/cute/VarArgs.java
index e61e91d9b..6a83b68e8 100644
--- a/src/net/sourceforge/plantuml/cute/VarArgs.java
+++ b/src/net/sourceforge/plantuml/cute/VarArgs.java
@@ -40,10 +40,10 @@ import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
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;
public class VarArgs {
@@ -89,14 +89,14 @@ public class VarArgs {
return new MyDouble(value);
}
- public HtmlColor getAsColor(String k) {
+ public HColor getAsColor(String k) {
final String value = args.get(k);
if (value == null) {
- return HtmlColorUtils.BLACK;
+ return HColorUtils.BLACK;
}
- final HtmlColor result = HtmlColorSet.getInstance().getColorIfValid(value);
+ final HColor result = HColorSet.instance().getColorIfValid(value);
if (result == null) {
- return HtmlColorUtils.BLACK;
+ return HColorUtils.BLACK;
}
return result;
}
diff --git a/src/net/sourceforge/plantuml/dedication/PSystemDedication.java b/src/net/sourceforge/plantuml/dedication/PSystemDedication.java
index 6bd11de2e..bc9cd7301 100644
--- a/src/net/sourceforge/plantuml/dedication/PSystemDedication.java
+++ b/src/net/sourceforge/plantuml/dedication/PSystemDedication.java
@@ -43,12 +43,12 @@ import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.UDrawable;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class PSystemDedication extends AbstractPSystem {
@@ -63,7 +63,7 @@ public class PSystemDedication extends AbstractPSystem {
@Override
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
throws IOException {
- final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.WHITE,
+ final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HColorUtils.WHITE,
getMetadata(), null, 0, 0, null, false);
imageBuilder.setUDrawable(new UDrawable() {
public void drawU(UGraphic ug) {
diff --git a/src/net/sourceforge/plantuml/definition/PSystemDefinition.java b/src/net/sourceforge/plantuml/definition/PSystemDefinition.java
index c9a62bb9c..6562f4fb9 100644
--- a/src/net/sourceforge/plantuml/definition/PSystemDefinition.java
+++ b/src/net/sourceforge/plantuml/definition/PSystemDefinition.java
@@ -48,12 +48,12 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.UDrawable;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class PSystemDefinition extends AbstractPSystem implements UDrawable {
@@ -80,7 +80,7 @@ public class PSystemDefinition extends AbstractPSystem implements UDrawable {
public void drawU(UGraphic ug) {
final UFont font = UFont.sansSerif(14);
- final FontConfiguration fc = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
+ final FontConfiguration fc = new FontConfiguration(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
Display.getWithNewlines(startLine).create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()).drawU(ug);
}
diff --git a/src/net/sourceforge/plantuml/descdiagram/BoxedCharacter.java b/src/net/sourceforge/plantuml/descdiagram/BoxedCharacter.java
index 7b895fb1a..480e42d74 100644
--- a/src/net/sourceforge/plantuml/descdiagram/BoxedCharacter.java
+++ b/src/net/sourceforge/plantuml/descdiagram/BoxedCharacter.java
@@ -39,7 +39,6 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UCenteredCharacter;
@@ -49,17 +48,18 @@ 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.HColor;
public class BoxedCharacter extends AbstractTextBlock implements TextBlock {
private final String c;
private final UFont font;
- private final HtmlColor innerCircle;
- private final HtmlColor circle;
- private final HtmlColor fontColor;
+ private final HColor innerCircle;
+ private final HColor circle;
+ private final HColor fontColor;
private final double radius;
- public BoxedCharacter(char c, double size, UFont font, HtmlColor innerCircle, HtmlColor circle, HtmlColor fontColor) {
+ public BoxedCharacter(char c, double size, UFont font, HColor innerCircle, HColor circle, HColor fontColor) {
this.c = "" + c;
this.font = font;
this.innerCircle = innerCircle;
diff --git a/src/net/sourceforge/plantuml/descdiagram/EntityImageDesignedDomain.java b/src/net/sourceforge/plantuml/descdiagram/EntityImageDesignedDomain.java
index d78298089..961f89cbb 100644
--- a/src/net/sourceforge/plantuml/descdiagram/EntityImageDesignedDomain.java
+++ b/src/net/sourceforge/plantuml/descdiagram/EntityImageDesignedDomain.java
@@ -50,7 +50,6 @@ import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -65,6 +64,7 @@ import net.sourceforge.plantuml.ugraphic.ULayoutGroup;
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;
public class EntityImageDesignedDomain extends AbstractEntityImage {
final private TextBlock name;
@@ -125,11 +125,11 @@ public class EntityImageDesignedDomain extends AbstractEntityImage {
final double widthTotal = dimTotal.getWidth();
final double heightTotal = dimTotal.getHeight();
- final URectangle rect = new URectangle(widthTotal, heightTotal, 0, 0);
- URectangle rect2 = new URectangle(4, heightTotal, 0, 0);
+ final URectangle rect = new URectangle(widthTotal, heightTotal);
+ URectangle rect2 = new URectangle(4, heightTotal);
ug = ug.apply(new UChangeColor(SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.designedBorder)));
- HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
+ HColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.designedBackground);
}
@@ -144,7 +144,7 @@ public class EntityImageDesignedDomain extends AbstractEntityImage {
final ULayoutGroup header = new ULayoutGroup(new PlacementStrategyY1Y2(ug.getStringBounder()));
header.add(name);
- header.drawU(ug.apply(new UTranslate(4, 0)), dimTotal.getWidth(), dimTitle.getHeight());
+ header.drawU(ug.apply(UTranslate.dx(4)), dimTotal.getWidth(), dimTitle.getHeight());
if (url != null) {
ug.closeAction();
diff --git a/src/net/sourceforge/plantuml/descdiagram/EntityImageDomain.java b/src/net/sourceforge/plantuml/descdiagram/EntityImageDomain.java
index 117995f7f..5c694241f 100644
--- a/src/net/sourceforge/plantuml/descdiagram/EntityImageDomain.java
+++ b/src/net/sourceforge/plantuml/descdiagram/EntityImageDomain.java
@@ -50,7 +50,6 @@ import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -66,6 +65,7 @@ import net.sourceforge.plantuml.ugraphic.ULayoutGroup;
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;
public class EntityImageDomain extends AbstractEntityImage {
final private TextBlock name;
@@ -128,10 +128,10 @@ public class EntityImageDomain extends AbstractEntityImage {
final Dimension2D dimTag = getTagDimension(stringBounder);
final double widthTotal = dimTotal.getWidth();
final double heightTotal = dimTotal.getHeight();
- final URectangle rect = new URectangle(widthTotal, heightTotal, 0, 0);
+ final URectangle rect = new URectangle(widthTotal, heightTotal);
ug = ug.apply(new UChangeColor(SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.domainBorder)));
- HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
+ HColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.domainBackground);
}
diff --git a/src/net/sourceforge/plantuml/descdiagram/EntityImageMachine.java b/src/net/sourceforge/plantuml/descdiagram/EntityImageMachine.java
index bb71a6594..67c81b37b 100644
--- a/src/net/sourceforge/plantuml/descdiagram/EntityImageMachine.java
+++ b/src/net/sourceforge/plantuml/descdiagram/EntityImageMachine.java
@@ -50,7 +50,6 @@ import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -65,6 +64,7 @@ import net.sourceforge.plantuml.ugraphic.ULayoutGroup;
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;
public class EntityImageMachine extends AbstractEntityImage {
final private TextBlock name;
@@ -124,11 +124,11 @@ public class EntityImageMachine extends AbstractEntityImage {
final double widthTotal = dimTotal.getWidth();
final double heightTotal = dimTotal.getHeight();
- final URectangle rect = new URectangle(widthTotal, heightTotal, 0, 0);
- URectangle rect2 = new URectangle(4, heightTotal, 0, 0);
+ final URectangle rect = new URectangle(widthTotal, heightTotal);
+ URectangle rect2 = new URectangle(4, heightTotal);
ug = ug.apply(new UChangeColor(SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.machineBorder)));
- HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
+ HColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.machineBackground);
}
@@ -139,11 +139,11 @@ public class EntityImageMachine extends AbstractEntityImage {
final UStroke stroke = getStroke();
ug.apply(stroke).draw(rect);
- ug.apply(new UTranslate(4, 0)).apply(stroke).draw(rect2);
+ ug.apply(UTranslate.dx(4)).apply(stroke).draw(rect2);
final ULayoutGroup header = new ULayoutGroup(new PlacementStrategyY1Y2(ug.getStringBounder()));
header.add(name);
- header.drawU(ug.apply(new UTranslate(5, 0)), dimTotal.getWidth(), dimTitle.getHeight());
+ header.drawU(ug.apply(UTranslate.dx(5)), dimTotal.getWidth(), dimTitle.getHeight());
if (url != null) {
ug.closeAction();
diff --git a/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java b/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java
index d87d9fe5d..d7f581160 100644
--- a/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java
+++ b/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java
@@ -51,7 +51,6 @@ import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.SkinParameter;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -68,6 +67,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UHorizontalLine;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class EntityImageRequirement extends AbstractEntityImage {
@@ -119,12 +119,12 @@ public class EntityImageRequirement extends AbstractEntityImage {
}
ug = ug.apply(getStroke());
- HtmlColor linecolor = getEntity().getColors(getSkinParam()).getColor(ColorType.LINE);
+ HColor linecolor = getEntity().getColors(getSkinParam()).getColor(ColorType.LINE);
if (linecolor == null) {
linecolor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.requirementBorder);
}
ug = ug.apply(new UChangeColor(linecolor));
- HtmlColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
+ HColor backcolor = getEntity().getColors(getSkinParam()).getColor(ColorType.BACK);
if (backcolor == null) {
backcolor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.requirementBackground);
}
diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java
index 056844f4e..94608d321 100644
--- a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java
+++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java
@@ -59,11 +59,11 @@ import net.sourceforge.plantuml.cucadiagram.Ident;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.descdiagram.DescriptionDiagram;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandCreateElementFull extends SingleLineCommand2 {
@@ -225,7 +225,7 @@ public class CommandCreateElementFull extends SingleLineCommand2 {
@@ -195,7 +195,7 @@ public class CommandCreateElementParenthesis extends SingleLineCommand2Special thanks to our sponsors and donors !"));
header.drawU(ug);
final StringBounder stringBounder = ug.getStringBounder();
- ug = ug.apply(new UTranslate(0, header.calculateDimension(stringBounder).getHeight()));
+ ug = ug.apply(UTranslate.dy(header.calculateDimension(stringBounder).getHeight()));
double x = 0;
double lastX = 0;
double y = 0;
for (TextBlock tb : cols) {
final Dimension2D dim = tb.calculateDimension(stringBounder);
- tb.drawU(ug.apply(new UTranslate(x, 0)));
+ tb.drawU(ug.apply(UTranslate.dx(x)));
lastX = x;
x += dim.getWidth() + 10;
y = Math.max(y, dim.getHeight());
diff --git a/src/net/sourceforge/plantuml/donors/PSystemSkinparameterList.java b/src/net/sourceforge/plantuml/donors/PSystemSkinparameterList.java
index 2363e990f..9b33d2ed5 100644
--- a/src/net/sourceforge/plantuml/donors/PSystemSkinparameterList.java
+++ b/src/net/sourceforge/plantuml/donors/PSystemSkinparameterList.java
@@ -47,14 +47,14 @@ import net.sourceforge.plantuml.SkinParam;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.graphic.GraphicStrings;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.UDrawable;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class PSystemSkinparameterList extends AbstractPSystem {
@@ -62,7 +62,7 @@ public class PSystemSkinparameterList extends AbstractPSystem {
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
throws IOException {
final UDrawable result = getGraphicStrings();
- final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.WHITE,
+ final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HColorUtils.WHITE,
getMetadata(), null, 0, 0, null, false);
imageBuilder.setUDrawable(result);
return imageBuilder.writeImageTOBEMOVED(fileFormat, seed, os);
@@ -77,7 +77,7 @@ public class PSystemSkinparameterList extends AbstractPSystem {
double y = 0;
for (TextBlock tb : cols) {
final Dimension2D dim = tb.calculateDimension(stringBounder);
- tb.drawU(ug.apply(new UTranslate(x, 0)));
+ tb.drawU(ug.apply(UTranslate.dx(x)));
x += dim.getWidth() + 10;
y = Math.max(y, dim.getHeight());
}
diff --git a/src/net/sourceforge/plantuml/eggs/GraphicsPath.java b/src/net/sourceforge/plantuml/eggs/GraphicsPath.java
index 24128e168..63ec27440 100644
--- a/src/net/sourceforge/plantuml/eggs/GraphicsPath.java
+++ b/src/net/sourceforge/plantuml/eggs/GraphicsPath.java
@@ -44,11 +44,11 @@ import java.io.OutputStream;
import net.sourceforge.plantuml.EmptyImageBuilder;
import net.sourceforge.plantuml.api.ImageDataSimple;
import net.sourceforge.plantuml.core.ImageData;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.png.PngIO;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
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.g2d.UGraphicG2d;
public class GraphicsPath {
@@ -75,7 +75,7 @@ public class GraphicsPath {
final UGraphicG2d ug = new UGraphicG2d(colorMapper, g2d, 1.0);
ug.setBufferedImage(im);
final UMotif motif = new UMotif(path);
- motif.drawHorizontal(ug.apply(new UChangeColor(HtmlColorUtils.BLACK)), 20, 20, 1);
+ motif.drawHorizontal(ug.apply(new UChangeColor(HColorUtils.BLACK)), 20, 20, 1);
g2d.dispose();
return im;
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemAppleTwo.java b/src/net/sourceforge/plantuml/eggs/PSystemAppleTwo.java
index 66de2abe9..1a28f81a4 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemAppleTwo.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemAppleTwo.java
@@ -48,8 +48,8 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.graphic.GraphicPosition;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
import net.sourceforge.plantuml.version.PSystemVersion;
public class PSystemAppleTwo extends AbstractPSystem {
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemCharlie.java b/src/net/sourceforge/plantuml/eggs/PSystemCharlie.java
index b026374b8..e10926004 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemCharlie.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemCharlie.java
@@ -42,12 +42,12 @@ import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.UDrawable;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import net.sourceforge.plantuml.version.PSystemVersion;
public class PSystemCharlie extends AbstractPSystem {
@@ -61,7 +61,7 @@ public class PSystemCharlie extends AbstractPSystem {
@Override
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
throws IOException {
- final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.BLACK,
+ final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HColorUtils.BLACK,
getMetadata(), null, 0, 0, null, false);
imageBuilder.setUDrawable(new UDrawable() {
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemColors.java b/src/net/sourceforge/plantuml/eggs/PSystemColors.java
index 280c6372f..680c2aa80 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemColors.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemColors.java
@@ -55,14 +55,9 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.UDrawable;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -71,13 +66,18 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+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;
// http://www.redblobgames.com/grids/hexagons/
public class PSystemColors extends AbstractPSystem implements UDrawable {
private final double rectangleHeight = 28;
private final double rectangleWidth = 175;
- private final HtmlColorSetSimple colors = new HtmlColorSetSimple();
+ private final HColorSet colors = HColorSet.instance();
private final String paletteCentralColor;
private final double size = 60;
@@ -92,7 +92,7 @@ public class PSystemColors extends AbstractPSystem implements UDrawable {
@Override
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
throws IOException {
- final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.WHITE,
+ final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HColorUtils.WHITE,
getMetadata(), null, 0, 0, null, false);
imageBuilder.setUDrawable(this);
return imageBuilder.writeImageTOBEMOVED(fileFormat, seed, os);
@@ -103,7 +103,7 @@ public class PSystemColors extends AbstractPSystem implements UDrawable {
}
public void drawU(UGraphic ug) {
- if (colors.getColorIfValid(paletteCentralColor) instanceof HtmlColorSimple) {
+ if (colors.getColorIfValid(paletteCentralColor) instanceof HColorSimple) {
drawPalette(ug);
} else {
drawFull(ug);
@@ -154,7 +154,7 @@ public class PSystemColors extends AbstractPSystem implements UDrawable {
}
private void drawOneHexa(UGraphic ug, String colorName, int i, int j, UPolygon hexa) {
- final HtmlColorSimple color = (HtmlColorSimple) colors.getColorIfValid(colorName);
+ final HColorSimple color = (HColorSimple) colors.getColorIfValid(colorName);
ug = applyColor(ug, color);
ug = ug.apply(new UTranslate(centerHexa(i, j)));
ug.draw(hexa);
@@ -178,7 +178,7 @@ public class PSystemColors extends AbstractPSystem implements UDrawable {
continue;
}
final String candidat = colorName.substring(0, i) + BackSlash.BS_BS_N + colorName.substring(i);
- final TextBlock tt = getTextName(font, candidat, (HtmlColorSimple) HtmlColorUtils.BLACK);
+ final TextBlock tt = getTextName(font, candidat, (HColorSimple) HColorUtils.BLACK);
final double width = tt.calculateDimension(stringBounder).getWidth();
if (width < min) {
result = candidat;
@@ -188,7 +188,7 @@ public class PSystemColors extends AbstractPSystem implements UDrawable {
return result;
}
- private UGraphic applyColor(UGraphic ug, HtmlColor color) {
+ private UGraphic applyColor(UGraphic ug, HColor color) {
return ug.apply(new UChangeColor(color)).apply(new UChangeBackColor(color));
}
@@ -235,11 +235,11 @@ public class PSystemColors extends AbstractPSystem implements UDrawable {
}
private Comparator closeComparator(String center) {
- final HtmlColorSimple centerColor = (HtmlColorSimple) colors.getColorIfValid(center);
+ final HColorSimple centerColor = (HColorSimple) colors.getColorIfValid(center);
return new Comparator() {
public int compare(String col1, String col2) {
- final double dist1 = centerColor.distance((HtmlColorSimple) colors.getColorIfValid(col1));
- final double dist2 = centerColor.distance((HtmlColorSimple) colors.getColorIfValid(col2));
+ final double dist1 = centerColor.distance((HColorSimple) colors.getColorIfValid(col1));
+ final double dist2 = centerColor.distance((HColorSimple) colors.getColorIfValid(col2));
return (int) Math.signum(dist1 - dist2);
}
};
@@ -248,12 +248,12 @@ public class PSystemColors extends AbstractPSystem implements UDrawable {
private void drawFull(UGraphic ug) {
final UFont font = UFont.sansSerif(14).bold();
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
+ ug = ug.apply(new UChangeColor(HColorUtils.BLACK));
int i = 0;
int j = 0;
for (String name : colors.names()) {
UGraphic tmp = getPositioned(ug, i, j);
- final HtmlColorSimple color = (HtmlColorSimple) colors.getColorIfValid(name);
+ final HColorSimple color = (HColorSimple) colors.getColorIfValid(name);
applyColor(tmp, color).draw(new URectangle(rectangleWidth, rectangleHeight));
final TextBlock tt = getTextName(font, name, color);
final Dimension2D dimText = tt.calculateDimension(ug.getStringBounder());
@@ -267,9 +267,9 @@ public class PSystemColors extends AbstractPSystem implements UDrawable {
}
}
- private TextBlock getTextName(final UFont font, String name, final HtmlColorSimple color) {
- final HtmlColorSimple opposite = color.opposite();
- final FontConfiguration fc = new FontConfiguration(font, opposite, HtmlColorUtils.BLUE, true);
+ private TextBlock getTextName(final UFont font, String name, final HColorSimple color) {
+ final HColorSimple opposite = color.opposite();
+ final FontConfiguration fc = new FontConfiguration(font, opposite, HColorUtils.BLUE, true);
final TextBlock tt = Display.getWithNewlines(name).create(fc, HorizontalAlignment.CENTER,
new SpriteContainerEmpty());
return tt;
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemEgg.java b/src/net/sourceforge/plantuml/eggs/PSystemEgg.java
index 06a25dd97..d79f7f0f1 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemEgg.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemEgg.java
@@ -47,8 +47,8 @@ import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
public class PSystemEgg extends AbstractPSystem {
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemLost.java b/src/net/sourceforge/plantuml/eggs/PSystemLost.java
index d66f9adf4..9a43722b8 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemLost.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemLost.java
@@ -46,8 +46,8 @@ import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
public class PSystemLost extends AbstractPSystem {
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemPath.java b/src/net/sourceforge/plantuml/eggs/PSystemPath.java
index 2e4263a65..712c6783a 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemPath.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemPath.java
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
public class PSystemPath extends AbstractPSystem {
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemRIP.java b/src/net/sourceforge/plantuml/eggs/PSystemRIP.java
index cb8a50195..758313bf5 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemRIP.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemRIP.java
@@ -52,8 +52,8 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.graphic.GraphicPosition;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
public class PSystemRIP extends AbstractPSystem {
diff --git a/src/net/sourceforge/plantuml/eggs/PSystemWelcome.java b/src/net/sourceforge/plantuml/eggs/PSystemWelcome.java
index fc971c2c7..0b89f8def 100644
--- a/src/net/sourceforge/plantuml/eggs/PSystemWelcome.java
+++ b/src/net/sourceforge/plantuml/eggs/PSystemWelcome.java
@@ -47,8 +47,8 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.graphic.GraphicPosition;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
import net.sourceforge.plantuml.version.PSystemVersion;
public class PSystemWelcome extends AbstractPSystem {
diff --git a/src/net/sourceforge/plantuml/eps/EpsGraphics.java b/src/net/sourceforge/plantuml/eps/EpsGraphics.java
index 50636270a..4b257f08b 100644
--- a/src/net/sourceforge/plantuml/eps/EpsGraphics.java
+++ b/src/net/sourceforge/plantuml/eps/EpsGraphics.java
@@ -43,12 +43,12 @@ import java.util.StringTokenizer;
import net.sourceforge.plantuml.BackSlash;
import net.sourceforge.plantuml.Log;
-import net.sourceforge.plantuml.graphic.HtmlColorGradient;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.ShadowManager;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.USegment;
import net.sourceforge.plantuml.ugraphic.USegmentType;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.HColorGradient;
import net.sourceforge.plantuml.utils.MathUtils;
import net.sourceforge.plantuml.version.Version;
@@ -328,7 +328,7 @@ public class EpsGraphics {
}
- public void epsPolygon(HtmlColorGradient gr, ColorMapper mapper, double... points) {
+ public void epsPolygon(HColorGradient gr, ColorMapper mapper, double... points) {
assert points.length % 2 == 0;
setFillColor(mapper.getMappedColor(gr.getColor1()));
epsPolygon(points);
@@ -402,7 +402,7 @@ public class EpsGraphics {
}
public void epsRectangle(double x, double y, double width, double height, double rx, double ry,
- HtmlColorGradient gr, ColorMapper mapper) {
+ HColorGradient gr, ColorMapper mapper) {
checkCloseDone();
ensureVisible(x, y);
ensureVisible(x + width, y + height);
diff --git a/src/net/sourceforge/plantuml/error/PSystemError.java b/src/net/sourceforge/plantuml/error/PSystemError.java
index 547f9c5ad..f08659d22 100644
--- a/src/net/sourceforge/plantuml/error/PSystemError.java
+++ b/src/net/sourceforge/plantuml/error/PSystemError.java
@@ -70,10 +70,6 @@ import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.GraphicPosition;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -81,13 +77,17 @@ import net.sourceforge.plantuml.graphic.TextBlockRaw;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+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.txt.UGraphicTxt;
import net.sourceforge.plantuml.version.LicenseInfo;
import net.sourceforge.plantuml.version.PSystemVersion;
@@ -122,23 +122,22 @@ public abstract class PSystemError extends AbstractPSystem {
}
private TextBlockBackcolored getGraphicalFormatted() {
- final FontConfiguration fc0 = GraphicStrings.sansSerif14(HtmlColorUtils.BLACK).bold();
- final FontConfiguration fc1 = GraphicStrings.sansSerif14(HtmlColorUtils.MY_GREEN).bold();
- final FontConfiguration fc2 = GraphicStrings.sansSerif14(HtmlColorUtils.RED).bold();
+ 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 List fullBody = getTextFullBody();
final TextBlock result0 = TextBlockUtils.addBackcolor(
- TextBlockUtils.withMargin(new TextBlockRaw(getTextFromStack(), fc0), 1, 1, 1, 4),
- HtmlColorUtils.MY_GREEN);
+ TextBlockUtils.withMargin(new TextBlockRaw(getTextFromStack(), fc0), 1, 1, 1, 4), HColorUtils.MY_GREEN);
final TextBlock result1 = new TextBlockRaw(allButLast(fullBody), fc1);
- final TextBlock result2 = new TextBlockRaw(onlyLast(fullBody), fc1.wave(HtmlColorUtils.RED));
+ final TextBlock result2 = new TextBlockRaw(onlyLast(fullBody), fc1.wave(HColorUtils.RED));
final TextBlock result3 = new TextBlockRaw(getTextError(), fc2);
TextBlock result = result0;
result = TextBlockUtils.mergeTB(result, result1, HorizontalAlignment.LEFT);
result = TextBlockUtils.mergeTB(result, result2, HorizontalAlignment.LEFT);
result = TextBlockUtils.mergeTB(result, result3, HorizontalAlignment.LEFT);
result = TextBlockUtils.withMargin(result, 5, 5);
- return TextBlockUtils.addBackcolor(result, HtmlColorUtils.BLACK);
+ return TextBlockUtils.addBackcolor(result, HColorUtils.BLACK);
}
private List getPureAsciiFormatted() {
@@ -219,17 +218,17 @@ public abstract class PSystemError extends AbstractPSystem {
} else {
udrawable = result;
}
- final int min = (int) (System.currentTimeMillis() / 60000L) % 60;
- // udrawable = addMessageAdopt(udrawable);
- if (min == 1 || min == 8 || min == 13 || min == 55) {
- udrawable = addMessagePatreon(udrawable);
- } else if (min == 15) {
- udrawable = addMessageLiberapay(udrawable);
- } else if (min == 30 || min == 39 || min == 48) {
- udrawable = addMessageDedication(udrawable);
- } else if (getSource().containsIgnoreCase("arecibo")) {
- udrawable = addMessageArecibo(udrawable);
- }
+ udrawable = addMessageCoronavirus(udrawable);
+// final int min = (int) (System.currentTimeMillis() / 60000L) % 60;
+// if (min == 1 || min == 8 || min == 13 || min == 55) {
+// udrawable = addMessagePatreon(udrawable);
+// } else if (min == 15) {
+// udrawable = addMessageLiberapay(udrawable);
+// } else if (min == 30 || min == 39 || min == 48) {
+// udrawable = addMessageDedication(udrawable);
+// } else if (getSource().containsIgnoreCase("arecibo")) {
+// udrawable = addMessageArecibo(udrawable);
+// }
imageBuilder.setUDrawable(udrawable);
final ImageData imageData = imageBuilder.writeImageTOBEMOVED(fileFormat, seed(), os);
((ImageDataAbstract) imageData).setStatus(FileImageData.ERROR);
@@ -283,6 +282,13 @@ public abstract class PSystemError extends AbstractPSystem {
return result;
}
+ private TextBlock addMessageCoronavirus(final TextBlock source) throws IOException {
+ final TextBlock message = getMessageCoronavirus();
+ TextBlock result = TextBlockUtils.mergeTB(message, source, HorizontalAlignment.LEFT);
+ result = TextBlockUtils.mergeTB(result, message, HorizontalAlignment.LEFT);
+ return result;
+ }
+
private TextBlock addMessageDedication(final TextBlock source) throws IOException {
if (LicenseInfo.retrieveNamedOrDistributorQuickIsValid()) {
return source;
@@ -309,17 +315,17 @@ public abstract class PSystemError extends AbstractPSystem {
private TextBlockBackcolored getMessageDedication() {
final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
- final HtmlColorSimple backColor = (HtmlColorSimple) new HtmlColorSetSimple().getColorIfValid("#eae2c9");
+ final HColorSimple backColor = (HColorSimple) HColorSet.instance().getColorIfValid("#eae2c9");
- final BufferedImage qrcode = smaller(utils.exportFlashcode("http://plantuml.com/dedication", Color.BLACK,
- backColor.getColor999()));
+ final BufferedImage qrcode = smaller(
+ utils.exportFlashcode("http://plantuml.com/dedication", Color.BLACK, backColor.getColor999()));
final Display disp = Display.create("Add your own dedication into PlantUML", " ", "For just $5 per month!",
"Details on [[http://plantuml.com/dedication]]");
final UFont font = UFont.sansSerif(14);
- final FontConfiguration fc = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
- final TextBlock text = TextBlockUtils.withMargin(
- disp.create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()), 10, 0);
+ final FontConfiguration fc = new FontConfiguration(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
+ final TextBlock text = TextBlockUtils
+ .withMargin(disp.create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()), 10, 0);
final TextBlock result;
if (qrcode == null) {
result = text;
@@ -332,35 +338,71 @@ public abstract class PSystemError extends AbstractPSystem {
}
private TextBlockBackcolored getMessageAdopt() {
- final HtmlColorSimple backColor = (HtmlColorSimple) new HtmlColorSetSimple().getColorIfValid("#eff4d2");
+ final HColorSimple backColor = (HColorSimple) HColorSet.instance().getColorIfValid("#eff4d2");
final Display disp = Display.create("Adopt-a-Word and put your message here!", " ",
"Details on [[http://plantuml.com/adopt]]", " ");
final UFont font = UFont.sansSerif(14);
- final FontConfiguration fc = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
- final TextBlock text = TextBlockUtils.withMargin(
- disp.create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()), 10, 0);
+ final FontConfiguration fc = new FontConfiguration(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
+ final TextBlock text = TextBlockUtils
+ .withMargin(disp.create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()), 10, 0);
final TextBlock result;
result = text;
return TextBlockUtils.addBackcolor(result, backColor);
}
+ private TextBlockBackcolored getMessageCoronavirus() {
+
+ final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
+ final HColorSimple backColor = (HColorSimple) HColorSet.instance().getColorIfValid("#fff");
+
+ final BufferedImage qrcode = smaller(utils.exportFlashcode(
+ "https://medium.com/@tomaspueyo/coronavirus-act-today-or-people-will-die-f4d3d9cd99ca", Color.BLACK,
+ backColor.getColor999()));
+ final Display disp = Display.create("Coronavirus: Why You Must Act Now", " ",
+ "Please use the flashcode or go to", "https://plantuml/coronavirus", " ",
+ "If you live in UK, Europe, North & South America, Iran, Japan, Korea...",
+ " please apply social distancing right now!", " ", "The coronavirus is coming to you.",
+ "It’s coming at an exponential speed: gradually, and then suddenly.",
+ "It’s a matter of days. Maybe a week or two.",
+ "When it does, your healthcare system will be overwhelmed.",
+ "Your fellow citizens will be treated in the hallways.",
+ "Exhausted healthcare workers will break down. Some will die.",
+ "They will have to decide which patient gets the oxygen and which one dies.",
+ "The only way to prevent this is social distancing today. Not tomorrow. Today.",
+ "That means keeping as many people home as possible, starting now.", " ");
+
+ final UFont font = UFont.sansSerif(14);
+ final FontConfiguration fc = new FontConfiguration(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
+ final TextBlock text = TextBlockUtils
+ .withMargin(disp.create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()), 10, 0);
+ final TextBlock result;
+ if (qrcode == null) {
+ result = text;
+ } else {
+ final UImage qr = new UImage(qrcode).scaleNearestNeighbor(3);
+ result = TextBlockUtils.mergeLR(text, TextBlockUtils.fromUImage(qr), VerticalAlignment.CENTER);
+ }
+ return TextBlockUtils.addBackcolor(result, backColor);
+
+ }
+
private TextBlockBackcolored getMessagePatreon() {
final UImage message = new UImage(PSystemVersion.getTime01());
final Color back = new Color(message.getImage().getRGB(0, 0));
- final HtmlColor backColor = new HtmlColorSimple(back, false);
+ final HColor backColor = new HColorSimple(back, false);
final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
- final BufferedImage qrcode = smaller(utils.exportFlashcode("http://plantuml.com/patreon", Color.BLACK,
- Color.WHITE));
+ final BufferedImage qrcode = smaller(
+ utils.exportFlashcode("http://plantuml.com/patreon", Color.BLACK, Color.WHITE));
final int scale = 2;
final double imWidth = message.getWidth() + (qrcode == null ? 0 : qrcode.getWidth() * scale + 20);
- final double imHeight = qrcode == null ? message.getHeight() : Math.max(message.getHeight(), qrcode.getHeight()
- * scale + 10);
+ final double imHeight = qrcode == null ? message.getHeight()
+ : Math.max(message.getHeight(), qrcode.getHeight() * scale + 10);
return new TextBlockBackcolored() {
public void drawU(UGraphic ug) {
@@ -385,7 +427,7 @@ public abstract class PSystemError extends AbstractPSystem {
return MinMax.fromMax(imWidth + 1, imHeight + 1);
}
- public HtmlColor getBackcolor() {
+ public HColor getBackcolor() {
return backColor;
}
};
@@ -395,7 +437,7 @@ public abstract class PSystemError extends AbstractPSystem {
private TextBlockBackcolored getMessageLiberapay() {
final UImage message = new UImage(PSystemVersion.getTime15());
final Color back = new Color(message.getImage().getRGB(0, 0));
- final HtmlColor backColor = new HtmlColorSimple(back, false);
+ final HColor backColor = new HColorSimple(back, false);
final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
final BufferedImage qrcode = smaller(utils.exportFlashcode("http://plantuml.com/lp", Color.BLACK, Color.WHITE));
@@ -403,8 +445,8 @@ public abstract class PSystemError extends AbstractPSystem {
final int scale = 2;
final double imWidth = message.getWidth() + (qrcode == null ? 0 : qrcode.getWidth() * scale + 20);
- final double imHeight = qrcode == null ? message.getHeight() : Math.max(message.getHeight(), qrcode.getHeight()
- * scale + 10);
+ final double imHeight = qrcode == null ? message.getHeight()
+ : Math.max(message.getHeight(), qrcode.getHeight() * scale + 10);
return new TextBlockBackcolored() {
public void drawU(UGraphic ug) {
@@ -429,7 +471,7 @@ public abstract class PSystemError extends AbstractPSystem {
return MinMax.fromMax(imWidth + 1, imHeight + 1);
}
- public HtmlColor getBackcolor() {
+ public HColor getBackcolor() {
return backColor;
}
};
diff --git a/src/net/sourceforge/plantuml/flowdiagram/ActivityBox.java b/src/net/sourceforge/plantuml/flowdiagram/ActivityBox.java
index 343d07f4a..94bce19b0 100644
--- a/src/net/sourceforge/plantuml/flowdiagram/ActivityBox.java
+++ b/src/net/sourceforge/plantuml/flowdiagram/ActivityBox.java
@@ -44,7 +44,6 @@ import net.sourceforge.plantuml.golem.Tile;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.Shadowable;
@@ -55,6 +54,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;
public class ActivityBox extends AbstractTextBlock {
@@ -93,9 +93,9 @@ public class ActivityBox extends AbstractTextBlock {
final double widthTotal = dimTotal.getWidth();
final double heightTotal = dimTotal.getHeight();
- final Shadowable rect = new URectangle(widthTotal, heightTotal, CORNER, CORNER);
- ug = ug.apply(new UChangeColor(HtmlColorUtils.MY_RED));
- ug = ug.apply(new UChangeBackColor(HtmlColorUtils.MY_YELLOW));
+ final Shadowable rect = new URectangle(widthTotal, heightTotal).rounded(CORNER);
+ ug = ug.apply(new UChangeColor(HColorUtils.MY_RED));
+ ug = ug.apply(new UChangeBackColor(HColorUtils.MY_YELLOW));
ug.apply(new UStroke(1.5)).draw(rect);
tb.drawU(ug.apply(new UTranslate(MARGIN, MARGIN)));
diff --git a/src/net/sourceforge/plantuml/flowdiagram/FlowDiagram.java b/src/net/sourceforge/plantuml/flowdiagram/FlowDiagram.java
index 20d81f88b..a89c45acf 100644
--- a/src/net/sourceforge/plantuml/flowdiagram/FlowDiagram.java
+++ b/src/net/sourceforge/plantuml/flowdiagram/FlowDiagram.java
@@ -57,11 +57,9 @@ import net.sourceforge.plantuml.golem.Tile;
import net.sourceforge.plantuml.golem.TileArea;
import net.sourceforge.plantuml.golem.TileGeometry;
import net.sourceforge.plantuml.golem.TilesField;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -71,6 +69,8 @@ import net.sourceforge.plantuml.ugraphic.UGraphicUtils;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class FlowDiagram extends UmlDiagram implements TextBlock {
@@ -126,7 +126,7 @@ public class FlowDiagram extends UmlDiagram implements TextBlock {
@Override
protected ImageData exportDiagramInternal(OutputStream os, int index, FileFormatOption fileFormatOption)
throws IOException {
- UGraphicUtils.writeImage(os, null, fileFormatOption, seed(), new ColorMapperIdentity(), HtmlColorUtils.WHITE,
+ UGraphicUtils.writeImage(os, null, fileFormatOption, seed(), new ColorMapperIdentity(), HColorUtils.WHITE,
this);
return ImageDataSimple.ok();
}
@@ -150,8 +150,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(new UChangeColor(HtmlColorUtils.MY_RED));
- ug = ug.apply(new UChangeBackColor(HtmlColorUtils.MY_RED));
+ ug = ug.apply(new UChangeColor(HColorUtils.MY_RED));
+ ug = ug.apply(new UChangeBackColor(HColorUtils.MY_RED));
final UShape arrow = new UEllipse(7, 7);
for (Path p : field.getPaths()) {
final TileArea start = p.getStart();
diff --git a/src/net/sourceforge/plantuml/font/PSystemListFonts.java b/src/net/sourceforge/plantuml/font/PSystemListFonts.java
index 6816d3d6e..0bec5b189 100644
--- a/src/net/sourceforge/plantuml/font/PSystemListFonts.java
+++ b/src/net/sourceforge/plantuml/font/PSystemListFonts.java
@@ -47,8 +47,8 @@ import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
public class PSystemListFonts extends AbstractPSystem {
diff --git a/src/net/sourceforge/plantuml/golem/Tile.java b/src/net/sourceforge/plantuml/golem/Tile.java
index 91edc23cd..6a4cd7c13 100644
--- a/src/net/sourceforge/plantuml/golem/Tile.java
+++ b/src/net/sourceforge/plantuml/golem/Tile.java
@@ -46,7 +46,6 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -55,6 +54,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;
public class Tile extends AbstractTextBlock implements TextBlock {
@@ -79,7 +79,7 @@ public class Tile extends AbstractTextBlock implements TextBlock {
}
public void drawU(UGraphic ug) {
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
+ ug = ug.apply(new UChangeColor(HColorUtils.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());
diff --git a/src/net/sourceforge/plantuml/golem/TilesField.java b/src/net/sourceforge/plantuml/golem/TilesField.java
index c921006e6..6a5dd22a7 100644
--- a/src/net/sourceforge/plantuml/golem/TilesField.java
+++ b/src/net/sourceforge/plantuml/golem/TilesField.java
@@ -45,13 +45,13 @@ import java.util.Map;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
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;
public class TilesField extends AbstractTextBlock implements TextBlock {
@@ -253,7 +253,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(new UChangeColor(HtmlColorUtils.RED));
+ ug = ug.apply(new UChangeColor(HColorUtils.RED));
for (Path p : paths) {
final TileArea start = p.getStart();
final TileArea dest = p.getDest();
diff --git a/src/net/sourceforge/plantuml/graph/AbstractEntityImage.java b/src/net/sourceforge/plantuml/graph/AbstractEntityImage.java
index 52d6c5c57..506926567 100644
--- a/src/net/sourceforge/plantuml/graph/AbstractEntityImage.java
+++ b/src/net/sourceforge/plantuml/graph/AbstractEntityImage.java
@@ -39,27 +39,27 @@ import java.awt.Graphics2D;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.cucadiagram.IEntity;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
abstract class AbstractEntityImage {
private final IEntity entity;
- final private HtmlColor red = HtmlColorUtils.MY_RED;
+ final private HColor red = HColorUtils.MY_RED;
- final private HtmlColor yellow = HtmlColorUtils.MY_YELLOW;
- private final HtmlColor yellowNote = HtmlColorUtils.COL_FBFB77;
+ final private HColor yellow = HColorUtils.MY_YELLOW;
+ private final HColor yellowNote = HColorUtils.COL_FBFB77;
final private UFont font14 = UFont.sansSerif(14);
final private UFont font17 = UFont.courier(17).bold();
- final private HtmlColor green = HtmlColorUtils.COL_ADD1B2;
- final private HtmlColor violet = HtmlColorUtils.COL_B4A7E5;
- final private HtmlColor blue = HtmlColorUtils.COL_A9DCDF;
- final private HtmlColor rose = HtmlColorUtils.COL_EB937F;
+ final private HColor green = HColorUtils.COL_ADD1B2;
+ final private HColor violet = HColorUtils.COL_B4A7E5;
+ final private HColor blue = HColorUtils.COL_A9DCDF;
+ final private HColor rose = HColorUtils.COL_EB937F;
public AbstractEntityImage(IEntity entity) {
if (entity == null) {
@@ -76,11 +76,11 @@ abstract class AbstractEntityImage {
return entity;
}
- protected final HtmlColor getRed() {
+ protected final HColor getRed() {
return red;
}
- protected final HtmlColor getYellow() {
+ protected final HColor getYellow() {
return yellow;
}
@@ -92,23 +92,23 @@ abstract class AbstractEntityImage {
return font14;
}
- protected final HtmlColor getGreen() {
+ protected final HColor getGreen() {
return green;
}
- protected final HtmlColor getViolet() {
+ protected final HColor getViolet() {
return violet;
}
- protected final HtmlColor getBlue() {
+ protected final HColor getBlue() {
return blue;
}
- protected final HtmlColor getRose() {
+ protected final HColor getRose() {
return rose;
}
- protected final HtmlColor getYellowNote() {
+ protected final HColor getYellowNote() {
return yellowNote;
}
}
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageActivityBar.java b/src/net/sourceforge/plantuml/graph/EntityImageActivityBar.java
index ee5c2bc32..65566bf4e 100644
--- a/src/net/sourceforge/plantuml/graph/EntityImageActivityBar.java
+++ b/src/net/sourceforge/plantuml/graph/EntityImageActivityBar.java
@@ -42,7 +42,7 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
class EntityImageActivityBar extends AbstractEntityImage {
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageActivityBranch.java b/src/net/sourceforge/plantuml/graph/EntityImageActivityBranch.java
index da317ecfa..b83d1adb9 100644
--- a/src/net/sourceforge/plantuml/graph/EntityImageActivityBranch.java
+++ b/src/net/sourceforge/plantuml/graph/EntityImageActivityBranch.java
@@ -42,7 +42,7 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
class EntityImageActivityBranch extends AbstractEntityImage {
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageActivityCircle.java b/src/net/sourceforge/plantuml/graph/EntityImageActivityCircle.java
index a0995f212..f8b3a835f 100644
--- a/src/net/sourceforge/plantuml/graph/EntityImageActivityCircle.java
+++ b/src/net/sourceforge/plantuml/graph/EntityImageActivityCircle.java
@@ -42,7 +42,7 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.cucadiagram.IEntity;
import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
class EntityImageActivityCircle extends AbstractEntityImage {
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageCircleInterface.java b/src/net/sourceforge/plantuml/graph/EntityImageCircleInterface.java
index 80032ae73..cba3158a2 100644
--- a/src/net/sourceforge/plantuml/graph/EntityImageCircleInterface.java
+++ b/src/net/sourceforge/plantuml/graph/EntityImageCircleInterface.java
@@ -46,7 +46,7 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.CircleInterface;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
class EntityImageCircleInterface extends AbstractEntityImage {
diff --git a/src/net/sourceforge/plantuml/graphic/AddStyle.java b/src/net/sourceforge/plantuml/graphic/AddStyle.java
index 10300cf4d..d1f2b60c1 100644
--- a/src/net/sourceforge/plantuml/graphic/AddStyle.java
+++ b/src/net/sourceforge/plantuml/graphic/AddStyle.java
@@ -35,13 +35,14 @@
*/
package net.sourceforge.plantuml.graphic;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class AddStyle implements FontChange {
private final FontStyle style;
- private final HtmlColor extendedColor;
+ private final HColor extendedColor;
- public AddStyle(FontStyle style, HtmlColor extendedColor) {
+ public AddStyle(FontStyle style, HColor extendedColor) {
this.style = style;
this.extendedColor = extendedColor;
}
diff --git a/src/net/sourceforge/plantuml/graphic/CircledCharacter.java b/src/net/sourceforge/plantuml/graphic/CircledCharacter.java
index f4ac55146..fe14c67d3 100644
--- a/src/net/sourceforge/plantuml/graphic/CircledCharacter.java
+++ b/src/net/sourceforge/plantuml/graphic/CircledCharacter.java
@@ -45,18 +45,19 @@ import net.sourceforge.plantuml.ugraphic.UEllipse;
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;
public class CircledCharacter extends AbstractTextBlock implements TextBlock {
private final String c;
private final UFont font;
- private final HtmlColor innerCircle;
- private final HtmlColor circle;
- private final HtmlColor fontColor;
+ private final HColor innerCircle;
+ private final HColor circle;
+ private final HColor fontColor;
private final double radius;
- public CircledCharacter(char c, double radius, UFont font, HtmlColor innerCircle, HtmlColor circle,
- HtmlColor fontColor) {
+ public CircledCharacter(char c, double radius, UFont font, HColor innerCircle, HColor circle,
+ HColor fontColor) {
this.c = "" + c;
this.radius = radius;
this.font = font;
diff --git a/src/net/sourceforge/plantuml/graphic/ColorAndSizeChange.java b/src/net/sourceforge/plantuml/graphic/ColorAndSizeChange.java
index 27644787c..7eadc920b 100644
--- a/src/net/sourceforge/plantuml/graphic/ColorAndSizeChange.java
+++ b/src/net/sourceforge/plantuml/graphic/ColorAndSizeChange.java
@@ -38,6 +38,8 @@ package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
class ColorAndSizeChange implements FontChange {
@@ -45,13 +47,13 @@ class ColorAndSizeChange implements FontChange {
static final Pattern2 sizePattern = MyPattern.cmpile("(?i)size\\s*=\\s*[%g]?(\\d+)[%g]?");
- private final HtmlColor color;
+ private final HColor color;
private final Integer size;
ColorAndSizeChange(String s) {
final Matcher2 matcherColor = colorPattern.matcher(s);
if (matcherColor.find()) {
- color = HtmlColorSet.getInstance().getColorIfValid(matcherColor.group(1));
+ color = HColorSet.instance().getColorIfValid(matcherColor.group(1));
} else {
color = null;
}
@@ -63,7 +65,7 @@ class ColorAndSizeChange implements FontChange {
}
}
- HtmlColor getColor() {
+ HColor getColor() {
return color;
}
diff --git a/src/net/sourceforge/plantuml/graphic/ColorChange.java b/src/net/sourceforge/plantuml/graphic/ColorChange.java
index 00c5dfd1b..eb7812a88 100644
--- a/src/net/sourceforge/plantuml/graphic/ColorChange.java
+++ b/src/net/sourceforge/plantuml/graphic/ColorChange.java
@@ -38,22 +38,24 @@ package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
class ColorChange implements FontChange {
static private final Pattern2 colorPattern = MyPattern.cmpile("(?i)" + Splitter.fontColorPattern2);
- private final HtmlColor color;
+ private final HColor color;
ColorChange(String s) {
final Matcher2 matcherColor = colorPattern.matcher(s);
if (matcherColor.find() == false) {
throw new IllegalArgumentException();
}
- this.color = HtmlColorSet.getInstance().getColorIfValid(matcherColor.group(1));
+ this.color = HColorSet.instance().getColorIfValid(matcherColor.group(1));
}
- HtmlColor getColor() {
+ HColor getColor() {
return color;
}
diff --git a/src/net/sourceforge/plantuml/graphic/FontConfiguration.java b/src/net/sourceforge/plantuml/graphic/FontConfiguration.java
index a44c03963..62a384183 100644
--- a/src/net/sourceforge/plantuml/graphic/FontConfiguration.java
+++ b/src/net/sourceforge/plantuml/graphic/FontConfiguration.java
@@ -45,34 +45,36 @@ import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class FontConfiguration {
private final EnumSet styles;
private final UFont currentFont;
private final UFont motherFont;
- private final HtmlColor motherColor;
- private final HtmlColor hyperlinkColor;
- private final HtmlColor currentColor;
- private final HtmlColor extendedColor;
+ private final HColor motherColor;
+ private final HColor hyperlinkColor;
+ private final HColor currentColor;
+ private final HColor extendedColor;
private final FontPosition fontPosition;
private final SvgAttributes svgAttributes;
private final boolean hyperlink;
private final boolean useUnderlineForHyperlink;
private final int tabSize;
- public FontConfiguration(UFont font, HtmlColor color, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink) {
+ public FontConfiguration(UFont font, HColor color, HColor hyperlinkColor, boolean useUnderlineForHyperlink) {
this(font, color, hyperlinkColor, useUnderlineForHyperlink, 8);
}
- public FontConfiguration(UFont font, HtmlColor color, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink,
+ public FontConfiguration(UFont font, HColor color, HColor hyperlinkColor, boolean useUnderlineForHyperlink,
int tabSize) {
this(getStyles(font), font, color, font, color, null, FontPosition.NORMAL, new SvgAttributes(), false,
hyperlinkColor, useUnderlineForHyperlink, tabSize);
}
public static FontConfiguration blackBlueTrue(UFont font) {
- return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLUE, true, 8);
+ return new FontConfiguration(font, HColorUtils.BLACK, HColorUtils.BLUE, true, 8);
}
public FontConfiguration(ISkinParam skinParam, FontParam fontParam, Stereotype stereo) {
@@ -86,7 +88,7 @@ public class FontConfiguration {
return useUnderlineForHyperlink;
}
- public final HtmlColor getHyperlinkColor() {
+ public final HColor getHyperlinkColor() {
return hyperlinkColor;
}
@@ -112,9 +114,9 @@ public class FontConfiguration {
return styles.toString() + " " + currentColor;
}
- private FontConfiguration(EnumSet styles, UFont motherFont, HtmlColor motherColor, UFont currentFont,
- HtmlColor currentColor, HtmlColor extendedColor, FontPosition fontPosition, SvgAttributes svgAttributes,
- boolean hyperlink, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, int tabSize) {
+ private FontConfiguration(EnumSet styles, UFont motherFont, HColor motherColor, UFont currentFont,
+ HColor currentColor, HColor extendedColor, FontPosition fontPosition, SvgAttributes svgAttributes,
+ boolean hyperlink, HColor hyperlinkColor, boolean useUnderlineForHyperlink, int tabSize) {
this.styles = styles;
this.currentFont = currentFont;
this.motherFont = motherFont;
@@ -129,7 +131,7 @@ public class FontConfiguration {
this.tabSize = tabSize;
}
- public FontConfiguration forceFont(UFont newFont, HtmlColor htmlColorForStereotype) {
+ public FontConfiguration forceFont(UFont newFont, HColor htmlColorForStereotype) {
if (newFont == null) {
return add(FontStyle.ITALIC);
}
@@ -153,7 +155,7 @@ public class FontConfiguration {
fontPosition, svgAttributes, true, hyperlinkColor, useUnderlineForHyperlink, tabSize);
}
- public FontConfiguration changeColor(HtmlColor htmlColor) {
+ public FontConfiguration changeColor(HColor htmlColor) {
return new FontConfiguration(styles, motherFont, motherColor, currentFont, htmlColor, extendedColor,
fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink, tabSize);
}
@@ -162,14 +164,14 @@ public class FontConfiguration {
if (colors == null) {
throw new IllegalArgumentException();
}
- final HtmlColor color = colors.getColor(ColorType.TEXT);
+ final HColor color = colors.getColor(ColorType.TEXT);
if (color == null) {
return this;
}
return changeColor(color);
}
- FontConfiguration changeExtendedColor(HtmlColor newExtendedColor) {
+ FontConfiguration changeExtendedColor(HColor newExtendedColor) {
return new FontConfiguration(styles, motherFont, motherColor, currentFont, currentColor, newExtendedColor,
fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink, tabSize);
}
@@ -222,7 +224,7 @@ public class FontConfiguration {
return add(FontStyle.UNDERLINE);
}
- public FontConfiguration wave(HtmlColor color) {
+ public FontConfiguration wave(HColor color) {
return add(FontStyle.WAVE).changeExtendedColor(color);
}
@@ -248,14 +250,14 @@ public class FontConfiguration {
return fontPosition.mute(result);
}
- public HtmlColor getColor() {
+ public HColor getColor() {
if (hyperlink) {
return hyperlinkColor;
}
return currentColor;
}
- public HtmlColor getExtendedColor() {
+ public HColor getExtendedColor() {
return extendedColor;
}
diff --git a/src/net/sourceforge/plantuml/graphic/FontStyle.java b/src/net/sourceforge/plantuml/graphic/FontStyle.java
index a212ed1de..7d36d25b1 100644
--- a/src/net/sourceforge/plantuml/graphic/FontStyle.java
+++ b/src/net/sourceforge/plantuml/graphic/FontStyle.java
@@ -41,6 +41,8 @@ import java.util.EnumSet;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public enum FontStyle {
PLAIN, ITALIC, BOLD, UNDERLINE, STRIKE, WAVE, BACKCOLOR;
@@ -119,14 +121,14 @@ public enum FontStyle {
throw new UnsupportedOperationException();
}
- public HtmlColor getExtendedColor(String s) {
+ public HColor getExtendedColor(String s) {
final Matcher2 m = MyPattern.cmpile(getActivationPattern()).matcher(s);
if (m.find() == false || m.groupCount() != 1) {
return null;
}
final String color = m.group(1);
- if (HtmlColorSet.getInstance().getColorIfValid(color) != null) {
- return HtmlColorSet.getInstance().getColorIfValid(color);
+ if (HColorSet.instance().getColorIfValid(color) != null) {
+ return HColorSet.instance().getColorIfValid(color);
}
return null;
}
diff --git a/src/net/sourceforge/plantuml/graphic/GraphicStrings.java b/src/net/sourceforge/plantuml/graphic/GraphicStrings.java
index 882327156..fd8946f9f 100644
--- a/src/net/sourceforge/plantuml/graphic/GraphicStrings.java
+++ b/src/net/sourceforge/plantuml/graphic/GraphicStrings.java
@@ -52,14 +52,16 @@ import net.sourceforge.plantuml.ugraphic.UFont;
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;
public class GraphicStrings extends AbstractTextBlock implements IEntityImage {
private final double margin = 5;
- private final HtmlColor background;
+ private final HColor background;
- private final static HtmlColor hyperlinkColor = HtmlColorUtils.BLUE;
+ private final static HColor hyperlinkColor = HColorUtils.BLUE;
private final static boolean useUnderlineForHyperlink = true;
@@ -77,56 +79,56 @@ public class GraphicStrings extends AbstractTextBlock implements IEntityImage {
CreoleMode.NO_CREOLE);
}
- private static HtmlColor getForeColor(boolean useRed) {
+ private static HColor getForeColor(boolean useRed) {
if (useRed) {
- return HtmlColorUtils.BLACK;
+ return HColorUtils.BLACK;
}
- return HtmlColorUtils.MY_GREEN;
+ return HColorUtils.MY_GREEN;
}
- private static HtmlColor getBackColor(boolean useRed) {
+ private static HColor getBackColor(boolean useRed) {
if (useRed) {
- return HtmlColorUtils.RED_LIGHT;
+ return HColorUtils.RED_LIGHT;
}
- return HtmlColorUtils.BLACK;
+ return HColorUtils.BLACK;
}
public static TextBlockBackcolored createGreenOnBlackMonospaced(List strings) {
- return new GraphicStrings(strings, monospaced14(HtmlColorUtils.GREEN), HtmlColorUtils.BLACK, null, null,
+ return new GraphicStrings(strings, monospaced14(HColorUtils.GREEN), HColorUtils.BLACK, null, null,
CreoleMode.SIMPLE_LINE);
}
public static TextBlockBackcolored createBlackOnWhite(List strings) {
- return new GraphicStrings(strings, sansSerif12(HtmlColorUtils.BLACK), HtmlColorUtils.WHITE, null, null,
+ return new GraphicStrings(strings, sansSerif12(HColorUtils.BLACK), HColorUtils.WHITE, null, null,
CreoleMode.FULL);
}
public static TextBlockBackcolored createBlackOnWhiteMonospaced(List strings) {
- return new GraphicStrings(strings, monospaced14(HtmlColorUtils.BLACK), HtmlColorUtils.WHITE, null, null,
+ return new GraphicStrings(strings, monospaced14(HColorUtils.BLACK), HColorUtils.WHITE, null, null,
CreoleMode.FULL);
}
public static TextBlockBackcolored createBlackOnWhite(List strings, BufferedImage image,
GraphicPosition position) {
- return new GraphicStrings(strings, sansSerif12(HtmlColorUtils.BLACK), HtmlColorUtils.WHITE, image, position,
+ return new GraphicStrings(strings, sansSerif12(HColorUtils.BLACK), HColorUtils.WHITE, image, position,
CreoleMode.FULL);
}
- private static FontConfiguration sansSerif12(HtmlColor color) {
+ private static FontConfiguration sansSerif12(HColor color) {
return new FontConfiguration(UFont.sansSerif(12), color, hyperlinkColor, useUnderlineForHyperlink);
}
- public static FontConfiguration sansSerif14(HtmlColor color) {
+ public static FontConfiguration sansSerif14(HColor color) {
return new FontConfiguration(UFont.sansSerif(14), color, hyperlinkColor, useUnderlineForHyperlink);
}
- private static FontConfiguration monospaced14(HtmlColor color) {
+ private static FontConfiguration monospaced14(HColor color) {
return new FontConfiguration(UFont.monospaced(14), color, hyperlinkColor, useUnderlineForHyperlink);
}
private final CreoleMode mode;
- private GraphicStrings(List strings, FontConfiguration fontConfiguration, HtmlColor background,
+ private GraphicStrings(List strings, FontConfiguration fontConfiguration, HColor background,
BufferedImage image, GraphicPosition position, CreoleMode mode) {
this.strings = strings;
this.background = background;
@@ -187,7 +189,7 @@ public class GraphicStrings extends AbstractTextBlock implements IEntityImage {
return ShapeType.RECTANGLE;
}
- public HtmlColor getBackcolor() {
+ public HColor getBackcolor() {
return background;
}
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java b/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java
index afe11da01..3c47e756e 100644
--- a/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java
+++ b/src/net/sourceforge/plantuml/graphic/HtmlColorAndStyle.java
@@ -42,10 +42,12 @@ import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignature;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class HtmlColorAndStyle {
- private final HtmlColor color;
+ private final HColor color;
private final LinkStyle style;
@Override
@@ -53,11 +55,11 @@ public class HtmlColorAndStyle {
return color + " " + style;
}
- public HtmlColorAndStyle(HtmlColor color) {
+ public HtmlColorAndStyle(HColor color) {
this(color, LinkStyle.NORMAL());
}
- public HtmlColorAndStyle(HtmlColor color, LinkStyle style) {
+ public HtmlColorAndStyle(HColor color, LinkStyle style) {
if (color == null) {
throw new IllegalArgumentException();
}
@@ -65,7 +67,7 @@ public class HtmlColorAndStyle {
this.style = style;
}
- public HtmlColor getColor() {
+ public HColor getColor() {
return color;
}
@@ -78,7 +80,7 @@ public class HtmlColorAndStyle {
}
public static HtmlColorAndStyle build(ISkinParam skinParam, String definition) {
- HtmlColor color;
+ HColor color;
if (SkinParam.USE_STYLES()) {
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
color = style.value(PName.LineColor).asColor(skinParam.getIHtmlColorSet());
@@ -86,14 +88,14 @@ public class HtmlColorAndStyle {
color = Rainbow.build(skinParam).getColors().get(0).color;
}
LinkStyle style = LinkStyle.NORMAL();
- final IHtmlColorSet set = skinParam.getIHtmlColorSet();
+ final HColorSet set = skinParam.getIHtmlColorSet();
for (String s : definition.split(",")) {
final LinkStyle tmpStyle = LinkStyle.fromString1(s);
if (tmpStyle.isNormal() == false) {
style = tmpStyle;
continue;
}
- final HtmlColor tmpColor = set.getColorIfValid(s);
+ final HColor tmpColor = set.getColorIfValid(s);
if (tmpColor != null) {
color = tmpColor;
}
diff --git a/src/net/sourceforge/plantuml/graphic/HtmlColorTransparent.java b/src/net/sourceforge/plantuml/graphic/HtmlColorTransparent.java
deleted file mode 100644
index 0a71dbe7a..000000000
--- a/src/net/sourceforge/plantuml/graphic/HtmlColorTransparent.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* ========================================================================
- * PlantUML : a free UML diagram generator
- * ========================================================================
- *
- * (C) Copyright 2009-2020, Arnaud Roques
- *
- * Project Info: http://plantuml.com
- *
- * If you like this project or if you find it useful, you can support us at:
- *
- * http://plantuml.com/patreon (only 1$ per month!)
- * http://plantuml.com/paypal
- *
- * This file is part of PlantUML.
- *
- * PlantUML is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * PlantUML distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- * USA.
- *
- *
- * Original Author: Arnaud Roques
- *
- */
-package net.sourceforge.plantuml.graphic;
-
-public class HtmlColorTransparent implements HtmlColor {
-
-}
diff --git a/src/net/sourceforge/plantuml/graphic/QuoteUtils.java b/src/net/sourceforge/plantuml/graphic/QuoteUtils.java
index e520364d7..7188b733d 100644
--- a/src/net/sourceforge/plantuml/graphic/QuoteUtils.java
+++ b/src/net/sourceforge/plantuml/graphic/QuoteUtils.java
@@ -247,7 +247,8 @@ public class QuoteUtils {
"Cerzngher bcgvzvmngvba vf gur ebbg bs nyy rivy", "Chgnva, w'ra nv zneer q'nibve gbhwbhef envfba",
"Guvf vf gur jnl", "Cngvrapr lbh zhfg unir zl lbhat cnqnjna", "V gubhtug lbh jrer ba zl fvqr",
"Qba'g cnavp. Abar bs lbh cnavp. Nofbyhgryl ab ernfba gb cnavp.",
- "Gung jnf hacyrnfnag. V'z fbeel lbh unq gb frr gung.", "Gur neg bs fvzcyvpvgl vf n chmmyr bs pbzcyrkvgl.");
+ "Gung jnf hacyrnfnag. V'z fbeel lbh unq gb frr gung.", "Gur neg bs fvzcyvpvgl vf n chmmyr bs pbzcyrkvgl.",
+ "Xrrc pnyz naq fgnl ng ubzr");
private QuoteUtils() {
}
diff --git a/src/net/sourceforge/plantuml/graphic/Rainbow.java b/src/net/sourceforge/plantuml/graphic/Rainbow.java
index 270a491b3..1985d91cc 100644
--- a/src/net/sourceforge/plantuml/graphic/Rainbow.java
+++ b/src/net/sourceforge/plantuml/graphic/Rainbow.java
@@ -45,6 +45,8 @@ import net.sourceforge.plantuml.SkinParam;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class Rainbow {
@@ -66,7 +68,7 @@ public class Rainbow {
return new Rainbow(0);
}
- public static Rainbow fromColor(HtmlColor color) {
+ public static Rainbow fromColor(HColor color) {
if (color == null) {
return Rainbow.none();
}
@@ -80,8 +82,8 @@ public class Rainbow {
return fromColor(rose.getHtmlColor(skinParam, ColorParam.arrow));
}
- public static Rainbow build(Style style, IHtmlColorSet set) {
- final HtmlColor color = style.value(PName.LineColor).asColor(set);
+ public static Rainbow build(Style style, HColorSet set) {
+ final HColor color = style.value(PName.LineColor).asColor(set);
return fromColor(color);
}
@@ -127,7 +129,7 @@ public class Rainbow {
return Collections.unmodifiableList(colors);
}
- public HtmlColor getColor() {
+ public HColor getColor() {
return colors.get(0).getColor();
}
diff --git a/src/net/sourceforge/plantuml/graphic/SimpleTextBlockBordered.java b/src/net/sourceforge/plantuml/graphic/SimpleTextBlockBordered.java
index 039aa0f76..2ad590e8d 100644
--- a/src/net/sourceforge/plantuml/graphic/SimpleTextBlockBordered.java
+++ b/src/net/sourceforge/plantuml/graphic/SimpleTextBlockBordered.java
@@ -42,13 +42,14 @@ import net.sourceforge.plantuml.ugraphic.UChangeColor;
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;
class SimpleTextBlockBordered extends AbstractTextBlock implements TextBlock {
private final TextBlock textBlock;
- private final HtmlColor color;
+ private final HColor color;
- public SimpleTextBlockBordered(TextBlock textBlock, HtmlColor color) {
+ public SimpleTextBlockBordered(TextBlock textBlock, HColor color) {
this.textBlock = textBlock;
this.color = color;
}
diff --git a/src/net/sourceforge/plantuml/graphic/SymbolContext.java b/src/net/sourceforge/plantuml/graphic/SymbolContext.java
index 1f7820c7d..ca19ce612 100644
--- a/src/net/sourceforge/plantuml/graphic/SymbolContext.java
+++ b/src/net/sourceforge/plantuml/graphic/SymbolContext.java
@@ -39,18 +39,20 @@ import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
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;
public class SymbolContext {
- private final HtmlColor backColor;
- private final HtmlColor foreColor;
+ private final HColor backColor;
+ private final HColor foreColor;
private final UStroke stroke;
private final double deltaShadow;
private final double roundCorner;
private final double diagonalCorner;
- private SymbolContext(HtmlColor backColor, HtmlColor foreColor, UStroke stroke, double deltaShadow,
- double roundCorner, double diagonalCorner) {
+ private SymbolContext(HColor backColor, HColor foreColor, UStroke stroke, double deltaShadow, double roundCorner,
+ double diagonalCorner) {
this.backColor = backColor;
this.foreColor = foreColor;
this.stroke = stroke;
@@ -81,13 +83,14 @@ public class SymbolContext {
}
public SymbolContext transparentBackColorToNull() {
- if (backColor instanceof HtmlColorTransparent) {
- return new SymbolContext(null, foreColor, stroke, deltaShadow, roundCorner, diagonalCorner);
+ if (backColor instanceof HColorBackground) {
+ return new SymbolContext(((HColorBackground) backColor).getNull(), foreColor, stroke, deltaShadow,
+ roundCorner, diagonalCorner);
}
return this;
}
- public SymbolContext(HtmlColor backColor, HtmlColor foreColor) {
+ public SymbolContext(HColor backColor, HColor foreColor) {
this(backColor, foreColor, new UStroke(), 0, 0, 0);
}
@@ -103,11 +106,11 @@ public class SymbolContext {
return new SymbolContext(backColor, foreColor, newStroke, deltaShadow, roundCorner, diagonalCorner);
}
- public SymbolContext withBackColor(HtmlColor backColor) {
+ public SymbolContext withBackColor(HColor backColor) {
return new SymbolContext(backColor, foreColor, stroke, deltaShadow, roundCorner, diagonalCorner);
}
- public SymbolContext withForeColor(HtmlColor foreColor) {
+ public SymbolContext withForeColor(HColor foreColor) {
return new SymbolContext(backColor, foreColor, stroke, deltaShadow, roundCorner, diagonalCorner);
}
@@ -115,11 +118,11 @@ public class SymbolContext {
return new SymbolContext(backColor, foreColor, stroke, deltaShadow, roundCorner, diagonalCorner);
}
- public HtmlColor getBackColor() {
+ public HColor getBackColor() {
return backColor;
}
- public HtmlColor getForeColor() {
+ public HColor getForeColor() {
return foreColor;
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockArrow.java b/src/net/sourceforge/plantuml/graphic/TextBlockArrow.java
index 29e8e5680..905bf38ff 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockArrow.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockArrow.java
@@ -44,12 +44,13 @@ import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class TextBlockArrow extends AbstractTextBlock implements TextBlock {
private final double size;
private final Direction arrow;
- private final HtmlColor color;
+ private final HColor color;
public TextBlockArrow(Direction arrow, FontConfiguration fontConfiguration) {
if (arrow == null) {
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java b/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java
index 3f5527b80..0ccfcdaba 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockBordered.java
@@ -45,12 +45,13 @@ 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.HColor;
public class TextBlockBordered extends AbstractTextBlock implements TextBlock {
private final double cornersize;
- private final HtmlColor backgroundColor;
- private final HtmlColor borderColor;
+ private final HColor backgroundColor;
+ private final HColor borderColor;
private final double marginX;
private final double marginY;
private final UStroke stroke;
@@ -58,7 +59,7 @@ public class TextBlockBordered extends AbstractTextBlock implements TextBlock {
private final TextBlock textBlock;
- TextBlockBordered(TextBlock textBlock, UStroke stroke, HtmlColor borderColor, HtmlColor backgroundColor,
+ TextBlockBordered(TextBlock textBlock, UStroke stroke, HColor borderColor, HColor backgroundColor,
double cornersize, double marginX, double marginY) {
this.marginX = marginX;
this.marginY = marginY;
@@ -70,7 +71,7 @@ public class TextBlockBordered extends AbstractTextBlock implements TextBlock {
this.backgroundColor = backgroundColor;
}
- TextBlockBordered(TextBlock textBlock, UStroke stroke, HtmlColor borderColor, HtmlColor backgroundColor,
+ TextBlockBordered(TextBlock textBlock, UStroke stroke, HColor borderColor, HColor backgroundColor,
double cornersize) {
this(textBlock, stroke, borderColor, backgroundColor, cornersize, 6, 5);
}
@@ -129,7 +130,7 @@ public class TextBlockBordered extends AbstractTextBlock implements TextBlock {
private Shadowable getPolygonNormal(final StringBounder stringBounder) {
final double height = getTextHeight(stringBounder);
final double width = getTextWidth(stringBounder);
- return new URectangle(width, height, cornersize, cornersize);
+ return new URectangle(width, height).rounded(cornersize);
}
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java b/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java
index e8944788d..a7429d6d4 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockGeneric.java
@@ -42,14 +42,15 @@ import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class TextBlockGeneric extends AbstractTextBlock implements TextBlock {
private final TextBlock textBlock;
- private final HtmlColor background;
- private final HtmlColor border;
+ private final HColor background;
+ private final HColor border;
- public TextBlockGeneric(TextBlock textBlock, HtmlColor background, HtmlColor border) {
+ public TextBlockGeneric(TextBlock textBlock, HColor background, HColor border) {
this.textBlock = textBlock;
this.border = border;
this.background = background;
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockHorizontal.java b/src/net/sourceforge/plantuml/graphic/TextBlockHorizontal.java
index b62f7120f..d26b16a78 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockHorizontal.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockHorizontal.java
@@ -79,7 +79,7 @@ public class TextBlockHorizontal extends AbstractTextBlock implements TextBlock
final double dy = (dimtotal.getHeight() - dimb.getHeight()) / 2;
block.drawU(ug.apply(new UTranslate(x, dy)));
} else {
- block.drawU(ug.apply(new UTranslate(x, 0)));
+ block.drawU(ug.apply(UTranslate.dx(x)));
}
x += dimb.getWidth();
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java b/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java
index 5371a79d8..790979fb7 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockLineBefore.java
@@ -44,6 +44,7 @@ import net.sourceforge.plantuml.svek.WithPorts;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UHorizontalLine;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class TextBlockLineBefore extends AbstractTextBlock implements TextBlock, WithPorts {
@@ -75,7 +76,7 @@ public class TextBlockLineBefore extends AbstractTextBlock implements TextBlock,
}
public void drawU(UGraphic ug) {
- final HtmlColor color = ug.getParam().getColor();
+ final HColor color = ug.getParam().getColor();
if (title == null) {
UHorizontalLine.infinite(1, 1, separator).drawMe(ug);
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockMinWidth.java b/src/net/sourceforge/plantuml/graphic/TextBlockMinWidth.java
index 81777a47f..e05f07e52 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockMinWidth.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockMinWidth.java
@@ -64,7 +64,7 @@ class TextBlockMinWidth extends AbstractTextBlock implements TextBlock {
} else if (horizontalAlignment == HorizontalAlignment.RIGHT) {
final Dimension2D dim = textBlock.calculateDimension(ug.getStringBounder());
final double diffx = minWidth - dim.getWidth();
- textBlock.drawU(ug.apply(new UTranslate(diffx, 0)));
+ textBlock.drawU(ug.apply(UTranslate.dx(diffx)));
} else {
throw new UnsupportedOperationException();
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockRaw.java b/src/net/sourceforge/plantuml/graphic/TextBlockRaw.java
index af94867cf..0fb2a9aea 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockRaw.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockRaw.java
@@ -87,7 +87,7 @@ public class TextBlockRaw extends AbstractTextBlock implements TextBlock {
double y = 0;
for (Line line : getLines(ug.getStringBounder())) {
- line.drawU(ug.apply(new UTranslate(0, y)));
+ line.drawU(ug.apply(UTranslate.dy(y)));
y += line.calculateDimension(ug.getStringBounder()).getHeight();
}
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java b/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java
index 397d24716..4619e659b 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockRecentred.java
@@ -41,6 +41,7 @@ import net.sourceforge.plantuml.svek.TextBlockBackcolored;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class TextBlockRecentred extends AbstractTextBlock implements TextBlockBackcolored {
@@ -77,7 +78,7 @@ public class TextBlockRecentred extends AbstractTextBlock implements TextBlockBa
return minMax.getDimension();
}
- public HtmlColor getBackcolor() {
+ public HColor getBackcolor() {
if (textBlock instanceof TextBlockBackcolored) {
return ((TextBlockBackcolored) textBlock).getBackcolor();
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockSprited.java b/src/net/sourceforge/plantuml/graphic/TextBlockSprited.java
index 13b17c208..d215cead1 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockSprited.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockSprited.java
@@ -71,7 +71,7 @@ public class TextBlockSprited extends AbstractTextBlock {
final double widthCircledCharacter = getCircledCharacterWithAndMargin(stringBounder);
- parent.drawU(ug.apply(new UTranslate(widthCircledCharacter, 0)));
+ parent.drawU(ug.apply(UTranslate.dx(widthCircledCharacter)));
}
}
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockTitle.java b/src/net/sourceforge/plantuml/graphic/TextBlockTitle.java
index 9092c74a4..6926d9a2e 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockTitle.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockTitle.java
@@ -63,7 +63,7 @@ public class TextBlockTitle implements TextBlock {
}
public final void drawU(UGraphic ug) {
- textBlock.drawU(ug.apply(new UTranslate(outMargin, 0)));
+ textBlock.drawU(ug.apply(UTranslate.dx(outMargin)));
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java b/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java
index e905f01cb..9564124e9 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockUtils.java
@@ -62,16 +62,18 @@ import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class TextBlockUtils {
- public static TextBlock bordered(TextBlock textBlock, UStroke stroke, HtmlColor borderColor,
- HtmlColor backgroundColor, double cornersize) {
+ public static TextBlock bordered(TextBlock textBlock, UStroke stroke, HColor borderColor,
+ HColor backgroundColor, double cornersize) {
return new TextBlockBordered(textBlock, stroke, borderColor, backgroundColor, cornersize);
}
- public static TextBlock bordered(TextBlock textBlock, UStroke stroke, HtmlColor borderColor,
- HtmlColor backgroundColor, double cornersize, double marginX, double marginY) {
+ public static TextBlock bordered(TextBlock textBlock, UStroke stroke, HColor borderColor,
+ HColor backgroundColor, double cornersize, double marginX, double marginY) {
return new TextBlockBordered(textBlock, stroke, borderColor, backgroundColor, cornersize, marginX, marginY);
}
@@ -81,8 +83,8 @@ public class TextBlockUtils {
}
UStroke stroke = skinParam.getThickness(LineParam.titleBorder, null);
final Rose rose = new Rose();
- HtmlColor borderColor = rose.getHtmlColor(skinParam, ColorParam.titleBorder);
- final HtmlColor backgroundColor = rose.getHtmlColor(skinParam, ColorParam.titleBackground);
+ HColor borderColor = rose.getHtmlColor(skinParam, ColorParam.titleBorder);
+ final HColor backgroundColor = rose.getHtmlColor(skinParam, ColorParam.titleBackground);
final TextBlockTitle result = new TextBlockTitle(font, stringsToDisplay, skinParam);
if (stroke == null && borderColor == null) {
return result;
@@ -91,7 +93,7 @@ public class TextBlockUtils {
stroke = new UStroke(1.5);
}
if (borderColor == null) {
- borderColor = HtmlColorUtils.BLACK;
+ borderColor = HColorUtils.BLACK;
}
final double corner = skinParam.getRoundCorner(CornerParam.titleBorder, null);
return withMargin(bordered(result, stroke, borderColor, backgroundColor, corner), 2, 2);
@@ -203,7 +205,7 @@ public class TextBlockUtils {
};
}
- public static TextBlockBackcolored addBackcolor(final TextBlock text, final HtmlColor backColor) {
+ public static TextBlockBackcolored addBackcolor(final TextBlock text, final HColor backColor) {
return new TextBlockBackcolored() {
public void drawU(UGraphic ug) {
text.drawU(ug);
@@ -221,7 +223,7 @@ public class TextBlockUtils {
return text.calculateDimension(stringBounder);
}
- public HtmlColor getBackcolor() {
+ public HColor getBackcolor() {
return backColor;
}
};
diff --git a/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java b/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java
index aa24b44e3..bf5b45877 100644
--- a/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java
+++ b/src/net/sourceforge/plantuml/graphic/TextBlockVertical2.java
@@ -49,6 +49,7 @@ import net.sourceforge.plantuml.ugraphic.UChangeColor;
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;
public class TextBlockVertical2 extends AbstractTextBlock implements TextBlock, WithPorts {
@@ -86,14 +87,14 @@ public class TextBlockVertical2 extends AbstractTextBlock implements TextBlock,
for (TextBlock block : blocks) {
final Dimension2D dimb = block.calculateDimension(ug.getStringBounder());
if (block instanceof TextBlockBackcolored) {
- final HtmlColor back = ((TextBlockBackcolored) block).getBackcolor();
+ final HColor back = ((TextBlockBackcolored) block).getBackcolor();
if (back != null) {
- ug.apply(new UTranslate(0, y)).apply(new UChangeColor(back)).apply(new UChangeBackColor(back))
+ ug.apply(UTranslate.dy(y)).apply(new UChangeColor(back)).apply(new UChangeBackColor(back))
.draw(new URectangle(dimtotal.getWidth(), dimb.getHeight()));
}
}
if (horizontalAlignment == HorizontalAlignment.LEFT) {
- block.drawU(ug.apply(new UTranslate(0, y)));
+ block.drawU(ug.apply(UTranslate.dy(y)));
} else if (horizontalAlignment == HorizontalAlignment.CENTER) {
final double dx = (dimtotal.getWidth() - dimb.getWidth()) / 2;
block.drawU(ug.apply(new UTranslate(dx, y)));
@@ -127,7 +128,7 @@ public class TextBlockVertical2 extends AbstractTextBlock implements TextBlock,
final Dimension2D dimb = block.calculateDimension(stringBounder);
final Rectangle2D result = block.getInnerPosition(member, stringBounder, strategy);
if (result != null) {
- return new UTranslate(0, y).apply(result);
+ return UTranslate.dy(y).apply(result);
}
y += dimb.getHeight();
}
diff --git a/src/net/sourceforge/plantuml/graphic/TileImage.java b/src/net/sourceforge/plantuml/graphic/TileImage.java
index eeacf8332..e92e98018 100644
--- a/src/net/sourceforge/plantuml/graphic/TileImage.java
+++ b/src/net/sourceforge/plantuml/graphic/TileImage.java
@@ -61,7 +61,7 @@ public class TileImage extends AbstractTextBlock implements TextBlock {
}
public void drawU(UGraphic ug) {
- ug.apply(new UTranslate(0, vspace)).draw(new UImage(image));
+ ug.apply(UTranslate.dy(vspace)).draw(new UImage(image));
}
}
diff --git a/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java b/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java
index 4efcf972d..09886f0fb 100644
--- a/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java
+++ b/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java
@@ -36,10 +36,10 @@
package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.Url;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.UShape;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
public abstract class UGraphicDelegator implements UGraphic {
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java b/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java
index 740a23256..93139e8bb 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolArtifact.java
@@ -55,7 +55,7 @@ class USymbolArtifact extends USymbol {
private void drawArtifact(UGraphic ug, double widthTotal, double heightTotal, boolean shadowing, double roundCorner) {
- final URectangle form = new URectangle(widthTotal, heightTotal, roundCorner, roundCorner);
+ final URectangle form = new URectangle(widthTotal, heightTotal).rounded(roundCorner);
if (shadowing) {
form.setDeltaShadow(4);
}
@@ -80,8 +80,8 @@ class USymbolArtifact extends USymbol {
final double ySymbol = 5;
ug.apply(new UTranslate(xSymbol, ySymbol)).draw(polygon);
- ug.apply(new UTranslate(xSymbol + widthSymbol - cornersize, ySymbol)).draw(new ULine(0, cornersize));
- ug.apply(new UTranslate(xSymbol + widthSymbol, ySymbol + cornersize)).draw(new ULine(-cornersize, 0));
+ ug.apply(new UTranslate(xSymbol + widthSymbol - cornersize, ySymbol)).draw(ULine.vline(cornersize));
+ ug.apply(new UTranslate(xSymbol + widthSymbol, ySymbol + cornersize)).draw(ULine.hline(-cornersize));
}
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolCard.java b/src/net/sourceforge/plantuml/graphic/USymbolCard.java
index 660baa97d..22edd39d0 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolCard.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolCard.java
@@ -57,13 +57,13 @@ class USymbolCard extends USymbol {
}
private void drawCard(UGraphic ug, double width, double height, boolean shadowing, double top, double roundCorner) {
- final URectangle shape = new URectangle(width, height, roundCorner, roundCorner);
+ final URectangle shape = new URectangle(width, height).rounded(roundCorner);
if (shadowing) {
shape.setDeltaShadow(3.0);
}
ug.draw(shape);
if (top != 0) {
- ug.apply(new UTranslate(0, top)).draw(new ULine(width, 0));
+ ug.apply(UTranslate.dy(top)).draw(ULine.hline(width));
}
}
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolCloud.java b/src/net/sourceforge/plantuml/graphic/USymbolCloud.java
index 2a1984ff1..bed4330ec 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolCloud.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolCloud.java
@@ -67,7 +67,7 @@ class USymbolCloud extends USymbol {
if (shadowing) {
// shape.setDeltaShadow(3.0);
}
- ug.apply(new UTranslate(0, 0)).draw(shape);
+ ug.apply(UTranslate.dy(0)).draw(shape);
}
private UPath getSpecificFrontierForCloudNew(double width, double height) {
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolCollections.java b/src/net/sourceforge/plantuml/graphic/USymbolCollections.java
index 107b12cb9..5e86c1de2 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolCollections.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolCollections.java
@@ -65,14 +65,14 @@ class USymbolCollections extends USymbol {
}
private void drawCollections(UGraphic ug, double width, double height, boolean shadowing, double roundCorner) {
- final URectangle small = new URectangle(width - getDeltaCollection(), height - getDeltaCollection(),
- roundCorner, roundCorner);
+ final URectangle small = new URectangle(width - getDeltaCollection(), height - getDeltaCollection())
+ .rounded(roundCorner);
if (shadowing) {
small.setDeltaShadow(3.0);
}
ug.apply(new UTranslate(getDeltaCollection(), getDeltaCollection())).draw(small);
small.setDeltaShadow(0);
- ug.apply(new UTranslate(0, 0)).draw(small);
+ ug.apply(UTranslate.dy(0)).draw(small);
}
private Margin getMargin() {
@@ -96,8 +96,8 @@ class USymbolCollections extends USymbol {
symbolContext.getRoundCorner());
final Margin margin = getMargin();
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, stereoAlignment);
- tb.drawU(ug.apply(new UTranslate(margin.getX1() - getDeltaCollection() / 2, margin.getY1()
- - getDeltaCollection() / 2)));
+ tb.drawU(ug.apply(new UTranslate(margin.getX1() - getDeltaCollection() / 2,
+ margin.getY1() - getDeltaCollection() / 2)));
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
@@ -110,7 +110,8 @@ class USymbolCollections extends USymbol {
@Override
public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
- final double width, final double height, final SymbolContext symbolContext, final HorizontalAlignment stereoAlignment) {
+ final double width, final double height, final SymbolContext symbolContext,
+ final HorizontalAlignment stereoAlignment) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java b/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java
index ff769dd5b..734dee677 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolComponent1.java
@@ -55,7 +55,7 @@ class USymbolComponent1 extends USymbol {
private void drawComponent1(UGraphic ug, double widthTotal, double heightTotal, boolean shadowing,
double roundCorner) {
- final URectangle form = new URectangle(widthTotal, heightTotal, roundCorner, roundCorner);
+ final URectangle form = new URectangle(widthTotal, heightTotal).rounded(roundCorner);
if (shadowing) {
form.setDeltaShadow(4);
}
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java b/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java
index f38dced23..868559b01 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolComponent2.java
@@ -55,7 +55,7 @@ class USymbolComponent2 extends USymbol {
private void drawComponent2(UGraphic ug, double widthTotal, double heightTotal, boolean shadowing,
double roundCorner) {
- final URectangle form = new URectangle(widthTotal, heightTotal, roundCorner, roundCorner);
+ final URectangle form = new URectangle(widthTotal, heightTotal).rounded(roundCorner);
if (shadowing) {
form.setDeltaShadow(4);
}
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java b/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java
index 1a8b8a601..be0537d33 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolDatabase.java
@@ -98,9 +98,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 UChangeBackColor(null)).apply(new UTranslate(0, -15)).draw(closing);
+ ug.apply(line.getStroke()).apply(new UChangeBackColor(null)).apply(UTranslate.dy(-15)).draw(closing);
if (line.isDouble()) {
- ug.apply(line.getStroke()).apply(new UChangeBackColor(null)).apply(new UTranslate(0, -15 + 2))
+ ug.apply(line.getStroke()).apply(new UChangeBackColor(null)).apply(UTranslate.dy(-15 + 2))
.draw(closing);
}
line.drawTitleInternal(ug, 0, endingX, 0, true);
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolFolder.java b/src/net/sourceforge/plantuml/graphic/USymbolFolder.java
index ca55ebe8d..a3df8c8ab 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolFolder.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolFolder.java
@@ -115,7 +115,7 @@ public class USymbolFolder extends USymbol {
shape.setDeltaShadow(3.0);
}
ug.draw(shape);
- ug.apply(new UTranslate(0, htitle)).draw(new ULine(wtitle + marginTitleX3, 0));
+ ug.apply(UTranslate.dy(htitle)).draw(ULine.hline(wtitle + marginTitleX3));
}
private double getHTitle(Dimension2D dimTitle) {
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolFrame.java b/src/net/sourceforge/plantuml/graphic/USymbolFrame.java
index adb26d7e2..5577c1ebf 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolFrame.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolFrame.java
@@ -55,8 +55,7 @@ class USymbolFrame extends USymbol {
private void drawFrame(UGraphic ug, double width, double height, Dimension2D dimTitle, boolean shadowing,
double roundCorner) {
- final URectangle shape = new URectangle(width, height, roundCorner, roundCorner);
- shape.setIgnoreForCompression(true);
+ final URectangle shape = new URectangle(width, height).rounded(roundCorner).ignoreForCompression();
if (shadowing) {
shape.setDeltaShadow(3.0);
}
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolLabel.java b/src/net/sourceforge/plantuml/graphic/USymbolLabel.java
index 5a315acdd..08df00461 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolLabel.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolLabel.java
@@ -38,11 +38,8 @@ package net.sourceforge.plantuml.graphic;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
-import net.sourceforge.plantuml.ugraphic.Shadowable;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
-import net.sourceforge.plantuml.ugraphic.UPath;
-import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolNode.java b/src/net/sourceforge/plantuml/graphic/USymbolNode.java
index ac04800e0..36d87b778 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolNode.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolNode.java
@@ -79,8 +79,8 @@ class USymbolNode extends USymbol {
ug.draw(shape);
ug.apply(new UTranslate(width - 10, 10)).draw(new ULine(9, -9));
- ug.apply(new UTranslate(0, 10)).draw(new ULine(width - 10, 0));
- ug.apply(new UTranslate(width - 10, 10)).draw(new ULine(0, height - 10));
+ ug.apply(UTranslate.dy(10)).draw(ULine.hline(width - 10));
+ ug.apply(new UTranslate(width - 10, 10)).draw(ULine.vline(height - 10));
}
@@ -104,15 +104,15 @@ class USymbolNode extends USymbol {
drawHlineInternal(ug, line);
if (line.isDouble()) {
- drawHlineInternal(ug.apply(new UTranslate(0, 2)), line);
+ drawHlineInternal(ug.apply(UTranslate.dy(2)), line);
}
line.drawTitleInternal(ug, 0, endingX - 10, 0, true);
}
private void drawHlineInternal(UGraphic ug, UHorizontalLine line) {
ug = ug.apply(line.getStroke()).apply(new UChangeBackColor(null));
- ug.draw(new ULine(endingX - 10, 0));
- ug.apply(new UTranslate(endingX - 10, 0)).draw(new ULine(10, -10));
+ ug.draw(ULine.hline(endingX - 10));
+ ug.apply(UTranslate.dx(endingX - 10)).draw(new ULine(10, -10));
}
}
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolRect.java b/src/net/sourceforge/plantuml/graphic/USymbolRect.java
index 4b72f0a55..aeaa20d22 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolRect.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolRect.java
@@ -41,7 +41,6 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ugraphic.Shadowable;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
-import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@@ -61,28 +60,15 @@ class USymbolRect extends USymbol {
private void drawRect(UGraphic ug, double width, double height, boolean shadowing, double roundCorner,
double diagonalCorner) {
- final Shadowable shape = diagonalCorner > 0 ? getDiagonalShape(width, height, diagonalCorner) : new URectangle(
- width, height, roundCorner, roundCorner);
+ final URectangle rect = new URectangle(width, height);
+ final Shadowable shape = diagonalCorner > 0 ? rect.diagonalCorner(diagonalCorner)
+ : rect.rounded(roundCorner);
if (shadowing) {
shape.setDeltaShadow(3.0);
}
ug.draw(shape);
}
- private Shadowable getDiagonalShape(double width, double height, double diagonalCorner) {
- final UPath result = new UPath();
- result.moveTo(diagonalCorner, 0);
- result.lineTo(width - diagonalCorner, 0);
- result.lineTo(width, diagonalCorner);
- result.lineTo(width, height - diagonalCorner);
- result.lineTo(width - diagonalCorner, height);
- result.lineTo(diagonalCorner, height);
- result.lineTo(0, height - diagonalCorner);
- result.lineTo(0, diagonalCorner);
- result.lineTo(diagonalCorner, 0);
- return result;
- }
-
private Margin getMargin() {
return new Margin(10, 10, 10, 10);
}
@@ -113,7 +99,8 @@ class USymbolRect extends USymbol {
@Override
public TextBlock asBig(final TextBlock title, final HorizontalAlignment labelAlignment, final TextBlock stereotype,
- final double width, final double height, final SymbolContext symbolContext, final HorizontalAlignment stereoAlignment) {
+ final double width, final double height, final SymbolContext symbolContext,
+ final HorizontalAlignment stereoAlignment) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java b/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java
index 00bd65aab..a7665cc90 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolSimpleAbstract.java
@@ -39,8 +39,6 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
-import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
abstract class USymbolSimpleAbstract extends USymbol {
@@ -73,7 +71,7 @@ abstract class USymbolSimpleAbstract extends USymbol {
label.drawU(ug.apply(new UTranslate(labelX, labelY)));
final double stereoX = (dimTotal.getWidth() - dimStereo.getWidth()) / 2;
- stereotype.drawU(ug.apply(new UTranslate(stereoX, 0)));
+ stereotype.drawU(ug.apply(UTranslate.dx(stereoX)));
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolStack.java b/src/net/sourceforge/plantuml/graphic/USymbolStack.java
index f00bfb434..5221412ab 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolStack.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolStack.java
@@ -57,11 +57,11 @@ class USymbolStack extends USymbol {
private void drawQueue(UGraphic ug, double width, double height, boolean shadowing, double roundCorner) {
final double border = 15;
- final URectangle rect = new URectangle(width - 2 * border, height, roundCorner, roundCorner);
+ final URectangle rect = new URectangle(width - 2 * border, height).rounded(roundCorner);
if (shadowing) {
rect.setDeltaShadow(3.0);
}
- ug.apply(new UChangeColor(null)).apply(new UTranslate(border, 0)).draw(rect);
+ ug.apply(new UChangeColor(null)).apply(UTranslate.dx(border)).draw(rect);
final UPath path = new UPath();
if (roundCorner == 0) {
path.moveTo(0, 0);
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolStorage.java b/src/net/sourceforge/plantuml/graphic/USymbolStorage.java
index 05817599b..8b07ba919 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolStorage.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolStorage.java
@@ -52,7 +52,7 @@ class USymbolStorage extends USymbol {
}
private void drawStorage(UGraphic ug, double width, double height, boolean shadowing) {
- final URectangle shape = new URectangle(width, height, 70, 70);
+ final URectangle shape = new URectangle(width, height).rounded(70);
if (shadowing) {
shape.setDeltaShadow(3.0);
}
@@ -88,7 +88,8 @@ class USymbolStorage extends USymbol {
@Override
public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
- final double width, final double height, final SymbolContext symbolContext, final HorizontalAlignment stereoAlignment) {
+ final double width, final double height, final SymbolContext symbolContext,
+ final HorizontalAlignment stereoAlignment) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
diff --git a/src/net/sourceforge/plantuml/graphic/color/ColorParser.java b/src/net/sourceforge/plantuml/graphic/color/ColorParser.java
index 0043dac64..37733a465 100644
--- a/src/net/sourceforge/plantuml/graphic/color/ColorParser.java
+++ b/src/net/sourceforge/plantuml/graphic/color/ColorParser.java
@@ -37,7 +37,7 @@ package net.sourceforge.plantuml.graphic.color;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.graphic.IHtmlColorSet;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class ColorParser {
@@ -56,7 +56,7 @@ public class ColorParser {
this.mainType = mainType;
}
- public Colors getColor(RegexResult arg, IHtmlColorSet set) {
+ public Colors getColor(RegexResult arg, HColorSet set) {
if (mainType == null) {
throw new IllegalStateException();
}
diff --git a/src/net/sourceforge/plantuml/graphic/color/Colors.java b/src/net/sourceforge/plantuml/graphic/color/Colors.java
index 2fd5f1335..fb1ff4768 100644
--- a/src/net/sourceforge/plantuml/graphic/color/Colors.java
+++ b/src/net/sourceforge/plantuml/graphic/color/Colors.java
@@ -46,14 +46,14 @@ import net.sourceforge.plantuml.SkinParamColors;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.cucadiagram.LinkStyle;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.IHtmlColorSet;
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.HColorSet;
public class Colors {
- private final Map map = new EnumMap(ColorType.class);
+ private final Map map = new EnumMap(ColorType.class);
private LinkStyle lineStyle = null;
private Boolean shadowing = null;
@@ -80,7 +80,7 @@ public class Colors {
private Colors() {
}
- public Colors(String data, IHtmlColorSet set, ColorType mainType) {
+ public Colors(String data, HColorSet set, ColorType mainType) {
data = StringUtils.goLowerCase(data);
for (final StringTokenizer st = new StringTokenizer(data, "#;"); st.hasMoreTokens();) {
@@ -97,7 +97,7 @@ public class Colors {
this.shadowing = value.equalsIgnoreCase("true");
} else {
final ColorType key = ColorType.getType(name);
- final HtmlColor color = set.getColorIfValid(value);
+ final HColor color = set.getColorIfValid(value);
map.put(key, color);
}
}
@@ -111,15 +111,15 @@ public class Colors {
}
}
- public HtmlColor getColor(ColorType key) {
+ public HColor getColor(ColorType key) {
if (key == null) {
throw new IllegalArgumentException();
}
return map.get(key);
}
- public HtmlColor getColor(ColorType key1, ColorType key2) {
- final HtmlColor result = getColor(key1);
+ public HColor getColor(ColorType key1, ColorType key2) {
+ final HColor result = getColor(key1);
if (result != null) {
return result;
}
@@ -139,7 +139,7 @@ public class Colors {
// return result;
// }
- public Colors add(ColorType type, HtmlColor color) {
+ public Colors add(ColorType type, HColor color) {
if (color == null) {
return this;
}
@@ -214,7 +214,7 @@ public class Colors {
if (getColor(colorType) != null) {
return this;
}
- final HtmlColor col = skinParam.getFontHtmlColor(stereotype, param);
+ final HColor col = skinParam.getFontHtmlColor(stereotype, param);
return add(colorType, col);
}
diff --git a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB1.java b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB1.java
index 637f77eea..b7f39673f 100644
--- a/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB1.java
+++ b/src/net/sourceforge/plantuml/hector/CucaDiagramFileMakerHectorB1.java
@@ -50,8 +50,6 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.Link;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.svek.CucaDiagramFileMaker;
import net.sourceforge.plantuml.svek.GeneralImageBuilder;
@@ -63,6 +61,8 @@ import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphic2;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class CucaDiagramFileMakerHectorB1 implements CucaDiagramFileMaker {
@@ -144,7 +144,7 @@ public class CucaDiagramFileMakerHectorB1 implements CucaDiagramFileMaker {
final double x = getX(pin);
final double y = getY(pin);
final UEllipse circle = new UEllipse(6, 6);
- ug.apply(new UChangeColor(HtmlColorUtils.BLACK)).apply(new UChangeBackColor(HtmlColorUtils.BLACK))
+ ug.apply(new UChangeColor(HColorUtils.BLACK)).apply(new UChangeBackColor(HColorUtils.BLACK))
.apply(new UTranslate(x - 3, y - 3)).draw(circle);
}
@@ -155,7 +155,7 @@ public class CucaDiagramFileMakerHectorB1 implements CucaDiagramFileMaker {
final double y2 = getY(pinLink.getPin2());
final Rose rose = new Rose();
- final HtmlColor color = rose.getHtmlColor(diagram.getSkinParam(), ColorParam.arrow);
+ final HColor color = rose.getHtmlColor(diagram.getSkinParam(), ColorParam.arrow);
final List b = new ArrayList();
final SmartConnection connection = new SmartConnection(x1, y1, x2, y2, b);
connection.draw(ug, color);
diff --git a/src/net/sourceforge/plantuml/hector/HectorPath.java b/src/net/sourceforge/plantuml/hector/HectorPath.java
index 8cd0a11a1..be12686f4 100644
--- a/src/net/sourceforge/plantuml/hector/HectorPath.java
+++ b/src/net/sourceforge/plantuml/hector/HectorPath.java
@@ -40,10 +40,10 @@ import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.geom.LineSegmentDouble;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class HectorPath {
@@ -62,7 +62,7 @@ public class HectorPath {
return segments.toString();
}
- public void draw(UGraphic ug, HtmlColor color) {
+ public void draw(UGraphic ug, HColor color) {
ug = ug.apply(new UChangeColor(color)).apply(new UStroke(1.5));
for (LineSegmentDouble seg : segments) {
seg.draw(ug);
diff --git a/src/net/sourceforge/plantuml/hector/SmartConnection.java b/src/net/sourceforge/plantuml/hector/SmartConnection.java
index d90a0032f..953781063 100644
--- a/src/net/sourceforge/plantuml/hector/SmartConnection.java
+++ b/src/net/sourceforge/plantuml/hector/SmartConnection.java
@@ -39,12 +39,12 @@ import java.awt.geom.Point2D;
import java.util.List;
import net.sourceforge.plantuml.geom.LineSegmentDouble;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UStroke;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
class SmartConnection {
@@ -66,11 +66,11 @@ class SmartConnection {
this(p1.getX(), p1.getY(), p2.getX(), p2.getY(), b);
}
- public void draw(UGraphic ug, HtmlColor color) {
+ public void draw(UGraphic ug, HColor color) {
final LineSegmentDouble seg = new LineSegmentDouble(x1, y1, x2, y2);
boolean clash = intersect(seg);
if (clash) {
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK)).apply(new UStroke(1.0));
+ ug = ug.apply(new UChangeColor(HColorUtils.BLACK)).apply(new UStroke(1.0));
} else {
ug = ug.apply(new UChangeColor(color)).apply(new UStroke(1.5));
}
@@ -86,7 +86,7 @@ class SmartConnection {
return false;
}
- public void drawEx1(UGraphic ug, HtmlColor color) {
+ public void drawEx1(UGraphic ug, HColor color) {
ug = ug.apply(new UChangeColor(color)).apply(new UStroke(1.5));
final double orthoX = -(y2 - y1);
final double orthoY = x2 - x1;
diff --git a/src/net/sourceforge/plantuml/hector2/graphic/Foo2.java b/src/net/sourceforge/plantuml/hector2/graphic/Foo2.java
index 63a57fb22..953f9dd21 100644
--- a/src/net/sourceforge/plantuml/hector2/graphic/Foo2.java
+++ b/src/net/sourceforge/plantuml/hector2/graphic/Foo2.java
@@ -84,7 +84,7 @@ public class Foo2 extends AbstractTextBlock implements TextBlock {
final Dimension2D cell = getMaxCellDimension(stringBounder);
for (Layer layer : distribution.getLayers()) {
drawLayer(ug, layer, cell.getWidth(), cell.getHeight());
- ug = ug.apply(new UTranslate(0, cell.getHeight()));
+ ug = ug.apply(UTranslate.dy(cell.getHeight()));
}
}
diff --git a/src/net/sourceforge/plantuml/help/CommandHelpColor.java b/src/net/sourceforge/plantuml/help/CommandHelpColor.java
index 2789b4583..16a34e064 100644
--- a/src/net/sourceforge/plantuml/help/CommandHelpColor.java
+++ b/src/net/sourceforge/plantuml/help/CommandHelpColor.java
@@ -42,7 +42,7 @@ import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class CommandHelpColor extends SingleLineCommand2 {
@@ -65,7 +65,7 @@ public class CommandHelpColor extends SingleLineCommand2 {
diagram.add("You may improve it on https://github.com/plantuml/plantuml/tree/master/src/net/sourceforge/plantuml/help");
diagram.add(" ");
diagram.add(" The possible colors are :");
- for (String type : new HtmlColorSetSimple().names()) {
+ for (String type : HColorSet.instance().names()) {
diagram.add("* " + type);
}
diff --git a/src/net/sourceforge/plantuml/help/Help.java b/src/net/sourceforge/plantuml/help/Help.java
index a87545e0d..4a9571420 100644
--- a/src/net/sourceforge/plantuml/help/Help.java
+++ b/src/net/sourceforge/plantuml/help/Help.java
@@ -52,9 +52,9 @@ import net.sourceforge.plantuml.creole.SheetBlock1;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
public class Help extends UmlDiagram {
diff --git a/src/net/sourceforge/plantuml/jdot/CucaDiagramFileMakerJDot.java b/src/net/sourceforge/plantuml/jdot/CucaDiagramFileMakerJDot.java
index c5fde0062..99673f703 100644
--- a/src/net/sourceforge/plantuml/jdot/CucaDiagramFileMakerJDot.java
+++ b/src/net/sourceforge/plantuml/jdot/CucaDiagramFileMakerJDot.java
@@ -86,7 +86,6 @@ import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.entity.EntityFactory;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.QuoteUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -108,6 +107,7 @@ import net.sourceforge.plantuml.ugraphic.ImageBuilder;
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 smetana.core.CString;
import smetana.core.JUtils;
import smetana.core.JUtilsDebug;
diff --git a/src/net/sourceforge/plantuml/jdot/JDotPath.java b/src/net/sourceforge/plantuml/jdot/JDotPath.java
index fa35e8daf..ffdc0bec7 100644
--- a/src/net/sourceforge/plantuml/jdot/JDotPath.java
+++ b/src/net/sourceforge/plantuml/jdot/JDotPath.java
@@ -48,8 +48,6 @@ import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
import net.sourceforge.plantuml.cucadiagram.Link;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.graphic.color.ColorType;
@@ -61,6 +59,8 @@ import net.sourceforge.plantuml.ugraphic.UEllipse;
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.HColorUtils;
import smetana.core.Macro;
public class JDotPath implements UDrawable {
@@ -102,10 +102,10 @@ public class JDotPath implements UDrawable {
public void drawU(UGraphic ug) {
- HtmlColor color = rose.getHtmlColor(diagram.getSkinParam(), null, getArrowColorParam());
+ HColor color = rose.getHtmlColor(diagram.getSkinParam(), null, getArrowColorParam());
if (this.link.getColors() != null) {
- final HtmlColor newColor = this.link.getColors().getColor(ColorType.ARROW, ColorType.LINE);
+ final HColor newColor = this.link.getColors().getColor(ColorType.ARROW, ColorType.LINE);
if (newColor != null) {
color = newColor;
}
@@ -136,7 +136,7 @@ public class JDotPath implements UDrawable {
}
private void printDebug(UGraphic ug) {
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLUE)).apply(new UChangeBackColor(HtmlColorUtils.BLUE));
+ ug = ug.apply(new UChangeColor(HColorUtils.BLUE)).apply(new UChangeBackColor(HColorUtils.BLUE));
final ST_splines splines = getSplines(edge);
final ST_bezier beziers = splines.list.getPtr();
for (int i = 0; i < beziers.size; i++) {
@@ -147,7 +147,7 @@ public class JDotPath 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(new UChangeColor(HtmlColorUtils.BLUE)).apply(new UChangeBackColor(null));
+ ug = ug.apply(new UChangeColor(HColorUtils.BLUE)).apply(new UChangeBackColor(null));
ug.apply(getLabelRectangleTranslate("label")).draw(getLabelURectangle());
}
diff --git a/src/net/sourceforge/plantuml/jungle/GTileLeftRight.java b/src/net/sourceforge/plantuml/jungle/GTileLeftRight.java
index 921b14052..c3e94608c 100644
--- a/src/net/sourceforge/plantuml/jungle/GTileLeftRight.java
+++ b/src/net/sourceforge/plantuml/jungle/GTileLeftRight.java
@@ -40,12 +40,12 @@ import java.util.Arrays;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class GTileLeftRight extends AbstractTextBlock implements GTile {
@@ -67,11 +67,11 @@ public class GTileLeftRight extends AbstractTextBlock implements GTile {
final Dimension2D dimTotal = calculateDimension(stringBounder);
final double deltaH1 = dimTotal.getHeight() - dimLeft.getHeight();
final double deltaH2 = dimTotal.getHeight() - dimRight.getHeight();
- left.drawU(ug.apply(new UTranslate(0, deltaH1 / 2)));
+ left.drawU(ug.apply(UTranslate.dy(deltaH1 / 2)));
final double dx2 = dimLeft.getWidth() + space;
right.drawU(ug.apply(new UTranslate(dx2, deltaH2 / 2)));
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
+ ug = ug.apply(new UChangeColor(HColorUtils.BLACK));
final double step = dimLeft.getHeight() / (dimRight.getWestPositions().size() + 1);
double ystart = step + deltaH1 / 2;
for (Double w2 : dimRight.getWestPositions()) {
@@ -89,7 +89,7 @@ public class GTileLeftRight extends AbstractTextBlock implements GTile {
path.lineTo(x1 + step, y1);
path.lineTo(x2 - step, y2);
path.lineTo(x2, y2);
- ug.apply(new UTranslate(0, 0)).draw(path);
+ ug.apply(UTranslate.dy(0)).draw(path);
}
public GTileGeometry calculateDimension(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/jungle/GTileNode.java b/src/net/sourceforge/plantuml/jungle/GTileNode.java
index ada8adbe1..c7278456a 100644
--- a/src/net/sourceforge/plantuml/jungle/GTileNode.java
+++ b/src/net/sourceforge/plantuml/jungle/GTileNode.java
@@ -49,8 +49,6 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -59,6 +57,8 @@ import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class GTileNode extends AbstractTextBlock implements GTile {
@@ -68,14 +68,14 @@ public class GTileNode extends AbstractTextBlock implements GTile {
final Display display = node.getDisplay();
final SheetBlock1 sheetBlock1 = getTextBlock(display);
- final SymbolContext symbolContext = new SymbolContext(HtmlColorUtils.MY_YELLOW, HtmlColorUtils.BLACK);
+ final SymbolContext symbolContext = new SymbolContext(HColorUtils.MY_YELLOW, HColorUtils.BLACK);
tb = USymbol.RECTANGLE.asSmall(null, sheetBlock1, TextBlockUtils.empty(0, 0), symbolContext, HorizontalAlignment.CENTER);
}
public static SheetBlock1 getTextBlock(final Display display) {
final Rose rose = new Rose();
final SkinParam skinParam = SkinParam.create(null);
- final HtmlColor fontColor = rose.getFontColor(skinParam, FontParam.NOTE);
+ final HColor fontColor = rose.getFontColor(skinParam, FontParam.NOTE);
final UFont fontNote = skinParam.getFont(null, false, FontParam.NOTE);
final FontConfiguration fc = new FontConfiguration(skinParam, FontParam.NOTE, null);
diff --git a/src/net/sourceforge/plantuml/jungle/GTileStack.java b/src/net/sourceforge/plantuml/jungle/GTileStack.java
index 19b572f66..3528cf53a 100644
--- a/src/net/sourceforge/plantuml/jungle/GTileStack.java
+++ b/src/net/sourceforge/plantuml/jungle/GTileStack.java
@@ -61,7 +61,7 @@ public class GTileStack extends AbstractTextBlock implements GTile {
for (GTile tile : tiles) {
tile.drawU(ug);
final Dimension2D dim = tile.calculateDimension(ug.getStringBounder());
- ug = ug.apply(new UTranslate(0, dim.getHeight() + space));
+ ug = ug.apply(UTranslate.dy(dim.getHeight() + space));
}
}
diff --git a/src/net/sourceforge/plantuml/jungle/Needle.java b/src/net/sourceforge/plantuml/jungle/Needle.java
index e06417921..308b3bcdc 100644
--- a/src/net/sourceforge/plantuml/jungle/Needle.java
+++ b/src/net/sourceforge/plantuml/jungle/Needle.java
@@ -38,12 +38,12 @@ package net.sourceforge.plantuml.jungle;
import java.util.List;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
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;
public class Needle implements UDrawable {
@@ -106,7 +106,7 @@ public class Needle implements UDrawable {
final UDrawable n1 = needle0.addChildren(root.getChildren());
return new UDrawable() {
public void drawU(UGraphic ug) {
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
+ ug = ug.apply(new UChangeColor(HColorUtils.BLACK));
n1.drawU(ug);
}
};
diff --git a/src/net/sourceforge/plantuml/jungle/PSystemTree.java b/src/net/sourceforge/plantuml/jungle/PSystemTree.java
index 2ecba4262..aca8e052e 100644
--- a/src/net/sourceforge/plantuml/jungle/PSystemTree.java
+++ b/src/net/sourceforge/plantuml/jungle/PSystemTree.java
@@ -45,12 +45,12 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.graphic.UDrawableUtils;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.LimitFinder;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class PSystemTree extends AbstractPSystem {
@@ -65,7 +65,7 @@ public class PSystemTree extends AbstractPSystem {
@Override
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
throws IOException {
- final ImageBuilder builder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.WHITE, null, null,
+ final ImageBuilder builder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HColorUtils.WHITE, null, null,
5, 5, null, false);
if (rendering == Rendering.NEEDLE) {
final UDrawable tmp = Needle.getNeedle(root, 200, 0, 60);
diff --git a/src/net/sourceforge/plantuml/logo/PSystemLogo.java b/src/net/sourceforge/plantuml/logo/PSystemLogo.java
index d275bf7a4..996d288f9 100644
--- a/src/net/sourceforge/plantuml/logo/PSystemLogo.java
+++ b/src/net/sourceforge/plantuml/logo/PSystemLogo.java
@@ -49,8 +49,8 @@ import net.sourceforge.plantuml.api.ImageDataSimple;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.png.PngIO;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d;
public class PSystemLogo extends AbstractPSystem {
diff --git a/src/net/sourceforge/plantuml/logo/TinyJavaLogo.java b/src/net/sourceforge/plantuml/logo/TinyJavaLogo.java
index 389b52486..d68402f8d 100644
--- a/src/net/sourceforge/plantuml/logo/TinyJavaLogo.java
+++ b/src/net/sourceforge/plantuml/logo/TinyJavaLogo.java
@@ -38,8 +38,8 @@ package net.sourceforge.plantuml.logo;
import java.util.HashMap;
import java.util.Map;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class TinyJavaLogo {
private final LogoScanner scanner = new LogoScanner();
@@ -47,7 +47,7 @@ public class TinyJavaLogo {
private final TurtleGraphicsPane turtleGraphicsPane;
private final Map dictionary = new HashMap();
- private HtmlColor penColor;
+ private HColor penColor;
public TinyJavaLogo(TurtleGraphicsPane turtleGraphicsPane) {
this.turtleGraphicsPane = turtleGraphicsPane;
@@ -191,7 +191,7 @@ public class TinyJavaLogo {
case LogoToken.SETPC:
token = scanner.getToken();
- final HtmlColor newPenColor = new HtmlColorSetSimple().getColorIfValid(token.lexeme);
+ final HColor newPenColor = HColorSet.instance().getColorIfValid(token.lexeme);
if (newPenColor == null) {
error("Unrecognized color name");
return;
diff --git a/src/net/sourceforge/plantuml/logo/TurtleGraphicsPane.java b/src/net/sourceforge/plantuml/logo/TurtleGraphicsPane.java
index 6510bdcf9..9b3ab1069 100644
--- a/src/net/sourceforge/plantuml/logo/TurtleGraphicsPane.java
+++ b/src/net/sourceforge/plantuml/logo/TurtleGraphicsPane.java
@@ -45,10 +45,6 @@ import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.graphic.IHtmlColorSet;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -57,6 +53,9 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
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;
class TurtleGraphicsPane {
final private double width;
@@ -66,9 +65,9 @@ class TurtleGraphicsPane {
private double turtleDirection = 90;
private boolean penIsDown = true;
private boolean showTurtle = true;
- private HtmlColor penColor = HtmlColorUtils.BLACK;
+ private HColor penColor = HColorUtils.BLACK;
private List lines = new ArrayList();
- private List colors = new ArrayList();
+ private List colors = new ArrayList();
private String message;
@@ -121,9 +120,9 @@ class TurtleGraphicsPane {
final double angle = -dtor(turtleDirection - 90);
poly.rotate(angle);
// ug.setAntiAliasing(false);
- final IHtmlColorSet htmlColorSet = new HtmlColorSetSimple();
- final HtmlColor turtleColor1 = htmlColorSet.getColorIfValid("OliveDrab");
- final HtmlColor turtleColor2 = htmlColorSet.getColorIfValid("MediumSpringGreen");
+ final HColorSet htmlColorSet = HColorSet.instance();
+ final HColor turtleColor1 = htmlColorSet.getColorIfValid("OliveDrab");
+ final HColor turtleColor2 = htmlColorSet.getColorIfValid("MediumSpringGreen");
ug.apply(new UChangeColor(turtleColor1)).apply(new UChangeBackColor(turtleColor2)).apply(new UTranslate(x, -y))
.draw(poly);
@@ -138,7 +137,7 @@ class TurtleGraphicsPane {
showTurtle = false;
}
- public void setPenColor(HtmlColor newPenColor) {
+ public void setPenColor(HColor newPenColor) {
penColor = newPenColor;
}
@@ -191,7 +190,7 @@ class TurtleGraphicsPane {
int n = lines.size();
for (int i = 0; i < n; i++) {
- final HtmlColor color = colors.get(i);
+ final HColor color = colors.get(i);
final Rectangle2D.Double r = lines.get(i);
final ULine line = new ULine(r.width - r.x, -r.height + r.y);
ug.apply(new UChangeColor(color)).apply(new UTranslate(r.x, -r.y)).draw(line);
@@ -204,7 +203,7 @@ class TurtleGraphicsPane {
new SpriteContainerEmpty());
final Dimension2D dim = text.calculateDimension(ug.getStringBounder());
final double textHeight = dim.getHeight();
- text.drawU(ug.apply(new UTranslate(0, (height - textHeight))));
+ text.drawU(ug.apply(UTranslate.dy((height - textHeight))));
}
}
diff --git a/src/net/sourceforge/plantuml/math/PSystemMath.java b/src/net/sourceforge/plantuml/math/PSystemMath.java
index 8419111e7..caed05628 100644
--- a/src/net/sourceforge/plantuml/math/PSystemMath.java
+++ b/src/net/sourceforge/plantuml/math/PSystemMath.java
@@ -44,9 +44,9 @@ import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class PSystemMath extends AbstractPSystem {
@@ -110,7 +110,7 @@ public class PSystemMath extends AbstractPSystem {
}
private Color getColor(final String col) {
- final HtmlColor col2 = new HtmlColorSetSimple().getColorIfValid(col);
+ final HColor col2 = HColorSet.instance().getColorIfValid(col);
final Color col3 = new ColorMapperIdentity().getMappedColor(col2);
return col3;
}
diff --git a/src/net/sourceforge/plantuml/math/ScientificEquationSafe.java b/src/net/sourceforge/plantuml/math/ScientificEquationSafe.java
index 5c803017a..8078528df 100644
--- a/src/net/sourceforge/plantuml/math/ScientificEquationSafe.java
+++ b/src/net/sourceforge/plantuml/math/ScientificEquationSafe.java
@@ -54,8 +54,8 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.eps.EpsGraphics;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
public class ScientificEquationSafe {
@@ -126,7 +126,7 @@ public class ScientificEquationSafe {
private void printTrace(Exception e) {
System.err.println("formula=" + formula);
- if (formula != null) {
+ if (equation != null) {
System.err.println("Latex=" + equation.getSource());
}
e.printStackTrace();
diff --git a/src/net/sourceforge/plantuml/mindmap/CommandMindMapOrgmode.java b/src/net/sourceforge/plantuml/mindmap/CommandMindMapOrgmode.java
index 0b10a0527..d92641aba 100644
--- a/src/net/sourceforge/plantuml/mindmap/CommandMindMapOrgmode.java
+++ b/src/net/sourceforge/plantuml/mindmap/CommandMindMapOrgmode.java
@@ -44,7 +44,7 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandMindMapOrgmode extends SingleLineCommand2 {
@@ -66,7 +66,7 @@ public class CommandMindMapOrgmode extends SingleLineCommand2 {
final String type = arg.get("TYPE", 0);
final String label = arg.get("LABEL", 0);
final String stringColor = arg.get("BACKCOLOR", 0);
- HtmlColor backColor = null;
+ HColor backColor = null;
if (stringColor != null) {
backColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(stringColor);
}
diff --git a/src/net/sourceforge/plantuml/mindmap/CommandMindMapOrgmodeMultiline.java b/src/net/sourceforge/plantuml/mindmap/CommandMindMapOrgmodeMultiline.java
index b0df57678..c05a2d646 100644
--- a/src/net/sourceforge/plantuml/mindmap/CommandMindMapOrgmodeMultiline.java
+++ b/src/net/sourceforge/plantuml/mindmap/CommandMindMapOrgmodeMultiline.java
@@ -45,7 +45,7 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandMindMapOrgmodeMultiline extends CommandMultilines2 {
@@ -73,7 +73,7 @@ public class CommandMindMapOrgmodeMultiline extends CommandMultilines2 children = new ArrayList();
private final IdeaShape shape;
- private final HtmlColor backColor;
+ private final HColor backColor;
private final StyleBuilder styleBuilder;
private final String stereotype;
- public Idea(StyleBuilder styleBuilder, HtmlColor backColor, Display label, IdeaShape shape, String stereotype) {
+ public Idea(StyleBuilder styleBuilder, HColor backColor, Display label, IdeaShape shape, String stereotype) {
this(styleBuilder, backColor, 0, null, label, shape, stereotype);
}
- public Idea createIdea(StyleBuilder styleBuilder, HtmlColor backColor, int newLevel, Display newDisplay,
+ public Idea createIdea(StyleBuilder styleBuilder, HColor backColor, int newLevel, Display newDisplay,
IdeaShape newShape, String stereotype) {
final Idea result = new Idea(styleBuilder, backColor, newLevel, this, newDisplay, newShape, stereotype);
this.children.add(result);
return result;
}
- private Idea(StyleBuilder styleBuilder, HtmlColor backColor, int level, Idea parent, Display label,
+ private Idea(StyleBuilder styleBuilder, HColor backColor, int level, Idea parent, Display label,
IdeaShape shape, String stereotype) {
this.backColor = backColor;
this.styleBuilder = styleBuilder;
@@ -106,7 +106,7 @@ class Idea {
return shape;
}
- public final HtmlColor getBackColor() {
+ public final HColor getBackColor() {
return backColor;
}
diff --git a/src/net/sourceforge/plantuml/mindmap/MindMapDiagram.java b/src/net/sourceforge/plantuml/mindmap/MindMapDiagram.java
index 5c12e5456..c6472f20d 100644
--- a/src/net/sourceforge/plantuml/mindmap/MindMapDiagram.java
+++ b/src/net/sourceforge/plantuml/mindmap/MindMapDiagram.java
@@ -53,7 +53,6 @@ import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -63,6 +62,7 @@ import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.wbs.WBSDiagram;
public class MindMapDiagram extends UmlDiagram {
@@ -134,7 +134,7 @@ public class MindMapDiagram extends UmlDiagram {
throw new UnsupportedOperationException();
}
- public HtmlColor getBackcolor() {
+ public HColor getBackcolor() {
return null;
}
};
@@ -175,11 +175,11 @@ public class MindMapDiagram extends UmlDiagram {
}
}
- public CommandExecutionResult addIdea(HtmlColor backColor, int level, Display label, IdeaShape shape) {
+ public CommandExecutionResult addIdea(HColor backColor, int level, Display label, IdeaShape shape) {
return addIdea(backColor, level, label, shape, defaultDirection);
}
- public CommandExecutionResult addIdea(HtmlColor backColor, int level, Display label, IdeaShape shape,
+ public CommandExecutionResult addIdea(HColor backColor, int level, Display label, IdeaShape shape,
Direction direction) {
String stereotype = label.getEndingStereotype();
if (stereotype != null) {
@@ -205,7 +205,7 @@ public class MindMapDiagram extends UmlDiagram {
private Idea last;
private Finger finger;
- private void initRoot(StyleBuilder styleBuilder, HtmlColor backColor, Display label, IdeaShape shape, String stereotype) {
+ private void initRoot(StyleBuilder styleBuilder, HColor backColor, Display label, IdeaShape shape, String stereotype) {
root = new Idea(styleBuilder, backColor, label, shape, stereotype);
last = root;
}
@@ -218,7 +218,7 @@ public class MindMapDiagram extends UmlDiagram {
return result;
}
- private CommandExecutionResult add(StyleBuilder styleBuilder, HtmlColor backColor, int level, Display label,
+ private CommandExecutionResult add(StyleBuilder styleBuilder, HColor backColor, int level, Display label,
IdeaShape shape, String stereotype) {
if (last == null) {
return CommandExecutionResult.error("Check your indentation ?");
diff --git a/src/net/sourceforge/plantuml/nwdiag/DiagElement.java b/src/net/sourceforge/plantuml/nwdiag/DiagElement.java
index d140ff2cd..ffc5079cc 100644
--- a/src/net/sourceforge/plantuml/nwdiag/DiagElement.java
+++ b/src/net/sourceforge/plantuml/nwdiag/DiagElement.java
@@ -39,13 +39,13 @@ import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.skin.ActorStyle;
import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class DiagElement {
@@ -79,7 +79,7 @@ public class DiagElement {
private FontConfiguration getFontConfiguration() {
final UFont font = UFont.serif(11);
- return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
+ return new FontConfiguration(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
}
public LinkedElement asTextBlock(final String adress1, final String adress2) {
diff --git a/src/net/sourceforge/plantuml/nwdiag/DiagGroup.java b/src/net/sourceforge/plantuml/nwdiag/DiagGroup.java
index 419b9ab2c..2845654ba 100644
--- a/src/net/sourceforge/plantuml/nwdiag/DiagGroup.java
+++ b/src/net/sourceforge/plantuml/nwdiag/DiagGroup.java
@@ -37,14 +37,14 @@ package net.sourceforge.plantuml.nwdiag;
import java.util.HashSet;
import java.util.Set;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class DiagGroup {
private final String name;
private final Network network;
private final Set elements = new HashSet();
- private HtmlColor color;
+ private HColor color;
@Override
public String toString() {
@@ -71,11 +71,11 @@ public class DiagGroup {
return elements.contains(tested.getElement().getName());
}
- public final HtmlColor getColor() {
+ public final HColor getColor() {
return color;
}
- public final void setColor(HtmlColor color) {
+ public final void setColor(HColor color) {
this.color = color;
}
diff --git a/src/net/sourceforge/plantuml/nwdiag/GridTextBlockDecorated.java b/src/net/sourceforge/plantuml/nwdiag/GridTextBlockDecorated.java
index d7936f80f..67b481f4b 100644
--- a/src/net/sourceforge/plantuml/nwdiag/GridTextBlockDecorated.java
+++ b/src/net/sourceforge/plantuml/nwdiag/GridTextBlockDecorated.java
@@ -36,18 +36,18 @@ package net.sourceforge.plantuml.nwdiag;
import java.util.Collection;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
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.HColorSet;
public class GridTextBlockDecorated extends GridTextBlockSimple {
- public static final HtmlColorSetSimple colors = new HtmlColorSetSimple();
+ public static final HColorSet colors = HColorSet.instance();
public static final int NETWORK_THIN = 5;
@@ -87,7 +87,7 @@ public class GridTextBlockDecorated extends GridTextBlockSimple {
y += lineHeight;
}
if (size != null) {
- HtmlColor color = group.getColor();
+ HColor color = group.getColor();
if (color == null) {
color = colors.getColorIfValid("#AAA");
}
diff --git a/src/net/sourceforge/plantuml/nwdiag/LinkedElement.java b/src/net/sourceforge/plantuml/nwdiag/LinkedElement.java
index f0388b63f..1964ea494 100644
--- a/src/net/sourceforge/plantuml/nwdiag/LinkedElement.java
+++ b/src/net/sourceforge/plantuml/nwdiag/LinkedElement.java
@@ -38,7 +38,6 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.MinMax;
@@ -46,6 +45,7 @@ import net.sourceforge.plantuml.ugraphic.UChangeColor;
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.utils.MathUtils;
public class LinkedElement {
@@ -90,7 +90,7 @@ public class LinkedElement {
drawCenter(ug, box, xMiddle, yMiddle);
- final HtmlColor color = ColorParam.activityBorder.getDefaultValue();
+ final HColor color = ColorParam.activityBorder.getDefaultValue();
ug = ug.apply(new UChangeColor(color));
drawHLine(ug, xMiddle, GridTextBlockDecorated.NETWORK_THIN, y1);
if (ad2 != null) {
@@ -110,7 +110,7 @@ public class LinkedElement {
}
private void drawHLine(UGraphic ug, double x, double y1, double y2) {
- final ULine line = new ULine(0, y2 - y1);
+ final ULine line = ULine.vline(y2 - y1);
ug.apply(new UTranslate(x, y1)).draw(line);
}
diff --git a/src/net/sourceforge/plantuml/nwdiag/Network.java b/src/net/sourceforge/plantuml/nwdiag/Network.java
index 46097c328..bc430f197 100644
--- a/src/net/sourceforge/plantuml/nwdiag/Network.java
+++ b/src/net/sourceforge/plantuml/nwdiag/Network.java
@@ -37,13 +37,13 @@ package net.sourceforge.plantuml.nwdiag;
import java.util.LinkedHashMap;
import java.util.Map;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class Network {
private final String name;
private final Map localElements = new LinkedHashMap();
- private HtmlColor color;
+ private HColor color;
private String ownAdress;
@@ -92,11 +92,11 @@ public class Network {
return name;
}
- public final HtmlColor getColor() {
+ public final HColor getColor() {
return color;
}
- public final void setColor(HtmlColor color) {
+ public final void setColor(HColor color) {
this.color = color;
}
diff --git a/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java b/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java
index 745589350..e23decd1a 100644
--- a/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java
+++ b/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java
@@ -57,12 +57,9 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.UDrawable;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -70,6 +67,9 @@ import net.sourceforge.plantuml.ugraphic.UEmpty;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class NwDiagram extends UmlDiagram {
@@ -204,7 +204,7 @@ public class NwDiagram extends UmlDiagram {
private FontConfiguration getFontConfiguration() {
final UFont font = UFont.serif(11);
- return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
+ return new FontConfiguration(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
}
private void drawMe(UGraphic ug) {
@@ -271,7 +271,7 @@ public class NwDiagram extends UmlDiagram {
currentNetwork().setOwnAdress(value);
}
if ("color".equalsIgnoreCase(property)) {
- final HtmlColor color = GridTextBlockDecorated.colors.getColorIfValid(value);
+ final HColor color = GridTextBlockDecorated.colors.getColorIfValid(value);
if (currentGroup != null) {
currentGroup.setColor(color);
} else if (currentNetwork() != null) {
diff --git a/src/net/sourceforge/plantuml/openiconic/OpenIcon.java b/src/net/sourceforge/plantuml/openiconic/OpenIcon.java
index f0ffd74ad..8c65b8a57 100644
--- a/src/net/sourceforge/plantuml/openiconic/OpenIcon.java
+++ b/src/net/sourceforge/plantuml/openiconic/OpenIcon.java
@@ -47,12 +47,12 @@ import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.openiconic.data.DummyIcon;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class OpenIcon {
@@ -132,7 +132,7 @@ public class OpenIcon {
return s.substring(x1 + 1, x2);
}
- public TextBlock asTextBlock(final HtmlColor color, final double factor) {
+ public TextBlock asTextBlock(final HColor color, final double factor) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
svgPath.drawMe(ug.apply(new UChangeColor(color)), factor);
diff --git a/src/net/sourceforge/plantuml/openiconic/PSystemListOpenIconic.java b/src/net/sourceforge/plantuml/openiconic/PSystemListOpenIconic.java
index a1d49d590..6ed55cd6c 100644
--- a/src/net/sourceforge/plantuml/openiconic/PSystemListOpenIconic.java
+++ b/src/net/sourceforge/plantuml/openiconic/PSystemListOpenIconic.java
@@ -48,14 +48,14 @@ import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.donors.PSystemDonors;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockHorizontal;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.openiconic.data.DummyIcon;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class PSystemListOpenIconic extends AbstractPSystem {
@@ -63,7 +63,7 @@ public class PSystemListOpenIconic extends AbstractPSystem {
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
throws IOException {
final UDrawable result = getGraphicStrings();
- final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.WHITE,
+ final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HColorUtils.WHITE,
fileFormat.isWithMetadata() ? getMetadata() : null, null, 0, 0, null, false);
imageBuilder.setUDrawable(result);
return imageBuilder.writeImageTOBEMOVED(fileFormat, seed, os);
diff --git a/src/net/sourceforge/plantuml/openiconic/PSystemOpenIconic.java b/src/net/sourceforge/plantuml/openiconic/PSystemOpenIconic.java
index a45a88176..a2dadef38 100644
--- a/src/net/sourceforge/plantuml/openiconic/PSystemOpenIconic.java
+++ b/src/net/sourceforge/plantuml/openiconic/PSystemOpenIconic.java
@@ -42,9 +42,9 @@ import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class PSystemOpenIconic extends AbstractPSystem {
@@ -64,7 +64,7 @@ public class PSystemOpenIconic extends AbstractPSystem {
final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, null, null, null, 5, 5,
null, false);
- imageBuilder.setUDrawable(icon.asTextBlock(HtmlColorUtils.BLACK, factor));
+ imageBuilder.setUDrawable(icon.asTextBlock(HColorUtils.BLACK, factor));
return imageBuilder.writeImageTOBEMOVED(fileFormat, seed, os);
// UGraphic2 ug = fileFormat.createUGraphic(dim);
diff --git a/src/net/sourceforge/plantuml/oregon/PSystemOregon.java b/src/net/sourceforge/plantuml/oregon/PSystemOregon.java
index 754019716..292adb510 100644
--- a/src/net/sourceforge/plantuml/oregon/PSystemOregon.java
+++ b/src/net/sourceforge/plantuml/oregon/PSystemOregon.java
@@ -47,8 +47,8 @@ import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
public class PSystemOregon extends AbstractPSystem {
diff --git a/src/net/sourceforge/plantuml/png/PngTitler.java b/src/net/sourceforge/plantuml/png/PngTitler.java
index 54ef49791..1f946ea76 100644
--- a/src/net/sourceforge/plantuml/png/PngTitler.java
+++ b/src/net/sourceforge/plantuml/png/PngTitler.java
@@ -45,28 +45,28 @@ import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.DisplaySection;
import net.sourceforge.plantuml.graphic.FontConfiguration;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.IHtmlColorSet;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
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.HColorSet;
public class PngTitler {
- private final HtmlColor textColor;
- private final HtmlColor hyperlinkColor;
+ private final HColor textColor;
+ private final HColor hyperlinkColor;
private final DisplaySection text;
private final int fontSize;
private final String fontFamily;
private final boolean useUnderlineForHyperlink;
private final Style style;
- private final IHtmlColorSet set;
+ private final HColorSet set;
private final ISkinSimple spriteContainer;
- public PngTitler(HtmlColor textColor, DisplaySection text, int fontSize, String fontFamily,
- HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, Style style, IHtmlColorSet set,
+ public PngTitler(HColor textColor, DisplaySection text, int fontSize, String fontFamily,
+ HColor hyperlinkColor, boolean useUnderlineForHyperlink, Style style, HColorSet set,
ISkinSimple spriteContainer) {
this.style = style;
this.set = set;
diff --git a/src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java b/src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java
index 4230c5045..546a6769a 100644
--- a/src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java
+++ b/src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java
@@ -41,10 +41,10 @@ import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.cucadiagram.IEntity;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
abstract class AbstractEntityImage2 implements IEntityImageBlock {
@@ -71,11 +71,11 @@ abstract class AbstractEntityImage2 implements IEntityImageBlock {
return skinParam.getFont(null, false, fontParam);
}
- protected HtmlColor getFontColor(FontParam fontParam) {
+ protected HColor getFontColor(FontParam fontParam) {
return skinParam.getFontHtmlColor(null, fontParam);
}
- protected final HtmlColor getColor(ColorParam colorParam) {
+ protected final HColor getColor(ColorParam colorParam) {
return rose.getHtmlColor(skinParam, colorParam);
}
diff --git a/src/net/sourceforge/plantuml/posimo/Frame.java b/src/net/sourceforge/plantuml/posimo/Frame.java
index 4ad680a70..6c9a7f6ca 100644
--- a/src/net/sourceforge/plantuml/posimo/Frame.java
+++ b/src/net/sourceforge/plantuml/posimo/Frame.java
@@ -42,7 +42,6 @@ import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.Area;
@@ -59,6 +58,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.HColor;
public class Frame implements Component {
@@ -82,7 +82,7 @@ public class Frame implements Component {
public void drawU(UGraphic ug, Area area, Context2D context) {
final Dimension2D dimensionToUse = area.getDimensionToUse();
- final HtmlColor lineColor = rose.getHtmlColor(skinParam, ColorParam.packageBorder);
+ final HColor lineColor = rose.getHtmlColor(skinParam, ColorParam.packageBorder);
ug = ug.apply(new UChangeColor(lineColor));
ug = ug.apply(new UChangeBackColor(null));
ug.apply(new UStroke(1.4)).draw(new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight()));
@@ -120,7 +120,7 @@ public class Frame implements Component {
private TextBlock createTextBloc() {
final UFont font = skinParam.getFont(null, false, FontParam.PACKAGE);
- final HtmlColor textColor = skinParam.getFontHtmlColor(null, FontParam.PACKAGE);
+ final HColor textColor = skinParam.getFontHtmlColor(null, FontParam.PACKAGE);
// final TextBlock bloc = Display.create(name).create(new FontConfiguration(font, textColor,
// skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink()), HorizontalAlignment.LEFT, new
// SpriteContainerEmpty());
diff --git a/src/net/sourceforge/plantuml/postit/PostIt.java b/src/net/sourceforge/plantuml/postit/PostIt.java
index e1abd32fd..1f3e81b69 100644
--- a/src/net/sourceforge/plantuml/postit/PostIt.java
+++ b/src/net/sourceforge/plantuml/postit/PostIt.java
@@ -44,9 +44,6 @@ import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.skin.Area;
@@ -56,6 +53,9 @@ import net.sourceforge.plantuml.skin.rose.ComponentRoseNote;
import net.sourceforge.plantuml.ugraphic.UFont;
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.HColorSet;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class PostIt {
@@ -110,12 +110,12 @@ public class PostIt {
}
private Component getComponent() {
- final HtmlColor noteBackgroundColor = new HtmlColorSetSimple().getColorIfValid("#FBFB77");
- final HtmlColor borderColor = HtmlColorUtils.MY_RED;
+ final HColor noteBackgroundColor = HColorSet.instance().getColorIfValid("#FBFB77");
+ final HColor borderColor = HColorUtils.MY_RED;
final SkinParam param = SkinParam.noShadowing(null);
final UFont fontNote = param.getFont(null, false, FontParam.NOTE);
- final FontConfiguration font2 = fontNote.toFont2(HtmlColorUtils.BLACK, true, HtmlColorUtils.BLUE, 8);
+ final FontConfiguration font2 = fontNote.toFont2(HColorUtils.BLACK, true, HColorUtils.BLUE, 8);
final ComponentRoseNote note = new ComponentRoseNote(
null, new SymbolContext(noteBackgroundColor, borderColor).withStroke(new UStroke()), font2, text, 0,
0, new SpriteContainerEmpty(), 0, HorizontalAlignment.LEFT);
diff --git a/src/net/sourceforge/plantuml/postit/PostItDiagram.java b/src/net/sourceforge/plantuml/postit/PostItDiagram.java
index 7c047fd64..fcfc9e343 100644
--- a/src/net/sourceforge/plantuml/postit/PostItDiagram.java
+++ b/src/net/sourceforge/plantuml/postit/PostItDiagram.java
@@ -53,8 +53,8 @@ import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.png.PngIO;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.eps.UGraphicEps;
import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d;
import net.sourceforge.plantuml.ugraphic.svg.UGraphicSvg;
diff --git a/src/net/sourceforge/plantuml/preproc/ReadLineNumbered.java b/src/net/sourceforge/plantuml/preproc/ReadLineNumbered.java
index 1d71937bb..c85ebc784 100644
--- a/src/net/sourceforge/plantuml/preproc/ReadLineNumbered.java
+++ b/src/net/sourceforge/plantuml/preproc/ReadLineNumbered.java
@@ -35,9 +35,7 @@
*/
package net.sourceforge.plantuml.preproc;
-import java.util.Set;
-
public interface ReadLineNumbered extends ReadLine {
- public Set getFilesUsed();
+ // public Set getFilesUsedTOBEREMOVED();
}
diff --git a/src/net/sourceforge/plantuml/preproc2/Preprocessor.java b/src/net/sourceforge/plantuml/preproc2/Preprocessor.java
index cc8b30a34..a81ff1c5f 100644
--- a/src/net/sourceforge/plantuml/preproc2/Preprocessor.java
+++ b/src/net/sourceforge/plantuml/preproc2/Preprocessor.java
@@ -65,9 +65,9 @@ public class Preprocessor implements ReadLineNumbered {
this.source.close();
}
- public Set getFilesUsed() {
- // System.err.println("************************** WARNING **************************");
- return Collections.emptySet();
- // return Collections.unmodifiableSet(include.getFilesUsedGlobal());
- }
+// public Set getFilesUsedTOBEREMOVED() {
+// // System.err.println("************************** WARNING **************************");
+// return Collections.emptySet();
+// // return Collections.unmodifiableSet(include.getFilesUsedGlobal());
+// }
}
\ No newline at end of file
diff --git a/src/net/sourceforge/plantuml/project/ConstantPlan.java b/src/net/sourceforge/plantuml/project/ConstantPlan.java
index 0703b2efb..2e7326264 100644
--- a/src/net/sourceforge/plantuml/project/ConstantPlan.java
+++ b/src/net/sourceforge/plantuml/project/ConstantPlan.java
@@ -35,7 +35,7 @@
*/
package net.sourceforge.plantuml.project;
-import net.sourceforge.plantuml.project.core.Wink;
+import net.sourceforge.plantuml.project.time.Wink;
public class ConstantPlan implements LoadPlanable {
diff --git a/src/net/sourceforge/plantuml/project/DaysAsDates.java b/src/net/sourceforge/plantuml/project/DaysAsDates.java
index 612b68c1e..3828f377d 100644
--- a/src/net/sourceforge/plantuml/project/DaysAsDates.java
+++ b/src/net/sourceforge/plantuml/project/DaysAsDates.java
@@ -39,20 +39,21 @@ import java.util.Iterator;
import net.sourceforge.plantuml.project.lang.Complement;
import net.sourceforge.plantuml.project.lang.Subject;
+import net.sourceforge.plantuml.project.time.Day;
-public class DaysAsDates implements Subject, Complement, Iterable {
+public class DaysAsDates implements Subject, Complement, Iterable {
- private final DayAsDate date1;
- private final DayAsDate date2;
+ private final Day date1;
+ private final Day date2;
- public DaysAsDates(DayAsDate date1, DayAsDate date2) {
+ public DaysAsDates(Day date1, Day date2) {
this.date1 = date1;
this.date2 = date2;
}
- public DaysAsDates(GanttDiagram gantt, DayAsDate date1, int count) {
+ public DaysAsDates(GanttDiagram gantt, Day date1, int count) {
this.date1 = date1;
- DayAsDate tmp = date1;
+ Day tmp = date1;
while (count > 0) {
if (gantt.isOpen(tmp)) {
count--;
@@ -62,11 +63,11 @@ public class DaysAsDates implements Subject, Complement, Iterable {
this.date2 = tmp;
}
- class MyIterator implements Iterator {
+ class MyIterator implements Iterator {
- private DayAsDate current;
+ private Day current;
- public MyIterator(DayAsDate current) {
+ public MyIterator(Day current) {
this.current = current;
}
@@ -74,8 +75,8 @@ public class DaysAsDates implements Subject, Complement, Iterable {
return current.compareTo(date2) <= 0;
}
- public DayAsDate next() {
- final DayAsDate result = current;
+ public Day next() {
+ final Day result = current;
current = current.next();
return result;
}
@@ -86,7 +87,7 @@ public class DaysAsDates implements Subject, Complement, Iterable {
}
- public Iterator iterator() {
+ public Iterator iterator() {
return new MyIterator(date1);
}
diff --git a/src/net/sourceforge/plantuml/project/GanttArrow.java b/src/net/sourceforge/plantuml/project/GanttArrow.java
index e5390b1c3..a2654d9b7 100644
--- a/src/net/sourceforge/plantuml/project/GanttArrow.java
+++ b/src/net/sourceforge/plantuml/project/GanttArrow.java
@@ -36,12 +36,10 @@
package net.sourceforge.plantuml.project;
import net.sourceforge.plantuml.Direction;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.project.core.Task;
import net.sourceforge.plantuml.project.core.TaskAttribute;
import net.sourceforge.plantuml.project.core.TaskInstant;
-import net.sourceforge.plantuml.project.draw.TaskDraw;
import net.sourceforge.plantuml.project.timescale.TimeScale;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -49,6 +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;
public class GanttArrow implements UDrawable {
@@ -81,11 +80,11 @@ public class GanttArrow implements UDrawable {
}
public void drawU(UGraphic ug) {
- ug = ug.apply(new UChangeBackColor(HtmlColorUtils.RED_DARK)).apply(new UChangeColor(HtmlColorUtils.RED_DARK))
+ ug = ug.apply(new UChangeBackColor(HColorUtils.RED_DARK)).apply(new UChangeColor(HColorUtils.RED_DARK))
.apply(new UStroke(1.5));
- final TaskDraw draw1 = ((Task) source.getMoment()).getTaskDraw();
- final TaskDraw draw2 = ((Task) dest.getMoment()).getTaskDraw();
+ final Task draw1 = (Task) source.getMoment();
+ final Task draw2 = (Task) dest.getMoment();
double x1 = getX(source.withDelta(0), atStart);
double y1 = draw1.getY(atStart);
diff --git a/src/net/sourceforge/plantuml/project/GanttConstraint.java b/src/net/sourceforge/plantuml/project/GanttConstraint.java
index 19c1566a0..5b094221b 100644
--- a/src/net/sourceforge/plantuml/project/GanttConstraint.java
+++ b/src/net/sourceforge/plantuml/project/GanttConstraint.java
@@ -38,6 +38,7 @@ package net.sourceforge.plantuml.project;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.project.core.TaskInstant;
import net.sourceforge.plantuml.project.lang.Complement;
+import net.sourceforge.plantuml.project.time.Wink;
import net.sourceforge.plantuml.project.timescale.TimeScale;
public class GanttConstraint implements Complement {
@@ -58,4 +59,24 @@ public class GanttConstraint implements Complement {
public UDrawable getUDrawable(final TimeScale timeScale) {
return new GanttArrow(timeScale, source, dest);
}
+
+ public boolean isHidden(Wink min, Wink max) {
+ if (isHidden(source.getInstantPrecise(), min, max)) {
+ return true;
+ }
+ if (isHidden(dest.getInstantPrecise(), min, max)) {
+ return true;
+ }
+ return false;
+ }
+
+ private boolean isHidden(Wink now, Wink min, Wink max) {
+ if (now.compareTo(min) < 0) {
+ return true;
+ }
+ if (now.compareTo(max) > 0) {
+ return true;
+ }
+ return false;
+ }
}
diff --git a/src/net/sourceforge/plantuml/project/GanttDiagram.java b/src/net/sourceforge/plantuml/project/GanttDiagram.java
index 6c6a66516..adc235108 100644
--- a/src/net/sourceforge/plantuml/project/GanttDiagram.java
+++ b/src/net/sourceforge/plantuml/project/GanttDiagram.java
@@ -60,10 +60,6 @@ import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
-import net.sourceforge.plantuml.graphic.IHtmlColorSet;
import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
@@ -77,49 +73,57 @@ import net.sourceforge.plantuml.project.core.TaskCode;
import net.sourceforge.plantuml.project.core.TaskImpl;
import net.sourceforge.plantuml.project.core.TaskInstant;
import net.sourceforge.plantuml.project.core.TaskSeparator;
-import net.sourceforge.plantuml.project.core.Wink;
import net.sourceforge.plantuml.project.draw.ResourceDraw;
import net.sourceforge.plantuml.project.draw.TaskDraw;
+import net.sourceforge.plantuml.project.draw.TaskDrawDiamond;
import net.sourceforge.plantuml.project.draw.TaskDrawRegular;
import net.sourceforge.plantuml.project.draw.TaskDrawSeparator;
import net.sourceforge.plantuml.project.draw.TimeHeader;
import net.sourceforge.plantuml.project.draw.TimeHeaderDaily;
+import net.sourceforge.plantuml.project.draw.TimeHeaderMonthly;
import net.sourceforge.plantuml.project.draw.TimeHeaderSimple;
import net.sourceforge.plantuml.project.draw.TimeHeaderWeekly;
import net.sourceforge.plantuml.project.lang.ComplementColors;
import net.sourceforge.plantuml.project.lang.Subject;
+import net.sourceforge.plantuml.project.time.Day;
+import net.sourceforge.plantuml.project.time.DayOfWeek;
+import net.sourceforge.plantuml.project.time.GCalendar;
+import net.sourceforge.plantuml.project.time.Wink;
import net.sourceforge.plantuml.project.timescale.TimeScale;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class GanttDiagram extends TitledDiagram implements Subject {
private final Map tasks = new LinkedHashMap();
private final Map byShortName = new HashMap();
private final List constraints = new ArrayList();
- private final IHtmlColorSet colorSet = new HtmlColorSetSimple();
+ private final HColorSet colorSet = HColorSet.instance();
private final Collection closedDayOfWeek = EnumSet.noneOf(DayOfWeek.class);
- private final Collection closedDayAsDate = new HashSet();
- private final Collection openedDayAsDate = new HashSet();
+ private final Collection closedDayAsDate = new HashSet();
+ private final Collection openedDayAsDate = new HashSet();
private final Map resources = new LinkedHashMap();
- private final Map colorDays = new HashMap();
- private final Map nameDays = new HashMap();
+ private final Map colorDays = new HashMap();
+ private final Map nameDays = new HashMap();
private PrintScale printScale = PrintScale.DAILY;
- private DayAsDate today;
+ private Day today;
private GCalendar calendar;
private double totalHeight;
private Wink min = new Wink(0);
private Wink max;
- private DayAsDate printStart;
- private DayAsDate printEnd;
+ private Day printStart;
+ private Day printEnd;
public DiagramDescription getDescription() {
return new DiagramDescription("(Project)");
@@ -176,6 +180,19 @@ public class GanttDiagram extends TitledDiagram implements Subject {
this.printScale = printScale;
}
+ private boolean isHidden(Task task) {
+ if (printStart == null) {
+ return false;
+ }
+ if (task.getEnd().compareTo(min) < 0) {
+ return true;
+ }
+ if (task.getStart().compareTo(max) > 0) {
+ return true;
+ }
+ return false;
+ }
+
private TextBlockBackcolored getTextBlock() {
if (printStart == null) {
initMinMax();
@@ -188,7 +205,10 @@ public class GanttDiagram extends TitledDiagram implements Subject {
timeHeader = new TimeHeaderSimple(min, max);
} else if (printScale == PrintScale.WEEKLY) {
timeHeader = new TimeHeaderWeekly(calendar, min, max, getDefaultPlan(), colorDays, nameDays);
+ } else if (printScale == PrintScale.MONTHLY) {
+ timeHeader = new TimeHeaderMonthly(calendar, min, max, getDefaultPlan(), colorDays, nameDays);
} else {
+// timeHeader = new TimeHeaderDaily(calendar, min, max, getDefaultPlan(), colorDays, nameDays, null, null);
timeHeader = new TimeHeaderDaily(calendar, min, max, getDefaultPlan(), colorDays, nameDays, printStart,
printEnd);
}
@@ -200,7 +220,8 @@ public class GanttDiagram extends TitledDiagram implements Subject {
drawConstraints(ug, timeHeader.getTimeScale());
drawTasksRect(ug);
drawTasksTitle(ug);
- drawResources(ug);
+ if (printStart == null)
+ drawResources(ug);
}
public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
@@ -217,7 +238,7 @@ public class GanttDiagram extends TitledDiagram implements Subject {
throw new UnsupportedOperationException();
}
- public HtmlColor getBackcolor() {
+ public HColor getBackcolor() {
return null;
}
};
@@ -225,22 +246,28 @@ public class GanttDiagram extends TitledDiagram implements Subject {
private void drawTasksRect(UGraphic ug) {
for (Task task : tasks.values()) {
- final TaskDraw draw = task.getTaskDraw();
- final UTranslate move = new UTranslate(0, draw.getY());
+ final TaskDraw draw = draws.get(task);
+ final UTranslate move = UTranslate.dy(draw.getY());
draw.drawU(ug.apply(move));
}
}
private void drawConstraints(final UGraphic ug, TimeScale timeScale) {
for (GanttConstraint constraint : constraints) {
+ if (printStart != null && constraint.isHidden(min, max)) {
+ continue;
+ }
constraint.getUDrawable(timeScale).drawU(ug);
}
}
private void drawTasksTitle(final UGraphic ug1) {
for (Task task : tasks.values()) {
- final TaskDraw draw = task.getTaskDraw();
- final UTranslate move = new UTranslate(0, draw.getY());
+ if (isHidden(task)) {
+ continue;
+ }
+ final TaskDraw draw = draws.get(task);
+ final UTranslate move = UTranslate.dy(draw.getY());
draw.drawTitle(ug1.apply(move));
}
}
@@ -248,7 +275,7 @@ public class GanttDiagram extends TitledDiagram implements Subject {
private void drawResources(UGraphic ug) {
for (Resource res : resources.values()) {
final ResourceDraw draw = res.getResourceDraw();
- final UTranslate move = new UTranslate(0, draw.getY());
+ final UTranslate move = UTranslate.dy(draw.getY());
draw.drawU(ug.apply(move));
}
}
@@ -259,7 +286,7 @@ public class GanttDiagram extends TitledDiagram implements Subject {
if (calendar == null) {
return 100;
}
- final DayAsDate day = calendar.toDayAsDate((Wink) instant);
+ final Day day = calendar.toDayAsDate((Wink) instant);
if (isClosed(day)) {
return 0;
}
@@ -268,7 +295,7 @@ public class GanttDiagram extends TitledDiagram implements Subject {
};
}
- private boolean isClosed(final DayAsDate day) {
+ private boolean isClosed(final Day day) {
if (openedDayAsDate.contains(day)) {
return false;
}
@@ -280,26 +307,40 @@ public class GanttDiagram extends TitledDiagram implements Subject {
closedDayOfWeek.add(day);
}
- public void closeDayAsDate(DayAsDate day) {
+ public void closeDayAsDate(Day day) {
closedDayAsDate.add(day);
}
- public void openDayAsDate(DayAsDate day) {
+ public void openDayAsDate(Day day) {
openedDayAsDate.add(day);
}
+ private final Map draws = new LinkedHashMap();
+
private void initTaskAndResourceDraws(TimeScale timeScale, double headerHeight) {
double y = headerHeight;
+ for (Task task : tasks.values()) {
+ task.setY(y);
+ y += task.getHeight();
+
+ }
for (Task task : tasks.values()) {
final TaskDraw draw;
if (task instanceof TaskSeparator) {
- draw = new TaskDrawSeparator((TaskSeparator) task, timeScale, y, min, max);
+ draw = new TaskDrawSeparator(((TaskSeparator) task).getName(), timeScale, task.getY(), min, max);
} else {
- draw = new TaskDrawRegular((TaskImpl) task, timeScale, y);
+ final TaskImpl tmp = (TaskImpl) task;
+ if (tmp.isDiamond()) {
+ draw = new TaskDrawDiamond(timeScale, task.getY(), tmp.getPrettyDisplay(), getStart(tmp));
+ } else {
+ final boolean oddStart = printStart != null && min.compareTo(getStart(tmp)) == 0;
+ final boolean oddEnd = printStart != null && max.compareTo(getEnd(tmp)) == 0;
+ draw = new TaskDrawRegular(timeScale, task.getY(), tmp.getPrettyDisplay(), getStart(tmp),
+ getEnd(tmp), oddStart, oddEnd);
+ }
+ draw.setColorsAndCompletion(tmp.getColors(), tmp.getCompletion(), tmp.getUrl());
}
- task.setTaskDraw(draw);
- y += draw.getHeight();
-
+ draws.put(task, draw);
}
for (Resource res : resources.values()) {
final ResourceDraw draw = new ResourceDraw(this, res, timeScale, y, min, max);
@@ -310,6 +351,20 @@ public class GanttDiagram extends TitledDiagram implements Subject {
this.totalHeight = y;
}
+ private Wink getStart(final TaskImpl tmp) {
+ if (printStart == null) {
+ return tmp.getStart();
+ }
+ return Wink.max(min, tmp.getStart());
+ }
+
+ private Wink getEnd(final TaskImpl tmp) {
+ if (printStart == null) {
+ return tmp.getEnd();
+ }
+ return Wink.min(max, tmp.getEnd());
+ }
+
private void initMinMax() {
if (tasks.size() == 0) {
max = min.increment();
@@ -330,13 +385,13 @@ public class GanttDiagram extends TitledDiagram implements Subject {
}
}
if (calendar != null) {
- for (DayAsDate d : colorDays.keySet()) {
+ for (Day d : colorDays.keySet()) {
final Wink instant = calendar.fromDayAsDate(d);
if (instant.compareTo(max) > 0) {
max = instant;
}
}
- for (DayAsDate d : nameDays.keySet()) {
+ for (Day d : nameDays.keySet()) {
final Wink instant = calendar.fromDayAsDate(d);
if (instant.compareTo(max) > 0) {
max = instant;
@@ -345,14 +400,14 @@ public class GanttDiagram extends TitledDiagram implements Subject {
}
}
- public DayAsDate getThenDate() {
- DayAsDate result = getStartingDate();
- for (DayAsDate d : colorDays.keySet()) {
+ public Day getThenDate() {
+ Day result = getStartingDate();
+ for (Day d : colorDays.keySet()) {
if (d.compareTo(result) > 0) {
result = d;
}
}
- for (DayAsDate d : nameDays.keySet()) {
+ for (Day d : nameDays.keySet()) {
if (d.compareTo(result) > 0) {
result = d;
}
@@ -428,22 +483,22 @@ public class GanttDiagram extends TitledDiagram implements Subject {
constraints.add(constraint);
}
- public IHtmlColorSet getIHtmlColorSet() {
+ public HColorSet getIHtmlColorSet() {
return colorSet;
}
- public void setStartingDate(DayAsDate start) {
+ public void setStartingDate(Day start) {
this.calendar = new GCalendar(start);
}
- public DayAsDate getStartingDate() {
+ public Day getStartingDate() {
if (this.calendar == null) {
return null;
}
return this.calendar.getStartingDate();
}
- public DayAsDate getStartingDate(int nday) {
+ public Day getStartingDate(int nday) {
if (this.calendar == null) {
return null;
}
@@ -454,11 +509,11 @@ public class GanttDiagram extends TitledDiagram implements Subject {
return 7 - closedDayOfWeek.size();
}
- public Wink convert(DayAsDate day) {
+ public Wink convert(Day day) {
return calendar.fromDayAsDate(day);
}
- public boolean isOpen(DayAsDate day) {
+ public boolean isOpen(Day day) {
return getDefaultPlan().getLoadAt(convert(day)) > 0;
}
@@ -500,9 +555,9 @@ public class GanttDiagram extends TitledDiagram implements Subject {
public Moment getExistingMoment(String id) {
Moment result = getExistingTask(id);
if (result == null) {
- DayAsDate start = null;
- DayAsDate end = null;
- for (Map.Entry ent : nameDays.entrySet()) {
+ Day start = null;
+ Day end = null;
+ for (Map.Entry ent : nameDays.entrySet()) {
if (ent.getValue().equalsIgnoreCase(id) == false) {
continue;
}
@@ -516,7 +571,7 @@ public class GanttDiagram extends TitledDiagram implements Subject {
return result;
}
- private DayAsDate min(DayAsDate d1, DayAsDate d2) {
+ private Day min(Day d1, Day d2) {
if (d1 == null) {
return d2;
}
@@ -526,7 +581,7 @@ public class GanttDiagram extends TitledDiagram implements Subject {
return d1;
}
- private DayAsDate max(DayAsDate d1, DayAsDate d2) {
+ private Day max(Day d1, Day d2) {
if (d1 == null) {
return d2;
}
@@ -536,32 +591,32 @@ public class GanttDiagram extends TitledDiagram implements Subject {
return d1;
}
- public void colorDay(DayAsDate day, HtmlColor color) {
+ public void colorDay(Day day, HColor color) {
colorDays.put(day, color);
}
- public void nameDay(DayAsDate day, String name) {
+ public void nameDay(Day day, String name) {
nameDays.put(day, name);
}
public void setTodayColors(ComplementColors colors) {
if (today == null) {
- this.today = DayAsDate.today();
+ this.today = Day.today();
}
colorDay(today, colors.getCenter());
}
- public CommandExecutionResult setToday(DayAsDate date) {
+ public CommandExecutionResult setToday(Day date) {
this.today = date;
return CommandExecutionResult.ok();
}
public CommandExecutionResult deleteTask(Task task) {
- task.setColors(new ComplementColors(HtmlColorUtils.WHITE, HtmlColorUtils.BLACK));
+ task.setColors(new ComplementColors(HColorUtils.WHITE, HColorUtils.BLACK));
return CommandExecutionResult.ok();
}
- public void setPrintInterval(DayAsDate start, DayAsDate end) {
+ public void setPrintInterval(Day start, Day end) {
this.printStart = start;
this.printEnd = end;
}
diff --git a/src/net/sourceforge/plantuml/project/LoadPlanable.java b/src/net/sourceforge/plantuml/project/LoadPlanable.java
index 15a909c7c..64d004759 100644
--- a/src/net/sourceforge/plantuml/project/LoadPlanable.java
+++ b/src/net/sourceforge/plantuml/project/LoadPlanable.java
@@ -35,7 +35,7 @@
*/
package net.sourceforge.plantuml.project;
-import net.sourceforge.plantuml.project.core.Wink;
+import net.sourceforge.plantuml.project.time.Wink;
public interface LoadPlanable {
diff --git a/src/net/sourceforge/plantuml/project/PlanUtils.java b/src/net/sourceforge/plantuml/project/PlanUtils.java
index 0d1ce7b18..9ad264ffa 100644
--- a/src/net/sourceforge/plantuml/project/PlanUtils.java
+++ b/src/net/sourceforge/plantuml/project/PlanUtils.java
@@ -35,7 +35,7 @@
*/
package net.sourceforge.plantuml.project;
-import net.sourceforge.plantuml.project.core.Wink;
+import net.sourceforge.plantuml.project.time.Wink;
public class PlanUtils {
diff --git a/src/net/sourceforge/plantuml/project/Solver3.java b/src/net/sourceforge/plantuml/project/Solver3.java
index 976ab40bd..530bf0ef7 100644
--- a/src/net/sourceforge/plantuml/project/Solver3.java
+++ b/src/net/sourceforge/plantuml/project/Solver3.java
@@ -41,7 +41,7 @@ import java.util.Map;
import java.util.Map.Entry;
import net.sourceforge.plantuml.project.core.TaskAttribute;
-import net.sourceforge.plantuml.project.core.Wink;
+import net.sourceforge.plantuml.project.time.Wink;
public class Solver3 {
diff --git a/src/net/sourceforge/plantuml/project/command/CommandPrintBetween.java b/src/net/sourceforge/plantuml/project/command/CommandPrintBetween.java
index ed436bbc1..ceca8be26 100644
--- a/src/net/sourceforge/plantuml/project/command/CommandPrintBetween.java
+++ b/src/net/sourceforge/plantuml/project/command/CommandPrintBetween.java
@@ -41,14 +41,10 @@ import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
-import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayAsDate;
-import net.sourceforge.plantuml.project.Failable;
import net.sourceforge.plantuml.project.GanttDiagram;
-import net.sourceforge.plantuml.project.core.PrintScale;
-import net.sourceforge.plantuml.project.lang.Complement;
import net.sourceforge.plantuml.project.lang.ComplementDate;
+import net.sourceforge.plantuml.project.time.Day;
public class CommandPrintBetween extends SingleLineCommand2 {
@@ -75,8 +71,8 @@ public class CommandPrintBetween extends SingleLineCommand2 {
@Override
protected CommandExecutionResult executeArg(GanttDiagram diagram, LineLocation location, RegexResult arg) {
- final DayAsDate start = (DayAsDate) pattern.getComplement(diagram, arg, "START").get();
- final DayAsDate end = (DayAsDate) pattern.getComplement(diagram, arg, "END").get();
+ final Day start = (Day) pattern.getComplement(diagram, arg, "START").get();
+ final Day end = (Day) pattern.getComplement(diagram, arg, "END").get();
diagram.setPrintInterval(start, end);
return CommandExecutionResult.ok();
}
diff --git a/src/net/sourceforge/plantuml/project/command/CommandPrintScale.java b/src/net/sourceforge/plantuml/project/command/CommandPrintScale.java
index 64c09ceda..428088af5 100644
--- a/src/net/sourceforge/plantuml/project/command/CommandPrintScale.java
+++ b/src/net/sourceforge/plantuml/project/command/CommandPrintScale.java
@@ -57,6 +57,7 @@ public class CommandPrintScale extends SingleLineCommand2 {
new RegexLeaf("printscale"), //
RegexLeaf.spaceOneOrMore(), //
new RegexOr("SCALE", //
+ new RegexLeaf("monthly"), //
new RegexLeaf("daily"), //
new RegexLeaf("weekly")), //
RegexLeaf.end()); //
diff --git a/src/net/sourceforge/plantuml/timingdiagram/PlayerRobust.java b/src/net/sourceforge/plantuml/project/core/AbstractTask.java
similarity index 66%
rename from src/net/sourceforge/plantuml/timingdiagram/PlayerRobust.java
rename to src/net/sourceforge/plantuml/project/core/AbstractTask.java
index 1e864b9a3..5c8ebe566 100644
--- a/src/net/sourceforge/plantuml/timingdiagram/PlayerRobust.java
+++ b/src/net/sourceforge/plantuml/project/core/AbstractTask.java
@@ -30,22 +30,44 @@
*
*
* Original Author: Arnaud Roques
+ *
*
*/
-package net.sourceforge.plantuml.timingdiagram;
+package net.sourceforge.plantuml.project.core;
-import net.sourceforge.plantuml.ISkinParam;
+import net.sourceforge.plantuml.Direction;
-public class PlayerRobust extends AbstractPlayer {
+public abstract class AbstractTask implements Task {
- protected TimeDrawing buildDrawing() {
- final TimeDrawing result;
- result = new Histogram(ruler, skinParam, statesLabel.values());
- return result;
+ public static final double HEIGHT = 16;
+
+ public double getHeight() {
+ return HEIGHT;
}
- public PlayerRobust(TitleStrategy titleStrategy, String full, ISkinParam skinParam, TimingRuler ruler) {
- super(titleStrategy, full, skinParam, ruler);
+ protected final TaskCode code;
+ private double y;
+
+ protected AbstractTask(TaskCode code) {
+ this.code = code;
+ }
+
+ public final double getY() {
+ return y;
+ }
+
+ public final void setY(double y) {
+ this.y = y;
+ }
+
+ public double getY(Direction direction) {
+ if (direction == Direction.UP) {
+ return y;
+ }
+ if (direction == Direction.DOWN) {
+ return y + getHeight();
+ }
+ return y + getHeight() / 2;
}
}
diff --git a/src/net/sourceforge/plantuml/project/core/Moment.java b/src/net/sourceforge/plantuml/project/core/Moment.java
index cea85f99a..47ec59be4 100644
--- a/src/net/sourceforge/plantuml/project/core/Moment.java
+++ b/src/net/sourceforge/plantuml/project/core/Moment.java
@@ -35,6 +35,8 @@
*/
package net.sourceforge.plantuml.project.core;
+import net.sourceforge.plantuml.project.time.Wink;
+
public interface Moment {
public Wink getStart();
diff --git a/src/net/sourceforge/plantuml/project/core/MomentImpl.java b/src/net/sourceforge/plantuml/project/core/MomentImpl.java
index 410d3059b..8fe2d00fa 100644
--- a/src/net/sourceforge/plantuml/project/core/MomentImpl.java
+++ b/src/net/sourceforge/plantuml/project/core/MomentImpl.java
@@ -35,6 +35,8 @@
*/
package net.sourceforge.plantuml.project.core;
+import net.sourceforge.plantuml.project.time.Wink;
+
public class MomentImpl implements Moment {
private final Wink start;
diff --git a/src/net/sourceforge/plantuml/project/core/PrintScale.java b/src/net/sourceforge/plantuml/project/core/PrintScale.java
index ecde6640c..5dfe1b50b 100644
--- a/src/net/sourceforge/plantuml/project/core/PrintScale.java
+++ b/src/net/sourceforge/plantuml/project/core/PrintScale.java
@@ -36,12 +36,25 @@
package net.sourceforge.plantuml.project.core;
public enum PrintScale {
- DAILY, WEEKLY;
+ DAILY(1), WEEKLY(4), MONTHLY(15);
+
+ private final int compress;
+
+ private PrintScale(int compress) {
+ this.compress = compress;
+ }
+
+ public int getCompress() {
+ return compress;
+ }
static public PrintScale fromString(String value) {
if (value.startsWith("w")) {
return WEEKLY;
}
+ if (value.startsWith("m")) {
+ return MONTHLY;
+ }
return DAILY;
}
}
diff --git a/src/net/sourceforge/plantuml/project/core/Resource.java b/src/net/sourceforge/plantuml/project/core/Resource.java
index a5cb17364..b169728a0 100644
--- a/src/net/sourceforge/plantuml/project/core/Resource.java
+++ b/src/net/sourceforge/plantuml/project/core/Resource.java
@@ -40,12 +40,13 @@ import java.util.EnumSet;
import java.util.Set;
import java.util.TreeSet;
-import net.sourceforge.plantuml.project.DayAsDate;
-import net.sourceforge.plantuml.project.DayOfWeek;
-import net.sourceforge.plantuml.project.GCalendar;
import net.sourceforge.plantuml.project.LoadPlanable;
import net.sourceforge.plantuml.project.draw.ResourceDraw;
import net.sourceforge.plantuml.project.lang.Subject;
+import net.sourceforge.plantuml.project.time.Day;
+import net.sourceforge.plantuml.project.time.DayOfWeek;
+import net.sourceforge.plantuml.project.time.GCalendar;
+import net.sourceforge.plantuml.project.time.Wink;
public class Resource implements Subject {
@@ -95,7 +96,7 @@ public class Resource implements Subject {
return false;
}
if (closedDayOfWeek.size() > 0 && calendar != null) {
- final DayAsDate d = calendar.toDayAsDate((Wink) instant);
+ final Day d = calendar.toDayAsDate((Wink) instant);
if (closedDayOfWeek.contains(d.getDayOfWeek())) {
return true;
}
diff --git a/src/net/sourceforge/plantuml/project/core/Task.java b/src/net/sourceforge/plantuml/project/core/Task.java
index fde1371f3..8575ea403 100644
--- a/src/net/sourceforge/plantuml/project/core/Task.java
+++ b/src/net/sourceforge/plantuml/project/core/Task.java
@@ -35,11 +35,12 @@
*/
package net.sourceforge.plantuml.project.core;
+import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.project.Load;
-import net.sourceforge.plantuml.project.draw.TaskDraw;
import net.sourceforge.plantuml.project.lang.ComplementColors;
import net.sourceforge.plantuml.project.lang.Subject;
+import net.sourceforge.plantuml.project.time.Wink;
public interface Task extends Subject, Moment {
@@ -57,21 +58,24 @@ public interface Task extends Subject, Moment {
public void setEnd(Wink end);
- public void setTaskDraw(TaskDraw taskDraw);
-
- public TaskDraw getTaskDraw();
-
public void setColors(ComplementColors colors);
public void addResource(Resource resource, int percentage);
public void setDiamond(boolean diamond);
-
+
public boolean isDiamond();
public void setCompletion(int completion);
public void setUrl(Url url);
+ public double getHeight();
+
+ public double getY();
+
+ public void setY(double y);
+
+ public double getY(Direction direction);
}
diff --git a/src/net/sourceforge/plantuml/project/core/TaskImpl.java b/src/net/sourceforge/plantuml/project/core/TaskImpl.java
index 2a3a15a1d..b0c6126c9 100644
--- a/src/net/sourceforge/plantuml/project/core/TaskImpl.java
+++ b/src/net/sourceforge/plantuml/project/core/TaskImpl.java
@@ -44,19 +44,17 @@ import net.sourceforge.plantuml.project.Load;
import net.sourceforge.plantuml.project.LoadPlanable;
import net.sourceforge.plantuml.project.PlanUtils;
import net.sourceforge.plantuml.project.Solver3;
-import net.sourceforge.plantuml.project.draw.TaskDraw;
import net.sourceforge.plantuml.project.lang.ComplementColors;
+import net.sourceforge.plantuml.project.time.Wink;
-public class TaskImpl implements Task, LoadPlanable {
+public class TaskImpl extends AbstractTask implements Task, LoadPlanable {
- private final TaskCode code;
private final Solver3 solver;
private final Map resources2 = new LinkedHashMap();
private final LoadPlanable defaultPlan;
private boolean diamond;
-
+
private Url url;
- private TaskDraw taskDraw;
private ComplementColors colors;
public void setUrl(Url url) {
@@ -64,7 +62,7 @@ public class TaskImpl implements Task, LoadPlanable {
}
public TaskImpl(TaskCode code, LoadPlanable defaultPlan) {
- this.code = code;
+ super(code);
this.defaultPlan = defaultPlan;
this.solver = new Solver3(this);
setStart(new Wink(0));
@@ -182,16 +180,6 @@ public class TaskImpl implements Task, LoadPlanable {
solver.setData(TaskAttribute.END, end);
}
-
- public void setTaskDraw(TaskDraw taskDraw) {
- taskDraw.setColorsAndCompletion(colors, completion, url);
- this.taskDraw = taskDraw;
- }
-
- public TaskDraw getTaskDraw() {
- return taskDraw;
- }
-
public void setColors(ComplementColors colors) {
this.colors = colors;
}
@@ -214,4 +202,16 @@ public class TaskImpl implements Task, LoadPlanable {
this.completion = completion;
}
+ public final Url getUrl() {
+ return url;
+ }
+
+ public final ComplementColors getColors() {
+ return colors;
+ }
+
+ public final int getCompletion() {
+ return completion;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/project/core/TaskInstant.java b/src/net/sourceforge/plantuml/project/core/TaskInstant.java
index 3d4d72e1e..78b1a2e55 100644
--- a/src/net/sourceforge/plantuml/project/core/TaskInstant.java
+++ b/src/net/sourceforge/plantuml/project/core/TaskInstant.java
@@ -36,6 +36,7 @@
package net.sourceforge.plantuml.project.core;
import net.sourceforge.plantuml.project.lang.Complement;
+import net.sourceforge.plantuml.project.time.Wink;
public class TaskInstant implements Complement {
diff --git a/src/net/sourceforge/plantuml/project/core/TaskSeparator.java b/src/net/sourceforge/plantuml/project/core/TaskSeparator.java
index 3f722b5ac..a5ff90ce8 100644
--- a/src/net/sourceforge/plantuml/project/core/TaskSeparator.java
+++ b/src/net/sourceforge/plantuml/project/core/TaskSeparator.java
@@ -37,18 +37,15 @@ package net.sourceforge.plantuml.project.core;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.project.Load;
-import net.sourceforge.plantuml.project.draw.TaskDraw;
import net.sourceforge.plantuml.project.lang.ComplementColors;
+import net.sourceforge.plantuml.project.time.Wink;
-public class TaskSeparator implements Task {
- // public static final double SPACE = 15;
+public class TaskSeparator extends AbstractTask implements Task {
- private final TaskCode code;
private final String comment;
- private TaskDraw taskDraw;
public TaskSeparator(String comment, int id) {
- this.code = new TaskCode("##" + id);
+ super(new TaskCode("##" + id));
this.comment = comment;
}
@@ -70,15 +67,6 @@ public class TaskSeparator implements Task {
public void setEnd(Wink end) {
throw new UnsupportedOperationException();
-
- }
-
- public void setTaskDraw(TaskDraw taskDraw) {
- this.taskDraw = taskDraw;
- }
-
- public TaskDraw getTaskDraw() {
- return taskDraw;
}
public void setColors(ComplementColors colors) {
diff --git a/src/net/sourceforge/plantuml/project/draw/AbstractTaskDraw.java b/src/net/sourceforge/plantuml/project/draw/AbstractTaskDraw.java
new file mode 100644
index 000000000..3302dca9e
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project/draw/AbstractTaskDraw.java
@@ -0,0 +1,73 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2020, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * If you like this project or if you find it useful, you can support us at:
+ *
+ * http://plantuml.com/patreon (only 1$ per month!)
+ * http://plantuml.com/paypal
+ *
+ * This file is part of PlantUML.
+ *
+ * PlantUML is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * PlantUML distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ *
+ * Original Author: Arnaud Roques
+ *
+ *
+ */
+package net.sourceforge.plantuml.project.draw;
+
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.project.core.AbstractTask;
+import net.sourceforge.plantuml.project.time.Wink;
+import net.sourceforge.plantuml.project.timescale.TimeScale;
+
+public abstract class AbstractTaskDraw implements TaskDraw {
+
+ protected final TimeScale timeScale;
+ protected final double y;
+ protected final String prettyDisplay;
+ protected final Wink start;
+
+ protected final double margin = 2;
+
+ public AbstractTaskDraw(TimeScale timeScale, double y, String prettyDisplay, Wink start) {
+ this.y = y;
+ this.start = start;
+ this.prettyDisplay = prettyDisplay;
+ this.timeScale = timeScale;
+ }
+
+ abstract protected FontConfiguration getFontConfiguration();
+
+ final protected double getShapeHeight() {
+ return getHeight() - 2 * margin;
+ }
+
+ final public double getHeight() {
+ return AbstractTask.HEIGHT;
+ }
+
+ final public double getY() {
+ return y;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/timingdiagram/PlayerConcise.java b/src/net/sourceforge/plantuml/project/draw/PathUtils.java
similarity index 58%
rename from src/net/sourceforge/plantuml/timingdiagram/PlayerConcise.java
rename to src/net/sourceforge/plantuml/project/draw/PathUtils.java
index adcb4722a..a3a7b20d9 100644
--- a/src/net/sourceforge/plantuml/timingdiagram/PlayerConcise.java
+++ b/src/net/sourceforge/plantuml/project/draw/PathUtils.java
@@ -30,22 +30,39 @@
*
*
* Original Author: Arnaud Roques
+ *
*
*/
-package net.sourceforge.plantuml.timingdiagram;
+package net.sourceforge.plantuml.project.draw;
-import net.sourceforge.plantuml.ISkinParam;
+import java.awt.geom.Point2D;
-public class PlayerConcise extends AbstractPlayer {
+import net.sourceforge.plantuml.ugraphic.UPath;
- protected TimeDrawing buildDrawing() {
- final TimeDrawing result;
- result = new Ribbon(ruler, skinParam, notes);
+public class PathUtils {
+
+ private final static double round = 4;
+
+ public static UPath UtoRight(double width, double height) {
+ final UPath result = new UPath();
+ result.moveTo(0, 0);
+ result.lineTo(width - round, 0);
+ result.arcTo(new Point2D.Double(width, round), round, 0, 1);
+ result.lineTo(width, height - round);
+ result.arcTo(new Point2D.Double(width - round, height), round, 0, 1);
+ result.lineTo(0, height);
return result;
}
- public PlayerConcise(TitleStrategy titleStrategy, String full, ISkinParam skinParam, TimingRuler ruler) {
- super(titleStrategy, full, skinParam, ruler);
+ public static UPath UtoLeft(double width, double height) {
+ final UPath result = new UPath();
+ result.moveTo(width, height);
+ result.lineTo(round, height);
+ result.arcTo(new Point2D.Double(0, height - round), round, 0, 1);
+ result.lineTo(0, round);
+ result.arcTo(new Point2D.Double(round, 0), round, 0, 1);
+ result.lineTo(width, 0);
+ return result;
}
}
diff --git a/src/net/sourceforge/plantuml/project/draw/ResourceDraw.java b/src/net/sourceforge/plantuml/project/draw/ResourceDraw.java
index e95c35054..b1464637f 100644
--- a/src/net/sourceforge/plantuml/project/draw/ResourceDraw.java
+++ b/src/net/sourceforge/plantuml/project/draw/ResourceDraw.java
@@ -39,19 +39,19 @@ import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.project.GanttDiagram;
import net.sourceforge.plantuml.project.core.Resource;
-import net.sourceforge.plantuml.project.core.Wink;
+import net.sourceforge.plantuml.project.time.Wink;
import net.sourceforge.plantuml.project.timescale.TimeScale;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UFont;
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;
public class ResourceDraw implements UDrawable {
@@ -75,14 +75,14 @@ public class ResourceDraw implements UDrawable {
final TextBlock title = Display.getWithNewlines(res.getName()).create(getFontConfiguration(13),
HorizontalAlignment.LEFT, new SpriteContainerEmpty());
title.drawU(ug);
- final ULine line = new ULine(timeScale.getEndingPosition(max) - timeScale.getStartingPosition(min), 0);
- ug.apply(new UChangeColor(HtmlColorUtils.BLACK))
- .apply(new UTranslate(0, title.calculateDimension(ug.getStringBounder()).getHeight())).draw(line);
+ final ULine line = ULine.hline(timeScale.getEndingPosition(max) - timeScale.getStartingPosition(min));
+ ug.apply(new UChangeColor(HColorUtils.BLACK))
+ .apply(UTranslate.dy(title.calculateDimension(ug.getStringBounder()).getHeight())).draw(line);
for (Wink i = min; i.compareTo(max) <= 0; i = i.increment()) {
final int load = gantt.getLoadForResource(res, i);
if (load > 0) {
- final FontConfiguration fontConfiguration = getFontConfiguration(9, load > 100 ? HtmlColorUtils.RED
- : HtmlColorUtils.BLACK);
+ final FontConfiguration fontConfiguration = getFontConfiguration(9, load > 100 ? HColorUtils.RED
+ : HColorUtils.BLACK);
final TextBlock value = Display.getWithNewlines("" + load).create(fontConfiguration,
HorizontalAlignment.LEFT, new SpriteContainerEmpty());
final double start = (timeScale.getStartingPosition(i) + timeScale.getEndingPosition(i)) / 2
@@ -95,10 +95,10 @@ public class ResourceDraw implements UDrawable {
}
private FontConfiguration getFontConfiguration(int size) {
- return getFontConfiguration(size, HtmlColorUtils.BLACK);
+ return getFontConfiguration(size, HColorUtils.BLACK);
}
- private FontConfiguration getFontConfiguration(int size, HtmlColor color) {
+ private FontConfiguration getFontConfiguration(int size, HColor color) {
final UFont font = UFont.serif(size);
return new FontConfiguration(font, color, color, false);
}
diff --git a/src/net/sourceforge/plantuml/project/draw/TaskDraw.java b/src/net/sourceforge/plantuml/project/draw/TaskDraw.java
index 814c33b9d..b5e844b95 100644
--- a/src/net/sourceforge/plantuml/project/draw/TaskDraw.java
+++ b/src/net/sourceforge/plantuml/project/draw/TaskDraw.java
@@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.project.draw;
-import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.project.lang.ComplementColors;
@@ -47,8 +46,6 @@ public interface TaskDraw extends UDrawable {
public double getY();
- public double getY(Direction direction);
-
public void drawTitle(UGraphic ug);
public double getHeight();
diff --git a/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java b/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java
new file mode 100644
index 000000000..db6a2a114
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java
@@ -0,0 +1,110 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2020, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * If you like this project or if you find it useful, you can support us at:
+ *
+ * http://plantuml.com/patreon (only 1$ per month!)
+ * http://plantuml.com/paypal
+ *
+ * This file is part of PlantUML.
+ *
+ * PlantUML is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * PlantUML distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ *
+ * Original Author: Arnaud Roques
+ *
+ *
+ */
+package net.sourceforge.plantuml.project.draw;
+
+import net.sourceforge.plantuml.SpriteContainerEmpty;
+import net.sourceforge.plantuml.Url;
+import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.graphic.FontConfiguration;
+import net.sourceforge.plantuml.graphic.HorizontalAlignment;
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.project.lang.ComplementColors;
+import net.sourceforge.plantuml.project.time.Wink;
+import net.sourceforge.plantuml.project.timescale.TimeScale;
+import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
+import net.sourceforge.plantuml.ugraphic.UChangeColor;
+import net.sourceforge.plantuml.ugraphic.UFont;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.UPolygon;
+import net.sourceforge.plantuml.ugraphic.UShape;
+import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
+
+public class TaskDrawDiamond extends AbstractTaskDraw {
+
+ private ComplementColors colors;
+
+ public TaskDrawDiamond(TimeScale timeScale, double y, String prettyDisplay, Wink start) {
+ super(timeScale, y, prettyDisplay, start);
+ }
+
+ @Override
+ protected FontConfiguration getFontConfiguration() {
+ final UFont font = UFont.serif(11);
+ return new FontConfiguration(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
+ }
+
+ final public void drawTitle(UGraphic ug) {
+ final TextBlock title = Display.getWithNewlines(prettyDisplay).create(getFontConfiguration(),
+ HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ final double titleHeight = title.calculateDimension(ug.getStringBounder()).getHeight();
+ final double h = (margin + getShapeHeight() - titleHeight) / 2;
+ final double endingPosition = timeScale.getStartingPosition(start) + getHeight();
+ title.drawU(ug.apply(new UTranslate(endingPosition, h)));
+ }
+
+ public void drawU(UGraphic ug1) {
+ final double startPos = timeScale.getStartingPosition(start);
+ ug1 = applyColors(ug1);
+ UGraphic ug2 = ug1.apply(new UTranslate(startPos + margin, margin));
+ drawShape(ug2);
+ }
+
+ private UGraphic applyColors(UGraphic ug) {
+ if (colors != null && colors.isOk()) {
+ return colors.apply(ug);
+ }
+ return ug.apply(new UChangeColor(HColorUtils.BLACK)).apply(new UChangeBackColor(HColorUtils.BLACK));
+ }
+
+ private void drawShape(UGraphic ug) {
+ ug.draw(getDiamond());
+ }
+
+ private UShape getDiamond() {
+ final double h = getHeight() - 2 * margin;
+ final UPolygon result = new UPolygon();
+ result.addPoint(h / 2, 0);
+ result.addPoint(h, h / 2);
+ result.addPoint(h / 2, h);
+ result.addPoint(0, h / 2);
+ return result;
+ }
+
+ public void setColorsAndCompletion(ComplementColors colors, int completion, Url url) {
+ this.colors = colors;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java b/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java
index d3e606365..b871c1fea 100644
--- a/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java
+++ b/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java
@@ -35,71 +35,66 @@
*/
package net.sourceforge.plantuml.project.draw;
-import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.project.core.TaskImpl;
-import net.sourceforge.plantuml.project.core.Wink;
import net.sourceforge.plantuml.project.lang.ComplementColors;
+import net.sourceforge.plantuml.project.time.Wink;
import net.sourceforge.plantuml.project.timescale.TimeScale;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
-import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.URectangle;
-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.HColorSet;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
-public class TaskDrawRegular implements TaskDraw {
+public class TaskDrawRegular extends AbstractTaskDraw {
+
+ private static final HColor defaultColor = HColorSet.instance().getColorIfValid("GreenYellow");
- // private static final HtmlColor defaultColor = HtmlColorUtils.COL_84BE84;
- private static final HtmlColor defaultColor = new HtmlColorSetSimple().getColorIfValid("GreenYellow");
- private final TaskImpl task;
- private final TimeScale timeScale;
- private final double y;
private ComplementColors colors;
private int completion = 100;
private Url url;
+ private final Wink end;
+ private final boolean oddStart;
+ private final boolean oddEnd;
private final double margin = 2;
- public TaskDrawRegular(TaskImpl task, TimeScale timeScale, double y) {
- this.y = y;
- this.task = task;
- this.timeScale = timeScale;
+ public TaskDrawRegular(TimeScale timeScale, double y, String prettyDisplay, Wink start, Wink end, boolean oddStart,
+ boolean oddEnd) {
+ super(timeScale, y, prettyDisplay, start);
+ this.end = end;
+ this.oddStart = oddStart;
+ this.oddEnd = oddEnd;
+
}
public void drawTitle(UGraphic ug) {
- final TextBlock title = Display.getWithNewlines(task.getPrettyDisplay()).create(getFontConfiguration(),
+ final TextBlock title = Display.getWithNewlines(prettyDisplay).create(getFontConfiguration(),
HorizontalAlignment.LEFT, new SpriteContainerEmpty());
final double titleHeight = title.calculateDimension(ug.getStringBounder()).getHeight();
final double h = (margin + getShapeHeight() - titleHeight) / 2;
- final double endingPosition;
- if (isDiamond()) {
- endingPosition = timeScale.getStartingPosition(task.getStart()) + getHeight();
- } else {
- endingPosition = timeScale.getEndingPosition(task.getStart());
- }
+ final double endingPosition = timeScale.getEndingPosition(start);
title.drawU(ug.apply(new UTranslate(endingPosition, h)));
}
- private FontConfiguration getFontConfiguration() {
+ @Override
+ protected FontConfiguration getFontConfiguration() {
final UFont font = UFont.serif(11);
- return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
+ return new FontConfiguration(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
}
public void drawU(UGraphic ug1) {
- final double start = timeScale.getStartingPosition(task.getStart());
+ final double startPos = timeScale.getStartingPosition(start);
ug1 = applyColors(ug1);
- UGraphic ug2 = ug1.apply(new UTranslate(start + margin, margin));
+ UGraphic ug2 = ug1.apply(new UTranslate(startPos + margin, margin));
drawShape(ug2);
}
@@ -107,91 +102,48 @@ public class TaskDrawRegular implements TaskDraw {
if (colors != null && colors.isOk()) {
return colors.apply(ug);
}
- if (isDiamond()) {
- return ug.apply(new UChangeColor(HtmlColorUtils.BLACK)).apply(new UChangeBackColor(HtmlColorUtils.BLACK));
- }
- return ug.apply(new UChangeColor(HtmlColorUtils.BLUE)).apply(new UChangeBackColor(defaultColor));
+ return ug.apply(new UChangeColor(HColorUtils.BLUE)).apply(new UChangeBackColor(defaultColor));
}
private void drawShape(UGraphic ug) {
- if (isDiamond()) {
- ug.draw(getDiamond());
- return;
- }
- final Wink instantStart = task.getStart();
- final Wink instantEnd = task.getEnd();
- final double start = timeScale.getStartingPosition(instantStart);
- final double end = timeScale.getEndingPosition(instantEnd);
+ final double startPos = timeScale.getStartingPosition(start);
+ final double endPos = timeScale.getEndingPosition(end);
- final double fullLength = end - start - 2 * margin;
+ final double fullLength = endPos - startPos - 2 * margin;
if (fullLength < 10) {
return;
}
if (url != null) {
ug.startUrl(url);
}
- final URectangle full = new URectangle(fullLength, getShapeHeight(), 8, 8);
+ if (oddStart && !oddEnd) {
+ ug.draw(PathUtils.UtoRight(fullLength, getShapeHeight()));
+ return;
+ }
+ if (!oddStart && oddEnd) {
+ ug.draw(PathUtils.UtoLeft(fullLength, getShapeHeight()));
+ return;
+ }
+ final URectangle full = new URectangle(fullLength, getShapeHeight()).rounded(8);
if (completion == 100) {
ug.draw(full);
} else {
final double partialLength = fullLength * completion / 100.;
- ug.apply(new UChangeColor(HtmlColorUtils.WHITE)).apply(new UChangeBackColor(HtmlColorUtils.WHITE))
+ ug.apply(new UChangeColor(HColorUtils.WHITE)).apply(new UChangeBackColor(HColorUtils.WHITE))
.draw(full);
if (partialLength > 2) {
- final URectangle partial = new URectangle(partialLength, getShapeHeight(), 8, 8);
+ final URectangle partial = new URectangle(partialLength, getShapeHeight()).rounded(8);
ug.apply(new UChangeColor(null)).draw(partial);
}
if (partialLength > 10 && partialLength < fullLength - 10) {
final URectangle patch = new URectangle(8, getShapeHeight());
- ug.apply(new UChangeColor(null)).apply(new UTranslate(partialLength - 8, 0)).draw(patch);
+ ug.apply(new UChangeColor(null)).apply(UTranslate.dx(partialLength - 8)).draw(patch);
}
ug.apply(new UChangeBackColor(null)).draw(full);
}
if (url != null) {
ug.closeAction();
}
-
- }
-
- private double getShapeHeight() {
- return getHeight() - 2 * margin;
- }
-
- private boolean isDiamond() {
- if (task.isDiamond()) {
- final Wink instantStart = task.getStart();
- final Wink instantEnd = task.getEnd();
- return instantStart.compareTo(instantEnd) == 0;
- }
- return false;
- }
-
- private UShape getDiamond() {
- final double h = getHeight() - 2 * margin;
- final UPolygon result = new UPolygon();
- result.addPoint(h / 2, 0);
- result.addPoint(h, h / 2);
- result.addPoint(h / 2, h);
- result.addPoint(0, h / 2);
- return result;
- }
-
- public double getHeight() {
- return 16;
- }
-
- public double getY() {
- return y;
- }
-
- public double getY(Direction direction) {
- if (direction == Direction.UP) {
- return y;
- }
- if (direction == Direction.DOWN) {
- return y + getHeight();
- }
- return y + getHeight() / 2;
}
public void setColorsAndCompletion(ComplementColors colors, int completion, Url url) {
diff --git a/src/net/sourceforge/plantuml/project/draw/TaskDrawSeparator.java b/src/net/sourceforge/plantuml/project/draw/TaskDrawSeparator.java
index 6e88d95f3..d510383bf 100644
--- a/src/net/sourceforge/plantuml/project/draw/TaskDrawSeparator.java
+++ b/src/net/sourceforge/plantuml/project/draw/TaskDrawSeparator.java
@@ -35,24 +35,23 @@
*/
package net.sourceforge.plantuml.project.draw;
-import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
-import net.sourceforge.plantuml.project.core.TaskSeparator;
-import net.sourceforge.plantuml.project.core.Wink;
+import net.sourceforge.plantuml.project.core.AbstractTask;
import net.sourceforge.plantuml.project.lang.ComplementColors;
+import net.sourceforge.plantuml.project.time.Wink;
import net.sourceforge.plantuml.project.timescale.TimeScale;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UFont;
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;
public class TaskDrawSeparator implements TaskDraw {
@@ -62,8 +61,8 @@ public class TaskDrawSeparator implements TaskDraw {
private final Wink max;
private final String name;
- public TaskDrawSeparator(TaskSeparator task, TimeScale timeScale, double y, Wink min, Wink max) {
- this.name = task.getName();
+ public TaskDrawSeparator(String name, TimeScale timeScale, double y, Wink min, Wink max) {
+ this.name = name;
this.y = y;
this.timeScale = timeScale;
this.min = min;
@@ -71,7 +70,7 @@ public class TaskDrawSeparator implements TaskDraw {
}
public void drawTitle(UGraphic ug) {
- getTitle().drawU(ug.apply(new UTranslate(MARGIN1, 0)));
+ getTitle().drawU(ug.apply(UTranslate.dx(MARGIN1)));
}
private TextBlock getTitle() {
@@ -84,7 +83,7 @@ public class TaskDrawSeparator implements TaskDraw {
private FontConfiguration getFontConfiguration() {
final UFont font = UFont.serif(11);
- return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
+ return new FontConfiguration(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
}
private final static double MARGIN1 = 10;
@@ -95,38 +94,28 @@ public class TaskDrawSeparator implements TaskDraw {
final double start = timeScale.getStartingPosition(min) + widthTitle;
final double end = timeScale.getEndingPosition(max);
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
- ug = ug.apply(new UTranslate(0, getHeight() / 2));
+ ug = ug.apply(new UChangeColor(HColorUtils.BLACK));
+ ug = ug.apply(UTranslate.dy(getHeight() / 2));
if (widthTitle == 0) {
- final ULine line = new ULine(end - start, 0);
+ final ULine line = ULine.hline(end - start);
ug.draw(line);
} else {
- final ULine line1 = new ULine(MARGIN1 - MARGIN2, 0);
- final ULine line2 = new ULine(end - start - MARGIN1 - MARGIN2, 0);
+ final ULine line1 = ULine.hline(MARGIN1 - MARGIN2);
+ final ULine line2 = ULine.hline(end - start - MARGIN1 - MARGIN2);
ug.draw(line1);
- ug.apply(new UTranslate(widthTitle + MARGIN1 + MARGIN2, 0)).draw(line2);
+ ug.apply(UTranslate.dx(widthTitle + MARGIN1 + MARGIN2)).draw(line2);
}
}
public double getHeight() {
- return 16;
+ return AbstractTask.HEIGHT;
}
public double getY() {
return y;
}
- public double getY(Direction direction) {
- if (direction == Direction.UP) {
- return y;
- }
- if (direction == Direction.DOWN) {
- return y + getHeight();
- }
- return y + getHeight() / 2;
- }
-
public void setColorsAndCompletion(ComplementColors colors, int completion, Url url) {
}
diff --git a/src/net/sourceforge/plantuml/project/draw/TimeHeader.java b/src/net/sourceforge/plantuml/project/draw/TimeHeader.java
index 982f9c82d..c7584d1f9 100644
--- a/src/net/sourceforge/plantuml/project/draw/TimeHeader.java
+++ b/src/net/sourceforge/plantuml/project/draw/TimeHeader.java
@@ -39,18 +39,21 @@ import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.project.core.Wink;
+import net.sourceforge.plantuml.project.time.Wink;
import net.sourceforge.plantuml.project.timescale.TimeScale;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UTranslate;
-import sun.security.x509.AVA;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public abstract class TimeHeader {
+
+ protected static final int Y_POS_ROW16 = 16;
+ protected static final int Y_POS_ROW28 = 28;
+
private final TimeScale timeScale;
protected final Wink min;
@@ -69,8 +72,8 @@ public abstract class TimeHeader {
protected final void drawHline(UGraphic ug, double y) {
final double xmin = getTimeScale().getStartingPosition(min);
final double xmax = getTimeScale().getEndingPosition(max);
- final ULine hline = new ULine(xmax - xmin, 0);
- ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(0, y)).draw(hline);
+ final ULine hline = ULine.hline(xmax - xmin);
+ ug.apply(new UChangeColor(HColorUtils.LIGHT_GRAY)).apply(UTranslate.dy(y)).draw(hline);
}
final protected FontConfiguration getFontConfiguration(int size, boolean bold) {
@@ -78,7 +81,7 @@ public abstract class TimeHeader {
if (bold) {
font = font.bold();
}
- return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
+ return new FontConfiguration(font, HColorUtils.BLACK, HColorUtils.BLACK, false);
}
public final TimeScale getTimeScale() {
@@ -94,7 +97,7 @@ public abstract class TimeHeader {
final double width = text.calculateDimension(ug.getStringBounder()).getWidth();
final double available = end - start;
final double diff = Math.max(0, available - width);
- text.drawU(ug.apply(new UTranslate(start + diff / 2, 0)));
+ text.drawU(ug.apply(UTranslate.dx(start + diff / 2)));
}
protected final void printCentered(UGraphic ug, double start, double end, TextBlock... texts) {
@@ -104,7 +107,7 @@ public abstract class TimeHeader {
final double width = text.calculateDimension(ug.getStringBounder()).getWidth();
if (i == 0 || width <= available) {
final double diff = Math.max(0, available - width);
- text.drawU(ug.apply(new UTranslate(start + diff / 2, 0)));
+ text.drawU(ug.apply(UTranslate.dx(start + diff / 2)));
return;
}
}
diff --git a/src/net/sourceforge/plantuml/project/draw/TimeHeaderDaily.java b/src/net/sourceforge/plantuml/project/draw/TimeHeaderDaily.java
index a0a819fef..177407ceb 100644
--- a/src/net/sourceforge/plantuml/project/draw/TimeHeaderDaily.java
+++ b/src/net/sourceforge/plantuml/project/draw/TimeHeaderDaily.java
@@ -37,16 +37,12 @@ package net.sourceforge.plantuml.project.draw;
import java.util.Map;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.project.DayAsDate;
-import net.sourceforge.plantuml.project.DayOfWeek;
-import net.sourceforge.plantuml.project.GCalendar;
import net.sourceforge.plantuml.project.LoadPlanable;
-import net.sourceforge.plantuml.project.core.Month;
-import net.sourceforge.plantuml.project.core.Wink;
+import net.sourceforge.plantuml.project.time.Day;
+import net.sourceforge.plantuml.project.time.GCalendar;
+import net.sourceforge.plantuml.project.time.MonthYear;
+import net.sourceforge.plantuml.project.time.Wink;
import net.sourceforge.plantuml.project.timescale.TimeScaleDaily;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -54,26 +50,25 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
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.HColorSet;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class TimeHeaderDaily extends TimeHeader {
- private static final int Y_POS_WEEKDAY = 16;
- private static final int Y_POS_NUMDAY = 28;
-
private double getTimeHeaderHeight() {
- return Y_POS_NUMDAY + 13;
+ return Y_POS_ROW28 + 13;
}
- private final HtmlColor veryLightGray = new HtmlColorSetSimple().getColorIfValid("#E0E8E8");
+ private final HColor veryLightGray = HColorSet.instance().getColorIfValid("#E0E8E8");
private final GCalendar calendar;
private final LoadPlanable defaultPlan;
- private final Map colorDays;
- private final Map nameDays;
+ private final Map colorDays;
+ private final Map nameDays;
public TimeHeaderDaily(GCalendar calendar, Wink min, Wink max, LoadPlanable defaultPlan,
- Map colorDays, Map nameDays, DayAsDate printStart,
- DayAsDate printEnd) {
+ Map colorDays, Map nameDays, Day printStart, Day printEnd) {
super(min, max, new TimeScaleDaily(calendar, printStart));
this.calendar = calendar;
this.defaultPlan = defaultPlan;
@@ -90,74 +85,104 @@ public class TimeHeaderDaily extends TimeHeader {
}
private void drawCalendar(final UGraphic ug, double totalHeight) {
- Month lastMonth = null;
- double lastChangeMonth = -1;
- Wink wink = min;
- while (wink.compareTo(max) <= 0) {
- final DayAsDate day = calendar.toDayAsDate(wink);
- final DayOfWeek dayOfWeek = day.getDayOfWeek();
- final boolean isWorkingDay = defaultPlan.getLoadAt(wink) > 0;
- final String d1 = "" + day.getDayOfMonth();
- final TextBlock num = getTextBlock(d1, 10, false);
- final double x1 = getTimeScale().getStartingPosition(wink);
- final double x2 = getTimeScale().getEndingPosition(wink);
- double startingY = getFullHeaderHeight();
- if (wink.compareTo(max.increment()) < 0) {
- final TextBlock weekDay = getTextBlock(dayOfWeek.shortName(), 10, false);
-
- final URectangle rect = new URectangle(x2 - x1 - 1, totalHeight - getFullHeaderHeight());
- if (isWorkingDay) {
- final HtmlColor back = colorDays.get(day);
- if (back != null) {
- ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(back))
- .apply(new UTranslate(x1 + 1, getFullHeaderHeight())).draw(rect);
- }
- printCentered(ug.apply(new UTranslate(0, Y_POS_WEEKDAY)), weekDay, x1, x2);
- printCentered(ug.apply(new UTranslate(0, Y_POS_NUMDAY)), num, x1, x2);
- } else {
- ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(veryLightGray))
- .apply(new UTranslate(x1 + 1, getFullHeaderHeight())).draw(rect);
- }
- if (lastMonth != day.getMonth()) {
- startingY = 0;
- if (lastMonth != null) {
- printMonth(ug, lastMonth, day.getYear(), lastChangeMonth, x1);
- }
- lastChangeMonth = x1;
- lastMonth = day.getMonth();
- }
- }
- drawVbar(ug, x1, startingY, totalHeight);
- wink = wink.increment();
- }
- final DayAsDate day = calendar.toDayAsDate(max);
- final double x1 = getTimeScale().getStartingPosition(wink);
- drawVbar(ug, x1, Y_POS_WEEKDAY, totalHeight);
- if (x1 > lastChangeMonth) {
- printMonth(ug, lastMonth, day.getYear(), lastChangeMonth, x1);
- }
-
+ drawTexts(ug, totalHeight);
+ drawMonths(ug);
+ drawNonWorking(ug, totalHeight);
+ drawVBars(ug, totalHeight);
+ drawVbar(ug, getTimeScale().getStartingPosition(max.increment()), Y_POS_ROW16, totalHeight);
printNamedDays(ug);
}
- private void printMonth(UGraphic ug, Month lastMonth, int year, double start, double end) {
- final TextBlock tiny = getTextBlock(lastMonth.shortName(), 12, true);
- final TextBlock small = getTextBlock(lastMonth.niceName(), 12, true);
- final TextBlock big = getTextBlock(lastMonth.niceName() + " " + year, 12, true);
+ private void drawTexts(final UGraphic ug, double totalHeight) {
+ final double height = totalHeight - getFullHeaderHeight();
+ for (Wink wink = min; wink.compareTo(max) <= 0; wink = wink.increment()) {
+ final double x1 = getTimeScale().getStartingPosition(wink);
+ final double x2 = getTimeScale().getEndingPosition(wink);
+ final Day day = calendar.toDayAsDate(wink);
+ if (defaultPlan.getLoadAt(wink) > 0) {
+ final HColor back = colorDays.get(day);
+ if (back != null) {
+ drawRectangle(ug.apply(new UChangeBackColor(back)), height, x1, x2);
+ }
+ printCentered(ug.apply(UTranslate.dy(Y_POS_ROW16)),
+ getTextBlock(day.getDayOfWeek().shortName(), 10, false), x1, x2);
+ printCentered(ug.apply(UTranslate.dy(Y_POS_ROW28)), getTextBlock("" + day.getDayOfMonth(), 10, false),
+ x1, x2);
+ }
+ }
+ }
+
+ private void drawMonths(final UGraphic ug) {
+ MonthYear last = null;
+ double lastChangeMonth = -1;
+ for (Wink wink = min; wink.compareTo(max) <= 0; wink = wink.increment()) {
+ final double x1 = getTimeScale().getStartingPosition(wink);
+ final Day day = calendar.toDayAsDate(wink);
+ if (day.monthYear().equals(last) == false) {
+ if (last != null) {
+ printMonth(ug, last, lastChangeMonth, x1);
+ }
+ lastChangeMonth = x1;
+ last = day.monthYear();
+ }
+ }
+ final double x1 = getTimeScale().getStartingPosition(max.increment());
+ if (x1 > lastChangeMonth) {
+ printMonth(ug, last, lastChangeMonth, x1);
+ }
+ }
+
+ private void drawNonWorking(final UGraphic ug, double totalHeight) {
+ final double height = totalHeight - getFullHeaderHeight();
+ for (Wink wink = min; wink.compareTo(max) <= 0; wink = wink.increment()) {
+ final double x1 = getTimeScale().getStartingPosition(wink);
+ final double x2 = getTimeScale().getEndingPosition(wink);
+ if (defaultPlan.getLoadAt(wink) == 0) {
+ drawRectangle(ug.apply(new UChangeBackColor(veryLightGray)), height, x1, x2);
+ }
+ }
+ }
+
+ private void drawRectangle(UGraphic ug, double height, double x1, double x2) {
+ if (height == 0) {
+ return;
+ }
+ ug = ug.apply(new UChangeColor(null));
+ ug = ug.apply(new UTranslate(x1 + 1, getFullHeaderHeight()));
+ ug.draw(new URectangle(x2 - x1 - 1, height));
+ }
+
+ private void drawVBars(final UGraphic ug, double totalHeight) {
+ MonthYear last = null;
+ for (Wink wink = min; wink.compareTo(max) <= 0; wink = wink.increment()) {
+ double startingY = getFullHeaderHeight();
+ final Day day = calendar.toDayAsDate(wink);
+ if (day.monthYear().equals(last) == false) {
+ startingY = 0;
+ last = day.monthYear();
+ }
+ drawVbar(ug, getTimeScale().getStartingPosition(wink), startingY, totalHeight);
+ }
+ }
+
+ private void printMonth(UGraphic ug, MonthYear monthYear, double start, double end) {
+ final TextBlock tiny = getTextBlock(monthYear.shortName(), 12, true);
+ final TextBlock small = getTextBlock(monthYear.longName(), 12, true);
+ final TextBlock big = getTextBlock(monthYear.longNameYYYY(), 12, true);
printCentered(ug, start, end, tiny, small, big);
}
private void drawVbar(UGraphic ug, double x, double y1, double y2) {
- final ULine vbar = new ULine(0, y2 - y1);
- ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(x, y1)).draw(vbar);
+ final ULine vbar = ULine.vline(y2 - y1);
+ ug.apply(new UChangeColor(HColorUtils.LIGHT_GRAY)).apply(new UTranslate(x, y1)).draw(vbar);
}
private void printNamedDays(final UGraphic ug) {
if (nameDays.size() > 0) {
String last = null;
for (Wink wink = min; wink.compareTo(max.increment()) <= 0; wink = wink.increment()) {
- final DayAsDate tmpday = calendar.toDayAsDate(wink);
+ final Day tmpday = calendar.toDayAsDate(wink);
final String name = nameDays.get(tmpday);
if (name != null && name.equals(last) == false) {
final double x1 = getTimeScale().getStartingPosition(wink);
@@ -166,7 +191,7 @@ public class TimeHeaderDaily extends TimeHeader {
final double h = label.calculateDimension(ug.getStringBounder()).getHeight();
double y1 = getTimeHeaderHeight();
double y2 = getFullHeaderHeight();
- label.drawU(ug.apply(new UTranslate(x1, Y_POS_NUMDAY + 11)));
+ label.drawU(ug.apply(new UTranslate(x1, Y_POS_ROW28 + 11)));
}
last = name;
}
diff --git a/src/net/sourceforge/plantuml/project/draw/TimeHeaderMonthly.java b/src/net/sourceforge/plantuml/project/draw/TimeHeaderMonthly.java
new file mode 100644
index 000000000..8cbd7b7e6
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project/draw/TimeHeaderMonthly.java
@@ -0,0 +1,150 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2020, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * If you like this project or if you find it useful, you can support us at:
+ *
+ * http://plantuml.com/patreon (only 1$ per month!)
+ * http://plantuml.com/paypal
+ *
+ * This file is part of PlantUML.
+ *
+ * PlantUML is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * PlantUML distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ *
+ * Original Author: Arnaud Roques
+ *
+ *
+ */
+package net.sourceforge.plantuml.project.draw;
+
+import java.util.Map;
+
+import net.sourceforge.plantuml.graphic.TextBlock;
+import net.sourceforge.plantuml.project.LoadPlanable;
+import net.sourceforge.plantuml.project.core.PrintScale;
+import net.sourceforge.plantuml.project.time.Day;
+import net.sourceforge.plantuml.project.time.GCalendar;
+import net.sourceforge.plantuml.project.time.MonthYear;
+import net.sourceforge.plantuml.project.time.Wink;
+import net.sourceforge.plantuml.project.timescale.TimeScaleCompressed;
+import net.sourceforge.plantuml.ugraphic.UChangeColor;
+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;
+
+public class TimeHeaderMonthly extends TimeHeader {
+
+ private double getTimeHeaderHeight() {
+ return Y_POS_ROW16 + 13;
+ }
+
+ private final GCalendar calendar;
+
+ public TimeHeaderMonthly(GCalendar calendar, Wink min, Wink max, LoadPlanable defaultPlan,
+ Map colorDays, Map nameDays) {
+ super(min, max, new TimeScaleCompressed(calendar, PrintScale.MONTHLY.getCompress()));
+ this.calendar = calendar;
+ }
+
+ @Override
+ public void drawTimeHeader(final UGraphic ug, double totalHeight) {
+ drawCalendar(ug, totalHeight);
+ drawHline(ug, 0);
+ drawHline(ug, Y_POS_ROW16);
+ drawHline(ug, getFullHeaderHeight());
+
+ }
+
+ private void drawCalendar(final UGraphic ug, double totalHeight) {
+ drawYears(ug);
+ drawMonths(ug);
+ }
+
+ private void drawYears(final UGraphic ug) {
+ MonthYear last = null;
+ double lastChange = -1;
+ for (Wink wink = min; wink.compareTo(max) < 0; wink = wink.increment()) {
+ final Day day = calendar.toDayAsDate(wink);
+ final double x1 = getTimeScale().getStartingPosition(wink);
+ if (last == null || day.monthYear().year() != last.year()) {
+ drawVbar(ug, x1, 0, Y_POS_ROW16);
+ if (last != null) {
+ printYear(ug, last, lastChange, x1);
+ }
+ lastChange = x1;
+ last = day.monthYear();
+ }
+ }
+ final double x1 = getTimeScale().getStartingPosition(max.increment());
+ if (x1 > lastChange) {
+ printYear(ug, last, lastChange, x1);
+ }
+ }
+
+ private void drawMonths(final UGraphic ug) {
+ MonthYear last = null;
+ double lastChange = -1;
+ for (Wink wink = min; wink.compareTo(max) < 0; wink = wink.increment()) {
+ final Day day = calendar.toDayAsDate(wink);
+ final double x1 = getTimeScale().getStartingPosition(wink);
+ if (day.monthYear().equals(last) == false) {
+ drawVbar(ug, x1, Y_POS_ROW16, Y_POS_ROW28);
+ if (last != null) {
+ printMonth(ug.apply(UTranslate.dy(Y_POS_ROW16)), last, lastChange, x1);
+ }
+ lastChange = x1;
+ last = day.monthYear();
+ }
+ }
+ final double x1 = getTimeScale().getStartingPosition(max.increment());
+ if (x1 > lastChange) {
+ printMonth(ug.apply(UTranslate.dy(Y_POS_ROW16)), last, lastChange, x1);
+ }
+ }
+
+ private void printYear(UGraphic ug, MonthYear monthYear, double start, double end) {
+ final TextBlock small = getTextBlock("" + monthYear.year(), 12, true);
+ printCentered(ug, start, end, small);
+ }
+
+ private void printMonth(UGraphic ug, MonthYear monthYear, double start, double end) {
+ final TextBlock small = getTextBlock(monthYear.shortName(), 10, false);
+ final TextBlock big = getTextBlock(monthYear.longName(), 10, false);
+ printCentered(ug, start, end, small, big);
+ }
+
+ private void drawVbar(UGraphic ug, double x, double y1, double y2) {
+ final ULine vbar = ULine.vline(y2 - y1);
+ ug.apply(new UChangeColor(HColorUtils.LIGHT_GRAY)).apply(new UTranslate(x, y1)).draw(vbar);
+ }
+
+ private void printLeft(UGraphic ug, TextBlock text, double start) {
+ text.drawU(ug.apply(UTranslate.dx(start)));
+ }
+
+ @Override
+ public double getFullHeaderHeight() {
+ return getTimeHeaderHeight();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project/draw/TimeHeaderSimple.java b/src/net/sourceforge/plantuml/project/draw/TimeHeaderSimple.java
index 2d07d261d..d0e49a8f2 100644
--- a/src/net/sourceforge/plantuml/project/draw/TimeHeaderSimple.java
+++ b/src/net/sourceforge/plantuml/project/draw/TimeHeaderSimple.java
@@ -38,49 +38,18 @@ package net.sourceforge.plantuml.project.draw;
import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.project.core.Wink;
+import net.sourceforge.plantuml.project.time.Wink;
import net.sourceforge.plantuml.project.timescale.TimeScale;
import net.sourceforge.plantuml.project.timescale.TimeScaleWink;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
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;
public class TimeHeaderSimple extends TimeHeader {
- public TimeHeaderSimple(Wink min, Wink max) {
- super(min, max, new TimeScaleWink());
- }
-
- @Override
- public void drawTimeHeader(final UGraphic ug, double totalHeight) {
- final double xmin = getTimeScale().getStartingPosition(min);
- final double xmax = getTimeScale().getEndingPosition(max);
- drawSimpleDayCounter(ug, getTimeScale(), totalHeight);
- ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).draw(new ULine(xmax - xmin, 0));
- ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(0, getFullHeaderHeight() - 3))
- .draw(new ULine(xmax - xmin, 0));
-
- }
-
- private void drawSimpleDayCounter(final UGraphic ug, TimeScale timeScale, double totalHeight) {
- final ULine vbar = new ULine(0, totalHeight);
- for (Wink i = min; i.compareTo(max.increment()) <= 0; i = i.increment()) {
- final TextBlock num = Display.getWithNewlines(i.toShortString()).create(getFontConfiguration(10, false),
- HorizontalAlignment.LEFT, new SpriteContainerEmpty());
- final double x1 = timeScale.getStartingPosition(i);
- final double x2 = timeScale.getEndingPosition(i);
- final double width = num.calculateDimension(ug.getStringBounder()).getWidth();
- final double delta = (x2 - x1) - width;
- if (i.compareTo(max.increment()) < 0) {
- num.drawU(ug.apply(new UTranslate(x1 + delta / 2, 0)));
- }
- ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(x1, 0)).draw(vbar);
- }
- }
-
@Override
public double getFullHeaderHeight() {
return getTimeHeaderHeight() + getHeaderNameDayHeight();
@@ -94,4 +63,35 @@ public class TimeHeaderSimple extends TimeHeader {
return 0;
}
+ public TimeHeaderSimple(Wink min, Wink max) {
+ super(min, max, new TimeScaleWink());
+ }
+
+ @Override
+ public void drawTimeHeader(final UGraphic ug, double totalHeight) {
+ final double xmin = getTimeScale().getStartingPosition(min);
+ final double xmax = getTimeScale().getEndingPosition(max);
+ drawSimpleDayCounter(ug, getTimeScale(), totalHeight);
+ ug.apply(new UChangeColor(HColorUtils.LIGHT_GRAY)).draw(ULine.hline(xmax - xmin));
+ ug.apply(new UChangeColor(HColorUtils.LIGHT_GRAY)).apply(UTranslate.dy(getFullHeaderHeight() - 3))
+ .draw(ULine.hline(xmax - xmin));
+
+ }
+
+ private void drawSimpleDayCounter(final UGraphic ug, TimeScale timeScale, double totalHeight) {
+ final ULine vbar = ULine.vline(totalHeight);
+ for (Wink i = min; i.compareTo(max.increment()) <= 0; i = i.increment()) {
+ final TextBlock num = Display.getWithNewlines(i.toShortString()).create(getFontConfiguration(10, false),
+ HorizontalAlignment.LEFT, new SpriteContainerEmpty());
+ final double x1 = timeScale.getStartingPosition(i);
+ final double x2 = timeScale.getEndingPosition(i);
+ final double width = num.calculateDimension(ug.getStringBounder()).getWidth();
+ final double delta = (x2 - x1) - width;
+ if (i.compareTo(max.increment()) < 0) {
+ num.drawU(ug.apply(UTranslate.dx(x1 + delta / 2)));
+ }
+ ug.apply(new UChangeColor(HColorUtils.LIGHT_GRAY)).apply(UTranslate.dx(x1)).draw(vbar);
+ }
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/project/draw/TimeHeaderWeekly.java b/src/net/sourceforge/plantuml/project/draw/TimeHeaderWeekly.java
index d6433515c..5a5837c39 100644
--- a/src/net/sourceforge/plantuml/project/draw/TimeHeaderWeekly.java
+++ b/src/net/sourceforge/plantuml/project/draw/TimeHeaderWeekly.java
@@ -37,152 +37,108 @@ package net.sourceforge.plantuml.project.draw;
import java.util.Map;
-import net.sourceforge.plantuml.SpriteContainerEmpty;
-import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
-import net.sourceforge.plantuml.project.DayAsDate;
-import net.sourceforge.plantuml.project.DayOfWeek;
-import net.sourceforge.plantuml.project.GCalendar;
import net.sourceforge.plantuml.project.LoadPlanable;
-import net.sourceforge.plantuml.project.core.Month;
-import net.sourceforge.plantuml.project.core.Wink;
-import net.sourceforge.plantuml.project.timescale.TimeScaleWeekly;
+import net.sourceforge.plantuml.project.core.PrintScale;
+import net.sourceforge.plantuml.project.time.Day;
+import net.sourceforge.plantuml.project.time.DayOfWeek;
+import net.sourceforge.plantuml.project.time.GCalendar;
+import net.sourceforge.plantuml.project.time.MonthYear;
+import net.sourceforge.plantuml.project.time.Wink;
+import net.sourceforge.plantuml.project.timescale.TimeScaleCompressed;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
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;
public class TimeHeaderWeekly extends TimeHeader {
- private static final int Y_POS_NUMDAY = 16;
-
private double getTimeHeaderHeight() {
- return Y_POS_NUMDAY + 13;
+ return Y_POS_ROW16 + 13;
}
- private final HtmlColor veryLightGray = new HtmlColorSetSimple().getColorIfValid("#E0E8E8");
-
private final GCalendar calendar;
- private final LoadPlanable defaultPlan;
- private final Map colorDays;
- private final Map nameDays;
public TimeHeaderWeekly(GCalendar calendar, Wink min, Wink max, LoadPlanable defaultPlan,
- Map colorDays, Map nameDays) {
- super(min, max, new TimeScaleWeekly(calendar));
+ Map colorDays, Map nameDays) {
+ super(min, max, new TimeScaleCompressed(calendar, PrintScale.WEEKLY.getCompress()));
this.calendar = calendar;
- this.defaultPlan = defaultPlan;
- this.colorDays = colorDays;
- this.nameDays = nameDays;
}
@Override
public void drawTimeHeader(final UGraphic ug, double totalHeight) {
drawCalendar(ug, totalHeight);
drawHline(ug, 0);
- drawHline(ug, Y_POS_NUMDAY);
+ drawHline(ug, Y_POS_ROW16);
drawHline(ug, getFullHeaderHeight());
}
private void drawCalendar(final UGraphic ug, double totalHeight) {
- Month lastMonth = null;
- double lastChangeMonth = -1;
- Wink wink = min;
- while (wink.compareTo(max) <= 0) {
- final DayAsDate day = calendar.toDayAsDate(wink);
- final DayOfWeek dayOfWeek = day.getDayOfWeek();
- final String d1 = "" + day.getDayOfMonth();
- final TextBlock num = getTextBlock(d1, 10, false);
- final double x1 = getTimeScale().getStartingPosition(wink);
- final double x2 = getTimeScale().getEndingPosition(wink);
- double startingY = getFullHeaderHeight();
- if (wink.compareTo(max.increment()) < 0) {
- if (dayOfWeek == DayOfWeek.MONDAY) {
- printLeft(ug.apply(new UTranslate(0, Y_POS_NUMDAY)), num, x1 + 5);
- }
- if (lastMonth != day.getMonth()) {
- startingY = Y_POS_NUMDAY;
- drawVbar(ug, x1, 0, Y_POS_NUMDAY);
- if (lastMonth != null) {
- printMonth(ug, lastMonth, day.getYear(), lastChangeMonth, x1);
- }
- lastChangeMonth = x1;
- lastMonth = day.getMonth();
- }
- }
- if (dayOfWeek == DayOfWeek.MONDAY) {
- drawVbar(ug, x1, Y_POS_NUMDAY, totalHeight);
- }
- wink = wink.increment();
- }
- final DayAsDate day = calendar.toDayAsDate(wink);
- final double x1 = getTimeScale().getStartingPosition(wink);
- if (x1 > lastChangeMonth) {
- printMonth(ug, lastMonth, day.getYear(), lastChangeMonth, x1);
- }
-
- printNamedDays(ug);
-
+ printDaysOfMonth(ug);
+ printSmallVbars(ug, totalHeight);
+ printMonths(ug);
}
- private void printMonth(UGraphic ug, Month lastMonth, int year, double start, double end) {
- final TextBlock small = getTextBlock(lastMonth.shortName(), 12, true);
- final TextBlock big = getTextBlock(lastMonth.shortName() + " " + year, 12, true);
+ private void printMonths(final UGraphic ug) {
+ MonthYear last = null;
+ double lastChangeMonth = -1;
+ for (Wink wink = min; wink.compareTo(max) < 0; wink = wink.increment()) {
+ final Day day = calendar.toDayAsDate(wink);
+ final double x1 = getTimeScale().getStartingPosition(wink);
+ if (day.monthYear().equals(last) == false) {
+ drawVbar(ug, x1, 0, Y_POS_ROW16);
+ if (last != null) {
+ printMonth(ug, last, lastChangeMonth, x1);
+ }
+ lastChangeMonth = x1;
+ last = day.monthYear();
+ }
+ }
+ final double x1 = getTimeScale().getStartingPosition(max.increment());
+ if (x1 > lastChangeMonth) {
+ printMonth(ug, last, lastChangeMonth, x1);
+ }
+ }
+
+ private void printSmallVbars(final UGraphic ug, double totalHeight) {
+ for (Wink wink = min; wink.compareTo(max) <= 0; wink = wink.increment()) {
+ if (calendar.toDayAsDate(wink).getDayOfWeek() == DayOfWeek.MONDAY) {
+ drawVbar(ug, getTimeScale().getStartingPosition(wink), Y_POS_ROW16, totalHeight);
+ }
+ }
+ }
+
+ private void printDaysOfMonth(final UGraphic ug) {
+ for (Wink wink = min; wink.compareTo(max) < 0; wink = wink.increment()) {
+ final Day day = calendar.toDayAsDate(wink);
+ if (day.getDayOfWeek() == DayOfWeek.MONDAY) {
+ printLeft(ug.apply(UTranslate.dy(Y_POS_ROW16)), getTextBlock("" + day.getDayOfMonth(), 10, false),
+ getTimeScale().getStartingPosition(wink) + 5);
+ }
+ }
+ }
+
+ private void printMonth(UGraphic ug, MonthYear monthYear, double start, double end) {
+ final TextBlock small = getTextBlock(monthYear.shortName(), 12, true);
+ final TextBlock big = getTextBlock(monthYear.shortNameYYYY(), 12, true);
printCentered(ug, start, end, small, big);
}
private void drawVbar(UGraphic ug, double x, double y1, double y2) {
- final ULine vbar = new ULine(0, y2 - y1);
- ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(x, y1)).draw(vbar);
- }
-
- private void printNamedDays(final UGraphic ug) {
-// if (nameDays.size() > 0) {
-// String last = null;
-// for (Wink wink = min; wink.compareTo(max.increment()) <= 0; wink = wink.increment()) {
-// final DayAsDate tmpday = calendar.toDayAsDate(wink);
-// final String name = nameDays.get(tmpday);
-// if (name != null && name.equals(last) == false) {
-// final double x1 = getTimeScale().getStartingPosition(wink);
-// final double x2 = getTimeScale().getEndingPosition(wink);
-// final TextBlock label = getTextBlock(name, 12, false);
-// final double h = label.calculateDimension(ug.getStringBounder()).getHeight();
-// double y1 = getTimeHeaderHeight();
-// double y2 = getFullHeaderHeight();
-// label.drawU(ug.apply(new UTranslate(x1, Y_POS_NUMDAY + 11)));
-// }
-// last = name;
-// }
-// }
+ final ULine vbar = ULine.vline(y2 - y1);
+ ug.apply(new UChangeColor(HColorUtils.LIGHT_GRAY)).apply(new UTranslate(x, y1)).draw(vbar);
}
private void printLeft(UGraphic ug, TextBlock text, double start) {
- text.drawU(ug.apply(new UTranslate(start, 0)));
+ text.drawU(ug.apply(UTranslate.dx(start)));
}
@Override
public double getFullHeaderHeight() {
- return getTimeHeaderHeight() + getHeaderNameDayHeight();
+ return getTimeHeaderHeight();
}
- private double getHeaderNameDayHeight() {
-// if (nameDays.size() > 0) {
-// return 16;
-// }
- return 0;
- }
-
-// private void drawCenter(final UGraphic ug, final TextBlock text, final double x1, final double x2) {
-// final double width = text.calculateDimension(ug.getStringBounder()).getWidth();
-// final double delta = (x2 - x1) - width;
-// if (delta < 0) {
-// return;
-// }
-// text.drawU(ug.apply(new UTranslate(x1 + delta / 2, 0)));
-// }
}
diff --git a/src/net/sourceforge/plantuml/project/lang/ComplementColors.java b/src/net/sourceforge/plantuml/project/lang/ComplementColors.java
index 4bb445c1f..d2bc2f068 100644
--- a/src/net/sourceforge/plantuml/project/lang/ComplementColors.java
+++ b/src/net/sourceforge/plantuml/project/lang/ComplementColors.java
@@ -35,17 +35,17 @@
*/
package net.sourceforge.plantuml.project.lang;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class ComplementColors implements Complement {
- private final HtmlColor center;
- private final HtmlColor border;
+ private final HColor center;
+ private final HColor border;
- public ComplementColors(HtmlColor center, HtmlColor border) {
+ public ComplementColors(HColor center, HColor border) {
this.center = center;
this.border = border;
}
@@ -67,7 +67,7 @@ public class ComplementColors implements Complement {
return center != null;
}
- public HtmlColor getCenter() {
+ public HColor getCenter() {
return center;
}
}
diff --git a/src/net/sourceforge/plantuml/project/lang/ComplementDate.java b/src/net/sourceforge/plantuml/project/lang/ComplementDate.java
index e4cdb55ee..1285d6c5b 100644
--- a/src/net/sourceforge/plantuml/project/lang/ComplementDate.java
+++ b/src/net/sourceforge/plantuml/project/lang/ComplementDate.java
@@ -40,10 +40,10 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayAsDate;
import net.sourceforge.plantuml.project.Failable;
import net.sourceforge.plantuml.project.GanttDiagram;
-import net.sourceforge.plantuml.project.core.Month;
+import net.sourceforge.plantuml.project.time.Day;
+import net.sourceforge.plantuml.project.time.Month;
public class ComplementDate implements ComplementPattern {
@@ -115,20 +115,20 @@ public class ComplementDate implements ComplementPattern {
final int day = Integer.parseInt(arg.get("ADAY" + suffix, 0));
final String month = arg.get("AMONTH" + suffix, 0);
final int year = Integer.parseInt(arg.get("AYEAR" + suffix, 0));
- return DayAsDate.create(year, month, day);
+ return Day.create(year, month, day);
}
private Complement resultB(RegexResult arg, String suffix) {
final int day = Integer.parseInt(arg.get("BDAY" + suffix, 0));
final int month = Integer.parseInt(arg.get("BMONTH" + suffix, 0));
final int year = Integer.parseInt(arg.get("BYEAR" + suffix, 0));
- return DayAsDate.create(year, month, day);
+ return Day.create(year, month, day);
}
private Complement resultC(RegexResult arg, String suffix) {
final int day = Integer.parseInt(arg.get("CDAY" + suffix, 0));
final String month = arg.get("CMONTH" + suffix, 0);
final int year = Integer.parseInt(arg.get("CYEAR" + suffix, 0));
- return DayAsDate.create(year, month, day);
+ return Day.create(year, month, day);
}
}
diff --git a/src/net/sourceforge/plantuml/project/lang/ComplementDates.java b/src/net/sourceforge/plantuml/project/lang/ComplementDates.java
index 7cbb13e74..398ec934b 100644
--- a/src/net/sourceforge/plantuml/project/lang/ComplementDates.java
+++ b/src/net/sourceforge/plantuml/project/lang/ComplementDates.java
@@ -39,10 +39,10 @@ import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayAsDate;
import net.sourceforge.plantuml.project.DaysAsDates;
import net.sourceforge.plantuml.project.Failable;
import net.sourceforge.plantuml.project.GanttDiagram;
+import net.sourceforge.plantuml.project.time.Day;
public class ComplementDates implements ComplementPattern {
@@ -66,16 +66,16 @@ public class ComplementDates implements ComplementPattern {
}
public Subject getSubject(GanttDiagram project, RegexResult arg) {
- final DayAsDate date1 = getDate(arg, "1");
- final DayAsDate date2 = getDate(arg, "2");
+ final Day date1 = getDate(arg, "1");
+ final Day date2 = getDate(arg, "2");
return new DaysAsDates(date1, date2);
}
- private DayAsDate getDate(RegexResult arg, String suffix) {
+ private Day getDate(RegexResult arg, String suffix) {
final int day = Integer.parseInt(arg.get("DAY" + suffix, 0));
final int month = Integer.parseInt(arg.get("MONTH" + suffix, 0));
final int year = Integer.parseInt(arg.get("YEAR" + suffix, 0));
- return DayAsDate.create(year, month, day);
+ return Day.create(year, month, day);
}
public Failable getComplement(GanttDiagram system, RegexResult arg, String suffix) {
@@ -83,12 +83,12 @@ public class ComplementDates implements ComplementPattern {
final int day1 = Integer.parseInt(arg.get("DAY1" + suffix, 0));
final int month1 = Integer.parseInt(arg.get("MONTH1" + suffix, 0));
final int year1 = Integer.parseInt(arg.get("YEAR1" + suffix, 0));
- final DayAsDate date1 = DayAsDate.create(year1, month1, day1);
+ final Day date1 = Day.create(year1, month1, day1);
final int day2 = Integer.parseInt(arg.get("DAY2" + suffix, 0));
final int month2 = Integer.parseInt(arg.get("MONTH2" + suffix, 0));
final int year2 = Integer.parseInt(arg.get("YEAR2" + suffix, 0));
- final DayAsDate date2 = DayAsDate.create(year2, month2, day2);
+ final Day date2 = Day.create(year2, month2, day2);
return Failable. ok(new DaysAsDates(date1, date2));
}
diff --git a/src/net/sourceforge/plantuml/project/lang/ComplementDayOfWeek.java b/src/net/sourceforge/plantuml/project/lang/ComplementDayOfWeek.java
index 416352281..bd365d2e3 100644
--- a/src/net/sourceforge/plantuml/project/lang/ComplementDayOfWeek.java
+++ b/src/net/sourceforge/plantuml/project/lang/ComplementDayOfWeek.java
@@ -39,9 +39,9 @@ import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayOfWeek;
import net.sourceforge.plantuml.project.Failable;
import net.sourceforge.plantuml.project.GanttDiagram;
+import net.sourceforge.plantuml.project.time.DayOfWeek;
public class ComplementDayOfWeek implements ComplementPattern {
diff --git a/src/net/sourceforge/plantuml/project/lang/ComplementInColors.java b/src/net/sourceforge/plantuml/project/lang/ComplementInColors.java
index 0c9b5b68c..289c0b5d5 100644
--- a/src/net/sourceforge/plantuml/project/lang/ComplementInColors.java
+++ b/src/net/sourceforge/plantuml/project/lang/ComplementInColors.java
@@ -38,9 +38,9 @@ package net.sourceforge.plantuml.project.lang;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.project.Failable;
import net.sourceforge.plantuml.project.GanttDiagram;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class ComplementInColors implements ComplementPattern {
@@ -51,8 +51,8 @@ public class ComplementInColors implements ComplementPattern {
public Failable getComplement(GanttDiagram system, RegexResult arg, String suffix) {
final String color1 = arg.get("COMPLEMENT" + suffix, 0);
final String color2 = arg.get("COMPLEMENT" + suffix, 1);
- final HtmlColor col1 = system.getIHtmlColorSet().getColorIfValid(color1);
- final HtmlColor col2 = system.getIHtmlColorSet().getColorIfValid(color2);
+ final HColor col1 = system.getIHtmlColorSet().getColorIfValid(color1);
+ final HColor col2 = system.getIHtmlColorSet().getColorIfValid(color2);
return Failable. ok(new ComplementColors(col1, col2));
}
}
diff --git a/src/net/sourceforge/plantuml/project/lang/ComplementInColors2.java b/src/net/sourceforge/plantuml/project/lang/ComplementInColors2.java
index fb1b504c2..5dea97234 100644
--- a/src/net/sourceforge/plantuml/project/lang/ComplementInColors2.java
+++ b/src/net/sourceforge/plantuml/project/lang/ComplementInColors2.java
@@ -38,9 +38,9 @@ package net.sourceforge.plantuml.project.lang;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.project.Failable;
import net.sourceforge.plantuml.project.GanttDiagram;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class ComplementInColors2 implements ComplementPattern {
@@ -51,8 +51,8 @@ public class ComplementInColors2 implements ComplementPattern {
public Failable getComplement(GanttDiagram system, RegexResult arg, String suffix) {
final String color1 = arg.get("COMPLEMENT" + suffix, 0);
final String color2 = arg.get("COMPLEMENT" + suffix, 1);
- final HtmlColor col1 = system.getIHtmlColorSet().getColorIfValid(color1);
- final HtmlColor col2 = system.getIHtmlColorSet().getColorIfValid(color2);
+ final HColor col1 = system.getIHtmlColorSet().getColorIfValid(color1);
+ final HColor col2 = system.getIHtmlColorSet().getColorIfValid(color2);
return Failable. ok(new ComplementColors(col1, col2));
}
}
diff --git a/src/net/sourceforge/plantuml/project/lang/SubjectDayAsDate.java b/src/net/sourceforge/plantuml/project/lang/SubjectDayAsDate.java
index 55992f2b8..083c2f07e 100644
--- a/src/net/sourceforge/plantuml/project/lang/SubjectDayAsDate.java
+++ b/src/net/sourceforge/plantuml/project/lang/SubjectDayAsDate.java
@@ -42,8 +42,8 @@ import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayAsDate;
import net.sourceforge.plantuml.project.GanttDiagram;
+import net.sourceforge.plantuml.project.time.Day;
public class SubjectDayAsDate implements SubjectPattern {
@@ -64,7 +64,7 @@ public class SubjectDayAsDate implements SubjectPattern {
final int day = Integer.parseInt(arg.get("DAY", 0));
final int month = Integer.parseInt(arg.get("MONTH", 0));
final int year = Integer.parseInt(arg.get("YEAR", 0));
- return DayAsDate.create(year, month, day);
+ return Day.create(year, month, day);
}
}
diff --git a/src/net/sourceforge/plantuml/project/lang/SubjectDayOfWeek.java b/src/net/sourceforge/plantuml/project/lang/SubjectDayOfWeek.java
index 5f2ab8192..5fe23c476 100644
--- a/src/net/sourceforge/plantuml/project/lang/SubjectDayOfWeek.java
+++ b/src/net/sourceforge/plantuml/project/lang/SubjectDayOfWeek.java
@@ -41,8 +41,8 @@ import java.util.Collection;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayOfWeek;
import net.sourceforge.plantuml.project.GanttDiagram;
+import net.sourceforge.plantuml.project.time.DayOfWeek;
public class SubjectDayOfWeek implements SubjectPattern {
diff --git a/src/net/sourceforge/plantuml/project/lang/SubjectDaysAsDates.java b/src/net/sourceforge/plantuml/project/lang/SubjectDaysAsDates.java
index 95398e7a5..6ea25f9a3 100644
--- a/src/net/sourceforge/plantuml/project/lang/SubjectDaysAsDates.java
+++ b/src/net/sourceforge/plantuml/project/lang/SubjectDaysAsDates.java
@@ -43,9 +43,9 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayAsDate;
import net.sourceforge.plantuml.project.DaysAsDates;
import net.sourceforge.plantuml.project.GanttDiagram;
+import net.sourceforge.plantuml.project.time.Day;
public class SubjectDaysAsDates implements SubjectPattern {
@@ -107,26 +107,26 @@ public class SubjectDaysAsDates implements SubjectPattern {
public Subject getSubject(GanttDiagram project, RegexResult arg) {
final String countAnd = arg.get("COUNT_AND", 0);
if (countAnd != null) {
- final DayAsDate date3 = getDate(arg, "3");
+ final Day date3 = getDate(arg, "3");
final int nb = Integer.parseInt(countAnd);
return new DaysAsDates(project, date3, nb);
}
final String countThen = arg.get("COUNT_THEN", 0);
if (countThen != null) {
- final DayAsDate date3 = project.getThenDate();
+ final Day date3 = project.getThenDate();
final int nb = Integer.parseInt(countThen);
return new DaysAsDates(project, date3, nb);
}
- final DayAsDate date1 = getDate(arg, "1");
- final DayAsDate date2 = getDate(arg, "2");
+ final Day date1 = getDate(arg, "1");
+ final Day date2 = getDate(arg, "2");
return new DaysAsDates(date1, date2);
}
- private DayAsDate getDate(RegexResult arg, String suffix) {
+ private Day getDate(RegexResult arg, String suffix) {
final int day = Integer.parseInt(arg.get("DAY" + suffix, 0));
final int month = Integer.parseInt(arg.get("MONTH" + suffix, 0));
final int year = Integer.parseInt(arg.get("YEAR" + suffix, 0));
- return DayAsDate.create(year, month, day);
+ return Day.create(year, month, day);
}
}
diff --git a/src/net/sourceforge/plantuml/project/lang/VerbAre.java b/src/net/sourceforge/plantuml/project/lang/VerbAre.java
index 188e25d88..82d341320 100644
--- a/src/net/sourceforge/plantuml/project/lang/VerbAre.java
+++ b/src/net/sourceforge/plantuml/project/lang/VerbAre.java
@@ -42,8 +42,8 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayOfWeek;
import net.sourceforge.plantuml.project.GanttDiagram;
+import net.sourceforge.plantuml.project.time.DayOfWeek;
public class VerbAre implements VerbPattern {
diff --git a/src/net/sourceforge/plantuml/project/lang/VerbHappens.java b/src/net/sourceforge/plantuml/project/lang/VerbHappens.java
index c17a697d8..68d15dd8f 100644
--- a/src/net/sourceforge/plantuml/project/lang/VerbHappens.java
+++ b/src/net/sourceforge/plantuml/project/lang/VerbHappens.java
@@ -42,11 +42,11 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayAsDate;
import net.sourceforge.plantuml.project.GanttDiagram;
import net.sourceforge.plantuml.project.Load;
import net.sourceforge.plantuml.project.core.Task;
import net.sourceforge.plantuml.project.core.TaskInstant;
+import net.sourceforge.plantuml.project.time.Day;
public class VerbHappens implements VerbPattern {
@@ -63,9 +63,9 @@ public class VerbHappens implements VerbPattern {
public CommandExecutionResult execute(Subject subject, Complement complement) {
final Task task = (Task) subject;
task.setLoad(Load.inWinks(1));
- if (complement instanceof DayAsDate) {
- final DayAsDate start = (DayAsDate) complement;
- final DayAsDate startingDate = project.getStartingDate();
+ if (complement instanceof Day) {
+ final Day start = (Day) complement;
+ final Day startingDate = project.getStartingDate();
if (startingDate == null) {
return CommandExecutionResult.error("No starting date for the project");
}
diff --git a/src/net/sourceforge/plantuml/project/lang/VerbIsForToday.java b/src/net/sourceforge/plantuml/project/lang/VerbIsForToday.java
index 030df6334..abf45bd79 100644
--- a/src/net/sourceforge/plantuml/project/lang/VerbIsForToday.java
+++ b/src/net/sourceforge/plantuml/project/lang/VerbIsForToday.java
@@ -42,8 +42,8 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayAsDate;
import net.sourceforge.plantuml.project.GanttDiagram;
+import net.sourceforge.plantuml.project.time.Day;
public class VerbIsForToday implements VerbPattern {
@@ -59,7 +59,7 @@ public class VerbIsForToday implements VerbPattern {
return new Verb() {
public CommandExecutionResult execute(Subject subject, Complement complement) {
// final Today task = (Today) subject;
- final DayAsDate date = (DayAsDate) complement;
+ final Day date = (Day) complement;
return project.setToday(date);
}
};
diff --git a/src/net/sourceforge/plantuml/project/lang/VerbIsOff.java b/src/net/sourceforge/plantuml/project/lang/VerbIsOff.java
index 285ea496a..b7d46c522 100644
--- a/src/net/sourceforge/plantuml/project/lang/VerbIsOff.java
+++ b/src/net/sourceforge/plantuml/project/lang/VerbIsOff.java
@@ -44,11 +44,11 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayAsDate;
-import net.sourceforge.plantuml.project.DayOfWeek;
import net.sourceforge.plantuml.project.DaysAsDates;
import net.sourceforge.plantuml.project.GanttDiagram;
import net.sourceforge.plantuml.project.core.Resource;
+import net.sourceforge.plantuml.project.time.Day;
+import net.sourceforge.plantuml.project.time.DayOfWeek;
public class VerbIsOff implements VerbPattern {
@@ -77,11 +77,11 @@ public class VerbIsOff implements VerbPattern {
if (complement instanceof DayOfWeek) {
resource.addCloseDay(((DayOfWeek) complement));
} else if (complement instanceof DaysAsDates) {
- for (DayAsDate when : (DaysAsDates) complement) {
+ for (Day when : (DaysAsDates) complement) {
resource.addCloseDay(project.convert(when));
}
} else {
- final DayAsDate when = (DayAsDate) complement;
+ final Day when = (Day) complement;
resource.addCloseDay(project.convert(when));
}
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/project/lang/VerbIsOn.java b/src/net/sourceforge/plantuml/project/lang/VerbIsOn.java
index 44003c446..1fba48b3b 100644
--- a/src/net/sourceforge/plantuml/project/lang/VerbIsOn.java
+++ b/src/net/sourceforge/plantuml/project/lang/VerbIsOn.java
@@ -44,10 +44,10 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayAsDate;
import net.sourceforge.plantuml.project.DaysAsDates;
import net.sourceforge.plantuml.project.GanttDiagram;
import net.sourceforge.plantuml.project.core.Resource;
+import net.sourceforge.plantuml.project.time.Day;
public class VerbIsOn implements VerbPattern {
@@ -74,11 +74,11 @@ public class VerbIsOn implements VerbPattern {
public CommandExecutionResult execute(Subject subject, Complement complement) {
final Resource resource = (Resource) subject;
if (complement instanceof DaysAsDates) {
- for (DayAsDate when : (DaysAsDates) complement) {
+ for (Day when : (DaysAsDates) complement) {
resource.addForceOnDay(project.convert(when));
}
} else {
- final DayAsDate when = (DayAsDate) complement;
+ final Day when = (Day) complement;
resource.addForceOnDay(project.convert(when));
}
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/project/lang/VerbIsOrAre.java b/src/net/sourceforge/plantuml/project/lang/VerbIsOrAre.java
index dd639b263..efb6f22d1 100644
--- a/src/net/sourceforge/plantuml/project/lang/VerbIsOrAre.java
+++ b/src/net/sourceforge/plantuml/project/lang/VerbIsOrAre.java
@@ -42,10 +42,10 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.project.DayAsDate;
import net.sourceforge.plantuml.project.DaysAsDates;
import net.sourceforge.plantuml.project.GanttDiagram;
+import net.sourceforge.plantuml.project.time.Day;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class VerbIsOrAre implements VerbPattern {
@@ -62,7 +62,7 @@ public class VerbIsOrAre implements VerbPattern {
return new Verb() {
public CommandExecutionResult execute(Subject subject, Complement complement) {
if (complement instanceof ComplementColors) {
- final HtmlColor color = ((ComplementColors) complement).getCenter();
+ final HColor color = ((ComplementColors) complement).getCenter();
return manageColor(project, subject, color);
}
if (complement == ComplementClose.CLOSE) {
@@ -76,14 +76,14 @@ public class VerbIsOrAre implements VerbPattern {
};
}
- private CommandExecutionResult manageColor(final GanttDiagram project, Subject subject, HtmlColor color) {
- if (subject instanceof DayAsDate) {
- final DayAsDate day = (DayAsDate) subject;
+ private CommandExecutionResult manageColor(final GanttDiagram project, Subject subject, HColor color) {
+ if (subject instanceof Day) {
+ final Day day = (Day) subject;
project.colorDay(day, color);
}
if (subject instanceof DaysAsDates) {
final DaysAsDates days = (DaysAsDates) subject;
- for (DayAsDate d : days) {
+ for (Day d : days) {
project.colorDay(d, color);
}
}
@@ -91,13 +91,13 @@ public class VerbIsOrAre implements VerbPattern {
}
private CommandExecutionResult manageClose(final GanttDiagram project, Subject subject) {
- if (subject instanceof DayAsDate) {
- final DayAsDate day = (DayAsDate) subject;
+ if (subject instanceof Day) {
+ final Day day = (Day) subject;
project.closeDayAsDate(day);
}
if (subject instanceof DaysAsDates) {
final DaysAsDates days = (DaysAsDates) subject;
- for (DayAsDate d : days) {
+ for (Day d : days) {
project.closeDayAsDate(d);
}
}
@@ -105,13 +105,13 @@ public class VerbIsOrAre implements VerbPattern {
}
private CommandExecutionResult manageOpen(final GanttDiagram project, Subject subject) {
- if (subject instanceof DayAsDate) {
- final DayAsDate day = (DayAsDate) subject;
+ if (subject instanceof Day) {
+ final Day day = (Day) subject;
project.openDayAsDate(day);
}
if (subject instanceof DaysAsDates) {
final DaysAsDates days = (DaysAsDates) subject;
- for (DayAsDate d : days) {
+ for (Day d : days) {
project.openDayAsDate(d);
}
}
diff --git a/src/net/sourceforge/plantuml/project/lang/VerbIsOrAreNamed.java b/src/net/sourceforge/plantuml/project/lang/VerbIsOrAreNamed.java
index 01062ee21..45ddfc761 100644
--- a/src/net/sourceforge/plantuml/project/lang/VerbIsOrAreNamed.java
+++ b/src/net/sourceforge/plantuml/project/lang/VerbIsOrAreNamed.java
@@ -42,9 +42,9 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayAsDate;
import net.sourceforge.plantuml.project.DaysAsDates;
import net.sourceforge.plantuml.project.GanttDiagram;
+import net.sourceforge.plantuml.project.time.Day;
public class VerbIsOrAreNamed implements VerbPattern {
@@ -62,7 +62,7 @@ public class VerbIsOrAreNamed implements VerbPattern {
final ComplementName named = (ComplementName) complement;
final String name = named.getName();
final DaysAsDates days = (DaysAsDates) subject;
- for (DayAsDate d : days) {
+ for (Day d : days) {
project.nameDay(d, name);
}
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/project/lang/VerbProjectStarts.java b/src/net/sourceforge/plantuml/project/lang/VerbProjectStarts.java
index 2d0b047fc..bae17615c 100644
--- a/src/net/sourceforge/plantuml/project/lang/VerbProjectStarts.java
+++ b/src/net/sourceforge/plantuml/project/lang/VerbProjectStarts.java
@@ -45,8 +45,8 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayAsDate;
import net.sourceforge.plantuml.project.GanttDiagram;
+import net.sourceforge.plantuml.project.time.Day;
public class VerbProjectStarts implements VerbPattern {
@@ -74,7 +74,7 @@ public class VerbProjectStarts implements VerbPattern {
public Verb getVerb(final GanttDiagram project, RegexResult arg) {
return new Verb() {
public CommandExecutionResult execute(Subject subject, Complement complement) {
- final DayAsDate start = (DayAsDate) complement;
+ final Day start = (Day) complement;
assert project == subject;
project.setStartingDate(start);
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/project/lang/VerbTaskEndsAbsolute.java b/src/net/sourceforge/plantuml/project/lang/VerbTaskEndsAbsolute.java
index 10d44afd4..11d3276dd 100644
--- a/src/net/sourceforge/plantuml/project/lang/VerbTaskEndsAbsolute.java
+++ b/src/net/sourceforge/plantuml/project/lang/VerbTaskEndsAbsolute.java
@@ -42,9 +42,9 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayAsDate;
import net.sourceforge.plantuml.project.GanttDiagram;
import net.sourceforge.plantuml.project.core.Task;
+import net.sourceforge.plantuml.project.time.Day;
public class VerbTaskEndsAbsolute implements VerbPattern {
@@ -60,8 +60,8 @@ public class VerbTaskEndsAbsolute implements VerbPattern {
return new Verb() {
public CommandExecutionResult execute(Subject subject, Complement complement) {
final Task task = (Task) subject;
- final DayAsDate end = (DayAsDate) complement;
- final DayAsDate startingDate = project.getStartingDate();
+ final Day end = (Day) complement;
+ final Day startingDate = project.getStartingDate();
if (startingDate == null) {
return CommandExecutionResult.error("No starting date for the project");
}
diff --git a/src/net/sourceforge/plantuml/project/lang/VerbTaskStartsAbsolute.java b/src/net/sourceforge/plantuml/project/lang/VerbTaskStartsAbsolute.java
index 22dee2089..f021a74e4 100644
--- a/src/net/sourceforge/plantuml/project/lang/VerbTaskStartsAbsolute.java
+++ b/src/net/sourceforge/plantuml/project/lang/VerbTaskStartsAbsolute.java
@@ -42,9 +42,9 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.project.DayAsDate;
import net.sourceforge.plantuml.project.GanttDiagram;
import net.sourceforge.plantuml.project.core.Task;
+import net.sourceforge.plantuml.project.time.Day;
public class VerbTaskStartsAbsolute implements VerbPattern {
@@ -60,8 +60,8 @@ public class VerbTaskStartsAbsolute implements VerbPattern {
return new Verb() {
public CommandExecutionResult execute(Subject subject, Complement complement) {
final Task task = (Task) subject;
- final DayAsDate start = (DayAsDate) complement;
- final DayAsDate startingDate = project.getStartingDate();
+ final Day start = (Day) complement;
+ final Day startingDate = project.getStartingDate();
if (startingDate == null) {
return CommandExecutionResult.error("No starting date for the project");
}
diff --git a/src/net/sourceforge/plantuml/project/DayAsDate.java b/src/net/sourceforge/plantuml/project/time/Day.java
similarity index 69%
rename from src/net/sourceforge/plantuml/project/DayAsDate.java
rename to src/net/sourceforge/plantuml/project/time/Day.java
index a9b0b97e3..8464465a5 100644
--- a/src/net/sourceforge/plantuml/project/DayAsDate.java
+++ b/src/net/sourceforge/plantuml/project/time/Day.java
@@ -33,30 +33,27 @@
*
*
*/
-package net.sourceforge.plantuml.project;
+package net.sourceforge.plantuml.project.time;
import java.util.Date;
-import net.sourceforge.plantuml.project.core.Month;
-import net.sourceforge.plantuml.project.core.Wink;
import net.sourceforge.plantuml.project.lang.Complement;
import net.sourceforge.plantuml.project.lang.Subject;
-public class DayAsDate implements Complement, Comparable, Subject {
+public class Day implements Complement, Comparable, Subject {
- private final int year;
private final int dayOfMonth;
- private final Month month;
+ private final MonthYear monthYear;
- public static DayAsDate create(int year, String month, int dayOfMonth) {
- return new DayAsDate(year, Month.fromString(month), dayOfMonth);
+ public static Day create(int year, String month, int dayOfMonth) {
+ return new Day(year, Month.fromString(month), dayOfMonth);
}
- public static DayAsDate create(int year, int month, int dayOfMonth) {
- return new DayAsDate(year, Month.values()[month - 1], dayOfMonth);
+ public static Day create(int year, int month, int dayOfMonth) {
+ return new Day(year, Month.values()[month - 1], dayOfMonth);
}
- public static DayAsDate today() {
+ public static Day today() {
final Date now = new Date();
final int year = now.getYear() + 1900;
final int month = now.getMonth() + 1;
@@ -64,33 +61,36 @@ public class DayAsDate implements Complement, Comparable, Subject {
return create(year, month, dayOfMonth);
}
- private DayAsDate(int year, Month month, int dayOfMonth) {
- this.year = year;
- this.dayOfMonth = dayOfMonth;
- this.month = month;
+ private Day(int year, Month month, int dayOfMonth) {
+ this(MonthYear.create(year, month), dayOfMonth);
}
- public int getYear() {
- return year;
+ private Day(MonthYear monthYear, int dayOfMonth) {
+ this.dayOfMonth = dayOfMonth;
+ this.monthYear = monthYear;
+ }
+
+ public int year() {
+ return monthYear.year();
}
private int internalNumber() {
- return year * 100 * 100 + month.ordinal() * 100 + dayOfMonth;
+ return year() * 100 * 100 + month().ordinal() * 100 + dayOfMonth;
}
@Override
public String toString() {
- return "" + year + "/" + month + "/" + dayOfMonth;
+ return monthYear.toString() + "/" + dayOfMonth;
}
@Override
public int hashCode() {
- return year * 113 + dayOfMonth * 17 + month.hashCode();
+ return monthYear.hashCode() + dayOfMonth * 17;
}
@Override
public boolean equals(Object obj) {
- final DayAsDate other = (DayAsDate) obj;
+ final Day other = (Day) obj;
return other.internalNumber() == this.internalNumber();
}
@@ -99,42 +99,43 @@ public class DayAsDate implements Complement, Comparable, Subject {
}
private int daysPerMonth() {
- return month.getDaysPerMonth(year);
+ return month().getDaysPerMonth(year());
}
- public DayAsDate next() {
+ public Day next() {
int newDayOfMonth = dayOfMonth + 1;
if (newDayOfMonth <= daysPerMonth()) {
- return new DayAsDate(year, month, newDayOfMonth);
+ return new Day(year(), month(), newDayOfMonth);
}
assert newDayOfMonth > daysPerMonth();
- newDayOfMonth = 1;
- final Month newMonth = month.next();
- final int newYear = newMonth == Month.JANUARY ? year + 1 : year;
- return new DayAsDate(newYear, newMonth, newDayOfMonth);
+ return new Day(monthYear.next(), 1);
}
- public Month getMonth() {
- return month;
+ public Month month() {
+ return monthYear.month();
+ }
+
+ public MonthYear monthYear() {
+ return monthYear;
}
// https://en.wikipedia.org/wiki/Zeller%27s_congruence
public DayOfWeek getDayOfWeek() {
final int q = dayOfMonth;
- final int m = month.m();
- final int y = m >= 13 ? year - 1 : year;
+ final int m = month().m();
+ final int y = m >= 13 ? year() - 1 : year();
final int k = y % 100;
final int j = y / 100;
final int h = ((q + 13 * (m + 1) / 5) + k + k / 4 + j / 4 + 5 * j) % 7;
return DayOfWeek.fromH(h);
}
- public Wink asInstantDay(DayAsDate reference) {
+ public Wink asInstantDay(Day reference) {
// if (this.compareTo(reference) < 0) {
// throw new IllegalArgumentException();
// }
int cmp = 0;
- DayAsDate current = reference;
+ Day current = reference;
while (current.compareTo(this) < 0) {
current = current.next();
cmp++;
@@ -144,8 +145,8 @@ public class DayAsDate implements Complement, Comparable, Subject {
// http://www.proesite.com/timex/wkcalc.htm
public int ISO_WN() {
- final int y = year;
- int m = month.ordinal() + 1;
+ final int y = year();
+ int m = month().ordinal() + 1;
int d = dayOfMonth;
int dow = DOW(y, m, d);
int dow0101 = DOW(y, 1, 1);
@@ -174,7 +175,7 @@ public class DayAsDate implements Complement, Comparable, Subject {
return 0;
}
- public int compareTo(DayAsDate other) {
+ public int compareTo(Day other) {
return this.internalNumber() - other.internalNumber();
}
diff --git a/src/net/sourceforge/plantuml/project/DayOfWeek.java b/src/net/sourceforge/plantuml/project/time/DayOfWeek.java
similarity index 98%
rename from src/net/sourceforge/plantuml/project/DayOfWeek.java
rename to src/net/sourceforge/plantuml/project/time/DayOfWeek.java
index 37bcdb160..db268f486 100644
--- a/src/net/sourceforge/plantuml/project/DayOfWeek.java
+++ b/src/net/sourceforge/plantuml/project/time/DayOfWeek.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.project;
+package net.sourceforge.plantuml.project.time;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.project.lang.Complement;
diff --git a/src/net/sourceforge/plantuml/project/GCalendar.java b/src/net/sourceforge/plantuml/project/time/GCalendar.java
similarity index 84%
rename from src/net/sourceforge/plantuml/project/GCalendar.java
rename to src/net/sourceforge/plantuml/project/time/GCalendar.java
index 05090b701..c0f359524 100644
--- a/src/net/sourceforge/plantuml/project/GCalendar.java
+++ b/src/net/sourceforge/plantuml/project/time/GCalendar.java
@@ -33,20 +33,18 @@
*
*
*/
-package net.sourceforge.plantuml.project;
-
-import net.sourceforge.plantuml.project.core.Wink;
+package net.sourceforge.plantuml.project.time;
public class GCalendar {
- private final DayAsDate start;
+ private final Day start;
- public GCalendar(DayAsDate start) {
+ public GCalendar(Day start) {
this.start = start;
}
- public DayAsDate toDayAsDate(Wink day) {
- DayAsDate result = start;
+ public Day toDayAsDate(Wink day) {
+ Day result = start;
final int target = day.getWink();
int work = 0;
while (work < target) {
@@ -56,7 +54,7 @@ public class GCalendar {
return result;
}
- public Wink fromDayAsDate(DayAsDate day) {
+ public Wink fromDayAsDate(Day day) {
if (day.compareTo(start) < 0) {
throw new IllegalArgumentException();
}
@@ -67,7 +65,7 @@ public class GCalendar {
return result;
}
- public DayAsDate getStartingDate() {
+ public Day getStartingDate() {
return start;
}
diff --git a/src/net/sourceforge/plantuml/project/core/Month.java b/src/net/sourceforge/plantuml/project/time/Month.java
similarity index 95%
rename from src/net/sourceforge/plantuml/project/core/Month.java
rename to src/net/sourceforge/plantuml/project/time/Month.java
index 73528c4fc..1b6bb8351 100644
--- a/src/net/sourceforge/plantuml/project/core/Month.java
+++ b/src/net/sourceforge/plantuml/project/time/Month.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.project.core;
+package net.sourceforge.plantuml.project.time;
import net.sourceforge.plantuml.StringUtils;
@@ -49,10 +49,10 @@ public enum Month {
}
public String shortName() {
- return niceName().substring(0, 3);
+ return longName().substring(0, 3);
}
- public String niceName() {
+ public String longName() {
return StringUtils.capitalize(name());
}
diff --git a/src/net/sourceforge/plantuml/project/time/MonthYear.java b/src/net/sourceforge/plantuml/project/time/MonthYear.java
new file mode 100644
index 000000000..9a62258dc
--- /dev/null
+++ b/src/net/sourceforge/plantuml/project/time/MonthYear.java
@@ -0,0 +1,109 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009-2020, Arnaud Roques
+ *
+ * Project Info: http://plantuml.com
+ *
+ * If you like this project or if you find it useful, you can support us at:
+ *
+ * http://plantuml.com/patreon (only 1$ per month!)
+ * http://plantuml.com/paypal
+ *
+ * This file is part of PlantUML.
+ *
+ * PlantUML is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * PlantUML distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ *
+ * Original Author: Arnaud Roques
+ *
+ *
+ */
+package net.sourceforge.plantuml.project.time;
+
+public class MonthYear implements Comparable {
+
+ private final int year;
+ private final Month month;
+
+ public static MonthYear create(int year, Month month) {
+ return new MonthYear(year, month);
+ }
+
+ public String shortName() {
+ return month.shortName();
+ }
+
+ public String shortNameYYYY() {
+ return month.shortName() + " " + year;
+ }
+
+ public String longName() {
+ return month.longName();
+ }
+
+ public String longNameYYYY() {
+ return month.longName() + " " + year;
+ }
+
+ private MonthYear(int year, Month month) {
+ this.year = year;
+ this.month = month;
+ }
+
+ public int year() {
+ return year;
+ }
+
+ public MonthYear next() {
+ final Month newMonth = month.next();
+ final int newYear = newMonth == Month.JANUARY ? year + 1 : year;
+ return new MonthYear(newYear, newMonth);
+ }
+
+ public Month month() {
+ return month;
+ }
+
+ private int internalNumber() {
+ return year * 100 + month.ordinal();
+ }
+
+ @Override
+ public String toString() {
+ return "" + year + "/" + month;
+ }
+
+ @Override
+ public int hashCode() {
+ return year * 113 + month.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+ final MonthYear other = (MonthYear) obj;
+ return other.internalNumber() == this.internalNumber();
+ }
+
+ public int compareTo(MonthYear other) {
+ return this.internalNumber() - other.internalNumber();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/project/core/Wink.java b/src/net/sourceforge/plantuml/project/time/Wink.java
similarity index 86%
rename from src/net/sourceforge/plantuml/project/core/Wink.java
rename to src/net/sourceforge/plantuml/project/time/Wink.java
index 94c83dba5..45566c9ea 100644
--- a/src/net/sourceforge/plantuml/project/core/Wink.java
+++ b/src/net/sourceforge/plantuml/project/time/Wink.java
@@ -33,7 +33,7 @@
*
*
*/
-package net.sourceforge.plantuml.project.core;
+package net.sourceforge.plantuml.project.time;
import net.sourceforge.plantuml.project.Value;
@@ -70,4 +70,18 @@ public class Wink implements Value, Comparable {
return "" + (wink + 1);
}
+ public static Wink min(Wink wink1, Wink wink2) {
+ if (wink2.wink < wink1.wink) {
+ return wink2;
+ }
+ return wink1;
+ }
+
+ public static Wink max(Wink wink1, Wink wink2) {
+ if (wink2.wink > wink1.wink) {
+ return wink2;
+ }
+ return wink1;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/project/timescale/TimeScale.java b/src/net/sourceforge/plantuml/project/timescale/TimeScale.java
index b5baf4ef6..c8ce1e654 100644
--- a/src/net/sourceforge/plantuml/project/timescale/TimeScale.java
+++ b/src/net/sourceforge/plantuml/project/timescale/TimeScale.java
@@ -35,7 +35,7 @@
*/
package net.sourceforge.plantuml.project.timescale;
-import net.sourceforge.plantuml.project.core.Wink;
+import net.sourceforge.plantuml.project.time.Wink;
public interface TimeScale {
diff --git a/src/net/sourceforge/plantuml/project/timescale/TimeScaleWeekly.java b/src/net/sourceforge/plantuml/project/timescale/TimeScaleCompressed.java
similarity index 77%
rename from src/net/sourceforge/plantuml/project/timescale/TimeScaleWeekly.java
rename to src/net/sourceforge/plantuml/project/timescale/TimeScaleCompressed.java
index c06dc0780..ba3c335e2 100644
--- a/src/net/sourceforge/plantuml/project/timescale/TimeScaleWeekly.java
+++ b/src/net/sourceforge/plantuml/project/timescale/TimeScaleCompressed.java
@@ -35,28 +35,29 @@
*/
package net.sourceforge.plantuml.project.timescale;
-import net.sourceforge.plantuml.project.GCalendar;
-import net.sourceforge.plantuml.project.core.Wink;
+import net.sourceforge.plantuml.project.time.GCalendar;
+import net.sourceforge.plantuml.project.time.Wink;
-public class TimeScaleWeekly implements TimeScale {
+public class TimeScaleCompressed implements TimeScale {
- private static final int COMPRESS = 4;
+ private final int compress;
private final TimeScale daily;
- public TimeScaleWeekly(GCalendar calendar) {
+ public TimeScaleCompressed(GCalendar calendar, int compress) {
this.daily = new TimeScaleDaily(calendar, null);
+ this.compress = compress;
}
public double getStartingPosition(Wink instant) {
- return daily.getStartingPosition(instant) / COMPRESS;
+ return daily.getStartingPosition(instant) / compress;
}
public double getEndingPosition(Wink instant) {
- return daily.getEndingPosition(instant) / COMPRESS;
+ return daily.getEndingPosition(instant) / compress;
}
public double getWidth(Wink instant) {
- return daily.getWidth(instant) / COMPRESS;
+ return daily.getWidth(instant) / compress;
}
}
diff --git a/src/net/sourceforge/plantuml/project/timescale/TimeScaleDaily.java b/src/net/sourceforge/plantuml/project/timescale/TimeScaleDaily.java
index e8bafb6cb..30e029702 100644
--- a/src/net/sourceforge/plantuml/project/timescale/TimeScaleDaily.java
+++ b/src/net/sourceforge/plantuml/project/timescale/TimeScaleDaily.java
@@ -35,16 +35,16 @@
*/
package net.sourceforge.plantuml.project.timescale;
-import net.sourceforge.plantuml.project.DayAsDate;
-import net.sourceforge.plantuml.project.GCalendar;
-import net.sourceforge.plantuml.project.core.Wink;
+import net.sourceforge.plantuml.project.time.Day;
+import net.sourceforge.plantuml.project.time.GCalendar;
+import net.sourceforge.plantuml.project.time.Wink;
public final class TimeScaleDaily implements TimeScale {
private final TimeScaleWink basic;
private final double delta;
- public TimeScaleDaily(GCalendar calendar, DayAsDate zeroDay) {
+ public TimeScaleDaily(GCalendar calendar, Day zeroDay) {
this.basic = new TimeScaleWink();
if (zeroDay == null) {
this.delta = 0;
diff --git a/src/net/sourceforge/plantuml/project/timescale/TimeScaleWink.java b/src/net/sourceforge/plantuml/project/timescale/TimeScaleWink.java
index 118642613..1d0280293 100644
--- a/src/net/sourceforge/plantuml/project/timescale/TimeScaleWink.java
+++ b/src/net/sourceforge/plantuml/project/timescale/TimeScaleWink.java
@@ -35,7 +35,7 @@
*/
package net.sourceforge.plantuml.project.timescale;
-import net.sourceforge.plantuml.project.core.Wink;
+import net.sourceforge.plantuml.project.time.Wink;
public class TimeScaleWink implements TimeScale {
diff --git a/src/net/sourceforge/plantuml/project/timescale/UnusedTimeScaleWithoutWeekEnd.java b/src/net/sourceforge/plantuml/project/timescale/UnusedTimeScaleWithoutWeekEnd.java
index da6e677e5..0d0cd6203 100644
--- a/src/net/sourceforge/plantuml/project/timescale/UnusedTimeScaleWithoutWeekEnd.java
+++ b/src/net/sourceforge/plantuml/project/timescale/UnusedTimeScaleWithoutWeekEnd.java
@@ -35,10 +35,10 @@
*/
package net.sourceforge.plantuml.project.timescale;
-import net.sourceforge.plantuml.project.DayAsDate;
-import net.sourceforge.plantuml.project.DayOfWeek;
-import net.sourceforge.plantuml.project.GCalendar;
-import net.sourceforge.plantuml.project.core.Wink;
+import net.sourceforge.plantuml.project.time.Day;
+import net.sourceforge.plantuml.project.time.DayOfWeek;
+import net.sourceforge.plantuml.project.time.GCalendar;
+import net.sourceforge.plantuml.project.time.Wink;
public class UnusedTimeScaleWithoutWeekEnd implements TimeScale {
@@ -63,7 +63,7 @@ public class UnusedTimeScaleWithoutWeekEnd implements TimeScale {
}
public double getWidth(Wink instant) {
- final DayAsDate day = calendar.toDayAsDate((Wink) instant);
+ final Day day = calendar.toDayAsDate((Wink) instant);
final DayOfWeek dayOfWeek = day.getDayOfWeek();
if (dayOfWeek == DayOfWeek.SATURDAY || dayOfWeek == DayOfWeek.SUNDAY) {
return 1;
diff --git a/src/net/sourceforge/plantuml/salt/Dictionary.java b/src/net/sourceforge/plantuml/salt/Dictionary.java
index 3157d501f..dc9abde05 100644
--- a/src/net/sourceforge/plantuml/salt/Dictionary.java
+++ b/src/net/sourceforge/plantuml/salt/Dictionary.java
@@ -42,14 +42,13 @@ import net.sourceforge.plantuml.Guillemet;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.SpriteContainer;
-import net.sourceforge.plantuml.creole.CommandCreoleMonospaced;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
-import net.sourceforge.plantuml.graphic.IHtmlColorSet;
+import net.sourceforge.plantuml.creole.command.CommandCreoleMonospaced;
import net.sourceforge.plantuml.salt.element.Element;
import net.sourceforge.plantuml.salt.element.WrappedElement;
import net.sourceforge.plantuml.sprite.Sprite;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class Dictionary implements SpriteContainer, ISkinSimple {
@@ -91,8 +90,8 @@ public class Dictionary implements SpriteContainer, ISkinSimple {
return 8;
}
- public IHtmlColorSet getIHtmlColorSet() {
- return new HtmlColorSetSimple();
+ public HColorSet getIHtmlColorSet() {
+ return HColorSet.instance();
}
public int getDpi() {
diff --git a/src/net/sourceforge/plantuml/salt/PSystemSalt.java b/src/net/sourceforge/plantuml/salt/PSystemSalt.java
index 9ade106b7..9ad07d207 100644
--- a/src/net/sourceforge/plantuml/salt/PSystemSalt.java
+++ b/src/net/sourceforge/plantuml/salt/PSystemSalt.java
@@ -57,7 +57,6 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandFactorySprite;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.salt.element.Element;
import net.sourceforge.plantuml.salt.factory.AbstractElementFactoryComplex;
@@ -80,10 +79,11 @@ import net.sourceforge.plantuml.salt.factory.ElementFactoryText;
import net.sourceforge.plantuml.salt.factory.ElementFactoryTextField;
import net.sourceforge.plantuml.salt.factory.ElementFactoryTree;
import net.sourceforge.plantuml.sprite.Sprite;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class PSystemSalt extends AbstractPSystem implements WithSprite {
@@ -115,12 +115,12 @@ public class PSystemSalt extends AbstractPSystem implements WithSprite {
if (getScale() != null) {
scale = getScale().getScale(size.getWidth(), size.getHeight());
}
- final ImageBuilder builder = new ImageBuilder(new ColorMapperIdentity(), scale, HtmlColorUtils.WHITE, null,
+ final ImageBuilder builder = new ImageBuilder(new ColorMapperIdentity(), scale, HColorUtils.WHITE, null,
null, 5, 5, null, false);
builder.setUDrawable(new UDrawable() {
public void drawU(UGraphic ug) {
- ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
+ ug = ug.apply(new UChangeColor(HColorUtils.BLACK));
salt.drawU(ug, 0, new Dimension2DDouble(size.getWidth(), size.getHeight()));
salt.drawU(ug, 1, new Dimension2DDouble(size.getWidth(), size.getHeight()));
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementBorder.java b/src/net/sourceforge/plantuml/salt/element/ElementBorder.java
index b0bbb2426..ac63e278e 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementBorder.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementBorder.java
@@ -85,8 +85,8 @@ public class ElementBorder extends AbstractElement {
// - dimSouth.getHeight());
north.drawU(ug, zIndex, dimToUse);
- south.drawU(ug.apply(new UTranslate(0, pC.getY())), zIndex, dimToUse);
- west.drawU(ug.apply(new UTranslate(0, pA.getY())), zIndex, dimToUse);
+ south.drawU(ug.apply(UTranslate.dy(pC.getY())), zIndex, dimToUse);
+ west.drawU(ug.apply(UTranslate.dy(pA.getY())), zIndex, dimToUse);
east.drawU(ug.apply(new UTranslate(pB.getX(), pB.getY())), zIndex, dimToUse);
center.drawU(ug.apply(new UTranslate(pA.getX(), pA.getY())), zIndex, dimToUse);
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementButton.java b/src/net/sourceforge/plantuml/salt/element/ElementButton.java
index f7ea79bc4..7f0ecb348 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementButton.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementButton.java
@@ -39,7 +39,6 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UFont;
@@ -47,6 +46,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.HColorSet;
public class ElementButton extends AbstractElementText implements Element {
@@ -70,9 +70,9 @@ public class ElementButton extends AbstractElementText implements Element {
}
final Dimension2D dim = getPreferredDimension(ug.getStringBounder(), 0, 0);
ug = ug.apply(new UStroke(stroke));
- ug = ug.apply(new UChangeBackColor(HtmlColorSet.getInstance().getColorIfValid("#EEEEEE")));
+ ug = ug.apply(new UChangeBackColor(HColorSet.instance().getColorIfValid("#EEEEEE")));
ug.apply(new UTranslate(stroke, stroke)).draw(
- new URectangle(dim.getWidth() - 2 * stroke, dim.getHeight() - 2 * stroke, 10, 10));
+ new URectangle(dim.getWidth() - 2 * stroke, dim.getHeight() - 2 * stroke).rounded(10));
final Dimension2D dimPureText = getPureTextDimension(ug.getStringBounder());
drawText(ug, (dim.getWidth() - dimPureText.getWidth()) / 2, stroke + marginY);
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementDroplist.java b/src/net/sourceforge/plantuml/salt/element/ElementDroplist.java
index e4b5f53ca..40f96a539 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementDroplist.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementDroplist.java
@@ -44,7 +44,6 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
@@ -54,6 +53,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.HColorSet;
public class ElementDroplist extends AbstractElementText implements Element {
@@ -93,11 +93,11 @@ public class ElementDroplist extends AbstractElementText implements Element {
public void drawU(UGraphic ug, int zIndex, Dimension2D dimToUse) {
final Dimension2D dim = getPreferredDimension(ug.getStringBounder(), 0, 0);
if (zIndex == 0) {
- ug.apply(new UChangeBackColor(HtmlColorSet.getInstance().getColorIfValid("#EEEEEE"))).draw(
+ ug.apply(new UChangeBackColor(HColorSet.instance().getColorIfValid("#EEEEEE"))).draw(
new URectangle(dim.getWidth() - 1, dim.getHeight() - 1));
drawText(ug, 2, 2);
final double xline = dim.getWidth() - box;
- ug.apply(new UTranslate(xline, 0)).draw(new ULine(0, dim.getHeight() - 1));
+ ug.apply(UTranslate.dx(xline)).draw(ULine.vline(dim.getHeight() - 1));
final UPolygon poly = new UPolygon();
poly.addPoint(0, 0);
@@ -111,10 +111,10 @@ public class ElementDroplist extends AbstractElementText implements Element {
if (openDrop != null) {
final Dimension2D dimOpen = Dimension2DDouble.atLeast(openDrop.calculateDimension(ug.getStringBounder()),
dim.getWidth() - 1, 0);
- ug.apply(new UChangeBackColor(HtmlColorSet.getInstance().getColorIfValid("#EEEEEE")))
- .apply(new UTranslate(0, dim.getHeight() - 1))
+ ug.apply(new UChangeBackColor(HColorSet.instance().getColorIfValid("#EEEEEE")))
+ .apply(UTranslate.dy(dim.getHeight() - 1))
.draw(new URectangle(dimOpen.getWidth() - 1, dimOpen.getHeight() - 1));
- openDrop.drawU(ug.apply(new UTranslate(0, dim.getHeight() - 1)));
+ openDrop.drawU(ug.apply(UTranslate.dy(dim.getHeight() - 1)));
}
}
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementLine.java b/src/net/sourceforge/plantuml/salt/element/ElementLine.java
index 3f0edc08e..a55d806f4 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementLine.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementLine.java
@@ -38,13 +38,13 @@ package net.sourceforge.plantuml.salt.element;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
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.HColorSet;
public class ElementLine extends AbstractElement {
@@ -62,7 +62,7 @@ public class ElementLine extends AbstractElement {
if (zIndex != 0) {
return;
}
- ug = ug.apply(new UChangeColor(HtmlColorSet.getInstance().getColorIfValid("#AAAAAA")));
+ ug = ug.apply(new UChangeColor(HColorSet.instance().getColorIfValid("#AAAAAA")));
double y2 = dimToUse.getHeight() / 2;
if (separator == '=') {
y2 = y2 - 1;
@@ -72,14 +72,14 @@ public class ElementLine extends AbstractElement {
private static void drawLine(UGraphic ug, double x, double y, double widthToUse, char separator) {
if (separator == '=') {
- ug.apply(new UStroke()).apply(new UTranslate(x, y)).draw(new ULine(widthToUse, 0));
- ug.apply(new UStroke()).apply(new UTranslate(x, y + 2)).draw(new ULine(widthToUse, 0));
+ ug.apply(new UStroke()).apply(new UTranslate(x, y)).draw(ULine.hline(widthToUse));
+ ug.apply(new UStroke()).apply(new UTranslate(x, y + 2)).draw(ULine.hline(widthToUse));
} else if (separator == '.') {
- ug.apply(new UStroke(1, 2, 1)).apply(new UTranslate(x, y)).draw(new ULine(widthToUse, 0));
+ ug.apply(new UStroke(1, 2, 1)).apply(new UTranslate(x, y)).draw(ULine.hline(widthToUse));
} else if (separator == '-') {
- ug.apply(new UStroke()).apply(new UTranslate(x, y)).draw(new ULine(widthToUse, 0));
+ ug.apply(new UStroke()).apply(new UTranslate(x, y)).draw(ULine.hline(widthToUse));
} else {
- ug.apply(new UStroke(1.5)).apply(new UTranslate(x, y)).draw(new ULine(widthToUse, 0));
+ ug.apply(new UStroke(1.5)).apply(new UTranslate(x, y)).draw(ULine.hline(widthToUse));
}
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementMenuBar.java b/src/net/sourceforge/plantuml/salt/element/ElementMenuBar.java
index 13a86c536..71aa1f486 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementMenuBar.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementMenuBar.java
@@ -43,13 +43,13 @@ import java.util.Map;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
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.HColorSet;
public class ElementMenuBar extends AbstractElement {
@@ -106,10 +106,10 @@ public class ElementMenuBar extends AbstractElement {
double x1 = 0;
if (zIndex == 0) {
- ug.apply(new UChangeBackColor(HtmlColorSet.getInstance().getColorIfValid("#DDDDDD"))).draw(
+ ug.apply(new UChangeBackColor(HColorSet.instance().getColorIfValid("#DDDDDD"))).draw(
new URectangle(dimToUse.getWidth(), dimToUse.getHeight()));
for (ElementMenuEntry entry : entries) {
- entry.drawU(ug.apply(new UTranslate(x1, 0)), zIndex, dimToUse);
+ entry.drawU(ug.apply(UTranslate.dx(x1)), zIndex, dimToUse);
final double w = entry.getPreferredDimension(ug.getStringBounder(), x1, 0).getWidth();
entry.setX(x1);
x1 += w + 10;
@@ -119,7 +119,7 @@ public class ElementMenuBar extends AbstractElement {
if (zIndex == 1) {
for (ElementMenuEntry entry : popups.keySet()) {
- entry.setBackground(HtmlColorSet.getInstance().getColorIfValid("#BBBBBB"));
+ entry.setBackground(HColorSet.instance().getColorIfValid("#BBBBBB"));
}
final double y1 = preferred.getHeight();
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementMenuEntry.java b/src/net/sourceforge/plantuml/salt/element/ElementMenuEntry.java
index 6c1dfcfc9..7d8d44f06 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementMenuEntry.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementMenuEntry.java
@@ -42,19 +42,19 @@ import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class ElementMenuEntry extends AbstractElement {
private final TextBlock block;
private final String text;
- private HtmlColor background;
+ private HColor background;
private double xxx;
public ElementMenuEntry(String text, UFont font, ISkinSimple spriteContainer) {
@@ -90,11 +90,11 @@ public class ElementMenuEntry extends AbstractElement {
return text;
}
- public HtmlColor getBackground() {
+ public HColor getBackground() {
return background;
}
- public void setBackground(HtmlColor background) {
+ public void setBackground(HColor background) {
this.background = background;
}
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementMenuPopup.java b/src/net/sourceforge/plantuml/salt/element/ElementMenuPopup.java
index 184c88262..57a406742 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementMenuPopup.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementMenuPopup.java
@@ -41,7 +41,6 @@ import java.util.Collection;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UFont;
@@ -49,6 +48,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class ElementMenuPopup extends AbstractElement {
@@ -80,16 +80,16 @@ public class ElementMenuPopup extends AbstractElement {
if (zIndex != 1) {
return;
}
- ug.apply(new UChangeBackColor(HtmlColorSet.getInstance().getColorIfValid("#DDDDDD"))).draw(
+ ug.apply(new UChangeBackColor(HColorSet.instance().getColorIfValid("#DDDDDD"))).draw(
new URectangle(dimToUse.getWidth(), dimToUse.getHeight()));
double y1 = 0;
for (ElementMenuEntry entry : entries) {
final double h = entry.getPreferredDimension(ug.getStringBounder(), 0, y1).getHeight();
if (entry.getText().equals("-")) {
- ug.apply(new UTranslate(0, y1 + h / 2)).draw(new ULine(dimToUse.getWidth(), 0));
+ ug.apply(UTranslate.dy(y1 + h / 2)).draw(ULine.hline(dimToUse.getWidth()));
} else {
- entry.drawU(ug.apply(new UTranslate(0, y1)), zIndex, dimToUse);
+ entry.drawU(ug.apply(UTranslate.dy(y1)), zIndex, dimToUse);
}
y1 += h;
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementPyramidScrolled.java b/src/net/sourceforge/plantuml/salt/element/ElementPyramidScrolled.java
index b8053842a..48ebbfb3e 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementPyramidScrolled.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementPyramidScrolled.java
@@ -39,7 +39,6 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinSimple;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.salt.Positionner2;
import net.sourceforge.plantuml.salt.factory.ScrollStrategy;
@@ -49,6 +48,7 @@ import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class ElementPyramidScrolled extends ElementPyramid {
@@ -78,10 +78,10 @@ public class ElementPyramidScrolled extends ElementPyramid {
super.drawU(ug, zIndex, dimToUse);
final Dimension2D dim = super.getPreferredDimension(ug.getStringBounder(), 0, 0);
if (scrollStrategy == ScrollStrategy.BOTH || scrollStrategy == ScrollStrategy.VERTICAL_ONLY) {
- drawV(ug.apply(new UTranslate(dim.getWidth() + 4, 0)), v1, dim.getHeight());
+ drawV(ug.apply(UTranslate.dx(dim.getWidth() + 4)), v1, dim.getHeight());
}
if (scrollStrategy == ScrollStrategy.BOTH || scrollStrategy == ScrollStrategy.HORIZONTAL_ONLY) {
- drawH(ug.apply(new UTranslate(0, dim.getHeight() + 4)), dim.getWidth(), v1);
+ drawH(ug.apply(UTranslate.dy(dim.getHeight() + 4)), dim.getWidth(), v1);
}
}
@@ -127,18 +127,18 @@ public class ElementPyramidScrolled extends ElementPyramid {
private void drawV(UGraphic ug, double width, double height) {
ug.draw(new URectangle(width, height));
- ug.apply(new UTranslate(0, v2)).draw(new ULine(width, 0));
- ug.apply(new UTranslate(0, height - v2)).draw(new ULine(width, 0));
- ug.apply(new UTranslate(4, 4)).apply(new UChangeBackColor(HtmlColorUtils.BLACK)).draw(getTr0());
- ug.apply(new UTranslate(4, height - v2 + 4)).apply(new UChangeBackColor(HtmlColorUtils.BLACK)).draw(getTr180());
+ ug.apply(UTranslate.dy(v2)).draw(ULine.hline(width));
+ ug.apply(UTranslate.dy(height - v2)).draw(ULine.hline(width));
+ ug.apply(new UTranslate(4, 4)).apply(new UChangeBackColor(HColorUtils.BLACK)).draw(getTr0());
+ ug.apply(new UTranslate(4, height - v2 + 4)).apply(new UChangeBackColor(HColorUtils.BLACK)).draw(getTr180());
}
private void drawH(UGraphic ug, double width, double height) {
ug.draw(new URectangle(width, height));
- ug.apply(new UTranslate(v2, 0)).draw(new ULine(0, height));
- ug.apply(new UTranslate(width - v2, 0)).draw(new ULine(0, height));
- ug.apply(new UTranslate(4, 4)).apply(new UChangeBackColor(HtmlColorUtils.BLACK)).draw(getTr90());
- ug.apply(new UTranslate(width - v2 + 4, 4)).apply(new UChangeBackColor(HtmlColorUtils.BLACK)).draw(getTr270());
+ ug.apply(UTranslate.dx(v2)).draw(ULine.vline(height));
+ ug.apply(UTranslate.dx(width - v2)).draw(ULine.vline(height));
+ ug.apply(new UTranslate(4, 4)).apply(new UChangeBackColor(HColorUtils.BLACK)).draw(getTr90());
+ ug.apply(new UTranslate(width - v2 + 4, 4)).apply(new UChangeBackColor(HColorUtils.BLACK)).draw(getTr270());
}
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementRadioCheckbox.java b/src/net/sourceforge/plantuml/salt/element/ElementRadioCheckbox.java
index f6338cfcc..75d45a727 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementRadioCheckbox.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementRadioCheckbox.java
@@ -82,7 +82,7 @@ public class ElementRadioCheckbox extends AbstractElement {
if (zIndex != 0) {
return;
}
- block.drawU(ug.apply(new UTranslate(margin, 0)));
+ block.drawU(ug.apply(UTranslate.dx(margin)));
final Dimension2D dim = getPreferredDimension(ug.getStringBounder(), 0, 0);
final double height = dim.getHeight();
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementTabBar.java b/src/net/sourceforge/plantuml/salt/element/ElementTabBar.java
index c1f641d4d..1adbf282f 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementTabBar.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementTabBar.java
@@ -106,10 +106,10 @@ public class ElementTabBar extends AbstractElement {
elt.drawU(ug.apply(new UTranslate(x1 + margin1, y)), zIndex, dimToUse);
final Dimension2D dimText = elt.getPreferredDimension(ug.getStringBounder(), x1, y);
final double w = dimText.getWidth();
- ug.apply(new UTranslate(x1, y)).draw(new ULine(0, dimText.getHeight()));
- ug.apply(new UTranslate(x1, y)).draw(new ULine(w + margin1 + margin2, 0));
- ug.apply(new UTranslate(x1 + w + margin1 + margin2, y)).draw(new ULine(0, dimText.getHeight()));
- ug.apply(new UTranslate(x1 + w + margin1 + margin2, y + dimText.getHeight())).draw(new ULine(margin3, 0));
+ ug.apply(new UTranslate(x1, y)).draw(ULine.vline(dimText.getHeight()));
+ ug.apply(new UTranslate(x1, y)).draw(ULine.hline(w + margin1 + margin2));
+ ug.apply(new UTranslate(x1 + w + margin1 + margin2, y)).draw(ULine.vline(dimText.getHeight()));
+ ug.apply(new UTranslate(x1 + w + margin1 + margin2, y + dimText.getHeight())).draw(ULine.hline(margin3));
x1 += w + margin1 + margin2 + margin3;
}
}
@@ -130,13 +130,13 @@ public class ElementTabBar extends AbstractElement {
ug = ug.apply(new UTranslate(x, y));
double y1 = x;
for (Element elt : tabs) {
- elt.drawU(ug.apply(new UTranslate(0, y1 + margin1)), zIndex, dimToUse);
+ elt.drawU(ug.apply(UTranslate.dy(y1 + margin1)), zIndex, dimToUse);
final Dimension2D dimText = elt.getPreferredDimension(ug.getStringBounder(), x, y1);
final double h = dimText.getHeight();
- ug.apply(new UTranslate(0, y1)).draw(new ULine(preferred.getWidth(), 0));
- ug.apply(new UTranslate(0, y1)).draw(new ULine(0, h + margin1 + margin2));
- ug.apply(new UTranslate(0, y1 + h + margin1 + margin2)).draw(new ULine(preferred.getWidth(), 0));
- ug.apply(new UTranslate(preferred.getWidth(), y1 + h + margin1 + margin2)).draw(new ULine(0, margin3));
+ ug.apply(UTranslate.dy(y1)).draw(ULine.hline(preferred.getWidth()));
+ ug.apply(UTranslate.dy(y1)).draw(ULine.vline(h + margin1 + margin2));
+ ug.apply(UTranslate.dy(y1 + h + margin1 + margin2)).draw(ULine.hline(preferred.getWidth()));
+ ug.apply(new UTranslate(preferred.getWidth(), y1 + h + margin1 + margin2)).draw(ULine.vline(margin3));
y1 += h + margin1 + margin2 + margin3;
}
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementTextField.java b/src/net/sourceforge/plantuml/salt/element/ElementTextField.java
index 961985e39..f92481aeb 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementTextField.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementTextField.java
@@ -63,10 +63,10 @@ public class ElementTextField extends AbstractElementText implements Element {
drawText(ug, 3, 0);
final Dimension2D dim = getPreferredDimension(ug.getStringBounder(), 0, 0);
final Dimension2D textDim = getTextDimensionAt(ug.getStringBounder(), 0);
- ug.apply(new UTranslate(1, textDim.getHeight())).draw(new ULine(dim.getWidth() - 3, 0));
+ ug.apply(new UTranslate(1, textDim.getHeight())).draw(ULine.hline(dim.getWidth() - 3));
final double y3 = textDim.getHeight() - 3;
- ug.apply(new UTranslate(1, y3)).draw(new ULine(0, 2));
- ug.apply(new UTranslate(3 + textDim.getWidth() + 1, y3)).draw(new ULine(0, 2));
+ ug.apply(new UTranslate(1, y3)).draw(ULine.vline(2));
+ ug.apply(new UTranslate(3 + textDim.getWidth() + 1, y3)).draw(ULine.vline(2));
}
}
diff --git a/src/net/sourceforge/plantuml/salt/element/ElementTree.java b/src/net/sourceforge/plantuml/salt/element/ElementTree.java
index 6f0c1363a..09030a082 100644
--- a/src/net/sourceforge/plantuml/salt/element/ElementTree.java
+++ b/src/net/sourceforge/plantuml/salt/element/ElementTree.java
@@ -44,11 +44,11 @@ import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.StringUtils;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class ElementTree extends AbstractElement {
@@ -145,7 +145,7 @@ public class ElementTree extends AbstractElement {
yvar += h;
rows.add(yvar);
}
- ug = ug.apply(new UChangeColor(HtmlColorSet.getInstance().getColorIfValid("#888888")));
+ ug = ug.apply(new UChangeColor(HColorSet.instance().getColorIfValid("#888888")));
skeleton.draw(ug, 0, 0);
if (strategy != TableStrategy.DRAW_NONE) {
final Grid2 grid = new Grid2(rows, cols, strategy);
diff --git a/src/net/sourceforge/plantuml/salt/element/Grid.java b/src/net/sourceforge/plantuml/salt/element/Grid.java
index 7bae8a600..ca458d7c9 100644
--- a/src/net/sourceforge/plantuml/salt/element/Grid.java
+++ b/src/net/sourceforge/plantuml/salt/element/Grid.java
@@ -39,7 +39,6 @@ import java.awt.geom.Dimension2D;
import java.util.HashSet;
import java.util.Set;
-import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.salt.Cell;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
@@ -48,6 +47,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class Grid {
@@ -90,21 +90,21 @@ public class Grid {
final int row1 = seg.getRow();
final int col1 = seg.getCol();
final double width = colsStart[col1 + 1] - colsStart[col1];
- ug.apply(new UTranslate(x + colsStart[col1], y + rowsStart[row1])).draw(new ULine(width, 0));
+ ug.apply(new UTranslate(x + colsStart[col1], y + rowsStart[row1])).draw(ULine.hline(width));
}
// Vlines
for (Segment seg : verticals) {
final int row1 = seg.getRow();
final int col1 = seg.getCol();
final double height = rowsStart[row1 + 1] - rowsStart[row1];
- ug.apply(new UTranslate(x + colsStart[col1], y + rowsStart[row1])).draw(new ULine(0, height));
+ ug.apply(new UTranslate(x + colsStart[col1], y + rowsStart[row1])).draw(ULine.vline(height));
}
final Dimension2D dim = title.calculateDimension(ug.getStringBounder());
if (dim.getWidth() > 0 && dim.getHeight() > 0) {
final UGraphic ug2 = ug.apply(new UTranslate(x + 6, y - dim.getHeight() * 0));
- ug2.apply(new UChangeBackColor(HtmlColorUtils.WHITE)).apply(new UChangeColor(HtmlColorUtils.WHITE))
+ ug2.apply(new UChangeBackColor(HColorUtils.WHITE)).apply(new UChangeColor(HColorUtils.WHITE))
.draw(new URectangle(dim));
title.drawU(ug2);
}
diff --git a/src/net/sourceforge/plantuml/salt/element/Grid2.java b/src/net/sourceforge/plantuml/salt/element/Grid2.java
index 8a888a3b2..a0d3b1e47 100644
--- a/src/net/sourceforge/plantuml/salt/element/Grid2.java
+++ b/src/net/sourceforge/plantuml/salt/element/Grid2.java
@@ -59,19 +59,19 @@ public class Grid2 {
final double ymin = rowsStart.get(0);
final double ymax = rowsStart.get(rowsStart.size() - 1);
if (strategy == TableStrategy.DRAW_OUTSIDE || strategy == TableStrategy.DRAW_OUTSIDE_WITH_TITLE) {
- ug.apply(new UTranslate(xmin, ymin)).draw(new ULine(xmax - xmin, 0));
- ug.apply(new UTranslate(xmin, ymax)).draw(new ULine(xmax - xmin, 0));
- ug.apply(new UTranslate(xmin, ymin)).draw(new ULine(0, ymax - ymin));
- ug.apply(new UTranslate(xmax, ymin)).draw(new ULine(0, ymax - ymin));
+ ug.apply(new UTranslate(xmin, ymin)).draw(ULine.hline(xmax - xmin));
+ ug.apply(new UTranslate(xmin, ymax)).draw(ULine.hline(xmax - xmin));
+ ug.apply(new UTranslate(xmin, ymin)).draw(ULine.vline(ymax - ymin));
+ ug.apply(new UTranslate(xmax, ymin)).draw(ULine.vline(ymax - ymin));
}
if (drawHorizontal()) {
for (Double y : rowsStart) {
- ug.apply(new UTranslate(xmin, y)).draw(new ULine(xmax - xmin, 0));
+ ug.apply(new UTranslate(xmin, y)).draw(ULine.hline(xmax - xmin));
}
}
if (drawVertical()) {
for (Double x : colsStart) {
- ug.apply(new UTranslate(x, ymin)).draw(new ULine(0, ymax - ymin));
+ ug.apply(new UTranslate(x, ymin)).draw(ULine.vline(ymax - ymin));
}
}
}
diff --git a/src/net/sourceforge/plantuml/salt/element/Skeleton.java b/src/net/sourceforge/plantuml/salt/element/Skeleton.java
index 5b8279298..6019cd181 100644
--- a/src/net/sourceforge/plantuml/salt/element/Skeleton.java
+++ b/src/net/sourceforge/plantuml/salt/element/Skeleton.java
@@ -86,10 +86,10 @@ public class Skeleton {
private void drawChild(UGraphic ug, Entry parent, Entry child) {
final double dy = child.ypos - parent.ypos - 2;
- ug.apply(new UTranslate(parent.xpos + 1, parent.ypos + 3)).draw(new ULine(0, dy));
+ ug.apply(new UTranslate(parent.xpos + 1, parent.ypos + 3)).draw(ULine.vline(dy));
final double dx = child.xpos - parent.xpos - 2;
- ug.apply(new UTranslate(parent.xpos + 1, child.ypos + 1)).draw(new ULine(dx, 0));
+ ug.apply(new UTranslate(parent.xpos + 1, child.ypos + 1)).draw(ULine.hline(dx));
}
diff --git a/src/net/sourceforge/plantuml/salt/element/Skeleton2.java b/src/net/sourceforge/plantuml/salt/element/Skeleton2.java
index 634471dc4..5e09cc421 100644
--- a/src/net/sourceforge/plantuml/salt/element/Skeleton2.java
+++ b/src/net/sourceforge/plantuml/salt/element/Skeleton2.java
@@ -61,13 +61,13 @@ public class Skeleton2 {
void drawHline(UGraphic ug) {
final double xpos = getXStartForLevel(level);
ug.apply(new UTranslate(xpos + sizeX - 1, ypos - 1)).draw(new URectangle(2, 2));
- ug.apply(new UTranslate(xpos, ypos)).draw(new ULine(sizeX, 0));
+ ug.apply(new UTranslate(xpos, ypos)).draw(ULine.hline(sizeX));
}
public void drawVline(UGraphic ug, double lastY) {
// System.err.println("ypos=" + ypos);
final double xpos = getXStartForLevel(level);
- ug.apply(new UTranslate(xpos, lastY)).draw(new ULine(0, ypos - lastY));
+ ug.apply(new UTranslate(xpos, lastY)).draw(ULine.vline(ypos - lastY));
}
}
@@ -124,7 +124,7 @@ public class Skeleton2 {
//
// private void drawChild(UGraphic ug, Entry parent, Entry child) {
// final double dy = child.ypos - parent.ypos - 2;
- // ug.apply(new UTranslate(parent.xpos + 1, parent.ypos + 3)).draw(new ULine(0, dy));
+ // ug.apply(new UTranslate(parent.xpos + 1, parent.ypos + 3)).draw(ULine.dy(dy));
//
// final double dx = child.xpos - parent.xpos - 2;
// ug.apply(new UTranslate(parent.xpos + 1, child.ypos + 1)).draw(new ULine(dx, 0));
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Englober.java b/src/net/sourceforge/plantuml/sequencediagram/Englober.java
index f6b42e923..755ed19cc 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Englober.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Englober.java
@@ -42,7 +42,6 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.PaddingParam;
import net.sourceforge.plantuml.SkinParamBackcolored;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.real.RealUtils;
@@ -60,6 +59,7 @@ import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.style.WithStyle;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class Englober implements WithStyle {
@@ -78,7 +78,7 @@ public class Englober implements WithStyle {
public Style[] getUsedStyles() {
Style tmp = getDefaultStyleDefinition().with(participantEnglober.getStereotype()).getMergedStyle(styleBuilder);
- final HtmlColor backColor = participantEnglober.getBoxColor();
+ final HColor backColor = participantEnglober.getBoxColor();
if (tmp != null) {
tmp = tmp.eventuallyOverride(PName.BackGroundColor, backColor);
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Grouping.java b/src/net/sourceforge/plantuml/sequencediagram/Grouping.java
index 1645dceba..59ee4ee64 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Grouping.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Grouping.java
@@ -35,20 +35,20 @@
*/
package net.sourceforge.plantuml.sequencediagram;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleBuilder;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.style.WithStyle;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public abstract class Grouping implements Event, WithStyle {
private final String title;
private final GroupingType type;
private final String comment;
- private final HtmlColor backColorElement;
+ private final HColor backColorElement;
// private final StyleBuilder styleBuilder;
@@ -70,7 +70,7 @@ public abstract class Grouping implements Event, WithStyle {
backColorElement) };
}
- public Grouping(String title, String comment, GroupingType type, HtmlColor backColorElement,
+ public Grouping(String title, String comment, GroupingType type, HColor backColorElement,
StyleBuilder styleBuilder) {
this.title = title;
// this.styleBuilder = styleBuilder;
@@ -96,13 +96,13 @@ public abstract class Grouping implements Event, WithStyle {
public abstract int getLevel();
- public abstract HtmlColor getBackColorGeneral();
+ public abstract HColor getBackColorGeneral();
final public String getComment() {
return comment;
}
- public final HtmlColor getBackColorElement() {
+ public final HColor getBackColorElement() {
return backColorElement;
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/GroupingLeaf.java b/src/net/sourceforge/plantuml/sequencediagram/GroupingLeaf.java
index f500274df..0b961cd63 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/GroupingLeaf.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/GroupingLeaf.java
@@ -39,16 +39,16 @@ import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.Url;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.style.StyleBuilder;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
final public class GroupingLeaf extends Grouping implements EventWithDeactivate {
private final GroupingStart start;
- private final HtmlColor backColorGeneral;
+ private final HColor backColorGeneral;
- public GroupingLeaf(String title, String comment, GroupingType type, HtmlColor backColorGeneral,
- HtmlColor backColorElement, GroupingStart start, StyleBuilder styleBuilder) {
+ public GroupingLeaf(String title, String comment, GroupingType type, HColor backColorGeneral,
+ HColor backColorElement, GroupingStart start, StyleBuilder styleBuilder) {
super(title, comment, type, backColorElement, styleBuilder);
if (start == null) {
throw new IllegalArgumentException();
@@ -79,7 +79,7 @@ final public class GroupingLeaf extends Grouping implements EventWithDeactivate
}
@Override
- public final HtmlColor getBackColorGeneral() {
+ public final HColor getBackColorGeneral() {
if (backColorGeneral == null) {
return start.getBackColorGeneral();
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/GroupingStart.java b/src/net/sourceforge/plantuml/sequencediagram/GroupingStart.java
index a1dbab497..7748c0eea 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/GroupingStart.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/GroupingStart.java
@@ -40,20 +40,20 @@ import java.util.Collections;
import java.util.List;
import net.sourceforge.plantuml.Url;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleBuilder;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class GroupingStart extends Grouping {
private final List children = new ArrayList();
- private final HtmlColor backColorGeneral;
+ private final HColor backColorGeneral;
final private GroupingStart parent;
private boolean parallel = false;
- public GroupingStart(String title, String comment, HtmlColor backColorGeneral, HtmlColor backColorElement,
+ public GroupingStart(String title, String comment, HColor backColorGeneral, HColor backColorElement,
GroupingStart parent, StyleBuilder styleBuilder) {
super(title, comment, GroupingType.START, backColorElement, styleBuilder);
this.backColorGeneral = backColorGeneral;
@@ -84,7 +84,7 @@ public class GroupingStart extends Grouping {
}
@Override
- public HtmlColor getBackColorGeneral() {
+ public HColor getBackColorGeneral() {
return backColorGeneral;
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java b/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java
index 513ee7321..4c83ac03c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java
@@ -43,13 +43,13 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.sequencediagram.teoz.YPositionedTile;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class LinkAnchor {
@@ -91,7 +91,7 @@ public class LinkAnchor {
final double ymin = Math.min(y1, y2);
final double ymax = Math.max(y1, y2);
- final HtmlColor color = new Rose().getHtmlColor(param, ColorParam.arrow);
+ final HColor color = new Rose().getHtmlColor(param, ColorParam.arrow);
final Rainbow rainbow = Rainbow.fromColor(color);
final Snake snake = new Snake(Arrows.asToUp(), HorizontalAlignment.CENTER, rainbow, Arrows.asToDown());
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Participant.java b/src/net/sourceforge/plantuml/sequencediagram/Participant.java
index 2e8c87fdf..6264bb97f 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Participant.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Participant.java
@@ -46,7 +46,6 @@ import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.EntityPortion;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
@@ -54,6 +53,7 @@ import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleBuilder;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.style.WithStyle;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class Participant implements SpecificBackcolorable, WithStyle {
@@ -172,7 +172,7 @@ public class Participant implements SpecificBackcolorable, WithStyle {
return colors;
}
- public void setSpecificColorTOBEREMOVED(ColorType type, HtmlColor color) {
+ public void setSpecificColorTOBEREMOVED(ColorType type, HColor color) {
if (color != null) {
this.colors = colors.add(type, color);
}
@@ -203,14 +203,14 @@ public class Participant implements SpecificBackcolorable, WithStyle {
}
public SkinParamBackcolored getSkinParamBackcolored(ISkinParam skinParam) {
- HtmlColor specificBackColor = getColors(skinParam).getColor(ColorType.BACK);
+ HColor specificBackColor = getColors(skinParam).getColor(ColorType.BACK);
final boolean clickable = getUrl() != null;
- final HtmlColor stereoBackColor = skinParam.getHtmlColor(getBackgroundColorParam(), getStereotype(), clickable);
+ final HColor stereoBackColor = skinParam.getHtmlColor(getBackgroundColorParam(), getStereotype(), clickable);
if (stereoBackColor != null && specificBackColor == null) {
specificBackColor = stereoBackColor;
}
final SkinParamBackcolored result = new SkinParamBackcolored(skinParam, specificBackColor, clickable);
- final HtmlColor stereoBorderColor = skinParam.getHtmlColor(ColorParam.participantBorder, getStereotype(),
+ final HColor stereoBorderColor = skinParam.getHtmlColor(ColorParam.participantBorder, getStereotype(),
clickable);
if (stereoBorderColor != null) {
result.forceColor(ColorParam.participantBorder, stereoBorderColor);
diff --git a/src/net/sourceforge/plantuml/sequencediagram/ParticipantEnglober.java b/src/net/sourceforge/plantuml/sequencediagram/ParticipantEnglober.java
index 13c04dda9..a5c62da54 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/ParticipantEnglober.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/ParticipantEnglober.java
@@ -37,15 +37,15 @@ package net.sourceforge.plantuml.sequencediagram;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class ParticipantEnglober {
final private Display title;
- final private HtmlColor boxColor;
+ final private HColor boxColor;
final private Stereotype stereotype;
- public ParticipantEnglober(Display title, HtmlColor boxColor, Stereotype stereotype) {
+ public ParticipantEnglober(Display title, HColor boxColor, Stereotype stereotype) {
this.title = title;
this.boxColor = boxColor;
this.stereotype = stereotype;
@@ -55,7 +55,7 @@ public class ParticipantEnglober {
return title;
}
- public final HtmlColor getBoxColor() {
+ public final HColor getBoxColor() {
return boxColor;
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/Reference.java b/src/net/sourceforge/plantuml/sequencediagram/Reference.java
index 041a6ad35..a034c46f5 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/Reference.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/Reference.java
@@ -41,19 +41,19 @@ import java.util.List;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleBuilder;
import net.sourceforge.plantuml.style.StyleSignature;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class Reference extends AbstractEvent implements Event {
private final List participants;
private final Url url;
- private final HtmlColor backColorGeneral;
- private final HtmlColor backColorElement;
+ private final HColor backColorGeneral;
+ private final HColor backColorElement;
private final Display strings;
@@ -75,8 +75,8 @@ public class Reference extends AbstractEvent implements Event {
backColorElement) };
}
- public Reference(List participants, Url url, Display strings, HtmlColor backColorGeneral,
- HtmlColor backColorElement, StyleBuilder styleBuilder) {
+ public Reference(List participants, Url url, Display strings, HColor backColorGeneral,
+ HColor backColorElement, StyleBuilder styleBuilder) {
this.participants = participants;
this.url = url;
this.strings = strings;
@@ -119,11 +119,11 @@ public class Reference extends AbstractEvent implements Event {
return sb.toString();
}
- public final HtmlColor getBackColorGeneral() {
+ public final HColor getBackColorGeneral() {
return backColorGeneral;
}
- public final HtmlColor getBackColorElement() {
+ public final HColor getBackColorElement() {
return backColorElement;
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java
index 691550309..8e6543524 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java
@@ -62,13 +62,13 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.EntityPortion;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.sequencediagram.graphic.FileMaker;
import net.sourceforge.plantuml.sequencediagram.graphic.SequenceDiagramFileMakerPuma2;
import net.sourceforge.plantuml.sequencediagram.graphic.SequenceDiagramTxtMaker;
import net.sourceforge.plantuml.sequencediagram.teoz.SequenceDiagramFileMakerTeoz;
import net.sourceforge.plantuml.skin.rose.Rose;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class SequenceDiagram extends UmlDiagram {
@@ -92,8 +92,8 @@ public class SequenceDiagram extends UmlDiagram {
public Participant getOrCreateParticipant(String code, Display display) {
Participant result = participantsget(code);
if (result == null) {
- result = new Participant(ParticipantType.PARTICIPANT, code, display, hiddenPortions, 0, getSkinParam()
- .getCurrentStyleBuilder());
+ result = new Participant(ParticipantType.PARTICIPANT, code, display, hiddenPortions, 0,
+ getSkinParam().getCurrentStyleBuilder());
addWithOrder(result);
participantEnglobers2.put(result, participantEnglober);
}
@@ -123,8 +123,8 @@ public class SequenceDiagram extends UmlDiagram {
// display = Arrays.asList(code);
display = Display.getWithNewlines(code);
}
- final Participant result = new Participant(type, code, display, hiddenPortions, order, getSkinParam()
- .getCurrentStyleBuilder());
+ final Participant result = new Participant(type, code, display, hiddenPortions, order,
+ getSkinParam().getCurrentStyleBuilder());
addWithOrder(result);
participantEnglobers2.put(result, participantEnglober);
return result;
@@ -226,7 +226,7 @@ public class SequenceDiagram extends UmlDiagram {
return Collections.unmodifiableList(events);
}
- private FileMaker getSequenceDiagramPngMaker(FileFormatOption fileFormatOption) {
+ private FileMaker getSequenceDiagramPngMaker(int index, FileFormatOption fileFormatOption) {
final FileFormat fileFormat = fileFormatOption.getFileFormat();
@@ -235,7 +235,7 @@ public class SequenceDiagram extends UmlDiagram {
}
if (modeTeoz()) {
- return new SequenceDiagramFileMakerTeoz(this, skin2, fileFormatOption);
+ return new SequenceDiagramFileMakerTeoz(this, skin2, fileFormatOption, index);
}
return new SequenceDiagramFileMakerPuma2(this, skin2, fileFormatOption);
@@ -248,7 +248,7 @@ public class SequenceDiagram extends UmlDiagram {
@Override
protected ImageData exportDiagramInternal(OutputStream os, int index, FileFormatOption fileFormat)
throws IOException {
- final FileMaker sequenceDiagramPngMaker = getSequenceDiagramPngMaker(fileFormat);
+ final FileMaker sequenceDiagramPngMaker = getSequenceDiagramPngMaker(index, fileFormat);
return sequenceDiagramPngMaker.createOne(os, index, fileFormat.isWithMetadata());
}
@@ -264,11 +264,11 @@ public class SequenceDiagram extends UmlDiagram {
private LifeEvent pendingCreate = null;
- public String activate(Participant p, LifeEventType lifeEventType, HtmlColor backcolor) {
+ public String activate(Participant p, LifeEventType lifeEventType, HColor backcolor) {
return activate(p, lifeEventType, backcolor, null);
}
- public String activate(Participant p, LifeEventType lifeEventType, HtmlColor backcolor, HtmlColor linecolor) {
+ public String activate(Participant p, LifeEventType lifeEventType, HColor backcolor, HColor linecolor) {
if (lastDelay != null) {
return "You cannot Activate/Deactivate just after a ...";
}
@@ -305,8 +305,8 @@ public class SequenceDiagram extends UmlDiagram {
private final List openGroupings = new ArrayList();
- public boolean grouping(String title, String comment, GroupingType type, HtmlColor backColorGeneral,
- HtmlColor backColorElement, boolean parallel) {
+ public boolean grouping(String title, String comment, GroupingType type, HColor backColorGeneral,
+ HColor backColorElement, boolean parallel) {
if (type != GroupingType.START && openGroupings.size() == 0) {
return false;
}
@@ -316,9 +316,11 @@ public class SequenceDiagram extends UmlDiagram {
final GroupingStart top = openGroupings.size() > 0 ? openGroupings.get(0) : null;
- final Grouping g = type == GroupingType.START ? new GroupingStart(title, comment, backColorGeneral,
- backColorElement, top, getSkinParam().getCurrentStyleBuilder()) : new GroupingLeaf(title, comment,
- type, backColorGeneral, backColorElement, top, getSkinParam().getCurrentStyleBuilder());
+ final Grouping g = type == GroupingType.START
+ ? new GroupingStart(title, comment, backColorGeneral, backColorElement, top,
+ getSkinParam().getCurrentStyleBuilder())
+ : new GroupingLeaf(title, comment, type, backColorGeneral, backColorElement, top,
+ getSkinParam().getCurrentStyleBuilder());
events.add(g);
if (type == GroupingType.START) {
@@ -356,7 +358,8 @@ public class SequenceDiagram extends UmlDiagram {
// autoNumber.resume(decimalFormat);
// }
//
- // public final void autonumberResume(int increment, DecimalFormat decimalFormat) {
+ // public final void autonumberResume(int increment, DecimalFormat
+ // decimalFormat) {
// autoNumber.resume(increment, decimalFormat);
// }
@@ -392,7 +395,7 @@ public class SequenceDiagram extends UmlDiagram {
private ParticipantEnglober participantEnglober;
- public void boxStart(Display comment, HtmlColor color, Stereotype stereotype) {
+ public void boxStart(Display comment, HColor color, Stereotype stereotype) {
if (participantEnglober != null) {
throw new IllegalStateException();
}
@@ -413,7 +416,7 @@ public class SequenceDiagram extends UmlDiagram {
@Override
public int getNbImages() {
try {
- return getSequenceDiagramPngMaker(new FileFormatOption(FileFormat.PNG)).getNbPages();
+ return getSequenceDiagramPngMaker(1, new FileFormatOption(FileFormat.PNG)).getNbPages();
} catch (Throwable t) {
t.printStackTrace();
return 1;
@@ -518,7 +521,7 @@ public class SequenceDiagram extends UmlDiagram {
return super.checkFinalError();
}
- private final Set hiddenPortions = EnumSet. noneOf(EntityPortion.class);
+ private final Set hiddenPortions = EnumSet.noneOf(EntityPortion.class);
public void hideOrShow(Set portions, boolean show) {
if (show) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate.java
index 2e225f703..f351f8fdb 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandActivate.java
@@ -44,10 +44,10 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.sequencediagram.LifeEventType;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandActivate extends SingleLineCommand2 {
@@ -74,8 +74,8 @@ public class CommandActivate extends SingleLineCommand2 {
final LifeEventType type = LifeEventType.valueOf(StringUtils.goUpperCase(arg.get("TYPE", 0)));
final Participant p = diagram.getOrCreateParticipant(StringUtils
.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("WHO", 0)));
- final HtmlColor backColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("BACK", 0));
- final HtmlColor lineColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINE", 0));
+ final HColor backColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("BACK", 0));
+ final HColor lineColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("LINE", 0));
final String error = diagram.activate(p, type, backColor, lineColor);
if (error == null) {
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java
index 7b72b2e19..f1bec2a55 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java
@@ -52,8 +52,6 @@ import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
-import net.sourceforge.plantuml.graphic.HtmlColor;
-import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.sequencediagram.LifeEventType;
import net.sourceforge.plantuml.sequencediagram.Message;
import net.sourceforge.plantuml.sequencediagram.Participant;
@@ -63,6 +61,8 @@ import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.skin.ArrowDecoration;
import net.sourceforge.plantuml.skin.ArrowHead;
import net.sourceforge.plantuml.skin.ArrowPart;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
+import net.sourceforge.plantuml.ugraphic.color.HColorSet;
public class CommandArrow extends SingleLineCommand2 {
@@ -263,7 +263,7 @@ public class CommandArrow extends SingleLineCommand2 {
return CommandExecutionResult.error(error);
}
- final HtmlColor activationColor = diagram.getSkinParam().getIHtmlColorSet()
+ final HColor activationColor = diagram.getSkinParam().getIHtmlColorSet()
.getColorIfValid(arg.get("LIFECOLOR", 0));
if (activationSpec != null) {
@@ -323,7 +323,7 @@ public class CommandArrow extends SingleLineCommand2 {
config = config.withBody(ArrowBody.HIDDEN);
// link.goHidden();
} else {
- config = config.withColor(HtmlColorSet.getInstance().getColorIfValid(s));
+ config = config.withColor(HColorSet.instance().getColorIfValid(s));
}
}
return config;
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java
index 235ba8d00..016a76e61 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java
@@ -45,7 +45,6 @@ import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.sequencediagram.LifeEventType;
import net.sourceforge.plantuml.sequencediagram.MessageExo;
import net.sourceforge.plantuml.sequencediagram.MessageExoType;
@@ -56,6 +55,7 @@ import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.skin.ArrowDecoration;
import net.sourceforge.plantuml.skin.ArrowHead;
import net.sourceforge.plantuml.skin.ArrowPart;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
abstract class CommandExoArrowAny extends SingleLineCommand2 {
@@ -148,7 +148,7 @@ abstract class CommandExoArrowAny extends SingleLineCommand2 {
return CommandExecutionResult.error(error);
}
- final HtmlColor activationColor = diagram.getSkinParam().getIHtmlColorSet()
+ final HColor activationColor = diagram.getSkinParam().getIHtmlColorSet()
.getColorIfValid(arg.get("LIFECOLOR", 0));
if (activationSpec != null) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandGrouping.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandGrouping.java
index 0413113c0..05c203207 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandGrouping.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandGrouping.java
@@ -47,9 +47,9 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOptional;
import net.sourceforge.plantuml.command.regex.RegexResult;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.sequencediagram.GroupingType;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandGrouping extends SingleLineCommand2 {
@@ -72,10 +72,10 @@ public class CommandGrouping extends SingleLineCommand2 {
@Override
protected CommandExecutionResult executeArg(SequenceDiagram diagram, LineLocation location, RegexResult arg) {
String type = StringUtils.goLowerCase(arg.get("TYPE", 0));
- final HtmlColor backColorElement = diagram.getSkinParam().getIHtmlColorSet()
+ final HColor backColorElement = diagram.getSkinParam().getIHtmlColorSet()
.getColorIfValid(arg.get("COLORS", 0));
- final HtmlColor backColorGeneral = diagram.getSkinParam().getIHtmlColorSet()
- .getColorIfValid(arg.get("COLORS", 1), true);
+ final HColor backColorGeneral = diagram.getSkinParam().getIHtmlColorSet()
+ .getColorIfValid(arg.get("COLORS", 1), diagram.getSkinParam().getBackgroundColor());
String comment = arg.get("COMMENT", 0);
final GroupingType groupingType = GroupingType.getType(type);
if ("group".equals(type)) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceMultilinesOverSeveral.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceMultilinesOverSeveral.java
index db8914128..4254690bd 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceMultilinesOverSeveral.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceMultilinesOverSeveral.java
@@ -46,10 +46,10 @@ import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines;
import net.sourceforge.plantuml.cucadiagram.Display;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.Reference;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class CommandReferenceMultilinesOverSeveral extends CommandMultilines {
@@ -66,8 +66,8 @@ public class CommandReferenceMultilinesOverSeveral extends CommandMultilines line0 = StringUtils.getSplit(getStartingPattern(), lines.getFirst499().getTrimmed()
.getString());
- final HtmlColor backColorElement = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get(0));
- // final HtmlColor backColorGeneral = HtmlColorSet.getInstance().getColorIfValid(line0.get(1));
+ final HColor backColorElement = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get(0));
+ // final HtmlColor backColorGeneral = HtmlColorSetSimple.instance().getColorIfValid(line0.get(1));
final List participants = StringUtils.splitComma(line0.get(1));
final List p = new ArrayList();
@@ -88,7 +88,7 @@ public class CommandReferenceMultilinesOverSeveral extends CommandMultilines {
@@ -77,8 +77,8 @@ public class CommandReferenceOverSeveral extends SingleLineCommand2 participants = StringUtils.splitComma(arg.get("PARTS", 0));
final String url = arg.get("URL", 0);
@@ -97,7 +97,7 @@ public class CommandReferenceOverSeveral extends SingleLineCommand2 {
@@ -92,7 +91,7 @@ public class CommandReturn extends SingleLineCommand2 {
ArrowConfiguration arrow = message1.getArrowConfiguration().withBody(ArrowBody.DOTTED);
final String color = arg.get("COLOR", 0);
if (color != null) {
- arrow = arrow.withColor(HtmlColorSet.getInstance().getColorIfValid(color));
+ arrow = arrow.withColor(HColorSet.instance().getColorIfValid(color));
}
final Display display = Display.getWithNewlines(arg.get("MESSAGE", 0));
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndParticipant.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndParticipant.java
index 836382bf3..381ffc8b2 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndParticipant.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/ArrowAndParticipant.java
@@ -97,7 +97,7 @@ class ArrowAndParticipant extends Arrow implements InGroupable {
arrow.drawInternalU(ug, maxX, context);
} else {
final double boxWidth = participantBox.getPreferredWidth(ug.getStringBounder());
- arrow.drawInternalU(ug.apply(new UTranslate(boxWidth / 2 - paddingParticipant, 0)), maxX, context);
+ arrow.drawInternalU(ug.apply(UTranslate.dx(boxWidth / 2 - paddingParticipant)), maxX, context);
}
final double arrowHeight = arrow.getPreferredHeight(ug.getStringBounder());
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java
index a80d99dad..dced37e32 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java
@@ -296,7 +296,7 @@ public class DrawableSet {
private UTranslate getTranslate4(final double delta) {
if (delta > 0) {
- return new UTranslate(0, -delta);
+ return UTranslate.dy(-delta);
}
return new UTranslate();
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalDivider.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalDivider.java
index a590e589d..9e7a3bc3a 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalDivider.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalDivider.java
@@ -56,7 +56,7 @@ class GraphicalDivider extends GraphicalElement {
@Override
protected void drawInternalU(UGraphic ug, double maxX, Context2D context) {
- ug = ug.apply(new UTranslate(0, getStartingY()));
+ ug = ug.apply(UTranslate.dy(getStartingY()));
final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D dim = new Dimension2DDouble(maxX, comp.getPreferredHeight(stringBounder));
comp.drawU(ug, new Area(dim), context);
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalNewpage.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalNewpage.java
index 6dc63bb34..edd052356 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalNewpage.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalNewpage.java
@@ -58,7 +58,7 @@ class GraphicalNewpage extends GraphicalElement {
@Override
protected void drawInternalU(UGraphic ug, double maxX, Context2D context) {
//final double x = ug.getTranslateX();
- ug = ug.apply(new UTranslate(0, getStartingY()));
+ ug = ug.apply(UTranslate.dy(getStartingY()));
final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D dim = new Dimension2DDouble(maxX, comp.getPreferredHeight(stringBounder));
comp.drawU(ug, new Area(dim), context);
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementHeader.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementHeader.java
index 29c79143f..291f8ec00 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementHeader.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/GroupingGraphicalElementHeader.java
@@ -103,7 +103,7 @@ class GroupingGraphicalElementHeader extends GroupingGraphicalElement {
comp.drawU(ug, new Area(dim), context);
for (Component note : notes) {
final Dimension2D dimNote = note.getPreferredDimension(stringBounder);
- note.drawU(ug.apply(new UTranslate(x2 - x1, 0)), new Area(dimNote), context);
+ note.drawU(ug.apply(UTranslate.dx(x2 - x1)), new Area(dimNote), context);
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeLine.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeLine.java
index a16da8072..bd7b37c48 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeLine.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/LifeLine.java
@@ -45,7 +45,6 @@ import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParamBackcolored;
import net.sourceforge.plantuml.SkinParamForceColor;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.skin.Component;
@@ -55,6 +54,7 @@ import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class LifeLine {
@@ -203,15 +203,15 @@ public class LifeLine {
public void drawU(UGraphic ug, Rose skin, ISkinParam skinParam) {
final StringBounder stringBounder = ug.getStringBounder();
- ug = ug.apply(new UTranslate(getStartingX(stringBounder), 0));
+ ug = ug.apply(UTranslate.dx(getStartingX(stringBounder)));
for (int i = 0; i < events.size(); i++) {
ComponentType type = ComponentType.ALIVE_BOX_CLOSE_OPEN;
for (final Iterator it = getSegmentsCutted(stringBounder, i).iterator(); it.hasNext();) {
final SegmentColored seg = it.next();
- final HtmlColor specificBackColor = seg.getSpecificBackColor();
+ final HColor specificBackColor = seg.getSpecificBackColor();
ISkinParam skinParam2 = new SkinParamBackcolored(skinParam, specificBackColor);
- final HtmlColor specificLineColor = seg.getSpecificLineColor();
+ final HColor specificLineColor = seg.getSpecificLineColor();
if (specificLineColor != null) {
skinParam2 = new SkinParamForceColor(skinParam2, ColorParam.sequenceLifeLineBorder,
specificLineColor);
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantBox.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantBox.java
index 078c47877..de176a036 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantBox.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/ParticipantBox.java
@@ -149,14 +149,14 @@ public class ParticipantBox implements Pushable {
// ug.translate(outMargin, 0);
final StringBounder stringBounder = ug.getStringBounder();
head.drawU(
- ug.apply(new UTranslate(outMargin, 0)),
+ ug.apply(UTranslate.dx(outMargin)),
new Area(new Dimension2DDouble(head.getPreferredWidth(stringBounder), head
.getPreferredHeight(stringBounder))), new SimpleContext2D(false));
// ug.translate(-outMargin, 0);
}
public void drawLineU22(UGraphic ug, double startingY, final double endingY, boolean showTail, double myDelta) {
- ug = ug.apply(new UTranslate(startingX, 0));
+ ug = ug.apply(UTranslate.dx(startingX));
if (delays.size() > 0) {
final StringBounder stringBounder = ug.getStringBounder();
for (GraphicalDelayText delay : delays) {
@@ -185,7 +185,7 @@ public class ParticipantBox implements Pushable {
private void drawLine(UGraphic ug, double startingY, double endingY, Component comp) {
final StringBounder stringBounder = ug.getStringBounder();
- comp.drawU(ug.apply(new UTranslate(0, startingY)),
+ comp.drawU(ug.apply(UTranslate.dy(startingY)),
new Area(new Dimension2DDouble(head.getPreferredWidth(stringBounder) + outMargin * 2, endingY
- startingY)), new SimpleContext2D(false));
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/SegmentColored.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/SegmentColored.java
index 0dc367542..d35a22ed7 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/SegmentColored.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/SegmentColored.java
@@ -41,7 +41,6 @@ import java.util.Collection;
import java.util.Iterator;
import net.sourceforge.plantuml.Dimension2DDouble;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.SymbolContext;
import net.sourceforge.plantuml.skin.Area;
@@ -49,6 +48,7 @@ import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.SimpleContext2D;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
class SegmentColored {
@@ -68,14 +68,14 @@ class SegmentColored {
this.pos1Initial = pos1Initial;
}
- public HtmlColor getSpecificBackColor() {
+ public HColor getSpecificBackColor() {
if (colors == null) {
return null;
}
return colors.getBackColor();
}
- public HtmlColor getSpecificLineColor() {
+ public HColor getSpecificLineColor() {
if (colors == null) {
return null;
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java
index 5c9ea175d..e7feb2eb2 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java
@@ -56,7 +56,6 @@ import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
import net.sourceforge.plantuml.cucadiagram.DisplaySection;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@@ -75,6 +74,7 @@ import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.HColor;
public class SequenceDiagramFileMakerPuma2 implements FileMaker {
@@ -266,7 +266,7 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
return;
}
text.drawU(ug.apply(new UTranslate(area.getFooterX(diagram.getFooter().getHorizontalAlignment()), area
- .getFooterY() + legendHeight)));
+ .getFooterY() + legendHeight)));
}
private void drawHeader(SequenceDiagramArea area, UGraphic ug, int page) {
@@ -276,7 +276,7 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
return;
}
text.drawU(ug.apply(new UTranslate(area.getHeaderX(diagram.getHeader().getHorizontalAlignment()), area
- .getHeaderY())));
+ .getHeaderY())));
}
private double oneOf(double a, double b) {
@@ -308,8 +308,8 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
private PngTitler getPngTitler(final FontParam fontParam, int page) {
final ISkinParam skinParam = diagram.getSkinParam();
- final HtmlColor hyperlinkColor = skinParam.getHyperlinkColor();
- final HtmlColor titleColor = skinParam.getFontHtmlColor(null, fontParam);
+ final HColor hyperlinkColor = skinParam.getHyperlinkColor();
+ final HColor titleColor = skinParam.getFontHtmlColor(null, fontParam);
final String fontFamily = skinParam.getFont(null, false, fontParam).getFamily(null);
final int fontSize = skinParam.getFont(null, false, fontParam).getSize();
final DisplaySection display = diagram.getFooterOrHeaderTeoz(fontParam).withPage(page + 1, pages.size());
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramTxtMaker.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramTxtMaker.java
index fd3b0f1b6..45d670f0c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramTxtMaker.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramTxtMaker.java
@@ -111,7 +111,7 @@ public class SequenceDiagramTxtMaker implements FileMaker {
if (title.isWhite()) {
ug2 = ug;
} else {
- ug2 = (UGraphicTxt) ug.apply(new UTranslate(0, title.as().size() + 1));
+ ug2 = (UGraphicTxt) ug.apply(UTranslate.dy(title.as().size() + 1));
}
drawableSet.drawU22(ug2, 0, fullDimension.getWidth(), page, diagram.isShowFootbox());
if (title.isWhite() == false) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/AbstractTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/AbstractTile.java
index f959b3b34..ac13d3570 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/AbstractTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/AbstractTile.java
@@ -51,15 +51,15 @@ public abstract class AbstractTile implements Tile {
return result;
}
- public boolean matchAnchor(String anchor) {
+ public Tile matchAnchorV1(String anchor) {
final Event event = this.getEvent();
if (event instanceof AbstractMessage) {
final AbstractMessage msg = (AbstractMessage) event;
if (anchor.equals(msg.getAnchor())) {
- return true;
+ return this;
}
}
- return false;
+ return null;
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationExoTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationExoTile.java
index d7164c9d9..b277feb3a 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationExoTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationExoTile.java
@@ -121,7 +121,7 @@ public class CommunicationExoTile extends AbstractTile implements TileWithUpdate
}
final Area area = new Area(x2 - x1, dim.getHeight());
- ug = ug.apply(new UTranslate(x1, 0));
+ ug = ug.apply(UTranslate.dx(x1));
comp.drawU(ug, area, (Context2D) ug);
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTile.java
index 0e7114e84..0efc9b38a 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTile.java
@@ -171,7 +171,7 @@ public class CommunicationTile extends AbstractTile implements TileWithUpdateSta
}
x2 += LIVE_DELTA_SIZE * level2;
area = new Area(x1 - x2, dim.getHeight());
- ug = ug.apply(new UTranslate(x2, 0));
+ ug = ug.apply(UTranslate.dx(x2));
if (isCreate()) {
livingSpace2.drawHead(ug, (Context2D) ug, VerticalAlignment.TOP, HorizontalAlignment.RIGHT);
}
@@ -184,9 +184,9 @@ public class CommunicationTile extends AbstractTile implements TileWithUpdateSta
x1 += LIVE_DELTA_SIZE * level1;
x2 += LIVE_DELTA_SIZE * level2;
area = new Area(x2 - x1, dim.getHeight());
- ug = ug.apply(new UTranslate(x1, 0));
+ ug = ug.apply(UTranslate.dx(x1));
if (isCreate()) {
- livingSpace2.drawHead(ug.apply(new UTranslate(area.getDimensionToUse().getWidth(), 0)), (Context2D) ug,
+ livingSpace2.drawHead(ug.apply(UTranslate.dx(area.getDimensionToUse().getWidth())), (Context2D) ug,
VerticalAlignment.TOP, HorizontalAlignment.LEFT);
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteBottom.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteBottom.java
index 564e87193..5e5e45979 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteBottom.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteBottom.java
@@ -39,7 +39,6 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
@@ -55,6 +54,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.HColor;
public class CommunicationTileNoteBottom extends AbstractTile implements TileWithUpdateStairs, TileWithCallbackY {
@@ -119,7 +119,7 @@ public class CommunicationTileNoteBottom extends AbstractTile implements TileWit
private final double spacey = 10;
private void drawLine(UGraphic ug, double x1, double y1, double x2, double y2) {
- final HtmlColor color = new Rose().getHtmlColor(skinParam, ColorParam.arrow);
+ final HColor color = new Rose().getHtmlColor(skinParam, ColorParam.arrow);
final double dx = x2 - x1;
final double dy = y2 - y1;
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteLeft.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteLeft.java
index af839e449..96b5cf6bc 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteLeft.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteLeft.java
@@ -103,7 +103,7 @@ public class CommunicationTileNoteLeft extends AbstractTile implements TileWithU
tile.drawU(ug);
final Real p = getNotePosition(stringBounder);
- comp.drawU(ug.apply(new UTranslate(p.getCurrentValue(), 0)), area, (Context2D) ug);
+ comp.drawU(ug.apply(UTranslate.dx(p.getCurrentValue())), area, (Context2D) ug);
}
public double getPreferredHeight(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteRight.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteRight.java
index ba5932c04..9c35dae9f 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteRight.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteRight.java
@@ -111,7 +111,7 @@ public class CommunicationTileNoteRight extends AbstractTile implements TileWith
tile.drawU(ug);
final Real p = getNotePosition(stringBounder);
- comp.drawU(ug.apply(new UTranslate(p.getCurrentValue(), 0)), area, (Context2D) ug);
+ comp.drawU(ug.apply(UTranslate.dx(p.getCurrentValue())), area, (Context2D) ug);
}
public double getPreferredHeight(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteTop.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteTop.java
index fe55a2e7a..a360979cb 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteTop.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileNoteTop.java
@@ -39,7 +39,6 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam;
-import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
@@ -55,6 +54,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.HColor;
public class CommunicationTileNoteTop extends AbstractTile implements TileWithUpdateStairs, TileWithCallbackY {
@@ -103,14 +103,14 @@ public class CommunicationTileNoteTop extends AbstractTile implements TileWithUp
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
final Area area = new Area(dim.getWidth(), dim.getHeight());
- tile.drawU(ug.apply(new UTranslate(0, dim.getHeight() + spacey)));
+ tile.drawU(ug.apply(UTranslate.dy(dim.getHeight() + spacey)));
final double middleMsg = (tile.getMinX(stringBounder).getCurrentValue() + tile.getMaxX(stringBounder)
.getCurrentValue()) / 2;
final double xNote = getNotePosition(stringBounder).getCurrentValue();
- comp.drawU(ug.apply(new UTranslate(xNote, 0)), area, (Context2D) ug);
+ comp.drawU(ug.apply(UTranslate.dx(xNote)), area, (Context2D) ug);
drawLine(ug, middleMsg, tile.getYPoint(stringBounder) + dim.getHeight() + spacey, xNote + dim.getWidth() / 2,
dim.getHeight() - 2 * Rose.paddingY);
@@ -120,7 +120,7 @@ public class CommunicationTileNoteTop extends AbstractTile implements TileWithUp
private final double spacey = 10;
private void drawLine(UGraphic ug, double x1, double y1, double x2, double y2) {
- final HtmlColor color = new Rose().getHtmlColor(skinParam, ColorParam.arrow);
+ final HColor color = new Rose().getHtmlColor(skinParam, ColorParam.arrow);
final double dx = x2 - x1;
final double dy = y2 - y1;
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelf.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelf.java
index 6196b02d8..7db19bc75 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelf.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelf.java
@@ -140,7 +140,7 @@ public class CommunicationTileSelf extends AbstractTile implements TileWithUpdat
// // x1 += CommunicationTile.LIVE_DELTA_SIZE * levelConsidere;
// }
area.setDeltaX1((levelIgnore - levelConsidere) * CommunicationTile.LIVE_DELTA_SIZE);
- ug = ug.apply(new UTranslate(x1, 0));
+ ug = ug.apply(UTranslate.dx(x1));
comp.drawU(ug, area, (Context2D) ug);
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelfNoteRight.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelfNoteRight.java
index f26c6dbfc..546bcf7cc 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelfNoteRight.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/CommunicationTileSelfNoteRight.java
@@ -99,7 +99,7 @@ public class CommunicationTileSelfNoteRight extends AbstractTile implements Tile
tile.drawU(ug);
final Real p = getNotePosition(stringBounder);
- comp.drawU(ug.apply(new UTranslate(p.getCurrentValue(), 0)), area, (Context2D) ug);
+ comp.drawU(ug.apply(UTranslate.dx(p.getCurrentValue())), area, (Context2D) ug);
}
public double getPreferredHeight(StringBounder stringBounder) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/DelayTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/DelayTile.java
index 407198621..d7e59329c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/DelayTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/DelayTile.java
@@ -102,7 +102,7 @@ public class DelayTile extends AbstractTile implements Tile, TileWithCallbackY {
final Area area = new Area(getPreferredWidth(stringBounder), dim.getHeight());
tileArguments.getLivingSpaces().delayOn(y, dim.getHeight());
- ug = ug.apply(new UTranslate(getMinX(stringBounder).getCurrentValue(), 0));
+ ug = ug.apply(UTranslate.dx(getMinX(stringBounder).getCurrentValue()));
comp.drawU(ug, area, (Context2D) ug);
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/DividerTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/DividerTile.java
index 964182495..f7795fb7b 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/DividerTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/DividerTile.java
@@ -83,7 +83,7 @@ public class DividerTile extends AbstractTile implements Tile {
final Area area = new Area(tileArguments.getBorder2() - tileArguments.getBorder1() - origin.getCurrentValue(),
dim.getHeight());
- ug = ug.apply(new UTranslate(tileArguments.getBorder1(), 0));
+ ug = ug.apply(UTranslate.dx(tileArguments.getBorder1()));
comp.drawU(ug, area, (Context2D) ug);
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/GroupingTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/GroupingTile.java
index 681a3c5ec..6b7be4fb9 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/GroupingTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/GroupingTile.java
@@ -87,12 +87,23 @@ public class GroupingTile extends AbstractTile implements TileWithCallbackY {
return 0;
}
+ @Override
+ public Tile matchAnchorV1(String anchor) {
+ for (Tile tile : tiles) {
+ final Tile result = tile.matchAnchorV1(anchor);
+ if (result != null) {
+ return result;
+ }
+ }
+ return super.matchAnchorV1(anchor);
+ }
+
public GroupingTile(Iterator it, GroupingStart start, TileArguments tileArgumentsBachColorChanged,
TileArguments tileArgumentsOriginal) {
final StringBounder stringBounder = tileArgumentsOriginal.getStringBounder();
this.start = start;
- this.display = start.getTitle().equals("group") ? Display.create(start.getComment()) : Display.create(
- start.getTitle(), start.getComment());
+ this.display = start.getTitle().equals("group") ? Display.create(start.getComment())
+ : Display.create(start.getTitle(), start.getComment());
this.skin = tileArgumentsOriginal.getSkin();
// this.skinParam = tileArgumentsOriginal.getSkinParam();
this.skinParam = tileArgumentsBachColorChanged.getSkinParam();
@@ -155,14 +166,15 @@ public class GroupingTile extends AbstractTile implements TileWithCallbackY {
final Area area = new Area(max.getCurrentValue() - min.getCurrentValue(), getTotalHeight(stringBounder));
if (ug instanceof LiveBoxFinder == false) {
- comp.drawU(ug.apply(new UTranslate(min.getCurrentValue(), 0)), area, (Context2D) ug);
+ comp.drawU(ug.apply(UTranslate.dx(min.getCurrentValue())), area, (Context2D) ug);
drawAllElses(ug);
}
- // ug.apply(new UChangeBackColor(HtmlColorUtils.LIGHT_GRAY)).draw(new URectangle(area.getDimensionToUse()));
+ // ug.apply(new UChangeBackColor(HtmlColorUtils.LIGHT_GRAY)).draw(new
+ // URectangle(area.getDimensionToUse()));
double h = dim1.getHeight() + MARGINY / 2;
for (Tile tile : tiles) {
- ug.apply(new UTranslate(0, h)).draw(tile);
+ ug.apply(UTranslate.dy(h)).draw(tile);
final double preferredHeight = tile.getPreferredHeight(stringBounder);
h += preferredHeight;
}
@@ -176,7 +188,8 @@ public class GroupingTile extends AbstractTile implements TileWithCallbackY {
private void drawAllElses(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
final double totalHeight = getTotalHeight(stringBounder);
- // final double suppHeight = getPreferredDimensionIfEmpty(stringBounder).getHeight() + MARGINY / 2;
+ // final double suppHeight =
+ // getPreferredDimensionIfEmpty(stringBounder).getHeight() + MARGINY / 2;
final List ys = new ArrayList();
for (Tile tile : tiles) {
if (tile instanceof ElseTile) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java
index 4daa64fd5..5ed13a66d 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/LifeEventTile.java
@@ -87,7 +87,7 @@ public class LifeEventTile extends AbstractTile implements TileWithUpdateStairs
final Component cross = skin.createComponent(null, ComponentType.DESTROY, null, skinParam, null);
final Dimension2D dimCross = cross.getPreferredDimension(ug.getStringBounder());
final double x = livingSpace.getPosC(ug.getStringBounder()).getCurrentValue();
- cross.drawU(ug.apply(new UTranslate(x - dimCross.getWidth() / 2, 0)), null, (Context2D) ug);
+ cross.drawU(ug.apply(UTranslate.dx(x - dimCross.getWidth() / 2)), null, (Context2D) ug);
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxFinder.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxFinder.java
index 94e64a807..886f8e93b 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxFinder.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxFinder.java
@@ -37,8 +37,6 @@ package net.sourceforge.plantuml.sequencediagram.teoz;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.graphic.StringBounder;
-import net.sourceforge.plantuml.ugraphic.ColorMapper;
-import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.UChange;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
@@ -48,6 +46,8 @@ import net.sourceforge.plantuml.ugraphic.UParamNull;
import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
+import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
public class LiveBoxFinder implements UGraphic {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxes.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxes.java
index 932561d96..b783fb506 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxes.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/LiveBoxes.java
@@ -87,7 +87,7 @@ public class LiveBoxes {
private void drawOneLevel(UGraphic ug, int levelToDraw, Stairs2 stairs, Context2D context) {
final LiveBoxesDrawer drawer = new LiveBoxesDrawer(context, skin, skinParam, delays);
- ug = ug.apply(new UTranslate((levelToDraw - 1) * drawer.getWidth(ug.getStringBounder()) / 2.0, 0));
+ ug = ug.apply(UTranslate.dx((levelToDraw - 1) * drawer.getWidth(ug.getStringBounder()) / 2.0));
boolean pending = true;
for (Iterator it = stairs.getYs().iterator(); it.hasNext();) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpace.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpace.java
index a32f6ab16..d3f7d1226 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpace.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpace.java
@@ -177,10 +177,10 @@ public class LivingSpace {
p.getSkinParamBackcolored(skinParam), p.getDisplay(skinParam.forceSequenceParticipantUnderlined()));
final Dimension2D dim = comp.getPreferredDimension(ug.getStringBounder());
if (horizontalAlignment == HorizontalAlignment.RIGHT) {
- ug = ug.apply(new UTranslate(-dim.getWidth(), 0));
+ ug = ug.apply(UTranslate.dx(-dim.getWidth()));
}
if (verticalAlignment == VerticalAlignment.CENTER) {
- ug = ug.apply(new UTranslate(0, -dim.getHeight() / 2));
+ ug = ug.apply(UTranslate.dy(-dim.getHeight() / 2));
}
final Area area = new Area(dim);
final Url url = getParticipant().getUrl();
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpaces.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpaces.java
index 156cc914c..8f4427180 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpaces.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/LivingSpaces.java
@@ -136,7 +136,7 @@ public class LivingSpaces {
// }
// System.err.println("drawing lines " + livingSpace);
final double x = livingSpace.getPosC(ug.getStringBounder()).getCurrentValue();
- livingSpace.drawLineAndLiveBoxes(ug.apply(new UTranslate(x, 0)), height, context);
+ livingSpace.drawLineAndLiveBoxes(ug.apply(UTranslate.dx(x)), height, context);
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/MutingLine.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/MutingLine.java
index 497e4bd6f..872bce870 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/MutingLine.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/MutingLine.java
@@ -110,7 +110,7 @@ public class MutingLine {
final Component comp = skin.createComponent(new Style[] { style }, defaultLineType, null, skinParam, null);
final Dimension2D dim = comp.getPreferredDimension(ug.getStringBounder());
final Area area = new Area(dim.getWidth(), y2 - y1);
- comp.drawU(ug.apply(new UTranslate(0, y1)), area, context);
+ comp.drawU(ug.apply(UTranslate.dy(y1)), area, context);
}
public void delayOn(double y, double height) {
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/NoteTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/NoteTile.java
index 3df211f46..17348cc28 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/NoteTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/NoteTile.java
@@ -101,7 +101,7 @@ public class NoteTile extends AbstractTile implements Tile {
final double x = getX(stringBounder).getCurrentValue();
final Area area = new Area(getUsedWidth(stringBounder), dim.getHeight());
- ug = ug.apply(new UTranslate(x, 0));
+ ug = ug.apply(UTranslate.dx(x));
comp.drawU(ug, area, (Context2D) ug);
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/NotesTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/NotesTile.java
index 9ee0b25b3..e85f37948 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/NotesTile.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/NotesTile.java
@@ -99,7 +99,7 @@ public class NotesTile extends AbstractTile implements Tile {
final double x = getX(stringBounder, note).getCurrentValue();
final Area area = new Area(getUsedWidth(stringBounder, note), dim.getHeight());
- final UGraphic ug2 = ug.apply(new UTranslate(x, 0));
+ final UGraphic ug2 = ug.apply(UTranslate.dx(x));
comp.drawU(ug2, area, (Context2D) ug2);
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/PlayingSpace.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/PlayingSpace.java
index 57353c7e6..9215b0c2b 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/teoz/PlayingSpace.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/PlayingSpace.java
@@ -128,7 +128,7 @@ public class PlayingSpace implements Bordered {
private YPositionedTile getFromAnchor(List