public static final class FireworkEffect.Builder
extends java.lang.Object
原文: This is a builder for FireworkEffects.
FireworkEffect.builder()
限定符和类型 | 方法和说明 |
---|---|
FireworkEffect |
build()
根据这个生成器的当前内容创建一个
FireworkEffect 。 |
FireworkEffect.Builder |
flicker(boolean flicker)
设置烟花是否具有闪烁效果。
|
FireworkEffect.Builder |
trail(boolean trail)
设置烟花是否有尾迹效果。
|
FireworkEffect.Builder |
with(FireworkEffect.Type type)
指定烟花效果的类型。
|
FireworkEffect.Builder |
withColor(Color... colors)
向烟花效果添加几种主颜色。
|
FireworkEffect.Builder |
withColor(Color color)
向烟花效果添加一种主颜色。
|
FireworkEffect.Builder |
withColor(java.lang.Iterable<?> colors)
向烟花效果添加几种主颜色。
|
FireworkEffect.Builder |
withFade(Color... colors)
向烟花效果添加几种淡出颜色。
|
FireworkEffect.Builder |
withFade(Color color)
向烟花效果添加一种淡出颜色。
|
FireworkEffect.Builder |
withFade(java.lang.Iterable<?> colors)
向烟花效果添加几种淡出颜色。
|
FireworkEffect.Builder |
withFlicker()
向烟花添加一个闪烁效果。
|
FireworkEffect.Builder |
withTrail()
向烟花添加一个尾迹效果。
|
public FireworkEffect.Builder with(FireworkEffect.Type type) throws java.lang.IllegalArgumentException
原文: Specify the type of the firework effect.
type
- 效果类型java.lang.IllegalArgumentException
- 如果类型为空则抛出错误public FireworkEffect.Builder withFlicker()
原文: Add a flicker to the firework effect.
public FireworkEffect.Builder flicker(boolean flicker)
原文: Set whether the firework effect should flicker.
flicker
- 具有闪烁效果为true,否则为falsepublic FireworkEffect.Builder withTrail()
原文: Add a trail to the firework effect.
public FireworkEffect.Builder trail(boolean trail)
原文: Set whether the firework effect should have a trail.
trail
- 如果具有尾迹效果则返回true,否则返回falsepublic FireworkEffect.Builder withColor(Color color) throws java.lang.IllegalArgumentException
原文: Add a primary color to the firework effect.
color
- 添加的颜色java.lang.IllegalArgumentException
- 如果颜色为空则抛出错误public FireworkEffect.Builder withColor(Color... colors) throws java.lang.IllegalArgumentException
原文: Add several primary colors to the firework effect.
colors
- 添加的颜色java.lang.IllegalArgumentException
- 如果颜色为空则抛出错误java.lang.IllegalArgumentException
- 如果任一颜色为空则抛出错误(可能在改变生效后抛出)public FireworkEffect.Builder withColor(java.lang.Iterable<?> colors) throws java.lang.IllegalArgumentException
原文: Add several primary colors to the firework effect.
colors
- 一个可迭代的对象,其迭代器可产生所需的颜色。java.lang.IllegalArgumentException
- 如果颜色为空则抛出错误java.lang.IllegalArgumentException
- 如果任一颜色为空则抛出错误(可能在改变生效后抛出)public FireworkEffect.Builder withFade(Color color) throws java.lang.IllegalArgumentException
原文: Add a fade color to the firework effect.
color
- 添加的颜色java.lang.IllegalArgumentException
- 如果颜色为空则抛出错误java.lang.IllegalArgumentException
- 如果任一颜色为空则抛出错误(可能在改变生效后抛出)public FireworkEffect.Builder withFade(Color... colors) throws java.lang.IllegalArgumentException
原文: Add several fade colors to the firework effect.
colors
- 添加的颜色java.lang.IllegalArgumentException
- 如果颜色为空则抛出错误java.lang.IllegalArgumentException
- 如果任一颜色为空则抛出错误(可能在改变生效后抛出)public FireworkEffect.Builder withFade(java.lang.Iterable<?> colors) throws java.lang.IllegalArgumentException
原文: Add several fade colors to the firework effect.
colors
- 一个可迭代的对象,其迭代器可产生所需的颜色。java.lang.IllegalArgumentException
- 如果颜色为空则抛出错误java.lang.IllegalArgumentException
- 如果任一颜色为空则抛出错误(可能在改变生效后抛出)public FireworkEffect build()
FireworkEffect
。
成功生成需要指定至少一种颜色。
原文:
Create a FireworkEffect
from the current contents of this
builder.
To successfully build, you must have specified at least one color.