-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
676 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/com/github/houbb/word/cloud/support/background/BackgroundImage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.github.houbb.word.cloud.support.background; | ||
|
||
import com.github.houbb.heaven.util.common.ArgUtil; | ||
import com.github.houbb.word.cloud.exception.WordCloudException; | ||
import com.kennycason.kumo.bg.Background; | ||
import com.kennycason.kumo.bg.PixelBoundryBackground; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* 图片背景 | ||
* @author binbin.hou | ||
* @since 1.3.0 | ||
*/ | ||
public class BackgroundImage implements IBackground{ | ||
|
||
private final String imagePath; | ||
|
||
public BackgroundImage(String imagePath) { | ||
ArgUtil.notEmpty(imagePath, "imagePath"); | ||
this.imagePath = imagePath; | ||
} | ||
|
||
/** | ||
* 没有背景 | ||
* | ||
* @return 背景 | ||
*/ | ||
public Background background() { | ||
try { | ||
return new PixelBoundryBackground(imagePath); | ||
} catch (IOException e) { | ||
throw new WordCloudException(e); | ||
} | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/github/houbb/word/cloud/support/background/BackgroundNone.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.github.houbb.word.cloud.support.background; | ||
|
||
import com.kennycason.kumo.bg.Background; | ||
|
||
/** | ||
* 背景 | ||
* @author binbin.hou | ||
* @since 1.3.0 | ||
*/ | ||
public class BackgroundNone implements IBackground{ | ||
|
||
/** | ||
* 没有背景 | ||
* | ||
* @return 背景 | ||
*/ | ||
public Background background() { | ||
return null; | ||
} | ||
|
||
} |
Oops, something went wrong.