1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-06-07 02:40:52 +00:00

Merge branch 'master' into java8syntax

This commit is contained in:
PlantUML 2022-03-28 19:43:11 +02:00 committed by GitHub
commit d36da706ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
279 changed files with 1052 additions and 1457 deletions

View File

@ -8,10 +8,16 @@ indent_size = 2
indent_style = tab
trim_trailing_whitespace = true
[*.java]
ij_continuation_indent_size = 8
ij_java_align_multiline_parameters = false
ij_java_class_count_to_use_import_on_demand = 999
ij_java_imports_layout = $*,|,java.**,|,javax.**,|,org.**,|com.**,|*,|
ij_java_names_count_to_use_import_on_demand = 999
[*.md]
max_line_length = off
trim_trailing_whitespace = false
[{pom.xml, *.yml}]
indent_style = space

View File

@ -1,6 +1,6 @@
version: 2
updates:
- package-ecosystem: maven
- package-ecosystem: gradle
directory: /
schedule:
interval: daily

View File

@ -1,27 +0,0 @@
#!/usr/bin/env bash
set -ex
POM_VERSION=$(gradle properties -q | grep "version:" | awk '{print $2}')
RELEASE_DIR="build/github_release"
mkdir "${RELEASE_DIR}"
ln -s "../libs/plantuml-${POM_VERSION}.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}.jar"
ln -s "../libs/plantuml-${POM_VERSION}-javadoc.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}-javadoc.jar"
ln -s "../libs/plantuml-${POM_VERSION}-sources.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}-sources.jar"
ln -s "../libs/plantuml-pdf-${POM_VERSION}.jar" "${RELEASE_DIR}/plantuml-pdf-${POM_VERSION}.jar"
if [[ -e "build/publications/maven/module.json.asc" ]]; then
# signatures are optional so that forked repos can release snapshots without needing a gpg signing key
ln -s "../libs/plantuml-${POM_VERSION}.jar.asc" "${RELEASE_DIR}/plantuml-${POM_VERSION}.jar.asc"
ln -s "../libs/plantuml-${POM_VERSION}-javadoc.jar.asc" "${RELEASE_DIR}/plantuml-${POM_VERSION}-javadoc.jar.asc"
ln -s "../libs/plantuml-${POM_VERSION}-sources.jar.asc" "${RELEASE_DIR}/plantuml-${POM_VERSION}-sources.jar.asc"
ln -s "../libs/plantuml-pdf-${POM_VERSION}.jar.asc" "${RELEASE_DIR}/plantuml-pdf-${POM_VERSION}.jar.asc"
fi
gh release create \
--target "${GITHUB_SHA}" \
--title "${TAG}" \
"${TAG}" ${RELEASE_DIR}/*
echo "::notice title=::Released at ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/tag/${TAG} 🎉"

View File

@ -1,14 +1,23 @@
#!/usr/bin/env bash
set -ex
RELEASE_DIR="target/github_release"
POM_VERSION=$(gradle properties -q | grep "version:" | awk '{print $2}')
RELEASE_DIR="build/github_release"
mkdir "${RELEASE_DIR}"
ln -s "../plantuml.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}.jar"
ln -s "../plantuml-javadoc.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}-javadoc.jar"
ln -s "../plantuml-sources.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}-sources.jar"
# we do not release the .pom or .asc signature files here, they will be added in a later PR
ln -s "../libs/plantuml-${POM_VERSION}.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}.jar"
ln -s "../libs/plantuml-${POM_VERSION}-javadoc.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}-javadoc.jar"
ln -s "../libs/plantuml-${POM_VERSION}-sources.jar" "${RELEASE_DIR}/plantuml-${POM_VERSION}-sources.jar"
ln -s "../libs/plantuml-pdf-${POM_VERSION}.jar" "${RELEASE_DIR}/plantuml-pdf-${POM_VERSION}.jar"
if [[ -e "build/publications/maven/module.json.asc" ]]; then
# signatures are optional so that forked repos can release snapshots without needing a gpg signing key
ln -s "../libs/plantuml-${POM_VERSION}.jar.asc" "${RELEASE_DIR}/plantuml-${POM_VERSION}.jar.asc"
ln -s "../libs/plantuml-${POM_VERSION}-javadoc.jar.asc" "${RELEASE_DIR}/plantuml-${POM_VERSION}-javadoc.jar.asc"
ln -s "../libs/plantuml-${POM_VERSION}-sources.jar.asc" "${RELEASE_DIR}/plantuml-${POM_VERSION}-sources.jar.asc"
ln -s "../libs/plantuml-pdf-${POM_VERSION}.jar.asc" "${RELEASE_DIR}/plantuml-pdf-${POM_VERSION}.jar.asc"
fi
gh release create \
--target "${GITHUB_SHA}" \

View File

@ -1,44 +0,0 @@
#!/usr/bin/env bash
set -ex
TAG="snapshot"
DATE_TIME_UTC=$(date -u +"%F at %T (UTC)")
RELEASE_DIR="target/github_release"
gh release delete "${TAG}" -y || true
git tag --force "${TAG}"
git push --force origin "${TAG}"
mkdir "${RELEASE_DIR}"
ln -s "../plantuml.pom" "${RELEASE_DIR}/plantuml-SNAPSHOT.pom"
ln -s "../plantuml.jar" "${RELEASE_DIR}/plantuml-SNAPSHOT.jar"
ln -s "../plantuml-javadoc.jar" "${RELEASE_DIR}/plantuml-SNAPSHOT-javadoc.jar"
ln -s "../plantuml-sources.jar" "${RELEASE_DIR}/plantuml-SNAPSHOT-sources.jar"
if [[ -e "target/plantuml.pom.asc" ]]; then
# signatures are optional so that forked repos can release snapshots without needing a gpg signing key
ln -s "../plantuml.pom.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT.pom.asc"
ln -s "../plantuml.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT.jar.asc"
ln -s "../plantuml-javadoc.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT-javadoc.jar.asc"
ln -s "../plantuml-sources.jar.asc" "${RELEASE_DIR}/plantuml-SNAPSHOT-sources.jar.asc"
fi
echo -n "${DATE_TIME_UTC}" > "${RELEASE_DIR}/plantuml-SNAPSHOT.timestamp"
cat <<-EOF >notes.txt
This is a pre-release of [the latest development work](https://github.com/plantuml/plantuml/commits/).
⚠️ **It is not ready for general use** ⚠️
⏱ _Snapshot taken the ${DATE_TIME_UTC}_
EOF
gh release create \
--prerelease \
--target "${GITHUB_SHA}" \
--title "${TAG}" \
--notes-file notes.txt \
"${TAG}" ${RELEASE_DIR}/*
echo "::notice title=release snapshot::Snapshot released at ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/tag/${TAG} and taken the ${DATE_TIME_UTC}"

View File

@ -1,150 +0,0 @@
name: CI gradle
on:
create:
pull_request:
types: [ opened, synchronize, reopened ]
paths-ignore:
- '*.md'
- 'docs/**'
push:
branches:
- master
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
workflow_config:
runs-on: ubuntu-latest
outputs:
do_release: ${{ steps.config.outputs.do_release }}
do_snapshot_release: ${{ steps.config.outputs.do_snapshot_release }}
pom_version: ${{ steps.config.outputs.pom_version }}
steps:
- name: Configure workflow
id: config
env:
ACTOR: ${{ github.actor }}
EVENT_ACTION: ${{ github.event.action }}
REF_TYPE: ${{ github.event.ref_type }}
REF: ${{ github.event.ref }}
run: |
cat <<-EOF
::group::Debug Info
GITHUB_EVENT_NAME : '${GITHUB_EVENT_NAME}'
EVENT_ACTION : '${EVENT_ACTION}'
REF_TYPE : '${REF_TYPE}'
REF : '${REF}'
ACTOR : '${ACTOR}'
GITHUB_REPOSITORY_OWNER : '${GITHUB_REPOSITORY_OWNER}'
::endgroup::
EOF
# Do a release when a git tag starting with 'v' has been created by a suitable user.
# (We match against github.repository_owner as a kludge so that forked repos can release themselves when testing the workflow)
if [[ "${GITHUB_EVENT_NAME}" == "create" && "${REF_TYPE}" == "tag" && "${REF}" == v* && \
( "${ACTOR}" == "arnaudroques" || "${ACTOR}" == "${GITHUB_REPOSITORY_OWNER}" ) \
]]; then
echo "::notice title=::This run will release '${REF}'"
echo "::set-output name=do_release::true"
echo "::set-output name=pom_version::${REF#v}" # pom_version is the tag without the 'v' prefix
elif [[ "${GITHUB_EVENT_NAME}" =~ push|workflow_dispatch && "${REF}" == "refs/heads/master" ]]; then
echo "::notice title=::This run will release a snapshot"
echo "::set-output name=do_snapshot_release::true"
else
echo "This run will NOT make a release"
fi
# We run the tests on many OS / Java combinations but also the Compile step because some users build
# their own jars from source, so it is good for CI to check that is working on all combinations.
test:
needs: workflow_config
strategy:
fail-fast: false
matrix:
java_version: [ 8, 11, 17 ]
os: [ macos-10.15, macos-11, ubuntu-18.04, ubuntu-20.04, windows-2019, windows-2022 ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Set up java
uses: actions/setup-java@v3.0.0
with:
java-version: ${{ matrix.java_version }}
distribution: temurin
cache: gradle
# Compile / Test / Package are separate steps so the reason for any failure is more obvious in GitHub UI
- name: Compile
run: gradle -q compileJava --no-daemon
- name: Test
run: gradle -q test --no-daemon
upload:
needs: [ workflow_config, test ]
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Set up java
uses: actions/setup-java@v3.0.0
with:
java-version: 17
distribution: temurin
cache: gradle
- name: Set version from tag
if: env.POM_VERSION
env:
POM_VERSION: ${{ needs.workflow_config.outputs.pom_version }}
run: sed -i "s/version = .*/version = $POM_VERSION/" gradle.properties
- name: Build artifacts
run: |
gradle -q clean build \
pdfJar \
generateMetadataFileForMavenPublication generatePomFileForMavenPublication \
-x test
- name: Sign artifacts
if: env.ORG_GRADLE_PROJECT_signingKey
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ARTIFACT_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ARTIFACT_SIGNING_PASSPHRASE }}
run: |
gradle -q signMavenPublication signPdfJar
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
# Using github.run_number here to reduce confusion when downloading & comparing artifacts from several builds
name: ${{ github.run_number }}-artifacts
path: |
build/libs/*
build/publications/maven/*
- name: Create snapshot release
if: needs.workflow_config.outputs.do_snapshot_release == 'true'
env:
GITHUB_TOKEN: ${{ github.token }}
run: .github/scripts/release-gradle-snapshot.sh
- name: Create release in GitHub
if: needs.workflow_config.outputs.do_release == 'true'
env:
GITHUB_TOKEN: ${{ github.token }}
TAG: ${{ github.event.ref }}
run: .github/scripts/release-gradle.sh

View File

@ -1,18 +1,18 @@
name: CI
on:
# create:
# pull_request:
# types: [ opened, synchronize, reopened ]
# paths-ignore:
# - '*.md'
# - 'docs/**'
# push:
# branches:
# - master
# paths-ignore:
# - '*.md'
# - 'docs/**'
create:
pull_request:
types: [ opened, synchronize, reopened ]
paths-ignore:
- '*.md'
- 'docs/**'
push:
branches:
- master
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:
defaults:
@ -66,20 +66,14 @@ jobs:
# We run the tests on many OS / Java combinations but also the Compile step because some users build
# their own jars from source, so it is good for CI to check that is working on all combinations.
build:
test:
needs: workflow_config
strategy:
fail-fast: false
matrix:
java_version: [ 8, 11, 17 ]
os: [ macos-10.15, macos-11, ubuntu-18.04, ubuntu-20.04, windows-2019, windows-2022 ]
include:
- release_from_this_build: true
os: ubuntu-20.04
java_version: 8
runs-on: ${{ matrix.os }}
env:
SIGN_ARTIFACTS: ${{ secrets.ARTIFACT_SIGNING_KEY != '' }}
steps:
- name: Checkout the repository
uses: actions/checkout@v2
@ -89,92 +83,68 @@ jobs:
with:
java-version: ${{ matrix.java_version }}
distribution: temurin
cache: maven
# Downloading all the dependencies is very log spammy, so we do this in its own step.
- name: Prime maven cache
run: mvn --batch-mode dependency:go-offline
# POM version is usually a -SNAPSHOT at this point, if this is a release then we use the version derived from the tag
- name: Set POM version
if: needs.workflow_config.outputs.do_release == 'true'
env:
POM_VERSION: ${{ needs.workflow_config.outputs.pom_version }}
run: mvn --batch-mode versions:set "-DnewVersion=${POM_VERSION}"
cache: gradle
# Compile / Test / Package are separate steps so the reason for any failure is more obvious in GitHub UI
- name: Compile
run: mvn --batch-mode compile
run: gradle -q compileJava --no-daemon
- name: Test
run: mvn --batch-mode test
run: gradle -q test --no-daemon
# The repeated "matrix.release_from_this_build" checks are messy, but I have not found a simple way to avoid them
# See https://github.com/actions/runner/issues/662
- name: Setup gpg
if: matrix.release_from_this_build && env.ARTIFACT_SIGNING_KEY
id: gpg
env:
ARTIFACT_SIGNING_KEY: ${{ secrets.ARTIFACT_SIGNING_KEY }}
run: |
echo "Importing key ..."
echo "${ARTIFACT_SIGNING_KEY}" | gpg --batch --import --import-options import-show
echo "Getting key id ..."
key_id="$(echo "${ARTIFACT_SIGNING_KEY}" | gpg --batch --show-keys --with-colons | awk -F: '$1 == "sec" { print $5 }')"
echo "::set-output name=key_id::${key_id}"
- name: Create artifacts
if: matrix.release_from_this_build
env:
GPG_KEYNAME: ${{ steps.gpg.outputs.key_id }}
GPG_PASSPHRASE: ${{ secrets.ARTIFACT_SIGNING_PASSPHRASE }}
run: |
[[ "${SIGN_ARTIFACTS}" == "true" ]] || cp pom.xml target/plantuml.pom
mvn --batch-mode \
"-DfinalName=plantuml" \
"-Dgpg.keyname=${GPG_KEYNAME}" \
"-Dgpg.passphrase=${GPG_PASSPHRASE}" \
"-Dmaven.test.skip=true" \
verify
- name: Upload artifacts
if: matrix.release_from_this_build
uses: actions/upload-artifact@v2
with:
# Using github.run_number here to reduce confusion when downloading & comparing artifacts from several builds
name: ${{ github.run_number }}-artifacts
path: |
target/*.asc
target/*.jar
target/*.pom
release:
needs: [ workflow_config, build ]
if: needs.workflow_config.outputs.do_release == 'true' || needs.workflow_config.outputs.do_snapshot_release == 'true'
upload:
needs: [ workflow_config, test ]
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Set up java
uses: actions/setup-java@v3.0.0
with:
java-version: 17
distribution: temurin
cache: gradle
- name: Set version from tag
if: env.POM_VERSION
env:
POM_VERSION: ${{ needs.workflow_config.outputs.pom_version }}
run: sed -i "s/version = .*/version = $POM_VERSION/" gradle.properties
- name: Build artifacts
run: |
gradle -q clean build \
pdfJar \
generateMetadataFileForMavenPublication generatePomFileForMavenPublication \
-x test
- name: Sign artifacts
if: env.ORG_GRADLE_PROJECT_signingKey
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ARTIFACT_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ARTIFACT_SIGNING_PASSPHRASE }}
run: |
gradle -q signMavenPublication signPdfJar
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
# Using github.run_number here to reduce confusion when downloading & comparing artifacts from several builds
name: ${{ github.run_number }}-artifacts
path: target
path: |
build/libs/*
build/publications/maven/*
- name: Create snapshot release
if: needs.workflow_config.outputs.do_snapshot_release == 'true'
env:
GITHUB_TOKEN: ${{ github.token }}
run: .github/scripts/release_snapshot.sh
run: .github/scripts/release-snapshot.sh
- name: Create release in GitHub
if: needs.workflow_config.outputs.do_release == 'true'
env:
GITHUB_TOKEN: ${{ github.token }}
POM_VERSION: ${{ needs.workflow_config.outputs.pom_version }}
TAG: ${{ github.event.ref }}
run: .github/scripts/release.sh

View File

@ -88,6 +88,42 @@ tasks.withType<Jar>().configureEach {
publishing {
publications.create<MavenPublication>("maven") {
from(components["java"])
pom {
url.set("https://plantuml.com/")
licenses {
license {
name.set("The GNU General Public License")
url.set("http://www.gnu.org/licenses/gpl.txt")
}
}
developers {
developer {
id.set("arnaud.roques")
name.set("Arnaud Roques")
email.set("plantuml@gmail.com")
}
}
scm {
connection.set("scm:git:git://github.com:plantuml/plantuml.git")
developerConnection.set("scm:git:ssh://git@github.com:plantuml/plantuml.git")
url.set("https://github.com/plantuml/plantuml")
}
}
suppressAllPomMetadataWarnings()
}
repositories {
maven {
name = "fstest"
url = uri(layout.buildDirectory.dir("repo"))
}
maven {
name = "OSSRH"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}

329
pom.xml
View File

@ -1,329 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
========================================================================
PlantUML : a free UML diagram generator
========================================================================
(C) Copyright 2009, Arnaud Roques
Project Info: http://plantuml.sourceforge.net
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 Lesser 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.
[Java is a trademark or registered trademark of Sun Microsystems, Inc.
in the United States and other countries.]
Script Author: Julien Eluard
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId>
<version>1.2022.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>PlantUML</name>
<description>
PlantUML is a component that allows to quickly write :
* sequence diagram,
* use case diagram,
* class diagram,
* activity diagram,
* component diagram,
* state diagram
* object diagram
</description>
<url>https://plantuml.com</url>
<parent>
<!-- TODO remove oss-parent https://central.sonatype.org/publish/publish-maven/#deprecated-oss-parent -->
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<properties>
<finalName>${project.artifactId}-${project.version}</finalName>
<main.class>net.sourceforge.plantuml.Run</main.class>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.8.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.10.12</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.22.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scilab.forge</groupId>
<artifactId>jlatexmath</artifactId>
<version>1.0.7</version>
<scope>test</scope>
</dependency>
</dependencies>
<licenses>
<license>
<name>The GNU General Public License</name>
<url>http://www.gnu.org/licenses/gpl.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:svn:svn://svn.code.sf.net/p/plantuml/code/trunk</connection>
<developerConnection>scm:svn:https://svn.code.sf.net/p/plantuml/code/trunk</developerConnection>
<url>svn://svn.code.sf.net/p/plantuml/code/trunk</url>
</scm>
<issueManagement>
<system>Sourceforge</system>
<url>http://sourceforge.net/tracker/?group_id=259736</url>
</issueManagement>
<developers>
<developer>
<id>arnaud.roques</id>
<name>Arnaud Roques</name>
<email>plantuml@gmail.com</email>
</developer>
</developers>
<build>
<finalName>${finalName}</finalName>
<sourceDirectory>${project.basedir}/src</sourceDirectory>
<testSourceDirectory>${project.basedir}/test</testSourceDirectory>
<resources>
<resource>
<directory>${project.basedir}/src</directory>
<includes>
<include>net/sourceforge/plantuml/version/*.png</include>
<include>net/sourceforge/plantuml/openiconic/data/*.txt</include>
<include>net/sourceforge/plantuml/openiconic/data/*.svg</include>
<include>net/sourceforge/plantuml/emoji/data/*.txt</include>
<include>net/sourceforge/plantuml/emoji/data/*.svg</include>
<include>net/sourceforge/plantuml/fun/*.png</include>
<include>sprites/archimate/*.png</include>
<include>net/sourceforge/plantuml/dedication/*.png</include>
<include>net/sourceforge/plantuml/math/*.js</include>
<include>net/sourceforge/plantuml/windowsdot/*.dat</include>
<include>net/sourceforge/plantuml/utils/*.txt</include>
</includes>
</resource>
<resource>
<directory>${project.basedir}</directory>
<includes>
<include>stdlib/**/*.repx</include>
<include>skin/**/*.skin</include>
<include>themes/**/*.puml</include>
<include>svg/**/*.css</include>
<include>svg/**/*.js</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.9.0</version>
<configuration>
<debug>true</debug>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<additionalJOptions>
<additionalJOption>-Xmaxwarns</additionalJOption>
<additionalJOption>1</additionalJOption>
</additionalJOptions>
<doclint>none</doclint>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<archive>
<manifestFile>manifest.txt</manifestFile>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<environmentVariables>
<PLANTUML_SECURITY_PROFILE>UNSECURE</PLANTUML_SECURITY_PROFILE>
</environmentVariables>
<systemPropertyVariables>
<java.awt.headless>true</java.awt.headless>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<mavenExecutorId>forked-path</mavenExecutorId>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.9.0</version>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- set the release flag only for jdk which do support it, plantuml should keep running with java8. -->
<id>javac-release-flag</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<properties>
<maven.compiler.release>8</maven.compiler.release>
</properties>
</profile>
<profile>
<id>javac-source-flag</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- maven-compiler-plugin source default with 3.9.0 is still 1.7, so set it for java8. -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</profile>
<profile>
<id>pdf</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>${main.class}</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>fop</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-all</artifactId>
<version>1.14</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>sign-artifacts</id>
<activation>
<property>
<name>env.SIGN_ARTIFACTS</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -97,6 +97,7 @@ import static smetana.core.Macro.GD_n_nodes;
import static smetana.core.Macro.GD_nlist;
import static smetana.core.Macro.GD_rank;
import static smetana.core.Macro.GD_rankleader;
import static smetana.core.Macro.N;
import static smetana.core.Macro.ND_UF_size;
import static smetana.core.Macro.ND_clust;
import static smetana.core.Macro.ND_in;
@ -363,8 +364,8 @@ try {
flat_edge(g, e);
prev = e;
} else if (NEQ(e, fe)) {
UNSUPPORTED("ckfinb4h4twp1ry02y9peyhz"); // safe_other_edge(e);
UNSUPPORTED("dg3e0udctqa7xtfynplc7wdpj"); // if (!ED_to_virt(e)) merge_oneway(e, fe);
safe_other_edge(e);
if (N(ED_to_virt(e))) merge_oneway(e, fe);
}
continue;
}

