Compare commits

..

1 commit

Author SHA1 Message Date
5a4a1e902b WIP add stub WordWrapRequest 2020-05-22 08:32:52 +01:00
11 changed files with 65 additions and 110 deletions

View file

@ -1,7 +0,0 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

View file

@ -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
View file

@ -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

View file

@ -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

View file

@ -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
View 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

View file

@ -1,20 +1,19 @@
name: sonatype-deploy
name: Deploy to Sonatype Nexus
on:
push:
tags:
- "v*"
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: kamiazya/setup-graphviz@v1
# - uses: kamiazya/setup-graphviz@v1
- uses: actions/checkout@v2
- name: Set up JDK
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 8
java-version: 11
- name: Build with Maven
run: mvn -B install
- name: Nexus Repo Publish

View file

@ -14,10 +14,6 @@ font size and/or overflow into additional rectangles.
</dependency>
```
## Requirements
* JDK 11+
## Usage
### Word Wrap

View file

@ -14,13 +14,13 @@
<version>DEV-SNAPSHOT</version>
<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-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>
<assertj.version>3.19.0</assertj.version>
<junit.version>5.6.2</junit.version>
<assertj.version>3.16.0</assertj.version>
<mockito.version>3.3.3</mockito.version>
<jqwik.version>1.2.7</jqwik.version>
</properties>

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();
}
}