1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-22 10:59:01 +00:00

<> operator

This commit is contained in:
soloturn 2022-02-08 21:34:55 +01:00
parent 70a9682c80
commit 789ff2309b
11 changed files with 61 additions and 63 deletions

View File

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

View File

@ -50,7 +50,7 @@ abstract class MonoSwimable extends WithNote implements Swimable {
} }
final public Set<Swimlane> getSwimlanes() { final public Set<Swimlane> getSwimlanes() {
return swimlane == null ? Collections.<Swimlane>emptySet() : Collections.<Swimlane>singleton(swimlane); return swimlane == null ? Collections.emptySet() : Collections.<Swimlane>singleton(swimlane);
} }
final public Swimlane getSwimlaneIn() { final public Swimlane getSwimlaneIn() {

View File

@ -42,7 +42,6 @@ import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
public class TextBlockInterceptorUDrawable extends AbstractTextBlock implements TextBlock { public class TextBlockInterceptorUDrawable extends AbstractTextBlock implements TextBlock {
@ -53,7 +52,7 @@ public class TextBlockInterceptorUDrawable extends AbstractTextBlock implements
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
new UGraphicInterceptorUDrawable2(ug, new HashMap<String, UTranslate>()).draw(textBlock); new UGraphicInterceptorUDrawable2(ug, new HashMap<>()).draw(textBlock);
ug.flushUg(); ug.flushUg();
} }

View File

@ -38,7 +38,6 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.Map; import java.util.Map;
import net.sourceforge.plantuml.activitydiagram3.gtile.GConnection;
import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile; import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile;
import net.sourceforge.plantuml.graphic.UDrawable; import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.graphic.UGraphicDelegator; import net.sourceforge.plantuml.graphic.UGraphicDelegator;

View File

@ -62,7 +62,7 @@ import net.sourceforge.plantuml.ugraphic.comp.CompressionMode;
public class Worm implements Iterable<Point2D.Double> { public class Worm implements Iterable<Point2D.Double> {
private final List<Point2D.Double> points = new ArrayList<Point2D.Double>(); private final List<Point2D.Double> points = new ArrayList<>();
private final Style style; private final Style style;
public Worm(Style style) { public Worm(Style style) {
@ -230,7 +230,7 @@ public class Worm implements Iterable<Point2D.Double> {
public String toString() { public String toString() {
final StringBuilder result = new StringBuilder(); final StringBuilder result = new StringBuilder();
for (int i = 0; i < points.size() - 1; i++) for (int i = 0; i < points.size() - 1; i++)
result.append(getDirectionAtPoint(i) + " "); result.append(getDirectionAtPoint(i)).append(" ");
return result + points.toString(); return result + points.toString();
} }

View File

@ -42,7 +42,7 @@ import java.util.Map;
public class BArray implements Iterable<BNode> { public class BArray implements Iterable<BNode> {
private final Map<String, BNode> data = new HashMap<String, BNode>(); private final Map<String, BNode> data = new HashMap<>();
private int maxX; private int maxX;
private int maxY; private int maxY;

View File

@ -311,7 +311,7 @@ public class Grid {
// } // }
public void addConnections() { public void addConnections() {
for (Map.Entry<Coord, Cell> ent : new HashMap<Coord, Cell>(cells).entrySet()) { for (Map.Entry<Coord, Cell> ent : new HashMap<>(cells).entrySet()) {
final List<Placeable> dests2 = ent.getValue().getDestinations2(); final List<Placeable> dests2 = ent.getValue().getDestinations2();
final Coord src = ent.getKey(); final Coord src = ent.getKey();
for (int i = 0; i < dests2.size(); i++) { for (int i = 0; i < dests2.size(); i++) {

View File

@ -97,7 +97,7 @@ final public class UmlSource {
} }
public UmlSource(List<StringLocated> data, boolean checkEndingBackslash) { public UmlSource(List<StringLocated> data, boolean checkEndingBackslash) {
this(data, checkEndingBackslash, new ArrayList<StringLocated>()); this(data, checkEndingBackslash, new ArrayList<>());
} }
/** /**
@ -109,14 +109,14 @@ final public class UmlSource {
* following one. * following one.
*/ */
public UmlSource(List<StringLocated> data, boolean checkEndingBackslash, List<StringLocated> rawSource) { public UmlSource(List<StringLocated> data, boolean checkEndingBackslash, List<StringLocated> rawSource) {
this(new ArrayList<StringLocated>(), rawSource); this(new ArrayList<>(), rawSource);
if (checkEndingBackslash) { if (checkEndingBackslash) {
final StringBuilder pending = new StringBuilder(); final StringBuilder pending = new StringBuilder();
for (StringLocated cs : data) { for (StringLocated cs : data) {
final String s = cs.getString(); final String s = cs.getString();
if (StringUtils.endsWithBackslash(s)) { if (StringUtils.endsWithBackslash(s)) {
pending.append(s.substring(0, s.length() - 1)); pending.append(s, 0, s.length() - 1);
} else { } else {
pending.append(s); pending.append(s);
this.source.add(new StringLocated(pending.toString(), cs.getLocation())); this.source.add(new StringLocated(pending.toString(), cs.getLocation()));

View File

@ -109,9 +109,9 @@ public class SheetBlock1 extends AbstractTextBlock implements TextBlock, Atom, S
for (Stripe stripe : sheet) { for (Stripe stripe : sheet) {
stripes.addAll(new Fission(stripe, maxWidth).getSplitted(stringBounder)); stripes.addAll(new Fission(stripe, maxWidth).getSplitted(stringBounder));
} }
positions = new LinkedHashMap<Atom, Position>(); positions = new LinkedHashMap<>();
widths = new LinkedHashMap<Stripe, Double>(); widths = new LinkedHashMap<>();
heights = new LinkedHashMap<Stripe, Double>(); heights = new LinkedHashMap<>();
minMax = MinMax.getEmpty(true); minMax = MinMax.getEmpty(true);
double y = 0; double y = 0;
for (Stripe stripe : stripes) { for (Stripe stripe : stripes) {

View File

@ -48,7 +48,7 @@ public class Stereostyles {
public static final Stereostyles NONE = new Stereostyles(); public static final Stereostyles NONE = new Stereostyles();
private final Set<String> names = new LinkedHashSet<String>(); private final Set<String> names = new LinkedHashSet<>();
private Stereostyles() { private Stereostyles() {
} }

View File

@ -65,7 +65,7 @@ public class TextBlockMap extends AbstractTextBlock implements WithPorts {
private final FontParam fontParam; private final FontParam fontParam;
private final ISkinParam skinParam; private final ISkinParam skinParam;
private final FontConfiguration fontConfiguration; private final FontConfiguration fontConfiguration;
private final Map<TextBlock, TextBlock> blocksMap = new LinkedHashMap<TextBlock, TextBlock>(); private final Map<TextBlock, TextBlock> blocksMap = new LinkedHashMap<>();
private final List<String> keys = new ArrayList<>(); private final List<String> keys = new ArrayList<>();
private double totalWidth; private double totalWidth;