WIP add stub WordWrapRequest

This commit is contained in:
Paul Campbell 2020-05-22 08:31:42 +01:00
parent 035e7f2065
commit 5a4a1e902b
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,16 @@
package net.kemitix.text.fit;
import lombok.Builder;
import lombok.With;
import java.awt.*;
@With
@Builder
public class WordWrapRequest {
String text;
Font font;
Graphics2D graphics2D;
int width;
}

View file

@ -1,6 +1,7 @@
package net.kemitix.text.fit;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.util.List;
public interface WordWrapper {
@ -10,4 +11,16 @@ public interface WordWrapper {
Graphics2D graphics2D,
int width
);
default WordWrapRequest request(
String text,
Font font,
Graphics2D graphics2D
) {
return WordWrapRequest.builder()
.text(text)
.font(font)
.graphics2D(graphics2D)
.build();
}
}