本文整理汇总了Java中org.jdesktop.swingx.painter.effects.ShadowPathEffect类的典型用法代码示例。如果您正苦于以下问题:Java ShadowPathEffect类的具体用法?Java ShadowPathEffect怎么用?Java ShadowPathEffect使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ShadowPathEffect类属于org.jdesktop.swingx.painter.effects包,在下文中一共展示了ShadowPathEffect类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addRasterizedTextLayer
import org.jdesktop.swingx.painter.effects.ShadowPathEffect; //导入依赖的package包/类
private static void addRasterizedTextLayer(Composition ic, String text, Color textColor, Font font, int translationY, BlendingMode blendingMode, float opacity, boolean dropShadow) {
addNewLayer(text);
TextFilter textFilter = TextFilter.INSTANCE;
AreaEffects effects = null;
if (dropShadow) {
effects = new AreaEffects();
effects.setDropShadowEffect(new ShadowPathEffect(1.0f));
}
TextSettings settings = new TextSettings(text, font, textColor, effects,
AbstractLayoutPainter.HorizontalAlignment.CENTER,
AbstractLayoutPainter.VerticalAlignment.CENTER, false);
textFilter.setSettings(settings);
textFilter.execute(OP_WITHOUT_DIALOG);
ImageLayer layer = (ImageLayer) ic.getActiveLayer();
layer.setTranslation(0, translationY);
layer.enlargeLayer();
layer.setOpacity(opacity, true, AddToHistory.YES, true);
layer.setBlendingMode(blendingMode, true, AddToHistory.YES, true);
}
示例2: initDropShadowConfigurator
import org.jdesktop.swingx.painter.effects.ShadowPathEffect; //导入依赖的package包/类
private void initDropShadowConfigurator(AreaEffects effects) {
boolean defaultEnabled = false;
Color defaultColor = BLACK;
int defaultDistance = 10;
double defaultAngle = 0.7;
int defaultSpread = 10;
if (effects != null) {
ShadowPathEffect effect = effects.getDropShadowEffect();
if (effect != null) {
defaultEnabled = true;
defaultColor = effect.getBrushColor();
Point2D offset = effect.getOffset();
double x = offset.getX();
double y = offset.getY();
defaultDistance = (int) Math.sqrt(x * x + y * y);
defaultAngle = Math.atan2(y, x);
defaultSpread = effect.getEffectWidth();
}
}
dropShadowConfigurator = new DropShadowEffectConfiguratorPanel(
defaultEnabled, defaultColor, defaultDistance, defaultAngle, defaultSpread);
}
示例3: createRandom
import org.jdesktop.swingx.painter.effects.ShadowPathEffect; //导入依赖的package包/类
public static AreaEffects createRandom(Random rand) {
AreaEffects ae = new AreaEffects();
float f = rand.nextFloat();
if(f < 0.25f) {
ae.setNeonBorderEffect(new NeonBorderEffect());
} else if(f < 0.5f) {
ae.setDropShadowEffect(new ShadowPathEffect(1.0f));
} else if(f < 0.75f) {
ae.setInnerGlowEffect(new InnerGlowPathEffect(1.0f));
} else {
ae.setGlowEffect(new GlowPathEffect(1.0f));
}
return ae;
}
示例4: createAreaEffectsList
import org.jdesktop.swingx.painter.effects.ShadowPathEffect; //导入依赖的package包/类
/**
* Create and returns model for effects selection combobox
* @return
*/
private ComboBoxModel createAreaEffectsList() {
DefaultComboBoxModel model = new DefaultComboBoxModel();
model.addElement(new DisplayInfo<AreaEffect>(" - none -", null));
model.addElement(new DisplayInfo<AreaEffect>(new GlowPathEffect()));
model.addElement(new DisplayInfo<AreaEffect>(new InnerGlowPathEffect()));
model.addElement(new DisplayInfo<AreaEffect>(new InnerShadowPathEffect()));
model.addElement(new DisplayInfo<AreaEffect>(new NeonBorderEffect()));
model.addElement(new DisplayInfo<AreaEffect>(new ShadowPathEffect()));
return model;
}
示例5: setDropShadowEffect
import org.jdesktop.swingx.painter.effects.ShadowPathEffect; //导入依赖的package包/类
public void setDropShadowEffect(ShadowPathEffect dropShadowEffect) {
this.dropShadowEffect = dropShadowEffect;
}
示例6: getDropShadowEffect
import org.jdesktop.swingx.painter.effects.ShadowPathEffect; //导入依赖的package包/类
public ShadowPathEffect getDropShadowEffect() {
return dropShadowEffect;
}