View File

@ -196,7 +196,7 @@ try {
for (i = 0; i < L.size; i++)
if (EQ(e, L.list.get_(i)))
return;
UNSUPPORTED("cslejjtgepjdwlcykfas4fmvz"); // elist_append(e, (*L));
elist_append(e, L);
} finally {
LEAVING("cttswsffgmw1g710jzvdd3wzn","safe_list_append");
}

View File

@ -106,12 +106,12 @@ public class AnnotatedWorker {
final Style style = StyleSignatureBasic.of(SName.root, SName.document, SName.frame)
.getMergedStyle(skinParam.getCurrentStyleBuilder());
deltaShadow = style.value(PName.Shadowing).asDouble();
fontConfiguration = new FontConfiguration(getSkinParam(), style);
fontConfiguration = FontConfiguration.create(getSkinParam(), style);
stroke = style.getStroke();
borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
} else {
deltaShadow = getSkinParam().shadowing(null) ? 3 : 0;
fontConfiguration = new FontConfiguration(getSkinParam(), FontParam.CAPTION, null);
fontConfiguration = FontConfiguration.create(getSkinParam(), FontParam.CAPTION, null);
stroke = new UStroke();
borderColor = HColorUtils.BLACK;
}
@ -193,7 +193,7 @@ public class AnnotatedWorker {
.getMergedStyle(skinParam.getCurrentStyleBuilder());
return style.createTextBlockBordered(caption.getDisplay(), skinParam.getIHtmlColorSet(), skinParam);
}
return caption.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.CAPTION, null),
return caption.getDisplay().create(FontConfiguration.create(getSkinParam(), FontParam.CAPTION, null),
HorizontalAlignment.CENTER, getSkinParam());
}
@ -209,7 +209,7 @@ public class AnnotatedWorker {
block = style.createTextBlockBordered(title.getDisplay(), skinParam.getIHtmlColorSet(), skinParam);
} else {
final ISkinParam skinParam = getSkinParam();
final FontConfiguration fontConfiguration = new FontConfiguration(skinParam, FontParam.TITLE, null);
final FontConfiguration fontConfiguration = FontConfiguration.create(skinParam, FontParam.TITLE, null);
block = TextBlockUtils.title(fontConfiguration, title.getDisplay(), skinParam);
}
@ -229,7 +229,7 @@ public class AnnotatedWorker {
style = StyleSignatureBasic.of(SName.root, SName.document, SName.footer)
.getMergedStyle(skinParam.getCurrentStyleBuilder());
}
textFooter = footer.createRibbon(new FontConfiguration(getSkinParam(), FontParam.FOOTER, null),
textFooter = footer.createRibbon(FontConfiguration.create(getSkinParam(), FontParam.FOOTER, null),
getSkinParam(), style);
}
TextBlock textHeader = null;
@ -239,7 +239,7 @@ public class AnnotatedWorker {
style = StyleSignatureBasic.of(SName.root, SName.document, SName.header)
.getMergedStyle(skinParam.getCurrentStyleBuilder());
}
textHeader = header.createRibbon(new FontConfiguration(getSkinParam(), FontParam.HEADER, null),
textHeader = header.createRibbon(FontConfiguration.create(getSkinParam(), FontParam.HEADER, null),
getSkinParam(), style);
}

