• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java AbstractLayoutPainter类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.jdesktop.swingx.painter.AbstractLayoutPainter的典型用法代码示例。如果您正苦于以下问题:Java AbstractLayoutPainter类的具体用法?Java AbstractLayoutPainter怎么用?Java AbstractLayoutPainter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

AbstractLayoutPainter类属于org.jdesktop.swingx.painter包,在下文中一共展示了AbstractLayoutPainter类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addRasterizedTextLayer

点赞 3

import org.jdesktop.swingx.painter.AbstractLayoutPainter; //导入依赖的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);
}
 

开发者ID:teddyted,
项目名称:iSeleda,
代码行数:25,
代码来源:ImageTests.java

示例2: initBackground

点赞 2

import org.jdesktop.swingx.painter.AbstractLayoutPainter; //导入依赖的package包/类
private void initBackground() {
    try {
        URL resource = getClass().getResource("/app/resources/bg/bg16.jpg");
        BufferedImage r = ImageIO.read(resource);
        jXPanel1.setBackgroundPainter(new ImagePainter(r, AbstractLayoutPainter.HorizontalAlignment.CENTER, AbstractLayoutPainter.VerticalAlignment.CENTER));
    } catch (IOException ex) {
        Logger.getLogger(Dashboard.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 

开发者ID:isu3ru,
项目名称:java-swing-template,
代码行数:10,
代码来源:Dashboard.java

示例3: TextSettings

点赞 2

import org.jdesktop.swingx.painter.AbstractLayoutPainter; //导入依赖的package包/类
public TextSettings(String text, Font font, Color color, AreaEffects areaEffects, AbstractLayoutPainter.HorizontalAlignment horizontalAlignment, AbstractLayoutPainter.VerticalAlignment verticalAlignment, boolean watermark) {
    this.areaEffects = areaEffects;
    this.color = color;
    this.font = font;
    this.horizontalAlignment = horizontalAlignment;
    this.text = text;
    this.verticalAlignment = verticalAlignment;
    this.watermark = watermark;
}
 

开发者ID:teddyted,
项目名称:iSeleda,
代码行数:10,
代码来源:TextSettings.java

示例4: createRandomSettings

点赞 2

import org.jdesktop.swingx.painter.AbstractLayoutPainter; //导入依赖的package包/类
public static TextSettings createRandomSettings(Random rand) {
    TextSettings ts = new TextSettings(Utils.getRandomString(10),
            new Font(Font.SANS_SERIF, Font.BOLD, 100),
            ColorUtils.getRandomColor(false),
            AreaEffects.createRandom(rand),
            AbstractLayoutPainter.HorizontalAlignment.CENTER,
            AbstractLayoutPainter.VerticalAlignment.CENTER,
            rand.nextBoolean());
    return ts;
}
 

开发者ID:teddyted,
项目名称:iSeleda,
代码行数:11,
代码来源:TextSettings.java

示例5: setPainter

点赞 2

import org.jdesktop.swingx.painter.AbstractLayoutPainter; //导入依赖的package包/类
public void setPainter(Painter<?> painter) {
    releaseBaseBindings();
    releaseAlignBindings();
    releaseAreaBindings();
    this.painter = painter;
    setBaseEnabled(painter instanceof AbstractPainter<?>);
    setAlignEnabled(painter instanceof AbstractLayoutPainter<?>);
    setAreaEnabled(painter instanceof AbstractAreaPainter<?>);
}
 

开发者ID:RockManJoe64,
项目名称:swingx,
代码行数:10,
代码来源:PainterDemo.java

示例6: getHorizontalAlignment

点赞 2

import org.jdesktop.swingx.painter.AbstractLayoutPainter; //导入依赖的package包/类
public AbstractLayoutPainter.HorizontalAlignment getHorizontalAlignment() {
    return horizontalAlignment;
}
 

开发者ID:teddyted,
项目名称:iSeleda,
代码行数:4,
代码来源:TextSettings.java

示例7: getVerticalAlignment

点赞 2

import org.jdesktop.swingx.painter.AbstractLayoutPainter; //导入依赖的package包/类
public AbstractLayoutPainter.VerticalAlignment getVerticalAlignment() {
    return verticalAlignment;
}
 

开发者ID:teddyted,
项目名称:iSeleda,
代码行数:4,
代码来源:TextSettings.java

示例8: savePainterToFile

点赞 2

import org.jdesktop.swingx.painter.AbstractLayoutPainter; //导入依赖的package包/类
static public void savePainterToFile(Painter compoundPainter, File file, URL baseURL) throws IOException {
    //System.setErr(null);
    //        u.p("writing out to: " + file.getCanonicalPath());
    setTransient(ImagePainter.class, "image");
    setTransient(ImagePainter.class, "imageString");
    //setTransient(CompoundPainter.class,"antialiasing");
    //setTransient(AbstractPainter.class,"antialiasing");
    //setTransient(AbstractPainter.class,"renderingHints");
    //setPropertyDelegate();
    
    XMLEncoder e = new XMLEncoder(new FileOutputStream(file));
    e.setOwner(new PersistenceOwner(baseURL));
    //p("owner = " + e.getOwner());
    //e.setOwner(compoundPainter);
    
    // serialize the enums
    //e.setPersistenceDelegate(AbstractPainter.Antialiasing.class, new TypeSafeEnumPersistenceDelegate());
    e.setPersistenceDelegate(AbstractPainter.Interpolation.class, new TypeSafeEnumPersistenceDelegate());
   // e.setPersistenceDelegate(AbstractPainter.FractionalMetrics.class, new TypeSafeEnumPersistenceDelegate());
    e.setPersistenceDelegate(RectanglePainter.Style.class, new TypeSafeEnumPersistenceDelegate());
    e.setPersistenceDelegate(AbstractLayoutPainter.HorizontalAlignment.class, new TypeSafeEnumPersistenceDelegate());
    e.setPersistenceDelegate(AbstractLayoutPainter.VerticalAlignment.class, new TypeSafeEnumPersistenceDelegate());
    
    
    e.setPersistenceDelegate(AbstractPainter.class, new AbstractPainterDelegate());
    e.setPersistenceDelegate(ImagePainter.class, new ImagePainterDelegate());
    e.setPersistenceDelegate(RenderingHints.class, new RenderingHintsDelegate());
    e.setPersistenceDelegate(GradientPaint.class, new GradientPaintDelegate());
    e.setPersistenceDelegate(Arc2D.Float.class, new Arc2DDelegate());
    e.setPersistenceDelegate(Arc2D.Double.class, new Arc2DDelegate());
    e.setPersistenceDelegate(CubicCurve2D.Float.class, new CubicCurve2DDelegate());
    e.setPersistenceDelegate(CubicCurve2D.Double.class, new CubicCurve2DDelegate());
    e.setPersistenceDelegate(Ellipse2D.Float.class, new Ellipse2DDelegate());
    e.setPersistenceDelegate(Ellipse2D.Double.class, new Ellipse2DDelegate());
    e.setPersistenceDelegate(Line2D.Float.class, new Line2DDelegate());
    e.setPersistenceDelegate(Line2D.Double.class, new Line2DDelegate());
    e.setPersistenceDelegate(Point2D.Float.class, new Point2DDelegate());
    e.setPersistenceDelegate(Point2D.Double.class, new Point2DDelegate());
    e.setPersistenceDelegate(QuadCurve2D.Float.class, new QuadCurve2DDelegate());
    e.setPersistenceDelegate(QuadCurve2D.Double.class, new QuadCurve2DDelegate());
    e.setPersistenceDelegate(Rectangle2D.Float.class, new Rectangle2DDelegate());
    e.setPersistenceDelegate(Rectangle2D.Double.class, new Rectangle2DDelegate());
    e.setPersistenceDelegate(RoundRectangle2D.Float.class, new RoundRectangle2DDelegate());
    e.setPersistenceDelegate(RoundRectangle2D.Double.class, new RoundRectangle2DDelegate());
    e.setPersistenceDelegate(Area.class, new AreaDelegate());
    e.setPersistenceDelegate(GeneralPath.class, new GeneralPathDelegate());
    e.setPersistenceDelegate(AffineTransform.class, new AffineTransformDelegate());
    e.setPersistenceDelegate(RadialGradientPaint.class, new RadialGradientPaintDelegate());
    e.setPersistenceDelegate(LinearGradientPaint.class, new LinearGradientPaintDelegate());
    e.setPersistenceDelegate(Insets.class, new InsetsDelegate());
    
    e.writeObject(compoundPainter);
    e.close();
}
 

开发者ID:RockManJoe64,
项目名称:swingx,
代码行数:55,
代码来源:PainterUtil.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)