Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
5a4a1e902b |
2 changed files with 29 additions and 0 deletions
16
src/main/java/net/kemitix/text/fit/WordWrapRequest.java
Normal file
16
src/main/java/net/kemitix/text/fit/WordWrapRequest.java
Normal 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;
|
||||
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue