From 62e5a00c8da63ad8d32c9a6d8a1cf49908cc32bc Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Wed, 17 Aug 2022 19:34:24 +0200 Subject: [PATCH] wip --- .../sourceforge/plantuml/AFileZipEntry.java | 12 +- src/net/sourceforge/plantuml/BlockUml.java | 10 +- .../plantuml/Dimension2DDouble.java | 2 +- src/net/sourceforge/plantuml/DirWatcher2.java | 12 +- .../sourceforge/plantuml/EmbeddedDiagram.java | 18 +-- src/net/sourceforge/plantuml/FileFormat.java | 20 +-- .../plantuml/GeneratedImageImpl.java | 10 +- src/net/sourceforge/plantuml/Log.java | 38 +++--- src/net/sourceforge/plantuml/OptionFlags.java | 12 +- src/net/sourceforge/plantuml/Run.java | 14 +- .../sourceforge/plantuml/SignatureUtils.java | 28 ++-- src/net/sourceforge/plantuml/SkinParam.java | 12 +- .../plantuml/SourceFileReaderAbstract.java | 11 +- src/net/sourceforge/plantuml/Splash.java | 10 +- .../sourceforge/plantuml/TitledDiagram.java | 8 +- src/net/sourceforge/plantuml/UmlDiagram.java | 20 +-- .../acearth/PSystemXearthFactory.java | 4 +- .../vcompact/FtileFactoryDelegatorIf.java | 4 - .../vcompact/cond/ConditionalBuilder.java | 4 - .../activitydiagram3/gtile/Gtiles.java | 4 - .../plantuml/ant/CheckZipTask.java | 11 +- .../plantuml/ant/PlantUmlTask.java | 13 +- .../plantuml/api/ImageDataAbstract.java | 1 - .../plantuml/api/ImageDataComplex.java | 3 +- .../plantuml/api/ImageDataSimple.java | 1 - .../plantuml/api/NumberAnalyzed.java | 11 +- .../plantuml/api/NumberAnalyzed2.java | 10 +- .../plantuml/api/NumberAnalyzedDated.java | 10 +- .../plantuml/api/TimeoutExecutor.java | 14 +- .../plantuml/argon2/blake2/Blake2b.java | 3 +- .../plantuml/code/CompressionBrotli.java | 10 +- .../plantuml/code/CompressionZlibAttic.java | 10 +- .../plantuml/code/Upf9Encoder.java | 12 +- .../plantuml/command/CommandSkinParam.java | 10 +- .../plantuml/command/ProtectedCommand.java | 17 +-- .../plantuml/command/SkinLoader.java | 10 +- .../plantuml/creole/atom/Atom.java | 2 +- .../plantuml/creole/atom/AtomEmoji.java | 3 +- .../creole/atom/AtomHorizontalTexts.java | 2 +- .../plantuml/creole/atom/AtomImg.java | 36 ++--- .../plantuml/creole/atom/AtomImgSvg.java | 1 - .../plantuml/creole/atom/AtomMath.java | 2 +- .../plantuml/creole/atom/AtomOpenIcon.java | 3 +- .../plantuml/creole/atom/AtomSpace.java | 3 +- .../plantuml/creole/atom/AtomSprite.java | 3 +- .../plantuml/creole/atom/AtomTable.java | 2 +- .../plantuml/creole/atom/AtomTree.java | 2 +- .../creole/atom/AtomVerticalTexts.java | 2 +- .../plantuml/creole/atom/AtomWithMargin.java | 2 +- .../plantuml/creole/atom/Bullet.java | 3 +- .../plantuml/cucadiagram/Body3.java | 2 +- .../plantuml/cucadiagram/EntityPosition.java | 2 +- .../plantuml/cucadiagram/GroupPrinter.java | 12 +- .../plantuml/cucadiagram/GroupRoot.java | 2 - .../plantuml/cucadiagram/Link.java | 2 +- .../plantuml/cucadiagram/LinkConstraint.java | 2 +- .../cucadiagram/NoteLinkStrategy.java | 3 +- .../cucadiagram/dot/AbstractGraphviz.java | 14 +- .../plantuml/cucadiagram/dot/DebugTrace.java | 10 +- .../cucadiagram/dot/GraphvizUtils.java | 20 +-- .../cucadiagram/dot/GraphvizWindowsOld.java | 12 +- .../cucadiagram/dot/Neighborhood.java | 2 +- .../cucadiagram/dot/ProcessRunner.java | 24 ++-- .../dedication/DedicationCrypted.java | 12 +- .../plantuml/dedication/DedicationSimple.java | 14 +- .../plantuml/dedication/Dedications.java | 12 +- .../dedication/PSystemDedication.java | 4 +- .../plantuml/ditaa/PSystemDitaa.java | 10 +- .../plantuml/donors/PSystemDonors.java | 14 +- .../donors/PSystemSkinparameterList.java | 2 +- .../plantuml/eggs/PSystemAppleTwoFactory.java | 12 +- .../plantuml/eggs/PSystemColors.java | 2 +- .../sourceforge/plantuml/eggs/PSystemEgg.java | 4 +- .../plantuml/eggs/PSystemRIPFactory.java | 12 +- .../plantuml/elk/CucaDiagramFileMakerElk.java | 20 +-- .../plantuml/elk/proxy/Reflect.java | 42 +++--- src/net/sourceforge/plantuml/emoji/Emoji.java | 6 +- .../plantuml/emoji/SpriteSvgNanoParser.java | 12 +- src/net/sourceforge/plantuml/ftp/FtpLoop.java | 12 +- .../sourceforge/plantuml/ftp/FtpServer.java | 12 +- .../sourceforge/plantuml/fun/IconLoader.java | 10 +- src/net/sourceforge/plantuml/graphic/Img.java | 14 +- .../plantuml/graphic/QuoteUtils.java | 6 +- .../sourceforge/plantuml/graphic/Rainbow.java | 1 - .../plantuml/graphic/UnusedSpace.java | 10 +- .../plantuml/hcl/HclDiagramFactory.java | 12 +- .../plantuml/help/CommandHelpTheme.java | 4 +- .../plantuml/jcckit/PSystemJcckitFactory.java | 12 +- src/net/sourceforge/plantuml/log/Logger.java | 57 -------- src/net/sourceforge/plantuml/log/Logme.java | 67 ++++++++++ .../plantuml/log/SimpleFormatter.java | 74 +++++++++++ .../sourceforge/plantuml/math/AsciiMath.java | 2 +- .../plantuml/math/ConverterSvg.java | 15 +-- .../plantuml/math/LatexBuilder.java | 2 +- .../plantuml/math/PSystemLatex.java | 14 +- .../plantuml/math/PSystemMath.java | 14 +- .../plantuml/math/ScientificEquation.java | 2 +- .../plantuml/math/ScientificEquationSafe.java | 16 +-- .../sourceforge/plantuml/mindmap/MindMap.java | 8 +- .../plantuml/openiconic/OpenIcon.java | 14 +- .../plantuml/pdf/PdfConverter.java | 12 +- .../plantuml/picoweb/PicoWebServer.java | 16 +-- .../plantuml/picoweb/PicoWebServerTest.java | 17 +-- .../plantuml/posimo/AbstractEntityImage2.java | 83 ------------ .../plantuml/posimo/EntityImageNote2.java | 81 ------------ .../preproc/StartDiagramExtractReader.java | 12 +- .../sourceforge/plantuml/preproc/Stdlib.java | 88 ++++++------ .../plantuml/preproc2/PreprocessorUtils.java | 42 +++--- .../plantuml/project/GanttConstraint.java | 24 ++-- .../plantuml/project/GanttConstraintMode.java | 41 ++++++ .../plantuml/project/GanttDiagram.java | 66 ++++++--- .../plantuml/project/OpenClose.java | 79 ++++++----- .../plantuml/project/core/TaskImpl.java | 86 ++++++------ .../plantuml/project/core/TaskInstant.java | 56 +++++--- .../project/draw/TaskDrawDiamond.java | 9 +- .../project/draw/TaskDrawRegular.java | 125 +++--------------- ...lementBeforeOrAfterOrAtTaskStartOrEnd.java | 13 +- .../project/lang/ComplementClose.java | 13 +- .../plantuml/project/lang/ComplementOpen.java | 13 +- .../project/lang/SubjectDayAsDate.java | 4 +- .../project/lang/SubjectDaysAsDates.java | 16 +-- .../plantuml/project/solver/Solver3.java | 4 +- .../plantuml/project/solver/SolverImpl.java | 12 +- .../plantuml/real/PositiveForce.java | 19 ++- .../sourceforge/plantuml/real/RealMax.java | 14 +- .../plantuml/real/RealMoveable.java | 14 +- .../plantuml/salt/PSystemSalt.java | 14 +- .../sdot/CucaDiagramFileMakerSmetana.java | 12 +- .../sourceforge/plantuml/security/SFile.java | 20 +-- .../sourceforge/plantuml/security/SURL.java | 38 +++--- .../plantuml/security/SecurityUtils.java | 6 +- .../AbstractOAuth2AccessAuthorizeManager.java | 18 +-- .../oauth/OAuth2AccessInterceptor.java | 4 +- .../OAuth2ClientAccessAuthorizeManager.java | 4 +- ...h2ResourceOwnerAccessAuthorizeManager.java | 4 +- .../sequencediagram/SequenceDiagram.java | 10 +- .../sourceforge/plantuml/skin/rose/Rose.java | 4 - .../plantuml/sprite/ListSpriteDiagram.java | 2 +- .../plantuml/sprite/RessourcesUtils.java | 12 +- .../plantuml/sprite/SpriteColor.java | 2 +- .../plantuml/sprite/SpriteGrayLevel.java | 12 +- .../plantuml/sprite/SpriteImage.java | 12 +- .../plantuml/sprite/SpriteMonochrome.java | 2 +- .../plantuml/sprite/SpriteSvg.java | 3 +- .../plantuml/sprite/StdlibDiagram.java | 14 +- .../plantuml/stats/FormatCounter.java | 10 +- .../plantuml/stats/HistoricalData.java | 10 +- .../plantuml/stats/StatsUtils.java | 20 +-- .../plantuml/stats/StatsUtilsIncrement.java | 10 +- .../style/CommandStyleMultilinesCSS.java | 8 +- src/net/sourceforge/plantuml/style/SName.java | 1 + .../svek/CucaDiagramFileMakerSvek.java | 14 +- .../plantuml/svek/GeneralImageBuilder.java | 12 +- .../svek/image/EntityImageClassHeader.java | 14 +- .../plantuml/svek/image/EntityImagePort.java | 2 +- .../sourceforge/plantuml/svg/SvgGraphics.java | 9 +- .../plantuml/swing/ImageWindow.java | 12 +- .../plantuml/swing/MainWindow.java | 18 ++- .../plantuml/telnet/AcceptTelnetClient.java | 12 +- .../sourceforge/plantuml/tim/EaterTheme.java | 8 +- .../sourceforge/plantuml/tim/TContext.java | 115 ++++++++-------- .../sourceforge/plantuml/tim/TimLoader.java | 4 +- .../plantuml/tim/stdlib/LoadJson.java | 18 +-- .../plantuml/tim/stdlib/LoadJsonLegacy.java | 18 +-- .../plantuml/timingdiagram/PlayerAnalog.java | 10 +- .../plantuml/timingdiagram/TimingRuler.java | 1 - .../ugraphic/g2d/ExtendedGeneralPath.java | 32 ++--- .../sourceforge/plantuml/utils/Cypher.java | 12 +- .../sourceforge/plantuml/utils/MathUtils.java | 2 +- .../plantuml/version/LicenseInfo.java | 18 +-- .../plantuml/version/PLSSignature.java | 10 +- .../plantuml/version/PSystemKeycheck.java | 12 +- .../plantuml/version/PSystemKeygen.java | 10 +- .../plantuml/version/PSystemVersion.java | 16 +-- .../version/PSystemVersionFactory.java | 2 - .../sourceforge/plantuml/version/Version.java | 17 ++- .../plantuml/vizjs/GraphvizJs.java | 14 +- .../sourceforge/plantuml/wbs/WBSDiagram.java | 10 +- .../sourceforge/plantuml/webp/VP8Decoder.java | 16 +-- .../sourceforge/plantuml/webp/VP8Frame.java | 90 ++++++------- .../windowsdot/WindowsDotArchive.java | 12 +- .../plantuml/xmi/CucaDiagramXmiMaker.java | 14 +- .../plantuml/xmi/SequenceDiagramXmiMaker.java | 15 +-- .../xmlsc/StateDiagramScxmlMaker.java | 14 +- .../plantuml/yaml/YamlDiagramFactory.java | 12 +- .../ascii2image/core/ConversionOptions.java | 6 +- .../ascii2image/graphics/BitmapRenderer.java | 2 +- .../ascii2image/graphics/ImageHandler.java | 2 +- src/smetana/core/CArray.java | 4 +- 189 files changed, 1430 insertions(+), 1518 deletions(-) delete mode 100644 src/net/sourceforge/plantuml/log/Logger.java create mode 100644 src/net/sourceforge/plantuml/log/Logme.java create mode 100644 src/net/sourceforge/plantuml/log/SimpleFormatter.java delete mode 100644 src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java delete mode 100644 src/net/sourceforge/plantuml/posimo/EntityImageNote2.java create mode 100644 src/net/sourceforge/plantuml/project/GanttConstraintMode.java diff --git a/src/net/sourceforge/plantuml/AFileZipEntry.java b/src/net/sourceforge/plantuml/AFileZipEntry.java index cd9a945fb..5169439d7 100644 --- a/src/net/sourceforge/plantuml/AFileZipEntry.java +++ b/src/net/sourceforge/plantuml/AFileZipEntry.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -40,7 +40,7 @@ import java.io.InputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; public class AFileZipEntry implements AFile { @@ -76,7 +76,7 @@ public class AFileZipEntry implements AFile { zis.closeEntry(); zis.close(); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } return null; } @@ -89,7 +89,7 @@ public class AFileZipEntry implements AFile { is.close(); return true; } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } } diff --git a/src/net/sourceforge/plantuml/BlockUml.java b/src/net/sourceforge/plantuml/BlockUml.java index d9104e9cf..6fddffede 100644 --- a/src/net/sourceforge/plantuml/BlockUml.java +++ b/src/net/sourceforge/plantuml/BlockUml.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -55,7 +55,7 @@ import net.sourceforge.plantuml.code.TranscoderUtil; import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.core.Diagram; import net.sourceforge.plantuml.error.PSystemErrorPreprocessor; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.preproc.Defines; import net.sourceforge.plantuml.preproc.FileWithSuffix; import net.sourceforge.plantuml.preproc2.PreprocessorModeSet; @@ -198,7 +198,7 @@ public class BlockUml { final byte[] digest = msgDigest.digest(); return coder.encode(digest); } catch (Exception e) { - Logger.error(e); + Logme.error(e); return "NOETAG"; } } diff --git a/src/net/sourceforge/plantuml/Dimension2DDouble.java b/src/net/sourceforge/plantuml/Dimension2DDouble.java index 4b0222e17..bf091c48e 100644 --- a/src/net/sourceforge/plantuml/Dimension2DDouble.java +++ b/src/net/sourceforge/plantuml/Dimension2DDouble.java @@ -36,9 +36,9 @@ package net.sourceforge.plantuml; import java.awt.Dimension; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.utils.MathUtils; public class Dimension2DDouble extends Dimension2D { diff --git a/src/net/sourceforge/plantuml/DirWatcher2.java b/src/net/sourceforge/plantuml/DirWatcher2.java index 08df525b4..ac185198a 100644 --- a/src/net/sourceforge/plantuml/DirWatcher2.java +++ b/src/net/sourceforge/plantuml/DirWatcher2.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -31,7 +31,7 @@ * * Original Author: Arnaud Roques * - * + * */ package net.sourceforge.plantuml; @@ -49,7 +49,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.preproc.FileWithSuffix; public class DirWatcher2 { @@ -99,7 +99,7 @@ public class DirWatcher2 { modifieds.put(f, new FileWatcher(files)); return Collections.unmodifiableList(generatedImages); } catch (Exception e) { - Logger.error(e); + Logme.error(e); return Collections.emptyList(); } } diff --git a/src/net/sourceforge/plantuml/EmbeddedDiagram.java b/src/net/sourceforge/plantuml/EmbeddedDiagram.java index 574975da2..1dc9bbb72 100644 --- a/src/net/sourceforge/plantuml/EmbeddedDiagram.java +++ b/src/net/sourceforge/plantuml/EmbeddedDiagram.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml; @@ -49,7 +49,7 @@ import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.Line; import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.preproc.Defines; import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.ugraphic.AffineTransformType; @@ -82,9 +82,9 @@ class EmbeddedDiagramDraw extends AbstractTextBlock implements Line, Atom { final BufferedImage im = getImage(); return new Dimension2DDouble(im.getWidth(), im.getHeight()); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } catch (InterruptedException e) { - Logger.error(e); + Logme.error(e); } return new Dimension2DDouble(42, 42); } @@ -102,9 +102,9 @@ class EmbeddedDiagramDraw extends AbstractTextBlock implements Line, Atom { final UShape image = new UImage(new PixelImage(im, AffineTransformType.TYPE_BILINEAR)); ug.draw(image); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } catch (InterruptedException e) { - Logger.error(e); + Logme.error(e); } } diff --git a/src/net/sourceforge/plantuml/FileFormat.java b/src/net/sourceforge/plantuml/FileFormat.java index b2044074d..0e42638fc 100644 --- a/src/net/sourceforge/plantuml/FileFormat.java +++ b/src/net/sourceforge/plantuml/FileFormat.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -39,16 +39,16 @@ import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.RenderingHints; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.io.IOException; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.braille.BrailleCharFactory; import net.sourceforge.plantuml.braille.UGraphicBraille; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounderRaw; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.png.MetadataTag; import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.svg.SvgGraphics; @@ -57,9 +57,9 @@ import net.sourceforge.plantuml.ugraphic.debug.StringBounderDebug; /** * Format for output files generated by PlantUML. - * + * * @author Arnaud Roques - * + * */ public enum FileFormat { PNG("image/png"), @@ -97,7 +97,7 @@ public enum FileFormat { /** * Returns the file format to be used for that format. - * + * * @return a string starting by a point. */ public String getFileSuffix() { @@ -229,7 +229,7 @@ public enum FileFormat { /** * Check if this file format is Encapsulated PostScript. - * + * * @return true for EPS. */ public boolean isEps() { @@ -300,7 +300,7 @@ public enum FileFormat { } } catch (IOException e) { - Logger.error(e); + Logme.error(e); } return false; } diff --git a/src/net/sourceforge/plantuml/GeneratedImageImpl.java b/src/net/sourceforge/plantuml/GeneratedImageImpl.java index f949b251b..308825ba9 100644 --- a/src/net/sourceforge/plantuml/GeneratedImageImpl.java +++ b/src/net/sourceforge/plantuml/GeneratedImageImpl.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -40,7 +40,7 @@ import java.io.IOException; import net.sourceforge.plantuml.core.Diagram; import net.sourceforge.plantuml.error.PSystemError; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; public class GeneratedImageImpl implements GeneratedImage { @@ -89,7 +89,7 @@ public class GeneratedImageImpl implements GeneratedImage { return cmp; } } catch (IOException e) { - Logger.error(e); + Logme.error(e); } return this.description.compareTo(this2.getDescription()); } diff --git a/src/net/sourceforge/plantuml/Log.java b/src/net/sourceforge/plantuml/Log.java index 9cc45079a..26be31d3f 100644 --- a/src/net/sourceforge/plantuml/Log.java +++ b/src/net/sourceforge/plantuml/Log.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -35,34 +35,23 @@ */ package net.sourceforge.plantuml; -import net.sourceforge.plantuml.log.Logger; - -public class Log { +public abstract class Log { private static final long start = System.currentTimeMillis(); public synchronized static void debug(String s) { - // noop - } - - public static void println(Object s) { - // noop - } - - public static void header(String s) { - // noop } public synchronized static void info(String s) { if (OptionFlags.getInstance().isVerbose()) { ProgressBar.clear(); - Logger.error(format(s)); + System.err.println(format(s)); } } public synchronized static void error(String s) { ProgressBar.clear(); - Logger.error(s); + System.err.println(s); } private static String format(String s) { @@ -104,5 +93,20 @@ public class Log { sb.append(" Mo - "); sb.append(s); return sb.toString(); + + } + + public static void println(Object s) { + // if (header2.get() == null) { + // System.err.println("L = " + s); + // } else { + // System.err.println(header2.get() + " " + s); + // } + } + + // private static final ThreadLocal header2 = new ThreadLocal<>(); + // + public static void header(String s) { + // header2.set(s); } } diff --git a/src/net/sourceforge/plantuml/OptionFlags.java b/src/net/sourceforge/plantuml/OptionFlags.java index d981acdec..24211dc90 100644 --- a/src/net/sourceforge/plantuml/OptionFlags.java +++ b/src/net/sourceforge/plantuml/OptionFlags.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -41,7 +41,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import net.sourceforge.plantuml.core.Diagram; import net.sourceforge.plantuml.cucadiagram.dot.GraphvizUtils; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.security.SecurityUtils; @@ -218,7 +218,7 @@ public class OptionFlags { ps.println(); } catch (FileNotFoundException e) { Log.error("Cannot open " + logData); - Logger.error(e); + Logme.error(e); } } } @@ -230,7 +230,7 @@ public class OptionFlags { ps.println(); } catch (FileNotFoundException e) { Log.error("Cannot open " + logData); - Logger.error(e); + Logme.error(e); } } diff --git a/src/net/sourceforge/plantuml/Run.java b/src/net/sourceforge/plantuml/Run.java index 8bd63d3a4..33c056623 100644 --- a/src/net/sourceforge/plantuml/Run.java +++ b/src/net/sourceforge/plantuml/Run.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -58,7 +58,7 @@ import net.sourceforge.plantuml.code.NoPlantumlCompressionException; import net.sourceforge.plantuml.code.Transcoder; import net.sourceforge.plantuml.code.TranscoderUtil; import net.sourceforge.plantuml.ftp.FtpServer; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.picoweb.PicoWebServer; import net.sourceforge.plantuml.png.MetadataTag; import net.sourceforge.plantuml.preproc.Stdlib; @@ -404,7 +404,7 @@ public class Run { return; } } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } } @@ -427,9 +427,9 @@ public class Run { try { manageFileInternal(f, option, error); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } catch (InterruptedException e) { - Logger.error(e); + Logme.error(e); } incDone(error.hasError()); } diff --git a/src/net/sourceforge/plantuml/SignatureUtils.java b/src/net/sourceforge/plantuml/SignatureUtils.java index 993037993..7c26ba642 100644 --- a/src/net/sourceforge/plantuml/SignatureUtils.java +++ b/src/net/sourceforge/plantuml/SignatureUtils.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -50,7 +50,7 @@ import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; import net.sourceforge.plantuml.code.AsciiEncoder; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; public class SignatureUtils { @@ -78,10 +78,10 @@ public class SignatureUtils { final byte[] digest = getMD5raw(s); return toString(digest); } catch (NoSuchAlgorithmException e) { - Logger.error(e); + Logme.error(e); throw new UnsupportedOperationException(e); } catch (UnsupportedEncodingException e) { - Logger.error(e); + Logme.error(e); throw new UnsupportedOperationException(e); } } @@ -105,10 +105,10 @@ public class SignatureUtils { assert digest.length == 16; return toHexString(digest); } catch (NoSuchAlgorithmException e) { - Logger.error(e); + Logme.error(e); throw new UnsupportedOperationException(e); } catch (UnsupportedEncodingException e) { - Logger.error(e); + Logme.error(e); throw new UnsupportedOperationException(e); } } @@ -119,10 +119,10 @@ public class SignatureUtils { assert digest.length == 64; return toHexString(digest); } catch (NoSuchAlgorithmException e) { - Logger.error(e); + Logme.error(e); throw new UnsupportedOperationException(e); } catch (UnsupportedEncodingException e) { - Logger.error(e); + Logme.error(e); throw new UnsupportedOperationException(e); } } @@ -161,10 +161,10 @@ public class SignatureUtils { final byte[] digest = msgDigest.digest(); return toString(digest); } catch (NoSuchAlgorithmException e) { - Logger.error(e); + Logme.error(e); throw new UnsupportedOperationException(e); } catch (UnsupportedEncodingException e) { - Logger.error(e); + Logme.error(e); throw new UnsupportedOperationException(e); } } @@ -195,10 +195,10 @@ public class SignatureUtils { final byte[] digest = msgDigest.digest(); return toString(digest); } catch (NoSuchAlgorithmException e) { - Logger.error(e); + Logme.error(e); throw new UnsupportedOperationException(e); } catch (UnsupportedEncodingException e) { - Logger.error(e); + Logme.error(e); throw new UnsupportedOperationException(e); } } diff --git a/src/net/sourceforge/plantuml/SkinParam.java b/src/net/sourceforge/plantuml/SkinParam.java index 5f5e9acf0..5d586392b 100644 --- a/src/net/sourceforge/plantuml/SkinParam.java +++ b/src/net/sourceforge/plantuml/SkinParam.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -63,7 +63,7 @@ import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.dot.DotSplines; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.color.Colors; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.skin.ActorStyle; import net.sourceforge.plantuml.skin.ArrowDirection; import net.sourceforge.plantuml.skin.Padder; @@ -112,7 +112,7 @@ public class SkinParam implements ISkinParam { try { this.styleBuilder = getCurrentStyleBuilderInternal(); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } return styleBuilder; @@ -179,7 +179,7 @@ public class SkinParam implements ISkinParam { this.muteStyle(modifiedStyle); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } } diff --git a/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java b/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java index 35747099f..b466eb6ba 100644 --- a/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java +++ b/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -54,10 +54,9 @@ import java.util.List; import java.util.Set; import net.sourceforge.plantuml.api.ImageDataSimple; -import net.sourceforge.plantuml.api.ThemeStyle; import net.sourceforge.plantuml.core.Diagram; import net.sourceforge.plantuml.error.PSystemError; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.preproc.Defines; import net.sourceforge.plantuml.preproc.FileWithSuffix; import net.sourceforge.plantuml.security.SFile; @@ -160,7 +159,7 @@ public abstract class SourceFileReaderAbstract implements ISourceFileReader { try { system = blockUml.getDiagram(); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); if (OptionFlags.getInstance().isSilentlyCompletelyIgnoreErrors() || noerror) { continue; } diff --git a/src/net/sourceforge/plantuml/Splash.java b/src/net/sourceforge/plantuml/Splash.java index 26cbeb5a8..79468d5d3 100644 --- a/src/net/sourceforge/plantuml/Splash.java +++ b/src/net/sourceforge/plantuml/Splash.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -51,7 +51,7 @@ import java.awt.image.BufferedImage; import java.net.URL; import java.util.concurrent.atomic.AtomicInteger; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.version.PSystemVersion; public class Splash extends Window implements MouseListener, MouseMotionListener { @@ -140,7 +140,7 @@ public class Splash extends Window implements MouseListener, MouseMotionListener try { Desktop.getDesktop().browse(new URL("https://plantuml.com").toURI()); } catch (Exception e) { - Logger.error(e); + Logme.error(e); } return; } diff --git a/src/net/sourceforge/plantuml/TitledDiagram.java b/src/net/sourceforge/plantuml/TitledDiagram.java index 85c73457d..007be77fd 100644 --- a/src/net/sourceforge/plantuml/TitledDiagram.java +++ b/src/net/sourceforge/plantuml/TitledDiagram.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -261,7 +261,7 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram, final AnimationDecoder animationDecoder = new AnimationDecoder(animationData); this.animation = Animation.create(animationDecoder.decode()); // } catch (ScriptException e) { -// Logger.error(e); +// Logme.error(e); // } } diff --git a/src/net/sourceforge/plantuml/UmlDiagram.java b/src/net/sourceforge/plantuml/UmlDiagram.java index b162c4e31..a8f8f31bb 100644 --- a/src/net/sourceforge/plantuml/UmlDiagram.java +++ b/src/net/sourceforge/plantuml/UmlDiagram.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -39,7 +39,6 @@ import static net.sourceforge.plantuml.ugraphic.ImageBuilder.plainImageBuilder; import java.awt.Color; import java.awt.geom.AffineTransform; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.image.BufferedImage; import java.io.BufferedOutputStream; import java.io.ByteArrayOutputStream; @@ -53,6 +52,7 @@ import java.util.List; import net.sourceforge.plantuml.api.ImageDataSimple; import net.sourceforge.plantuml.api.ThemeStyle; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.core.Diagram; import net.sourceforge.plantuml.core.ImageData; @@ -65,11 +65,11 @@ import net.sourceforge.plantuml.fun.IconLoader; import net.sourceforge.plantuml.graphic.GraphicPosition; import net.sourceforge.plantuml.graphic.GraphicStrings; import net.sourceforge.plantuml.graphic.UDrawable; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.mjpeg.MJPEGGenerator; import net.sourceforge.plantuml.pdf.PdfConverter; -import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.security.SFile; +import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.security.SecurityUtils; import net.sourceforge.plantuml.style.NoStyleAvailableException; import net.sourceforge.plantuml.svek.EmptySvgException; @@ -136,13 +136,13 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot this.lastInfo = new Dimension2DDouble(imageData.getWidth(), imageData.getHeight()); return imageData; } catch (NoStyleAvailableException e) { - // Logger.error(e); + // Logme.error(e); exportDiagramError(os, e, fileFormatOption, null); } catch (UnparsableGraphvizException e) { - Logger.error(e); + Logme.error(e); exportDiagramError(os, e.getCause(), fileFormatOption, e.getGraphvizVersion()); } catch (Throwable e) { - // Logger.error(e); + // Logme.error(e); exportDiagramError(os, e, fileFormatOption, null); } return ImageDataSimple.error(); @@ -171,7 +171,7 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot im2 = utils.exportFlashcode(flash, Color.BLACK, Color.WHITE); } catch (Throwable e) { Log.error("Issue in flashcode generation " + e); - // Logger.error(e); + // Logme.error(e); } if (im2 != null) GraphvizCrash.addDecodeHint(strings); diff --git a/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java b/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java index b96e7feee..a783eabe5 100644 --- a/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java +++ b/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java @@ -47,7 +47,7 @@ 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.core.UmlSource; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; public class PSystemXearthFactory extends PSystemBasicFactory { @@ -101,7 +101,7 @@ public class PSystemXearthFactory extends PSystemBasicFactory { return system; } } catch (Exception e) { - Logger.error(e); + Logme.error(e); return null; } return null; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java index 932224044..1df7a5ac5 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/FtileFactoryDelegatorIf.java @@ -97,8 +97,4 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator { conditionEndStyle, thens.get(0), elseBranch, skinParam(), getStringBounder(), fcArrow, fcTest, url); } - private HColor fontColor(FontParam param) { - return skinParam().getFontHtmlColor(null, param); - } - } 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 e0ae1d65e..e7a13043b 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/cond/ConditionalBuilder.java @@ -311,8 +311,4 @@ public class ConditionalBuilder { && tile2.calculateDimension(stringBounder).hasPointOut(); } - // private HtmlColor fontColor() { - // return skinParam.getFontHtmlColor(FontParam.ACTIVITY_DIAMOND, null); - // } - } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/gtile/Gtiles.java b/src/net/sourceforge/plantuml/activitydiagram3/gtile/Gtiles.java index 5ec1e3d67..7378e5b2d 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/gtile/Gtiles.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/gtile/Gtiles.java @@ -94,10 +94,6 @@ public class Gtiles { swimlane); } - private static HColor fontColor(ISkinParam skinParam, FontParam param) { - return skinParam.getFontHtmlColor(null, param); - } - static public Gtile withSouthMargin(Gtile orig, double south) { return new GtileWithMargin((AbstractGtileRoot) orig, 0, south, 0); diff --git a/src/net/sourceforge/plantuml/ant/CheckZipTask.java b/src/net/sourceforge/plantuml/ant/CheckZipTask.java index d8943a080..f6c628a20 100644 --- a/src/net/sourceforge/plantuml/ant/CheckZipTask.java +++ b/src/net/sourceforge/plantuml/ant/CheckZipTask.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -44,13 +44,12 @@ import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -import net.sourceforge.plantuml.log.Logger; - import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; import org.apache.tools.ant.types.FileList; import org.apache.tools.ant.types.FileSet; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.security.SecurityUtils; @@ -86,7 +85,7 @@ public class CheckZipTask extends Task { manageFileList(fileList); } } catch (IOException e) { - Logger.error(e); + Logme.error(e); throw new BuildException(e.toString()); } } diff --git a/src/net/sourceforge/plantuml/ant/PlantUmlTask.java b/src/net/sourceforge/plantuml/ant/PlantUmlTask.java index 14cf1f34d..00bc76097 100644 --- a/src/net/sourceforge/plantuml/ant/PlantUmlTask.java +++ b/src/net/sourceforge/plantuml/ant/PlantUmlTask.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -46,8 +46,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import net.sourceforge.plantuml.log.Logger; - import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.Task; @@ -62,6 +60,7 @@ import net.sourceforge.plantuml.OptionFlags; import net.sourceforge.plantuml.SourceFileReader; import net.sourceforge.plantuml.Splash; import net.sourceforge.plantuml.cucadiagram.dot.GraphvizUtils; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.preproc.Defines; import net.sourceforge.plantuml.stats.StatsUtils; @@ -132,10 +131,10 @@ public class PlantUmlTask extends Task { } this.log("Nb images generated: " + nbFiles.get()); } catch (IOException e) { - Logger.error(e); + Logme.error(e); throw new BuildException(e.toString()); } catch (InterruptedException e) { - Logger.error(e); + Logme.error(e); throw new BuildException(e.toString()); } diff --git a/src/net/sourceforge/plantuml/api/ImageDataAbstract.java b/src/net/sourceforge/plantuml/api/ImageDataAbstract.java index cf8138203..f3c690dc1 100644 --- a/src/net/sourceforge/plantuml/api/ImageDataAbstract.java +++ b/src/net/sourceforge/plantuml/api/ImageDataAbstract.java @@ -37,7 +37,6 @@ package net.sourceforge.plantuml.api; import net.sourceforge.plantuml.annotation.HaxeIgnored; import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.core.ImageData; public abstract class ImageDataAbstract implements ImageData { diff --git a/src/net/sourceforge/plantuml/api/ImageDataComplex.java b/src/net/sourceforge/plantuml/api/ImageDataComplex.java index 9f6bd4e12..7a3d90a79 100644 --- a/src/net/sourceforge/plantuml/api/ImageDataComplex.java +++ b/src/net/sourceforge/plantuml/api/ImageDataComplex.java @@ -35,10 +35,9 @@ */ package net.sourceforge.plantuml.api; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.CMapData; import net.sourceforge.plantuml.annotation.HaxeIgnored; +import net.sourceforge.plantuml.awt.geom.Dimension2D; public class ImageDataComplex extends ImageDataAbstract { diff --git a/src/net/sourceforge/plantuml/api/ImageDataSimple.java b/src/net/sourceforge/plantuml/api/ImageDataSimple.java index 659bfe1d5..132ddfa37 100644 --- a/src/net/sourceforge/plantuml/api/ImageDataSimple.java +++ b/src/net/sourceforge/plantuml/api/ImageDataSimple.java @@ -37,7 +37,6 @@ package net.sourceforge.plantuml.api; import net.sourceforge.plantuml.annotation.HaxeIgnored; import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.core.ImageData; public class ImageDataSimple extends ImageDataAbstract { diff --git a/src/net/sourceforge/plantuml/api/NumberAnalyzed.java b/src/net/sourceforge/plantuml/api/NumberAnalyzed.java index 3e35fbd24..bd4728201 100644 --- a/src/net/sourceforge/plantuml/api/NumberAnalyzed.java +++ b/src/net/sourceforge/plantuml/api/NumberAnalyzed.java @@ -3,12 +3,12 @@ * ======================================================================== * * 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 @@ -35,8 +35,7 @@ import java.util.prefs.Preferences; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.annotation.HaxeIgnored; -import net.sourceforge.plantuml.log.Logger; - +import net.sourceforge.plantuml.log.Logme; @HaxeIgnored public class NumberAnalyzed implements INumberAnalyzed { @@ -123,7 +122,7 @@ public class NumberAnalyzed implements INumberAnalyzed { Long.parseLong(st.nextToken(), 36), Long.parseLong(st.nextToken(), 36), Long.parseLong( st.nextToken(), 36), Long.parseLong(st.nextToken(), 36)); } catch (Exception e) { - Logger.error(e); + Logme.error(e); Log.info("Error reading " + value); return null; } diff --git a/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java b/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java index 61810caca..4977272cb 100644 --- a/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java +++ b/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java @@ -3,12 +3,12 @@ * ======================================================================== * * 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 @@ -34,7 +34,7 @@ import java.util.prefs.Preferences; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.annotation.HaxeIgnored; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; @HaxeIgnored public class NumberAnalyzed2 implements INumberAnalyzed { @@ -96,7 +96,7 @@ public class NumberAnalyzed2 implements INumberAnalyzed { Long.parseLong(st.nextToken(), 36), Long.parseLong(st.nextToken(), 36), Long.parseLong( st.nextToken(), 36), Long.parseLong(st.nextToken(), 36)); } catch (Exception e) { - Logger.error(e); + Logme.error(e); Log.info("Error reading " + value); return null; } diff --git a/src/net/sourceforge/plantuml/api/NumberAnalyzedDated.java b/src/net/sourceforge/plantuml/api/NumberAnalyzedDated.java index 3cfb2062c..adab7d6bc 100644 --- a/src/net/sourceforge/plantuml/api/NumberAnalyzedDated.java +++ b/src/net/sourceforge/plantuml/api/NumberAnalyzedDated.java @@ -3,12 +3,12 @@ * ======================================================================== * * 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 @@ -34,7 +34,7 @@ import java.util.prefs.Preferences; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.annotation.HaxeIgnored; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; @HaxeIgnored public class NumberAnalyzedDated extends NumberAnalyzed { @@ -105,7 +105,7 @@ public class NumberAnalyzedDated extends NumberAnalyzed { Long.parseLong(st.nextToken(), 36), Long.parseLong(st.nextToken(), 36), Long.parseLong( st.nextToken(), 36), st.nextToken()); } catch (Exception e) { - Logger.error(e); + Logme.error(e); Log.info("Error reading " + value); return null; } diff --git a/src/net/sourceforge/plantuml/api/TimeoutExecutor.java b/src/net/sourceforge/plantuml/api/TimeoutExecutor.java index a24a9f95b..766e2b1dc 100644 --- a/src/net/sourceforge/plantuml/api/TimeoutExecutor.java +++ b/src/net/sourceforge/plantuml/api/TimeoutExecutor.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -35,10 +35,10 @@ */ package net.sourceforge.plantuml.api; -import net.sourceforge.plantuml.log.Logger; - import java.util.concurrent.atomic.AtomicBoolean; +import net.sourceforge.plantuml.log.Logme; + public final class TimeoutExecutor { private final long ms; @@ -55,7 +55,7 @@ public final class TimeoutExecutor { mainThread.join(ms); } catch (InterruptedException e) { System.err.println("TimeoutExecutorA " + e); - Logger.error(e); + Logme.error(e); return false; } finally { done = mainThread.done.get(); @@ -82,7 +82,7 @@ public final class TimeoutExecutor { done.set(true); } catch (InterruptedException e) { System.err.println("TimeoutExecutorB " + e); - Logger.error(e); + Logme.error(e); } } diff --git a/src/net/sourceforge/plantuml/argon2/blake2/Blake2b.java b/src/net/sourceforge/plantuml/argon2/blake2/Blake2b.java index 8112dfc62..05c4bc64a 100644 --- a/src/net/sourceforge/plantuml/argon2/blake2/Blake2b.java +++ b/src/net/sourceforge/plantuml/argon2/blake2/Blake2b.java @@ -26,7 +26,6 @@ package net.sourceforge.plantuml.argon2.blake2; -import net.sourceforge.plantuml.log.Logger; import static net.sourceforge.plantuml.argon2.blake2.Blake2b.Engine.Assert.*; import static net.sourceforge.plantuml.argon2.blake2.Blake2b.Engine.LittleEndian.*; @@ -897,7 +896,7 @@ public interface Blake2b { public final static String exclusiveLowerBound = "'%s' %d is <= %d"; public final static String inclusiveLowerBound = "'%s' %d is < %d"; static String assertFail(final String name, final T v, final String err, final T spec) { - Logger.error(new Exception()); + new Exception().printStackTrace(); return String.format(err, name, v, spec); } } diff --git a/src/net/sourceforge/plantuml/code/CompressionBrotli.java b/src/net/sourceforge/plantuml/code/CompressionBrotli.java index 57a1a2bd8..d443e34b3 100644 --- a/src/net/sourceforge/plantuml/code/CompressionBrotli.java +++ b/src/net/sourceforge/plantuml/code/CompressionBrotli.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -41,7 +41,7 @@ import java.io.IOException; import net.sourceforge.plantuml.FileUtils; import net.sourceforge.plantuml.brotli.BrotliInputStream; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; public class CompressionBrotli implements Compression { @@ -57,7 +57,7 @@ public class CompressionBrotli implements Compression { FileUtils.copyToStream(brotli, result); return ByteArray.from(result.toByteArray()); } catch (IOException e) { - Logger.error(e); + Logme.error(e); throw new NoPlantumlCompressionException(e); } } diff --git a/src/net/sourceforge/plantuml/code/CompressionZlibAttic.java b/src/net/sourceforge/plantuml/code/CompressionZlibAttic.java index 1095dee16..59616039a 100644 --- a/src/net/sourceforge/plantuml/code/CompressionZlibAttic.java +++ b/src/net/sourceforge/plantuml/code/CompressionZlibAttic.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -91,7 +91,7 @@ public class CompressionZlibAttic implements Compression { return ByteArray.from(result); } catch (IOException e) { - // Logger.error(e); + // Logme.error(e); throw new NoPlantumlCompressionException(e); } @@ -115,7 +115,7 @@ public class CompressionZlibAttic implements Compression { final byte[] result = copyArray(tmp, resultLength); return result; } catch (DataFormatException e) { - // Logger.error(e); + // Logme.error(e); throw new IOException(e.toString()); } } diff --git a/src/net/sourceforge/plantuml/code/Upf9Encoder.java b/src/net/sourceforge/plantuml/code/Upf9Encoder.java index e59e00ef8..e97aa67a7 100644 --- a/src/net/sourceforge/plantuml/code/Upf9Encoder.java +++ b/src/net/sourceforge/plantuml/code/Upf9Encoder.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -35,12 +35,12 @@ */ package net.sourceforge.plantuml.code; -import net.sourceforge.plantuml.log.Logger; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import net.sourceforge.plantuml.log.Logme; + public class Upf9Encoder { private Upf9Encoder() { @@ -58,7 +58,7 @@ public class Upf9Encoder { if (c == Upf9Decoder.decodeChar(new ByteArrayInputStream(result))) return true; } catch (IOException e) { - Logger.error(e); + Logme.error(e); } return false; } diff --git a/src/net/sourceforge/plantuml/command/CommandSkinParam.java b/src/net/sourceforge/plantuml/command/CommandSkinParam.java index ebd8c0ebf..5ea149719 100644 --- a/src/net/sourceforge/plantuml/command/CommandSkinParam.java +++ b/src/net/sourceforge/plantuml/command/CommandSkinParam.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.command; @@ -64,7 +64,7 @@ public class CommandSkinParam extends SingleLineCommand2 { diagram.setParam(arg.get("NAME", 0), arg.get("VALUE", 0)); return CommandExecutionResult.ok(); } catch (NoStyleAvailableException e) { - // Logger.error(e); + // Logme.error(e); return CommandExecutionResult.error("General failure: no style available."); } diff --git a/src/net/sourceforge/plantuml/command/ProtectedCommand.java b/src/net/sourceforge/plantuml/command/ProtectedCommand.java index 85cad91fc..de8599d2a 100644 --- a/src/net/sourceforge/plantuml/command/ProtectedCommand.java +++ b/src/net/sourceforge/plantuml/command/ProtectedCommand.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.command; @@ -39,7 +39,7 @@ import java.util.Objects; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.core.Diagram; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.version.Version; public class ProtectedCommand implements Command { @@ -59,11 +59,12 @@ public class ProtectedCommand implements Command { // } return result; } catch (Throwable t) { - Logger.error("Error ", t); + Log.error("Error " + t); + Logme.error(t); String msg = "You should send a mail to plantuml@gmail.com or post to http://plantuml.com/qa with this log (V" + Version.versionString() + ")"; - Logger.error(msg); - msg += " " + t; + Log.error(msg); + msg += " " + t.toString(); return CommandExecutionResult.error(msg, t); } } diff --git a/src/net/sourceforge/plantuml/command/SkinLoader.java b/src/net/sourceforge/plantuml/command/SkinLoader.java index 7905f6735..48444a418 100644 --- a/src/net/sourceforge/plantuml/command/SkinLoader.java +++ b/src/net/sourceforge/plantuml/command/SkinLoader.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.command; @@ -106,7 +106,7 @@ public class SkinLoader { } return CommandExecutionResult.ok(); } catch (NoStyleAvailableException e) { - // Logger.error(e); + // Logme.error(e); return CommandExecutionResult.error("General failure: no style available."); } diff --git a/src/net/sourceforge/plantuml/creole/atom/Atom.java b/src/net/sourceforge/plantuml/creole/atom/Atom.java index b44a912ae..b273506ae 100644 --- a/src/net/sourceforge/plantuml/creole/atom/Atom.java +++ b/src/net/sourceforge/plantuml/creole/atom/Atom.java @@ -35,9 +35,9 @@ */ package net.sourceforge.plantuml.creole.atom; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.List; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UShape; diff --git a/src/net/sourceforge/plantuml/creole/atom/AtomEmoji.java b/src/net/sourceforge/plantuml/creole/atom/AtomEmoji.java index a942f478b..48508c0d9 100644 --- a/src/net/sourceforge/plantuml/creole/atom/AtomEmoji.java +++ b/src/net/sourceforge/plantuml/creole/atom/AtomEmoji.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.creole.atom; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.emoji.Emoji; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; diff --git a/src/net/sourceforge/plantuml/creole/atom/AtomHorizontalTexts.java b/src/net/sourceforge/plantuml/creole/atom/AtomHorizontalTexts.java index 8815df2f8..5880344a8 100644 --- a/src/net/sourceforge/plantuml/creole/atom/AtomHorizontalTexts.java +++ b/src/net/sourceforge/plantuml/creole/atom/AtomHorizontalTexts.java @@ -35,10 +35,10 @@ */ package net.sourceforge.plantuml.creole.atom; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.List; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/creole/atom/AtomImg.java b/src/net/sourceforge/plantuml/creole/atom/AtomImg.java index ab689df4b..69750352a 100644 --- a/src/net/sourceforge/plantuml/creole/atom/AtomImg.java +++ b/src/net/sourceforge/plantuml/creole/atom/AtomImg.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.creole.atom; @@ -38,7 +38,6 @@ package net.sourceforge.plantuml.creole.atom; import static java.nio.charset.StandardCharsets.UTF_8; import java.awt.Color; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.image.BufferedImage; import java.io.IOException; @@ -46,6 +45,7 @@ import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.FileSystem; import net.sourceforge.plantuml.FileUtils; import net.sourceforge.plantuml.Url; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.code.Base64Coder; import net.sourceforge.plantuml.creole.legacy.AtomTextUtils; import net.sourceforge.plantuml.flashcode.FlashCodeFactory; @@ -54,9 +54,9 @@ import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.ImgValign; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TileImageSvg; -import net.sourceforge.plantuml.log.Logger; -import net.sourceforge.plantuml.security.SImageIO; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; +import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.security.SURL; import net.sourceforge.plantuml.security.SecurityProfile; import net.sourceforge.plantuml.security.SecurityUtils; @@ -121,38 +121,38 @@ public class AtomImg extends AbstractAtom implements Atom { try { // Check if valid URL if (src.startsWith("http:") || src.startsWith("https:")) { - if (src.endsWith(".svg")) + if (src.endsWith(".svg")) return buildSvgFromUrl(src, fc, SURL.create(src), scale, url); - + return buildRasterFromUrl(src, fc, SURL.create(src), scale, url); } final SFile f = FileSystem.getInstance().getFile(src); if (f.exists() == false) { - if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE) + if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE) return AtomTextUtils.createLegacy("(File not found: " + f.getPrintablePath() + ")", fc); - + return AtomTextUtils.createLegacy("(Cannot decode)", fc); } if (f.getName().endsWith(".svg")) { final String tmp = FileUtils.readSvg(f); - if (tmp == null) + if (tmp == null) return AtomTextUtils.createLegacy("(Cannot decode)", fc); - + return new AtomImgSvg(new TileImageSvg(tmp, scale)); } final BufferedImage read = f.readRasterImageFromFile(); if (read == null) { - if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE) + if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE) return AtomTextUtils.createLegacy("(Cannot decode: " + f.getPrintablePath() + ")", fc); - + return AtomTextUtils.createLegacy("(Cannot decode)", fc); } return new AtomImg(f.readRasterImageFromFile(), scale, url, src); } catch (IOException e) { - Logger.error(e); - if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE) + Logme.error(e); + if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE) return AtomTextUtils.createLegacy("ERROR " + e.toString(), fc); - + return AtomTextUtils.createLegacy("ERROR", fc); } } diff --git a/src/net/sourceforge/plantuml/creole/atom/AtomImgSvg.java b/src/net/sourceforge/plantuml/creole/atom/AtomImgSvg.java index 6fd1ca4db..e236261d0 100644 --- a/src/net/sourceforge/plantuml/creole/atom/AtomImgSvg.java +++ b/src/net/sourceforge/plantuml/creole/atom/AtomImgSvg.java @@ -36,7 +36,6 @@ package net.sourceforge.plantuml.creole.atom; import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TileImageSvg; import net.sourceforge.plantuml.ugraphic.UGraphic; diff --git a/src/net/sourceforge/plantuml/creole/atom/AtomMath.java b/src/net/sourceforge/plantuml/creole/atom/AtomMath.java index dbc392d4e..a886afead 100644 --- a/src/net/sourceforge/plantuml/creole/atom/AtomMath.java +++ b/src/net/sourceforge/plantuml/creole/atom/AtomMath.java @@ -36,10 +36,10 @@ package net.sourceforge.plantuml.creole.atom; import java.awt.Color; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.image.BufferedImage; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.math.ScientificEquationSafe; import net.sourceforge.plantuml.ugraphic.UGraphic; diff --git a/src/net/sourceforge/plantuml/creole/atom/AtomOpenIcon.java b/src/net/sourceforge/plantuml/creole/atom/AtomOpenIcon.java index cf327872a..7a86f5bc8 100644 --- a/src/net/sourceforge/plantuml/creole/atom/AtomOpenIcon.java +++ b/src/net/sourceforge/plantuml/creole/atom/AtomOpenIcon.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.creole.atom; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Url; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; diff --git a/src/net/sourceforge/plantuml/creole/atom/AtomSpace.java b/src/net/sourceforge/plantuml/creole/atom/AtomSpace.java index b270260db..eca912298 100644 --- a/src/net/sourceforge/plantuml/creole/atom/AtomSpace.java +++ b/src/net/sourceforge/plantuml/creole/atom/AtomSpace.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.creole.atom; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; diff --git a/src/net/sourceforge/plantuml/creole/atom/AtomSprite.java b/src/net/sourceforge/plantuml/creole/atom/AtomSprite.java index e5320b520..e937bedb7 100644 --- a/src/net/sourceforge/plantuml/creole/atom/AtomSprite.java +++ b/src/net/sourceforge/plantuml/creole/atom/AtomSprite.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.creole.atom; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Url; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.sprite.Sprite; diff --git a/src/net/sourceforge/plantuml/creole/atom/AtomTable.java b/src/net/sourceforge/plantuml/creole/atom/AtomTable.java index 7da7e7418..0a5a3345b 100644 --- a/src/net/sourceforge/plantuml/creole/atom/AtomTable.java +++ b/src/net/sourceforge/plantuml/creole/atom/AtomTable.java @@ -35,13 +35,13 @@ */ package net.sourceforge.plantuml.creole.atom; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.Position; import net.sourceforge.plantuml.creole.SheetBlock1; import net.sourceforge.plantuml.graphic.HorizontalAlignment; diff --git a/src/net/sourceforge/plantuml/creole/atom/AtomTree.java b/src/net/sourceforge/plantuml/creole/atom/AtomTree.java index 12c761a3f..87c10cad0 100644 --- a/src/net/sourceforge/plantuml/creole/atom/AtomTree.java +++ b/src/net/sourceforge/plantuml/creole/atom/AtomTree.java @@ -35,13 +35,13 @@ */ package net.sourceforge.plantuml.creole.atom; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.salt.element.Skeleton2; import net.sourceforge.plantuml.ugraphic.UGraphic; diff --git a/src/net/sourceforge/plantuml/creole/atom/AtomVerticalTexts.java b/src/net/sourceforge/plantuml/creole/atom/AtomVerticalTexts.java index 0b9f515db..6e05a3a68 100644 --- a/src/net/sourceforge/plantuml/creole/atom/AtomVerticalTexts.java +++ b/src/net/sourceforge/plantuml/creole/atom/AtomVerticalTexts.java @@ -35,10 +35,10 @@ */ package net.sourceforge.plantuml.creole.atom; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.List; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/creole/atom/AtomWithMargin.java b/src/net/sourceforge/plantuml/creole/atom/AtomWithMargin.java index 7813c9664..bb6bc17a8 100644 --- a/src/net/sourceforge/plantuml/creole/atom/AtomWithMargin.java +++ b/src/net/sourceforge/plantuml/creole/atom/AtomWithMargin.java @@ -35,12 +35,12 @@ */ package net.sourceforge.plantuml.creole.atom; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.Collections; import java.util.List; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; diff --git a/src/net/sourceforge/plantuml/creole/atom/Bullet.java b/src/net/sourceforge/plantuml/creole/atom/Bullet.java index 277254f3e..87d4e25f4 100644 --- a/src/net/sourceforge/plantuml/creole/atom/Bullet.java +++ b/src/net/sourceforge/plantuml/creole/atom/Bullet.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.creole.atom; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.UEllipse; diff --git a/src/net/sourceforge/plantuml/cucadiagram/Body3.java b/src/net/sourceforge/plantuml/cucadiagram/Body3.java index 1bc87cef3..ae12f17d2 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/Body3.java +++ b/src/net/sourceforge/plantuml/cucadiagram/Body3.java @@ -35,12 +35,12 @@ */ package net.sourceforge.plantuml.cucadiagram; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.List; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; diff --git a/src/net/sourceforge/plantuml/cucadiagram/EntityPosition.java b/src/net/sourceforge/plantuml/cucadiagram/EntityPosition.java index 760af97be..8efd9c3a3 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/EntityPosition.java +++ b/src/net/sourceforge/plantuml/cucadiagram/EntityPosition.java @@ -36,11 +36,11 @@ */ package net.sourceforge.plantuml.cucadiagram; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.EnumSet; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.svek.ShapeType; import net.sourceforge.plantuml.ugraphic.Shadowable; import net.sourceforge.plantuml.ugraphic.UEllipse; diff --git a/src/net/sourceforge/plantuml/cucadiagram/GroupPrinter.java b/src/net/sourceforge/plantuml/cucadiagram/GroupPrinter.java index f6cdda0e9..7ae662fa2 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/GroupPrinter.java +++ b/src/net/sourceforge/plantuml/cucadiagram/GroupPrinter.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.cucadiagram; @@ -38,7 +38,7 @@ package net.sourceforge.plantuml.cucadiagram; import java.io.IOException; import java.io.PrintWriter; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; public class GroupPrinter { @@ -91,7 +91,7 @@ public class GroupPrinter { new GroupPrinter(pw).printGroup(rootGroup); pw.println(""); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } diff --git a/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java b/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java index 9ead4bf9f..f9f6a0e7e 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java +++ b/src/net/sourceforge/plantuml/cucadiagram/GroupRoot.java @@ -42,13 +42,11 @@ import java.util.List; import java.util.Map; import java.util.Set; -import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.cucadiagram.entity.EntityFactory; import net.sourceforge.plantuml.graphic.FontConfiguration; -import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.color.ColorType; import net.sourceforge.plantuml.graphic.color.Colors; diff --git a/src/net/sourceforge/plantuml/cucadiagram/Link.java b/src/net/sourceforge/plantuml/cucadiagram/Link.java index 907a4ac08..873a3a9e5 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/Link.java +++ b/src/net/sourceforge/plantuml/cucadiagram/Link.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.cucadiagram; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.Objects; import net.sourceforge.plantuml.Hideable; @@ -45,6 +44,7 @@ import net.sourceforge.plantuml.OptionFlags; import net.sourceforge.plantuml.Removeable; import net.sourceforge.plantuml.UmlDiagramType; import net.sourceforge.plantuml.Url; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.command.Position; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; diff --git a/src/net/sourceforge/plantuml/cucadiagram/LinkConstraint.java b/src/net/sourceforge/plantuml/cucadiagram/LinkConstraint.java index fa912b530..3f2310596 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/LinkConstraint.java +++ b/src/net/sourceforge/plantuml/cucadiagram/LinkConstraint.java @@ -35,11 +35,11 @@ */ package net.sourceforge.plantuml.cucadiagram; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.TextBlock; diff --git a/src/net/sourceforge/plantuml/cucadiagram/NoteLinkStrategy.java b/src/net/sourceforge/plantuml/cucadiagram/NoteLinkStrategy.java index c64ea9313..debc2f9bc 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/NoteLinkStrategy.java +++ b/src/net/sourceforge/plantuml/cucadiagram/NoteLinkStrategy.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.cucadiagram; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; public enum NoteLinkStrategy { NORMAL, HALF_PRINTED_FULL, HALF_NOT_PRINTED; diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/AbstractGraphviz.java b/src/net/sourceforge/plantuml/cucadiagram/dot/AbstractGraphviz.java index e33626825..d0a148d5a 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/dot/AbstractGraphviz.java +++ b/src/net/sourceforge/plantuml/cucadiagram/dot/AbstractGraphviz.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.cucadiagram.dot; @@ -45,7 +45,7 @@ import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.OptionFlags; import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; abstract class AbstractGraphviz implements Graphviz { @@ -76,7 +76,7 @@ abstract class AbstractGraphviz implements Graphviz { this.dotString = dotString; this.type = Objects.requireNonNull(type); } - + protected boolean findExecutableOnPath() { return true; } @@ -117,7 +117,7 @@ abstract class AbstractGraphviz implements Graphviz { // } Log.info("Ending process ok"); } catch (Throwable e) { - Logger.error(e); + Logme.error(e); Log.error("Error: " + e); Log.error("The command was " + cmd); Log.error(""); diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/DebugTrace.java b/src/net/sourceforge/plantuml/cucadiagram/dot/DebugTrace.java index 7f03fb1e4..9dc468758 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/dot/DebugTrace.java +++ b/src/net/sourceforge/plantuml/cucadiagram/dot/DebugTrace.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.cucadiagram.dot; @@ -51,7 +51,7 @@ public class DebugTrace { try { pw = out.createPrintWriter(); } catch (FileNotFoundException e) { - // ignore + } } return pw; diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java index 384d63772..17cd9ac70 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java +++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.cucadiagram.dot; @@ -45,7 +45,7 @@ import java.util.regex.Pattern; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.security.SecurityProfile; import net.sourceforge.plantuml.security.SecurityUtils; @@ -187,7 +187,7 @@ public class GraphvizUtils { try { return create(null, "png").graphviz244onWindows(); } catch (Exception e) { - Logger.error(e); + Logme.error(e); return false; } } @@ -228,8 +228,8 @@ public class GraphvizUtils { result.add(red + err); } catch (Exception e) { - result.add(red + e); - Logger.error(e); + result.add(red + e.toString()); + Logme.error(e); error = -1; } return error; @@ -269,8 +269,8 @@ public class GraphvizUtils { } } } catch (Exception e) { - result.add(red + e); - Logger.error(e); + result.add(red + e.toString()); + Logme.error(e); error = -5; } } else { diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizWindowsOld.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizWindowsOld.java index 6fed2e3e1..744282e6d 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizWindowsOld.java +++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizWindowsOld.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.cucadiagram.dot; @@ -43,7 +43,7 @@ import java.util.List; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.windowsdot.WindowsDotArchive; class GraphvizWindowsOld extends AbstractGraphviz { @@ -67,7 +67,7 @@ class GraphvizWindowsOld extends AbstractGraphviz { try { return GraphvizUtils.getDotVersion() == 244; } catch (Exception e) { - Logger.error(e); + Logme.error(e); return false; } } diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/Neighborhood.java b/src/net/sourceforge/plantuml/cucadiagram/dot/Neighborhood.java index 9df5ac04b..928699ac0 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/dot/Neighborhood.java +++ b/src/net/sourceforge/plantuml/cucadiagram/dot/Neighborhood.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.cucadiagram.dot; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.util.ArrayList; @@ -43,6 +42,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.ILeaf; import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.svek.Bibliotekon; diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/ProcessRunner.java b/src/net/sourceforge/plantuml/cucadiagram/dot/ProcessRunner.java index 50fe8f5b6..0ab967ec7 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/dot/ProcessRunner.java +++ b/src/net/sourceforge/plantuml/cucadiagram/dot/ProcessRunner.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.cucadiagram.dot; @@ -44,7 +44,7 @@ import java.util.concurrent.locks.ReentrantLock; import net.sourceforge.plantuml.OptionFlags; import net.sourceforge.plantuml.api.MyRunnable; import net.sourceforge.plantuml.api.TimeoutExecutor; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; public class ProcessRunner { @@ -163,14 +163,14 @@ public class ProcessRunner { try { process = Runtime.getRuntime().exec(cmd, null, dir == null ? null : dir.conv()); } catch (IOException e) { - Logger.error(e); + Logme.error(e); changeState.lock(); try { state = ProcessState.IO_EXCEPTION1(e); } finally { changeState.unlock(); } - Logger.error(e); + Logme.error(e); return; } errorStream = new ThreadStream(process.getErrorStream(), null); @@ -192,7 +192,7 @@ public class ProcessRunner { } finally { changeState.unlock(); } - Logger.error(e); + Logme.error(e); } } } @@ -249,9 +249,9 @@ public class ProcessRunner { } } catch (Throwable e) { System.err.println("ProcessRunnerA " + e); - Logger.error(e); + Logme.error(e); sb.append('\n'); - sb.append(e); + sb.append(e.toString()); } } } @@ -270,7 +270,7 @@ public class ProcessRunner { is.close(); } } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } @@ -280,7 +280,7 @@ public class ProcessRunner { os.close(); } } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } diff --git a/src/net/sourceforge/plantuml/dedication/DedicationCrypted.java b/src/net/sourceforge/plantuml/dedication/DedicationCrypted.java index 07c2515e4..95955a283 100644 --- a/src/net/sourceforge/plantuml/dedication/DedicationCrypted.java +++ b/src/net/sourceforge/plantuml/dedication/DedicationCrypted.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.dedication; @@ -41,7 +41,7 @@ import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.math.BigInteger; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.utils.MTRandom; public class DedicationCrypted implements Dedication { @@ -114,7 +114,7 @@ public class DedicationCrypted implements Dedication { this.solution = line; return img; } catch (Throwable t) { - Logger.error(t); + Logme.error(t); return null; } diff --git a/src/net/sourceforge/plantuml/dedication/DedicationSimple.java b/src/net/sourceforge/plantuml/dedication/DedicationSimple.java index 016e2642e..f787a9cd9 100644 --- a/src/net/sourceforge/plantuml/dedication/DedicationSimple.java +++ b/src/net/sourceforge/plantuml/dedication/DedicationSimple.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,16 +30,16 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.dedication; -import net.sourceforge.plantuml.log.Logger; - import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; +import net.sourceforge.plantuml.log.Logme; + public class DedicationSimple implements Dedication { private final byte crypted[]; @@ -63,7 +63,7 @@ public class DedicationSimple implements Dedication { current = decoded.toByteArray(512); return PSystemDedication.getBufferedImage(new ByteArrayInputStream(current)); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); return null; } } diff --git a/src/net/sourceforge/plantuml/dedication/Dedications.java b/src/net/sourceforge/plantuml/dedication/Dedications.java index f3f9c8121..1d38c1320 100644 --- a/src/net/sourceforge/plantuml/dedication/Dedications.java +++ b/src/net/sourceforge/plantuml/dedication/Dedications.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.dedication; @@ -44,7 +44,7 @@ import java.util.ArrayList; import java.util.List; import net.sourceforge.plantuml.FileUtils; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; public class Dedications { @@ -65,7 +65,7 @@ public class Dedications { all.add(secret(1, "ae8a7cf3997ccd6418866fc59e596502e1bd1c0265bba2fc380ad7f51c76518f", new BigInteger( "987988542836850639056829173787067531749177506648884857100630852970876999799588072360773169026225182488073794585127241896588994816566037813451743416913613428321215803586563629080034406083114565732322220091545330060636171674602040157"))); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); } } diff --git a/src/net/sourceforge/plantuml/dedication/PSystemDedication.java b/src/net/sourceforge/plantuml/dedication/PSystemDedication.java index 3bb56b3e0..70c2078dd 100644 --- a/src/net/sourceforge/plantuml/dedication/PSystemDedication.java +++ b/src/net/sourceforge/plantuml/dedication/PSystemDedication.java @@ -47,7 +47,7 @@ import net.sourceforge.plantuml.PlainDiagram; import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.graphic.UDrawable; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.ugraphic.AffineTransformType; import net.sourceforge.plantuml.ugraphic.PixelImage; @@ -88,7 +88,7 @@ public class PSystemDedication extends PlainDiagram { // final VP8Frame frame = vp8Decoder.getFrame(); // return frame.getBufferedImage(); } catch (Exception e) { - Logger.error(e); + Logme.error(e); return null; } } diff --git a/src/net/sourceforge/plantuml/ditaa/PSystemDitaa.java b/src/net/sourceforge/plantuml/ditaa/PSystemDitaa.java index 4316a7599..837e8d63f 100644 --- a/src/net/sourceforge/plantuml/ditaa/PSystemDitaa.java +++ b/src/net/sourceforge/plantuml/ditaa/PSystemDitaa.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -53,7 +53,7 @@ import net.sourceforge.plantuml.api.ImageDataSimple; import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.UmlSource; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.svek.GraphvizCrash; @@ -86,7 +86,7 @@ public class PSystemDitaa extends AbstractPSystem { this.processingOptions.getClass().getMethod("setAllCornersAreRound", boolean.class) .invoke(this.processingOptions, allCornersAreRound); } catch (Exception e) { - Logger.error(e); + Logme.error(e); this.processingOptions = null; } this.transparentBackground = transparentBackground; diff --git a/src/net/sourceforge/plantuml/donors/PSystemDonors.java b/src/net/sourceforge/plantuml/donors/PSystemDonors.java index d1a20b905..bdbc56ec7 100644 --- a/src/net/sourceforge/plantuml/donors/PSystemDonors.java +++ b/src/net/sourceforge/plantuml/donors/PSystemDonors.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.donors; @@ -57,7 +57,7 @@ import net.sourceforge.plantuml.graphic.GraphicStrings; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.UDrawable; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.svek.TextBlockBackcolored; import net.sourceforge.plantuml.ugraphic.AffineTransformType; import net.sourceforge.plantuml.ugraphic.PixelImage; @@ -98,7 +98,7 @@ public class PSystemDonors extends PlainDiagram { /* * Special thanks to our sponsors and donors: - * + * * - Noam Tamim */ @@ -154,7 +154,7 @@ public class PSystemDonors extends PlainDiagram { lines.add(st.nextToken()); } } catch (NoPlantumlCompressionException e) { - Logger.error(e); + Logme.error(e); } return lines; } diff --git a/src/net/sourceforge/plantuml/donors/PSystemSkinparameterList.java b/src/net/sourceforge/plantuml/donors/PSystemSkinparameterList.java index 20faa7635..e500b8bb0 100644 --- a/src/net/sourceforge/plantuml/donors/PSystemSkinparameterList.java +++ b/src/net/sourceforge/plantuml/donors/PSystemSkinparameterList.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.donors; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -43,6 +42,7 @@ import java.util.List; import net.sourceforge.plantuml.FileFormatOption; import net.sourceforge.plantuml.PlainDiagram; import net.sourceforge.plantuml.SkinParam; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.graphic.GraphicStrings; diff --git a/src/net/sourceforge/plantuml/eggs/PSystemAppleTwoFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemAppleTwoFactory.java index 8f9a872d4..80cc3c238 100644 --- a/src/net/sourceforge/plantuml/eggs/PSystemAppleTwoFactory.java +++ b/src/net/sourceforge/plantuml/eggs/PSystemAppleTwoFactory.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.eggs; @@ -41,7 +41,7 @@ import net.sourceforge.plantuml.AbstractPSystem; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.command.PSystemSingleLineFactory; import net.sourceforge.plantuml.core.UmlSource; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; public class PSystemAppleTwoFactory extends PSystemSingleLineFactory { @@ -54,7 +54,7 @@ public class PSystemAppleTwoFactory extends PSystemSingleLineFactory { return new PSystemAppleTwo(source); } catch (IOException e) { Log.error("Error " + e); - Logger.error(e); + Logme.error(e); } } return null; diff --git a/src/net/sourceforge/plantuml/eggs/PSystemColors.java b/src/net/sourceforge/plantuml/eggs/PSystemColors.java index 87d057733..21cb59e53 100644 --- a/src/net/sourceforge/plantuml/eggs/PSystemColors.java +++ b/src/net/sourceforge/plantuml/eggs/PSystemColors.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.eggs; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.Collection; @@ -48,6 +47,7 @@ import net.sourceforge.plantuml.BackSlash; import net.sourceforge.plantuml.FileFormatOption; import net.sourceforge.plantuml.PlainDiagram; import net.sourceforge.plantuml.SpriteContainerEmpty; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.cucadiagram.Display; diff --git a/src/net/sourceforge/plantuml/eggs/PSystemEgg.java b/src/net/sourceforge/plantuml/eggs/PSystemEgg.java index ca318287d..67b2df66f 100644 --- a/src/net/sourceforge/plantuml/eggs/PSystemEgg.java +++ b/src/net/sourceforge/plantuml/eggs/PSystemEgg.java @@ -35,12 +35,12 @@ */ package net.sourceforge.plantuml.eggs; +import java.util.StringTokenizer; + import net.sourceforge.plantuml.PlainStringsDiagram; import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.UmlSource; -import java.util.StringTokenizer; - public class PSystemEgg extends PlainStringsDiagram { PSystemEgg(UmlSource source, String sentence) { diff --git a/src/net/sourceforge/plantuml/eggs/PSystemRIPFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemRIPFactory.java index 50efda9a6..24e64d444 100644 --- a/src/net/sourceforge/plantuml/eggs/PSystemRIPFactory.java +++ b/src/net/sourceforge/plantuml/eggs/PSystemRIPFactory.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.eggs; @@ -41,7 +41,7 @@ import net.sourceforge.plantuml.AbstractPSystem; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.command.PSystemSingleLineFactory; import net.sourceforge.plantuml.core.UmlSource; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; public class PSystemRIPFactory extends PSystemSingleLineFactory { @@ -52,7 +52,7 @@ public class PSystemRIPFactory extends PSystemSingleLineFactory { return new PSystemRIP(source); } catch (IOException e) { Log.error("Error " + e); - Logger.error(e); + Logme.error(e); } } return null; diff --git a/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java b/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java index ee959c89b..3acb09eeb 100644 --- a/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java +++ b/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.elk; @@ -67,13 +67,13 @@ import net.sourceforge.plantuml.cucadiagram.entity.EntityFactory; /* * You can choose between real "org.eclipse.elk..." classes or proxied "net.sourceforge.plantuml.elk.proxy..." - * + * * Using proxied classes allows to compile PlantUML without having ELK available on the classpath. * Since GraphViz is the default layout engine up to now, we do not want to enforce the use of ELK just for compilation. * (for people not using maven) - * + * * If you are debugging, you should probably switch to "org.eclipse.elk..." classes - * + * */ /* @@ -111,7 +111,7 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.USymbolFolder; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; @@ -135,7 +135,7 @@ import net.sourceforge.plantuml.ugraphic.color.HColorUtils; /* * Some notes: - * + * https://www.eclipse.org/elk/documentation/tooldevelopers/graphdatastructure.html https://www.eclipse.org/elk/documentation/tooldevelopers/graphdatastructure/coordinatesystem.html @@ -522,7 +522,7 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker { } static private List getFailureText3(Throwable exception) { - Logger.error(exception); + Logme.error(exception); final List strings = new ArrayList<>(); strings.add("An error has occured : " + exception); final String quote = StringUtils.rot(QuoteUtils.getSomeQuote()); diff --git a/src/net/sourceforge/plantuml/elk/proxy/Reflect.java b/src/net/sourceforge/plantuml/elk/proxy/Reflect.java index dac8108c6..cd9ca1321 100644 --- a/src/net/sourceforge/plantuml/elk/proxy/Reflect.java +++ b/src/net/sourceforge/plantuml/elk/proxy/Reflect.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -35,12 +35,12 @@ */ package net.sourceforge.plantuml.elk.proxy; -import net.sourceforge.plantuml.log.Logger; - import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; +import net.sourceforge.plantuml.log.Logme; + /* * Various methods to do Java introspection */ @@ -50,7 +50,7 @@ public class Reflect { try { return Class.forName(className); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -65,7 +65,7 @@ public class Reflect { } throw new UnsupportedOperationException(name); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -76,7 +76,7 @@ public class Reflect { final Field field = cl.getField(fieldname); return field.get(null); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -86,7 +86,7 @@ public class Reflect { final Class cl = Class.forName(className); return cl.newInstance(); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -97,7 +97,7 @@ public class Reflect { final Constructor m = cl.getConstructor(arg1.getClass()); return m.newInstance(arg1); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -108,7 +108,7 @@ public class Reflect { final Constructor m = cl.getConstructor(Double.TYPE, Double.TYPE, Double.TYPE, Double.TYPE); return m.newInstance(arg1, arg2, arg3, arg4); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -119,7 +119,7 @@ public class Reflect { final Field f = cl.getField(fieldName); return f.get(null); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -130,7 +130,7 @@ public class Reflect { final Method m = cl.getMethod(method); return m.invoke(null); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -141,7 +141,7 @@ public class Reflect { final Method m = cl.getMethod(method, arg1.getClass()); return m.invoke(null, arg1); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -152,7 +152,7 @@ public class Reflect { final Method m = cl.getMethod(method, arg1.getClass(), arg2.getClass()); return m.invoke(null, arg1, arg2); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -163,7 +163,7 @@ public class Reflect { final Method m = getStaticMethod(cl, method, 1); return m.invoke(null, arg1); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -174,7 +174,7 @@ public class Reflect { final Method m = getStaticMethod(cl, method, 2); return m.invoke(null, arg1, arg2); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -193,7 +193,7 @@ public class Reflect { final Method m = instance.getClass().getMethod(method); return m.invoke(instance); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -203,7 +203,7 @@ public class Reflect { final Method m = instance.getClass().getMethod(method, arg1.getClass()); return m.invoke(instance, arg1); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -213,7 +213,7 @@ public class Reflect { final Method m = instance.getClass().getMethod(method, arg1.getClass(), arg2.getClass()); return m.invoke(instance, arg1, arg2); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } @@ -223,7 +223,7 @@ public class Reflect { final Method m = getMethod(instance, method, 2); return m.invoke(instance, arg1, arg2); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); throw new IllegalArgumentException(t); } } diff --git a/src/net/sourceforge/plantuml/emoji/Emoji.java b/src/net/sourceforge/plantuml/emoji/Emoji.java index 1533e5efb..55f4432df 100644 --- a/src/net/sourceforge/plantuml/emoji/Emoji.java +++ b/src/net/sourceforge/plantuml/emoji/Emoji.java @@ -12,7 +12,7 @@ import java.util.Map; import java.util.TreeMap; import net.sourceforge.plantuml.emoji.data.Dummy; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.color.HColor; @@ -30,7 +30,7 @@ public class Emoji { new Emoji(s); } } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } @@ -88,7 +88,7 @@ public class Emoji { try { loadIfNeed(); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } nano.drawU(ug, scale, colorForMonochrome); } diff --git a/src/net/sourceforge/plantuml/emoji/SpriteSvgNanoParser.java b/src/net/sourceforge/plantuml/emoji/SpriteSvgNanoParser.java index b9cb922a8..1c35bc611 100644 --- a/src/net/sourceforge/plantuml/emoji/SpriteSvgNanoParser.java +++ b/src/net/sourceforge/plantuml/emoji/SpriteSvgNanoParser.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.emoji; @@ -45,7 +45,7 @@ import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.sprite.Sprite; import net.sourceforge.plantuml.ugraphic.AffineTransformType; @@ -96,7 +96,7 @@ public class SpriteSvgNanoParser implements Sprite { try { return new SpriteSvgNanoParser(SImageIO.read(is)); } catch (IOException e) { - Logger.error(e); + Logme.error(e); return null; } diff --git a/src/net/sourceforge/plantuml/ftp/FtpLoop.java b/src/net/sourceforge/plantuml/ftp/FtpLoop.java index 297e2a228..31be1f01c 100644 --- a/src/net/sourceforge/plantuml/ftp/FtpLoop.java +++ b/src/net/sourceforge/plantuml/ftp/FtpLoop.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.ftp; @@ -54,7 +54,7 @@ import java.util.StringTokenizer; import net.sourceforge.plantuml.FileFormat; import net.sourceforge.plantuml.FileUtils; import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SecurityUtils; class FtpLoop implements Runnable { @@ -328,7 +328,7 @@ class FtpLoop implements Runnable { try { runInternal(); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); } } diff --git a/src/net/sourceforge/plantuml/ftp/FtpServer.java b/src/net/sourceforge/plantuml/ftp/FtpServer.java index d7206ad96..a133f1fa8 100644 --- a/src/net/sourceforge/plantuml/ftp/FtpServer.java +++ b/src/net/sourceforge/plantuml/ftp/FtpServer.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.ftp; @@ -50,7 +50,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import net.sourceforge.plantuml.FileFormat; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; public class FtpServer { @@ -115,7 +115,7 @@ public class FtpServer { try { connexion.processImage(name); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } }); diff --git a/src/net/sourceforge/plantuml/fun/IconLoader.java b/src/net/sourceforge/plantuml/fun/IconLoader.java index 3a332da3e..b6bc08732 100644 --- a/src/net/sourceforge/plantuml/fun/IconLoader.java +++ b/src/net/sourceforge/plantuml/fun/IconLoader.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -43,7 +43,7 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SImageIO; public class IconLoader { @@ -94,7 +94,7 @@ public class IconLoader { is.close(); return image; } catch (IOException e) { - Logger.error(e); + Logme.error(e); } return null; } diff --git a/src/net/sourceforge/plantuml/graphic/Img.java b/src/net/sourceforge/plantuml/graphic/Img.java index 8e2908710..6d2b37570 100644 --- a/src/net/sourceforge/plantuml/graphic/Img.java +++ b/src/net/sourceforge/plantuml/graphic/Img.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.graphic; @@ -44,7 +44,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.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.security.SURL; @@ -124,8 +124,8 @@ public class Img implements HtmlCommand { return new Img(new TileImage(f.readRasterImageFromFile(), valign, vspace)); } catch (IOException e) { - Logger.error(e); - return new Text("ERROR " + e); + Logme.error(e); + return new Text("ERROR " + e.toString()); } } diff --git a/src/net/sourceforge/plantuml/graphic/QuoteUtils.java b/src/net/sourceforge/plantuml/graphic/QuoteUtils.java index d9c3766f2..2444bc267 100644 --- a/src/net/sourceforge/plantuml/graphic/QuoteUtils.java +++ b/src/net/sourceforge/plantuml/graphic/QuoteUtils.java @@ -311,7 +311,11 @@ public class QuoteUtils { "Guvf qbrfa'g frrz yvxr n jryy gubhtug bhg cyna.", "Vg qbrf abg znxr frafr gung uhznaf qryvorengryl znyshapgvba.", "Gb fhpprrq, cynaavat nybar vf vafhssvpvrag. Bar zhfg vzcebivfr nf jryy.", - "Arire yrg lbhe frafr bs zbenyf cerirag lbh sebz qbvat jung vf evtug."); + "Arire yrg lbhe frafr bs zbenyf cerirag lbh sebz qbvat jung vf evtug.", "Jr arrq ab ybatre srne gur onanan", + "Vg jnf n znggre bs fheiviny. Jr gbbx ab fngvfsnpgvba va gur qrfgehpgvba bs bhe ohvyqref.", + "Znxr yvxr n gerr naq trg bhg bs urer", "Vg'f fgebat naq vg'f fhqqra naq vg'f pehry fbzrgvzrf", + "Uryy vf rzcgl naq nyy gur qrivyf ner urer", "Rg cbhe fbegve qrf zbzragf qvssvpvyrf...", + "cynaghzy: qvntenzf sbe pbashfvat crbcyr zber", "Ha zbeprnh dhv onynapr qh gbaareer?"); private QuoteUtils() { } diff --git a/src/net/sourceforge/plantuml/graphic/Rainbow.java b/src/net/sourceforge/plantuml/graphic/Rainbow.java index 5e2cfba83..78e7552e8 100644 --- a/src/net/sourceforge/plantuml/graphic/Rainbow.java +++ b/src/net/sourceforge/plantuml/graphic/Rainbow.java @@ -46,7 +46,6 @@ import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Value; import net.sourceforge.plantuml.style.ValueNull; -import net.sourceforge.plantuml.ugraphic.color.ColorUtils; import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorSet; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; diff --git a/src/net/sourceforge/plantuml/graphic/UnusedSpace.java b/src/net/sourceforge/plantuml/graphic/UnusedSpace.java index 9f236c2ea..4f60bad53 100644 --- a/src/net/sourceforge/plantuml/graphic/UnusedSpace.java +++ b/src/net/sourceforge/plantuml/graphic/UnusedSpace.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.graphic; @@ -139,7 +139,7 @@ public class UnusedSpace { // ImageIO.write(im, "png", SecurityUtils.File("c:/img" + cpt + ".png")); // cpt++; // } catch (IOException e) { - // Logger.error(e); + // Logme.error(e); // } } diff --git a/src/net/sourceforge/plantuml/hcl/HclDiagramFactory.java b/src/net/sourceforge/plantuml/hcl/HclDiagramFactory.java index d186e9019..dd9cd1562 100644 --- a/src/net/sourceforge/plantuml/hcl/HclDiagramFactory.java +++ b/src/net/sourceforge/plantuml/hcl/HclDiagramFactory.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.hcl; @@ -49,7 +49,7 @@ import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.json.JsonValue; import net.sourceforge.plantuml.jsondiagram.JsonDiagram; import net.sourceforge.plantuml.jsondiagram.StyleExtractor; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; public class HclDiagramFactory extends PSystemAbstractFactory { @@ -77,7 +77,7 @@ public class HclDiagramFactory extends PSystemAbstractFactory { HclParser parser = new HclParser(list); data = parser.parseMe(); } catch (Exception e) { - Logger.error(e); + Logme.error(e); } final JsonDiagram result = new JsonDiagram(style, source, UmlDiagramType.HCL, data, highlighted); // if (styleExtractor != null) { diff --git a/src/net/sourceforge/plantuml/help/CommandHelpTheme.java b/src/net/sourceforge/plantuml/help/CommandHelpTheme.java index 53fae1832..e5d0b2321 100644 --- a/src/net/sourceforge/plantuml/help/CommandHelpTheme.java +++ b/src/net/sourceforge/plantuml/help/CommandHelpTheme.java @@ -45,7 +45,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.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.theme.ThemeUtils; public class CommandHelpTheme extends SingleLineCommand2 { @@ -77,7 +77,7 @@ public class CommandHelpTheme extends SingleLineCommand2 { } catch (IOException e) { final String message = "Unexpected error listing themes: " + e.getMessage(); Log.error(message); - Logger.error(e); + Logme.error(e); return CommandExecutionResult.error(message); } diff --git a/src/net/sourceforge/plantuml/jcckit/PSystemJcckitFactory.java b/src/net/sourceforge/plantuml/jcckit/PSystemJcckitFactory.java index a33016c84..7a46a9eea 100644 --- a/src/net/sourceforge/plantuml/jcckit/PSystemJcckitFactory.java +++ b/src/net/sourceforge/plantuml/jcckit/PSystemJcckitFactory.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.jcckit; @@ -49,7 +49,7 @@ import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.Pattern2; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; public class PSystemJcckitFactory extends PSystemBasicFactory { @@ -100,7 +100,7 @@ public class PSystemJcckitFactory extends PSystemBasicFactory { // p.load(new ByteArrayInputStream(data.toString().getBytes("ISO-8859-1"))); } catch (IOException e) { Log.error("Error " + e); - Logger.error(e); + Logme.error(e); return null; } return new PSystemJcckit(source, p, width, height); diff --git a/src/net/sourceforge/plantuml/log/Logger.java b/src/net/sourceforge/plantuml/log/Logger.java deleted file mode 100644 index e1407e7f0..000000000 --- a/src/net/sourceforge/plantuml/log/Logger.java +++ /dev/null @@ -1,57 +0,0 @@ -package net.sourceforge.plantuml.log; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.logging.ConsoleHandler; -import java.util.logging.Formatter; -import java.util.logging.Level; -import java.util.logging.LogRecord; - -public class Logger { - - private static final java.util.logging.Logger logger; - - static { - logger = java.util.logging.Logger.getLogger("com.plantuml"); - logger.setUseParentHandlers(false); - ConsoleHandler handler = new ConsoleHandler(); - handler.setFormatter(new Formatter() { - @Override - public synchronized String format(LogRecord lr) { - String throwable = ""; - if (lr.getThrown() != null) { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - pw.println(); - lr.getThrown().printStackTrace(pw); - pw.close(); - throwable = sw.toString().trim(); - } - String message = lr.getMessage(); - StringBuilder sb = new StringBuilder(); - if (message.trim().length() > 0) { - sb.append(message); - sb.append(System.lineSeparator()); - } - if (throwable.length() > 0) { - sb.append(throwable); - sb.append(System.lineSeparator()); - } - return sb.toString(); - } - }); - logger.addHandler(handler); - } - - public static void error(Throwable thrown) { - logger.log(Level.SEVERE, "", thrown); - } - - public static void error(String msg, Throwable thrown) { - logger.log(Level.SEVERE, msg, thrown); - } - - public static void error(String msg) { - logger.log(Level.SEVERE, msg); - } -} diff --git a/src/net/sourceforge/plantuml/log/Logme.java b/src/net/sourceforge/plantuml/log/Logme.java new file mode 100644 index 000000000..51d7b24ec --- /dev/null +++ b/src/net/sourceforge/plantuml/log/Logme.java @@ -0,0 +1,67 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2023, 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: Guillaume Grossetie + * + * + */ +package net.sourceforge.plantuml.log; + +import java.util.logging.ConsoleHandler; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class Logme { + + private static final Logger logger; + + static { + logger = Logger.getLogger("com.plantuml"); + logger.setUseParentHandlers(false); + final ConsoleHandler handler = new ConsoleHandler(); + handler.setFormatter(new SimpleFormatter()); + logger.addHandler(handler); + } + + public static void error(Throwable thrown) { + logger.log(Level.SEVERE, "", thrown); + } + + // Unused right now + // + // public static void error(String msg, Throwable thrown) { + // logger.log(Level.SEVERE, msg, thrown); + // } + // + // public static void error(String msg) { + // logger.log(Level.SEVERE, msg); + // } +} diff --git a/src/net/sourceforge/plantuml/log/SimpleFormatter.java b/src/net/sourceforge/plantuml/log/SimpleFormatter.java new file mode 100644 index 000000000..45106d25f --- /dev/null +++ b/src/net/sourceforge/plantuml/log/SimpleFormatter.java @@ -0,0 +1,74 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2023, 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: Guillaume Grossetie + * + * + */ +package net.sourceforge.plantuml.log; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.logging.Formatter; +import java.util.logging.LogRecord; + +public class SimpleFormatter extends Formatter { + + @Override + public synchronized String format(LogRecord record) { + final String throwable; + if (record.getThrown() == null) { + throwable = ""; + } else { + final StringWriter sw = new StringWriter(); + final PrintWriter pw = new PrintWriter(sw); + pw.println(); + record.getThrown().printStackTrace(pw); + pw.close(); + throwable = sw.toString().trim(); + } + + final String message = record.getMessage(); + final StringBuilder sb = new StringBuilder(); + + if (message.trim().length() > 0) { + sb.append(message); + sb.append(System.lineSeparator()); + } + + if (throwable.length() > 0) { + sb.append(throwable); + sb.append(System.lineSeparator()); + } + + return sb.toString(); + } +} diff --git a/src/net/sourceforge/plantuml/math/AsciiMath.java b/src/net/sourceforge/plantuml/math/AsciiMath.java index e73f0ec1d..d5e3cc548 100644 --- a/src/net/sourceforge/plantuml/math/AsciiMath.java +++ b/src/net/sourceforge/plantuml/math/AsciiMath.java @@ -36,12 +36,12 @@ package net.sourceforge.plantuml.math; import java.awt.Color; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import javax.script.ScriptException; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.MutableImage; import net.sourceforge.plantuml.ugraphic.UImageSvg; diff --git a/src/net/sourceforge/plantuml/math/ConverterSvg.java b/src/net/sourceforge/plantuml/math/ConverterSvg.java index 46862314d..2a279e625 100644 --- a/src/net/sourceforge/plantuml/math/ConverterSvg.java +++ b/src/net/sourceforge/plantuml/math/ConverterSvg.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.math; @@ -38,7 +38,6 @@ package net.sourceforge.plantuml.math; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.io.CharArrayWriter; import java.io.IOException; import java.io.Writer; @@ -47,12 +46,12 @@ import java.lang.reflect.Method; import javax.swing.Icon; -import net.sourceforge.plantuml.log.Logger; - import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; +import net.sourceforge.plantuml.log.Logme; public class ConverterSvg { @@ -75,7 +74,7 @@ public class ConverterSvg { Class.forName("org.scilab.forge.jlatexmath.greek.GreekRegistration").newInstance()); } catch (Exception e) { - Logger.error(e); + Logme.error(e); } } diff --git a/src/net/sourceforge/plantuml/math/LatexBuilder.java b/src/net/sourceforge/plantuml/math/LatexBuilder.java index 062b67aee..2a367804b 100644 --- a/src/net/sourceforge/plantuml/math/LatexBuilder.java +++ b/src/net/sourceforge/plantuml/math/LatexBuilder.java @@ -37,13 +37,13 @@ package net.sourceforge.plantuml.math; import java.awt.Color; import java.awt.Graphics2D; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.image.BufferedImage; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import javax.swing.Icon; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.MutableImage; import net.sourceforge.plantuml.ugraphic.UImageSvg; diff --git a/src/net/sourceforge/plantuml/math/PSystemLatex.java b/src/net/sourceforge/plantuml/math/PSystemLatex.java index abcc18da9..0ab285f4f 100644 --- a/src/net/sourceforge/plantuml/math/PSystemLatex.java +++ b/src/net/sourceforge/plantuml/math/PSystemLatex.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.math; @@ -45,7 +45,7 @@ import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.UmlSource; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity; import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorSet; @@ -94,7 +94,7 @@ public class PSystemLatex extends AbstractPSystem { scale = scale1; } } catch (Exception e) { - Logger.error(e); + Logme.error(e); } } else if (lineLower.startsWith("dpi ")) { final String value = line.substring("dpi ".length()); @@ -104,7 +104,7 @@ public class PSystemLatex extends AbstractPSystem { scale = dpi1 / 96; } } catch (Exception e) { - Logger.error(e); + Logme.error(e); } } else { this.latex = line; diff --git a/src/net/sourceforge/plantuml/math/PSystemMath.java b/src/net/sourceforge/plantuml/math/PSystemMath.java index 43b7ce6ce..289b955dd 100644 --- a/src/net/sourceforge/plantuml/math/PSystemMath.java +++ b/src/net/sourceforge/plantuml/math/PSystemMath.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.math; @@ -45,7 +45,7 @@ import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.UmlSource; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity; import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorSet; @@ -94,7 +94,7 @@ public class PSystemMath extends AbstractPSystem { scale = scale1; } } catch (Exception e) { - Logger.error(e); + Logme.error(e); } } else if (lineLower.startsWith("dpi ")) { final String value = line.substring("dpi ".length()); @@ -104,7 +104,7 @@ public class PSystemMath extends AbstractPSystem { scale = dpi1 / 96; } } catch (Exception e) { - Logger.error(e); + Logme.error(e); } } else { this.math = line; diff --git a/src/net/sourceforge/plantuml/math/ScientificEquation.java b/src/net/sourceforge/plantuml/math/ScientificEquation.java index ab92ca796..260a7801c 100644 --- a/src/net/sourceforge/plantuml/math/ScientificEquation.java +++ b/src/net/sourceforge/plantuml/math/ScientificEquation.java @@ -36,10 +36,10 @@ package net.sourceforge.plantuml.math; import java.awt.Color; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.io.IOException; import java.lang.reflect.InvocationTargetException; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.ugraphic.MutableImage; import net.sourceforge.plantuml.ugraphic.UImageSvg; diff --git a/src/net/sourceforge/plantuml/math/ScientificEquationSafe.java b/src/net/sourceforge/plantuml/math/ScientificEquationSafe.java index 1387f09fb..15dc1484d 100644 --- a/src/net/sourceforge/plantuml/math/ScientificEquationSafe.java +++ b/src/net/sourceforge/plantuml/math/ScientificEquationSafe.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.math; @@ -52,7 +52,7 @@ import net.sourceforge.plantuml.api.ImageDataSimple; import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.eps.EpsGraphics; import net.sourceforge.plantuml.graphic.GraphicStrings; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.svek.TextBlockBackcolored; import net.sourceforge.plantuml.ugraphic.AffineTransformType; @@ -74,7 +74,7 @@ public class ScientificEquationSafe { try { return new ScientificEquationSafe(formula, new AsciiMath(formula)); } catch (Exception e) { - Logger.error(e); + Logme.error(e); Log.info("Error parsing " + formula); return new ScientificEquationSafe(formula, null); } @@ -84,7 +84,7 @@ public class ScientificEquationSafe { try { return new ScientificEquationSafe(formula, new LatexBuilder(formula)); } catch (Exception e) { - Logger.error(e); + Logme.error(e); Log.info("Error parsing " + formula); return new ScientificEquationSafe(formula, null); } @@ -130,7 +130,7 @@ public class ScientificEquationSafe { if (equation != null) { System.err.println("Latex=" + equation.getSource()); } - Logger.error(e); + Logme.error(e); } private TextBlockBackcolored getRollback() { diff --git a/src/net/sourceforge/plantuml/mindmap/MindMap.java b/src/net/sourceforge/plantuml/mindmap/MindMap.java index bd805a0c1..67a3dec62 100644 --- a/src/net/sourceforge/plantuml/mindmap/MindMap.java +++ b/src/net/sourceforge/plantuml/mindmap/MindMap.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -126,7 +126,7 @@ public class MindMap implements UDrawable { return this.regular.add(skinParam.getCurrentStyleBuilder(), backColor, level, label, shape, stereotype); } catch (NoStyleAvailableException e) { - // Logger.error(e); + // Logme.error(e); return CommandExecutionResult.error("General failure: no style available."); } } diff --git a/src/net/sourceforge/plantuml/openiconic/OpenIcon.java b/src/net/sourceforge/plantuml/openiconic/OpenIcon.java index b5c4c40d3..ba2906b02 100644 --- a/src/net/sourceforge/plantuml/openiconic/OpenIcon.java +++ b/src/net/sourceforge/plantuml/openiconic/OpenIcon.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,12 +30,11 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.openiconic; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -45,10 +44,11 @@ import java.util.ArrayList; import java.util.List; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.openiconic.data.DummyIcon; import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -70,7 +70,7 @@ public class OpenIcon { try { return new OpenIcon(is, name); } catch (IOException e) { - Logger.error(e); + Logme.error(e); return null; } } diff --git a/src/net/sourceforge/plantuml/pdf/PdfConverter.java b/src/net/sourceforge/plantuml/pdf/PdfConverter.java index 5802fd2dd..146e9f5b8 100644 --- a/src/net/sourceforge/plantuml/pdf/PdfConverter.java +++ b/src/net/sourceforge/plantuml/pdf/PdfConverter.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -35,11 +35,11 @@ */ package net.sourceforge.plantuml.pdf; -import net.sourceforge.plantuml.log.Logger; - import java.io.File; import java.lang.reflect.Method; +import net.sourceforge.plantuml.log.Logme; + public class PdfConverter { public static void convert(File svgFile, File pdfFile) { @@ -74,7 +74,7 @@ public class PdfConverter { final Method execute = clSVGConverter.getMethod("execute"); execute.invoke(converter); } catch (Exception e) { - Logger.error(e); + Logme.error(e); throw new UnsupportedOperationException(); } if (pdfFile.exists() == false) { diff --git a/src/net/sourceforge/plantuml/picoweb/PicoWebServer.java b/src/net/sourceforge/plantuml/picoweb/PicoWebServer.java index 13c470ab5..2fcf3187a 100644 --- a/src/net/sourceforge/plantuml/picoweb/PicoWebServer.java +++ b/src/net/sourceforge/plantuml/picoweb/PicoWebServer.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,9 +30,9 @@ * * * Original Author: Arnaud Roques - * + * * Highly inspired from https://www.ssaurel.com/blog/create-a-simple-http-web-server-in-java - * + * */ package net.sourceforge.plantuml.picoweb; @@ -69,7 +69,7 @@ import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.error.PSystemError; import net.sourceforge.plantuml.error.PSystemErrorUtils; import net.sourceforge.plantuml.graphic.QuoteUtils; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.version.Version; @@ -139,7 +139,7 @@ public class PicoWebServer implements Runnable { try { sendError(e, out); } catch (Throwable e1) { - Logger.error(e); + Logme.error(e); } } finally { try { @@ -147,7 +147,7 @@ public class PicoWebServer implements Runnable { out.close(); connect.close(); } catch (Throwable e) { - Logger.error(e); + Logme.error(e); } } } diff --git a/src/net/sourceforge/plantuml/picoweb/PicoWebServerTest.java b/src/net/sourceforge/plantuml/picoweb/PicoWebServerTest.java index 09b8eefb5..142201314 100644 --- a/src/net/sourceforge/plantuml/picoweb/PicoWebServerTest.java +++ b/src/net/sourceforge/plantuml/picoweb/PicoWebServerTest.java @@ -1,11 +1,8 @@ package net.sourceforge.plantuml.picoweb; -import net.sourceforge.plantuml.json.Json; -import net.sourceforge.plantuml.json.JsonObject; -import net.sourceforge.plantuml.log.Logger; +import static java.nio.charset.StandardCharsets.UTF_8; +import static net.sourceforge.plantuml.code.TranscoderUtil.getDefaultTranscoder; -import javax.imageio.ImageIO; -import javax.imageio.stream.MemoryCacheImageInputStream; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -15,8 +12,12 @@ import java.net.ServerSocket; import java.net.Socket; import java.net.URL; -import static java.nio.charset.StandardCharsets.UTF_8; -import static net.sourceforge.plantuml.code.TranscoderUtil.getDefaultTranscoder; +import javax.imageio.ImageIO; +import javax.imageio.stream.MemoryCacheImageInputStream; + +import net.sourceforge.plantuml.json.Json; +import net.sourceforge.plantuml.json.JsonObject; +import net.sourceforge.plantuml.log.Logme; // Newer Java versions have nice built-in HTTP classes in the jdk.incubator.httpclient / java.net.http packages // but PlantUML supports older Java versions so the tests here use a kludgy approach to HTTP. @@ -295,7 +296,7 @@ public class PicoWebServerTest { try { PicoWebServer.serverLoop(serverSocket); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } }; diff --git a/src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java b/src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java deleted file mode 100644 index 429038201..000000000 --- a/src/net/sourceforge/plantuml/posimo/AbstractEntityImage2.java +++ /dev/null @@ -1,83 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2023, 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.posimo; - -import net.sourceforge.plantuml.awt.geom.Dimension2D; -import java.util.Objects; - -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.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 { - - private final IEntity entity; - private final ISkinParam skinParam; - - private final Rose rose = new Rose(); - - public AbstractEntityImage2(IEntity entity, ISkinParam skinParam) { - this.entity = Objects.requireNonNull(entity); - this.skinParam = skinParam; - } - - public abstract Dimension2D getDimension(StringBounder stringBounder); - - protected final IEntity getEntity() { - return entity; - } - - protected UFont getFont(FontParam fontParam) { - return skinParam.getFont(null, false, fontParam); - } - - protected HColor getFontColor(FontParam fontParam) { - return skinParam.getFontHtmlColor(null, fontParam); - } - - protected final HColor getColor(ColorParam colorParam) { - return rose.getHtmlColor(skinParam, colorParam); - } - - protected final ISkinParam getSkinParam() { - return skinParam; - } -} diff --git a/src/net/sourceforge/plantuml/posimo/EntityImageNote2.java b/src/net/sourceforge/plantuml/posimo/EntityImageNote2.java deleted file mode 100644 index b96149188..000000000 --- a/src/net/sourceforge/plantuml/posimo/EntityImageNote2.java +++ /dev/null @@ -1,81 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2023, 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.posimo; - -import net.sourceforge.plantuml.awt.geom.Dimension2D; -import java.util.Collection; - -import net.sourceforge.plantuml.Dimension2DDouble; -import net.sourceforge.plantuml.ISkinParam; -import net.sourceforge.plantuml.cucadiagram.IEntity; -import net.sourceforge.plantuml.cucadiagram.Link; -import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.skin.Area; -import net.sourceforge.plantuml.skin.Component; -import net.sourceforge.plantuml.skin.ComponentType; -import net.sourceforge.plantuml.skin.SimpleContext2D; -import net.sourceforge.plantuml.skin.rose.Rose; -import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UTranslate; - -public class EntityImageNote2 extends AbstractEntityImage2 { - - private final Component comp; - - public EntityImageNote2(IEntity entity, ISkinParam skinParam, Collection links) { - super(entity, skinParam); - - final Rose skin = new Rose(); - - comp = skin.createComponent(null, ComponentType.NOTE, null, skinParam, entity.getDisplay()); - - } - - @Override - public Dimension2D getDimension(StringBounder stringBounder) { - final double height = comp.getPreferredHeight(stringBounder); - final double width = comp.getPreferredWidth(stringBounder); - return new Dimension2DDouble(width, height); - } - - public void drawU(UGraphic ug, double xTheoricalPosition, double yTheoricalPosition, double marginWidth, - double marginHeight) { - ug = ug.apply(new UTranslate(xTheoricalPosition, yTheoricalPosition)); - comp.drawU(ug, new Area(getDimension(ug.getStringBounder())), new SimpleContext2D(false)); - - } - -} diff --git a/src/net/sourceforge/plantuml/preproc/StartDiagramExtractReader.java b/src/net/sourceforge/plantuml/preproc/StartDiagramExtractReader.java index bca22893c..d264c2761 100644 --- a/src/net/sourceforge/plantuml/preproc/StartDiagramExtractReader.java +++ b/src/net/sourceforge/plantuml/preproc/StartDiagramExtractReader.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.preproc; @@ -43,7 +43,7 @@ import java.nio.charset.Charset; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.StringLocated; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SURL; import net.sourceforge.plantuml.utils.StartUtils; @@ -87,7 +87,7 @@ public class StartDiagramExtractReader implements ReadLine { } } } catch (IOException e) { - Logger.error(e); + Logme.error(e); Log.error("Error " + e); } finished = true; diff --git a/src/net/sourceforge/plantuml/preproc/Stdlib.java b/src/net/sourceforge/plantuml/preproc/Stdlib.java index 4ad42807e..b11c7acb9 100644 --- a/src/net/sourceforge/plantuml/preproc/Stdlib.java +++ b/src/net/sourceforge/plantuml/preproc/Stdlib.java @@ -24,7 +24,7 @@ import java.util.regex.Pattern; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.brotli.BrotliInputStream; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; public class Stdlib { @@ -40,21 +40,21 @@ public class Stdlib { public static InputStream getResourceAsStream(String fullname) { fullname = fullname.toLowerCase().replace(".puml", ""); final int last = fullname.indexOf('/'); - if (last == -1) { + if (last == -1) return null; - } + try { final Stdlib folder = retrieve(fullname.substring(0, last)); - if (folder == null || folder.info.size() == 0) { + if (folder == null || folder.info.size() == 0) return null; - } + final String data = folder.loadRessource(fullname.substring(last + 1)); - if (data == null) { + if (data == null) return null; - } + return new ByteArrayInputStream(data.getBytes(UTF_8)); } catch (IOException e) { - Logger.error(e); + Logme.error(e); return null; } } @@ -63,9 +63,9 @@ public class Stdlib { Stdlib result = all.get(name); if (result == null) { final DataInputStream dataStream = getDataStream(name); - if (dataStream == null) { + if (dataStream == null) return null; - } + final String info = dataStream.readUTF(); dataStream.close(); result = new Stdlib(name, info); @@ -85,9 +85,9 @@ public class Stdlib { } Log.info("No cache for " + file); final DataInputStream dataStream = getDataStream(); - if (dataStream == null) { + if (dataStream == null) return null; - } + dataStream.readUTF(); final InputStream spriteStream = getSpriteStream(); if (spriteStream == null) { @@ -102,9 +102,9 @@ public class Stdlib { Log.info("Not found " + filename); return null; } - if (filename.equalsIgnoreCase(file)) { + if (filename.equalsIgnoreCase(file)) found = new StringBuilder(); - } + while (true) { final String s = dataStream.readUTF(); if (s.equals(SEPARATOR)) { @@ -122,9 +122,9 @@ public class Stdlib { if (isSpriteLine(s)) { final Matcher m = sizePattern.matcher(s); final boolean ok = m.find(); - if (ok == false) { + if (ok == false) throw new IOException(s); - } + final int width = Integer.parseInt(m.group(1)); final int height = Integer.parseInt(m.group(2)); if (found == null) { @@ -189,19 +189,19 @@ public class Stdlib { } private void fillMap(String infoString) { - for (String s : infoString.split("\n")) { + for (String s : infoString.split("\n")) if (s.contains("=")) { final String data[] = s.split("="); this.info.put(data[0], data[1]); } - } + } private static DataInputStream getDataStream(String name) throws IOException { final InputStream raw = getInternalInputStream(name, "-abx.repx"); - if (raw == null) { + if (raw == null) return null; - } + return new DataInputStream(new BrotliInputStream(raw)); } @@ -211,9 +211,9 @@ public class Stdlib { private InputStream getSpriteStream() throws IOException { final InputStream raw = getInternalInputStream(name, "-dex.repx"); - if (raw == null) { + if (raw == null) return null; - } + return new BrotliInputStream(raw); } @@ -234,40 +234,40 @@ public class Stdlib { final InputStream home = getInternalInputStream("home", ".repx"); final BufferedReader br = new BufferedReader(new InputStreamReader(home)); String name; - while ((name = br.readLine()) != null) { + while ((name = br.readLine()) != null) result.add(name); - } + return Collections.unmodifiableCollection(result); } private void extractMeFull() throws IOException { final DataInputStream dataStream = getDataStream(); - if (dataStream == null) { + if (dataStream == null) return; - } + dataStream.readUTF(); final InputStream spriteStream = getSpriteStream(); try { while (true) { final String filename = dataStream.readUTF(); - if (filename.equals(SEPARATOR)) { + if (filename.equals(SEPARATOR)) return; - } + final SFile f = new SFile("stdlib/" + name + "/" + filename + ".puml"); f.getParentFile().mkdirs(); final PrintWriter fos = f.createPrintWriter(); while (true) { final String s = dataStream.readUTF(); - if (s.equals(SEPARATOR)) { + if (s.equals(SEPARATOR)) break; - } + fos.println(s); if (isSpriteLine(s)) { final Matcher m = sizePattern.matcher(s); final boolean ok = m.find(); - if (ok == false) { + if (ok == false) throw new IOException(s); - } + final int width = Integer.parseInt(m.group(1)); final int height = Integer.parseInt(m.group(2)); final String sprite = readSprite(width, height, spriteStream); @@ -286,34 +286,34 @@ public class Stdlib { public List extractAllSprites() throws IOException { final List result = new ArrayList<>(); final DataInputStream dataStream = getDataStream(); - if (dataStream == null) { + if (dataStream == null) return Collections.unmodifiableList(result); - } + dataStream.readUTF(); final InputStream spriteStream = getSpriteStream(); try { while (true) { final String filename = dataStream.readUTF(); - if (filename.equals(SEPARATOR)) { + if (filename.equals(SEPARATOR)) return Collections.unmodifiableList(result); - } + while (true) { final String s = dataStream.readUTF(); - if (s.equals(SEPARATOR)) { + if (s.equals(SEPARATOR)) break; - } + if (isSpriteLine(s)) { final Matcher m = sizePattern.matcher(s); final boolean ok = m.find(); - if (ok == false) { + if (ok == false) throw new IOException(s); - } + final int width = Integer.parseInt(m.group(1)); final int height = Integer.parseInt(m.group(2)); final String sprite = readSprite(width, height, spriteStream); - if (s.contains("_LARGE") == false) { + if (s.contains("_LARGE") == false) result.add(s + "\n" + sprite + "}"); - } + } } } @@ -353,8 +353,8 @@ public class Stdlib { public static void printStdLib() { final List print = new ArrayList<>(); addInfoVersion(print, true); - for (String s : print) { + for (String s : print) System.out.println(s.replace("", "")); - } + } } diff --git a/src/net/sourceforge/plantuml/preproc2/PreprocessorUtils.java b/src/net/sourceforge/plantuml/preproc2/PreprocessorUtils.java index c20aabf3f..1670064c7 100644 --- a/src/net/sourceforge/plantuml/preproc2/PreprocessorUtils.java +++ b/src/net/sourceforge/plantuml/preproc2/PreprocessorUtils.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -31,7 +31,7 @@ * * Original Author: Arnaud Roques * Modified by: Nicolas Jouanin - * + * * */ package net.sourceforge.plantuml.preproc2; @@ -48,7 +48,7 @@ import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.StringLocated; import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.preproc.ReadLine; import net.sourceforge.plantuml.preproc.ReadLineReader; import net.sourceforge.plantuml.preproc.ReadLineSimple; @@ -67,9 +67,9 @@ public class PreprocessorUtils { while (m.find()) { final String var = m.group(1); final String value = getenv(var); - if (value != null) { + if (value != null) m.appendReplacement(sb, Matcher.quoteReplacement(value)); - } + } m.appendTail(sb); s = sb.toString(); @@ -78,13 +78,13 @@ public class PreprocessorUtils { public static String getenv(String var) { final String env = System.getProperty(var); - if (StringUtils.isNotEmpty(env)) { + if (StringUtils.isNotEmpty(env)) return StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(env); - } + final String getenv = System.getenv(var); - if (StringUtils.isNotEmpty(getenv)) { + if (StringUtils.isNotEmpty(getenv)) return StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(getenv); - } + return null; } @@ -97,9 +97,9 @@ public class PreprocessorUtils { public static ReadLine getReaderStdlibInclude(StringLocated s, String filename) { Log.info("Loading sdlib " + filename); InputStream is = getStdlibInputStream(filename); - if (is == null) { + if (is == null) return null; - } + final String description = "<" + filename + ">"; try { if (StartDiagramExtractReader.containsStartDiagram(is, s, description)) { @@ -107,12 +107,12 @@ public class PreprocessorUtils { return StartDiagramExtractReader.build(is, s, description); } is = getStdlibInputStream(filename); - if (is == null) { + if (is == null) return null; - } + return ReadLineReader.create(new InputStreamReader(is), description); } catch (IOException e) { - Logger.error(e); + Logme.error(e); return new ReadLineSimple(s, e.toString()); } } @@ -120,12 +120,12 @@ public class PreprocessorUtils { public static ReadLine getReaderIncludeUrl(final SURL url, StringLocated s, String suf, Charset charset) throws EaterException { try { - if (StartDiagramExtractReader.containsStartDiagram(url, s, charset)) { + if (StartDiagramExtractReader.containsStartDiagram(url, s, charset)) return StartDiagramExtractReader.build(url, s, suf, charset); - } + return getReaderInclude(url, s.getLocation(), charset); } catch (IOException e) { - Logger.error(e); + Logme.error(e); throw EaterException.located("Cannot open URL " + e.getMessage()); } @@ -134,9 +134,9 @@ public class PreprocessorUtils { public static ReadLine getReaderInclude(SURL url, LineLocation lineLocation, Charset charset) throws EaterException, UnsupportedEncodingException { final InputStream is = url.openStream(); - if (is == null) { + if (is == null) throw EaterException.located("Cannot open URL"); - } + return ReadLineReader.create(new InputStreamReader(is, charset), url.toString(), lineLocation); } diff --git a/src/net/sourceforge/plantuml/project/GanttConstraint.java b/src/net/sourceforge/plantuml/project/GanttConstraint.java index 92d9600a8..0d0233e28 100644 --- a/src/net/sourceforge/plantuml/project/GanttConstraint.java +++ b/src/net/sourceforge/plantuml/project/GanttConstraint.java @@ -78,13 +78,13 @@ public class GanttConstraint extends WithLinkType { } public boolean isThereRightArrow(Task task) { - if (dest.getMoment() == task && dest.getAttribute() == TaskAttribute.END) { + if (dest.getMoment() == task && dest.getAttribute() == TaskAttribute.END) return true; - } + if (source.getMoment() == task && dest.getAttribute() == TaskAttribute.END - && source.getAttribute() == TaskAttribute.END) { + && source.getAttribute() == TaskAttribute.END) return true; - } + return false; } @@ -105,22 +105,22 @@ public class GanttConstraint extends WithLinkType { } public boolean isHidden(Day min, Day max) { - if (isHidden(source.getInstantPrecise(), min, max)) { + if (isHidden(source.getInstantPrecise(), min, max)) return true; - } - if (isHidden(dest.getInstantPrecise(), min, max)) { + + if (isHidden(dest.getInstantPrecise(), min, max)) return true; - } + return false; } private boolean isHidden(Day now, Day min, Day max) { - if (now.compareTo(min) < 0) { + if (now.compareTo(min) < 0) return true; - } - if (now.compareTo(max) > 0) { + + if (now.compareTo(max) > 0) return true; - } + return false; } diff --git a/src/net/sourceforge/plantuml/project/GanttConstraintMode.java b/src/net/sourceforge/plantuml/project/GanttConstraintMode.java new file mode 100644 index 000000000..2f394f260 --- /dev/null +++ b/src/net/sourceforge/plantuml/project/GanttConstraintMode.java @@ -0,0 +1,41 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2023, 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; + +public enum GanttConstraintMode { + IGNORE_CALENDAR, DO_NOT_COUNT_CLOSE_DAY + +} diff --git a/src/net/sourceforge/plantuml/project/GanttDiagram.java b/src/net/sourceforge/plantuml/project/GanttDiagram.java index 4fe06ec57..3669d0591 100644 --- a/src/net/sourceforge/plantuml/project/GanttDiagram.java +++ b/src/net/sourceforge/plantuml/project/GanttDiagram.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,12 +30,11 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.project; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; import java.io.IOException; import java.io.OutputStream; @@ -57,6 +56,7 @@ import net.sourceforge.plantuml.TitledDiagram; import net.sourceforge.plantuml.UmlDiagramType; import net.sourceforge.plantuml.WithSprite; import net.sourceforge.plantuml.api.ThemeStyle; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.ImageData; @@ -66,7 +66,7 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.InnerStrategy; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.UDrawable; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.project.core.Moment; import net.sourceforge.plantuml.project.core.MomentImpl; import net.sourceforge.plantuml.project.core.PrintScale; @@ -248,7 +248,7 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit timeHeader.drawTimeFooter(ug.apply(UTranslate.dy(totalHeightWithoutFooter))); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); final UDrawable crash = new GraphvizCrash(getSource().getPlainString(), false, t); crash.drawU(ug); @@ -295,28 +295,28 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit } private TimeHeader getTimeHeader() { - if (openClose.getCalendar() == null) + if (openClose.getStartingDay() == null) return new TimeHeaderSimple(printScale, getTimelineStyle(), getClosedStyle(), getFactorScale(), min, max, getIHtmlColorSet(), getSkinParam().getThemeStyle(), colorDays()); else if (printScale == PrintScale.DAILY) return new TimeHeaderDaily(locale, getTimelineStyle(), getClosedStyle(), getFactorScale(), - openClose.getCalendar(), min, max, openClose, colorDays(), colorDaysOfWeek, nameDays, printStart, + openClose.getStartingDay(), min, max, openClose, colorDays(), colorDaysOfWeek, nameDays, printStart, printEnd, getIHtmlColorSet(), getSkinParam().getThemeStyle()); else if (printScale == PrintScale.WEEKLY) return new TimeHeaderWeekly(weekNumberStrategy, withCalendarDate, locale, getTimelineStyle(), - getClosedStyle(), getFactorScale(), openClose.getCalendar(), min, max, openClose, colorDays(), + getClosedStyle(), getFactorScale(), openClose.getStartingDay(), min, max, openClose, colorDays(), colorDaysOfWeek, getIHtmlColorSet(), getSkinParam().getThemeStyle()); else if (printScale == PrintScale.MONTHLY) return new TimeHeaderMonthly(locale, getTimelineStyle(), getClosedStyle(), getFactorScale(), - openClose.getCalendar(), min, max, openClose, colorDays(), colorDaysOfWeek, getIHtmlColorSet(), + openClose.getStartingDay(), min, max, openClose, colorDays(), colorDaysOfWeek, getIHtmlColorSet(), getSkinParam().getThemeStyle()); else if (printScale == PrintScale.QUARTERLY) return new TimeHeaderQuarterly(locale, getTimelineStyle(), getClosedStyle(), getFactorScale(), - openClose.getCalendar(), min, max, openClose, colorDays(), colorDaysOfWeek, getIHtmlColorSet(), + openClose.getStartingDay(), min, max, openClose, colorDays(), colorDaysOfWeek, getIHtmlColorSet(), getSkinParam().getThemeStyle()); else if (printScale == PrintScale.YEARLY) return new TimeHeaderYearly(locale, getTimelineStyle(), getClosedStyle(), getFactorScale(), - openClose.getCalendar(), min, max, openClose, colorDays(), colorDaysOfWeek, getIHtmlColorSet(), + openClose.getStartingDay(), min, max, openClose, colorDays(), colorDaysOfWeek, getIHtmlColorSet(), getSkinParam().getThemeStyle()); else throw new IllegalStateException(); @@ -393,14 +393,33 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit openClose.close(day); } - public void closeDayAsDate(Day day) { - openClose.close(day); + public void closeDayAsDate(Day day, String task) { + if (task.length() == 0) + openClose.close(day); + else + getOpenCloseForTask(task).close(day); + } - public void openDayAsDate(Day day) { - openClose.open(day); + public void openDayAsDate(Day day, String task) { + if (task.length() == 0) + openClose.open(day); + else + getOpenCloseForTask(task).open(day); + } + private OpenClose getOpenCloseForTask(String task) { + OpenClose except = openCloseForTask.get(task); + if (except == null) { + except = new OpenClose(); + openCloseForTask.put(task, except); + } + return except; + } + + private final Map openCloseForTask = new HashMap<>(); + private void initTaskAndResourceDraws(TimeScale timeScale, double headerHeight, StringBounder stringBounder) { Real y = origin.addFixed(headerHeight); for (Task task : tasks.values()) { @@ -518,7 +537,7 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit } } - if (openClose.getCalendar() != null) { + if (openClose.getStartingDay() != null) { for (Day d : colorDays().keySet()) if (d.compareTo(max) > 0) max = d; @@ -578,7 +597,10 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit if (linkedToPrevious) previous = getLastCreatedTask(); - result = new TaskImpl(getSkinParam().getCurrentStyleBuilder(), code, openClose); + final OpenClose except = this.openCloseForTask.get(codeOrShortName); + + result = new TaskImpl(getSkinParam().getCurrentStyleBuilder(), code, openClose.mutateMe(except), + openClose.getStartingDay()); tasks.put(code, result); if (byShortName != null) byShortName.put(shortName, result); @@ -613,15 +635,15 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit } public void setStartingDate(Day start) { - openClose.setCalendar(start); + openClose.setStartingDay(start); this.min = start; } public Day getStartingDate() { - if (openClose.getCalendar() == null) + if (openClose.getStartingDay() == null) return min; - return openClose.getCalendar(); + return openClose.getStartingDay(); } public int daysInWeek() { diff --git a/src/net/sourceforge/plantuml/project/OpenClose.java b/src/net/sourceforge/plantuml/project/OpenClose.java index e77f024cb..b0d01523a 100644 --- a/src/net/sourceforge/plantuml/project/OpenClose.java +++ b/src/net/sourceforge/plantuml/project/OpenClose.java @@ -49,46 +49,46 @@ public class OpenClose implements Histogram, LoadPlanable { private final Collection closedDayOfWeek = EnumSet.noneOf(DayOfWeek.class); private final Collection closedDays = new HashSet<>(); private final Collection openedDays = new HashSet<>(); - private Day calendar; + private Day startingDay; public int daysInWeek() { return 7 - closedDayOfWeek.size(); } private boolean isThereSomeChangeAfter(Day day) { - if (closedDayOfWeek.size() > 0) { + if (closedDayOfWeek.size() > 0) return true; - } - for (Day tmp : closedDays) { + + for (Day tmp : closedDays) if (tmp.compareTo(day) >= 0) return true; - } - for (Day tmp : openedDays) { + + for (Day tmp : openedDays) if (tmp.compareTo(day) >= 0) return true; - } + return false; } private boolean isThereSomeChangeBefore(Day day) { - if (closedDayOfWeek.size() > 0) { + if (closedDayOfWeek.size() > 0) return true; - } - for (Day tmp : closedDays) { + + for (Day tmp : closedDays) if (tmp.compareTo(day) <= 0) return true; - } - for (Day tmp : openedDays) { + + for (Day tmp : openedDays) if (tmp.compareTo(day) <= 0) return true; - } + return false; } public boolean isClosed(Day day) { - if (openedDays.contains(day)) { + if (openedDays.contains(day)) return false; - } + final DayOfWeek dayOfWeek = day.getDayOfWeek(); return closedDayOfWeek.contains(dayOfWeek) || closedDays.contains(day); } @@ -105,19 +105,18 @@ public class OpenClose implements Histogram, LoadPlanable { openedDays.add(day); } - public final Day getCalendar() { - return calendar; + public final Day getStartingDay() { + return startingDay; } - public final void setCalendar(Day calendar) { - this.calendar = calendar; + public final void setStartingDay(Day startingDay) { + this.startingDay = startingDay; } public long getNext(long moment) { Day day = Day.create(moment); - if (isThereSomeChangeAfter(day) == false) { + if (isThereSomeChangeAfter(day) == false) return TimeLine.MAX_TIME; - } final long current = getLoatAtInternal(day); System.err.println("getNext:day=" + day + " current=" + current); @@ -125,17 +124,16 @@ public class OpenClose implements Histogram, LoadPlanable { day = day.increment(); final int tmp = getLoatAtInternal(day); System.err.println("..day=" + day + " " + tmp); - if (tmp != current) { + if (tmp != current) return day.getMillis(); - } + } } public long getPrevious(long moment) { Day day = Day.create(moment); - if (isThereSomeChangeBefore(day) == false) { + if (isThereSomeChangeBefore(day) == false) return -TimeLine.MAX_TIME; - } final long current = getLoatAtInternal(day); System.err.println("getPrevious=" + day + " current=" + current); @@ -143,32 +141,47 @@ public class OpenClose implements Histogram, LoadPlanable { day = day.decrement(); final int tmp = getLoatAtInternal(day); System.err.println("..day=" + day + " " + tmp); - if (tmp != current) { + if (tmp != current) return day.getMillis(); - } + } } public long getValueAt(long moment) { final Day day = Day.create(moment); - if (isClosed(day)) { + if (isClosed(day)) return 0; - } + return 100; } public int getLoadAt(Day day) { - if (getCalendar() == null) { + if (getStartingDay() == null) return 100; - } + return getLoatAtInternal(day); } private int getLoatAtInternal(Day day) { - if (isClosed(day)) { + if (isClosed(day)) return 0; - } + return 100; } + public LoadPlanable mutateMe(final OpenClose except) { + if (except != null) + return new LoadPlanable() { + @Override + public int getLoadAt(Day instant) { + if (except.openedDays.contains(instant)) + return 100; + if (except.closedDays.contains(instant)) + return 0; + return OpenClose.this.getLoadAt(instant); + } + }; + return this; + } + } diff --git a/src/net/sourceforge/plantuml/project/core/TaskImpl.java b/src/net/sourceforge/plantuml/project/core/TaskImpl.java index fe8877e9f..21e41c513 100644 --- a/src/net/sourceforge/plantuml/project/core/TaskImpl.java +++ b/src/net/sourceforge/plantuml/project/core/TaskImpl.java @@ -49,7 +49,6 @@ import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.project.Load; import net.sourceforge.plantuml.project.LoadPlanable; -import net.sourceforge.plantuml.project.OpenClose; import net.sourceforge.plantuml.project.PlanUtils; import net.sourceforge.plantuml.project.lang.CenterBorderColor; import net.sourceforge.plantuml.project.solver.Solver; @@ -77,58 +76,56 @@ public class TaskImpl extends AbstractTask implements Task, LoadPlanable { this.url = url; } - public TaskImpl(StyleBuilder styleBuilder, TaskCode code, OpenClose openClose) { + public TaskImpl(StyleBuilder styleBuilder, TaskCode code, LoadPlanable plan, Day startingDay) { super(styleBuilder, code); - this.defaultPlan = openClose; + this.defaultPlan = plan; this.solver = new SolverImpl(this); - if (openClose.getCalendar() == null) { + if (startingDay == null) setStart(Day.create(0)); - } else { - setStart(openClose.getCalendar()); - } + else + setStart(startingDay); + setLoad(Load.inWinks(1)); } public int getLoadAt(Day instant) { - if (isPaused(instant)) { + if (isPaused(instant)) return 0; - } LoadPlanable result = defaultPlan; - if (resources.size() > 0) { + if (resources.size() > 0) result = PlanUtils.multiply(defaultPlan, getRessourcePlan()); - } + return result.getLoadAt(instant); } private boolean isPaused(Day instant) { - if (pausedDay.contains(instant)) { + if (pausedDay.contains(instant)) return true; - } - if (pausedDayOfWeek(instant)) { + + if (pausedDayOfWeek(instant)) return true; - } + return false; } private boolean pausedDayOfWeek(Day instant) { - for (DayOfWeek dayOfWeek : pausedDayOfWeek) { - if (instant.getDayOfWeek() == dayOfWeek) { + for (DayOfWeek dayOfWeek : pausedDayOfWeek) + if (instant.getDayOfWeek() == dayOfWeek) return true; - } - } + return false; } public int loadForResource(Resource res, Day instant) { if (resources.keySet().contains(res) && instant.compareTo(getStart()) >= 0 && instant.compareTo(getEnd()) <= 0) { - if (isPaused(instant)) { + if (isPaused(instant)) return 0; - } - if (res.isClosedAt(instant)) { + + if (res.isClosedAt(instant)) return 0; - } + return resources.get(res); } return 0; @@ -143,17 +140,17 @@ public class TaskImpl extends AbstractTask implements Task, LoadPlanable { } private LoadPlanable getRessourcePlan() { - if (resources.size() == 0) { + if (resources.size() == 0) throw new IllegalStateException(); - } + return new LoadPlanable() { public int getLoadAt(Day instant) { int result = 0; for (Map.Entry ent : resources.entrySet()) { final Resource res = ent.getKey(); - if (res.isClosedAt(instant)) { + if (res.isClosedAt(instant)) continue; - } + final int percentage = ent.getValue(); result += percentage; } @@ -171,13 +168,13 @@ public class TaskImpl extends AbstractTask implements Task, LoadPlanable { result.append("{"); result.append(ent.getKey().getName()); final int percentage = ent.getValue(); - if (percentage != 100) { + if (percentage != 100) result.append(":" + percentage + "%"); - } + result.append("}"); - if (it.hasNext()) { + if (it.hasNext()) result.append(" "); - } + } return result.toString(); } @@ -195,9 +192,9 @@ public class TaskImpl extends AbstractTask implements Task, LoadPlanable { public Day getStart() { Day result = (Day) solver.getData(TaskAttribute.START); - while (getLoadAt(result) == 0) { + while (getLoadAt(result) == 0) result = result.increment(); - } + return result; } @@ -246,12 +243,12 @@ public class TaskImpl extends AbstractTask implements Task, LoadPlanable { } public final CenterBorderColor getColors() { - if (colors == null) { + if (colors == null) return null; - } - if (colors.length == 1) { + + if (colors.length == 1) return colors[0]; - } + return colors[0].unlinearTo(colors[1], completion); } @@ -261,20 +258,19 @@ public class TaskImpl extends AbstractTask implements Task, LoadPlanable { public final Collection getAllPaused() { final SortedSet result = new TreeSet<>(pausedDay); - for (DayOfWeek dayOfWeek : pausedDayOfWeek) { + for (DayOfWeek dayOfWeek : pausedDayOfWeek) addAll(result, dayOfWeek); - } + return Collections.unmodifiableCollection(result); } private void addAll(SortedSet result, DayOfWeek dayOfWeek) { final Day start = getStart(); final Day end = getEnd(); - for (Day current = start; current.compareTo(end) <= 0; current = current.increment()) { - if (current.getDayOfWeek() == dayOfWeek) { + for (Day current = start; current.compareTo(end) <= 0; current = current.increment()) + if (current.getDayOfWeek() == dayOfWeek) result.add(current); - } - } + } public void setNote(Display note) { @@ -285,4 +281,8 @@ public class TaskImpl extends AbstractTask implements Task, LoadPlanable { return note; } + public LoadPlanable getDefaultPlan() { + return defaultPlan; + } + } diff --git a/src/net/sourceforge/plantuml/project/core/TaskInstant.java b/src/net/sourceforge/plantuml/project/core/TaskInstant.java index 88f472f75..7ce81eb11 100644 --- a/src/net/sourceforge/plantuml/project/core/TaskInstant.java +++ b/src/net/sourceforge/plantuml/project/core/TaskInstant.java @@ -35,6 +35,8 @@ */ package net.sourceforge.plantuml.project.core; +import net.sourceforge.plantuml.project.GanttConstraintMode; +import net.sourceforge.plantuml.project.LoadPlanable; import net.sourceforge.plantuml.project.time.Day; public class TaskInstant { @@ -42,55 +44,65 @@ public class TaskInstant { private final Moment task; private final TaskAttribute attribute; private final int delta; + private final GanttConstraintMode mode; + private final LoadPlanable calendar; public TaskInstant(Moment task, TaskAttribute attribute) { - this(task, attribute, 0); + this(task, attribute, 0, GanttConstraintMode.IGNORE_CALENDAR, null); } - private TaskInstant(Moment task, TaskAttribute attribute, int delta) { + private TaskInstant(Moment task, TaskAttribute attribute, int delta, GanttConstraintMode mode, + LoadPlanable calendar) { this.task = task; this.attribute = attribute; this.delta = delta; - if (attribute != TaskAttribute.START && attribute != TaskAttribute.END) { + this.mode = mode; + this.calendar = calendar; + if (attribute != TaskAttribute.START && attribute != TaskAttribute.END) throw new IllegalArgumentException(); - } + } - public TaskInstant withDelta(int newDelta) { - return new TaskInstant(task, attribute, newDelta); + public TaskInstant withDelta(int newDelta, GanttConstraintMode mode, LoadPlanable calendar) { + return new TaskInstant(task, attribute, newDelta, mode, calendar); } private Day manageDelta(Day value) { - if (delta > 0) { + if (delta > 0) for (int i = 0; i < delta; i++) { + if (mode == GanttConstraintMode.DO_NOT_COUNT_CLOSE_DAY) { + int tmp = 0; + while (calendar.getLoadAt(value) == 0 && tmp++ < 1000) + value = value.increment(); + } + value = value.increment(); } - } - if (delta < 0) { - for (int i = 0; i < -delta; i++) { + + if (delta < 0) + for (int i = 0; i < -delta; i++) value = value.decrement(); - } - } + return value; } public Day getInstantPrecise() { - if (attribute == TaskAttribute.START) { + if (attribute == TaskAttribute.START) return manageDelta(task.getStart()); - } - if (attribute == TaskAttribute.END) { + + if (attribute == TaskAttribute.END) return manageDelta(task.getEnd().increment()); - } + throw new IllegalStateException(); } public Day getInstantTheorical() { - if (attribute == TaskAttribute.START) { + if (attribute == TaskAttribute.START) return manageDelta(task.getStart()); - } - if (attribute == TaskAttribute.END) { + + if (attribute == TaskAttribute.END) return manageDelta(task.getEnd()); - } + throw new IllegalStateException(); } @@ -115,9 +127,9 @@ public class TaskInstant { if (this.isTask() && dest.isTask()) { final AbstractTask t1 = (AbstractTask) this.getMoment(); final AbstractTask t2 = (AbstractTask) dest.getMoment(); - if (t1 == t2.getRow() || t2 == t1.getRow()) { + if (t1 == t2.getRow() || t2 == t1.getRow()) return true; - } + } return false; } diff --git a/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java b/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java index d5dd31dd3..f23fe7365 100644 --- a/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java +++ b/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java @@ -35,10 +35,9 @@ */ package net.sourceforge.plantuml.project.draw; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.SpriteContainerEmpty; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.StringBounder; @@ -142,15 +141,13 @@ public class TaskDrawDiamond extends AbstractTaskDraw { final double width = getShapeHeight(ug.getStringBounder()); final double delta = x2 - x1 - width; - if (url != null) { + if (url != null) ug.startUrl(url); - } drawShape(applyColors(ug).apply(UTranslate.dx(x1 + delta / 2))); - if (url != null) { + if (url != null) ug.closeUrl(); - } } private UGraphic applyColors(UGraphic ug) { diff --git a/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java b/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java index 3fed1f782..1720822be 100644 --- a/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java +++ b/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.project.draw; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.util.ArrayList; import java.util.Collection; import java.util.TreeSet; @@ -43,6 +42,7 @@ import java.util.TreeSet; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.SpriteContainerEmpty; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Sheet; @@ -69,17 +69,11 @@ import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; import net.sourceforge.plantuml.style.StyleSignatureBasic; -import net.sourceforge.plantuml.style.Value; import net.sourceforge.plantuml.svek.image.Opale; import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.ULine; -import net.sourceforge.plantuml.ugraphic.URectangle; -import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.color.HColor; -import net.sourceforge.plantuml.ugraphic.color.HColorNone; import net.sourceforge.plantuml.ugraphic.color.HColorSet; -import net.sourceforge.plantuml.ugraphic.color.HColorUtils; public class TaskDrawRegular extends AbstractTaskDraw { @@ -90,8 +84,6 @@ public class TaskDrawRegular extends AbstractTaskDraw { private final Collection constraints; private final ISkinParam skinParam; - // private final double margin = 2; - public TaskDrawRegular(TimeScale timeScale, Real y, String prettyDisplay, Day start, Day end, boolean oddStart, boolean oddEnd, ISkinParam skinParam, Task task, ToTaskDraw toTaskDraw, Collection constraints, StyleBuilder styleBuilder, HColorSet colorSet) { @@ -103,10 +95,9 @@ public class TaskDrawRegular extends AbstractTaskDraw { this.oddEnd = oddEnd; this.paused = new TreeSet<>(((TaskImpl) task).getAllPaused()); for (Day tmp = start; tmp.compareTo(end) <= 0; tmp = tmp.increment()) { - final int load = toTaskDraw.getDefaultPlan().getLoadAt(tmp); - if (load == 0) { + final int load = ((TaskImpl) task).getDefaultPlan().getLoadAt(tmp); + if (load == 0) this.paused.add(tmp); - } } } @@ -158,18 +149,17 @@ public class TaskDrawRegular extends AbstractTaskDraw { } private double getOutPosition(double pos2) { - if (isThereRightArrow()) { + if (isThereRightArrow()) return pos2 + 18; - } + return pos2 + 8; } private boolean isThereRightArrow() { - for (GanttConstraint constraint : constraints) { - if (constraint.isThereRightArrow(getTask())) { + for (GanttConstraint constraint : constraints) + if (constraint.isThereRightArrow(getTask())) return true; - } - } + return false; } @@ -193,17 +183,17 @@ public class TaskDrawRegular extends AbstractTaskDraw { } private void drawNote(UGraphic ug) { - if (note == null) { + if (note == null) return; - } + getOpaleNote().drawU(ug); } public double getHeightMax(StringBounder stringBounder) { - if (note == null) { + if (note == null) return getFullHeightTask(stringBounder); - } + return getYNotePosition(stringBounder) + getOpaleNote().calculateDimension(stringBounder).getHeight(); } @@ -234,9 +224,9 @@ public class TaskDrawRegular extends AbstractTaskDraw { } public FingerPrint getFingerPrintNote(StringBounder stringBounder) { - if (note == null) { + if (note == null) return null; - } + final Dimension2D dim = getOpaleNote().calculateDimension(stringBounder); final double startPos = timeScale.getStartingPosition(start); // final double endPos = timeScale.getEndingPosition(end); @@ -246,9 +236,9 @@ public class TaskDrawRegular extends AbstractTaskDraw { private UGraphic applyColors(UGraphic ug) { final CenterBorderColor col = this.getColors(); - if (col != null && col.isOk()) { + if (col != null && col.isOk()) return col.apply(ug); - } + return ug.apply(getLineColor()).apply(getBackgroundColor().bg()); } @@ -275,9 +265,8 @@ public class TaskDrawRegular extends AbstractTaskDraw { final double startPos = timeScale.getStartingPosition(start) + margin.getLeft(); final double endPos = timeScale.getEndingPosition(end) - margin.getRight(); - if (url != null) { + if (url != null) ug.startUrl(url); - } ug = ug.apply(UTranslate.dy(margin.getTop())); @@ -300,87 +289,9 @@ public class TaskDrawRegular extends AbstractTaskDraw { rectangleTask.draw(ug, getShapeHeight(stringBounder), backUndone, oddStart, oddEnd); - if (url != null) { + if (url != null) ug.closeUrl(); - } } - private void drawShapeOld(UGraphic ug) { - final Style style = getStyleSignature().getMergedStyle(getStyleBuilder()); - final ClockwiseTopRightBottomLeft margin = style.getMargin(); - - final double startPos = timeScale.getStartingPosition(start) + margin.getLeft(); - final double endPos = timeScale.getEndingPosition(end) - margin.getRight(); - - double fullLength = endPos - startPos; - if (fullLength < 3) { - fullLength = 3; - } - if (url != null) { - ug.startUrl(url); - } - - ug = ug.apply(UTranslate.dy(margin.getTop())); - - final StringBounder stringBounder = ug.getStringBounder(); - - final double round = style.value(PName.RoundCorner).asDouble(); - - if (oddStart && !oddEnd) { - ug.apply(UTranslate.dx(startPos)) - .draw(PathUtils.UtoRight(fullLength, getShapeHeight(stringBounder), round)); - } else if (!oddStart && oddEnd) { - ug.apply(UTranslate.dx(startPos)).draw(PathUtils.UtoLeft(fullLength, getShapeHeight(stringBounder), round)); - } else { - final URectangle full = new URectangle(fullLength, getShapeHeight(stringBounder)).rounded(round); - if (getCompletion() == 100) { - ug.apply(UTranslate.dx(startPos)).draw(full); - } else { - final double partialLength = fullLength * getCompletion() / 100.; - ug.apply(UTranslate.dx(startPos)).apply(HColorUtils.WHITE).apply(HColorUtils.WHITE.bg()).draw(full); - if (partialLength > 2) { - final URectangle partial = new URectangle(partialLength, getShapeHeight(stringBounder)) - .rounded(round); - ug.apply(UTranslate.dx(startPos)).apply(new HColorNone()).draw(partial); - } - if (partialLength > 10 && partialLength < fullLength - 10) { - final URectangle patch = new URectangle(round, getShapeHeight(stringBounder)); - ug.apply(UTranslate.dx(startPos)).apply(new HColorNone()) - .apply(UTranslate.dx(partialLength - round)).draw(patch); - } - ug.apply(UTranslate.dx(startPos)).apply(new HColorNone().bg()).draw(full); - } - } - if (url != null) { - ug.closeUrl(); - } - Day begin = null; - for (Day pause : paused) { - if (paused.contains(pause.increment())) { - if (begin == null) - begin = pause; - } else { - if (begin == null) - drawPause(ug, pause, pause); - else - drawPause(ug, begin, pause); - begin = null; - } - } - } - - private void drawPause(UGraphic ug, Day start1, Day end) { - final double x1 = timeScale.getStartingPosition(start1); - final double x2 = timeScale.getEndingPosition(end); - final StringBounder stringBounder = ug.getStringBounder(); - final URectangle small = new URectangle(x2 - x1 - 1, getShapeHeight(stringBounder) + 1); - final ULine line = ULine.hline(x2 - x1 - 1); - ug = ug.apply(UTranslate.dx(x1 - 1)); - ug.apply(HColorUtils.WHITE).apply(HColorUtils.WHITE.bg()).draw(small); - final UGraphic ugLine = ug.apply(new UStroke(2, 3, 1)); - ugLine.draw(line); - ugLine.apply(UTranslate.dy(getShapeHeight(stringBounder))).draw(line); - } - } diff --git a/src/net/sourceforge/plantuml/project/lang/ComplementBeforeOrAfterOrAtTaskStartOrEnd.java b/src/net/sourceforge/plantuml/project/lang/ComplementBeforeOrAfterOrAtTaskStartOrEnd.java index 30427a9a8..c80f13ad0 100644 --- a/src/net/sourceforge/plantuml/project/lang/ComplementBeforeOrAfterOrAtTaskStartOrEnd.java +++ b/src/net/sourceforge/plantuml/project/lang/ComplementBeforeOrAfterOrAtTaskStartOrEnd.java @@ -39,6 +39,7 @@ 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.Failable; +import net.sourceforge.plantuml.project.GanttConstraintMode; import net.sourceforge.plantuml.project.GanttDiagram; import net.sourceforge.plantuml.project.core.Moment; import net.sourceforge.plantuml.project.core.TaskAttribute; @@ -65,9 +66,9 @@ public class ComplementBeforeOrAfterOrAtTaskStartOrEnd implements Something { final String code = arg.get("COMPLEMENT" + suffix, POS_CODE_OTHER); final String startOrEnd = arg.get("COMPLEMENT" + suffix, POS_START_OR_END); final Moment task = system.getExistingMoment(code); - if (task == null) { + if (task == null) return Failable.error("No such task " + code); - } + TaskInstant result = new TaskInstant(task, TaskAttribute.fromString(startOrEnd)); final String nb1 = arg.get("COMPLEMENT" + suffix, POS_NB1); if (nb1 != null) { @@ -85,10 +86,12 @@ public class ComplementBeforeOrAfterOrAtTaskStartOrEnd implements Something { } int delta = days1 + days2; - if ("before".equalsIgnoreCase(arg.get("COMPLEMENT" + suffix, POS_BEFORE_OR_AFTER))) { + if ("before".equalsIgnoreCase(arg.get("COMPLEMENT" + suffix, POS_BEFORE_OR_AFTER))) delta = -delta; - } - result = result.withDelta(delta); + + final GanttConstraintMode mode = GanttConstraintMode.IGNORE_CALENDAR; + + result = result.withDelta(delta, mode, system.getDefaultPlan()); } return Failable.ok(result); } diff --git a/src/net/sourceforge/plantuml/project/lang/ComplementClose.java b/src/net/sourceforge/plantuml/project/lang/ComplementClose.java index 6764777ee..0a7952b32 100644 --- a/src/net/sourceforge/plantuml/project/lang/ComplementClose.java +++ b/src/net/sourceforge/plantuml/project/lang/ComplementClose.java @@ -44,10 +44,17 @@ import net.sourceforge.plantuml.project.GanttDiagram; public class ComplementClose implements Something { public IRegex toRegex(String suffix) { - return new RegexLeaf("CLOSED" + suffix, "(closed?)"); + return new RegexLeaf("CLOSED" + suffix, "(closed?(?: for \\[([^\\[\\]]+?)\\])?)"); } - public Failable getMe(GanttDiagram project, RegexResult arg, String suffix) { - return Failable.ok(new Object()); + public Failable getMe(GanttDiagram project, RegexResult arg, String suffix) { + final String value = arg.get("CLOSED" + suffix, 0); + final int x = value.indexOf('['); + if (x > 0) { + final int y = value.lastIndexOf(']'); + final String s = value.substring(x + 1, y); + return Failable.ok(s); + } + return Failable.ok(""); } } diff --git a/src/net/sourceforge/plantuml/project/lang/ComplementOpen.java b/src/net/sourceforge/plantuml/project/lang/ComplementOpen.java index 68e91a667..8cdb22a5f 100644 --- a/src/net/sourceforge/plantuml/project/lang/ComplementOpen.java +++ b/src/net/sourceforge/plantuml/project/lang/ComplementOpen.java @@ -44,11 +44,18 @@ import net.sourceforge.plantuml.project.GanttDiagram; public class ComplementOpen implements Something { public IRegex toRegex(String suffix) { - return new RegexLeaf("OPEN" + suffix, "(opene?d?)"); + return new RegexLeaf("OPEN" + suffix, "(opene?d?(?: for \\[([^\\[\\]]+?)\\])?)"); } - public Failable getMe(GanttDiagram project, RegexResult arg, String suffix) { - return Failable.ok(new Object()); + public Failable getMe(GanttDiagram project, RegexResult arg, String suffix) { + final String value = arg.get("OPEN" + suffix, 0); + final int x = value.indexOf('['); + if (x > 0) { + final int y = value.lastIndexOf(']'); + final String s = value.substring(x + 1, y); + return Failable.ok(s); + } + return Failable.ok(""); } } diff --git a/src/net/sourceforge/plantuml/project/lang/SubjectDayAsDate.java b/src/net/sourceforge/plantuml/project/lang/SubjectDayAsDate.java index 11699a58a..00d175c69 100644 --- a/src/net/sourceforge/plantuml/project/lang/SubjectDayAsDate.java +++ b/src/net/sourceforge/plantuml/project/lang/SubjectDayAsDate.java @@ -86,7 +86,7 @@ public class SubjectDayAsDate implements Subject { @Override public CommandExecutionResult execute(GanttDiagram project, Object subject, Object complement) { - project.closeDayAsDate((Day) subject); + project.closeDayAsDate((Day) subject, (String) complement); return CommandExecutionResult.ok(); } } @@ -98,7 +98,7 @@ public class SubjectDayAsDate implements Subject { @Override public CommandExecutionResult execute(GanttDiagram project, Object subject, Object complement) { - project.openDayAsDate((Day) subject); + project.openDayAsDate((Day) subject, (String) complement); return CommandExecutionResult.ok(); } } diff --git a/src/net/sourceforge/plantuml/project/lang/SubjectDaysAsDates.java b/src/net/sourceforge/plantuml/project/lang/SubjectDaysAsDates.java index 0a118db13..88f6a177d 100644 --- a/src/net/sourceforge/plantuml/project/lang/SubjectDaysAsDates.java +++ b/src/net/sourceforge/plantuml/project/lang/SubjectDaysAsDates.java @@ -158,9 +158,9 @@ public class SubjectDaysAsDates implements Subject { @Override public CommandExecutionResult execute(GanttDiagram project, Object subject, Object complement) { - for (Day d : (DaysAsDates) subject) { - project.closeDayAsDate(d); - } + for (Day d : (DaysAsDates) subject) + project.closeDayAsDate(d, (String) complement); + return CommandExecutionResult.ok(); } @@ -174,9 +174,9 @@ public class SubjectDaysAsDates implements Subject { @Override public CommandExecutionResult execute(GanttDiagram project, Object subject, Object complement) { - for (Day d : (DaysAsDates) subject) { - project.openDayAsDate(d); - } + for (Day d : (DaysAsDates) subject) + project.openDayAsDate(d, (String) complement); + return CommandExecutionResult.ok(); } @@ -192,9 +192,9 @@ public class SubjectDaysAsDates implements Subject { @Override public CommandExecutionResult execute(GanttDiagram project, Object subject, Object complement) { final HColor color = ((CenterBorderColor) complement).getCenter(); - for (Day d : (DaysAsDates) subject) { + for (Day d : (DaysAsDates) subject) project.colorDay(d, color); - } + return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/project/solver/Solver3.java b/src/net/sourceforge/plantuml/project/solver/Solver3.java index 8df72b2fc..82d901f03 100644 --- a/src/net/sourceforge/plantuml/project/solver/Solver3.java +++ b/src/net/sourceforge/plantuml/project/solver/Solver3.java @@ -62,9 +62,9 @@ public class Solver3 extends AbstractSolver { final long tmpWorkLoad = workLoad.getValueAt(currentTime); final long nextChange = workLoad.getNext(currentTime); final long duration = nextChange - currentTime; - if (duration <= 0) { + if (duration <= 0) throw new IllegalArgumentException(); - } + final long partialLoad = duration * tmpWorkLoad; resultLoad.put(currentTime, tmpWorkLoad); diff --git a/src/net/sourceforge/plantuml/project/solver/SolverImpl.java b/src/net/sourceforge/plantuml/project/solver/SolverImpl.java index e85e6c115..a25317940 100644 --- a/src/net/sourceforge/plantuml/project/solver/SolverImpl.java +++ b/src/net/sourceforge/plantuml/project/solver/SolverImpl.java @@ -57,9 +57,9 @@ public class SolverImpl extends AbstractSolver implements Solver { fullLoad -= loadPlanable.getLoadAt(current); current = current.increment(); cpt++; - if (cpt > 100000) { + if (cpt > 100000) throw new IllegalStateException(); - } + } return current.decrement(); } @@ -72,13 +72,13 @@ public class SolverImpl extends AbstractSolver implements Solver { while (fullLoad > 0) { fullLoad -= loadPlanable.getLoadAt(current); current = current.decrement(); - if (current.getMillis() <= 0) { + if (current.getMillis() <= 0) return current; - } + cpt++; - if (cpt > 100000) { + if (cpt > 100000) throw new IllegalStateException(); - } + } return current.increment(); } diff --git a/src/net/sourceforge/plantuml/real/PositiveForce.java b/src/net/sourceforge/plantuml/real/PositiveForce.java index 49e9a7c27..505ed1d2b 100644 --- a/src/net/sourceforge/plantuml/real/PositiveForce.java +++ b/src/net/sourceforge/plantuml/real/PositiveForce.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,12 +30,12 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.real; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; class PositiveForce { @@ -70,11 +70,10 @@ class PositiveForce { try { fixedPointValue = fixedPoint.getCurrentValue(); } catch (IllegalStateException e) { - Logger.error("Pb with force " + this); - Logger.error("Pb with force " + this); - Logger.error("This force has been created here:"); - Logger.error(creationPoint); - Logger.error("The fixed point has been created here: " + fixedPoint); + System.err.println("Pb with force " + this); + System.err.println("This force has been created here:"); + Logme.error(creationPoint); + System.err.println("The fixed point has been created here: " + fixedPoint); fixedPoint.printCreationStackTrace(); throw e; } diff --git a/src/net/sourceforge/plantuml/real/RealMax.java b/src/net/sourceforge/plantuml/real/RealMax.java index 7f16f39e7..660dd1bbb 100644 --- a/src/net/sourceforge/plantuml/real/RealMax.java +++ b/src/net/sourceforge/plantuml/real/RealMax.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,17 +30,17 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.real; -import net.sourceforge.plantuml.log.Logger; - import java.util.ArrayList; import java.util.Collection; import java.util.List; +import net.sourceforge.plantuml.log.Logme; + class RealMax extends AbstractReal implements Real { private final List all = new ArrayList<>(); @@ -95,7 +95,7 @@ class RealMax extends AbstractReal implements Real { } public void printCreationStackTrace() { - Logger.error(creationPoint); + Logme.error(creationPoint); } } diff --git a/src/net/sourceforge/plantuml/real/RealMoveable.java b/src/net/sourceforge/plantuml/real/RealMoveable.java index acb1a69ae..a5bf7e86b 100644 --- a/src/net/sourceforge/plantuml/real/RealMoveable.java +++ b/src/net/sourceforge/plantuml/real/RealMoveable.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,15 +30,15 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.real; -import net.sourceforge.plantuml.log.Logger; - import java.util.concurrent.atomic.AtomicInteger; +import net.sourceforge.plantuml.log.Logme; + abstract class RealMoveable extends AbstractReal implements Real { public static final AtomicInteger CPT = new AtomicInteger(); @@ -56,7 +56,7 @@ abstract class RealMoveable extends AbstractReal implements Real { abstract void move(double delta); final public void printCreationStackTrace() { - Logger.error(creationPoint); + Logme.error(creationPoint); } final public Real addFixed(double delta) { diff --git a/src/net/sourceforge/plantuml/salt/PSystemSalt.java b/src/net/sourceforge/plantuml/salt/PSystemSalt.java index fda90abad..0df568bbe 100644 --- a/src/net/sourceforge/plantuml/salt/PSystemSalt.java +++ b/src/net/sourceforge/plantuml/salt/PSystemSalt.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,12 +30,11 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.salt; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Rectangle2D; import java.io.IOException; import java.io.OutputStream; @@ -54,6 +53,7 @@ import net.sourceforge.plantuml.UmlDiagramType; import net.sourceforge.plantuml.WithSprite; import net.sourceforge.plantuml.api.ImageDataSimple; import net.sourceforge.plantuml.api.ThemeStyle; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.command.BlocLines; import net.sourceforge.plantuml.command.Command; import net.sourceforge.plantuml.command.CommandExecutionResult; @@ -63,7 +63,7 @@ import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.graphic.InnerStrategy; import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.salt.element.Element; import net.sourceforge.plantuml.salt.factory.AbstractElementFactoryComplex; import net.sourceforge.plantuml.salt.factory.ElementFactory; @@ -121,7 +121,7 @@ public class PSystemSalt extends TitledDiagram implements WithSprite { final Dimension2D size = salt.getPreferredDimension(stringBounder, 0, 0); return createImageBuilder(fileFormatOption).drawable(getTextBlock(salt, size)).write(os); } catch (Exception e) { - Logger.error(e); + Logme.error(e); UmlDiagram.exportDiagramError(os, e, fileFormatOption, seed(), getMetadata(), "none", new ArrayList()); return ImageDataSimple.error(); diff --git a/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java b/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java index 883db3d5f..6fbe1e270 100644 --- a/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java +++ b/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.sdot; @@ -88,7 +88,7 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.USymbol; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.svek.Bibliotekon; @@ -599,7 +599,7 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker { } static private List getFailureText3(Throwable exception) { - Logger.error(exception); + Logme.error(exception); final List strings = new ArrayList<>(); strings.add("An error has occured : " + exception); final String quote = StringUtils.rot(QuoteUtils.getSomeQuote()); diff --git a/src/net/sourceforge/plantuml/security/SFile.java b/src/net/sourceforge/plantuml/security/SFile.java index 1f1bcd2db..0a96a9208 100644 --- a/src/net/sourceforge/plantuml/security/SFile.java +++ b/src/net/sourceforge/plantuml/security/SFile.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,13 +30,11 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.security; -import net.sourceforge.plantuml.log.Logger; - import java.awt.image.BufferedImage; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; @@ -62,6 +60,8 @@ import java.util.List; import javax.swing.ImageIcon; +import net.sourceforge.plantuml.log.Logme; + /** * Secure replacement for java.io.File. *

@@ -221,7 +221,7 @@ public class SFile implements Comparable { try { return internal.getCanonicalPath(); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } return ""; @@ -350,7 +350,7 @@ public class SFile implements Comparable { try { return SecurityUtils.readRasterImage(new ImageIcon(this.getAbsolutePath())); } catch (Exception e) { - Logger.error(e); + Logme.error(e); } return null; } @@ -360,7 +360,7 @@ public class SFile implements Comparable { try { return new BufferedReader(new FileReader(internal)); } catch (FileNotFoundException e) { - Logger.error(e); + Logme.error(e); } } return null; @@ -375,7 +375,7 @@ public class SFile implements Comparable { try { return new BufferedInputStream(new FileInputStream(internal)); } catch (FileNotFoundException e) { - Logger.error(e); + Logme.error(e); } return null; } diff --git a/src/net/sourceforge/plantuml/security/SURL.java b/src/net/sourceforge/plantuml/security/SURL.java index e9fa566cc..0aca9d457 100644 --- a/src/net/sourceforge/plantuml/security/SURL.java +++ b/src/net/sourceforge/plantuml/security/SURL.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.security; @@ -68,7 +68,7 @@ import javax.net.ssl.HttpsURLConnection; import javax.swing.ImageIcon; import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.authentication.SecurityAccessInterceptor; import net.sourceforge.plantuml.security.authentication.SecurityAuthentication; import net.sourceforge.plantuml.security.authentication.SecurityCredentials; @@ -84,11 +84,11 @@ import net.sourceforge.plantuml.security.authentication.SecurityCredentials; * host. *

* Example:
- * + * *

  *     SURL url = SURL.create ("https://jenkins-access@jenkins.mycompany.com/api/json")
  * 
- * + * * The {@code jenkins-access} will checked against the Security context access * token configuration. If a configuration exists for this token name, the token * will be removed from the URL and the credentials will be added to the @@ -143,7 +143,7 @@ public class SURL { *

* The url must be http or https. Return null in case of error or if * url is null - * + * * @param url plain url starting by http:// or https// * @return the secure URL or null */ @@ -155,7 +155,7 @@ public class SURL { try { return create(new URL(url)); } catch (MalformedURLException e) { - Logger.error(e); + Logme.error(e); } return null; } @@ -164,7 +164,7 @@ public class SURL { * Create a secure URL from a java.net.URL object. *

* It takes into account credentials. - * + * * @param url * @return the secure URL * @throws MalformedURLException if url is null @@ -400,7 +400,7 @@ public class SURL { /** * Creates a GET request and response handler - * + * * @param url URL to request * @param proxy proxy to apply * @param authentication the authentication to use @@ -444,7 +444,7 @@ public class SURL { * content will be identified as form or JSON data. The charset encoding can be * set by header parameters or will be set to UTF-8. The method to some fancy * logic to simplify it for the user. - * + * * @param url URL to request via POST method * @param proxy proxy to apply * @param authentication the authentication to use @@ -489,7 +489,7 @@ public class SURL { try { return Charset.forName(matcher.group(1)); } catch (Exception e) { - Logger.error(e); + Logme.error(e); } return null; @@ -520,7 +520,7 @@ public class SURL { /** * Reads data in a byte[] array. - * + * * @param input input stream * @return byte data * @throws IOException if something went wrong @@ -538,7 +538,7 @@ public class SURL { /** * Sends a request content payload to an endpoint. - * + * * @param connection HTTP connection * @param data data as byte array * @throws IOException if something went wrong @@ -569,7 +569,7 @@ public class SURL { final ImageIcon tmp = new ImageIcon(bytes); return SecurityUtils.readRasterImage(tmp); } catch (Exception e) { - Logger.error(e); + Logme.error(e); } return null; } @@ -610,7 +610,7 @@ public class SURL { /** * Set the headers for a URL connection - * + * * @param headers map Keys with values (can be String or list of String) */ private static void applyAdditionalHeaders(URLConnection http, Map headers) { @@ -632,7 +632,7 @@ public class SURL { /** * Removes the userInfo part from the URL, because we want to use the * SecurityCredentials instead. - * + * * @param url URL with UserInfo part * @return url without UserInfo part * @throws MalformedURLException @@ -644,7 +644,7 @@ public class SURL { /** * Removes the userInfo part from the URL, because we want to use the * SecurityCredentials instead. - * + * * @param url URL with UserInfo part * @return url without UserInfo part */ diff --git a/src/net/sourceforge/plantuml/security/SecurityUtils.java b/src/net/sourceforge/plantuml/security/SecurityUtils.java index 5ed09faa9..0310a0dc0 100644 --- a/src/net/sourceforge/plantuml/security/SecurityUtils.java +++ b/src/net/sourceforge/plantuml/security/SecurityUtils.java @@ -61,7 +61,7 @@ import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.json.Json; import net.sourceforge.plantuml.json.JsonValue; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.authentication.SecurityAccessInterceptor; import net.sourceforge.plantuml.security.authentication.SecurityAuthentication; import net.sourceforge.plantuml.security.authentication.SecurityAuthorizeManager; @@ -97,7 +97,7 @@ public class SecurityUtils { * Whitelist of paths from where scripts can load data. */ public static final String ALLOWLIST_LOCAL_PATHS = "plantuml.allowlist.path"; - + /** * Whitelist of urls */ @@ -427,7 +427,7 @@ public class SecurityUtils { try (Reader r = new BufferedReader(new FileReader(jsonFile))) { return Json.parse(r); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } return Json.object(); diff --git a/src/net/sourceforge/plantuml/security/authentication/oauth/AbstractOAuth2AccessAuthorizeManager.java b/src/net/sourceforge/plantuml/security/authentication/oauth/AbstractOAuth2AccessAuthorizeManager.java index a5e57c2b6..cb2b4f501 100644 --- a/src/net/sourceforge/plantuml/security/authentication/oauth/AbstractOAuth2AccessAuthorizeManager.java +++ b/src/net/sourceforge/plantuml/security/authentication/oauth/AbstractOAuth2AccessAuthorizeManager.java @@ -35,14 +35,6 @@ */ package net.sourceforge.plantuml.security.authentication.oauth; -import net.sourceforge.plantuml.json.Json; -import net.sourceforge.plantuml.json.JsonObject; -import net.sourceforge.plantuml.json.JsonValue; -import net.sourceforge.plantuml.log.Logger; -import net.sourceforge.plantuml.security.SURL; -import net.sourceforge.plantuml.security.authentication.SecurityAuthentication; -import net.sourceforge.plantuml.security.authentication.SecurityAuthorizeManager; - import java.io.UnsupportedEncodingException; import java.net.Proxy; import java.net.URLEncoder; @@ -50,6 +42,14 @@ import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; +import net.sourceforge.plantuml.json.Json; +import net.sourceforge.plantuml.json.JsonObject; +import net.sourceforge.plantuml.json.JsonValue; +import net.sourceforge.plantuml.log.Logme; +import net.sourceforge.plantuml.security.SURL; +import net.sourceforge.plantuml.security.authentication.SecurityAuthentication; +import net.sourceforge.plantuml.security.authentication.SecurityAuthorizeManager; + /** * Default abstract OAuth2 AccessAuthorizeManager for OAuth2 managers. * @@ -134,7 +134,7 @@ public abstract class AbstractOAuth2AccessAuthorizeManager implements SecurityAu try { return URLEncoder.encode(data, "UTF-8"); } catch (UnsupportedEncodingException e) { - Logger.error(e); + Logme.error(e); return data; } } diff --git a/src/net/sourceforge/plantuml/security/authentication/oauth/OAuth2AccessInterceptor.java b/src/net/sourceforge/plantuml/security/authentication/oauth/OAuth2AccessInterceptor.java index 52441bad9..1878d2729 100644 --- a/src/net/sourceforge/plantuml/security/authentication/oauth/OAuth2AccessInterceptor.java +++ b/src/net/sourceforge/plantuml/security/authentication/oauth/OAuth2AccessInterceptor.java @@ -35,12 +35,12 @@ */ package net.sourceforge.plantuml.security.authentication.oauth; +import java.net.URLConnection; + import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.security.authentication.SecurityAccessInterceptor; import net.sourceforge.plantuml.security.authentication.SecurityAuthentication; -import java.net.URLConnection; - /** * Applies from {@link SecurityAuthentication} data an OAuth2 Authorization access header. * diff --git a/src/net/sourceforge/plantuml/security/authentication/oauth/OAuth2ClientAccessAuthorizeManager.java b/src/net/sourceforge/plantuml/security/authentication/oauth/OAuth2ClientAccessAuthorizeManager.java index 715af3831..2dc842eb2 100644 --- a/src/net/sourceforge/plantuml/security/authentication/oauth/OAuth2ClientAccessAuthorizeManager.java +++ b/src/net/sourceforge/plantuml/security/authentication/oauth/OAuth2ClientAccessAuthorizeManager.java @@ -35,14 +35,14 @@ */ package net.sourceforge.plantuml.security.authentication.oauth; +import java.util.Arrays; + import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.security.SURL; import net.sourceforge.plantuml.security.authentication.SecurityAuthentication; import net.sourceforge.plantuml.security.authentication.SecurityCredentials; import net.sourceforge.plantuml.security.authentication.basicauth.BasicAuthAuthorizeManager; -import java.util.Arrays; - /** * Authorize the principal (from {@link SecurityCredentials} and creates a {@link SecurityAuthentication} object with a * bearer token secret. diff --git a/src/net/sourceforge/plantuml/security/authentication/oauth/OAuth2ResourceOwnerAccessAuthorizeManager.java b/src/net/sourceforge/plantuml/security/authentication/oauth/OAuth2ResourceOwnerAccessAuthorizeManager.java index 8e45bc37c..297ae4bc1 100644 --- a/src/net/sourceforge/plantuml/security/authentication/oauth/OAuth2ResourceOwnerAccessAuthorizeManager.java +++ b/src/net/sourceforge/plantuml/security/authentication/oauth/OAuth2ResourceOwnerAccessAuthorizeManager.java @@ -35,14 +35,14 @@ */ package net.sourceforge.plantuml.security.authentication.oauth; +import java.util.Arrays; + import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.security.SURL; import net.sourceforge.plantuml.security.authentication.SecurityAuthentication; import net.sourceforge.plantuml.security.authentication.SecurityCredentials; import net.sourceforge.plantuml.security.authentication.basicauth.BasicAuthAuthorizeManager; -import java.util.Arrays; - /** * Authorize via principal a resource owner (from {@link SecurityCredentials} and creates a * {@link SecurityAuthentication} object with a bearer token secret. diff --git a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java index 797c0204f..94783291f 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java +++ b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -64,7 +64,7 @@ import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.EntityPortion; import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.graphic.SymbolContext; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.sequencediagram.graphic.FileMaker; import net.sourceforge.plantuml.sequencediagram.graphic.SequenceDiagramFileMakerPuma2; import net.sourceforge.plantuml.sequencediagram.graphic.SequenceDiagramTxtMaker; @@ -445,7 +445,7 @@ public class SequenceDiagram extends UmlDiagram { // The DEBUG StringBounder is ok just to compute the number of pages here. return getSequenceDiagramPngMaker(1, new FileFormatOption(FileFormat.DEBUG)).getNbPages(); } catch (Throwable t) { - Logger.error(t); + Logme.error(t); return 1; } } diff --git a/src/net/sourceforge/plantuml/skin/rose/Rose.java b/src/net/sourceforge/plantuml/skin/rose/Rose.java index 51071b281..fda8cc97c 100644 --- a/src/net/sourceforge/plantuml/skin/rose/Rose.java +++ b/src/net/sourceforge/plantuml/skin/rose/Rose.java @@ -62,10 +62,6 @@ public class Rose { final private double paddingX = 5; final public static double paddingY = 5; - public HColor getFontColor(ISkinParam skin, FontParam fontParam) { - return skin.getFontHtmlColor(null, fontParam); - } - public HColor getHtmlColor(ISkinParam skin, ColorParam color) { return getHtmlColor(skin, null, color); } diff --git a/src/net/sourceforge/plantuml/sprite/ListSpriteDiagram.java b/src/net/sourceforge/plantuml/sprite/ListSpriteDiagram.java index 13d6a5f7b..fa31c6bf5 100644 --- a/src/net/sourceforge/plantuml/sprite/ListSpriteDiagram.java +++ b/src/net/sourceforge/plantuml/sprite/ListSpriteDiagram.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.sprite; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.io.IOException; import java.io.OutputStream; @@ -45,6 +44,7 @@ import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.UmlDiagram; import net.sourceforge.plantuml.UmlDiagramType; import net.sourceforge.plantuml.api.ThemeStyle; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.UmlSource; diff --git a/src/net/sourceforge/plantuml/sprite/RessourcesUtils.java b/src/net/sourceforge/plantuml/sprite/RessourcesUtils.java index b0ae67273..7d3125e1c 100644 --- a/src/net/sourceforge/plantuml/sprite/RessourcesUtils.java +++ b/src/net/sourceforge/plantuml/sprite/RessourcesUtils.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.sprite; @@ -48,7 +48,7 @@ import java.util.TreeSet; import java.util.jar.JarEntry; import java.util.jar.JarFile; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.version.Version; @@ -64,7 +64,7 @@ public class RessourcesUtils { try { return listEntry(new SFile(local.toURI())); } catch (URISyntaxException e) { - Logger.error(e); + Logme.error(e); return null; } } diff --git a/src/net/sourceforge/plantuml/sprite/SpriteColor.java b/src/net/sourceforge/plantuml/sprite/SpriteColor.java index f813acb41..1cea8b348 100644 --- a/src/net/sourceforge/plantuml/sprite/SpriteColor.java +++ b/src/net/sourceforge/plantuml/sprite/SpriteColor.java @@ -36,10 +36,10 @@ package net.sourceforge.plantuml.sprite; import java.awt.Color; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.image.BufferedImage; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; diff --git a/src/net/sourceforge/plantuml/sprite/SpriteGrayLevel.java b/src/net/sourceforge/plantuml/sprite/SpriteGrayLevel.java index 298f6d3a6..fcc0cd6de 100644 --- a/src/net/sourceforge/plantuml/sprite/SpriteGrayLevel.java +++ b/src/net/sourceforge/plantuml/sprite/SpriteGrayLevel.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.sprite; @@ -50,7 +50,7 @@ import net.sourceforge.plantuml.code.CompressionZopfliZlib; import net.sourceforge.plantuml.code.NoPlantumlCompressionException; import net.sourceforge.plantuml.code.PairInt; import net.sourceforge.plantuml.code.SpiralOnRectangle; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.ugraphic.color.ColorChangerMonochrome; public enum SpriteGrayLevel { @@ -297,7 +297,7 @@ public enum SpriteGrayLevel { } return result; } catch (NoPlantumlCompressionException e) { - Logger.error(e); + Logme.error(e); return null; } } diff --git a/src/net/sourceforge/plantuml/sprite/SpriteImage.java b/src/net/sourceforge/plantuml/sprite/SpriteImage.java index f87aea07c..15e579b2d 100644 --- a/src/net/sourceforge/plantuml/sprite/SpriteImage.java +++ b/src/net/sourceforge/plantuml/sprite/SpriteImage.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.sprite; @@ -45,7 +45,7 @@ import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.ugraphic.AffineTransformType; import net.sourceforge.plantuml.ugraphic.PixelImage; @@ -92,7 +92,7 @@ public class SpriteImage implements Sprite { try { return new SpriteImage(SImageIO.read(is)); } catch (IOException e) { - Logger.error(e); + Logme.error(e); return null; } diff --git a/src/net/sourceforge/plantuml/sprite/SpriteMonochrome.java b/src/net/sourceforge/plantuml/sprite/SpriteMonochrome.java index aaf1314aa..485655dcc 100644 --- a/src/net/sourceforge/plantuml/sprite/SpriteMonochrome.java +++ b/src/net/sourceforge/plantuml/sprite/SpriteMonochrome.java @@ -36,12 +36,12 @@ package net.sourceforge.plantuml.sprite; import java.awt.Color; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.image.BufferedImage; import java.io.IOException; import java.io.OutputStream; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; diff --git a/src/net/sourceforge/plantuml/sprite/SpriteSvg.java b/src/net/sourceforge/plantuml/sprite/SpriteSvg.java index 105cf13f7..54d546bf9 100644 --- a/src/net/sourceforge/plantuml/sprite/SpriteSvg.java +++ b/src/net/sourceforge/plantuml/sprite/SpriteSvg.java @@ -35,9 +35,8 @@ */ package net.sourceforge.plantuml.sprite; -import net.sourceforge.plantuml.awt.geom.Dimension2D; - import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; diff --git a/src/net/sourceforge/plantuml/sprite/StdlibDiagram.java b/src/net/sourceforge/plantuml/sprite/StdlibDiagram.java index 517695bad..a8f11f637 100644 --- a/src/net/sourceforge/plantuml/sprite/StdlibDiagram.java +++ b/src/net/sourceforge/plantuml/sprite/StdlibDiagram.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.sprite; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.io.IOException; import java.io.OutputStream; import java.util.List; @@ -47,6 +46,7 @@ import net.sourceforge.plantuml.UmlDiagram; import net.sourceforge.plantuml.UmlDiagramType; import net.sourceforge.plantuml.WithSprite; import net.sourceforge.plantuml.api.ThemeStyle; +import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.command.BlocLines; import net.sourceforge.plantuml.command.Command; import net.sourceforge.plantuml.command.CommandFactorySprite; @@ -60,7 +60,7 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlockUtils; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.preproc.Stdlib; import net.sourceforge.plantuml.ugraphic.ImageBuilder; import net.sourceforge.plantuml.ugraphic.UFont; @@ -102,7 +102,7 @@ public class StdlibDiagram extends UmlDiagram { try { drawInternal(ug); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } @@ -134,7 +134,7 @@ public class StdlibDiagram extends UmlDiagram { try { cmd.execute(this, bloc); } catch (NoSuchColorException e) { - Logger.error(e); + Logme.error(e); } // System.err.println("nb=" + nb); nb++; diff --git a/src/net/sourceforge/plantuml/stats/FormatCounter.java b/src/net/sourceforge/plantuml/stats/FormatCounter.java index caeaedc25..c508c9e03 100644 --- a/src/net/sourceforge/plantuml/stats/FormatCounter.java +++ b/src/net/sourceforge/plantuml/stats/FormatCounter.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -44,7 +44,7 @@ import java.util.prefs.Preferences; import net.sourceforge.plantuml.FileFormat; import net.sourceforge.plantuml.api.NumberAnalyzed; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.stats.api.StatsColumn; import net.sourceforge.plantuml.stats.api.StatsLine; import net.sourceforge.plantuml.stats.api.StatsTable; @@ -101,7 +101,7 @@ public class FormatCounter { data.put(format, value); } } catch (Exception e) { - Logger.error(e); + Logme.error(e); } } } diff --git a/src/net/sourceforge/plantuml/stats/HistoricalData.java b/src/net/sourceforge/plantuml/stats/HistoricalData.java index a04b1abf3..6ac30f634 100644 --- a/src/net/sourceforge/plantuml/stats/HistoricalData.java +++ b/src/net/sourceforge/plantuml/stats/HistoricalData.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -42,7 +42,7 @@ import java.util.List; import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.version.Version; public class HistoricalData { @@ -56,7 +56,7 @@ public class HistoricalData { try { historical.addAll(reload()); } catch (BackingStoreException e) { - Logger.error(e); + Logme.error(e); } Collections.sort(historical, getIdComparator()); } diff --git a/src/net/sourceforge/plantuml/stats/StatsUtils.java b/src/net/sourceforge/plantuml/stats/StatsUtils.java index e10c5ab7a..3504b1460 100644 --- a/src/net/sourceforge/plantuml/stats/StatsUtils.java +++ b/src/net/sourceforge/plantuml/stats/StatsUtils.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -44,6 +44,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.logging.Filter; import java.util.logging.LogRecord; +import java.util.logging.Logger; import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; @@ -51,7 +52,7 @@ import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; import net.sourceforge.plantuml.Log; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.security.SecurityUtils; import net.sourceforge.plantuml.stats.api.Stats; @@ -84,7 +85,7 @@ public class StatsUtils { static { try { // Logger.getLogger("java.util.prefs").setLevel(Level.OFF); - java.util.logging.Logger.getLogger("java.util.prefs").setFilter(new Filter() { + Logger.getLogger("java.util.prefs").setFilter(new Filter() { public boolean isLoggable(LogRecord record) { final String message = record.getMessage(); System.err.println("SPECIAL TRACE FOR PLANTUML: " + message); @@ -92,13 +93,13 @@ public class StatsUtils { } }); } catch (Exception e) { - Logger.error(e); + Logme.error(e); } if (prefs.getInt("VERSION", 0) != VERSION) { try { prefs.clear(); } catch (BackingStoreException e1) { - Logger.error(e1); + Logme.error(e1); } prefs.putInt("VERSION", VERSION); } @@ -154,7 +155,7 @@ public class StatsUtils { htmlOutput(stats); } } catch (Exception e) { - Logger.error(e); + Logme.error(e); } } @@ -171,8 +172,7 @@ public class StatsUtils { } } - static void xmlOutput(Stats stats) - throws TransformerException, ParserConfigurationException, IOException { + static void xmlOutput(Stats stats) throws TransformerException, ParserConfigurationException, IOException { try (OutputStream os = SecurityUtils.createFileOutputStream("plantuml-stats.xml")) { new XmlConverter(stats).createXml(os); } diff --git a/src/net/sourceforge/plantuml/stats/StatsUtilsIncrement.java b/src/net/sourceforge/plantuml/stats/StatsUtilsIncrement.java index 35928b43b..9d7e3d426 100644 --- a/src/net/sourceforge/plantuml/stats/StatsUtilsIncrement.java +++ b/src/net/sourceforge/plantuml/stats/StatsUtilsIncrement.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -46,7 +46,7 @@ import net.sourceforge.plantuml.core.Diagram; import net.sourceforge.plantuml.directdot.PSystemDot; import net.sourceforge.plantuml.eggs.PSystemWelcome; import net.sourceforge.plantuml.error.PSystemErrorUtils; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.math.PSystemMath; import net.sourceforge.plantuml.salt.PSystemSalt; import net.sourceforge.plantuml.stats.api.Stats; @@ -175,7 +175,7 @@ public class StatsUtilsIncrement { lockHtml.unlock(); } } catch (Exception e) { - Logger.error(e); + Logme.error(e); } } diff --git a/src/net/sourceforge/plantuml/style/CommandStyleMultilinesCSS.java b/src/net/sourceforge/plantuml/style/CommandStyleMultilinesCSS.java index d24228663..33fdad7d7 100644 --- a/src/net/sourceforge/plantuml/style/CommandStyleMultilinesCSS.java +++ b/src/net/sourceforge/plantuml/style/CommandStyleMultilinesCSS.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -72,7 +72,7 @@ public class CommandStyleMultilinesCSS extends CommandMultilines2 ((SkinParam) diagram.getSkinParam()).applyPendingStyleMigration(); return CommandExecutionResult.ok(); } catch (NoStyleAvailableException e) { - // Logger.error(e); + // Logme.error(e); return CommandExecutionResult.error("General failure: no style available."); } } diff --git a/src/net/sourceforge/plantuml/style/SName.java b/src/net/sourceforge/plantuml/style/SName.java index 377ee084d..62158bad4 100644 --- a/src/net/sourceforge/plantuml/style/SName.java +++ b/src/net/sourceforge/plantuml/style/SName.java @@ -106,6 +106,7 @@ public enum SName { participant, // partition, // person, // + port, // queue, // rectangle, // reference, // diff --git a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java index d056ec259..97acbf02b 100644 --- a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java +++ b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.svek; @@ -52,7 +52,7 @@ import net.sourceforge.plantuml.cucadiagram.dot.CucaDiagramSimplifierActivity; import net.sourceforge.plantuml.cucadiagram.dot.CucaDiagramSimplifierState; import net.sourceforge.plantuml.cucadiagram.dot.DotData; import net.sourceforge.plantuml.graphic.StringBounder; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; public final class CucaDiagramFileMakerSvek implements CucaDiagramFileMaker { @@ -67,7 +67,7 @@ public final class CucaDiagramFileMakerSvek implements CucaDiagramFileMaker { try { return createFileInternal(os, dotStrings, fileFormatOption); } catch (InterruptedException e) { - Logger.error(e); + Logme.error(e); throw new IOException(e); } } @@ -115,7 +115,7 @@ public final class CucaDiagramFileMakerSvek implements CucaDiagramFileMaker { if (widthwarning != null && widthwarning.matches("\\d+")) { warningOrError = svek2.getWarningOrError(Integer.parseInt(widthwarning)); } - + // Sorry about this hack. There is a side effect in SvekResult::calculateDimension() result.calculateDimension(stringBounder); // Ensure text near the margins is not cut off diff --git a/src/net/sourceforge/plantuml/svek/GeneralImageBuilder.java b/src/net/sourceforge/plantuml/svek/GeneralImageBuilder.java index c14fd7dce..a7ba41b07 100644 --- a/src/net/sourceforge/plantuml/svek/GeneralImageBuilder.java +++ b/src/net/sourceforge/plantuml/svek/GeneralImageBuilder.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -32,7 +32,7 @@ * Original Author: Arnaud Roques * Contribution : Hisashi Miyashita * Contribution : Serge Wenger - * + * * */ package net.sourceforge.plantuml.svek; @@ -98,7 +98,7 @@ import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.USymbolHexagon; import net.sourceforge.plantuml.graphic.USymbolInterface; import net.sourceforge.plantuml.graphic.USymbols; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; @@ -438,7 +438,7 @@ public final class GeneralImageBuilder { } } } catch (IllegalStateException e) { - Logger.error(e); + Logme.error(e); } } diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader.java b/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader.java index 61f5f6ae3..b968e6080 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader.java @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.svek.image; -import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.Guillemet; import net.sourceforge.plantuml.ISkinParam; @@ -127,10 +126,17 @@ public class EntityImageClassHeader extends AbstractEntityImage { FontConfiguration.create(getSkinParam(), FontParam.CLASS_STEREOTYPE, stereotype), HorizontalAlignment.CENTER, skinParam); genericBlock = TextBlockUtils.withMargin(genericBlock, 1, 1); - final HColor classBackground = SkinParamUtils.getColor(getSkinParam(), stereotype, ColorParam.background); - final HColor classBorder = SkinParamUtils.getFontColor(getSkinParam(), FontParam.CLASS_STEREOTYPE, - stereotype); +// final HColor classBackground = SkinParamUtils.getColor(getSkinParam(), stereotype, ColorParam.background); +// final HColor classBorder = SkinParamUtils.getFontColor(getSkinParam(), FontParam.CLASS_STEREOTYPE, +// stereotype); + +// final HColor classBackground = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), +// skinParam.getIHtmlColorSet()); + final HColor classBackground = skinParam.getBackgroundColor(); + final HColor classBorder = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), + skinParam.getIHtmlColorSet()); + genericBlock = new TextBlockGeneric(genericBlock, classBackground, classBorder); genericBlock = TextBlockUtils.withMargin(genericBlock, 1, 1); } diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImagePort.java b/src/net/sourceforge/plantuml/svek/image/EntityImagePort.java index 6a3608e01..3a6a276d5 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImagePort.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImagePort.java @@ -72,7 +72,7 @@ public class EntityImagePort extends AbstractEntityImageBorder { } private StyleSignature getSignature() { - return StyleSignatureBasic.of(SName.root, SName.element, sname, SName.boundary).withTOBECHANGED(getStereo()); + return StyleSignatureBasic.of(SName.root, SName.element, sname, SName.port).withTOBECHANGED(getStereo()); } private boolean upPosition() { diff --git a/src/net/sourceforge/plantuml/svg/SvgGraphics.java b/src/net/sourceforge/plantuml/svg/SvgGraphics.java index 24ad35ae0..507c25dbb 100644 --- a/src/net/sourceforge/plantuml/svg/SvgGraphics.java +++ b/src/net/sourceforge/plantuml/svg/SvgGraphics.java @@ -60,8 +60,6 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import net.sourceforge.plantuml.log.Logger; - import org.w3c.dom.CDATASection; import org.w3c.dom.Comment; import org.w3c.dom.Document; @@ -72,6 +70,7 @@ import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.SignatureUtils; import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.code.Base64Coder; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.security.SecurityProfile; import net.sourceforge.plantuml.security.SecurityUtils; @@ -180,7 +179,7 @@ public class SvgGraphics { defs.appendChild(script); } } catch (ParserConfigurationException e) { - Logger.error(e); + Logme.error(e); throw new IllegalStateException(e); } } @@ -240,7 +239,7 @@ public class SvgGraphics { final InputStream is = SvgGraphics.class.getResourceAsStream("/svg/" + name); return FileUtils.readText(is); } catch (IOException e) { - Logger.error(e); + Logme.error(e); return null; } } @@ -898,7 +897,7 @@ public class SvgGraphics { private final Map images = new HashMap(); - + private void svgImageUnsecure(UImageSvg image, double x, double y) { if (hidden == false) { String svg = manageScale(image); diff --git a/src/net/sourceforge/plantuml/swing/ImageWindow.java b/src/net/sourceforge/plantuml/swing/ImageWindow.java index d098cfe7d..7862a7abf 100644 --- a/src/net/sourceforge/plantuml/swing/ImageWindow.java +++ b/src/net/sourceforge/plantuml/swing/ImageWindow.java @@ -5,9 +5,9 @@ * (C) Copyright 2009-2023, 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 * @@ -71,9 +71,9 @@ import javax.swing.WindowConstants; import net.sourceforge.plantuml.GeneratedImage; import net.sourceforge.plantuml.ImageSelection; import net.sourceforge.plantuml.graphic.GraphicStrings; -import net.sourceforge.plantuml.log.Logger; -import net.sourceforge.plantuml.security.SImageIO; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; +import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.svek.TextBlockBackcolored; import net.sourceforge.plantuml.version.PSystemVersion; @@ -338,7 +338,7 @@ class ImageWindow extends JFrame { final byte[] bytes = plainPngBuilder(error).writeByteArray(); image = SImageIO.read(bytes); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } final ImageIcon imageIcon = new ImageIcon(image, simpleLine.toString()); @@ -394,7 +394,7 @@ class ImageWindow extends JFrame { final ImageSelection imgSel = new ImageSelection(image); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(imgSel, null); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } diff --git a/src/net/sourceforge/plantuml/swing/MainWindow.java b/src/net/sourceforge/plantuml/swing/MainWindow.java index 3dfcb1baf..a619861bb 100644 --- a/src/net/sourceforge/plantuml/swing/MainWindow.java +++ b/src/net/sourceforge/plantuml/swing/MainWindow.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.swing; @@ -83,7 +83,7 @@ import net.sourceforge.plantuml.DirWatcher2; import net.sourceforge.plantuml.GeneratedImage; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.Option; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.version.PSystemVersion; public class MainWindow extends JFrame { @@ -338,8 +338,12 @@ public class MainWindow extends JFrame { jList1.setListData(new Vector<>(currentDirectoryListing2)); jList1.setVisible(true); } - } catch (IOException | InterruptedException | ExecutionException e) { - Logger.error(e); + } catch (IOException e) { + Logme.error(e); + } catch (InterruptedException e) { + Logme.error(e); + } catch (ExecutionException e) { + Logme.error(e); } } }); diff --git a/src/net/sourceforge/plantuml/telnet/AcceptTelnetClient.java b/src/net/sourceforge/plantuml/telnet/AcceptTelnetClient.java index 8b75719a1..4d7a21d48 100644 --- a/src/net/sourceforge/plantuml/telnet/AcceptTelnetClient.java +++ b/src/net/sourceforge/plantuml/telnet/AcceptTelnetClient.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.telnet; @@ -45,7 +45,7 @@ import net.sourceforge.plantuml.FileFormat; import net.sourceforge.plantuml.FileFormatOption; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.SourceStringReader; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; class AcceptTelnetClient extends Thread { final private Socket clientSocket; @@ -86,7 +86,7 @@ class AcceptTelnetClient extends Thread { os.close(); br.close(); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } diff --git a/src/net/sourceforge/plantuml/tim/EaterTheme.java b/src/net/sourceforge/plantuml/tim/EaterTheme.java index 7999a32ad..347ee60b5 100644 --- a/src/net/sourceforge/plantuml/tim/EaterTheme.java +++ b/src/net/sourceforge/plantuml/tim/EaterTheme.java @@ -43,7 +43,7 @@ import java.io.UnsupportedEncodingException; import net.sourceforge.plantuml.AFile; import net.sourceforge.plantuml.StringLocated; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.preproc.FileWithSuffix; import net.sourceforge.plantuml.preproc.ImportedFiles; import net.sourceforge.plantuml.preproc.ReadLine; @@ -97,7 +97,7 @@ public class EaterTheme extends Eater { return ReadLineReader.create(br, "theme " + realName); } } catch (IOException e) { - Logger.error(e); + Logme.error(e); } throw EaterException.located("Cannot load " + realName); @@ -109,7 +109,7 @@ public class EaterTheme extends Eater { try { return PreprocessorUtils.getReaderInclude(url, getLineLocation(), UTF_8); } catch (UnsupportedEncodingException e) { - Logger.error(e); + Logme.error(e); throw EaterException.located("Cannot decode charset"); } } @@ -122,7 +122,7 @@ public class EaterTheme extends Eater { return ReadLineReader.create(tmp, "theme " + realName); } catch (IOException e) { - Logger.error(e); + Logme.error(e); throw EaterException.located("Cannot load " + realName); } diff --git a/src/net/sourceforge/plantuml/tim/TContext.java b/src/net/sourceforge/plantuml/tim/TContext.java index a8407fdf5..ee6084f7f 100644 --- a/src/net/sourceforge/plantuml/tim/TContext.java +++ b/src/net/sourceforge/plantuml/tim/TContext.java @@ -54,7 +54,7 @@ import net.sourceforge.plantuml.StringLocated; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.json.Json; import net.sourceforge.plantuml.json.JsonValue; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.preproc.Defines; import net.sourceforge.plantuml.preproc.FileWithSuffix; import net.sourceforge.plantuml.preproc.ImportedFiles; @@ -301,7 +301,7 @@ public class TContext { throw (EaterException) e; if (e instanceof EaterExceptionLocated) throw (EaterExceptionLocated) e; - Logger.error(e); + Logme.error(e); throw EaterException.located("Fatal parsing error"); } } @@ -373,9 +373,9 @@ public class TContext { tmp[0] = new StringLocated(pendingAdd + tmp[0].getString(), tmp[0].getLocation()); pendingAdd = null; } - for (StringLocated line : tmp) { + for (StringLocated line : tmp) resultList.add(line); - } + } } @@ -405,18 +405,17 @@ public class TContext { private StringLocated[] applyFunctionsAndVariablesInternal(TMemory memory, StringLocated located) throws EaterException, EaterExceptionLocated { - if (memory.isEmpty() && functionsSet.size() == 0) { + if (memory.isEmpty() && functionsSet.size() == 0) return new StringLocated[] { located }; - } + final String result = applyFunctionsAndVariables(memory, located.getLocation(), located.getString()); - if (result == null) { + if (result == null) return null; - } + final String[] splited = result.split("\n"); final StringLocated[] tab = new StringLocated[splited.length]; - for (int i = 0; i < splited.length; i++) { + for (int i = 0; i < splited.length; i++) tab[i] = new StringLocated(splited[i], located.getLocation()); - } return tab; } @@ -445,17 +444,17 @@ public class TContext { final TFunctionSignature signature = new TFunctionSignature(presentFunction, call.getValues().size(), call.getNamedArguments().keySet()); final TFunction function = functionsSet.getFunctionSmart(signature); - if (function == null) { + if (function == null) throw EaterException.located("Function not found " + presentFunction); - } + if (function.getFunctionType() == TFunctionType.PROCEDURE) { this.pendingAdd = result.toString(); executeVoid3(location, memory, sub, function, call); i += call.getCurrentPosition(); final String remaining = str.substring(i); - if (remaining.length() > 0) { + if (remaining.length() > 0) appendToLastResult(remaining); - } + return null; } if (function.getFunctionType() == TFunctionType.LEGACY_DEFINELONG) { @@ -502,7 +501,7 @@ public class TContext { return; } } catch (IOException e) { - Logger.error(e); + Logme.error(e); throw EaterException.located("Cannot import " + e.getMessage()); } @@ -538,9 +537,9 @@ public class TContext { saveImportedFiles = this.importedFiles; this.importedFiles = this.importedFiles.withCurrentDir(f2.getParentFile()); final Reader reader = f2.getReader(charset); - if (reader == null) { + if (reader == null) throw EaterException.located("cannot include " + location); - } + try { ReadLine readerline = ReadLineReader.create(reader, location, s.getLocation()); readerline = new UncommentReadLine(readerline); @@ -550,21 +549,21 @@ public class TContext { } } } catch (IOException e) { - Logger.error(e); + Logme.error(e); throw EaterException.located("cannot include " + location); } } - if (sub == null) { + if (sub == null) sub = subs.get(location); - } - if (sub == null) { + + if (sub == null) throw EaterException.located("cannot include " + location); - } + executeLinesInternal(memory, sub.lines(), null); } finally { - if (saveImportedFiles != null) { + if (saveImportedFiles != null) this.importedFiles = saveImportedFiles; - } + } } @@ -586,13 +585,13 @@ public class TContext { body.add(sl); } while (true); } catch (IOException e) { - Logger.error(e); + Logme.error(e); throw EaterException.located("" + e); } finally { try { reader2.close(); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } } @@ -601,9 +600,9 @@ public class TContext { final EaterTheme eater = new EaterTheme(s.getTrimmed(), importedFiles); eater.analyze(this, memory); final ReadLine reader = eater.getTheme(); - if (reader == null) { + if (reader == null) throw EaterException.located("No such theme " + eater.getName()); - } + try { final List body = new ArrayList<>(); do { @@ -615,13 +614,13 @@ public class TContext { body.add(sl); } while (true); } catch (IOException e) { - Logger.error(e); + Logme.error(e); throw EaterException.located("Error reading theme " + e); } finally { try { reader.close(); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } } @@ -643,29 +642,28 @@ public class TContext { try { if (location.startsWith("http://") || location.startsWith("https://")) { final SURL url = SURL.create(location); - if (url == null) { + if (url == null) throw EaterException.located("Cannot open URL"); - } + reader = PreprocessorUtils.getReaderIncludeUrl(url, s, suf, charset); } else if (location.startsWith("<") && location.endsWith(">")) { reader = PreprocessorUtils.getReaderStdlibInclude(s, location.substring(1, location.length() - 1)); } else { final FileWithSuffix f2 = importedFiles.getFile(location, suf); if (f2.fileOk()) { - if (strategy == PreprocessorIncludeStrategy.DEFAULT && filesUsedCurrent.contains(f2)) { + if (strategy == PreprocessorIncludeStrategy.DEFAULT && filesUsedCurrent.contains(f2)) return; - } - if (strategy == PreprocessorIncludeStrategy.ONCE && filesUsedCurrent.contains(f2)) { + + if (strategy == PreprocessorIncludeStrategy.ONCE && filesUsedCurrent.contains(f2)) throw EaterException.located("This file has already been included"); - } if (StartDiagramExtractReader.containsStartDiagram(f2, s, charset)) { reader = StartDiagramExtractReader.build(f2, s, charset); } else { final Reader tmp = f2.getReader(charset); - if (tmp == null) { + if (tmp == null) throw EaterException.located("Cannot include file"); - } + reader = ReadLineReader.create(tmp, location, s.getLocation()); } saveImportedFiles = this.importedFiles; @@ -686,20 +684,20 @@ public class TContext { body.add(sl); } while (true); } finally { - if (saveImportedFiles != null) { + if (saveImportedFiles != null) this.importedFiles = saveImportedFiles; - } + } } } catch (IOException e) { - Logger.error(e); + Logme.error(e); throw EaterException.located("cannot include " + e); } finally { if (reader != null) { try { reader.close(); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } } @@ -708,41 +706,38 @@ public class TContext { } public boolean isLegacyDefine(String functionName) { - for (Map.Entry ent : functionsSet.functions().entrySet()) { - if (ent.getKey().getFunctionName().equals(functionName) && ent.getValue().getFunctionType().isLegacy()) { + for (Map.Entry ent : functionsSet.functions().entrySet()) + if (ent.getKey().getFunctionName().equals(functionName) && ent.getValue().getFunctionType().isLegacy()) return true; - } - } + return false; } public boolean isUnquoted(String functionName) { - for (Map.Entry ent : functionsSet.functions().entrySet()) { - if (ent.getKey().getFunctionName().equals(functionName) && ent.getValue().isUnquoted()) { + for (Map.Entry ent : functionsSet.functions().entrySet()) + if (ent.getKey().getFunctionName().equals(functionName) && ent.getValue().isUnquoted()) return true; - } - } + return false; } public boolean doesFunctionExist(String functionName) { - for (Map.Entry ent : functionsSet.functions().entrySet()) { - if (ent.getKey().getFunctionName().equals(functionName)) { + for (Map.Entry ent : functionsSet.functions().entrySet()) + if (ent.getKey().getFunctionName().equals(functionName)) return true; - } - } + return false; } private String getFunctionNameAt(String s, int pos) { if (pos > 0 && TLineType.isLetterOrUnderscoreOrDigit(s.charAt(pos - 1)) - && VariableManager.justAfterBackslashN(s, pos) == false) { + && VariableManager.justAfterBackslashN(s, pos) == false) return null; - } + final String fname = functionsSet.getLonguestMatchStartingIn(s.substring(pos)); - if (fname.length() == 0) { + if (fname.length() == 0) return null; - } + return fname.substring(0, fname.length() - 1); } @@ -759,9 +754,9 @@ public class TContext { while (resultList.size() > n1) { sb.append(resultList.get(n1).getString()); resultList.remove(n1); - if (resultList.size() > n1) { + if (resultList.size() > n1) sb.append("\\n"); - } + } return sb.toString(); } diff --git a/src/net/sourceforge/plantuml/tim/TimLoader.java b/src/net/sourceforge/plantuml/tim/TimLoader.java index 2d302e33a..28381d575 100644 --- a/src/net/sourceforge/plantuml/tim/TimLoader.java +++ b/src/net/sourceforge/plantuml/tim/TimLoader.java @@ -40,7 +40,7 @@ import java.util.Set; import net.sourceforge.plantuml.DefinitionsContainer; import net.sourceforge.plantuml.StringLocated; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.preproc.Defines; import net.sourceforge.plantuml.preproc.FileWithSuffix; import net.sourceforge.plantuml.preproc.ImportedFiles; @@ -58,7 +58,7 @@ public class TimLoader { try { defines.copyTo(global); } catch (EaterException e) { - Logger.error(e); + Logme.error(e); } } diff --git a/src/net/sourceforge/plantuml/tim/stdlib/LoadJson.java b/src/net/sourceforge/plantuml/tim/stdlib/LoadJson.java index 662113822..32804b241 100755 --- a/src/net/sourceforge/plantuml/tim/stdlib/LoadJson.java +++ b/src/net/sourceforge/plantuml/tim/stdlib/LoadJson.java @@ -47,7 +47,7 @@ import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.json.Json; import net.sourceforge.plantuml.json.JsonValue; import net.sourceforge.plantuml.json.ParseException; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.security.SURL; import net.sourceforge.plantuml.tim.EaterException; @@ -64,7 +64,7 @@ import net.sourceforge.plantuml.tim.expression.TValue; * datasource will be checked against the security rules. *

* Examples:
- * + * *

  *     @ startuml
  *     ' loads a local file
@@ -89,7 +89,7 @@ import net.sourceforge.plantuml.tim.expression.TValue;
  *     status -> $JSON_REMOTE_DEF.status
  *     @ enduml
  * 
- * + * * @author Aljoscha Rittner */ public class LoadJson extends SimpleReturnFunction { @@ -117,17 +117,17 @@ public class LoadJson extends SimpleReturnFunction { JsonValue jsonValue = Json.parse(data); return TValue.fromJson(jsonValue); } catch (ParseException pe) { - Logger.error(pe); + Logme.error(pe); throw EaterException.unlocated("JSON parse issue in source " + path + " on location " + pe.getLocation()); } catch (UnsupportedEncodingException e) { - Logger.error(e); + Logme.error(e); throw EaterException.unlocated("JSON encoding issue in source " + path + ": " + e.getMessage()); } } /** * Returns the JSON default, if the data source contains no data. - * + * * @param values value parameters * @return the defined default JSON or {@code "{}"} */ @@ -140,7 +140,7 @@ public class LoadJson extends SimpleReturnFunction { /** * Returns the charset name (if set) - * + * * @param values value parameters * @return defined charset or {@code "UTF-8"} */ @@ -154,7 +154,7 @@ public class LoadJson extends SimpleReturnFunction { /** * Loads String data from a data source {@code path} (file or URL) and expects * the data encoded in {@code charset}. - * + * * @param path path to data source (http(s)-URL or file). * @param charset character set to encode the string data * @return the decoded String from the data source @@ -177,7 +177,7 @@ public class LoadJson extends SimpleReturnFunction { byteData = out.toByteArray(); } } catch (IOException e) { - Logger.error(e); + Logme.error(e); throw EaterException.located("load JSON: Cannot read file " + path + ". " + e.getMessage()); } } diff --git a/src/net/sourceforge/plantuml/tim/stdlib/LoadJsonLegacy.java b/src/net/sourceforge/plantuml/tim/stdlib/LoadJsonLegacy.java index 3dd3e738d..44de27914 100644 --- a/src/net/sourceforge/plantuml/tim/stdlib/LoadJsonLegacy.java +++ b/src/net/sourceforge/plantuml/tim/stdlib/LoadJsonLegacy.java @@ -47,7 +47,7 @@ import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.json.Json; import net.sourceforge.plantuml.json.JsonValue; import net.sourceforge.plantuml.json.ParseException; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.security.SURL; import net.sourceforge.plantuml.tim.EaterException; @@ -64,7 +64,7 @@ import net.sourceforge.plantuml.tim.expression.TValue; * datasource will be checked against the security rules. *

* Examples:
- * + * *

  *     @ startuml
  *     ' loads a local file
@@ -89,7 +89,7 @@ import net.sourceforge.plantuml.tim.expression.TValue;
  *     status -> $JSON_REMOTE_DEF.status
  *     @ enduml
  * 
- * + * * @author Aljoscha Rittner */ public class LoadJsonLegacy extends SimpleReturnFunction { @@ -117,17 +117,17 @@ public class LoadJsonLegacy extends SimpleReturnFunction { JsonValue jsonValue = Json.parse(data); return TValue.fromJson(jsonValue); } catch (ParseException pe) { - Logger.error(pe); + Logme.error(pe); throw EaterException.unlocated("JSON parse issue in source " + path + " on location " + pe.getLocation()); } catch (UnsupportedEncodingException e) { - Logger.error(e); + Logme.error(e); throw EaterException.unlocated("JSON encoding issue in source " + path + ": " + e.getMessage()); } } /** * Returns the JSON default, if the data source contains no data. - * + * * @param values value parameters * @return the defined default JSON or {@code "{}"} */ @@ -140,7 +140,7 @@ public class LoadJsonLegacy extends SimpleReturnFunction { /** * Returns the charset name (if set) - * + * * @param values value parameters * @return defined charset or {@code "UTF-8"} */ @@ -154,7 +154,7 @@ public class LoadJsonLegacy extends SimpleReturnFunction { /** * Loads String data from a data source {@code path} (file or URL) and expects * the data encoded in {@code charset}. - * + * * @param path path to data source (http(s)-URL or file). * @param charset character set to encode the string data * @return the decoded String from the data source @@ -177,7 +177,7 @@ public class LoadJsonLegacy extends SimpleReturnFunction { byteData = out.toByteArray(); } } catch (IOException e) { - Logger.error(e); + Logme.error(e); throw EaterException.located("load JSON: Cannot read file " + path + ". " + e.getMessage()); } } diff --git a/src/net/sourceforge/plantuml/timingdiagram/PlayerAnalog.java b/src/net/sourceforge/plantuml/timingdiagram/PlayerAnalog.java index 5f679f10d..daa48dae3 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/PlayerAnalog.java +++ b/src/net/sourceforge/plantuml/timingdiagram/PlayerAnalog.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -54,7 +54,7 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.UDrawable; import net.sourceforge.plantuml.graphic.color.Colors; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.style.StyleSignatureBasic; @@ -159,7 +159,7 @@ public class PlayerAnalog extends Player { try { return Double.parseDouble(value); } catch (Exception e) { - Logger.error(e); + Logme.error(e); return 0; } } diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java b/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java index 85df6bd69..28e1b96ff 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java +++ b/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java @@ -59,7 +59,6 @@ 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 TimingRuler { diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/ExtendedGeneralPath.java b/src/net/sourceforge/plantuml/ugraphic/g2d/ExtendedGeneralPath.java index cb7ed9046..32a07af02 100644 --- a/src/net/sourceforge/plantuml/ugraphic/g2d/ExtendedGeneralPath.java +++ b/src/net/sourceforge/plantuml/ugraphic/g2d/ExtendedGeneralPath.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Thierry Kormann - * + * * */ package net.sourceforge.plantuml.ugraphic.g2d; @@ -54,8 +54,6 @@ package net.sourceforge.plantuml.ugraphic.g2d; */ -import net.sourceforge.plantuml.log.Logger; - import java.awt.Rectangle; import java.awt.Shape; import java.awt.geom.AffineTransform; @@ -66,15 +64,17 @@ import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.util.Arrays; +import net.sourceforge.plantuml.log.Logme; + /** * The ExtendedGeneralPath class represents a geometric path constructed from straight lines, quadratic and * cubic (Bezier) curves and elliptical arc. This class delegates lines and curves to an enclosed * GeneralPath. Elliptical arc is implemented using an Arc2D in double precision. - * + * *

* Warning : An elliptical arc may be composed of several path segments. For further details, see the SVG * Appendix F.6 - * + * * @author Thierry Kormann * @version $Id: ExtendedGeneralPath.java 594018 2007-11-12 04:17:41Z cam $ */ @@ -127,23 +127,23 @@ public class ExtendedGeneralPath implements Shape, Cloneable { /** * Adds an elliptical arc, defined by two radii, an angle from the x-axis, a flag to choose the large arc or not, a * flag to indicate if we increase or decrease the angles and the final point of the arc. - * + * * @param rx * the x radius of the ellipse * @param ry * the y radius of the ellipse - * + * * @param angle * the angle from the x-axis of the current coordinate system to the x-axis of the ellipse in degrees. - * + * * @param largeArcFlag * the large arc flag. If true the arc spanning less than or equal to 180 degrees is chosen, otherwise * the arc spanning greater than 180 degrees is chosen - * + * * @param sweepFlag * the sweep flag. If true the line joining center to arc sweeps through decreasing angles otherwise it * sweeps through increasing angles - * + * * @param x * the absolute x coordinate of the final point of the arc. * @param y @@ -193,7 +193,7 @@ public class ExtendedGeneralPath implements Shape, Cloneable { /** * This constructs an unrotated Arc2D from the SVG specification of an Elliptical arc. To get the final arc you need * to apply a rotation transform such as: - * + * * AffineTransform.getRotateInstance (angle, arc.getX()+arc.getWidth()/2, arc.getY()+arc.getHeight()/2); */ public static Arc2D computeArc(double x0, double y0, double rx, double ry, double angle, boolean largeArcFlag, @@ -727,7 +727,7 @@ public class ExtendedGeneralPath implements Shape, Cloneable { return result; } catch (CloneNotSupportedException ex) { - Logger.error(ex); + Logme.error(ex); } return null; } @@ -735,7 +735,7 @@ public class ExtendedGeneralPath implements Shape, Cloneable { /** * Make sure, that the requested number of slots in vales[] are available. Must be called even for numValues = 0, * because it is also used for initialization of those arrays. - * + * * @param numValues * number of requested coordinates */ diff --git a/src/net/sourceforge/plantuml/utils/Cypher.java b/src/net/sourceforge/plantuml/utils/Cypher.java index 440546721..20e507922 100644 --- a/src/net/sourceforge/plantuml/utils/Cypher.java +++ b/src/net/sourceforge/plantuml/utils/Cypher.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -35,8 +35,6 @@ */ package net.sourceforge.plantuml.utils; -import net.sourceforge.plantuml.log.Logger; - import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; @@ -52,6 +50,8 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; +import net.sourceforge.plantuml.log.Logme; + public class Cypher { final private static Pattern p = Pattern.compile("[\\p{L}\\p{N}]+"); @@ -73,7 +73,7 @@ public class Cypher { } is.close(); } catch (Exception e) { - Logger.error(e); + Logme.error(e); } Collections.shuffle(words, rnd); diff --git a/src/net/sourceforge/plantuml/utils/MathUtils.java b/src/net/sourceforge/plantuml/utils/MathUtils.java index 2d26efe91..d858296ba 100644 --- a/src/net/sourceforge/plantuml/utils/MathUtils.java +++ b/src/net/sourceforge/plantuml/utils/MathUtils.java @@ -35,10 +35,10 @@ */ package net.sourceforge.plantuml.utils; -import net.sourceforge.plantuml.awt.geom.Dimension2D; import java.awt.geom.Point2D; import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.awt.geom.Dimension2D; public class MathUtils { diff --git a/src/net/sourceforge/plantuml/version/LicenseInfo.java b/src/net/sourceforge/plantuml/version/LicenseInfo.java index 840b28b93..6eca0bcbe 100644 --- a/src/net/sourceforge/plantuml/version/LicenseInfo.java +++ b/src/net/sourceforge/plantuml/version/LicenseInfo.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -49,9 +49,9 @@ import java.util.prefs.Preferences; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.OptionFlags; import net.sourceforge.plantuml.SignatureUtils; -import net.sourceforge.plantuml.log.Logger; -import net.sourceforge.plantuml.security.SImageIO; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; +import net.sourceforge.plantuml.security.SImageIO; public class LicenseInfo { @@ -122,7 +122,7 @@ public class LicenseInfo { } } catch (IOException e) { Log.info("Error " + e); - // Logger.error(e); + // Logme.error(e); } } return cache; @@ -134,7 +134,7 @@ public class LicenseInfo { final String sig = SignatureUtils.toHexString(PLSSignature.signature()); return PLSSignature.retrieveNamed(sig, key, true); } catch (Exception e) { - // Logger.error(e); + // Logme.error(e); Log.info("Error retrieving license info" + e); } } @@ -161,7 +161,7 @@ public class LicenseInfo { dis.close(); } } catch (Exception e) { - Logger.error(e); + Logme.error(e); } return null; } @@ -185,7 +185,7 @@ public class LicenseInfo { } return null; } catch (Exception e) { - Logger.error(e); + Logme.error(e); return null; } } diff --git a/src/net/sourceforge/plantuml/version/PLSSignature.java b/src/net/sourceforge/plantuml/version/PLSSignature.java index ca42b99d1..af16ebd0c 100644 --- a/src/net/sourceforge/plantuml/version/PLSSignature.java +++ b/src/net/sourceforge/plantuml/version/PLSSignature.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -54,7 +54,7 @@ import net.sourceforge.plantuml.SignatureUtils; import net.sourceforge.plantuml.dedication.Dedication; import net.sourceforge.plantuml.dedication.QBlock; import net.sourceforge.plantuml.dedication.TurningBytes; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; public class PLSSignature { @@ -229,7 +229,7 @@ public class PLSSignature { try { return SignatureUtils.getSHA512raw(SignatureUtils.salting(signature, getSalt(signature))); } catch (Exception e) { - Logger.error(e); + Logme.error(e); throw new IOException(); } } diff --git a/src/net/sourceforge/plantuml/version/PSystemKeycheck.java b/src/net/sourceforge/plantuml/version/PSystemKeycheck.java index 9ef2f65a3..70273dfec 100644 --- a/src/net/sourceforge/plantuml/version/PSystemKeycheck.java +++ b/src/net/sourceforge/plantuml/version/PSystemKeycheck.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -52,7 +52,7 @@ import net.sourceforge.plantuml.flashcode.FlashCodeUtils; import net.sourceforge.plantuml.graphic.GraphicStrings; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.UDrawable; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.ugraphic.AffineTransformType; import net.sourceforge.plantuml.ugraphic.PixelImage; import net.sourceforge.plantuml.ugraphic.UGraphic; @@ -77,7 +77,7 @@ public class PSystemKeycheck extends PlainDiagram { try { drawInternal(ug); } catch (Exception e) { - Logger.error(e); + Logme.error(e); } } }; @@ -95,7 +95,7 @@ public class PSystemKeycheck extends PlainDiagram { License.addLicenseInfo(strings, info); strings.add(" "); } catch (Exception e) { - Logger.error(e); + Logme.error(e); strings.add("Error: " + e); } diff --git a/src/net/sourceforge/plantuml/version/PSystemKeygen.java b/src/net/sourceforge/plantuml/version/PSystemKeygen.java index f11b41a71..57c7e682d 100644 --- a/src/net/sourceforge/plantuml/version/PSystemKeygen.java +++ b/src/net/sourceforge/plantuml/version/PSystemKeygen.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -51,7 +51,7 @@ import net.sourceforge.plantuml.flashcode.FlashCodeUtils; import net.sourceforge.plantuml.graphic.GraphicStrings; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.UDrawable; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SFile; import net.sourceforge.plantuml.ugraphic.AffineTransformType; import net.sourceforge.plantuml.ugraphic.PixelImage; @@ -75,7 +75,7 @@ public class PSystemKeygen extends PlainDiagram { try { drawInternal(ug); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } }; diff --git a/src/net/sourceforge/plantuml/version/PSystemVersion.java b/src/net/sourceforge/plantuml/version/PSystemVersion.java index 8a8e0234d..65ab85665 100644 --- a/src/net/sourceforge/plantuml/version/PSystemVersion.java +++ b/src/net/sourceforge/plantuml/version/PSystemVersion.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -51,11 +51,11 @@ import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.cucadiagram.dot.GraphvizUtils; import net.sourceforge.plantuml.dedication.PSystemDedication; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.preproc.Stdlib; import net.sourceforge.plantuml.preproc2.PreprocessorUtils; -import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.security.SFile; +import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.security.SecurityProfile; import net.sourceforge.plantuml.security.SecurityUtils; import net.sourceforge.plantuml.svek.GraphvizCrash; @@ -121,7 +121,7 @@ public class PSystemVersion extends PlainStringsDiagram { is.close(); return image; } catch (IOException e) { - Logger.error(e); + Logme.error(e); } return new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB); } @@ -130,7 +130,7 @@ public class PSystemVersion extends PlainStringsDiagram { try (InputStream is = PSystemVersion.class.getResourceAsStream(name)) { return PSystemDedication.getBufferedImage(is); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } return new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB); } @@ -186,7 +186,7 @@ public class PSystemVersion extends PlainStringsDiagram { for (String v : OptionPrint.interestingValues()) { strings.add(v); } - + return new PSystemVersion(source, true, strings); } diff --git a/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java b/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java index 491d94235..22229e546 100644 --- a/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java +++ b/src/net/sourceforge/plantuml/version/PSystemVersionFactory.java @@ -42,8 +42,6 @@ import net.sourceforge.plantuml.AbstractPSystem; import net.sourceforge.plantuml.Log; import net.sourceforge.plantuml.command.PSystemSingleLineFactory; import net.sourceforge.plantuml.core.UmlSource; -import net.sourceforge.plantuml.security.SecurityProfile; -import net.sourceforge.plantuml.security.SecurityUtils; public class PSystemVersionFactory extends PSystemSingleLineFactory { diff --git a/src/net/sourceforge/plantuml/version/Version.java b/src/net/sourceforge/plantuml/version/Version.java index 2d8919f01..a9df3c61f 100644 --- a/src/net/sourceforge/plantuml/version/Version.java +++ b/src/net/sourceforge/plantuml/version/Version.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,14 +30,14 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.version; import java.util.Date; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.security.SURL; public class Version { @@ -81,7 +81,7 @@ public class Version { } public static int beta() { - final int beta = 9; + final int beta = 10; return beta; } @@ -111,11 +111,14 @@ public class Version { return "No ClassLoader?"; } final SURL url = SURL.create(loader.getResource("net/sourceforge/plantuml/version/Version.class")); + if (url == null) { + return "No URL?"; + } String fullpath = url.toString(); fullpath = fullpath.replaceAll("net/sourceforge/plantuml/version/Version\\.class", ""); return fullpath; } catch (Throwable t) { - Logger.error(t); + Logme.error(t); return t.toString(); } } diff --git a/src/net/sourceforge/plantuml/vizjs/GraphvizJs.java b/src/net/sourceforge/plantuml/vizjs/GraphvizJs.java index b3c11cc9d..2f5fd69f5 100644 --- a/src/net/sourceforge/plantuml/vizjs/GraphvizJs.java +++ b/src/net/sourceforge/plantuml/vizjs/GraphvizJs.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.vizjs; @@ -47,7 +47,7 @@ import net.sourceforge.plantuml.cucadiagram.dot.ExeState; import net.sourceforge.plantuml.cucadiagram.dot.Graphviz; import net.sourceforge.plantuml.cucadiagram.dot.GraphvizVersion; import net.sourceforge.plantuml.cucadiagram.dot.ProcessState; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; public class GraphvizJs implements Graphviz { @@ -73,7 +73,7 @@ public class GraphvizJs implements Graphviz { try { this.engine = new VizJsEngine(); } catch (Exception e) { - Logger.error(e); + Logme.error(e); } } runnable.run(); @@ -93,7 +93,7 @@ public class GraphvizJs implements Graphviz { os.write(svg.getBytes()); return ProcessState.TERMINATED_OK(); } catch (Exception e) { - Logger.error(e); + Logme.error(e); throw new GraphvizJsRuntimeException(e); } } diff --git a/src/net/sourceforge/plantuml/wbs/WBSDiagram.java b/src/net/sourceforge/plantuml/wbs/WBSDiagram.java index 555095c77..d6a7e79f5 100644 --- a/src/net/sourceforge/plantuml/wbs/WBSDiagram.java +++ b/src/net/sourceforge/plantuml/wbs/WBSDiagram.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -142,7 +142,7 @@ public class WBSDiagram extends UmlDiagram { } return add(backColor, level, display, stereotype, direction, shape); } catch (NoStyleAvailableException e) { - // Logger.error(e); + // Logme.error(e); return CommandExecutionResult.error("General failure: no style available."); } } @@ -204,7 +204,7 @@ public class WBSDiagram extends UmlDiagram { } return CommandExecutionResult.error("Bad tree structure"); } catch (NoStyleAvailableException e) { - // Logger.error(e); + // Logme.error(e); return CommandExecutionResult.error("General failure: no style available."); } } diff --git a/src/net/sourceforge/plantuml/webp/VP8Decoder.java b/src/net/sourceforge/plantuml/webp/VP8Decoder.java index 273a6ef8f..3b004104b 100644 --- a/src/net/sourceforge/plantuml/webp/VP8Decoder.java +++ b/src/net/sourceforge/plantuml/webp/VP8Decoder.java @@ -15,14 +15,14 @@ */ package net.sourceforge.plantuml.webp; -import net.sourceforge.plantuml.log.Logger; - import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import javax.imageio.stream.ImageInputStream; +import net.sourceforge.plantuml.log.Logme; + public class VP8Decoder { private int[][][][] coefProbs; VP8Frame f; @@ -73,7 +73,7 @@ public class VP8Decoder { out.write((byte) ' '); out.write(("" + (f.getHeight() + uvHeight)).getBytes()); - + out.write((byte) 0x0a); out.write(("255").getBytes()); out.write((byte) 0xa); @@ -95,12 +95,12 @@ public class VP8Decoder { } } catch (FileNotFoundException e) { - Logger.error(e); + Logme.error(e); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } - + public void writeYV12File(String fileName, VP8Frame frame) { FileOutputStream out; @@ -134,9 +134,9 @@ public class VP8Decoder { out.write(vData[x][y]); } } catch (FileNotFoundException e) { - Logger.error(e); + Logme.error(e); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } } diff --git a/src/net/sourceforge/plantuml/webp/VP8Frame.java b/src/net/sourceforge/plantuml/webp/VP8Frame.java index c1fbd98ca..ecf808f91 100644 --- a/src/net/sourceforge/plantuml/webp/VP8Frame.java +++ b/src/net/sourceforge/plantuml/webp/VP8Frame.java @@ -15,8 +15,6 @@ */ package net.sourceforge.plantuml.webp; -import net.sourceforge.plantuml.log.Logger; - import java.awt.image.BufferedImage; import java.awt.image.WritableRaster; import java.io.IOException; @@ -26,6 +24,8 @@ import java.util.Vector; import javax.imageio.event.IIOReadProgressListener; import javax.imageio.stream.ImageInputStream; +import net.sourceforge.plantuml.log.Logme; + public class VP8Frame { private static int BLOCK_TYPES = 4; @@ -34,7 +34,7 @@ public class VP8Frame { private static int MAX_MODE_LF_DELTAS = 4; private static int MAX_REF_LF_DELTAS = 4; private static int PREV_COEF_CONTEXTS = 3; - + private ArrayList _listeners = new ArrayList<>(); @@ -94,13 +94,13 @@ public class VP8Frame { for(int x=0; x 0 ) { - + macroBlockSegementAbsoluteDelta = bc.readBit(); /* For each segmentation feature (Quant and loop filter level) */ for (int i = 0; i < Globals.MAX_MB_SEGMENTS; i++) { @@ -194,7 +194,7 @@ public class VP8Frame { } simpleFilter = bc.readBit(); filterLevel = bc.readLiteral(6); - + sharpnessLevel = bc.readLiteral(3); modeRefLoopFilterDeltaEnabled = bc.readBit(); if (modeRefLoopFilterDeltaEnabled > 0) { @@ -268,7 +268,7 @@ public class VP8Frame { for (int mb_row = 0; mb_row < macroBlockRows; mb_row++) { if (num_part > 1) { - + tokenBoolDecoder = tokenBoolDecoders.elementAt(ibc); tokenBoolDecoder.seek(); @@ -299,7 +299,7 @@ public class VP8Frame { } } - + public void fireLFProgressUpdate(float p) { java.util.Iterator listeners = _listeners.iterator(); while( listeners.hasNext() ) { @@ -327,7 +327,7 @@ public class VP8Frame { int y = mb.getSubblockY(sb); if(plane==SubBlock.PLANE.Y1) { - + // top row if(y==0 && x<3) { @@ -342,7 +342,7 @@ public class VP8Frame { r = mb2.getSubBlock(plane, 0, 3); if(mb2.getX()==this.getMacroBlockCols()) { - + int dest[][] = new int [4][4]; for(int b=0; b<4; b++) for(int a=0; a<4; a++) { @@ -353,10 +353,10 @@ public class VP8Frame { } r=new SubBlock(mb2,null, null, SubBlock.PLANE.Y1); r.setDest(dest); - + } - + return r; } //not right edge or top row @@ -382,7 +382,7 @@ public class VP8Frame { if(r==null) { MacroBlock mb = sb.getMacroBlock(); int x = mb.getSubblockX(sb); - + MacroBlock mb2 = getMacroBlock(mb.getX(), mb.getY()-1); //TODO: SPLIT while(plane==SubBlock.PLANE.Y2 && mb2.getYMode()== Globals.B_PRED) { @@ -401,7 +401,7 @@ public class VP8Frame { return true; return false; } - + private int getBitAsInt(int data, int bit) { int r = data & (1 << bit); if (r > 0) @@ -659,7 +659,7 @@ public class VP8Frame { bufferCount++; return bi; } - + public BufferedImage getDebugImageYDiffBuffer() { BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); WritableRaster imRas = bi.getWritableTile(0, 0); @@ -685,7 +685,7 @@ public class VP8Frame { bufferCount++; return bi; } - + public BufferedImage getDebugImageYPredBuffer() { BufferedImage bi = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); WritableRaster imRas = bi.getWritableTile(0, 0); @@ -711,7 +711,7 @@ public class VP8Frame { bufferCount++; return bi; } - + public int getFilterLevel() { return filterLevel; } @@ -721,7 +721,7 @@ public class VP8Frame { public int getFrameType() { return frameType; } - + public int getHeight() { return height; } @@ -735,7 +735,7 @@ public class VP8Frame { while(plane==SubBlock.PLANE.Y2 && mb2.getYMode()== Globals.B_PRED) mb2 = getMacroBlock(mb2.getX()-1, mb2.getY()); - + r = mb2.getRightSubBlock(y, sb.getPlane()); } @@ -769,7 +769,7 @@ public class VP8Frame { public int getMacroBlockRows() { return macroBlockRows; } - + public int getQIndex() { return segmentQuants.getqIndex(); } @@ -783,7 +783,7 @@ public class VP8Frame { tokenBoolDecoder.seek(); return tokenBoolDecoder; } - + public int[][] getUBuffer() { int r[][]= new int [macroBlockCols*8][macroBlockRows*8]; for(int y=0; y 0) { prob_skip_false = bc.readLiteral(8); } @@ -873,12 +873,12 @@ public class VP8Frame { // Read the macroblock coeff skip flag if this feature is in // use, else default to 0 MacroBlock mb = getMacroBlock(mb_col, mb_row); - + if ((segmentationIsEnabled >0) &&( updateMacroBlockSegmentationMap > 0)) { int value = bc.readTree(Globals.macroBlockSegmentTree, this.macroBlockSegmentTreeProbs); mb.setSegmentId(value); } - + if(modeRefLoopFilterDeltaEnabled > 0) { int level = filterLevel; level = level + refLoopFilterDeltas[0]; @@ -889,7 +889,7 @@ public class VP8Frame { mb.setFilterLevel(segmentQuants.getSegQuants()[mb.getSegmentId()].getFilterStrength()); // logger.error("TODO:"); } - + int mb_skip_coeff = 0; if (macroBlockNoCoeffSkip > 0) mb_skip_coeff = bc.readBool(prob_skip_false); @@ -898,7 +898,7 @@ public class VP8Frame { mb.setSkipCoeff(mb_skip_coeff); int y_mode = readYMode(bc); - + mb.setYMode(y_mode); if (y_mode == Globals.B_PRED) { @@ -957,14 +957,14 @@ public class VP8Frame { } } } - - - + + + private int readPartitionSize(long l) throws IOException { frame.seek(l); int size =frame.readUnsignedByte() + (frame.readUnsignedByte() << 8) + (frame.readUnsignedByte() << 16); return size; - + } private int readSubBlockMode(BoolDecoder bc, int A, int L) throws IOException { int i = bc.readTree(Globals.vp8SubBlockModeTree, Globals.vp8KeyFrameSubBlockModeProb[A][L]); @@ -974,21 +974,21 @@ public class VP8Frame { int i = bc.readTree(Globals.vp8UVModeTree, Globals.vp8KeyFrameUVModeProb); return i; } - + private int readYMode(BoolDecoder bc) throws IOException { int i = bc.readTree(Globals.vp8KeyFrameYModeTree, Globals.vp8KeyFrameYModeProb); return i; } - + public void removeIIOReadProgressListener(IIOReadProgressListener listener) { _listeners.remove(listener); } - + public void setBuffersToCreate (int count) { this.buffersToCreate = 3+count; this.bufferCount=0; } - + private void setupTokenDecoder(BoolDecoder bc, int first_partition_length_in_bytes, long offset) throws IOException { long partitionSize = 0; @@ -1017,7 +1017,7 @@ public class VP8Frame { } tokenBoolDecoder = tokenBoolDecoders.elementAt(0); } - + public void useBufferedImage(BufferedImage dst) { WritableRaster imRas = dst.getWritableTile(0, 0); @@ -1052,7 +1052,7 @@ public class VP8Frame { this.coefProbs=Globals.getDefaultCoefProbs(); tokenBoolDecoders = new Vector<>(); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } } } diff --git a/src/net/sourceforge/plantuml/windowsdot/WindowsDotArchive.java b/src/net/sourceforge/plantuml/windowsdot/WindowsDotArchive.java index 9c84850ab..9b3b2647e 100644 --- a/src/net/sourceforge/plantuml/windowsdot/WindowsDotArchive.java +++ b/src/net/sourceforge/plantuml/windowsdot/WindowsDotArchive.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.windowsdot; @@ -43,7 +43,7 @@ import java.io.InputStream; import java.io.OutputStream; import net.sourceforge.plantuml.brotli.BrotliInputStream; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; public final class WindowsDotArchive { @@ -122,7 +122,7 @@ public final class WindowsDotArchive { extract(tmp); exe = new File(tmp, "dot.exe"); } catch (IOException e) { - Logger.error(e); + Logme.error(e); } return exe; } diff --git a/src/net/sourceforge/plantuml/xmi/CucaDiagramXmiMaker.java b/src/net/sourceforge/plantuml/xmi/CucaDiagramXmiMaker.java index e478e04c1..a698f9a12 100644 --- a/src/net/sourceforge/plantuml/xmi/CucaDiagramXmiMaker.java +++ b/src/net/sourceforge/plantuml/xmi/CucaDiagramXmiMaker.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.xmi; @@ -47,7 +47,7 @@ import net.sourceforge.plantuml.UmlDiagram; import net.sourceforge.plantuml.classdiagram.ClassDiagram; import net.sourceforge.plantuml.cucadiagram.CucaDiagram; import net.sourceforge.plantuml.descdiagram.DescriptionDiagram; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.statediagram.StateDiagram; public final class CucaDiagramXmiMaker { @@ -83,11 +83,11 @@ public final class CucaDiagramXmiMaker { xmi.transformerXml(fos); } catch (ParserConfigurationException e) { Log.error(e.toString()); - Logger.error(e); + Logme.error(e); throw new IOException(e.toString()); } catch (TransformerException e) { Log.error(e.toString()); - Logger.error(e); + Logme.error(e); throw new IOException(e.toString()); } } diff --git a/src/net/sourceforge/plantuml/xmi/SequenceDiagramXmiMaker.java b/src/net/sourceforge/plantuml/xmi/SequenceDiagramXmiMaker.java index 2b312ccd1..13a2760cb 100644 --- a/src/net/sourceforge/plantuml/xmi/SequenceDiagramXmiMaker.java +++ b/src/net/sourceforge/plantuml/xmi/SequenceDiagramXmiMaker.java @@ -15,13 +15,12 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import net.sourceforge.plantuml.log.Logger; - import org.w3c.dom.Document; import net.sourceforge.plantuml.FileFormat; import net.sourceforge.plantuml.api.ImageDataSimple; import net.sourceforge.plantuml.core.ImageData; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.sequencediagram.SequenceDiagram; import net.sourceforge.plantuml.sequencediagram.graphic.FileMaker; import net.sourceforge.plantuml.xml.XmlFactories; @@ -43,7 +42,7 @@ public final class SequenceDiagramXmiMaker implements FileMaker { try { builder = XmlFactories.newDocumentBuilder(); } catch (ParserConfigurationException e) { - Logger.error(e); + Logme.error(e); return imageData; } Document document = builder.newDocument(); @@ -55,18 +54,18 @@ public final class SequenceDiagramXmiMaker implements FileMaker { xmi = new XmiSequenceDiagramArgo(diagram, document); else xmi = new XmiSequenceDiagramStandard(diagram, document); - + xmi.build(); - + try { writeDocument(document, os); } catch (TransformerException | ParserConfigurationException e) { - Logger.error(e); + Logme.error(e); } return imageData; } - - + + @Override public int getNbPages() { return 1; diff --git a/src/net/sourceforge/plantuml/xmlsc/StateDiagramScxmlMaker.java b/src/net/sourceforge/plantuml/xmlsc/StateDiagramScxmlMaker.java index 183be639c..3fb1d776d 100644 --- a/src/net/sourceforge/plantuml/xmlsc/StateDiagramScxmlMaker.java +++ b/src/net/sourceforge/plantuml/xmlsc/StateDiagramScxmlMaker.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.xmlsc; @@ -42,7 +42,7 @@ import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; import net.sourceforge.plantuml.Log; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; import net.sourceforge.plantuml.statediagram.StateDiagram; public final class StateDiagramScxmlMaker { @@ -60,11 +60,11 @@ public final class StateDiagramScxmlMaker { xmi.transformerXml(fos); } catch (ParserConfigurationException e) { Log.error(e.toString()); - Logger.error(e); + Logme.error(e); throw new IOException(e.toString()); } catch (TransformerException e) { Log.error(e.toString()); - Logger.error(e); + Logme.error(e); throw new IOException(e.toString()); } } diff --git a/src/net/sourceforge/plantuml/yaml/YamlDiagramFactory.java b/src/net/sourceforge/plantuml/yaml/YamlDiagramFactory.java index 77150bb61..5ee26f382 100644 --- a/src/net/sourceforge/plantuml/yaml/YamlDiagramFactory.java +++ b/src/net/sourceforge/plantuml/yaml/YamlDiagramFactory.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, 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 @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.yaml; @@ -53,7 +53,7 @@ import net.sourceforge.plantuml.graphic.VerticalAlignment; import net.sourceforge.plantuml.json.JsonValue; import net.sourceforge.plantuml.jsondiagram.JsonDiagram; import net.sourceforge.plantuml.jsondiagram.StyleExtractor; -import net.sourceforge.plantuml.log.Logger; +import net.sourceforge.plantuml.log.Logme; public class YamlDiagramFactory extends PSystemAbstractFactory { @@ -84,7 +84,7 @@ public class YamlDiagramFactory extends PSystemAbstractFactory { } yaml = new SimpleYamlParser().parse(list); } catch (Exception e) { - Logger.error(e); + Logme.error(e); } final JsonDiagram result = new JsonDiagram(style, source, UmlDiagramType.YAML, yaml, highlighted); if (styleExtractor != null) { diff --git a/src/org/stathissideris/ascii2image/core/ConversionOptions.java b/src/org/stathissideris/ascii2image/core/ConversionOptions.java index b2808f039..17b407f6f 100644 --- a/src/org/stathissideris/ascii2image/core/ConversionOptions.java +++ b/src/org/stathissideris/ascii2image/core/ConversionOptions.java @@ -92,13 +92,13 @@ public class ConversionOptions { // } // } catch (ParserConfigurationException e) { // // TODO Auto-generated catch block -// e.printStackTrace(); +// Logme.error(e); // } catch (SAXException e) { // // TODO Auto-generated catch block -// e.printStackTrace(); +// Logme.error(e); // } catch (IOException e) { // // TODO Auto-generated catch block -// e.printStackTrace(); +// Logme.error(e); // } // } } diff --git a/src/org/stathissideris/ascii2image/graphics/BitmapRenderer.java b/src/org/stathissideris/ascii2image/graphics/BitmapRenderer.java index 3ef0ea525..0dd1013a9 100644 --- a/src/org/stathissideris/ascii2image/graphics/BitmapRenderer.java +++ b/src/org/stathissideris/ascii2image/graphics/BitmapRenderer.java @@ -405,7 +405,7 @@ public class BitmapRenderer { // } // g2.drawImage(graphic, bounds.x, bounds.y, null); // } catch (IOException e) { -// e.printStackTrace(); +// Logme.error(e); // } // } diff --git a/src/org/stathissideris/ascii2image/graphics/ImageHandler.java b/src/org/stathissideris/ascii2image/graphics/ImageHandler.java index 6669f43c6..3be6373d0 100644 --- a/src/org/stathissideris/ascii2image/graphics/ImageHandler.java +++ b/src/org/stathissideris/ascii2image/graphics/ImageHandler.java @@ -51,7 +51,7 @@ public class ImageHandler { // tracker.waitForID(0); // } catch (InterruptedException e) { // System.err.println("Failed to load image "+filename); -// e.printStackTrace(); +// Logme.error(e); // } // tracker.removeImage(result, 0); // diff --git a/src/smetana/core/CArray.java b/src/smetana/core/CArray.java index ed8b0c3f5..cc5cfcb6b 100644 --- a/src/smetana/core/CArray.java +++ b/src/smetana/core/CArray.java @@ -39,6 +39,8 @@ package smetana.core; import java.util.ArrayList; import java.util.List; +import net.sourceforge.plantuml.log.Logme; + public class CArray extends UnsupportedC { private final Class cl; @@ -97,7 +99,7 @@ public class CArray extends UnsupportedC { data.add(cl.getDeclaredConstructor().newInstance()); } } catch (Exception e) { - e.printStackTrace(); + Logme.error(e); throw new UnsupportedOperationException(); } }