Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
5a4a1e902b |
11 changed files with 65 additions and 110 deletions
7
.github/dependabot.yml
vendored
7
.github/dependabot.yml
vendored
|
@ -1,7 +0,0 @@
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: maven
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: daily
|
|
||||||
open-pull-requests-limit: 10
|
|
34
.github/release-drafter.yml
vendored
34
.github/release-drafter.yml
vendored
|
@ -1,34 +0,0 @@
|
||||||
name-template: 'v$RESOLVED_VERSION 🌈'
|
|
||||||
tag-template: 'v$RESOLVED_VERSION'
|
|
||||||
categories:
|
|
||||||
- title: '🚀 Features'
|
|
||||||
labels:
|
|
||||||
- 'feature'
|
|
||||||
- 'enhancement'
|
|
||||||
- title: '🐛 Bug Fixes'
|
|
||||||
labels:
|
|
||||||
- 'fix'
|
|
||||||
- 'bugfix'
|
|
||||||
- 'bug'
|
|
||||||
- title: '🧰 Maintenance'
|
|
||||||
labels:
|
|
||||||
- 'chore'
|
|
||||||
- 'dependencies'
|
|
||||||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
|
||||||
version-resolver:
|
|
||||||
major:
|
|
||||||
labels:
|
|
||||||
- 'major'
|
|
||||||
minor:
|
|
||||||
labels:
|
|
||||||
- 'minor'
|
|
||||||
patch:
|
|
||||||
labels:
|
|
||||||
- 'patch'
|
|
||||||
default: patch
|
|
||||||
exclude-labels:
|
|
||||||
- 'skip-changelog'
|
|
||||||
template: |
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
$CHANGES
|
|
17
.github/stale.yaml
vendored
17
.github/stale.yaml
vendored
|
@ -1,17 +0,0 @@
|
||||||
# Number of days of inactivity before an issue becomes stale
|
|
||||||
daysUntilStale: 60
|
|
||||||
# Number of days of inactivity before a stale issue is closed
|
|
||||||
daysUntilClose: 7
|
|
||||||
# Issues with these labels will never be considered stale
|
|
||||||
exemptLabels:
|
|
||||||
- pinned
|
|
||||||
- security
|
|
||||||
# Label to use when marking an issue as stale
|
|
||||||
staleLabel: wontfix
|
|
||||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
|
||||||
markComment: >
|
|
||||||
This issue has been automatically marked as stale because it has not had
|
|
||||||
recent activity. It will be closed if no further activity occurs. Thank you
|
|
||||||
for your contributions.
|
|
||||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
|
||||||
closeComment: false
|
|
23
.github/workflows/build-maven.yml
vendored
23
.github/workflows/build-maven.yml
vendored
|
@ -1,23 +0,0 @@
|
||||||
name: maven-build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: '*'
|
|
||||||
pull_request:
|
|
||||||
branches: '*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
java: [ 11, 14 ]
|
|
||||||
steps:
|
|
||||||
- uses: kamiazya/setup-graphviz@v1
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: setup-jdk-${{ matrix.java }}
|
|
||||||
uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: ${{ matrix.java }}
|
|
||||||
- name: build-jar
|
|
||||||
run: mvn -B install
|
|
14
.github/workflows/draft-release.yml
vendored
14
.github/workflows/draft-release.yml
vendored
|
@ -1,14 +0,0 @@
|
||||||
name: draft-release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update_draft_release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: release-drafter/release-drafter@v5.11.0
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
26
.github/workflows/maven-build.yml
vendored
Normal file
26
.github/workflows/maven-build.yml
vendored
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
# This workflow will build a Java project with Maven
|
||||||
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
||||||
|
|
||||||
|
name: Java CI with Maven
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: '*'
|
||||||
|
pull_request:
|
||||||
|
branches: '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
java: [ 11, 13 ]
|
||||||
|
steps:
|
||||||
|
# - uses: kamiazya/setup-graphviz@v1
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: setup-java-${{ matrix.java }}
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: ${{ matrix.java }}
|
||||||
|
- name: install
|
||||||
|
run: mvn -B install
|
|
@ -1,20 +1,19 @@
|
||||||
name: sonatype-deploy
|
name: Deploy to Sonatype Nexus
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
tags:
|
types: [created]
|
||||||
- "v*"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: kamiazya/setup-graphviz@v1
|
# - uses: kamiazya/setup-graphviz@v1
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Set up JDK
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 8
|
java-version: 11
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn -B install
|
run: mvn -B install
|
||||||
- name: Nexus Repo Publish
|
- name: Nexus Repo Publish
|
|
@ -14,10 +14,6 @@ font size and/or overflow into additional rectangles.
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
* JDK 11+
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Word Wrap
|
### Word Wrap
|
||||||
|
|
8
pom.xml
8
pom.xml
|
@ -14,13 +14,13 @@
|
||||||
<version>DEV-SNAPSHOT</version>
|
<version>DEV-SNAPSHOT</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<tiles-maven-plugin.version>2.21</tiles-maven-plugin.version>
|
<tiles-maven-plugin.version>2.16</tiles-maven-plugin.version>
|
||||||
<kemitix-maven-tiles.version>2.6.0</kemitix-maven-tiles.version>
|
<kemitix-maven-tiles.version>2.6.0</kemitix-maven-tiles.version>
|
||||||
<kemitix-checkstyle.version>5.4.0</kemitix-checkstyle.version>
|
<kemitix-checkstyle.version>5.4.0</kemitix-checkstyle.version>
|
||||||
<lombok.version>1.18.20</lombok.version>
|
<lombok.version>1.18.12</lombok.version>
|
||||||
|
|
||||||
<junit.version>5.7.2</junit.version>
|
<junit.version>5.6.2</junit.version>
|
||||||
<assertj.version>3.19.0</assertj.version>
|
<assertj.version>3.16.0</assertj.version>
|
||||||
<mockito.version>3.3.3</mockito.version>
|
<mockito.version>3.3.3</mockito.version>
|
||||||
<jqwik.version>1.2.7</jqwik.version>
|
<jqwik.version>1.2.7</jqwik.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
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;
|
package net.kemitix.text.fit;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
import java.awt.geom.Rectangle2D;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface WordWrapper {
|
public interface WordWrapper {
|
||||||
|
@ -10,4 +11,16 @@ public interface WordWrapper {
|
||||||
Graphics2D graphics2D,
|
Graphics2D graphics2D,
|
||||||
int width
|
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