View File

@ -42,14 +42,14 @@ public class BaseFile {
private final String basename;
private final SFile basedir;
public BaseFile() {
this.basedir = null;
this.basename = null;
}
public BaseFile(SFile file) {
this.basedir = file.getParentFile();
this.basename = extractBasename(file.getName());
if (file == null) {
this.basedir = null;
this.basename = null;
} else {
this.basedir = file.getParentFile();
this.basename = extractBasename(file.getName());
}
}
private static String extractBasename(String name) {

View File

@ -77,6 +77,7 @@ public class BlockUml {
return Collections.unmodifiableSet(included);
}
@Deprecated
BlockUml(ThemeStyle style, String... strings) {
this(style, convert(strings), Defines.createEmpty(), null, null, null);
}

View File

@ -35,11 +35,13 @@
*/
package net.sourceforge.plantuml;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
@HaxeIgnored
public enum ColorParam {
background(HColorUtils.WHITE, true, ColorType.BACK),
hyperlink(HColorUtils.BLUE),

View File

@ -47,15 +47,15 @@ public class Dimension2DDouble extends Dimension2D {
final private double height;
public Dimension2DDouble(double width, double height) {
if (Double.isNaN(width) || Double.isNaN(height)) {
if (Double.isNaN(width) || Double.isNaN(height))
throw new IllegalArgumentException();
}
this.width = width;
this.height = height;
}
public Dimension2DDouble(Point2D point) {
this(point.getX(), point.getY());
private static Dimension2DDouble fromPoint(Point2D point) {
return new Dimension2DDouble(point.getX(), point.getY());
}
@Override

View File

@ -35,13 +35,13 @@
*/
package net.sourceforge.plantuml;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.creole.atom.Atom;
import net.sourceforge.plantuml.cucadiagram.Display;
@ -58,6 +58,95 @@ import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UImageSvg;
import net.sourceforge.plantuml.ugraphic.UShape;
class EmbeddedDiagramDraw extends AbstractTextBlock implements Line, Atom {
private BufferedImage image;
private final ISkinSimple skinParam;
private final List<StringLocated> as2;
public List<Atom> splitInTwo(StringBounder stringBounder, double width) {
return Arrays.asList((Atom) this);
}
EmbeddedDiagramDraw(ISkinSimple skinParam, List<StringLocated> as2) {
this.skinParam = skinParam;
this.as2 = as2;
}
public double getStartingAltitude(StringBounder stringBounder) {
return 0;
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
try {
final BufferedImage im = getImage();
return new Dimension2DDouble(im.getWidth(), im.getHeight());
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
return new Dimension2DDouble(42, 42);
}
public void drawU(UGraphic ug) {
try {
final boolean isSvg = ug.matchesProperty("SVG");
if (isSvg) {
final String imageSvg = getImageSvg();
final UImageSvg svg = new UImageSvg(imageSvg, 1);
ug.draw(svg);
return;
}
final BufferedImage im = getImage();
final UShape image = new UImage(new PixelImage(im, AffineTransformType.TYPE_BILINEAR));
ug.draw(image);
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
private String getImageSvg() throws IOException, InterruptedException {
final boolean sav = UseStyle.useBetaStyle();
final Diagram system = getSystem();
final ByteArrayOutputStream os = new ByteArrayOutputStream();
system.exportDiagram(os, 0, new FileFormatOption(FileFormat.SVG));
os.close();
UseStyle.setBetaStyle(sav);
return new String(os.toByteArray());
}
private BufferedImage getImage() throws IOException, InterruptedException {
if (image == null) {
final boolean sav = UseStyle.useBetaStyle();
image = getImageSlow();
UseStyle.setBetaStyle(sav);
}
return image;
}
private BufferedImage getImageSlow() throws IOException, InterruptedException {
final Diagram system = getSystem();
final ByteArrayOutputStream os = new ByteArrayOutputStream();
system.exportDiagram(os, 0, new FileFormatOption(FileFormat.PNG));
os.close();
return SImageIO.read(os.toByteArray());
}
public HorizontalAlignment getHorizontalAlignment() {
return HorizontalAlignment.LEFT;
}
private Diagram getSystem() throws IOException, InterruptedException {
final BlockUml blockUml = new BlockUml(skinParam.getThemeStyle(), as2, Defines.createEmpty(), skinParam, null,
null);
return blockUml.getDiagram();
}
}
public class EmbeddedDiagram implements CharSequence {
public static String getEmbeddedType(CharSequence s) {
@ -116,95 +205,8 @@ public class EmbeddedDiagram implements CharSequence {
return toString().subSequence(start, end);
}
public Draw asDraw(ISkinSimple skinParam) {
return new Draw(skinParam);
}
public class Draw extends AbstractTextBlock implements Line, Atom {
private BufferedImage image;
private final ISkinSimple skinParam;
public List<Atom> splitInTwo(StringBounder stringBounder, double width) {
return Arrays.asList((Atom) this);
}
private Draw(ISkinSimple skinParam) {
this.skinParam = skinParam;
}
public double getStartingAltitude(StringBounder stringBounder) {
return 0;
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
try {
final BufferedImage im = getImage();
return new Dimension2DDouble(im.getWidth(), im.getHeight());
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
return new Dimension2DDouble(42, 42);
}
public void drawU(UGraphic ug) {
try {
final boolean isSvg = ug.matchesProperty("SVG");
if (isSvg) {
final String imageSvg = getImageSvg();
final UImageSvg svg = new UImageSvg(imageSvg, 1);
ug.draw(svg);
return;
}
final BufferedImage im = getImage();
final UShape image = new UImage(new PixelImage(im, AffineTransformType.TYPE_BILINEAR));
ug.draw(image);
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
private String getImageSvg() throws IOException, InterruptedException {
final boolean sav = UseStyle.useBetaStyle();
final Diagram system = getSystem();
final ByteArrayOutputStream os = new ByteArrayOutputStream();
system.exportDiagram(os, 0, new FileFormatOption(FileFormat.SVG));
os.close();
UseStyle.setBetaStyle(sav);
return new String(os.toByteArray());
}
private BufferedImage getImage() throws IOException, InterruptedException {
if (image == null) {
final boolean sav = UseStyle.useBetaStyle();
image = getImageSlow();
UseStyle.setBetaStyle(sav);
}
return image;
}
private BufferedImage getImageSlow() throws IOException, InterruptedException {
final Diagram system = getSystem();
final ByteArrayOutputStream os = new ByteArrayOutputStream();
system.exportDiagram(os, 0, new FileFormatOption(FileFormat.PNG));
os.close();
return SImageIO.read(os.toByteArray());
}
public HorizontalAlignment getHorizontalAlignment() {
return HorizontalAlignment.LEFT;
}
private Diagram getSystem() throws IOException, InterruptedException {
final BlockUml blockUml = new BlockUml(skinParam.getThemeStyle(), system.as2(), Defines.createEmpty(),
skinParam, null, null);
return blockUml.getDiagram();
}
public EmbeddedDiagramDraw asDraw(ISkinSimple skinParam) {
return new EmbeddedDiagramDraw(skinParam, system.as2());
}
}

View File

@ -60,9 +60,13 @@ public class EmptyImageBuilder {
private final Color background;
private final StringBounder stringBounder;
public EmptyImageBuilder(String watermark, double width, double height, Color background,
StringBounder stringBounder) {
this(watermark, (int) width, (int) height, background, stringBounder);
private static EmptyImageBuilder create(String watermark, int width, int height, Color background,
StringBounder stringBounder, double dpiFactor) {
EmptyImageBuilder result = new EmptyImageBuilder(watermark, (int) (width * dpiFactor),
(int) (height * dpiFactor), background, stringBounder);
if (dpiFactor != 1.0)
result.g2d.setTransform(AffineTransform.getScaleInstance(dpiFactor, dpiFactor));
return result;
}
public EmptyImageBuilder(String watermark, int width, int height, Color background, StringBounder stringBounder) {
@ -156,14 +160,6 @@ public class EmptyImageBuilder {
return result;
}
public EmptyImageBuilder(String watermark, int width, int height, Color background, StringBounder stringBounder,
double dpiFactor) {
this(watermark, width * dpiFactor, height * dpiFactor, background, stringBounder);
if (dpiFactor != 1.0) {
g2d.setTransform(AffineTransform.getScaleInstance(dpiFactor, dpiFactor));
}
}
public BufferedImage getBufferedImage() {
return im;
}

View File

@ -39,6 +39,7 @@ import java.awt.geom.AffineTransform;
import java.io.Serializable;
import java.util.Objects;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.api.ThemeStyle;
import net.sourceforge.plantuml.graphic.StringBounder;
@ -66,10 +67,12 @@ public final class FileFormatOption implements Serializable {
return scale;
}
@HaxeIgnored
public FileFormatOption(FileFormat fileFormat) {
this(fileFormat, true, false, null, false, null, TikzFontDistortion.getDefault(), 1.0, null, null, ThemeStyle.LIGHT_REGULAR);
}
@HaxeIgnored
public FileFormatOption(FileFormat fileFormat, boolean withMetadata) {
this(fileFormat, withMetadata, false, null, false, null, TikzFontDistortion.getDefault(), 1.0, null, null, ThemeStyle.LIGHT_REGULAR);
}

View File

@ -37,6 +37,7 @@ package net.sourceforge.plantuml;
import java.awt.Font;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.StyleSignatureBasic;
@ -46,6 +47,7 @@ interface FontParamConstant {
String COLOR = "black";
}
@HaxeIgnored
public enum FontParam {
TIMING(12, Font.PLAIN), //
ACTIVITY(12, Font.PLAIN), //
@ -184,7 +186,7 @@ public enum FontParam {
}
public FontConfiguration getFontConfiguration(ISkinParam skinParam) {
return new FontConfiguration(skinParam, this, null);
return FontConfiguration.create(skinParam, this, null);
}
public StyleSignatureBasic getStyleDefinition(SName diagramType) {

View File

@ -37,6 +37,8 @@ package net.sourceforge.plantuml;
import java.util.Objects;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
public class LineLocationImpl implements LineLocation {
private final String desc;
@ -52,6 +54,7 @@ public class LineLocationImpl implements LineLocation {
this(desc, parent, -1);
}
@HaxeIgnored
private LineLocationImpl(String desc, LineLocation parent, int position) {
this.parent = parent;
this.desc = Objects.requireNonNull(desc);

View File

@ -46,6 +46,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.api.ApiWarning;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
@ -55,6 +56,7 @@ import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.security.SFile;
import net.sourceforge.plantuml.stats.StatsUtils;
@HaxeIgnored
public class Option {
private final List<String> excludes = new ArrayList<>();

View File

@ -114,7 +114,7 @@ public class PSystemBuilder {
Diagram result = null;
try {
final DiagramType type = DiagramType.getTypeFromArobaseStart(source.get(0).getString());
final UmlSource umlSource = new UmlSource(source, type == DiagramType.UML, rawSource);
final UmlSource umlSource = UmlSource.createWithRaw(source, type == DiagramType.UML, rawSource);
for (StringLocated s : source) {
if (s.getPreprocessorError() != null) {

View File

@ -38,9 +38,11 @@ package net.sourceforge.plantuml;
import java.util.EnumMap;
import java.util.Map;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.ugraphic.color.HColor;
@HaxeIgnored
public class SkinParamBackcolored extends SkinParamDelegator {
final private HColor backColorElement;

View File

@ -41,9 +41,11 @@ import java.io.IOException;
import java.util.Collections;
import java.util.List;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.security.SFile;
@HaxeIgnored
public class SourceFileReader extends SourceFileReaderAbstract implements ISourceFileReader {
public SourceFileReader(File file) throws IOException {

View File

@ -47,6 +47,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.api.ThemeStyle;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.core.DiagramDescription;
@ -56,6 +57,7 @@ import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.security.SFile;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
@HaxeIgnored
public class SourceStringReader {
final private List<BlockUml> blocks;

View File

@ -46,8 +46,8 @@ public class SplitParam {
private final HColor externalColor;
private final int externalMargin;
public SplitParam() {
this(null, null, 0);
private static SplitParam empty() {
return new SplitParam(null, null, 0);
}
public SplitParam(HColor borderColor, HColor externalColor, int externalMargin) {

View File

@ -37,6 +37,7 @@ package net.sourceforge.plantuml;
import java.util.Objects;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.command.regex.FoxSignature;
import net.sourceforge.plantuml.tim.TLineType;
@ -50,10 +51,17 @@ final public class StringLocated {
private long fox = -1;
private TLineType type;
@HaxeIgnored
public StringLocated(String s, LineLocation location) {
this(s, location, null);
}
public StringLocated(String s, LineLocation location, String preprocessorError) {
this.s = Objects.requireNonNull(s);
this.location = location;
this.preprocessorError = preprocessorError;
}
@Override
public String toString() {
return s;
@ -70,12 +78,6 @@ final public class StringLocated {
return new StringLocated(s.substring(0, s.length() - 1) + next.s, location, preprocessorError);
}
public StringLocated(String s, LineLocation location, String preprocessorError) {
this.s = Objects.requireNonNull(s);
this.location = location;
this.preprocessorError = preprocessorError;
}
public StringLocated withErrorPreprocessor(String preprocessorError) {
return new StringLocated(s, location, preprocessorError);
}

View File

@ -87,23 +87,25 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram,
return pragma;
}
public TitledDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type) {
// public TitledDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type) {
// super(source);
// this.type = type;
// this.skinParam = SkinParam.create(type, style);
// }
public TitledDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type, ISkinSimple orig) {
super(source);
this.type = type;
this.skinParam = SkinParam.create(type, style);
if (orig != null)
this.skinParam.copyAllFrom(orig);
}
public final StyleBuilder getCurrentStyleBuilder() {
return skinParam.getCurrentStyleBuilder();
}
public TitledDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type, ISkinSimple orig) {
this(style, source, type);
if (orig != null) {
this.skinParam.copyAllFrom(orig);
}
}
final public UmlDiagramType getUmlDiagramType() {
return type;
}
@ -274,7 +276,8 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram,
public HColor calculateBackColor() {
if (UseStyle.useBetaStyle()) {
final Style style = StyleSignatureBasic.of(SName.root, SName.document, this.getUmlDiagramType().getStyleName())
final Style style = StyleSignatureBasic
.of(SName.root, SName.document, this.getUmlDiagramType().getStyleName())
.getMergedStyle(this.getSkinParam().getCurrentStyleBuilder());
HColor backgroundColor = style.value(PName.BackGroundColor).asColor(this.getSkinParam().getThemeStyle(),

View File

@ -87,9 +87,9 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
private int minwidth = Integer.MAX_VALUE;
public UmlDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type) {
super(style, source, type);
}
// public UmlDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type) {
// super(style, source, type);
// }
public UmlDiagram(ThemeStyle style, UmlSource source, UmlDiagramType type, ISkinSimple orig) {
super(style, source, type, orig);

View File

@ -37,6 +37,7 @@ package net.sourceforge.plantuml;
import java.util.Comparator;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.cucadiagram.dot.DotMaker2;
public class Url implements EnsureVisible {
@ -46,6 +47,7 @@ public class Url implements EnsureVisible {
private final String label;
private boolean member;
@HaxeIgnored
public Url(String url, String tooltip) {
this(url, tooltip, null);
}

View File

@ -41,10 +41,6 @@ import net.sourceforge.plantuml.command.regex.Pattern2;
public class UrlBuilder {
public static enum ModeUrl {
STRICT, ANYWHERE
}
private static final String S_QUOTED = "\\[\\[[%s]*" + //
"[%g]([^%g]+)[%g]" + // Quoted part
"(?:[%s]*\\{([^{}]*)\\})?" + // Optional tooltip
@ -88,9 +84,9 @@ public class UrlBuilder {
.cmpile(S_LINK_WITH_OPTIONAL_TOOLTIP_WITH_OPTIONAL_LABEL);
private final String topurl;
private ModeUrl mode;
private UrlMode mode;
public UrlBuilder(String topurl, ModeUrl mode) {
public UrlBuilder(String topurl, UrlMode mode) {
this.topurl = topurl;
this.mode = mode;
}
@ -127,9 +123,9 @@ public class UrlBuilder {
}
private boolean matchesOrFind(Matcher2 m) {
if (mode == ModeUrl.STRICT) {
if (mode == UrlMode.STRICT) {
return m.matches();
} else if (mode == ModeUrl.ANYWHERE) {
} else if (mode == UrlMode.ANYWHERE) {
return m.find();
} else {
throw new IllegalStateException();

View File

@ -0,0 +1,40 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml;
public enum UrlMode {
STRICT, ANYWHERE
}

View File

@ -40,7 +40,7 @@ import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.UrlMode;
import net.sourceforge.plantuml.activitydiagram.ActivityDiagram;
import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
import net.sourceforge.plantuml.command.CommandExecutionResult;
@ -177,7 +177,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
link = link.getInv();
}
if (arg.get("URL", 0) != null) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);
final Url urlLink = urlBuilder.getUrl(arg.get("URL", 0));
link.setUrl(urlLink);
}

View File

@ -43,7 +43,7 @@ import net.sourceforge.plantuml.StringLocated;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.UrlMode;
import net.sourceforge.plantuml.activitydiagram.ActivityDiagram;
import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
import net.sourceforge.plantuml.command.BlocLines;
@ -226,7 +226,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
}
if (line0.get("URL", 0) != null) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);
final Url urlLink = urlBuilder.getUrl(line0.get("URL", 0));
link.setUrl(urlLink);
}
@ -242,7 +242,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
}
public Url extractUrlString(final ActivityDiagram diagram, String string) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);
return urlBuilder.getUrl(string);
}

View File

@ -364,7 +364,7 @@ public class ActivityDiagram3 extends UmlDiagram {
manageSwimlaneStrategy();
if (current() instanceof InstructionRepeat) {
final InstructionRepeat instructionRepeat = (InstructionRepeat) current();
final LinkRendering back = new LinkRendering(linkColor).withDisplay(linkLabel);
final LinkRendering back = LinkRendering.create(linkColor).withDisplay(linkLabel);
instructionRepeat.setTest(label, yes, out, nextLinkRenderer(), back, swinlanes.getCurrentSwimlane());
setCurrent(instructionRepeat.getParent());
this.setNextLinkRendererInternal(LinkRendering.none());
@ -471,7 +471,7 @@ public class ActivityDiagram3 extends UmlDiagram {
if (color == null)
return;
final LinkRendering link = new LinkRendering(color);
final LinkRendering link = LinkRendering.create(color);
setNextLink(link);
}

View File

@ -113,11 +113,11 @@ public class ActivityDiagramFactory3 extends PSystemCommandFactory {
cmds.add(new CommandActivity3());
cmds.add(new CommandIf4());
cmds.add(new CommandIf2());
cmds.add(new CommandDecoratorMultine(new CommandIf2(), 50));
cmds.add(CommandDecoratorMultine.create(new CommandIf2(), 50));
cmds.add(new CommandIfLegacy1());
cmds.add(new CommandElseIf2());
cmds.add(new CommandElse3());
cmds.add(new CommandDecoratorMultine(new CommandElse3(), 50));
cmds.add(CommandDecoratorMultine.create(new CommandElse3(), 50));
cmds.add(new CommandElseLegacy1());
cmds.add(new CommandEndif3());
@ -156,7 +156,7 @@ public class ActivityDiagramFactory3 extends PSystemCommandFactory {
cmds.add(new CommandLabel());
cmds.add(new CommandGoto());
cmds.add(new CommandDecoratorMultine(new CommandElseIf2(), 50));
cmds.add(CommandDecoratorMultine.create(new CommandElseIf2(), 50));
return cmds;
}

View File

@ -255,7 +255,7 @@ public class Branch {
lineBreak = style.wrapWidth();
fcArrow = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else {
fcArrow = new FontConfiguration(skinParam(), FontParam.ARROW, null);
fcArrow = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
}
return display.create0(fcArrow, HorizontalAlignment.LEFT, skinParam(), lineBreak, CreoleMode.SIMPLE_LINE, null,

View File

@ -85,7 +85,7 @@ public class InstructionFork extends WithNote implements Instruction {
this.skinParam = skinParam;
this.swimlaneIn = swimlane;
this.swimlaneOut = swimlane;
this.forks.add(new InstructionList());
this.forks.add(InstructionList.empty());
}
private InstructionList getLastList() {
@ -109,14 +109,13 @@ public class InstructionFork extends WithNote implements Instruction {
return new GtileSplit(all, swimlaneIn, getInLinkRenderingColor(skinParam).getColor());
}
private Rainbow getInLinkRenderingColor(ISkinParam skinParam) {
Rainbow color;
color = Rainbow.build(skinParam);
return color;
}
@Override
public Ftile createFtile(FtileFactory factory) {
final List<Ftile> all = new ArrayList<>();
@ -136,7 +135,7 @@ public class InstructionFork extends WithNote implements Instruction {
public void forkAgain(Swimlane swimlane) {
this.swimlaneOut = swimlane;
this.forks.add(new InstructionList());
this.forks.add(InstructionList.empty());
}
@Override

View File

@ -125,7 +125,7 @@ public class InstructionGroup extends AbstractInstruction implements Instruction
@Override
public boolean addNote(Display note, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote) {
if (list.isEmpty()) {
this.note = new PositionedNote(note, position, type, colors, swimlaneNote);
this.note = new PositionedNote(note, position, type, swimlaneNote, colors);
return true;
}
return list.addNote(note, position, type, colors, swimlaneNote);

View File

@ -73,8 +73,12 @@ public class InstructionList extends WithNote implements Instruction, Instructio
return false;
}
public InstructionList() {
this(null);
public static InstructionList empty() {
return new InstructionList(null);
}
public InstructionList(Swimlane defaultSwimlane) {
this.defaultSwimlane = defaultSwimlane;
}
public boolean isEmpty() {
@ -91,10 +95,6 @@ public class InstructionList extends WithNote implements Instruction, Instructio
return getLast() instanceof InstructionStop && ((InstructionStop) getLast()).hasNotes() == false;
}
public InstructionList(Swimlane defaultSwimlane) {
this.defaultSwimlane = defaultSwimlane;
}
@Override
public CommandExecutionResult add(Instruction ins) {
all.add(ins);

View File

@ -48,7 +48,7 @@ import net.sourceforge.plantuml.sequencediagram.NoteType;
public class InstructionPartition extends AbstractInstruction implements Instruction {
private final InstructionList list = new InstructionList();
private final InstructionList list = InstructionList.empty();
private final Instruction parent;
public InstructionPartition(Instruction parent, String partitionTitle) {

View File

@ -204,7 +204,7 @@ public class InstructionRepeat extends AbstractInstruction implements Instructio
if (Display.isNull(backward))
return repeatList.addNote(note, position, type, colors, swimlaneNote);
this.backwardNotes.add(new PositionedNote(note, position, type, colors, swimlaneNote));
this.backwardNotes.add(new PositionedNote(note, position, type, swimlaneNote, colors));
return true;
}

View File

@ -58,7 +58,7 @@ import net.sourceforge.plantuml.ugraphic.color.HColor;
public class InstructionWhile extends WithNote implements Instruction, InstructionCollection {
private final InstructionList repeatList = new InstructionList();
private final InstructionList repeatList = InstructionList.empty();
private final Instruction parent;
private final LinkRendering nextLinkRenderer;
private final HColor color;

View File

@ -45,8 +45,12 @@ public class LinkRendering {
private final Rainbow rainbow;
private final Display display;
public LinkRendering(Rainbow rainbow) {
this(rainbow, Display.NULL);
public static LinkRendering create(Rainbow rainbow) {
return new LinkRendering(rainbow, Display.NULL);
}
public static LinkRendering none() {
return LinkRendering.create(Rainbow.none());
}
private LinkRendering(Rainbow rainbow, Display display) {
@ -54,10 +58,6 @@ public class LinkRendering {
this.display = display;
}
public static LinkRendering none() {
return new LinkRendering(Rainbow.none());
}
public LinkRendering withRainbow(Rainbow rainbow) {
return new LinkRendering(rainbow, display);
}

View File

@ -36,6 +36,7 @@
package net.sourceforge.plantuml.activitydiagram3;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
@ -49,7 +50,7 @@ public class PositionedNote {
private final Colors colors;
private final Swimlane swimlaneNote;
public PositionedNote(Display display, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote) {
public PositionedNote(Display display, NotePosition position, NoteType type, Swimlane swimlaneNote, Colors colors) {
this.display = display;
this.notePosition = position;
this.type = type;
@ -57,15 +58,16 @@ public class PositionedNote {
this.swimlaneNote = swimlaneNote;
}
@HaxeIgnored
public PositionedNote(Display note, NotePosition position, NoteType type, Swimlane swimlaneNote) {
this(note, position, type, swimlaneNote, null);
}
@Override
public String toString() {
return "type=" + type + " notePosition=" + notePosition + " " + display;
}
public PositionedNote(Display note, NotePosition position, NoteType type, Swimlane swimlaneNote) {
this(note, position, type, null, swimlaneNote);
}
public Display getDisplay() {
return display;
}

View File

@ -52,7 +52,7 @@ abstract class WithNote extends AbstractInstruction {
private final Collection<PositionedNote> notes = new ArrayList<>();
public boolean addNote(Display note, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote) {
this.notes.add(new PositionedNote(note, position, type, colors, swimlaneNote));
this.notes.add(new PositionedNote(note, position, type, swimlaneNote, colors));
return true;
}

View File

@ -41,7 +41,7 @@ import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.UrlMode;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
import net.sourceforge.plantuml.command.CommandExecutionResult;
@ -109,7 +109,7 @@ public class CommandActivity3 extends SingleLineCommand2<ActivityDiagram3> {
if (arg.get("URL", 0) == null) {
url = null;
} else {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);
url = urlBuilder.getUrl(arg.get("URL", 0));
}

View File

@ -110,7 +110,7 @@ public class CommandBackward3 extends SingleLineCommand2<ActivityDiagram3> {
if (incomingColor == null)
in = LinkRendering.none();
else
in = new LinkRendering(incomingColor);
in = LinkRendering.create(incomingColor);
final String label = arg.get(name, 0);
return in.withDisplay(Display.getWithNewlines(label));
}

View File

@ -38,7 +38,7 @@ package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.UrlMode;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -94,7 +94,7 @@ public class CommandIf2 extends SingleLineCommand2<ActivityDiagram3> {
if (arg.get("URL", 0) == null) {
url = null;
} else {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);
url = urlBuilder.getUrl(arg.get("URL", 0));
}

View File

@ -41,6 +41,7 @@ import java.awt.geom.Line2D;
import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UBackground;
@ -56,6 +57,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
@HaxeIgnored
public class CollisionDetector extends UGraphicNo {
@Override
@ -65,16 +67,24 @@ public class CollisionDetector extends UGraphicNo {
private final Context context;
public CollisionDetector(StringBounder stringBounder) {
super(stringBounder);
this.context = new Context();
private static CollisionDetector create(StringBounder stringBounder) {
return new CollisionDetector(stringBounder, new UTranslate(), new Context());
}
private CollisionDetector(StringBounder stringBounder, UTranslate translate, Context context) {
super(stringBounder, translate);
this.context = context;
}
private CollisionDetector(CollisionDetector other, UChange change) {
super(other, change);
if (!instanceOfAny(change, UBackground.class, HColor.class, UStroke.class, UTranslate.class)) {
// this(other.stringBounder,
// change instanceof UTranslate ? other.translate.compose((UTranslate) change) :
// other.translate);
super(other.getStringBounder(), change instanceof UTranslate ? other.getTranslate().compose((UTranslate) change)
: other.getTranslate());
if (!instanceOfAny(change, UBackground.class, HColor.class, UStroke.class, UTranslate.class))
throw new UnsupportedOperationException(change.getClass().toString());
}
this.context = other.context;
}

View File

@ -63,7 +63,7 @@ public class EntityImageLegend {
return style.createTextBlockBordered(note, skinParam.getIHtmlColorSet(), skinParam);
}
final TextBlock textBlock = note.create(new FontConfiguration(skinParam, FontParam.LEGEND, null),
final TextBlock textBlock = note.create(FontConfiguration.create(skinParam, FontParam.LEGEND, null),
HorizontalAlignment.LEFT, skinParam);
final Rose rose = new Rose();
final HColor legendBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.legendBackground);

View File

@ -118,7 +118,7 @@ public class FtileFactoryDelegator implements FtileFactory {
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else {
fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null);
fontConfiguration = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
}
return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE);
}

View File

@ -100,7 +100,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
private final List<LaneDivider> dividers = new ArrayList<>();
private Swimlane currentSwimlane = null;
private final Instruction root = new InstructionList();
private final Instruction root = InstructionList.empty();
private Instruction currentInstruction = root;
private LinkRendering nextLinkRenderer = LinkRendering.none();
@ -215,7 +215,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
}
public final void computeSize(StringBounder stringBounder) {
final SlotFinder ug = new SlotFinder(CompressionMode.ON_Y, stringBounder);
final SlotFinder ug = SlotFinder.create(CompressionMode.ON_Y, stringBounder);
if (swimlanes().size() > 1) {
TextBlock full = root.createFtile(getFtileFactory(stringBounder));
computeSizeInternal(ug, full);
@ -258,7 +258,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
private TextBlock getTitle(Swimlane swimlane) {
final HorizontalAlignment horizontalAlignment = HorizontalAlignment.LEFT;
FontConfiguration fontConfiguration = new FontConfiguration(skinParam, FontParam.SWIMLANE_TITLE, null);
FontConfiguration fontConfiguration = FontConfiguration.create(skinParam, FontParam.SWIMLANE_TITLE, null);
if (UseStyle.useBetaStyle()) {
fontConfiguration = getStyle().getFontConfiguration(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet());
@ -359,7 +359,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
private void computeDrawingWidths(UGraphic ug, TextBlock full) {
final StringBounder stringBounder = ug.getStringBounder();
for (Swimlane swimlane : swimlanes()) {
final LimitFinder limitFinder = new LimitFinder(stringBounder, false);
final LimitFinder limitFinder = LimitFinder.create(stringBounder, false);
final UGraphicInterceptorOneSwimlane interceptor = new UGraphicInterceptorOneSwimlane(
new UGraphicForSnake(limitFinder), swimlane, swimlanes());
full.drawU(interceptor);

View File

@ -37,6 +37,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
import static net.sourceforge.plantuml.utils.ObjectUtils.instanceOfAny;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UBackground;
@ -49,6 +50,7 @@ import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
@HaxeIgnored
public class ZadBuilder extends UGraphicNo {
@Override
@ -63,20 +65,17 @@ public class ZadBuilder extends UGraphicNo {
}
public ZadBuilder(StringBounder stringBounder) {
super(stringBounder);
super(stringBounder, new UTranslate());
this.context = new Context();
}
private ZadBuilder(ZadBuilder other, UChange change) {
super(other, change);
if (!instanceOfAny(change,
UBackground.class,
HColor.class,
UStroke.class,
UTranslate.class
)) {
// super(other, change);
super(other.getStringBounder(), change instanceof UTranslate ? other.getTranslate().compose((UTranslate) change)
: other.getTranslate());
if (!instanceOfAny(change, UBackground.class, HColor.class, UStroke.class, UTranslate.class))
throw new UnsupportedOperationException(change.getClass().toString());
}
this.context = other.context;
}

View File

@ -139,7 +139,7 @@ public abstract class AbstractParallelFtilesBuilder {
final Style style = getStyleSignatureArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else {
fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null);
fontConfiguration = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
}
return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE);
}

View File

@ -82,7 +82,7 @@ public class FloatingNote extends AbstractTextBlock implements Stencil, TextBloc
final Style style = StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.note)
.getMergedStyle(skinParam.getCurrentStyleBuilder());
wrapWidth = style.wrapWidth();
fc = new FontConfiguration(skinParam, style);
fc = FontConfiguration.create(skinParam, style);
noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet());
borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
@ -92,7 +92,7 @@ public class FloatingNote extends AbstractTextBlock implements Stencil, TextBloc
shadowing = skinParam.shadowing(null) ? 4 : 0;
noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
fc = new FontConfiguration(skinParam, FontParam.NOTE, null);
fc = FontConfiguration.create(skinParam, FontParam.NOTE, null);
wrapWidth = skinParam.wrapWidth();
}

View File

@ -99,9 +99,9 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground)
: branch0.getColor();
arrowColor = Rainbow.build(skinParam());
fcTest = new FontConfiguration(skinParam(), testParam, null)
fcTest = FontConfiguration.create(skinParam(), testParam, null)
.changeColor(fontColor(FontParam.ACTIVITY_DIAMOND));
fcArrow = new FontConfiguration(skinParam(), FontParam.ARROW, null);
fcArrow = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
}
if (thens.size() > 1) {

View File

@ -107,8 +107,8 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
diamondColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground);
}
arrowColor = Rainbow.build(skinParam());
fcDiamond = new FontConfiguration(skinParam(), FontParam.ACTIVITY_DIAMOND, null);
fcArrow = new FontConfiguration(skinParam(), FontParam.ARROW, null);
fcDiamond = FontConfiguration.create(skinParam(), FontParam.ACTIVITY_DIAMOND, null);
fcArrow = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
}
final LinkRendering endRepeatLinkRendering = repeat.getOutLinkRendering();

View File

@ -145,7 +145,7 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator {
backColor = branch0.getColor() == null ? style.value(PName.BackGroundColor)
.asColor(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet()) : branch0.getColor();
} else {
fcDiamond = new FontConfiguration(skinParam(), FontParam.ACTIVITY_DIAMOND, null);
fcDiamond = FontConfiguration.create(skinParam(), FontParam.ACTIVITY_DIAMOND, null);
borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
backColor = branch0.getColor() == null
? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground)

View File

@ -99,8 +99,8 @@ public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
backColor = color == null ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground)
: color;
arrowColor = Rainbow.build(skinParam());
fontArrow = new FontConfiguration(skinParam(), FontParam.ARROW, null);
fcTest = new FontConfiguration(skinParam(), testParam, null);
fontArrow = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
fcTest = FontConfiguration.create(skinParam(), testParam, null);
}
incoming1 = ensureColor(incoming1, arrowColor);

View File

@ -118,7 +118,7 @@ public class FtileGroup extends AbstractFtile {
style = null;
final UFont font = skinParam.getFont(null, false, FontParam.PARTITION);
final HColor fontColor = skinParam.getFontHtmlColor(null, FontParam.PARTITION);
fc = new FontConfiguration(font, fontColor, skinParam.getHyperlinkColor(),
fc = FontConfiguration.create(font, fontColor, skinParam.getHyperlinkColor(),
skinParam.useUnderlineForHyperlink(), skinParam.getTabSize());
this.shadowing = skinParam().shadowing(null) ? 3 : 0;
thickness = skinParam.getThickness(LineParam.partitionBorder, null);
@ -169,7 +169,7 @@ public class FtileGroup extends AbstractFtile {
}
private MinMax getInnerMinMax(StringBounder stringBounder) {
final LimitFinder limitFinder = new LimitFinder(stringBounder, false);
final LimitFinder limitFinder = LimitFinder.create(stringBounder, false);
final UGraphicForSnake interceptor = new UGraphicForSnake(limitFinder);
final UGraphicInterceptorUDrawable interceptor2 = new UGraphicInterceptorUDrawable(interceptor);

View File

@ -128,10 +128,10 @@ class FtileIfAndStop extends AbstractFtile {
if (UseStyle.useBetaStyle()) {
final Style style = StyleSignatureBasic.activityDiamond().getMergedStyle(skinParam.getCurrentStyleBuilder());
thickness = tileNonStop.getThickness(style);
fcTest = new FontConfiguration(skinParam, style);
fcTest = FontConfiguration.create(skinParam, style);
} else {
thickness = tileNonStop.getThickness(null);
fcTest = new FontConfiguration(skinParam, FontParam.ACTIVITY_DIAMOND, null);
fcTest = FontConfiguration.create(skinParam, FontParam.ACTIVITY_DIAMOND, null);
}
final Sheet sheet = Parser

View File

@ -127,7 +127,7 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable
wrapWidth = skinParam.wrapWidth();
}
final FontConfiguration fc = new FontConfiguration(skinParam, FontParam.NOTE, null);
final FontConfiguration fc = FontConfiguration.create(skinParam, FontParam.NOTE, null);
final Sheet sheet = Parser
.build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL)

View File

@ -158,7 +158,7 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
} else {
noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
fc = new FontConfiguration(skinParam, FontParam.NOTE, null);
fc = FontConfiguration.create(skinParam, FontParam.NOTE, null);
shadowing = skinParam.shadowing(null) ? 4 : 0;
wrapWidth = skinParam.wrapWidth();
}

View File

@ -130,7 +130,7 @@ public class FtileWithNotes extends AbstractFtile {
} else {
noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder);
fc = new FontConfiguration(skinParam, FontParam.NOTE, null);
fc = FontConfiguration.create(skinParam, FontParam.NOTE, null);
shadowing = skinParam.shadowing(null) ? 4 : 0;
wrapWidth = skinParam.wrapWidth();
}

View File

@ -160,7 +160,7 @@ public class FtileBox extends AbstractFtile {
final FontConfiguration fc;
final LineBreakStrategy wrapWidth;
if (UseStyle.useBetaStyle()) {
this.inRendering = new LinkRendering(
this.inRendering = LinkRendering.create(
Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle()));
Colors specBack = null;
if (skinParam instanceof SkinParamColors) {
@ -180,10 +180,10 @@ public class FtileBox extends AbstractFtile {
} else {
this.padding = ClockwiseTopRightBottomLeft.same(10);
this.margin = ClockwiseTopRightBottomLeft.same(0);
this.inRendering = new LinkRendering(Rainbow.build(skinParam));
this.inRendering = LinkRendering.create(Rainbow.build(skinParam));
this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder);
this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground);
fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
this.horizontalAlignment = HorizontalAlignment.LEFT;
this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0;
wrapWidth = skinParam.wrapWidth();

View File

@ -161,7 +161,7 @@ public class FtileBox2 extends AbstractFtile {
final FontConfiguration fc;
final LineBreakStrategy wrapWidth;
if (UseStyle.useBetaStyle()) {
this.inRendering = new LinkRendering(
this.inRendering = LinkRendering.create(
Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle()));
Colors specBack = null;
if (skinParam instanceof SkinParamColors) {
@ -181,10 +181,10 @@ public class FtileBox2 extends AbstractFtile {
} else {
this.padding = ClockwiseTopRightBottomLeft.same(10);
this.margin = ClockwiseTopRightBottomLeft.same(0);
this.inRendering = new LinkRendering(Rainbow.build(skinParam));
this.inRendering = LinkRendering.create(Rainbow.build(skinParam));
this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder);
this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground);
fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
this.horizontalAlignment = HorizontalAlignment.LEFT;
this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0;
wrapWidth = skinParam.wrapWidth();

View File

@ -186,7 +186,7 @@ public class FtileBoxOld extends AbstractFtile {
final FontConfiguration fc;
final LineBreakStrategy wrapWidth;
if (UseStyle.useBetaStyle()) {
this.inRendering = new LinkRendering(
this.inRendering = LinkRendering.create(
Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle()));
Colors specBack = null;
if (skinParam instanceof SkinParamColors)
@ -204,10 +204,10 @@ public class FtileBoxOld extends AbstractFtile {
this.minimumWidth = style.value(PName.MinimumWidth).asDouble();
} else {
this.padding = ClockwiseTopRightBottomLeft.same(10);
this.inRendering = new LinkRendering(Rainbow.build(skinParam));
this.inRendering = LinkRendering.create(Rainbow.build(skinParam));
this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder);
this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground);
fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
this.horizontalAlignment = HorizontalAlignment.LEFT;
this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0;
wrapWidth = skinParam.wrapWidth();

View File

@ -77,9 +77,9 @@ public class FtileCircleSpot extends AbstractFtile {
this.swimlane = swimlane;
this.backColor = backColor;
if (UseStyle.useBetaStyle())
this.fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
this.fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
else
this.fc = new FontConfiguration(skinParam, style);
this.fc = FontConfiguration.create(skinParam, style);
}
@Override

View File

@ -93,7 +93,7 @@ public class GtileAssembly extends GtileTopDown {
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
} else {
fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null);
fontConfiguration = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
}
return display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE);
}

View File

@ -140,7 +140,7 @@ public class GtileBox extends AbstractGtile {
final FontConfiguration fc;
final LineBreakStrategy wrapWidth;
if (UseStyle.useBetaStyle()) {
this.inRendering = new LinkRendering(
this.inRendering = LinkRendering.create(
Rainbow.build(styleArrow, getIHtmlColorSet(), skinParam.getThemeStyle()));
Colors specBack = null;
if (skinParam instanceof SkinParamColors) {
@ -160,10 +160,10 @@ public class GtileBox extends AbstractGtile {
} else {
this.padding = ClockwiseTopRightBottomLeft.same(10);
this.margin = ClockwiseTopRightBottomLeft.same(0);
this.inRendering = new LinkRendering(Rainbow.build(skinParam));
this.inRendering = LinkRendering.create(Rainbow.build(skinParam));
this.borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder);
this.backColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground);
fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
this.horizontalAlignment = HorizontalAlignment.LEFT;
this.shadowing = skinParam().shadowing(null) ? 3.0 : 0.0;
wrapWidth = skinParam.wrapWidth();

View File

@ -75,7 +75,7 @@ public class GtileCircleSpot extends AbstractGtile {
super(stringBounder, skinParam, swimlane);
this.spot = spot;
this.backColor = backColor;
this.fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
this.fc = FontConfiguration.create(skinParam, FontParam.ACTIVITY, null);
if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam().getCurrentStyleBuilder());
this.shadowing = style.value(PName.Shadowing).asDouble();

View File

@ -114,7 +114,7 @@ public class GtileGroup extends AbstractGtileRoot {
style = null;
final UFont font = skinParam.getFont(null, false, FontParam.PARTITION);
final HColor fontColor = skinParam.getFontHtmlColor(null, FontParam.PARTITION);
fc = new FontConfiguration(font, fontColor, skinParam.getHyperlinkColor(),
fc = FontConfiguration.create(font, fontColor, skinParam.getHyperlinkColor(),
skinParam.useUnderlineForHyperlink(), skinParam.getTabSize());
this.shadowing = skinParam().shadowing(null) ? 3 : 0;
}

View File

@ -205,7 +205,7 @@ public class GtileIfHexagon extends GtileColumns {
// final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
// fontConfiguration = style.getFontConfiguration(skinParam().getThemeStyle(), skinParam().getIHtmlColorSet());
// } else {
// fontConfiguration = new FontConfiguration(skinParam(), FontParam.ARROW, null);
// fontConfiguration = FontConfiguration.create(skinParam(), FontParam.ARROW, null);
// }
//
// return branch.getDisplayPositive().create0(fontConfiguration, HorizontalAlignment.LEFT, skinParam(),

View File

@ -133,7 +133,7 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea
} else {
noteBackgroundColor = rose.getHtmlColor(skinParam, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam, ColorParam.noteBorder);
fc = new FontConfiguration(skinParam, FontParam.NOTE, null);
fc = FontConfiguration.create(skinParam, FontParam.NOTE, null);
shadowing = skinParam.shadowing(null) ? 4 : 0;
wrapWidth = skinParam.wrapWidth();
}

View File

@ -134,7 +134,7 @@ public class GtileWithNotes extends AbstractGtile {
} else {
noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder);
fc = new FontConfiguration(skinParam, FontParam.NOTE, null);
fc = FontConfiguration.create(skinParam, FontParam.NOTE, null);
shadowing = skinParam.shadowing(null) ? 4 : 0;
wrapWidth = skinParam.wrapWidth();
}

View File

@ -85,7 +85,7 @@ public class Gtiles {
borderColor = rose.getHtmlColor(skinParam, ColorParam.activityDiamondBorder);
backColor = color == null ? rose.getHtmlColor(skinParam, ColorParam.activityDiamondBackground) : color;
fcTest = new FontConfiguration(skinParam, testParam, null)
fcTest = FontConfiguration.create(skinParam, testParam, null)
.changeColor(fontColor(skinParam, FontParam.ACTIVITY_DIAMOND));
}

View File

@ -0,0 +1,11 @@
package net.sourceforge.plantuml.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
@Target({ ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE })
public @interface HaxeIgnored {
}

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.api;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.core.ImageData;
@ -49,7 +50,8 @@ public abstract class ImageDataAbstract implements ImageData {
this.width = width;
this.height = height;
}
@HaxeIgnored
public ImageDataAbstract(Dimension2D dim) {
this((int) dim.getWidth(), (int) dim.getHeight());
}

View File

@ -38,6 +38,7 @@ package net.sourceforge.plantuml.api;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.CMapData;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
public class ImageDataComplex extends ImageDataAbstract {
@ -45,6 +46,7 @@ public class ImageDataComplex extends ImageDataAbstract {
private final String warningOrError;
@SuppressWarnings("unused") // available publicly so retained for backwards compatibility
@HaxeIgnored
public ImageDataComplex(Dimension2D info, CMapData cmap, String warningOrError) {
super(info);
this.cmap = cmap;

View File

@ -35,16 +35,19 @@
*/
package net.sourceforge.plantuml.api;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.core.ImageData;
public class ImageDataSimple extends ImageDataAbstract {
@HaxeIgnored
public ImageDataSimple(int width, int height) {
super(width, height);
}
@HaxeIgnored
public ImageDataSimple(Dimension2D dim) {
super(dim);
}
@ -54,6 +57,7 @@ public class ImageDataSimple extends ImageDataAbstract {
setStatus(status);
}
@HaxeIgnored
private ImageDataSimple() {
this(0, 0);
}

View File

@ -34,7 +34,8 @@ import java.util.concurrent.locks.ReentrantLock;
import java.util.prefs.Preferences;
import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
@HaxeIgnored
public class NumberAnalyzed implements INumberAnalyzed {
private static final int SLIDING_WINDOW = 1024;

View File

@ -33,7 +33,9 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.prefs.Preferences;
import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
@HaxeIgnored
public class NumberAnalyzed2 implements INumberAnalyzed {
private static final int SLIDING_WINDOW = 512;

View File

@ -33,7 +33,9 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.prefs.Preferences;
import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
@HaxeIgnored
public class NumberAnalyzedDated extends NumberAnalyzed {
private final AtomicLong created = new AtomicLong();

View File

@ -17,7 +17,7 @@ class Functions {
/**
* H0 = H64(p, τ, m, t, v, y, |P|, P, |S|, S, |L|, K, |X|, X)
* H0 = H64(p, \u03c4, m, t, v, y, |P|, P, |S|, S, |L|, K, |X|, X)
* -> 64 byte (ARGON2_PREHASH_DIGEST_LENGTH)
*/
static byte[] initialHash(byte[] lanes, byte[] outputLength,

View File

@ -71,7 +71,7 @@ public class BoardDiagram extends UmlDiagram {
}
public BoardDiagram(ThemeStyle style, UmlSource source) {
super(style, source, UmlDiagramType.BOARD);
super(style, source, UmlDiagramType.BOARD, null);
}
@Override

View File

@ -76,7 +76,7 @@ public class BpmDiagram extends UmlDiagram {
}
public BpmDiagram(ThemeStyle style, UmlSource source) {
super(style, source, UmlDiagramType.BPM);
super(style, source, UmlDiagramType.BPM, null);
}
@Override

View File

@ -167,7 +167,7 @@ public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzz
return FtileBox.create(skinParam, display, null, BoxStyle.PLAIN, null);
}
final UFont font = UFont.serif(14);
final FontConfiguration fc = new FontConfiguration(font, HColorUtils.RED, HColorUtils.RED, false);
final FontConfiguration fc = FontConfiguration.create(font, HColorUtils.RED, HColorUtils.RED, false);
if (Display.isNull(display)) {
return Display.getWithNewlines(type.toString()).create(fc, HorizontalAlignment.LEFT, skinParam);
}

View File

@ -40,7 +40,7 @@ import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.UrlMode;
import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -168,7 +168,7 @@ public class CommandCreateClass extends SingleLineCommand2<ClassDiagram> {
final String urlString = arg.get("URL", 0);
if (urlString != null) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);
final Url url = urlBuilder.getUrl(urlString);
entity.addUrl(url);
}

View File

@ -40,7 +40,7 @@ import net.sourceforge.plantuml.StringLocated;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.UrlMode;
import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
@ -271,7 +271,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
final String urlString = arg.get("URL", 0);
if (urlString != null) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);
final Url url = urlBuilder.getUrl(urlString);
result.addUrl(url);
}

View File

@ -41,7 +41,7 @@ import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.UrlMode;
import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -220,7 +220,7 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
final String urlString = arg.get("URL", 0);
if (urlString != null) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);
final Url url = urlBuilder.getUrl(urlString);
entity.addUrl(url);
}

View File

@ -42,7 +42,7 @@ import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.UrlMode;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@ -217,7 +217,7 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
labels.getSecondLabel(), diagram.getLabeldistance(), diagram.getLabelangle(),
diagram.getSkinParam().getCurrentStyleBuilder());
if (arg.get("URL", 0) != null) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);
final Url url = urlBuilder.getUrl(arg.get("URL", 0));
link.setUrl(url);
}

View File

@ -38,7 +38,7 @@ package net.sourceforge.plantuml.classdiagram.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.UrlMode;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -87,7 +87,7 @@ public class CommandUrl extends SingleLineCommand2<AbstractEntityDiagram> {
return CommandExecutionResult.error(code + " does not exist");
}
// final IEntity entity = diagram.getOrCreateLeaf(code, null);
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);
final Url url = urlBuilder.getUrl(urlString);
entity.addUrl(url);
return CommandExecutionResult.ok();

View File

@ -132,8 +132,8 @@ public class BlocLines implements Iterable<StringLocated> {
return new BlocLines(result);
}
public BlocLines() {
this(new ArrayList<StringLocated>());
public static BlocLines create() {
return new BlocLines(new ArrayList<StringLocated>());
}
public BlocLines add(StringLocated s) {

View File

@ -42,40 +42,40 @@ public class CommandDecoratorMultine<D extends Diagram> implements Command<D> {
private final SingleLineCommand2<D> cmd;
private final boolean removeEmptyColumn;
private final int nbMaxLines;
public CommandDecoratorMultine(SingleLineCommand2<D> cmd, int nbMaxLines) {
this(cmd, false, nbMaxLines);
public static <D extends Diagram> CommandDecoratorMultine<D> create(SingleLineCommand2<D> cmd, int nbMaxLines) {
return new CommandDecoratorMultine<D>(cmd, false, nbMaxLines);
}
public CommandDecoratorMultine(SingleLineCommand2<D> cmd, boolean removeEmptyColumn, int nbMaxLines) {
private CommandDecoratorMultine(SingleLineCommand2<D> cmd, boolean removeEmptyColumn, int nbMaxLines) {
this.cmd = cmd;
this.removeEmptyColumn = removeEmptyColumn;
this.nbMaxLines = nbMaxLines;
}
public CommandExecutionResult execute(D diagram, BlocLines lines) {
if (removeEmptyColumn) {
if (removeEmptyColumn)
lines = lines.removeEmptyColumns();
}
lines = lines.toSingleLineWithHiddenNewLine();
return cmd.execute(diagram, lines);
}
public CommandControl isValid(BlocLines lines) {
if (cmd.isCommandForbidden()) {
if (cmd.isCommandForbidden())
return CommandControl.NOT_OK;
}
lines = lines.toSingleLineWithHiddenNewLine();
if (cmd.isForbidden(lines.getFirst().getString())) {
if (cmd.isForbidden(lines.getFirst().getString()))
return CommandControl.NOT_OK;
}
final CommandControl tmp = cmd.isValid(lines);
if (tmp == CommandControl.OK_PARTIAL) {
if (tmp == CommandControl.OK_PARTIAL)
throw new IllegalStateException();
}
if (tmp == CommandControl.OK) {
if (tmp == CommandControl.OK)
return tmp;
}
return CommandControl.OK_PARTIAL;
}

View File

@ -38,7 +38,7 @@ package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.UrlMode;
import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@ -103,7 +103,7 @@ public class CommandNamespace extends SingleLineCommand2<ClassDiagram> {
final String urlString = arg.get("URL", 0);
if (urlString != null) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);
final Url url = urlBuilder.getUrl(urlString);
p.addUrl(url);
}

View File

@ -38,7 +38,7 @@ package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.UrlMode;
import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@ -103,7 +103,7 @@ public class CommandNamespace2 extends SingleLineCommand2<ClassDiagram> {
final String urlString = arg.get("URL", 0);
if (urlString != null) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);
final Url url = urlBuilder.getUrl(urlString);
p.addUrl(url);
}

View File

@ -38,7 +38,7 @@ package net.sourceforge.plantuml.command;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.UrlMode;
import net.sourceforge.plantuml.classdiagram.ClassDiagram;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@ -97,7 +97,7 @@ public class CommandNamespaceEmpty extends SingleLineCommand2<ClassDiagram> {
final String urlString = arg.get("URL", 0);
if (urlString != null) {
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), ModeUrl.STRICT);
final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);
final Url url = urlBuilder.getUrl(urlString);
p.addUrl(url);
}

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