1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-22 02:49:06 +00:00

Import version 1.2021.6

This commit is contained in:
Arnaud Roques 2021-05-14 10:42:57 +02:00
parent 534bab1df4
commit f83a207360
585 changed files with 1257 additions and 16361 deletions

View File

@ -35,7 +35,7 @@
<groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId>
<version>1.2021.5-SNAPSHOT</version>
<version>1.2021.6-SNAPSHOT</version>
<packaging>jar</packaging>
<name>PlantUML</name>

View File

@ -1,3 +1,21 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* Original Author: Arnaud Roques
*
*/
package gen.annotation;
import java.lang.annotation.ElementType;

View File

@ -1,3 +1,21 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* Original Author: Arnaud Roques
*
*/
package gen.annotation;
import java.lang.annotation.ElementType;

View File

@ -1,3 +1,21 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* Original Author: Arnaud Roques
*
*/
package gen.annotation;
import java.lang.annotation.ElementType;

View File

@ -1,3 +1,21 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* Original Author: Arnaud Roques
*
*/
package gen.annotation;
import java.lang.annotation.ElementType;

View File

@ -1,3 +1,21 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* Original Author: Arnaud Roques
*
*/
package gen.annotation;
import java.lang.annotation.ElementType;

View File

@ -1,3 +1,21 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* Original Author: Arnaud Roques
*
*/
package gen.annotation;
import java.lang.annotation.ElementType;

View File

@ -1,3 +1,21 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* Original Author: Arnaud Roques
*
*/
package gen.annotation;
import java.lang.annotation.ElementType;

View File

@ -1,3 +1,21 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* Original Author: Arnaud Roques
*
*/
package gen.annotation;
import java.lang.annotation.ElementType;

View File

@ -1,3 +1,21 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* Original Author: Arnaud Roques
*
*/
package gen.annotation;
import java.lang.annotation.ElementType;

View File

