Compare commits

...

1 commit

Author SHA1 Message Date
5a4a1e902b WIP add stub WordWrapRequest 2020-05-22 08:32:52 +01:00
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();
}
}