From f7c578e3ad889c617ac36c68a991f1d34860ebca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Oct 2023 09:33:08 +0000 Subject: [PATCH 01/15] chore(deps-dev): bump @babel/traverse Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.15.4 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] --- .../configure-workflow/package-lock.json | 425 ++++++++++-------- 1 file changed, 239 insertions(+), 186 deletions(-) diff --git a/.github/actions/configure-workflow/package-lock.json b/.github/actions/configure-workflow/package-lock.json index 454475032..44a2cdbce 100644 --- a/.github/actions/configure-workflow/package-lock.json +++ b/.github/actions/configure-workflow/package-lock.json @@ -125,28 +125,20 @@ } }, "node_modules/@babel/generator": { - "version": "7.15.8", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.8.tgz", - "integrity": "sha512-ECmAKstXbp1cvpTTZciZCgfOt6iN64lR0d+euv3UZisU5awfRawOvg07Utn/qBGuH4bRIEZKrA/4LzZyXhZr8g==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "dependencies": { - "@babel/types": "^7.15.6", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/generator/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@babel/helper-compilation-targets": { "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz", @@ -165,39 +157,35 @@ "@babel/core": "^7.0.0" } }, - "node_modules/@babel/helper-function-name": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz", - "integrity": "sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw==", + "node_modules/@babel/helper-environment-visitor": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.15.4", - "@babel/template": "^7.15.4", - "@babel/types": "^7.15.4" - }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz", - "integrity": "sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA==", + "node_modules/@babel/helper-function-name": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "dependencies": { - "@babel/types": "^7.15.4" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz", - "integrity": "sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -246,15 +234,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-module-transforms/node_modules/@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-optimise-call-expression": { "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz", @@ -304,21 +283,30 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz", - "integrity": "sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", - "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" @@ -348,13 +336,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.14.5", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -362,9 +350,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.15.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.8.tgz", - "integrity": "sha512-BRYa3wcQnjS/nqI8Ac94pYYpJfojHVvVXJ97+IDCImX4Jc8W8Xv1+47enbruk+q1etOpsQNwnfFcNGw+gtPGxA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -536,44 +524,46 @@ } }, "node_modules/@babel/template": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz", - "integrity": "sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.14.5", - "@babel/parser": "^7.15.4", - "@babel/types": "^7.15.4" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/template/node_modules/@babel/code-frame": { - "version": "7.15.8", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", - "integrity": "sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { - "@babel/highlight": "^7.14.5" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.4.tgz", - "integrity": "sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.15.4", - "@babel/helper-function-name": "^7.15.4", - "@babel/helper-hoist-variables": "^7.15.4", - "@babel/helper-split-export-declaration": "^7.15.4", - "@babel/parser": "^7.15.4", - "@babel/types": "^7.15.4", + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -582,39 +572,32 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/code-frame": { - "version": "7.15.8", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", - "integrity": "sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { - "@babel/highlight": "^7.14.5" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/types": { - "version": "7.15.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.6.tgz", - "integrity": "sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.14.9", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/types/node_modules/@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", @@ -1414,6 +1397,54 @@ "node": ">=8" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", @@ -8506,22 +8537,15 @@ } }, "@babel/generator": { - "version": "7.15.8", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.8.tgz", - "integrity": "sha512-ECmAKstXbp1cvpTTZciZCgfOt6iN64lR0d+euv3UZisU5awfRawOvg07Utn/qBGuH4bRIEZKrA/4LzZyXhZr8g==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "requires": { - "@babel/types": "^7.15.6", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" } }, "@babel/helper-compilation-targets": { @@ -8536,33 +8560,29 @@ "semver": "^6.3.0" } }, - "@babel/helper-function-name": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz", - "integrity": "sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.15.4", - "@babel/template": "^7.15.4", - "@babel/types": "^7.15.4" - } + "@babel/helper-environment-visitor": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "dev": true }, - "@babel/helper-get-function-arity": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz", - "integrity": "sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA==", + "@babel/helper-function-name": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "requires": { - "@babel/types": "^7.15.4" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" } }, "@babel/helper-hoist-variables": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz", - "integrity": "sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "requires": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.22.5" } }, "@babel/helper-member-expression-to-functions": { @@ -8597,14 +8617,6 @@ "@babel/template": "^7.15.4", "@babel/traverse": "^7.15.4", "@babel/types": "^7.15.6" - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", - "dev": true - } } }, "@babel/helper-optimise-call-expression": { @@ -8644,18 +8656,24 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz", - "integrity": "sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "requires": { - "@babel/types": "^7.15.4" + "@babel/types": "^7.22.5" } }, + "@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true + }, "@babel/helper-validator-identifier": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", - "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true }, "@babel/helper-validator-option": { @@ -8676,20 +8694,20 @@ } }, "@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.14.5", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.15.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.8.tgz", - "integrity": "sha512-BRYa3wcQnjS/nqI8Ac94pYYpJfojHVvVXJ97+IDCImX4Jc8W8Xv1+47enbruk+q1etOpsQNwnfFcNGw+gtPGxA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true }, "@babel/plugin-syntax-async-generators": { @@ -8810,71 +8828,67 @@ } }, "@babel/template": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz", - "integrity": "sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "requires": { - "@babel/code-frame": "^7.14.5", - "@babel/parser": "^7.15.4", - "@babel/types": "^7.15.4" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" }, "dependencies": { "@babel/code-frame": { - "version": "7.15.8", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", - "integrity": "sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "requires": { - "@babel/highlight": "^7.14.5" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" } } } }, "@babel/traverse": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.4.tgz", - "integrity": "sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", "dev": true, "requires": { - "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.15.4", - "@babel/helper-function-name": "^7.15.4", - "@babel/helper-hoist-variables": "^7.15.4", - "@babel/helper-split-export-declaration": "^7.15.4", - "@babel/parser": "^7.15.4", - "@babel/types": "^7.15.4", + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, "dependencies": { "@babel/code-frame": { - "version": "7.15.8", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.15.8.tgz", - "integrity": "sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "requires": { - "@babel/highlight": "^7.14.5" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" } } } }, "@babel/types": { - "version": "7.15.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.6.tgz", - "integrity": "sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.14.9", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", - "dev": true - } } }, "@bcoe/v8-coverage": { @@ -9488,6 +9502,45 @@ } } }, + "@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "@nodelib/fs.scandir": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", From 4adacbabe505437219dc4c02788fb3e7abece5f9 Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Fri, 20 Oct 2023 15:29:27 +0200 Subject: [PATCH 02/15] fix: improve error management for non-GPL version --- .../sourceforge/plantuml/PSystemBuilder.java | 6 ++ .../plantuml/core/DiagramType.java | 12 ++- .../sourceforge/plantuml/core/UmlSource.java | 1 - .../plantuml/eggs/PSystemUnsupported.java | 76 +++++++++++++++++++ .../plantuml/utils/StartUtils.java | 16 ++-- .../sourceforge/plantuml/version/License.java | 59 +++++++++----- 6 files changed, 136 insertions(+), 34 deletions(-) create mode 100644 src/net/sourceforge/plantuml/eggs/PSystemUnsupported.java diff --git a/src/net/sourceforge/plantuml/PSystemBuilder.java b/src/net/sourceforge/plantuml/PSystemBuilder.java index cf47b9009..06c7af62d 100644 --- a/src/net/sourceforge/plantuml/PSystemBuilder.java +++ b/src/net/sourceforge/plantuml/PSystemBuilder.java @@ -66,6 +66,7 @@ import net.sourceforge.plantuml.eggs.PSystemColorsFactory; import net.sourceforge.plantuml.eggs.PSystemEggFactory; import net.sourceforge.plantuml.eggs.PSystemPathFactory; import net.sourceforge.plantuml.eggs.PSystemRIPFactory; +import net.sourceforge.plantuml.eggs.PSystemUnsupported; import net.sourceforge.plantuml.eggs.PSystemWelcomeFactory; import net.sourceforge.plantuml.emoji.PSystemListEmojiFactory; import net.sourceforge.plantuml.error.PSystemError; @@ -146,6 +147,9 @@ public class PSystemBuilder { } final DiagramType diagramType = umlSource.getDiagramType(); + if (diagramType == DiagramType.UNKNOWN) + return new PSystemUnsupported(umlSource); + final List errors = new ArrayList<>(); for (PSystemFactory systemFactory : factories) { if (diagramType != systemFactory.getDiagramType()) @@ -159,6 +163,8 @@ public class PSystemBuilder { } errors.add((PSystemError) sys); } + if (errors.size() == 0) + return new PSystemUnsupported(umlSource); result = PSystemErrorUtils.merge(errors); return result; diff --git a/src/net/sourceforge/plantuml/core/DiagramType.java b/src/net/sourceforge/plantuml/core/DiagramType.java index 2b0e4a4e7..7a045e588 100644 --- a/src/net/sourceforge/plantuml/core/DiagramType.java +++ b/src/net/sourceforge/plantuml/core/DiagramType.java @@ -39,7 +39,7 @@ import net.sourceforge.plantuml.utils.StartUtils; public enum DiagramType { // ::remove folder when __HAXE__ - UML, BPM, DITAA, DOT, PROJECT, JCCKIT, SALT, FLOW, CREOLE, JUNGLE, CUTE, MATH, LATEX, DEFINITION, GANTT, NW, + UML, BPM, DITAA, DOT, PROJECT, JCCKIT, SALT, FLOW, CREOLE, MATH, LATEX, DEFINITION, GANTT, NW, MINDMAP, WBS, WIRE, JSON, GIT, BOARD, YAML, HCL, EBNF, REGEX, FILES, UNKNOWN; static public DiagramType getTypeFromArobaseStart(String s) { @@ -59,11 +59,15 @@ public enum DiagramType { if (StartUtils.startsWithSymbolAnd("startdot", s)) return DOT; + // ::comment when __CORE__ or __MIT__ or __EPL__ or __BSD__ or __ASL__ or __LGPL__ if (StartUtils.startsWithSymbolAnd("startjcckit", s)) return JCCKIT; + // ::done + // ::comment when __CORE__ or __MIT__ or __EPL__ or __BSD__ or __ASL__ if (StartUtils.startsWithSymbolAnd("startditaa", s)) return DITAA; + // ::done if (StartUtils.startsWithSymbolAnd("startproject", s)) return PROJECT; @@ -77,12 +81,6 @@ public enum DiagramType { if (StartUtils.startsWithSymbolAnd("startcreole", s)) return CREOLE; - if (StartUtils.startsWithSymbolAnd("starttree", s)) - return JUNGLE; - - if (StartUtils.startsWithSymbolAnd("startcute", s)) - return CUTE; - if (StartUtils.startsWithSymbolAnd("startmath", s)) return MATH; diff --git a/src/net/sourceforge/plantuml/core/UmlSource.java b/src/net/sourceforge/plantuml/core/UmlSource.java index bda5c52e2..97b5ccc7b 100755 --- a/src/net/sourceforge/plantuml/core/UmlSource.java +++ b/src/net/sourceforge/plantuml/core/UmlSource.java @@ -45,7 +45,6 @@ import net.sourceforge.plantuml.klimt.creole.Display; import net.sourceforge.plantuml.regex.Matcher2; import net.sourceforge.plantuml.regex.MyPattern; import net.sourceforge.plantuml.regex.Pattern2; -import net.sourceforge.plantuml.text.BackSlash; import net.sourceforge.plantuml.text.StringLocated; import net.sourceforge.plantuml.utils.LineLocation; import net.sourceforge.plantuml.utils.StartUtils; diff --git a/src/net/sourceforge/plantuml/eggs/PSystemUnsupported.java b/src/net/sourceforge/plantuml/eggs/PSystemUnsupported.java new file mode 100644 index 000000000..0b7223c04 --- /dev/null +++ b/src/net/sourceforge/plantuml/eggs/PSystemUnsupported.java @@ -0,0 +1,76 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2024, Arnaud Roques + * + * Project Info: https://plantuml.com + * + * If you like this project or if you find it useful, you can support us at: + * + * https://plantuml.com/patreon (only 1$ per month!) + * https://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.eggs; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import net.sourceforge.plantuml.FileFormatOption; +import net.sourceforge.plantuml.PlainDiagram; +import net.sourceforge.plantuml.core.DiagramDescription; +import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.klimt.shape.GraphicStrings; +import net.sourceforge.plantuml.klimt.shape.TextBlock; +import net.sourceforge.plantuml.klimt.shape.UDrawable; +import net.sourceforge.plantuml.version.License; +import net.sourceforge.plantuml.version.Version; + +public class PSystemUnsupported extends PlainDiagram { + + private final List strings = new ArrayList<>(); + + public PSystemUnsupported(UmlSource source) { + super(source); + strings.add("Diagram not supported by this release of PlantUML"); + strings.add(Version.fullDescription()); + strings.add("License " + new License().toString()); + } + + @Override + protected UDrawable getRootDrawable(FileFormatOption fileFormatOption) throws IOException { + return getGraphicStrings(); + } + + public TextBlock getGraphicStrings() { + return GraphicStrings.createBlackOnWhite(strings); + } + + public DiagramDescription getDescription() { + return new DiagramDescription("(Unsupported)"); + } + +} diff --git a/src/net/sourceforge/plantuml/utils/StartUtils.java b/src/net/sourceforge/plantuml/utils/StartUtils.java index 2f7b92c7c..f71cbfb42 100644 --- a/src/net/sourceforge/plantuml/utils/StartUtils.java +++ b/src/net/sourceforge/plantuml/utils/StartUtils.java @@ -55,14 +55,14 @@ public class StartUtils { boolean inside = false; for (int i = 0; i < s.length(); i++) { final String tmp = s.substring(i, s.length()); - if (startsWithSymbolAnd("start", tmp)) { + if (startsWithSymbolAnd("start", tmp)) return s.substring(0, i); - } + final String single = s.substring(i, i + 1); if (inside) { - if (single.equals(">")) { + if (single.equals(">")) inside = false; - } + continue; } if (single.equals("<")) { @@ -81,9 +81,9 @@ public class StartUtils { public static boolean isArobaseStartDiagram(String s) { final String s2 = StringUtils.trinNoTrace(s); - if (s2.startsWith("@") == false && s2.startsWith("\\") == false) { + if (s2.startsWith("@") == false && s2.startsWith("\\") == false) return false; - } + return DiagramType.getTypeFromArobaseStart(s2) != DiagramType.UNKNOWN; } @@ -97,9 +97,9 @@ public class StartUtils { public static boolean startOrEnd(final StringLocated s) { final String s2 = StringUtils.trinNoTrace(s.getString()); - if (s2.startsWith("@") == false && s2.startsWith("\\") == false) { + if (s2.startsWith("@") == false && s2.startsWith("\\") == false) return false; - } + return startsWithSymbolAnd("end", s2) || DiagramType.getTypeFromArobaseStart(s2) != DiagramType.UNKNOWN; } diff --git a/src/net/sourceforge/plantuml/version/License.java b/src/net/sourceforge/plantuml/version/License.java index a4875f1d5..c6ac3c608 100644 --- a/src/net/sourceforge/plantuml/version/License.java +++ b/src/net/sourceforge/plantuml/version/License.java @@ -58,7 +58,7 @@ public class License { @Override public String toString() { - // ::comment when __CORE__ or __MIT__ or __EPL__ or __BSD__ or __ASL__ or __LGPL__ + // ::comment when __CORE__ or __MIT__ or __EPL__ or __BSD__ or __ASL__ or __LGPL__ or __GPLV2__ return "GPL"; // ::done // ::uncomment when __CORE__ or __MIT__ @@ -76,6 +76,9 @@ public class License { // ::uncomment when __LGPL__ // return "LGPL"; // ::done + // ::uncomment when __GPLV2__ + // return "GPLv2"; + // ::done } public static License getCurrent() { @@ -155,7 +158,7 @@ public class License { } private void end3(final LicenseInfo licenseInfo, final List text) { - // ::comment when __CORE__ or __MIT__ or __EPL__ or __BSD__ or __ASL__ or __LGPL__ + // ::comment when __CORE__ or __MIT__ or __EPL__ or __BSD__ or __ASL__ or __LGPL__ or __GPLV2__ text.add("PlantUML is free software; you can redistribute it and/or modify it"); text.add("under the terms of the GNU General Public License as published by"); text.add("the Free Software Foundation, either version 3 of the License, or"); @@ -188,6 +191,9 @@ public class License { // ::uncomment when __LGPL__ // addLgpl(licenseInfo, text); // ::done + // ::uncomment when __GPLV2__ + // addGplv2(licenseInfo, text); + // ::done text.add(" "); if (licenseInfo.isValid() == false) { @@ -370,22 +376,39 @@ public class License { // } // ::done -// ::uncomment when __LGPL__ -// private void addLgpl(final LicenseInfo licenseInfo, final List text) { -// text.add("PlantUML is free software; you can redistribute it and/or modify it"); -// text.add("under the terms of the GNU Lesser General Public License as published by"); -// text.add("the Free Software Foundation, either version 3 of the License, or"); -// text.add("(at your option) any later version."); -// text.add(" "); -// text.add("PlantUML distributed in the hope that it will be useful, but"); -// text.add("WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY"); -// text.add("or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public"); -// text.add("License for more details."); -// text.add(" "); -// text.add("You should have received a copy of the GNU Lesser General Public License"); -// text.add("along with this library. If not, see ."); -// } -// ::done + // ::uncomment when __LGPL__ +// private void addLgpl(final LicenseInfo licenseInfo, final List text) { +// text.add("PlantUML is free software; you can redistribute it and/or modify it"); +// text.add("under the terms of the GNU Lesser General Public License as published by"); +// text.add("the Free Software Foundation, either version 3 of the License, or"); +// text.add("(at your option) any later version."); +// text.add(" "); +// text.add("PlantUML distributed in the hope that it will be useful, but"); +// text.add("WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY"); +// text.add("or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public"); +// text.add("License for more details."); +// text.add(" "); +// text.add("You should have received a copy of the GNU Lesser General Public License"); +// text.add("along with this library. If not, see ."); +// } + // ::done + + // ::uncomment when __GPLV2__ +// private void addGplv2(final LicenseInfo licenseInfo, final List text) { +// text.add("PlantUML is free software; you can redistribute it and/or modify it"); +// text.add("under the terms of the GNU General Public License V2 as published by"); +// text.add("the Free Software Foundation, either version 2 of the License, or"); +// text.add("(at your option) any later version."); +// text.add(" "); +// text.add("PlantUML distributed in the hope that it will be useful, but"); +// text.add("WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY"); +// text.add("or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public"); +// text.add("License for more details."); +// text.add(" "); +// text.add("You should have received a copy of the GNU Lesser General Public License"); +// text.add("along with this library. If not, see ."); +// } + // ::done public static void addLicenseInfo(final List text, LicenseInfo licenseInfo) { if (licenseInfo.getLicenseType() == LicenseType.NAMED) { From 1e6ffb0bec9e02d0bc3b48d9ab5f53b876032a33 Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Fri, 20 Oct 2023 15:44:00 +0200 Subject: [PATCH 03/15] fix: add some hard-coded dot path for MacOS https://github.com/plantuml/plantuml/issues/1583 --- src/net/sourceforge/plantuml/dot/GraphvizLinux.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/net/sourceforge/plantuml/dot/GraphvizLinux.java b/src/net/sourceforge/plantuml/dot/GraphvizLinux.java index a1db5a1bd..c3282131d 100644 --- a/src/net/sourceforge/plantuml/dot/GraphvizLinux.java +++ b/src/net/sourceforge/plantuml/dot/GraphvizLinux.java @@ -48,10 +48,10 @@ class GraphvizLinux extends AbstractGraphviz { @Override protected File specificDotExe() { - final File all[] = new File[] { new File("/usr/local/bin/dot"), new File("/usr/bin/dot"), - new File("/opt/homebrew/bin/dot") }; + final File all[] = new File[] { new File("/usr/local/bin/dot"), new File("/opt/homebrew/bin/dot"), + new File("/opt/homebrew/opt/graphviz/bin/dot"), new File("/usr/bin/dot") }; for (File f : all) - if (f.exists()) + if (f.exists() && f.canRead() && f.canExecute()) return f; return new File("/opt/local/bin/dot"); } From 8b092894ed5ea0e571ef329597f83936101d5275 Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Fri, 20 Oct 2023 15:58:10 +0200 Subject: [PATCH 04/15] chore: version 1.2023.12 --- src/net/sourceforge/plantuml/version/Version.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net/sourceforge/plantuml/version/Version.java b/src/net/sourceforge/plantuml/version/Version.java index 472c3e0c6..86c31a4be 100644 --- a/src/net/sourceforge/plantuml/version/Version.java +++ b/src/net/sourceforge/plantuml/version/Version.java @@ -46,7 +46,7 @@ public class Version { // Warning, "version" should be the same in gradle.properties and Version.java // Any idea anyone how to magically synchronize those :-) ? - private static final String version = "1.2023.12beta1"; + private static final String version = "1.2023.12"; public static String versionString() { return version; @@ -80,7 +80,7 @@ public class Version { } public static long compileTime() { - return 1694629593289L; + return 1697809794384L; } public static String compileTimeString() { From 2b2f29191113b17be0c35e8a503643e0206a9fcc Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Fri, 20 Oct 2023 16:39:19 +0200 Subject: [PATCH 05/15] chore: gradle.properties has been skipped --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 11d4e612e..4a0fe315d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ # Warning, "version" should be the same in gradle.properties and Version.java # Any idea anyone how to magically synchronize those :-) ? -version = 1.2023.12beta1 +version = 1.2023.12 org.gradle.workers.max = 3 \ No newline at end of file From 920bb2b33cec591282958d31c7193523ba0c85a2 Mon Sep 17 00:00:00 2001 From: PlantUML Date: Sat, 21 Oct 2023 20:48:16 +0200 Subject: [PATCH 06/15] Proposal for attic.md --- attic.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 attic.md diff --git a/attic.md b/attic.md new file mode 100644 index 000000000..2c8d1d1d9 --- /dev/null +++ b/attic.md @@ -0,0 +1,6 @@ +# Historical Code Archive + +This document catalogs code that was previously part of PlantUML but has since been deprecated and removed due to its lack of use. +It serves as a historical reference to ensure we remember and understand past decisions. + +- [logo](https://github.com/plantuml/plantuml/tree/v1.2023.12/src/net/sourceforge/plantuml/logo) From 38ea5ae82335e9af41b56782caffd9eed99192f3 Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Sun, 22 Oct 2023 10:33:24 +0200 Subject: [PATCH 07/15] chore: prepare next development cycle --- gradle.properties | 2 +- src/net/sourceforge/plantuml/version/Version.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 4a0fe315d..39994fd2b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ # Warning, "version" should be the same in gradle.properties and Version.java # Any idea anyone how to magically synchronize those :-) ? -version = 1.2023.12 +version = 1.2023.13beta1 org.gradle.workers.max = 3 \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/version/Version.java b/src/net/sourceforge/plantuml/version/Version.java index 86c31a4be..f4b8d4cd1 100644 --- a/src/net/sourceforge/plantuml/version/Version.java +++ b/src/net/sourceforge/plantuml/version/Version.java @@ -46,7 +46,7 @@ public class Version { // Warning, "version" should be the same in gradle.properties and Version.java // Any idea anyone how to magically synchronize those :-) ? - private static final String version = "1.2023.12"; + private static final String version = "1.2023.13beta1"; public static String versionString() { return version; From 8f5c3379ed641465e34458b2617c818814bb648e Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Sun, 22 Oct 2023 11:28:29 +0200 Subject: [PATCH 08/15] refactor: remove unused logo dead code --- attic.md | 3 +- .../plantuml/logo/LogoScanner.java | 174 ------------- .../sourceforge/plantuml/logo/LogoToken.java | 62 ----- .../plantuml/logo/PSystemLogo.java | 109 --------- .../plantuml/logo/PSystemLogoFactory.java | 60 ----- .../plantuml/logo/TinyJavaLogo.java | 229 ------------------ .../plantuml/logo/TurtleGraphicsPane.java | 211 ---------------- 7 files changed, 2 insertions(+), 846 deletions(-) delete mode 100644 src/net/sourceforge/plantuml/logo/LogoScanner.java delete mode 100644 src/net/sourceforge/plantuml/logo/LogoToken.java delete mode 100644 src/net/sourceforge/plantuml/logo/PSystemLogo.java delete mode 100644 src/net/sourceforge/plantuml/logo/PSystemLogoFactory.java delete mode 100644 src/net/sourceforge/plantuml/logo/TinyJavaLogo.java delete mode 100644 src/net/sourceforge/plantuml/logo/TurtleGraphicsPane.java diff --git a/attic.md b/attic.md index 2c8d1d1d9..ddfb50449 100644 --- a/attic.md +++ b/attic.md @@ -3,4 +3,5 @@ This document catalogs code that was previously part of PlantUML but has since been deprecated and removed due to its lack of use. It serves as a historical reference to ensure we remember and understand past decisions. -- [logo](https://github.com/plantuml/plantuml/tree/v1.2023.12/src/net/sourceforge/plantuml/logo) +- [logo language](https://github.com/plantuml/plantuml/tree/v1.2023.12/src/net/sourceforge/plantuml/logo) +- [mjpeg export](https://github.com/plantuml/plantuml/tree/v1.2023.12/src/net/sourceforge/plantuml/mjpeg) diff --git a/src/net/sourceforge/plantuml/logo/LogoScanner.java b/src/net/sourceforge/plantuml/logo/LogoScanner.java deleted file mode 100644 index b5ac41de8..000000000 --- a/src/net/sourceforge/plantuml/logo/LogoScanner.java +++ /dev/null @@ -1,174 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2024, Arnaud Roques - * - * Project Info: https://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * https://plantuml.com/patreon (only 1$ per month!) - * https://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.logo; - -import java.util.HashMap; -import java.util.Map; - -class LogoScanner { - // ::remove folder when __HAXE__ - // ::remove folder when __CORE__ - // ::remove folder when __MIT__ or __EPL__ or __BSD__ or __ASL__ or __LGPL__ - final private Map keywordTable = new HashMap(); - private char sourceString[]; - private int sourceLength; - private int i; - - public LogoScanner() { - keywordTable.put("forward", LogoToken.FORWARD); - keywordTable.put("fd", LogoToken.FORWARD); - keywordTable.put("back", LogoToken.BACK); - keywordTable.put("bk", LogoToken.BACK); - keywordTable.put("right", LogoToken.RIGHT); - keywordTable.put("rt", LogoToken.RIGHT); - keywordTable.put("left", LogoToken.LEFT); - keywordTable.put("lt", LogoToken.LEFT); - keywordTable.put("penup", LogoToken.PENUP); - keywordTable.put("pu", LogoToken.PENUP); - keywordTable.put("pendown", LogoToken.PENDOWN); - keywordTable.put("pd", LogoToken.PENDOWN); - keywordTable.put("hideturtle", LogoToken.HIDETURTLE); - keywordTable.put("ht", LogoToken.HIDETURTLE); - keywordTable.put("showturtle", LogoToken.SHOWTURTLE); - keywordTable.put("st", LogoToken.SHOWTURTLE); - keywordTable.put("clearscreen", LogoToken.CLEARSCREEN); - keywordTable.put("cs", LogoToken.CLEARSCREEN); - keywordTable.put("repeat", LogoToken.REPEAT); - keywordTable.put("rep", LogoToken.REPEAT); - keywordTable.put("to", LogoToken.TO); - keywordTable.put("setpc", LogoToken.SETPC); - keywordTable.put("pc", LogoToken.SETPC); - } - - public int getPosition() { - return i; - } - - public void setPosition(int newPosition) { - if (i >= 0 && i <= sourceLength) { - i = newPosition; - } else { - i = sourceLength; - } - } - - public void setSourceString(String newSourceString) { - sourceLength = newSourceString.length(); - sourceString = newSourceString.concat("\0").toCharArray(); - i = 0; - } - - public String getSourceString() { - return new String(sourceString); - } - - public String getRestAsString() { - skipWhitespace(); - final String rest = new String(sourceString, i, sourceLength - i + 1); - i = sourceLength; - return rest; - } - - void skipWhitespace() { - char c; - do { - c = sourceString[i++]; - } while (c == ' ' || c == '\t'); - i--; - } - - public LogoToken getToken() { - final LogoToken token = new LogoToken(); - final StringBuilder lexeme = new StringBuilder(); - - if (i >= sourceLength) { - token.kind = LogoToken.END_OF_INPUT; - return token; - } - - // Skip whitespace. - skipWhitespace(); - char c = sourceString[i++]; - - // Now figure out what kind of token we've got. - if (c == '[' || c == ']') { - token.kind = c; - token.lexeme = String.valueOf(c); - } else if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) { - do { - lexeme.append(c); - c = sourceString[i++]; - } while ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')); - i--; - token.lexeme = lexeme.toString(); - token.kind = LogoToken.IDENTIFIER; - final Integer keyword = keywordTable.get(token.lexeme); - if (keyword != null) { - token.kind = keyword; - } - } else if (c >= '0' && c <= '9') { - do { - lexeme.append(c); - c = sourceString[i++]; - } while (c >= '0' && c <= '9'); - boolean hasDecimalPart = false; - if (c == '.') { - do { - lexeme.append(c); - c = sourceString[i++]; - } while (c >= '0' && c <= '9'); - hasDecimalPart = true; - } - i--; - token.lexeme = lexeme.toString(); - token.value = Float.parseFloat(token.lexeme); - if (hasDecimalPart) { - token.kind = LogoToken.FLOAT; - } else { - token.kind = LogoToken.INTEGER; - token.intValue = Integer.parseInt(token.lexeme); - } - } else if (c == 0) { - i--; - token.kind = LogoToken.END_OF_INPUT; - } else { - i--; - token.kind = LogoToken.INVALID_TOKEN; - } - - return token; - } -} diff --git a/src/net/sourceforge/plantuml/logo/LogoToken.java b/src/net/sourceforge/plantuml/logo/LogoToken.java deleted file mode 100644 index cdea195fc..000000000 --- a/src/net/sourceforge/plantuml/logo/LogoToken.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2024, Arnaud Roques - * - * Project Info: https://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * https://plantuml.com/patreon (only 1$ per month!) - * https://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.logo; - -class LogoToken { - public final static int END_OF_INPUT = 256; - public final static int INVALID_TOKEN = 257; - public final static int IDENTIFIER = 258; - public final static int FLOAT = 259; - public final static int INTEGER = 270; - - public final static int FORWARD = 260; - public final static int BACK = 261; - public final static int LEFT = 262; - public final static int RIGHT = 263; - public final static int PENUP = 264; - public final static int PENDOWN = 265; - public final static int HIDETURTLE = 266; - public final static int SHOWTURTLE = 267; - public final static int CLEARSCREEN = 268; - public final static int REPEAT = 269; - public final static int TO = 271; - public final static int SETPC = 272; - - public int kind; - public String lexeme; - public float value; - public int intValue; -} diff --git a/src/net/sourceforge/plantuml/logo/PSystemLogo.java b/src/net/sourceforge/plantuml/logo/PSystemLogo.java deleted file mode 100644 index e3f99da2d..000000000 --- a/src/net/sourceforge/plantuml/logo/PSystemLogo.java +++ /dev/null @@ -1,109 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2024, Arnaud Roques - * - * Project Info: https://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * https://plantuml.com/patreon (only 1$ per month!) - * https://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.logo; - -import java.awt.Color; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; - -import net.sourceforge.plantuml.AbstractPSystem; -import net.sourceforge.plantuml.EmptyImageBuilder; -import net.sourceforge.plantuml.FileFormat; -import net.sourceforge.plantuml.FileFormatOption; -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.klimt.color.ColorMapper; -import net.sourceforge.plantuml.klimt.color.HColors; -import net.sourceforge.plantuml.klimt.drawing.UGraphic; -import net.sourceforge.plantuml.klimt.drawing.g2d.UGraphicG2d; -import net.sourceforge.plantuml.klimt.font.StringBounder; -import net.sourceforge.plantuml.png.PngIO; - -public class PSystemLogo extends AbstractPSystem { - - private final List lines = new ArrayList<>(); - - public PSystemLogo(UmlSource source) { - super(source); - } - - @Override - final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat) - throws IOException { - final int width = 640; - final int height = 480; - final StringBounder stringBounder = FileFormat.PNG.getDefaultStringBounder(); - final EmptyImageBuilder builder = new EmptyImageBuilder(fileFormat.getWatermark(), width, height, Color.WHITE, - stringBounder); - final BufferedImage im = builder.getBufferedImage(); - final UGraphic ug = new UGraphicG2d(HColors.WHITE, ColorMapper.IDENTITY, stringBounder, builder.getGraphics2D(), - 1.0, FileFormat.PNG); - ((UGraphicG2d) ug).setBufferedImage(im); - - final TurtleGraphicsPane turtleGraphicsPane = new TurtleGraphicsPane(width, height); - final TinyJavaLogo tinyJavaLogo = new TinyJavaLogo(turtleGraphicsPane); - for (String line : lines) { - tinyJavaLogo.doCommandLine(line); - } - turtleGraphicsPane.paint(ug); - PngIO.write(im, ColorMapper.IDENTITY, os, null, 96); - return new ImageDataSimple(im.getWidth(), im.getHeight()); - } - - // private GraphicStrings getGraphicStrings() throws IOException { - // final UFont font = new UFont("SansSerif", Font.PLAIN, 12); - // final GraphicStrings result = new GraphicStrings(strings, font, - // HtmlColorUtils.BLACK, HtmlColorUtils.WHITE, - // image, - // GraphicPosition.BOTTOM, false); - // result.setMinWidth(200); - // return result; - // } - - public DiagramDescription getDescription() { - return new DiagramDescription("(Logo)"); - } - - public void doCommandLine(String line) { - lines.add(line); - } - -} diff --git a/src/net/sourceforge/plantuml/logo/PSystemLogoFactory.java b/src/net/sourceforge/plantuml/logo/PSystemLogoFactory.java deleted file mode 100644 index 68ced376c..000000000 --- a/src/net/sourceforge/plantuml/logo/PSystemLogoFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2024, Arnaud Roques - * - * Project Info: https://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * https://plantuml.com/patreon (only 1$ per month!) - * https://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.logo; - -import net.sourceforge.plantuml.command.PSystemBasicFactory; -import net.sourceforge.plantuml.core.UmlSource; - -public class PSystemLogoFactory extends PSystemBasicFactory { - - @Override - public PSystemLogo initDiagram(UmlSource source, String startLine) { - return null; - } - - @Override - public PSystemLogo executeLine(UmlSource source, PSystemLogo system, String line) { - if (system == null && line.equalsIgnoreCase("logo")) { - return new PSystemLogo(source); - } - if (system == null) { - return null; - } - system.doCommandLine(line); - return system; - } - -} diff --git a/src/net/sourceforge/plantuml/logo/TinyJavaLogo.java b/src/net/sourceforge/plantuml/logo/TinyJavaLogo.java deleted file mode 100644 index 18de02723..000000000 --- a/src/net/sourceforge/plantuml/logo/TinyJavaLogo.java +++ /dev/null @@ -1,229 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2024, Arnaud Roques - * - * Project Info: https://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * https://plantuml.com/patreon (only 1$ per month!) - * https://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.logo; - -import java.util.HashMap; -import java.util.Map; - -import net.sourceforge.plantuml.klimt.color.HColor; -import net.sourceforge.plantuml.klimt.color.HColorSet; - -public class TinyJavaLogo { - private final LogoScanner scanner = new LogoScanner(); - - private final TurtleGraphicsPane turtleGraphicsPane; - - private final Map dictionary = new HashMap(); - private HColor penColor; - - public TinyJavaLogo(TurtleGraphicsPane turtleGraphicsPane) { - this.turtleGraphicsPane = turtleGraphicsPane; - } - - private void message(String messageText) { - // turtleGraphicsPane.message(messageText); - } - - private void error(String messageText) { - turtleGraphicsPane.message("Error: " + messageText); - } - - private void parseCommandBlock(int nestLevel) { - String commandName; - String code; - LogoToken token = scanner.getToken(); - while (token.kind != LogoToken.END_OF_INPUT && token.kind != LogoToken.INVALID_TOKEN) { - switch (token.kind) { - case LogoToken.FORWARD: - token = scanner.getToken(); - if (token.kind == LogoToken.FLOAT || token.kind == LogoToken.INTEGER) { - turtleGraphicsPane.forward(token.value); - token = scanner.getToken(); - } else { - error("FORWARD requires distance"); - return; - } - break; - - case LogoToken.BACK: - token = scanner.getToken(); - if (token.kind == LogoToken.FLOAT || token.kind == LogoToken.INTEGER) { - turtleGraphicsPane.back(token.value); - token = scanner.getToken(); - } else { - error("BACK requires distance"); - return; - } - break; - - case LogoToken.LEFT: - token = scanner.getToken(); - if (token.kind == LogoToken.FLOAT || token.kind == LogoToken.INTEGER) { - turtleGraphicsPane.left(token.value); - token = scanner.getToken(); - } else { - error("LEFT requires turn angle"); - return; - } - break; - - case LogoToken.RIGHT: - token = scanner.getToken(); - if (token.kind == LogoToken.FLOAT || token.kind == LogoToken.INTEGER) { - turtleGraphicsPane.right(token.value); - token = scanner.getToken(); - } else { - error("RIGHT requires turn angle"); - return; - } - break; - - case LogoToken.PENUP: - turtleGraphicsPane.penUp(); - token = scanner.getToken(); - break; - - case LogoToken.PENDOWN: - turtleGraphicsPane.penDown(); - token = scanner.getToken(); - break; - - case LogoToken.HIDETURTLE: - turtleGraphicsPane.hideTurtle(); - token = scanner.getToken(); - break; - - case LogoToken.SHOWTURTLE: - turtleGraphicsPane.showTurtle(); - token = scanner.getToken(); - break; - - case LogoToken.CLEARSCREEN: - turtleGraphicsPane.clearScreen(); - token = scanner.getToken(); - break; - - case LogoToken.REPEAT: - token = scanner.getToken(); - if (token.kind != LogoToken.INTEGER) { - error("REPEAT requires positive integer count"); - return; - } - int count = token.intValue; - token = scanner.getToken(); - if (token.kind != '[') { - error("REPEAT requires block in []"); - return; - } - final int blockStart = scanner.getPosition(); - while (count-- > 0) { - scanner.setPosition(blockStart); - parseCommandBlock(nestLevel + 1); - } - token = scanner.getToken(); - break; - - case LogoToken.TO: - token = scanner.getToken(); - if (token.kind != LogoToken.IDENTIFIER) { - error("TO requires name for new definition"); - return; - } - commandName = token.lexeme; - if (dictionary.get(commandName) == null) { - message("Defining new command " + commandName); - } else { - message("Redefining command " + commandName); - } - code = scanner.getRestAsString(); - dictionary.put(commandName, code); - token = scanner.getToken(); - break; - - case LogoToken.IDENTIFIER: - commandName = token.lexeme; - code = dictionary.get(commandName); - if (code == null) { - error("Undefined command " + commandName); - return; - } - final String savedCommand = scanner.getSourceString(); - final int savedPosition = scanner.getPosition(); - scanner.setSourceString(code); - parseCommandBlock(0); - scanner.setSourceString(savedCommand); - scanner.setPosition(savedPosition); - token = scanner.getToken(); - break; - - case LogoToken.SETPC: - token = scanner.getToken(); - String s = token.lexeme; - final HColor newPenColor = s == null ? null : HColorSet.instance().getColorOrWhite(s); - if (newPenColor == null) { - error("Unrecognized color name"); - return; - } - penColor = newPenColor; - turtleGraphicsPane.setPenColor(penColor); - token = scanner.getToken(); - break; - - case '[': - token = scanner.getToken(); - break; - - case ']': - if (nestLevel == 0) { - error("] without matching ["); - token = scanner.getToken(); - return; - } - return; - - default: - error("Unrecognized symbol in input"); - return; - } - } - } - - public void doCommandLine(String commandLine) { - message(commandLine); - scanner.setSourceString(commandLine); - parseCommandBlock(0); - } -} diff --git a/src/net/sourceforge/plantuml/logo/TurtleGraphicsPane.java b/src/net/sourceforge/plantuml/logo/TurtleGraphicsPane.java deleted file mode 100644 index 5101d5572..000000000 --- a/src/net/sourceforge/plantuml/logo/TurtleGraphicsPane.java +++ /dev/null @@ -1,211 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2024, Arnaud Roques - * - * Project Info: https://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * https://plantuml.com/patreon (only 1$ per month!) - * https://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.logo; - -import java.awt.Font; -import java.awt.geom.Rectangle2D; -import java.util.ArrayList; -import java.util.List; - -import net.sourceforge.plantuml.klimt.UTranslate; -import net.sourceforge.plantuml.klimt.color.HColor; -import net.sourceforge.plantuml.klimt.color.HColorSet; -import net.sourceforge.plantuml.klimt.color.HColors; -import net.sourceforge.plantuml.klimt.creole.Display; -import net.sourceforge.plantuml.klimt.drawing.UGraphic; -import net.sourceforge.plantuml.klimt.font.FontConfiguration; -import net.sourceforge.plantuml.klimt.font.UFont; -import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment; -import net.sourceforge.plantuml.klimt.geom.XDimension2D; -import net.sourceforge.plantuml.klimt.shape.TextBlock; -import net.sourceforge.plantuml.klimt.shape.ULine; -import net.sourceforge.plantuml.klimt.shape.UPolygon; -import net.sourceforge.plantuml.klimt.sprite.SpriteContainerEmpty; - -class TurtleGraphicsPane { - final private double width; - final private double height; - private double x; - private double y; - private double turtleDirection = 90; - private boolean penIsDown = true; - private boolean showTurtle = true; - private HColor penColor = HColors.BLACK; - private List lines = new ArrayList(); - private List colors = new ArrayList<>(); - - private String message; - - public TurtleGraphicsPane(int width, int height) { - this.width = width; - this.height = height; - clearScreen(); - } - - public void clearScreen() { - x = width / 2; - y = -height / 2; - turtleDirection = 90; - lines.clear(); - colors.clear(); - } - - private double dtor(double degrees) { - return degrees * Math.PI / 180.0; - } - - private void drawTurtle(UGraphic ug) { - if (showTurtle == false) { - return; - } - final UPolygon poly = new UPolygon(); - double size = 2; - double deltax = 4.5 * size; - poly.addPoint(0 * size - deltax, 0); - poly.addPoint(0 * size - deltax, -2 * size); - poly.addPoint(1 * size - deltax, -2 * size); - poly.addPoint(1 * size - deltax, -4 * size); - poly.addPoint(2 * size - deltax, -4 * size); - poly.addPoint(2 * size - deltax, -6 * size); - poly.addPoint(3 * size - deltax, -6 * size); - poly.addPoint(3 * size - deltax, -8 * size); - poly.addPoint(4 * size - deltax, -8 * size); - poly.addPoint(4 * size - deltax, -9 * size); - poly.addPoint(5 * size - deltax, -9 * size); - poly.addPoint(5 * size - deltax, -8 * size); - poly.addPoint(6 * size - deltax, -8 * size); - poly.addPoint(6 * size - deltax, -6 * size); - poly.addPoint(7 * size - deltax, -6 * size); - poly.addPoint(7 * size - deltax, -4 * size); - poly.addPoint(8 * size - deltax, -4 * size); - poly.addPoint(8 * size - deltax, -2 * size); - poly.addPoint(9 * size - deltax, -2 * size); - poly.addPoint(9 * size - deltax, 0); - poly.addPoint(0 * size - deltax, 0); - final double angle = -dtor(turtleDirection - 90); - poly.rotate(angle); - // ug.setAntiAliasing(false); - final HColorSet htmlColorSet = HColorSet.instance(); - final HColor turtleColor1 = htmlColorSet.getColorOrWhite("OliveDrab"); - final HColor turtleColor2 = htmlColorSet.getColorOrWhite("MediumSpringGreen"); - - ug.apply(turtleColor1).apply(turtleColor2.bg()).apply(new UTranslate(x, -y)).draw(poly); - // ug.setAntiAliasing(true); - } - - public void showTurtle() { - showTurtle = true; - } - - public void hideTurtle() { - showTurtle = false; - } - - public void setPenColor(HColor newPenColor) { - penColor = newPenColor; - } - - void addLine(double x1, double y1, double x2, double y2) { - lines.add(new Rectangle2D.Double(x1, y1, x2, y2)); - colors.add(penColor); - } - - public void forward(double distance) { - double angle = dtor(turtleDirection); - double newX = x + distance * Math.cos(angle); - double newY = y + distance * Math.sin(angle); - if (penIsDown) { - addLine(x, y, newX, newY); - x = newX; - y = newY; - } else { - x = newX; - y = newY; - } - } - - public void back(double distance) { - forward(-distance); - } - - public void left(double turnAngle) { - turtleDirection += turnAngle; - while (turtleDirection > 360) { - turtleDirection -= 360; - } - while (turtleDirection < 0) { - turtleDirection += 360; - } - } - - public void right(double turnAngle) { - left(-turnAngle); - } - - public void penUp() { - penIsDown = false; - } - - public void penDown() { - penIsDown = true; - } - - public void paint(UGraphic ug) { - int n = lines.size(); - - for (int i = 0; i < n; i++) { - final HColor color = colors.get(i); - final Rectangle2D.Double r = lines.get(i); - final ULine line = new ULine(r.width - r.x, -r.height + r.y); - ug.apply(color).apply(new UTranslate(r.x, -r.y)).draw(line); - - } - drawTurtle(ug); - if (message != null) { - final FontConfiguration font = FontConfiguration.blackBlueTrue(UFont.build("", Font.PLAIN, 14)); - final TextBlock text = Display.create(message).create(font, HorizontalAlignment.LEFT, - new SpriteContainerEmpty()); - final XDimension2D dim = text.calculateDimension(ug.getStringBounder()); - final double textHeight = dim.getHeight(); - text.drawU(ug.apply(UTranslate.dy((height - textHeight)))); - } - } - - public void message(String messageText) { - this.message = messageText; - } - -} From e92dcd400b06e386381ebcd57e7467996b862282 Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Sun, 22 Oct 2023 11:54:17 +0200 Subject: [PATCH 09/15] refactor: remove unused code --- attic.md | 2 + src/net/atmp/ImageBuilder.java | 154 +--- src/net/sourceforge/plantuml/FileFormat.java | 8 - .../sourceforge/plantuml/TitledDiagram.java | 21 - src/net/sourceforge/plantuml/UmlDiagram.java | 25 - .../plantuml/anim/AffineTransformation.java | 157 ---- .../sourceforge/plantuml/anim/Animation.java | 99 --- .../plantuml/anim/AnimationDecoder.java | 78 -- .../plantuml/anim/AnimationScript.java | 71 -- .../command/CommandAffineTransform.java | 71 -- .../CommandAffineTransformMultiline.java | 60 -- .../plantuml/command/CommonCommands.java | 2 - src/net/sourceforge/plantuml/jasic/Jasic.java | 829 ------------------ .../klimt/drawing/g2d/UGraphicG2d.java | 32 +- .../plantuml/mjpeg/MJPEGGenerator.java | 493 ----------- 15 files changed, 18 insertions(+), 2084 deletions(-) delete mode 100644 src/net/sourceforge/plantuml/anim/AffineTransformation.java delete mode 100644 src/net/sourceforge/plantuml/anim/Animation.java delete mode 100644 src/net/sourceforge/plantuml/anim/AnimationDecoder.java delete mode 100644 src/net/sourceforge/plantuml/anim/AnimationScript.java delete mode 100644 src/net/sourceforge/plantuml/command/CommandAffineTransform.java delete mode 100644 src/net/sourceforge/plantuml/command/CommandAffineTransformMultiline.java delete mode 100644 src/net/sourceforge/plantuml/jasic/Jasic.java delete mode 100644 src/net/sourceforge/plantuml/mjpeg/MJPEGGenerator.java diff --git a/attic.md b/attic.md index ddfb50449..839058eb3 100644 --- a/attic.md +++ b/attic.md @@ -4,4 +4,6 @@ This document catalogs code that was previously part of PlantUML but has since b It serves as a historical reference to ensure we remember and understand past decisions. - [logo language](https://github.com/plantuml/plantuml/tree/v1.2023.12/src/net/sourceforge/plantuml/logo) +- [basic language](https://github.com/plantuml/plantuml/tree/v1.2023.12/src/net/sourceforge/plantuml/jasic) - [mjpeg export](https://github.com/plantuml/plantuml/tree/v1.2023.12/src/net/sourceforge/plantuml/mjpeg) +- [animation](https://github.com/plantuml/plantuml/tree/v1.2023.12/src/net/sourceforge/plantuml/anim) diff --git a/src/net/atmp/ImageBuilder.java b/src/net/atmp/ImageBuilder.java index 3ce84f890..6534f2221 100644 --- a/src/net/atmp/ImageBuilder.java +++ b/src/net/atmp/ImageBuilder.java @@ -37,8 +37,6 @@ package net.atmp; import java.awt.Color; import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -46,22 +44,16 @@ import java.io.OutputStream; import java.util.Random; import java.util.Set; -import javax.swing.ImageIcon; - import com.plantuml.api.cheerpj.WasmLog; -import net.sourceforge.plantuml.AnimatedGifEncoder; import net.sourceforge.plantuml.AnnotatedBuilder; import net.sourceforge.plantuml.AnnotatedWorker; import net.sourceforge.plantuml.EmptyImageBuilder; import net.sourceforge.plantuml.FileFormat; import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.FileUtils; import net.sourceforge.plantuml.OptionFlags; import net.sourceforge.plantuml.Scale; import net.sourceforge.plantuml.TitledDiagram; -import net.sourceforge.plantuml.anim.AffineTransformation; -import net.sourceforge.plantuml.anim.Animation; import net.sourceforge.plantuml.api.ImageDataComplex; import net.sourceforge.plantuml.api.ImageDataSimple; import net.sourceforge.plantuml.braille.UGraphicBraille; @@ -87,14 +79,10 @@ import net.sourceforge.plantuml.klimt.drawing.tikz.UGraphicTikz; import net.sourceforge.plantuml.klimt.drawing.txt.UGraphicTxt; import net.sourceforge.plantuml.klimt.drawing.visio.UGraphicVdx; import net.sourceforge.plantuml.klimt.font.StringBounder; -import net.sourceforge.plantuml.klimt.geom.MinMax; import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.shape.TextBlock; import net.sourceforge.plantuml.klimt.shape.UDrawable; import net.sourceforge.plantuml.klimt.shape.URectangle; -import net.sourceforge.plantuml.mjpeg.MJPEGGenerator; -import net.sourceforge.plantuml.security.SFile; -import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.skin.ColorParam; import net.sourceforge.plantuml.skin.CornerParam; import net.sourceforge.plantuml.skin.LineParam; @@ -113,9 +101,6 @@ import net.sourceforge.plantuml.url.Url; public class ImageBuilder { - // ::comment when __CORE__ - private Animation animation; - // ::done private boolean annotations; private HColor backcolor = getDefaultHBackColor(); @@ -223,9 +208,6 @@ public class ImageBuilder { public ImageBuilder styled(TitledDiagram diagram) { skinParam = diagram.getSkinParam(); stringBounder = fileFormatOption.getDefaultStringBounder(skinParam); - // ::comment when __CORE__ - animation = diagram.getAnimation(); - // ::done annotations = true; backcolor = diagram.calculateBackColor(); margin = calculateMargin(diagram); @@ -246,21 +228,7 @@ public class ImageBuilder { udrawable = annotatedWorker.addAdd((TextBlock) udrawable); } - // ::comment when __CORE__ - switch (fileFormatOption.getFileFormat()) { - case MJPEG: - return writeImageMjpeg(os); - case ANIMATED_GIF: - return writeImageAnimatedGif(os); - default: - return writeImageInternal(os, animation); - // ::done - // ::uncomment when __CORE__ - // return writeImageInternal(os); - // ::done - // ::comment when __CORE__ - } - // ::done + return writeImageInternal(os); } public byte[] writeByteArray() throws IOException { @@ -270,34 +238,19 @@ public class ImageBuilder { } } - // ::revert when __CORE__ - private ImageData writeImageInternal(OutputStream os, Animation animationArg) throws IOException { - // private ImageData writeImageInternal(OutputStream os) throws IOException { - // ::done + private ImageData writeImageInternal(OutputStream os) throws IOException { XDimension2D dim = getFinalDimension(); double dx = 0; double dy = 0; - // ::comment when __CORE__ - if (animationArg != null) { - final MinMax minmax = animationArg.getMinMax(dim); - animationArg.setDimension(dim); - dim = minmax.getDimension(); - dx = -minmax.getMinX(); - dy = -minmax.getMinY(); - } - // ::done + final Scale scale = titledDiagram == null ? null : titledDiagram.getScale(); final double scaleFactor = (scale == null ? 1 : scale.getScale(dim.getWidth(), dim.getHeight())) * getDpi() / 96.0; if (scaleFactor <= 0) throw new IllegalStateException("Bad scaleFactor"); WasmLog.log("...image drawing..."); - // ::revert when __CORE__ - UGraphic ug = createUGraphic(dim, animationArg, dx, dy, scaleFactor, + UGraphic ug = createUGraphic(dim, dx, dy, scaleFactor, titledDiagram == null ? new Pragma() : titledDiagram.getPragma()); - // UGraphic ug = createUGraphic(dim, dx, dy, scaleFactor, - // titledDiagram == null ? new Pragma() : titledDiagram.getPragma()); - // ::done maybeDrawBorder(ug, dim); if (randomPixel) drawRandomPoint(ug); @@ -330,9 +283,9 @@ public class ImageBuilder { if (stroke == null) return; - final URectangle rectangle = URectangle.build(dim.getWidth() - stroke.getThickness(), - dim.getHeight() - stroke.getThickness()) - .rounded(skinParam.getRoundCorner(CornerParam.diagramBorder, null)); + final URectangle rectangle = URectangle + .build(dim.getWidth() - stroke.getThickness(), dim.getHeight() - stroke.getThickness()) + .rounded(skinParam.getRoundCorner(CornerParam.diagramBorder, null)); ug.apply(color == null ? HColors.BLACK : color).apply(stroke).draw(rectangle); } @@ -364,83 +317,13 @@ public class ImageBuilder { return ug; } - // ::comment when __CORE__ - private ImageData writeImageMjpeg(OutputStream os) throws IOException { - - final XDimension2D dim = getFinalDimension(); - - final SFile f = new SFile("c:/tmp.avi"); - - final int nbframe = 100; - - final MJPEGGenerator m = new MJPEGGenerator(f, getAviImage(null).getWidth(null), - getAviImage(null).getHeight(null), 12.0, nbframe); - for (int i = 0; i < nbframe; i++) { - // AffineTransform at = AffineTransform.getRotateInstance(1.0); - AffineTransform at = AffineTransform.getTranslateInstance(dim.getWidth() / 2, dim.getHeight() / 2); - at.rotate(90.0 * Math.PI / 180.0 * i / 100); - at.translate(-dim.getWidth() / 2, -dim.getHeight() / 2); - // final AffineTransform at = AffineTransform.getTranslateInstance(i, 0); - // final ImageIcon ii = new ImageIcon(getAviImage(at)); - // m.addImage(ii.getImage()); - throw new UnsupportedOperationException(); - } - m.finishAVI(); - - FileUtils.copyToStream(f, os); - - return createImageData(dim); - } - - private ImageData writeImageAnimatedGif(OutputStream os) throws IOException { - - final XDimension2D dim = getFinalDimension(); - - final MinMax minmax = animation.getMinMax(dim); - - final AnimatedGifEncoder e = new AnimatedGifEncoder(); - // e.setQuality(1); - e.setRepeat(0); - e.start(os); - // e.setDelay(1000); // 1 frame per sec - // e.setDelay(100); // 10 frame per sec - e.setDelay(60); // 16 frame per sec - // e.setDelay(50); // 20 frame per sec - - for (AffineTransformation at : animation.getAll()) { - final ImageIcon ii = new ImageIcon(getAviImage(at)); - e.addFrame((BufferedImage) ii.getImage()); - } - e.finish(); - return createImageData(dim); - } - - private Image getAviImage(AffineTransformation affineTransform) throws IOException { - final ByteArrayOutputStream baos = new ByteArrayOutputStream(); - writeImageInternal(baos, Animation.singleton(affineTransform)); - baos.close(); - return SImageIO.read(baos.toByteArray()); - } - // ::done - - // ::revert when __CORE__ - private UGraphic createUGraphic(final XDimension2D dim, Animation animationArg, double dx, double dy, - double scaleFactor, Pragma pragma) { - // private UGraphic createUGraphic(final XDimension2D dim, double dx, double dy, - // double scaleFactor, Pragma pragma) { - // ::done + private UGraphic createUGraphic(final XDimension2D dim, double dx, double dy, double scaleFactor, Pragma pragma) { final ColorMapper colorMapper = fileFormatOption.getColorMapper(); switch (fileFormatOption.getFileFormat()) { case PNG: case RAW: - // ::comment when __CORE__ - return createUGraphicPNG(scaleFactor, dim, animationArg, dx, dy, fileFormatOption.getWatermark(), + return createUGraphicPNG(scaleFactor, dim, dx, dy, fileFormatOption.getWatermark(), fileFormatOption.getFileFormat()); - // ::done - // ::uncomment when __CORE__ - // return createUGraphicPNG(scaleFactor, dim, dx, dy, - // fileFormatOption.getWatermark(), fileFormatOption.getFileFormat()); - // ::done case SVG: return createUGraphicSVG(scaleFactor, dim, pragma); // ::comment when __CORE__ @@ -492,13 +375,8 @@ public class ImageBuilder { } - // ::uncomment when __CORE__ - // private UGraphic createUGraphicPNG(double scaleFactor, final XDimension2D - // dim, double dx, double dy, String watermark, FileFormat format) { - // ::done - // ::comment when __CORE__ - private UGraphic createUGraphicPNG(double scaleFactor, final XDimension2D dim, Animation affineTransforms, - double dx, double dy, String watermark, FileFormat format) { + private UGraphic createUGraphicPNG(double scaleFactor, final XDimension2D dim, double dx, double dy, + String watermark, FileFormat format) { // ::done Color pngBackColor = new Color(0, 0, 0, 0); @@ -513,15 +391,9 @@ public class ImageBuilder { (int) (dim.getHeight() * scaleFactor), pngBackColor, stringBounder); final Graphics2D graphics2D = builder.getGraphics2D(); - // ::comment when __CORE__ final UGraphicG2d ug = new UGraphicG2d(backcolor, fileFormatOption.getColorMapper(), stringBounder, graphics2D, - scaleFactor, dx, dy, format, affineTransforms == null ? null : affineTransforms.getFirst()); - // ::done - // ::uncomment when __CORE__ - // final UGraphicG2d ug = new UGraphicG2d(backcolor, - // fileFormatOption.getColorMapper(), stringBounder, graphics2D, - // scaleFactor, dx, dy, format); - // ::done + scaleFactor, dx, dy, format); + ug.setBufferedImage(builder.getBufferedImage()); final BufferedImage im = ug.getBufferedImage(); if (this.backcolor instanceof HColorGradient) diff --git a/src/net/sourceforge/plantuml/FileFormat.java b/src/net/sourceforge/plantuml/FileFormat.java index 2de98c84e..bff8ddeb9 100644 --- a/src/net/sourceforge/plantuml/FileFormat.java +++ b/src/net/sourceforge/plantuml/FileFormat.java @@ -76,8 +76,6 @@ public enum FileFormat { SCXML("application/scxml+xml"), // GRAPHML("application/graphml+xml"), // PDF("application/pdf"), // - MJPEG("video/x-msvideo"), // - ANIMATED_GIF("image/gif"), // HTML("text/html"), // HTML5("text/html"), // VDX("application/vnd.visio.xml"), // @@ -112,15 +110,9 @@ public enum FileFormat { if (name().startsWith("XMI")) return ".xmi"; - if (this == MJPEG) - return ".avi"; - if (this == LATEX || this == LATEX_NO_PREAMBLE) return ".tex"; - if (this == ANIMATED_GIF) - return ".gif"; - if (this == BRAILLE_PNG) return ".braille.png"; diff --git a/src/net/sourceforge/plantuml/TitledDiagram.java b/src/net/sourceforge/plantuml/TitledDiagram.java index 380bf6f4f..f5faeba59 100644 --- a/src/net/sourceforge/plantuml/TitledDiagram.java +++ b/src/net/sourceforge/plantuml/TitledDiagram.java @@ -42,8 +42,6 @@ import java.util.Map; import net.atmp.ImageBuilder; import net.sourceforge.plantuml.abel.DisplayPositioned; import net.sourceforge.plantuml.abel.DisplayPositionned; -import net.sourceforge.plantuml.anim.Animation; -import net.sourceforge.plantuml.anim.AnimationDecoder; import net.sourceforge.plantuml.api.ApiStable; import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.core.Diagram; @@ -88,10 +86,6 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram, private final SkinParam skinParam; - // ::comment when __CORE__ - private Animation animation; - // ::done - private final Pragma pragma = new Pragma(); public Pragma getPragma() { @@ -218,21 +212,6 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram, return ClockwiseTopRightBottomLeft.same(10); } - // ::comment when __CORE__ - final public void setAnimation(Iterable animationData) { -// try { - final AnimationDecoder animationDecoder = new AnimationDecoder(animationData); - this.animation = Animation.create(animationDecoder.decode()); -// } catch (ScriptException e) { -// Logme.error(e); -// } - } - - final public Animation getAnimation() { - return animation; - } - // ::done - @Override public ImageBuilder createImageBuilder(FileFormatOption fileFormatOption) throws IOException { return super.createImageBuilder(fileFormatOption).styled(this); diff --git a/src/net/sourceforge/plantuml/UmlDiagram.java b/src/net/sourceforge/plantuml/UmlDiagram.java index 67860d2cb..0025f7843 100644 --- a/src/net/sourceforge/plantuml/UmlDiagram.java +++ b/src/net/sourceforge/plantuml/UmlDiagram.java @@ -38,10 +38,8 @@ package net.sourceforge.plantuml; import static net.atmp.ImageBuilder.plainImageBuilder; import java.awt.Color; -import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; import java.io.BufferedOutputStream; -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; @@ -74,10 +72,8 @@ import net.sourceforge.plantuml.klimt.shape.TextBlock; import net.sourceforge.plantuml.klimt.shape.UDrawable; import net.sourceforge.plantuml.klimt.shape.UImage; import net.sourceforge.plantuml.log.Logme; -import net.sourceforge.plantuml.mjpeg.MJPEGGenerator; import net.sourceforge.plantuml.pdf.PdfConverter; import net.sourceforge.plantuml.security.SFile; -import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.security.SecurityUtils; import net.sourceforge.plantuml.skin.UmlDiagramType; import net.sourceforge.plantuml.style.NoStyleAvailableException; @@ -258,27 +254,6 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot } // ::comment when __CORE__ - private void exportDiagramInternalMjpeg(OutputStream os) throws IOException { - final SFile f = new SFile("c:/test.avi"); - final int nb = 150; - final double framerate = 30; - final MJPEGGenerator m = new MJPEGGenerator(f, 640, 480, framerate, nb); - - for (int i = 0; i < nb; i++) { - final AffineTransform at = new AffineTransform(); - final double coef = (nb - 1 - i) * 1.0 / nb; - at.setToShear(coef, coef); - final ByteArrayOutputStream baos = new ByteArrayOutputStream(); - // exportDiagramTOxxBEREMOVED(baos, null, 0, new - // FileFormatOption(FileFormat.PNG, at)); - baos.close(); - final BufferedImage im = SImageIO.read(baos.toByteArray()); - m.addImage(im); - } - m.finishAVI(); - - } - private ImageData exportDiagramInternalPdf(OutputStream os, int index) throws IOException { final File svg = FileUtils.createTempFileLegacy("pdf", ".svf"); final File pdfFile = FileUtils.createTempFileLegacy("pdf", ".pdf"); diff --git a/src/net/sourceforge/plantuml/anim/AffineTransformation.java b/src/net/sourceforge/plantuml/anim/AffineTransformation.java deleted file mode 100644 index beda401ea..000000000 --- a/src/net/sourceforge/plantuml/anim/AffineTransformation.java +++ /dev/null @@ -1,157 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2024, Arnaud Roques - * - * Project Info: https://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * https://plantuml.com/patreon (only 1$ per month!) - * https://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.anim; - -import java.awt.geom.AffineTransform; -import java.util.Objects; -import java.util.StringTokenizer; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.klimt.geom.MinMax; -import net.sourceforge.plantuml.klimt.geom.XDimension2D; -import net.sourceforge.plantuml.klimt.geom.XPoint2D; - -public class AffineTransformation { - // ::remove folder when __HAXE__ - // ::remove folder when __CORE__ - - static private final Pattern rotate = Pattern.compile("rotate\\s+(-?\\d+\\.?\\d*)"); - static private final Pattern shear = Pattern.compile("shear\\s+(-?\\d+\\.?\\d*)\\s+(-?\\d+\\.?\\d*)"); - static private final Pattern translate = Pattern.compile("translate\\s+(-?\\d+\\.?\\d*)\\s+(-?\\d+\\.?\\d*)"); - static private final Pattern scale = Pattern.compile("scale\\s+(-?\\d+\\.?\\d*)\\s+(-?\\d+\\.?\\d*)"); - static private final Pattern color = Pattern.compile("color\\s+.*"); - - private final AffineTransform affineTransform; - private XDimension2D dimension; - - private AffineTransformation(AffineTransform affineTransform) { - this.affineTransform = Objects.requireNonNull(affineTransform); - } - - private AffineTransformation compose(AffineTransformation other) { - final AffineTransform tmp = new AffineTransform(this.affineTransform); - tmp.concatenate(other.affineTransform); - return new AffineTransformation(tmp); - } - - public static AffineTransformation from(AffineTransform affineTransform) { - return new AffineTransformation(affineTransform); - } - - static AffineTransformation create(String value) { - final StringTokenizer st = new StringTokenizer(value, "|"); - AffineTransformation result = null; - while (st.hasMoreTokens()) { - final String s = st.nextToken(); - final AffineTransformation tmp = createSimple(s); - if (tmp != null) { - if (result == null) { - result = tmp; - } else { - result = result.compose(tmp); - } - } - } - return result; - } - - private static AffineTransformation createSimple(String value) { - Matcher m = rotate.matcher(StringUtils.trin(value)); - if (m.find()) { - final double angle = Double.parseDouble(m.group(1)); - return new AffineTransformation(AffineTransform.getRotateInstance(angle * Math.PI / 180.0)); - } - m = shear.matcher(value); - if (m.find()) { - final double shx = Double.parseDouble(m.group(1)); - final double shy = Double.parseDouble(m.group(2)); - return new AffineTransformation(AffineTransform.getShearInstance(shx, shy)); - } - m = translate.matcher(value); - if (m.find()) { - final double tx = Double.parseDouble(m.group(1)); - final double ty = Double.parseDouble(m.group(2)); - return new AffineTransformation(AffineTransform.getTranslateInstance(tx, ty)); - } - m = scale.matcher(value); - if (m.find()) { - final double scalex = Double.parseDouble(m.group(1)); - final double scaley = Double.parseDouble(m.group(2)); - return new AffineTransformation(AffineTransform.getScaleInstance(scalex, scaley)); - } - m = color.matcher(value); - if (m.find()) { - return new AffineTransformation(new AffineTransform()); - } - return null; - } - - public final AffineTransform getAffineTransform() { - return getAffineTransform(dimension); - } - - private AffineTransform getAffineTransform(XDimension2D dimension) { - if (dimension == null) { - throw new IllegalStateException(); - } - final AffineTransform at = AffineTransform.getTranslateInstance(dimension.getWidth() / 2, - dimension.getHeight() / 2); - at.concatenate(affineTransform); - at.translate(-dimension.getWidth() / 2, -dimension.getHeight() / 2); - - return at; - } - - public void setDimension(XDimension2D dim) { - this.dimension = dim; - - } - - public MinMax getMinMax(XDimension2D rect) { - MinMax result = MinMax.getEmpty(false); - final AffineTransform tmp = getAffineTransform(rect); - - result = result.addPoint(new XPoint2D(0, 0).transform(tmp)); - result = result.addPoint(new XPoint2D(0, rect.getHeight()).transform(tmp)); - result = result.addPoint(new XPoint2D(rect.getWidth(), 0).transform(tmp)); - result = result.addPoint(new XPoint2D(rect.getWidth(), rect.getHeight()).transform(tmp)); - - return result; - } - -} diff --git a/src/net/sourceforge/plantuml/anim/Animation.java b/src/net/sourceforge/plantuml/anim/Animation.java deleted file mode 100644 index 77165f891..000000000 --- a/src/net/sourceforge/plantuml/anim/Animation.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2024, Arnaud Roques - * - * Project Info: https://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * https://plantuml.com/patreon (only 1$ per month!) - * https://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.anim; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import net.sourceforge.plantuml.klimt.geom.MinMax; -import net.sourceforge.plantuml.klimt.geom.XDimension2D; - -public class Animation { - - private final List all; - - private Animation(List all) { - if (all.size() == 0) { - throw new IllegalArgumentException(); - } - this.all = all; - } - - public static Animation singleton(AffineTransformation affineTransformation) { - if (affineTransformation == null) { - return null; - } - return new Animation(Collections.singletonList(affineTransformation)); - } - - public static Animation create(List descriptions) { - final List all = new ArrayList<>(); - for (String s : descriptions) { - final AffineTransformation tmp = AffineTransformation.create(s); - if (tmp != null) { - all.add(tmp); - } - } - return new Animation(all); - } - - public Collection getAll() { - return Collections.unmodifiableCollection(all); - } - - public void setDimension(XDimension2D dim) { - for (AffineTransformation affineTransform : all) { - affineTransform.setDimension(dim); - } - - } - - public AffineTransformation getFirst() { - return all.get(0); - } - - public MinMax getMinMax(XDimension2D dim) { - MinMax result = MinMax.getEmpty(false); - for (AffineTransformation affineTransform : all) { - final MinMax m = affineTransform.getMinMax(dim); - result = result.addMinMax(m); - } - return result; - } - -} diff --git a/src/net/sourceforge/plantuml/anim/AnimationDecoder.java b/src/net/sourceforge/plantuml/anim/AnimationDecoder.java deleted file mode 100644 index 9328169e5..000000000 --- a/src/net/sourceforge/plantuml/anim/AnimationDecoder.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2024, Arnaud Roques - * - * Project Info: https://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * https://plantuml.com/patreon (only 1$ per month!) - * https://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.anim; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.StringTokenizer; - -public class AnimationDecoder { - - private final List result = new ArrayList<>(); - - public AnimationDecoder(Iterable data) { - - for (final Iterator it = data.iterator(); it.hasNext();) { - String line = it.next().toString(); - if (line.matches("^\\s*\\[script\\]\\s*$")) { - final StringBuilder scriptText = new StringBuilder(); - while (true) { - line = it.next().toString(); - if (line.matches("^\\s*\\[/script\\]\\s*$")) { - final AnimationScript script = new AnimationScript(); - final String out = script.eval(scriptText.toString()); - for (final StringTokenizer st = new StringTokenizer(out, "\n"); st.hasMoreTokens();) { - result.add(st.nextToken()); - } - break; - } else { - scriptText.append(line); - scriptText.append("\n"); - } - } - } else { - result.add(line); - } - } - } - - public List decode() { - return Collections.unmodifiableList(result); - } - -} diff --git a/src/net/sourceforge/plantuml/anim/AnimationScript.java b/src/net/sourceforge/plantuml/anim/AnimationScript.java deleted file mode 100644 index 610120639..000000000 --- a/src/net/sourceforge/plantuml/anim/AnimationScript.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2024, Arnaud Roques - * - * Project Info: https://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * https://plantuml.com/patreon (only 1$ per month!) - * https://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.anim; - -public class AnimationScript { - -// private final ScriptEngine engine; - - public AnimationScript() { - -// final ScriptEngineManager manager = new ScriptEngineManager(); -// engine = manager.getEngineByName("js"); - - // ScriptEngineManager manager = new ScriptEngineManager(); - // List factories = manager.getEngineFactories(); - // for (ScriptEngineFactory factory : factories) { - // System.out.println("Name : " + factory.getEngineName()); - // System.out.println("Version : " + factory.getEngineVersion()); - // System.out.println("Language name : " + factory.getLanguageName()); - // System.out.println("Language version : " + factory.getLanguageVersion()); - // System.out.println("Extensions : " + factory.getExtensions()); - // System.out.println("Mime types : " + factory.getMimeTypes()); - // System.out.println("Names : " + factory.getNames()); - // - // } - - } - - public String eval(String line) { - throw new UnsupportedOperationException(); -// final ScriptContext context = engine.getContext(); -// final StringWriter sw = new StringWriter(); -// context.setWriter(new PrintWriter(sw)); -// engine.eval(line, context); -// final String result = sw.toString(); -// return result; - } -} diff --git a/src/net/sourceforge/plantuml/command/CommandAffineTransform.java b/src/net/sourceforge/plantuml/command/CommandAffineTransform.java deleted file mode 100644 index 210639cd8..000000000 --- a/src/net/sourceforge/plantuml/command/CommandAffineTransform.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2024, Arnaud Roques - * - * Project Info: https://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * https://plantuml.com/patreon (only 1$ per month!) - * https://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.command; - -import java.util.Collections; - -import net.sourceforge.plantuml.UmlDiagram; -import net.sourceforge.plantuml.regex.IRegex; -import net.sourceforge.plantuml.regex.RegexConcat; -import net.sourceforge.plantuml.regex.RegexLeaf; -import net.sourceforge.plantuml.regex.RegexResult; -import net.sourceforge.plantuml.utils.LineLocation; - -public class CommandAffineTransform extends SingleLineCommand2 { - - public static final CommandAffineTransform ME = new CommandAffineTransform(); - - private CommandAffineTransform() { - super(getRegexConcat()); - } - - static IRegex getRegexConcat() { - return RegexConcat.build(CommandAffineTransform.class.getName(), RegexLeaf.start(), // - new RegexLeaf("!transformation"), // - RegexLeaf.spaceOneOrMore(), // - new RegexLeaf("ANIMATION", "([^{}]*)"), RegexLeaf.end()); // - } - - @Override - protected CommandExecutionResult executeArg(UmlDiagram diagram, LineLocation location, RegexResult arg) { - final CharSequence value = arg.get("ANIMATION", 0); - // ::comment when __CORE__ - diagram.setAnimation(Collections.singletonList(value)); - // ::done - return CommandExecutionResult.ok(); - } - -} diff --git a/src/net/sourceforge/plantuml/command/CommandAffineTransformMultiline.java b/src/net/sourceforge/plantuml/command/CommandAffineTransformMultiline.java deleted file mode 100644 index 5b3aa6744..000000000 --- a/src/net/sourceforge/plantuml/command/CommandAffineTransformMultiline.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2024, Arnaud Roques - * - * Project Info: https://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * https://plantuml.com/patreon (only 1$ per month!) - * https://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.command; - -import net.sourceforge.plantuml.TitledDiagram; -import net.sourceforge.plantuml.utils.BlocLines; - -public class CommandAffineTransformMultiline extends CommandMultilines { - - public static final CommandAffineTransformMultiline ME = new CommandAffineTransformMultiline(); - - private CommandAffineTransformMultiline() { - super("^!transformation[%s]+\\{[%s]*$"); - } - - @Override - public String getPatternEnd() { - return "^[%s]*!\\}[%s]*$"; - } - - public CommandExecutionResult execute(final TitledDiagram diagram, BlocLines lines) { - // lines = lines.subExtract(1, 1); - // diagram.setAnimation(lines); - return CommandExecutionResult.error("Not yet implemented"); - } - -} diff --git a/src/net/sourceforge/plantuml/command/CommonCommands.java b/src/net/sourceforge/plantuml/command/CommonCommands.java index 707dd49b3..0f569dea3 100644 --- a/src/net/sourceforge/plantuml/command/CommonCommands.java +++ b/src/net/sourceforge/plantuml/command/CommonCommands.java @@ -73,8 +73,6 @@ public final class CommonCommands { cmds.add(CommandScaleMaxWidth.ME); cmds.add(CommandScaleMaxHeight.ME); cmds.add(CommandScaleMaxWidthAndHeight.ME); - cmds.add(CommandAffineTransform.ME); - cmds.add(CommandAffineTransformMultiline.ME); final CommandFactorySprite factorySpriteCommand = new CommandFactorySprite(); cmds.add(factorySpriteCommand.createMultiLine(false)); cmds.add(factorySpriteCommand.createSingleLine()); diff --git a/src/net/sourceforge/plantuml/jasic/Jasic.java b/src/net/sourceforge/plantuml/jasic/Jasic.java deleted file mode 100644 index 3bc1b359d..000000000 --- a/src/net/sourceforge/plantuml/jasic/Jasic.java +++ /dev/null @@ -1,829 +0,0 @@ -package net.sourceforge.plantuml.jasic; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/* - Jasic uses the MIT License: - - Copyright (c) 2010 Robert Nystrom - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - the Software, and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ -/* - * This defines a single class that contains an entire interpreter for a language very similar to the original BASIC. - * Everything is here (albeit in very simplified form): tokenizing, parsing, and interpretation. The file is organized - * in phases, with each appearing roughly in the order that they occur when a program is run. You should be able to read - * this top-down to walk through the entire process of loading and running a program. - * - * Jasic language syntax --------------------- - * - * Comments start with ' and proceed to the end of the line: - * - * print "hi there" ' this is a comment - * - * Numbers and strings are supported. Strings should be in "double quotes", and only positive integers can be parsed - * (though numbers are double internally). - * - * Variables are identified by name which must start with a letter and can contain letters or numbers. Case is - * significant for names and keywords. - * - * Each statement is on its own line. Optionally, a line may have a label before the statement. A label is a name that - * ends with a colon: - * - * foo: - * - * - * The following statements are supported: - * - * = Evaluates the expression and assigns the result to the given named variable. All variables are - * globally scoped. - * - * pi = (314159 / 10000) - * - * print Evaluates the expression and prints the result. - * - * print "hello, " + "world" - * - * input Reads in a line of input from the user and stores it in the variable with the given name. - * - * input guess - * - * goto