@ -68,7 +68,7 @@ public class BackSlash {
if (s == null) {
return null;
}
final List<String> result = new ArrayList<String>();
final List<String> result = new ArrayList<>();
final StringBuilder current = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
final char c = s.charAt(i);

View File

@ -65,7 +65,7 @@ public class BlockUml {
private Diagram system;
private final Defines localDefines;
private final ISkinSimple skinParam;
private final Set<FileWithSuffix> included = new HashSet<FileWithSuffix>();
private final Set<FileWithSuffix> included = new HashSet<>();
public Set<FileWithSuffix> getIncluded() {
return Collections.unmodifiableSet(included);
@ -97,7 +97,7 @@ public class BlockUml {
}
public static List<StringLocated> convert(List<String> strings) {
final List<StringLocated> result = new ArrayList<StringLocated>();
final List<StringLocated> result = new ArrayList<>();
LineLocationImpl location = new LineLocationImpl("block", null);
for (String s : strings) {
location = location.oneLineRead();
@ -109,7 +109,7 @@ public class BlockUml {
private boolean preprocessorError;
public BlockUml(List<StringLocated> strings, Defines defines, ISkinSimple skinParam, PreprocessorModeSet mode) {
this.rawSource = new ArrayList<StringLocated>(strings);
this.rawSource = new ArrayList<>(strings);
this.localDefines = defines;
this.skinParam = skinParam;
final String s0 = strings.get(0).getTrimmed().getString();
@ -117,7 +117,7 @@ public class BlockUml {
throw new IllegalArgumentException();
}
if (mode == null) {
this.data = new ArrayList<StringLocated>(strings);
this.data = new ArrayList<>(strings);
} else {
final TimLoader timLoader = new TimLoader(mode.getImportedFiles(), defines, mode.getCharset(),
(DefinitionsContainer) mode);
@ -199,7 +199,7 @@ public class BlockUml {
}
public List<String> getDefinition(boolean withHeader) {
final List<String> result = new ArrayList<String>();
final List<String> result = new ArrayList<>();
for (StringLocated s : data) {
result.add(s.getString());
}

View File

@ -55,8 +55,8 @@ import net.sourceforge.plantuml.utils.StartUtils;
public final class BlockUmlBuilder implements DefinitionsContainer {
private final List<BlockUml> blocks = new ArrayList<BlockUml>();
private Set<FileWithSuffix> usedFiles = new HashSet<FileWithSuffix>();
private final List<BlockUml> blocks = new ArrayList<>();
private Set<FileWithSuffix> usedFiles = new HashSet<>();
private final UncommentReadLine reader;
private final Defines defines;
private final ImportedFiles importedFiles;
@ -92,7 +92,7 @@ public final class BlockUmlBuilder implements DefinitionsContainer {
while ((s = includer.readLine()) != null) {
if (StartUtils.isArobaseStartDiagram(s.getString())) {
current = new ArrayList<StringLocated>();
current = new ArrayList<>();
paused = false;
}
if (StartUtils.isArobasePauseDiagram(s.getString())) {

View File

@ -79,7 +79,7 @@ public class CMapData {
public static CMapData cmapString(Set<Url> allUrlEncountered, double scale) {
final CMapData cmapdata = new CMapData();
final List<Url> all = new ArrayList<Url>(allUrlEncountered);
final List<Url> all = new ArrayList<>(allUrlEncountered);
Collections.sort(all, Url.SURFACE_COMPARATOR);
int seq = 1;

View File

@ -64,7 +64,7 @@ public class DirWatcher {
public List<GeneratedImage> buildCreatedFiles() throws IOException, InterruptedException {
boolean error = false;
final List<GeneratedImage> result = new ArrayList<GeneratedImage>();
final List<GeneratedImage> result = new ArrayList<>();
for (File f : dir.listFiles()) {
if (error) {
continue;

View File

@ -132,7 +132,7 @@ public class EmptyImageBuilder {
private List<String> withBreaks(String watermark, Font javaFont, FontMetrics fm, int maxWidth) {
final String[] words = watermark.split("\\s+");
final List<String> result = new ArrayList<String>();
final List<String> result = new ArrayList<>();
String pending = "";
for (String word : words) {
final String candidate = pending.length() == 0 ? word : pending + " " + word;

View File

@ -83,10 +83,9 @@ public final class FileFormatOption implements Serializable {
this.useRedForError = useRedForError;
this.svgLinkTarget = svgLinkTarget;
this.debugsvek = debugsvek;
this.tikzFontDistortion = tikzFontDistortion;
this.tikzFontDistortion = Objects.requireNonNull(tikzFontDistortion);
this.scale = scale;
this.preserveAspectRatio = preserveAspectRatio;
Objects.requireNonNull(tikzFontDistortion);
}
public StringBounder getDefaultStringBounder(SvgCharSizeHack charSizeHack) {

View File

@ -46,7 +46,7 @@ import net.sourceforge.plantuml.command.regex.Pattern2;
public class FileGroup {
private final List<File> result = new ArrayList<File>();
private final List<File> result = new ArrayList<>();
private final String pattern;
private final List<String> excluded;
private final Option option;

View File

@ -44,7 +44,7 @@ public class FileSystem {
private final static FileSystem singleton = new FileSystem();
private ThreadLocal<String> currentDir = new ThreadLocal<String>();
private ThreadLocal<String> currentDir = new ThreadLocal<>();
private FileSystem() {
reset();

View File

@ -53,9 +53,8 @@ public class LineLocationImpl implements LineLocation {
}
private LineLocationImpl(String desc, LineLocation parent, int position) {
Objects.requireNonNull(desc);
this.parent = parent;
this.desc = desc;
this.desc = Objects.requireNonNull(desc);
this.position = position;
}

View File

@ -104,7 +104,7 @@ public abstract class Log {
// }
}
// private static final ThreadLocal<String> header2 = new ThreadLocal<String>();
// private static final ThreadLocal<String> header2 = new ThreadLocal<>();
//
public static void header(String s) {
// header2.set(s);

View File

@ -51,7 +51,7 @@ import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException;
public class NewpagedDiagram extends AbstractPSystem {
private final List<Diagram> diagrams = new ArrayList<Diagram>();
private final List<Diagram> diagrams = new ArrayList<>();
public NewpagedDiagram(AbstractPSystem diag1, AbstractPSystem diag2) {
if (diag1 instanceof NewpagedDiagram) {

View File

@ -57,8 +57,8 @@ import net.sourceforge.plantuml.stats.StatsUtils;
public class Option {
private final List<String> excludes = new ArrayList<String>();
private final List<String> config = new ArrayList<String>();
private final List<String> excludes = new ArrayList<>();
private final List<String> config = new ArrayList<>();
private final Map<String, String> defines = new LinkedHashMap<String, String>();
private String charset;
private boolean computeurl = false;
@ -91,7 +91,7 @@ public class Option {
private File outputFile = null;
private String filename;
private final List<String> result = new ArrayList<String>();
private final List<String> result = new ArrayList<>();
public Option() {
}

View File

@ -58,7 +58,7 @@ import net.sourceforge.plantuml.version.Version;
public class OptionPrint {
static public void printTestDot() throws InterruptedException {
final List<String> result = new ArrayList<String>();
final List<String> result = new ArrayList<>();
final int errorCode = GraphvizUtils.addDotStatus(result, false);
for (String s : result) {
if (errorCode == 0) {
@ -187,7 +187,7 @@ public class OptionPrint {
System.out.println(v);
}
System.out.println();
final List<String> result = new ArrayList<String>();
final List<String> result = new ArrayList<>();
final int errorCode = GraphvizUtils.addDotStatus(result, false);
for (String s : result) {
System.out.println(s);
@ -213,7 +213,7 @@ public class OptionPrint {
all = Arrays.asList("java.runtime.name", "Java Runtime", "java.vm.name", "JVM", "file.encoding",
"Default Encoding", "user.language", "Language", "user.country", "Country");
}
final List<String> result = new ArrayList<String>();
final List<String> result = new ArrayList<>();
for (int i = 0; i < all.size(); i += 2) {
result.add(all.get(i + 1) + ": " + p.getProperty(all.get(i)));
}
@ -221,7 +221,7 @@ public class OptionPrint {
}
public static Collection<String> interestingValues() {
final List<String> strings = new ArrayList<String>();
final List<String> strings = new ArrayList<>();
// if (withIp() == false) {
// strings.add("Machine: " + getHostName());
// }

View File

@ -125,7 +125,7 @@ public class PSystemBuilder {
}
final DiagramType diagramType = umlSource.getDiagramType();
final List<PSystemError> errors = new ArrayList<PSystemError>();
final List<PSystemError> errors = new ArrayList<>();
final List<PSystemFactory> factories = getAllFactories(skinParam);
for (PSystemFactory systemFactory : factories) {
if (diagramType != systemFactory.getDiagramType()) {
@ -152,7 +152,7 @@ public class PSystemBuilder {
}
private static List<PSystemFactory> getAllFactories(ISkinSimple skinParam) {
final List<PSystemFactory> factories = new ArrayList<PSystemFactory>();
final List<PSystemFactory> factories = new ArrayList<>();
factories.add(new PSystemWelcomeFactory());
factories.add(new PSystemColorsFactory());
factories.add(new SequenceDiagramFactory(skinParam));

View File

@ -99,7 +99,7 @@ public class PSystemUtils {
private static List<FileImageData> exportDiagramsNewpaged(NewpagedDiagram system, SuggestedFile suggestedFile,
FileFormatOption fileFormat) throws IOException {
final List<FileImageData> result = new ArrayList<FileImageData>();
final List<FileImageData> result = new ArrayList<>();
final int nbImages = system.getNbImages();
for (int i = 0; i < nbImages; i++) {
@ -187,7 +187,7 @@ public class PSystemUtils {
private static List<FileImageData> exportDiagramsSequence(SequenceDiagram system, SuggestedFile suggestedFile,
FileFormatOption fileFormat) throws IOException {
final List<FileImageData> result = new ArrayList<FileImageData>();
final List<FileImageData> result = new ArrayList<>();
final int nbImages = system.getNbImages();
for (int i = 0; i < nbImages; i++) {
@ -248,7 +248,7 @@ public class PSystemUtils {
system.getMetadata(), dpi, fileFormat.isWithMetadata(), system.getSkinParam().getSplitParam())
.getFiles();
}
final List<FileImageData> result2 = new ArrayList<FileImageData>();
final List<FileImageData> result2 = new ArrayList<>();
for (SFile f : result) {
result2.add(new FileImageData(f, cmap));
}
@ -283,7 +283,7 @@ public class PSystemUtils {
system.getMetadata(), system.getDpi(fileFormat), fileFormat.isWithMetadata(), splitParam)
.getFiles();
}
final List<FileImageData> result2 = new ArrayList<FileImageData>();
final List<FileImageData> result2 = new ArrayList<>();
for (SFile f : result) {
result2.add(new FileImageData(f, cmap));
}

View File

@ -48,7 +48,7 @@ public abstract class PlainStringsDiagram extends PlainDiagram {
protected BufferedImage image = null;
protected GraphicPosition imagePosition = null;
protected final List<String> strings = new ArrayList<String>();
protected final List<String> strings = new ArrayList<>();
@Override
public UDrawable getRootDrawable(FileFormatOption fileFormatOption) {

View File

@ -410,7 +410,7 @@ public class Run {
multithread(option, error);
return;
}
final List<File> files = new ArrayList<File>();
final List<File> files = new ArrayList<>();
for (String s : option.getResult()) {
if (option.isDecodeurl()) {
error.goOk();

View File

@ -254,7 +254,7 @@ public class SkinParam implements ISkinParam {
key = key.replaceAll("sequencearrow", "arrow");
key = key.replaceAll("align$", "alignment");
final Matcher2 mm = stereoPattern.matcher(key);
final List<String> result = new ArrayList<String>();
final List<String> result = new ArrayList<>();
while (mm.find()) {
final String s = mm.group(1);
result.add(key.replaceAll(stereoPatternString, "") + "<<" + s + ">>");
@ -357,8 +357,7 @@ public class SkinParam implements ISkinParam {
}
public char getCircledCharacter(Stereotype stereotype) {
Objects.requireNonNull(stereotype);
final String value2 = getValue("spotchar" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
final String value2 = getValue("spotchar" + Objects.requireNonNull(stereotype).getLabel(Guillemet.DOUBLE_COMPARATOR));
if (value2 != null && value2.length() > 0) {
return value2.charAt(0);
}
@ -517,7 +516,7 @@ public class SkinParam implements ISkinParam {
}
public static Collection<String> getPossibleValues() {
final Set<String> result = new TreeSet<String>();
final Set<String> result = new TreeSet<>();
result.add("Monochrome");
// result.add("BackgroundColor");
result.add("CircledCharacterRadius");
@ -760,8 +759,7 @@ public class SkinParam implements ISkinParam {
}
public boolean shadowing2(Stereotype stereotype, SkinParameter skinParameter) {
Objects.requireNonNull(skinParameter);
final String name = skinParameter.getUpperCaseName();
final String name = Objects.requireNonNull(skinParameter).getUpperCaseName();
if (stereotype != null) {
checkStereotype(stereotype);
final String value2 = getValue(name + "shadowing" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
@ -789,7 +787,7 @@ public class SkinParam implements ISkinParam {
private final Map<String, Sprite> sprites = new HashMap<String, Sprite>();
public Collection<String> getAllSpriteNames() {
return Collections.unmodifiableCollection(new TreeSet<String>(sprites.keySet()));
return Collections.unmodifiableCollection(new TreeSet<>(sprites.keySet()));
}
public void addSprite(String name, Sprite sprite) {

View File

@ -139,7 +139,7 @@ public abstract class SourceFileReaderAbstract {
Log.info("Reading file: " + file);
cpt = 0;
final List<GeneratedImage> result = new ArrayList<GeneratedImage>();
final List<GeneratedImage> result = new ArrayList<>();
for (BlockUml blockUml : builder.getBlockUmls()) {
final SuggestedFile suggested = getSuggestedFile(blockUml);

View File

@ -71,8 +71,7 @@ final public class StringLocated {
}
public StringLocated(String s, LineLocation location, String preprocessorError) {
Objects.requireNonNull(s);
this.s = s;
this.s = Objects.requireNonNull(s);
this.location = location;
this.preprocessorError = preprocessorError;
}

View File

@ -112,7 +112,7 @@ public class StringUtils {
if (m.find() == false) {
return null;
}
final List<String> result = new ArrayList<String>();
final List<String> result = new ArrayList<>();
for (int i = 1; i <= m.groupCount(); i++) {
result.add(m.group(i));
}
@ -425,7 +425,7 @@ public class StringUtils {
// == false) {
// throw new IllegalArgumentException();
// }
final List<String> result = new ArrayList<String>();
final List<String> result = new ArrayList<>();
final Pattern2 p = MyPattern.cmpile("([\\p{L}0-9_.]+|[%g][^%g]+[%g])");
final Matcher2 m = p.matcher(s);
while (m.find()) {
@ -439,7 +439,7 @@ public class StringUtils {
}
public static <O> List<O> merge(List<O> l1, List<O> l2) {
final List<O> result = new ArrayList<O>(l1);
final List<O> result = new ArrayList<>(l1);
result.addAll(l2);
return Collections.unmodifiableList(result);
}

View File

@ -37,8 +37,6 @@ package net.sourceforge.plantuml;
import java.io.IOException;
import javax.script.ScriptException;
import net.sourceforge.plantuml.anim.Animation;
import net.sourceforge.plantuml.anim.AnimationDecoder;
import net.sourceforge.plantuml.command.CommandExecutionResult;
@ -237,13 +235,12 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram,
}
final public void setAnimation(Iterable<CharSequence> animationData) {
try {
final AnimationDecoder animationDecoder = new AnimationDecoder(animationData);
this.animation = Animation.create(animationDecoder.decode());
} catch (ScriptException e) {
e.printStackTrace();
}
// try {
final AnimationDecoder animationDecoder = new AnimationDecoder(animationData);
this.animation = Animation.create(animationDecoder.decode());
// } catch (ScriptException e) {
// e.printStackTrace();
// }
}
final public Animation getAnimation() {

View File

@ -37,7 +37,7 @@ package net.sourceforge.plantuml;
public class UseStyle {
private static final ThreadLocal<Boolean> useBeta = new ThreadLocal<Boolean>();
private static final ThreadLocal<Boolean> useBeta = new ThreadLocal<>();
static public boolean useBetaStyle() {
final Boolean result = useBeta.get();

View File

@ -49,7 +49,7 @@ import net.sourceforge.plantuml.command.regex.Pattern2;
public class PSystemXearthFactory extends PSystemBasicFactory<PSystemXearth> {
private final Map<String, String> config = new LinkedHashMap<String, String>();
private final List<Marker> markers = new ArrayList<Marker>();
private final List<Marker> markers = new ArrayList<>();
private int width;
private int height;

View File

@ -37,6 +37,7 @@ package net.sourceforge.plantuml.activitydiagram;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.ISkinSimple;
@ -66,8 +67,7 @@ public class ActivityDiagram extends CucaDiagram {
}
public ILeaf getOrCreateLeaf(Ident ident, Code code, LeafType type, USymbol symbol) {
checkNotNull(ident);
return getOrCreateLeafDefault(ident, code, type, symbol);
return getOrCreateLeafDefault(Objects.requireNonNull(ident), code, type, symbol);
}
private String getAutoBranch() {
@ -134,15 +134,13 @@ public class ActivityDiagram extends CucaDiagram {
@Override
public ILeaf createLeaf(Ident idNewLong, Code code, Display display, LeafType type, USymbol symbol) {
checkNotNull(idNewLong);
final ILeaf result = super.createLeaf(idNewLong, code, display, type, symbol);
final ILeaf result = super.createLeaf(Objects.requireNonNull(idNewLong), code, display, type, symbol);
updateLasts(result);
return result;
}
public IEntity createNote(Ident idNewLong, Code code, Display display) {
checkNotNull(idNewLong);
return super.createLeaf(idNewLong, code, display, LeafType.NOTE, null);
return super.createLeaf(Objects.requireNonNull(idNewLong), code, display, LeafType.NOTE, null);
}
final protected List<String> getDotStrings() {

View File

@ -70,7 +70,7 @@ public class ActivityDiagramFactory extends PSystemCommandFactory {
@Override
protected List<Command> createCommands() {
final List<Command> cmds = new ArrayList<Command>();
final List<Command> cmds = new ArrayList<>();
cmds.add(new CommandFootboxIgnored());
addCommonCommands1(cmds);
cmds.add(new CommandRankDir());

View File

@ -99,7 +99,7 @@ public class ActivityDiagramFactory3 extends PSystemCommandFactory {
@Override
protected List<Command> createCommands() {
final List<Command> cmds = new ArrayList<Command>();
final List<Command> cmds = new ArrayList<>();
cmds.add(new CommandFootboxIgnored());
addCommonCommands1(cmds);

View File

@ -53,7 +53,7 @@ import net.sourceforge.plantuml.sequencediagram.NoteType;
public class InstructionFork extends WithNote implements Instruction {
private final List<InstructionList> forks = new ArrayList<InstructionList>();
private final List<InstructionList> forks = new ArrayList<>();
private final Instruction parent;
private final LinkRendering inlinkRendering;
private final ISkinParam skinParam;
@ -90,7 +90,7 @@ public class InstructionFork extends WithNote implements Instruction {
}
public Ftile createFtile(FtileFactory factory) {
final List<Ftile> all = new ArrayList<Ftile>();
final List<Ftile> all = new ArrayList<>();
for (InstructionList list : forks) {
all.add(list.createFtile(factory));
}
@ -130,7 +130,7 @@ public class InstructionFork extends WithNote implements Instruction {
}
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>(InstructionList.getSwimlanes2(forks));
final Set<Swimlane> result = new HashSet<>(InstructionList.getSwimlanes2(forks));
result.add(swimlaneIn);
result.add(swimlaneOut);
return result;

View File

@ -58,7 +58,7 @@ import net.sourceforge.plantuml.ugraphic.color.HColor;
public class InstructionIf extends WithNote implements Instruction, InstructionCollection {
private final List<Branch> thens = new ArrayList<Branch>();
private final List<Branch> thens = new ArrayList<>();
private Branch elseBranch;
private boolean endifCalled = false;
private final ISkinParam skinParam;
@ -113,7 +113,7 @@ public class InstructionIf extends WithNote implements Instruction, InstructionC
if (getPositionedNotes().size() > 0) {
result = FtileWithNoteOpale.create(result, getPositionedNotes(), skinParam, false);
}
final List<WeldingPoint> weldingPoints = new ArrayList<WeldingPoint>();
final List<WeldingPoint> weldingPoints = new ArrayList<>();
for (Branch branch : thens) {
weldingPoints.addAll(branch.getWeldingPoints());
}
@ -191,7 +191,7 @@ public class InstructionIf extends WithNote implements Instruction, InstructionC
}
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>();
final Set<Swimlane> result = new HashSet<>();
if (swimlane != null) {
result.add(swimlane);
}

View File

@ -54,7 +54,7 @@ import net.sourceforge.plantuml.sequencediagram.NoteType;
public class InstructionList extends WithNote implements Instruction, InstructionCollection {
private final List<Instruction> all = new ArrayList<Instruction>();
private final List<Instruction> all = new ArrayList<>();
private final Swimlane defaultSwimlane;
public boolean containsBreak() {
@ -96,7 +96,7 @@ public class InstructionList extends WithNote implements Instruction, Instructio
if (all.size() == 0) {
return new FtileEmpty(factory.skinParam(), defaultSwimlane);
}
final List<WeldingPoint> breaks = new ArrayList<WeldingPoint>();
final List<WeldingPoint> breaks = new ArrayList<>();
Ftile result = eventuallyAddNote(factory, null, getSwimlaneIn());
for (Instruction ins : all) {
Ftile cur = ins.createFtile(factory);
@ -169,7 +169,7 @@ public class InstructionList extends WithNote implements Instruction, Instructio
}
public static Set<Swimlane> getSwimlanes2(List<? extends Instruction> list) {
final Set<Swimlane> result = new HashSet<Swimlane>();
final Set<Swimlane> result = new HashSet<>();
for (Instruction ins : list) {
result.addAll(ins.getSwimlanes());
}

View File

@ -66,7 +66,7 @@ public class InstructionRepeat implements Instruction {
private LinkRendering incoming1 = LinkRendering.none();
private LinkRendering incoming2 = LinkRendering.none();
private List<PositionedNote> backwardNotes = new ArrayList<PositionedNote>();
private List<PositionedNote> backwardNotes = new ArrayList<>();
private Display test = Display.NULL;
private Display yes = Display.NULL;
private Display out = Display.NULL;

View File

@ -50,7 +50,7 @@ import net.sourceforge.plantuml.sequencediagram.NoteType;
public class InstructionSplit implements Instruction {
private final List<InstructionList> splits = new ArrayList<InstructionList>();
private final List<InstructionList> splits = new ArrayList<>();
private final Instruction parent;
private final LinkRendering inlinkRendering;
private final Swimlane swimlaneIn;
@ -82,7 +82,7 @@ public class InstructionSplit implements Instruction {
}
public Ftile createFtile(FtileFactory factory) {
final List<Ftile> all = new ArrayList<Ftile>();
final List<Ftile> all = new ArrayList<>();
for (InstructionList list : splits) {
all.add(list.createFtile(factory));
}

View File

@ -51,7 +51,7 @@ import net.sourceforge.plantuml.ugraphic.color.HColor;
public class InstructionSwitch extends WithNote implements Instruction, InstructionCollection {
private final List<Branch> branches = new ArrayList<Branch>();
private final List<Branch> branches = new ArrayList<>();
private final ISkinParam skinParam;
private final Instruction parent;
@ -94,7 +94,7 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
// result = FtileWithNoteOpale.create(result, getPositionedNotes(), skinParam,
// false);
// }
// final List<WeldingPoint> weldingPoints = new ArrayList<WeldingPoint>();
// final List<WeldingPoint> weldingPoints = new ArrayList<>();
// for (Branch branch : branches) {
// weldingPoints.addAll(branch.getWeldingPoints());
// }
@ -113,7 +113,7 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
}
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>();
final Set<Swimlane> result = new HashSet<>();
if (swimlane != null) {
result.add(swimlane);
}

View File

@ -49,7 +49,7 @@ import net.sourceforge.plantuml.sequencediagram.NoteType;
public class WithNote {
private final Collection<PositionedNote> notes = new ArrayList<PositionedNote>();
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));

View File

@ -77,8 +77,8 @@ public class CollisionDetector extends UGraphicNo implements UGraphic {
private final Context context;
static class Context {
private final List<MinMax> rectangles = new ArrayList<MinMax>();
private final List<Snake> snakes = new ArrayList<Snake>();
private final List<MinMax> rectangles = new ArrayList<>();
private final List<Snake> snakes = new ArrayList<>();
private boolean manageSnakes;
public void drawDebug(UGraphic ug) {

View File

@ -147,7 +147,7 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
}
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>();
final Set<Swimlane> result = new HashSet<>();
result.addAll(tile1.getSwimlanes());
result.addAll(tile2.getSwimlanes());
return Collections.unmodifiableSet(result);
@ -162,7 +162,7 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
}
public List<WeldingPoint> getWeldingPoints() {
final List<WeldingPoint> result = new ArrayList<WeldingPoint>(tile1.getWeldingPoints());
final List<WeldingPoint> result = new ArrayList<>(tile1.getWeldingPoints());
result.addAll(tile2.getWeldingPoints());
return Collections.unmodifiableList(result);
}

View File

@ -47,7 +47,7 @@ public class FtileDecorateWelding extends FtileDecorate {
public FtileDecorateWelding(final Ftile ftile, final List<WeldingPoint> breaks) {
super(ftile);
this.breaks = new ArrayList<WeldingPoint>(breaks);
this.breaks = new ArrayList<>(breaks);
}
@Override

View File

@ -103,7 +103,7 @@ public class FtileEmpty extends AbstractFtile {
}
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>();
final Set<Swimlane> result = new HashSet<>();
if (swimlaneIn != null) {
result.add(swimlaneIn);
}

View File

@ -47,7 +47,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
class FtileWithConnection extends FtileDecorate {
private final List<Connection> connections = new ArrayList<Connection>();
private final List<Connection> connections = new ArrayList<>();
FtileWithConnection(Ftile ftile, Collection<Connection> connections) {
super(ftile);
@ -74,7 +74,7 @@ class FtileWithConnection extends FtileDecorate {
}
public Collection<Connection> getInnerConnections() {
final List<Connection> result = new ArrayList<Connection>(super.getInnerConnections());
final List<Connection> result = new ArrayList<>(super.getInnerConnections());
result.addAll(connections);
return Collections.unmodifiableList(connections);
}

View File

@ -205,7 +205,7 @@ public class Snake implements UShape {
final double move = 2 + colorArrowSeparationSpace;
final WormMutation mutation = WormMutation.create(worm, move);
if (mutation.isDxNegative()) {
colors = new ArrayList<HtmlColorAndStyle>(colors);
colors = new ArrayList<>(colors);
Collections.reverse(colors);
}
final double globalMove = -1.0 * (colors.size() - 1) / 2.0;
@ -270,7 +270,7 @@ public class Snake implements UShape {
}
public List<Line2D> getHorizontalLines() {
final List<Line2D> result = new ArrayList<Line2D>();
final List<Line2D> result = new ArrayList<>();
for (int i = 0; i < worm.size() - 1; i++) {
final Point2D pt1 = worm.get(i);
final Point2D pt2 = worm.get(i + 1);

View File

@ -93,9 +93,9 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
private final ISkinParam skinParam;;
private final Pragma pragma;
private final List<Swimlane> swimlanesRaw = new ArrayList<Swimlane>();
private final List<Swimlane> swimlanesSpecial = new ArrayList<Swimlane>();
private final List<LaneDivider> dividers = new ArrayList<LaneDivider>();
private final List<Swimlane> swimlanesRaw = new ArrayList<>();
private final List<Swimlane> swimlanesSpecial = new ArrayList<>();
private final List<LaneDivider> dividers = new ArrayList<>();
private Swimlane currentSwimlane = null;
private final Instruction root = new InstructionList();

View File

@ -43,7 +43,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
public class WormMutation {
private final List<UTranslate> translations = new ArrayList<UTranslate>();
private final List<UTranslate> translations = new ArrayList<>();
private WormMutation() {

View File

@ -44,7 +44,7 @@ import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class Zad {
private final List<MinMax> rectangles = new ArrayList<MinMax>();
private final List<MinMax> rectangles = new ArrayList<>();
public void add(MinMax rect) {
// System.err.println("add " + rect);

View File

@ -65,7 +65,7 @@ public abstract class AbstractParallelFtilesBuilder {
private final ISkinParam skinParam;
private final StringBounder stringBounder;
protected final List<Ftile> list99 = new ArrayList<Ftile>();
protected final List<Ftile> list99 = new ArrayList<>();
public StyleSignature getDefaultStyleDefinition() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity);
@ -83,7 +83,7 @@ public abstract class AbstractParallelFtilesBuilder {
protected List<Ftile> getFoo2(List<Ftile> all) {
final double maxHeight = computeMaxHeight(all);
final List<Ftile> result = new ArrayList<Ftile>();
final List<Ftile> result = new ArrayList<>();
for (Ftile ftile : all) {
final Ftile newFtile = computeNewFtile(ftile, maxHeight);
result.add(newFtile);

View File

@ -75,7 +75,7 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator {
}
private Ftile createNude(Swimlane swimlane, List<Branch> branches) {
final List<Ftile> ftiles = new ArrayList<Ftile>();
final List<Ftile> ftiles = new ArrayList<>();
for (Branch branch : branches) {
ftiles.add(new FtileMinWidthCentered(branch.getFtile(), 30));
}
@ -83,7 +83,7 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator {
}
private Ftile createWithDiamonds(Swimlane swimlane, List<Branch> branches, Display labelTest) {
final List<Ftile> ftiles = new ArrayList<Ftile>();
final List<Ftile> ftiles = new ArrayList<>();
for (Branch branch : branches) {
ftiles.add(new FtileMinWidthCentered(branch.getFtile(), 30));
}
@ -94,7 +94,7 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator {
}
private Ftile createWithLinks(Swimlane swimlane, List<Branch> branches, Display labelTest) {
final List<Ftile> ftiles = new ArrayList<Ftile>();
final List<Ftile> ftiles = new ArrayList<>();
final Ftile diamond1 = getDiamond1(swimlane, branches.get(0), labelTest);
final Ftile diamond2 = getDiamond2(swimlane, branches.get(0));
for (Branch branch : branches) {
@ -104,7 +104,7 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator {
if (ftiles.size() == 1) {
final FtileSwitchWithOneLink result = new FtileSwitchWithOneLink(ftiles, branches, swimlane, diamond1,
diamond2, getStringBounder(), arrowColor);
return result.addLinks();
return result.addLinks(getStringBounder());
}
final FtileSwitchWithManyLinks result = new FtileSwitchWithManyLinks(ftiles, branches, swimlane, diamond1,
diamond2, getStringBounder(), arrowColor);
@ -114,23 +114,27 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator {
private Ftile getDiamond1(Swimlane swimlane, Branch branch0, Display test) {
final HColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
final HColor backColor = branch0.getColor() == null ? getRose().getHtmlColor(skinParam(),
ColorParam.activityDiamondBackground) : branch0.getColor();
final HColor backColor = branch0.getColor() == null
? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground)
: branch0.getColor();
final FontConfiguration fcDiamond = new FontConfiguration(skinParam(), FontParam.ACTIVITY_DIAMOND, null);
final TextBlock tbTest = (Display.isNull(test) || test.isWhite()) ? TextBlockUtils.empty(0, 0) : test.create(
fcDiamond, branch0.skinParam().getDefaultTextAlignment(HorizontalAlignment.LEFT), branch0.skinParam());
final TextBlock tbTest = (Display.isNull(test) || test.isWhite()) ? TextBlockUtils.empty(0, 0)
: test.create(fcDiamond, branch0.skinParam().getDefaultTextAlignment(HorizontalAlignment.LEFT),
branch0.skinParam());
return new FtileDiamondInside(branch0.skinParam(), backColor, borderColor, swimlane, tbTest);
}
private Ftile getDiamond2(Swimlane swimlane, Branch branch0) {
final HColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
final HColor backColor = branch0.getColor() == null ? getRose().getHtmlColor(skinParam(),
ColorParam.activityDiamondBackground) : branch0.getColor();
final HColor backColor = branch0.getColor() == null
? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground)
: branch0.getColor();
return new FtileDiamondInside(branch0.skinParam(), backColor, borderColor, swimlane, TextBlockUtils.empty(0, 0));
return new FtileDiamondInside(branch0.skinParam(), backColor, borderColor, swimlane,
TextBlockUtils.empty(0, 0));
}
private HColor fontColor(FontParam param) {

View File

@ -54,7 +54,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
class FtileForkInner extends AbstractFtile {
private final List<Ftile> forks = new ArrayList<Ftile>();
private final List<Ftile> forks = new ArrayList<>();
public FtileForkInner(List<Ftile> forks) {
super(forks.get(0).skinParam());
@ -82,7 +82,7 @@ class FtileForkInner extends AbstractFtile {
}
public static Set<Swimlane> mergeSwimlanes(List<Ftile> tiles) {
final Set<Swimlane> result = new HashSet<Swimlane>();
final Set<Swimlane> result = new HashSet<>();
for (Ftile tile : tiles) {
result.addAll(tile.getSwimlanes());
}

View File

@ -53,7 +53,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
class FtileForkInnerOverlapped extends AbstractFtile {
private final List<Ftile> forks = new ArrayList<Ftile>();
private final List<Ftile> forks = new ArrayList<>();
public FtileForkInnerOverlapped(List<Ftile> forks) {
super(forks.get(0).skinParam());
@ -75,7 +75,7 @@ class FtileForkInnerOverlapped extends AbstractFtile {
}
public static Set<Swimlane> mergeSwimlanes(List<Ftile> tiles) {
final Set<Swimlane> result = new HashSet<Swimlane>();
final Set<Swimlane> result = new HashSet<>();
for (Ftile tile : tiles) {
result.addAll(tile.getSwimlanes());
}

View File

@ -95,7 +95,7 @@ class FtileIfAndStop extends AbstractFtile {
}
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>();
final Set<Swimlane> result = new HashSet<>();
if (getSwimlaneIn() != null) {
result.add(getSwimlaneIn());
}
@ -160,7 +160,7 @@ class FtileIfAndStop extends AbstractFtile {
// }
final FtileIfAndStop result = new FtileIfAndStop(diamond1, tileNonStop, arrowColor, stopFtile);
final List<Connection> conns = new ArrayList<Connection>();
final List<Connection> conns = new ArrayList<>();
conns.add(result.new ConnectionHorizontal(arrowColor));
// conns.add(result.new ConnectionHorizontalThenVertical(tile2));
// if (tile1.calculateDimension(stringBounder).hasPointOut()

View File

@ -85,7 +85,7 @@ public class FtileIfDown extends AbstractFtile {
}
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>(thenBlock.getSwimlanes());
final Set<Swimlane> result = new HashSet<>(thenBlock.getSwimlanes());
result.add(getSwimlaneIn());
return result;
}
@ -119,7 +119,7 @@ public class FtileIfDown extends AbstractFtile {
optionalStop == null ? diamond2 : new FtileEmpty(ftileFactory.skinParam()), optionalStop,
conditionEndStyle);
final List<Connection> conns = new ArrayList<Connection>();
final List<Connection> conns = new ArrayList<>();
conns.add(result.new ConnectionIn(thenBlock.getInLinkRendering().getRainbow(arrowColor)));
final boolean hasPointOut1 = thenBlock.calculateDimension(ftileFactory.getStringBounder()).hasPointOut();
if (optionalStop == null) {

View File

@ -81,7 +81,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
private final List<Ftile> tiles;
private final Ftile tile2;
private final List<Ftile> diamonds;
private final List<Ftile> couples = new ArrayList<Ftile>();
private final List<Ftile> couples = new ArrayList<>();
private final Rainbow arrowColor;
@ -97,8 +97,8 @@ class FtileIfLongHorizontal extends AbstractFtile {
couples.add(FtileUtils.addHorizontalMargin(tmp, inlabelSizes.get(i), 0));
}
this.tile2 = tile2;
this.diamonds = new ArrayList<Ftile>(diamonds);
this.tiles = new ArrayList<Ftile>(tiles);
this.diamonds = new ArrayList<>(diamonds);
this.tiles = new ArrayList<>(tiles);
this.arrowColor = arrowColor;
@ -109,7 +109,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
for (Ftile diamond : diamonds) {
maxOutY = Math.max(maxOutY, diamond.calculateDimension(stringBounder).getOutY());
}
final List<Ftile> result = new ArrayList<Ftile>();
final List<Ftile> result = new ArrayList<>();
for (int i = 0; i < diamonds.size(); i++) {
Ftile diamond = diamonds.get(i);
final double missing = maxOutY - diamond.calculateDimension(stringBounder).getOutY();
@ -121,7 +121,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
}
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>();
final Set<Swimlane> result = new HashSet<>();
if (getSwimlaneIn() != null) {
result.add(getSwimlaneIn());
}
@ -145,7 +145,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
FontConfiguration fcArrow, LinkRendering topInlinkRendering, LinkRendering afterEndwhile,
FontConfiguration fcTest) {
Objects.requireNonNull(afterEndwhile);
final List<Ftile> tiles = new ArrayList<Ftile>();
final List<Ftile> tiles = new ArrayList<>();
for (Branch branch : thens) {
tiles.add(new FtileMinWidthCentered(branch.getFtile(), 30));
@ -153,8 +153,8 @@ class FtileIfLongHorizontal extends AbstractFtile {
final Ftile tile2 = new FtileMinWidthCentered(branch2.getFtile(), 30);
List<Ftile> diamonds = new ArrayList<Ftile>();
List<Double> inlabelSizes = new ArrayList<Double>();
List<Ftile> diamonds = new ArrayList<>();
List<Double> inlabelSizes = new ArrayList<>();
for (Branch branch : thens) {
final TextBlock tb1 = branch.getLabelPositive().create(fcArrow, HorizontalAlignment.LEFT,
ftileFactory.skinParam());
@ -186,7 +186,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
final FtileIfLongHorizontal result = new FtileIfLongHorizontal(diamonds, inlabelSizes, tiles, tile2,
arrowColor);
final List<Connection> conns = new ArrayList<Connection>();
final List<Connection> conns = new ArrayList<>();
int nbOut = 0;
@ -470,7 +470,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D totalDim = calculateDimensionInternal(stringBounder);
final List<Ftile> allTiles = new ArrayList<Ftile>(couples);
final List<Ftile> allTiles = new ArrayList<>(couples);
allTiles.add(tile2);
final double[] minmax;
@ -589,7 +589,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
@Override
public Collection<Ftile> getMyChildren() {
final List<Ftile> result = new ArrayList<Ftile>(tiles);
final List<Ftile> result = new ArrayList<>(tiles);
result.add(tile2);
return Collections.unmodifiableList(result);
}
@ -689,7 +689,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final List<Ftile> all = new ArrayList<Ftile>(tiles);
final List<Ftile> all = new ArrayList<>(tiles);
all.add(tile2);
for (Ftile tmp : all) {
if (tmp.calculateDimension(stringBounder).hasPointOut()) {

View File

@ -85,7 +85,7 @@ class FtileIfLongVertical extends AbstractFtile {
@Override
public Collection<Ftile> getMyChildren() {
final List<Ftile> result = new ArrayList<Ftile>(tiles);
final List<Ftile> result = new ArrayList<>(tiles);
result.add(tile2);
return Collections.unmodifiableList(result);
}
@ -98,15 +98,15 @@ class FtileIfLongVertical extends AbstractFtile {
}
this.lastDiamond = lastDiamond;
this.tile2 = tile2;
this.diamonds = new ArrayList<Ftile>(diamonds);
this.tiles = new ArrayList<Ftile>(tiles);
this.diamonds = new ArrayList<>(diamonds);
this.tiles = new ArrayList<>(tiles);
this.arrowColor = arrowColor;
}
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>();
final Set<Swimlane> result = new HashSet<>();
if (getSwimlaneIn() != null) {
result.add(getSwimlaneIn());
}
@ -128,7 +128,7 @@ class FtileIfLongVertical extends AbstractFtile {
static Ftile create(Swimlane swimlane, HColor borderColor, HColor backColor, Rainbow arrowColor,
FtileFactory ftileFactory, ConditionStyle conditionStyle, List<Branch> thens, Branch branch2,
FontConfiguration fc, LinkRendering topInlinkRendering, LinkRendering afterEndwhile) {
final List<Ftile> tiles = new ArrayList<Ftile>();
final List<Ftile> tiles = new ArrayList<>();
for (Branch branch : thens) {
tiles.add(new FtileMinWidthCentered(branch.getFtile(), 30));
@ -136,7 +136,7 @@ class FtileIfLongVertical extends AbstractFtile {
final Ftile tile2 = new FtileMinWidthCentered(branch2.getFtile(), 30);
List<Ftile> diamonds = new ArrayList<Ftile>();
List<Ftile> diamonds = new ArrayList<>();
for (Branch branch : thens) {
final TextBlock tb1 = branch.getLabelPositive().create(fc, HorizontalAlignment.LEFT,
ftileFactory.skinParam());
@ -159,7 +159,7 @@ class FtileIfLongVertical extends AbstractFtile {
final FtileIfLongVertical result = new FtileIfLongVertical(diamonds, tiles, tile2, arrowColor, lastDiamond);
final List<Connection> conns = new ArrayList<Connection>();
final List<Connection> conns = new ArrayList<>();
for (int i = 0; i < thens.size(); i++) {
final Ftile ftile = tiles.get(i);
final Ftile diam = diamonds.get(i);
@ -518,7 +518,7 @@ class FtileIfLongVertical extends AbstractFtile {
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final List<Ftile> all = new ArrayList<Ftile>(tiles);
final List<Ftile> all = new ArrayList<>(tiles);
all.add(tile2);
for (Ftile tmp : all) {
if (tmp.calculateDimension(stringBounder).hasPointOut()) {

View File

@ -109,7 +109,7 @@ class FtileRepeat extends AbstractFtile {
}
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>(repeat.getSwimlanes());
final Set<Swimlane> result = new HashSet<>(repeat.getSwimlanes());
result.addAll(diamond1.getSwimlanes());
result.addAll(diamond2.getSwimlanes());
return Collections.unmodifiableSet(result);
@ -158,7 +158,7 @@ class FtileRepeat extends AbstractFtile {
throw new IllegalStateException();
}
final List<Connection> conns = new ArrayList<Connection>();
final List<Connection> conns = new ArrayList<>();
final Display in1 = repeat.getInLinkRendering().getDisplay();
final TextBlock tbin1 = in1 == null ? null
: in1.create7(fcArrow, HorizontalAlignment.LEFT, spriteContainer, CreoleMode.SIMPLE_LINE);

View File

@ -53,7 +53,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
class FtileSplit1 extends AbstractFtile {
private final List<Ftile> forks = new ArrayList<Ftile>();
private final List<Ftile> forks = new ArrayList<>();
public FtileSplit1(List<Ftile> forks) {
super(forks.get(0).skinParam());
@ -76,7 +76,7 @@ class FtileSplit1 extends AbstractFtile {
}
public static Set<Swimlane> mergeSwimlanes(List<Ftile> tiles) {
final Set<Swimlane> result = new HashSet<Swimlane>();
final Set<Swimlane> result = new HashSet<>();
for (Ftile tile : tiles) {
result.addAll(tile.getSwimlanes());
}

View File

@ -75,13 +75,13 @@ class FtileSwitch extends AbstractFtile {
private FtileSwitch(List<Double> inlabelSizes, List<Ftile> tiles, Rainbow arrowColor) {
super(tiles.get(0).skinParam());
this.tiles = new ArrayList<Ftile>(tiles);
this.tiles = new ArrayList<>(tiles);
this.arrowColor = arrowColor;
}
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>();
final Set<Swimlane> result = new HashSet<>();
if (getSwimlaneIn() != null) {
result.add(getSwimlaneIn());
}
@ -100,13 +100,13 @@ class FtileSwitch extends AbstractFtile {
FtileFactory ftileFactory, ConditionStyle conditionStyle, List<Branch> thens, FontConfiguration fcArrow,
LinkRendering topInlinkRendering, LinkRendering afterEndwhile, FontConfiguration fcTest) {
Objects.requireNonNull(afterEndwhile);
final List<Ftile> tiles = new ArrayList<Ftile>();
final List<Ftile> tiles = new ArrayList<>();
for (Branch branch : thens) {
tiles.add(new FtileMinWidthCentered(branch.getFtile(), 30));
}
List<Double> inlabelSizes = new ArrayList<Double>();
List<Double> inlabelSizes = new ArrayList<>();
for (Branch branch : thens) {
final TextBlock tb1 = branch.getLabelPositive().create(fcArrow, HorizontalAlignment.LEFT,
ftileFactory.skinParam());
@ -134,7 +134,7 @@ class FtileSwitch extends AbstractFtile {
@Override
public Collection<Ftile> getMyChildren() {
final List<Ftile> result = new ArrayList<Ftile>(tiles);
final List<Ftile> result = new ArrayList<>(tiles);
return Collections.unmodifiableList(result);
}
@ -179,7 +179,7 @@ class FtileSwitch extends AbstractFtile {
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final List<Ftile> all = new ArrayList<Ftile>(tiles);
final List<Ftile> all = new ArrayList<>(tiles);
for (Ftile tmp : all) {
if (tmp.calculateDimension(stringBounder).hasPointOut()) {
return new FtileGeometry(dimTotal, dimTotal.getWidth() / 2, 0, dimTotal.getHeight());

View File

@ -92,7 +92,7 @@ class FtileWhile extends AbstractFtile {
}
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>(whileBlock.getSwimlanes());
final Set<Swimlane> result = new HashSet<>(whileBlock.getSwimlanes());
result.add(getSwimlaneIn());
return result;
}
@ -146,7 +146,7 @@ class FtileWhile extends AbstractFtile {
final TextBlock back1 = incoming1.getDisplay().create(fontArrow, HorizontalAlignment.LEFT,
ftileFactory.skinParam());
final List<Connection> conns = new ArrayList<Connection>();
final List<Connection> conns = new ArrayList<>();
if (dim.getWidth() == 0 || dim.getHeight() == 0) {
conns.add(result.new ConnectionBackEmpty(incoming1.getRainbow()));
} else {

View File

@ -95,7 +95,7 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
public Set<Swimlane> getSwimlanes() {
if (swimlaneNote != null) {
final Set<Swimlane> result = new HashSet<Swimlane>(tile.getSwimlanes());
final Set<Swimlane> result = new HashSet<>(tile.getSwimlanes());
result.add(swimlaneNote);
return Collections.unmodifiableSet(result);
}

View File

@ -82,7 +82,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
final double maxHeight = computeMaxHeight(all);
final double ymargin1 = getSuppSpace1(all, getStringBounder());
final double ymargin2 = getSuppSpace2(all, getStringBounder());
final List<Ftile> result = new ArrayList<Ftile>();
final List<Ftile> result = new ArrayList<>();
for (Ftile ftile : all) {
final Ftile newFtile = computeNewFtile(ftile, maxHeight, ymargin1, ymargin2);
result.add(newFtile);
@ -128,7 +128,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
@Override
protected Ftile doStep1(Ftile middle) {
Ftile result = middle;
final List<Connection> conns = new ArrayList<Connection>();
final List<Connection> conns = new ArrayList<>();
final Swimlane swimlaneBlack = in;
final Ftile black = new FtileBlackBlock(skinParam(),
getRose().getHtmlColor(skinParam(), ColorParam.activityBar), swimlaneBlack);
@ -196,7 +196,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
((FtileBlackBlock) out).setLabel(getTextBlock(Display.getWithNewlines(label)));
}
result = new FtileAssemblySimple(result, out);
final List<Connection> conns = new ArrayList<Connection>();
final List<Connection> conns = new ArrayList<>();
double x = 0;
for (Ftile tmp : list99) {
final Dimension2D dim = tmp.calculateDimension(getStringBounder());

View File

@ -72,7 +72,7 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
@Override
protected Ftile doStep1(Ftile inner) {
Ftile result = inner;
final List<Connection> conns = new ArrayList<Connection>();
final List<Connection> conns = new ArrayList<>();
final HColor colorBar = getRose().getHtmlColor(skinParam(), ColorParam.activityBar);
final Ftile black = new FtileBlackBlock(skinParam(), colorBar, list99.get(0).getSwimlaneIn());
@ -104,7 +104,7 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
final HColor backColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground);
final Ftile out = new FtileDiamond(skinParam(), backColor, borderColor, swimlaneOutForStep2());
result = new FtileAssemblySimple(result, out);
final List<Connection> conns = new ArrayList<Connection>();
final List<Connection> conns = new ArrayList<>();
final UTranslate diamondTranslate = result.getTranslateFor(out, getStringBounder());
int i = 0;
double x = 0;

View File

@ -77,7 +77,7 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
@Override
protected Ftile doStep1(Ftile inner) {
Ftile result = inner;
final List<Connection> conns = new ArrayList<Connection>();
final List<Connection> conns = new ArrayList<>();
final Rainbow thinColor;
if (UseStyle.useBetaStyle()) {
Style style = getDefaultStyleDefinition().getMergedStyle(skinParam().getCurrentStyleBuilder());
@ -171,7 +171,7 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
final Ftile out = new FtileThinSplit(skinParam(), thinColor.getColor(), swimlaneOutForStep2());
result = new FtileAssemblySimple(result, out);
final List<Connection> conns = new ArrayList<Connection>();
final List<Connection> conns = new ArrayList<>();
double x = 0;
double first = 0;
double last = 0;

View File

@ -181,7 +181,7 @@ public class VCompactFactory implements FtileFactory {
public Ftile createIf(Swimlane swimlane, List<Branch> thens, Branch elseBranch, LinkRendering afterEndwhile,
LinkRendering topInlinkRendering, Url url) {
final List<Ftile> ftiles = new ArrayList<Ftile>();
final List<Ftile> ftiles = new ArrayList<>();
for (Branch branch : thens) {
ftiles.add(branch.getFtile());
}
@ -191,7 +191,7 @@ public class VCompactFactory implements FtileFactory {
public Ftile createSwitch(Swimlane swimlane, List<Branch> branches, LinkRendering afterEndwhile,
LinkRendering topInlinkRendering, Display labelTest) {
final List<Ftile> ftiles = new ArrayList<Ftile>();
final List<Ftile> ftiles = new ArrayList<>();
for (Branch branch : branches) {
ftiles.add(branch.getFtile());
}

View File

@ -74,7 +74,7 @@ public class FtileIfNude extends FtileDimensionMemoize {
}
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>();
final Set<Swimlane> result = new HashSet<>();
if (getSwimlaneIn() != null) {
result.add(getSwimlaneIn());
}

View File

@ -421,7 +421,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D totalDim = calculateDimensionInternal(stringBounder);
final List<Ftile> allTiles = new ArrayList<Ftile>();
final List<Ftile> allTiles = new ArrayList<>();
allTiles.add(tile1);
allTiles.add(tile2);
@ -533,7 +533,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
}
public Ftile addLinks(Branch branch1, Branch branch2, StringBounder stringBounder) {
final List<Connection> conns = new ArrayList<Connection>();
final List<Connection> conns = new ArrayList<>();
conns.add(new ConnectionHorizontalThenVertical(tile1, branch1));
conns.add(new ConnectionHorizontalThenVertical(tile2, branch2));
final boolean hasPointOut1 = tile1.calculateDimension(stringBounder).hasPointOut();

View File

@ -69,7 +69,7 @@ public class FtileSwitchNude extends FtileDimensionMemoize {
}
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<Swimlane>();
final Set<Swimlane> result = new HashSet<>();
if (getSwimlaneIn() != null) {
result.add(getSwimlaneIn());
}
@ -115,7 +115,7 @@ public class FtileSwitchNude extends FtileDimensionMemoize {
}
@Override
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
final FtileGeometry dimTotal = calculateDimensionInternal(stringBounder);
for (Ftile tile : tiles)
if (tile.calculateDimension(stringBounder).hasPointOut()) {

View File

@ -96,7 +96,7 @@ public class FtileSwitchWithDiamonds extends FtileSwitchNude {
@Override
public Collection<Ftile> getMyChildren() {
final Collection<Ftile> result = new ArrayList<Ftile>(super.getMyChildren());
final Collection<Ftile> result = new ArrayList<>(super.getMyChildren());
result.add(diamond1);
result.add(diamond2);
return Collections.unmodifiableCollection(result);
@ -111,7 +111,7 @@ public class FtileSwitchWithDiamonds extends FtileSwitchNude {
}
@Override
protected FtileGeometry calculateDimensionInternalSlow(StringBounder stringBounder) {
final protected FtileGeometry calculateDimensionInternalSlow(StringBounder stringBounder) {
final FtileGeometry dim1 = diamond1.calculateDimension(stringBounder);
final FtileGeometry dim2 = diamond2.calculateDimension(stringBounder);
@ -145,7 +145,10 @@ public class FtileSwitchWithDiamonds extends FtileSwitchNude {
} else {
super.drawU(ug.apply(getTranslateMain(stringBounder)));
}
ug.apply(getTranslateDiamond2(stringBounder)).draw(diamond2);
if (calculateDimension(stringBounder).hasPointOut()) {
ug.apply(getTranslateDiamond2(stringBounder)).draw(diamond2);
}
}
protected UTranslate getTranslateOf(Ftile tile, StringBounder stringBounder) {
@ -194,7 +197,8 @@ public class FtileSwitchWithDiamonds extends FtileSwitchNude {
protected TextBlock getLabelPositive(Branch branch) {
final FontConfiguration fcArrow = new FontConfiguration(skinParam(), FontParam.ARROW, null);
return branch.getLabelPositive().create7(fcArrow, HorizontalAlignment.LEFT, skinParam(), CreoleMode.SIMPLE_LINE);
return branch.getLabelPositive().create7(fcArrow, HorizontalAlignment.LEFT, skinParam(),
CreoleMode.SIMPLE_LINE);
}
}

View File

@ -275,7 +275,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
}
public Ftile addLinks() {
final List<Connection> conns = new ArrayList<Connection>();
final List<Connection> conns = new ArrayList<>();
conns.add(new ConnectionHorizontalThenVertical(tiles.get(0), branches.get(0)));
conns.add(new ConnectionHorizontalThenVertical(tiles.get(tiles.size() - 1), branches.get(tiles.size() - 1)));
conns.add(new ConnectionVerticalThenHorizontal(tiles.get(0)));

View File

@ -80,8 +80,8 @@ public class FtileSwitchWithOneLink extends FtileSwitchWithDiamonds {
final double x2 = p2.getX();
final double y2 = p2.getY();
final Snake snake = Snake.create(null, arrowColor, Arrows.asToDown())
.withLabel(getLabelPositive(branch), arrowHorizontalAlignment());
final Snake snake = Snake.create(null, arrowColor, Arrows.asToDown()).withLabel(getLabelPositive(branch),
arrowHorizontalAlignment());
// snake.addPoint(x1, y1);
snake.addPoint(x2, y1);
snake.addPoint(x2, y2);
@ -134,10 +134,14 @@ public class FtileSwitchWithOneLink extends FtileSwitchWithDiamonds {
}
}
public Ftile addLinks() {
final List<Connection> conns = new ArrayList<Connection>();
conns.add(new ConnectionVerticalTop(tiles.get(0), branches.get(0)));
conns.add(new ConnectionVerticalBottom(tiles.get(0)));
public Ftile addLinks(StringBounder stringBounder) {
final List<Connection> conns = new ArrayList<>();
final Ftile single = tiles.get(0);
conns.add(new ConnectionVerticalTop(single, branches.get(0)));
if (single.calculateDimension(stringBounder).hasPointOut()) {
conns.add(new ConnectionVerticalBottom(single));
}
return FtileUtils.addConnection(this, conns);
}

View File

@ -62,7 +62,7 @@ public class Animation {
}
public static Animation create(List<String> descriptions) {
final List<AffineTransformation> all = new ArrayList<AffineTransformation>();
final List<AffineTransformation> all = new ArrayList<>();
for (String s : descriptions) {
final AffineTransformation tmp = AffineTransformation.create(s);
if (tmp != null) {

View File

@ -41,14 +41,12 @@ import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
import javax.script.ScriptException;
public class AnimationDecoder {
private final List<String> result = new ArrayList<String>();
private final List<String> result = new ArrayList<>();
public AnimationDecoder(Iterable<CharSequence> data) {
public AnimationDecoder(Iterable<CharSequence> data) throws ScriptException {
for (final Iterator<CharSequence> it = data.iterator(); it.hasNext();) {
String line = it.next().toString();
if (line.matches("^\\s*\\[script\\]\\s*$")) {

View File

@ -35,22 +35,14 @@
*/
package net.sourceforge.plantuml.anim;
import java.io.PrintWriter;
import java.io.StringWriter;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class AnimationScript {
private final ScriptEngine engine;
// private final ScriptEngine engine;
public AnimationScript() {
final ScriptEngineManager manager = new ScriptEngineManager();
engine = manager.getEngineByName("js");
// final ScriptEngineManager manager = new ScriptEngineManager();
// engine = manager.getEngineByName("js");
// ScriptEngineManager manager = new ScriptEngineManager();
// List<ScriptEngineFactory> factories = manager.getEngineFactories();
@ -67,12 +59,13 @@ public class AnimationScript {
}
public String eval(String line) throws ScriptException {
final ScriptContext context = engine.getContext();
final StringWriter sw = new StringWriter();
context.setWriter(new PrintWriter(sw));
engine.eval(line, context);
final String result = sw.toString();
return result;
public String eval(String line) {
throw new UnsupportedOperationException();
// final ScriptContext context = engine.getContext();
// final StringWriter sw = new StringWriter();
// context.setWriter(new PrintWriter(sw));
// engine.eval(line, context);
// final String result = sw.toString();
// return result;
}
}

View File

@ -55,8 +55,8 @@ import net.sourceforge.plantuml.security.SecurityUtils;
public class CheckZipTask extends Task {
private String zipfile = null;
private List<FileSet> filesets = new ArrayList<FileSet>();
private List<FileList> filelists = new ArrayList<FileList>();
private List<FileSet> filesets = new ArrayList<>();
private List<FileList> filelists = new ArrayList<>();
/**
* Add a set of files to touch
@ -107,7 +107,7 @@ public class CheckZipTask extends Task {
return entries.contains(s);
}
private final List<String> entries = new ArrayList<String>();
private final List<String> entries = new ArrayList<>();
private void loadZipFile(SFile file) throws IOException {

View File

@ -79,8 +79,8 @@ public class PlantUmlTask extends Task {
private String dir = null;
private final Option option = new Option();
private List<FileSet> filesets = new ArrayList<FileSet>();
private List<FileList> filelists = new ArrayList<FileList>();
private List<FileSet> filesets = new ArrayList<>();
private List<FileList> filelists = new ArrayList<>();
private AtomicInteger nbFiles = new AtomicInteger(0);
private ExecutorService executorService;

View File

@ -156,7 +156,7 @@ public class BasicCharAreaImpl implements BasicCharArea {
}
public List<String> getLines() {
final List<String> result = new ArrayList<String>(height);
final List<String> result = new ArrayList<>(height);
for (int y = 0; y < height; y++) {
result.add(getLine(y));
}

View File

@ -45,7 +45,7 @@ public class BNode {
private final int stage;
private int x = -1;
private BNode parent;
private final List<BNode> children = new ArrayList<BNode>();
private final List<BNode> children = new ArrayList<>();
public BNode(int stage, String name) {
this.name = name;

View File

@ -62,7 +62,7 @@ import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class BoardDiagram extends UmlDiagram {
private final List<Activity> activities = new ArrayList<Activity>();
private final List<Activity> activities = new ArrayList<>();
public DiagramDescription getDescription() {
return new DiagramDescription("Board");

View File

@ -51,7 +51,7 @@ public class BoardDiagramFactory extends PSystemCommandFactory {
@Override
protected List<Command> createCommands() {
final List<Command> cmds = new ArrayList<Command>();
final List<Command> cmds = new ArrayList<>();
addCommonCommands1(cmds);
cmds.add(new CommandBoardPlus());
// cmds.add(new CommandMindMapTabulation());

View File

@ -66,8 +66,8 @@ public class BpmDiagram extends UmlDiagram {
private final BpmElement start = new BpmElement(null, BpmElementType.START);
private List<BpmEvent> events = new ArrayList<BpmEvent>();
private Deque<BpmBranch> branches = new ArrayDeque<BpmBranch>();
private List<BpmEvent> events = new ArrayList<>();
private Deque<BpmBranch> branches = new ArrayDeque<>();
public DiagramDescription getDescription() {
return new DiagramDescription("(Bpm Diagram)");

View File

@ -51,7 +51,7 @@ public class BpmDiagramFactory extends PSystemCommandFactory {
@Override
protected List<Command> createCommands() {
final List<Command> result = new ArrayList<Command>();
final List<Command> result = new ArrayList<>();
result.add(new CommandDockedEvent());
result.add(new CommandMerge());
result.add(new CommandResume());

View File

@ -42,7 +42,7 @@ import java.util.List;
public class Cell {
private Placeable data;
private final List<Placeable> destinations = new ArrayList<Placeable>();
private final List<Placeable> destinations = new ArrayList<>();
public final Placeable getData() {
return data;

View File

@ -43,8 +43,8 @@ import java.util.Objects;
public class ChainImpl<O> implements Chain<O> {
private final List<O> positive = new ArrayList<O>();
private final List<O> negative = new ArrayList<O>();
private final List<O> positive = new ArrayList<>();
private final List<O> negative = new ArrayList<>();
private int currentVersion;
public boolean remove(O data) {
@ -57,7 +57,7 @@ public class ChainImpl<O> implements Chain<O> {
}
public ChainImpl<O> cloneMe() {
final ChainImpl<O> result = new ChainImpl<O>();
final ChainImpl<O> result = new ChainImpl<>();
result.currentVersion = this.currentVersion;
result.positive.addAll(this.positive);
result.negative.addAll(this.negative);
@ -88,7 +88,7 @@ public class ChainImpl<O> implements Chain<O> {
}
public List<O> toList() {
final List<O> result = new ArrayList<O>();
final List<O> result = new ArrayList<>();
for (O element : negative) {
if (element != null) {
result.add(0, element);

View File

@ -40,6 +40,6 @@ import java.util.Set;
public class FootPrint {
private final Set<Coord> cells = new HashSet<Coord>();
private final Set<Coord> cells = new HashSet<>();
}

View File

@ -55,8 +55,8 @@ public class Grid {
public Grid() {
this.root = new Coord(new Line(), new Col());
this.lines = new ChainImpl<Line>(root.getLine());
this.cols = new ChainImpl<Col>(root.getCol());
this.lines = new ChainImpl<>(root.getLine());
this.cols = new ChainImpl<>(root.getCol());
this.cells.put(root, new Cell());
}
@ -92,7 +92,7 @@ public class Grid {
}
// private Set<GridEdge> edgeWith(Cell someCell) {
// // final Set<GridEdge> result = new HashSet<GridEdge>();
// // final Set<GridEdge> result = new HashSet<>();
// // for (GridEdge edge : edges) {
// // if (edge.match(someCell)) {
// // result.add(edge);
@ -104,7 +104,7 @@ public class Grid {
// }
//
// private Collection<Cell> getCellsConnectedTo(Cell someCell) {
// final Set<Cell> result = new HashSet<Cell>();
// final Set<Cell> result = new HashSet<>();
// final Set<GridEdge> myEdges = edgeWith(someCell);
// for (Cell cell : cells.values()) {
// for (GridEdge edge : myEdges) {
@ -118,7 +118,7 @@ public class Grid {
// }
//
// private SortedSet<Col> getColsConnectedTo(Cell someCell) {
// final SortedSet<Col> result = new TreeSet<Col>(cols);
// final SortedSet<Col> result = new TreeSet<>(cols);
// final Set<GridEdge> myEdges = edgeWith(someCell);
// for (Map.Entry<Coord, Cell> ent : cells.entrySet()) {
// for (GridEdge edge : myEdges) {
@ -132,7 +132,7 @@ public class Grid {
// }
// public SortedSet<Col> colsConnectedTo(Line line) {
// final SortedSet<Col> result = new TreeSet<Col>(cols);
// final SortedSet<Col> result = new TreeSet<>(cols);
// for (Map.Entry<Coord, Cell> ent : cells.entrySet()) {
// final Cell cell = ent.getValue();
// if (cell == null || cell.getData() == null) {
@ -254,7 +254,7 @@ public class Grid {
// }
public Set<Col> usedColsOf(Line line) {
final Set<Col> result = new HashSet<Col>();
final Set<Col> result = new HashSet<>();
for (Map.Entry<Coord, Cell> ent : cells.entrySet()) {
final Cell cell = ent.getValue();
if (cell == null || cell.getData() == null) {

View File

@ -53,7 +53,7 @@ public class GridArray implements UDrawable {
private final Placeable data[][];
private final ISkinParam skinParam;
// private final List<GridEdge> edges = new ArrayList<GridEdge>();
// private final List<GridEdge> edges = new ArrayList<>();
public GridArray(ISkinParam skinParam, int lines, int cols) {
this.skinParam = skinParam;

View File

@ -42,7 +42,7 @@ import java.util.List;
public class BrailleCharFactory {
public static List<BrailleChar> build(String s) {
final List<BrailleChar> result = new ArrayList<BrailleChar>();
final List<BrailleChar> result = new ArrayList<>();
for (int i = 0; i < s.length(); i++) {
result.add(BrailleChar.fromChar(s.charAt(i)));
}

View File

@ -51,7 +51,7 @@ public class BrailleGrid {
private int maxY;
private final double quanta;
private final Set<Coords> on = new HashSet<Coords>();
private final Set<Coords> on = new HashSet<>();
public BrailleGrid(double quanta) {
this.quanta = quanta;

View File

@ -58,7 +58,7 @@ public class DriverPolygonBraille implements UDriver<BrailleGrid> {
public void draw(UShape ushape, double x, double y, ColorMapper mapper, UParam param, BrailleGrid grid) {
final UPolygon shape = (UPolygon) ushape;
final List<Point2D> points = new ArrayList<Point2D>();
final List<Point2D> points = new ArrayList<>();
int i = 0;
for (Point2D pt : shape.getPoints()) {

View File

@ -1,5 +1,7 @@
/* Copyright 2015 Google Inc. All Rights Reserved.
https://github.com/google/brotli/blob/master/LICENSE
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

View File

@ -1,5 +1,7 @@
/* Copyright 2015 Google Inc. All Rights Reserved.
https://github.com/google/brotli/blob/master/LICENSE
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

View File

@ -1,5 +1,7 @@
/* Copyright 2015 Google Inc. All Rights Reserved.
https://github.com/google/brotli/blob/master/LICENSE
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

View File

@ -1,5 +1,7 @@
/* Copyright 2015 Google Inc. All Rights Reserved.
https://github.com/google/brotli/blob/master/LICENSE
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

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