当前位置: 首页>>代码示例>>Java>>正文


Java AttributedStringUtilities类代码示例

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


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

示例1: testAttributedStringSerialization3

import org.jfree.util.AttributedStringUtilities; //导入依赖的package包/类
/**
 * Tests the serialization of an {@link AttributedString}.
 */
public void testAttributedStringSerialization3() {
    AttributedString s1 = new AttributedString("ABC");
    s1.addAttribute(TextAttribute.LANGUAGE, "English");
    AttributedString s2 = null;
    try {
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(buffer);
        SerialUtilities.writeAttributedString(s1, out);
        out.close();

        ByteArrayInputStream bais = new ByteArrayInputStream(
                buffer.toByteArray());
        ObjectInputStream in = new ObjectInputStream(bais);
        s2 = SerialUtilities.readAttributedString(in);
        in.close();
    }
    catch (Exception e) {
        e.printStackTrace();
    }
    assertTrue(AttributedStringUtilities.equal(s1, s2));
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:25,代码来源:SerialUtilitiesTest.java

示例2: testAttributedStringSerialization1

import org.jfree.util.AttributedStringUtilities; //导入依赖的package包/类
/**
 * Tests the serialization of an {@link AttributedString}.
 */
public void testAttributedStringSerialization1() {
    AttributedString s1 = new AttributedString("");
    AttributedString s2 = null;
    try {
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(buffer);
        SerialUtilities.writeAttributedString(s1, out);
        out.close();

        ByteArrayInputStream bais = new ByteArrayInputStream(
            buffer.toByteArray()
        );
        ObjectInputStream in = new ObjectInputStream(bais);
        s2 = SerialUtilities.readAttributedString(in);
        in.close();
    }
    catch (Exception e) {
        e.printStackTrace();
    }
    assertTrue(AttributedStringUtilities.equal(s1, s2));
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:25,代码来源:SerialUtilitiesTest.java

示例3: testAttributedStringSerialization2

import org.jfree.util.AttributedStringUtilities; //导入依赖的package包/类
/**
 * Tests the serialization of an {@link AttributedString}.
 */
public void testAttributedStringSerialization2() {
    AttributedString s1 = new AttributedString("ABC");
    AttributedString s2 = null;
    try {
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(buffer);
        SerialUtilities.writeAttributedString(s1, out);
        out.close();

        ByteArrayInputStream bais = new ByteArrayInputStream(
                buffer.toByteArray());
        ObjectInputStream in = new ObjectInputStream(bais);
        s2 = SerialUtilities.readAttributedString(in);
        in.close();
    }
    catch (Exception e) {
        e.printStackTrace();
    }
    assertTrue(AttributedStringUtilities.equal(s1, s2));
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:24,代码来源:SerialUtilitiesTest.java

示例4: testEqual

import org.jfree.util.AttributedStringUtilities; //导入依赖的package包/类
/**
 * Some checks for the equal(AttributedString, AttributedString) method.
 */
public void testEqual() {
    assertTrue(AttributedStringUtilities.equal(null, null));
  
    AttributedString s1 = new AttributedString("ABC");
    assertFalse(AttributedStringUtilities.equal(s1, null));
    assertFalse(AttributedStringUtilities.equal(null, s1));
    
    AttributedString s2 = new AttributedString("ABC");
    assertTrue(AttributedStringUtilities.equal(s1, s2));
    
    s1.addAttribute(TextAttribute.BACKGROUND, Color.blue, 1, 2);
    assertFalse(AttributedStringUtilities.equal(s1, s2));
    s2.addAttribute(TextAttribute.BACKGROUND, Color.blue, 1, 2);
    assertTrue(AttributedStringUtilities.equal(s1, s2));
}
 
开发者ID:nologic,项目名称:nabs,代码行数:19,代码来源:AttributedStringUtilitiesTests.java

示例5: testAttributedStringSerialization2

import org.jfree.util.AttributedStringUtilities; //导入依赖的package包/类
/**
 * Tests the serialization of an {@link AttributedString}.
 */
public void testAttributedStringSerialization2() {
    AttributedString s1 = new AttributedString("ABC");
    AttributedString s2 = null;
    try {
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(buffer);
        SerialUtilities.writeAttributedString(s1, out);
        out.close();

        ByteArrayInputStream bais = new ByteArrayInputStream(
            buffer.toByteArray()
        );
        ObjectInputStream in = new ObjectInputStream(bais);
        s2 = SerialUtilities.readAttributedString(in);
        in.close();
    }
    catch (Exception e) {
        e.printStackTrace();
    }
    assertTrue(AttributedStringUtilities.equal(s1, s2));
}
 
开发者ID:nologic,项目名称:nabs,代码行数:25,代码来源:SerialUtilitiesTests.java

示例6: testAttributedStringSerialization3

import org.jfree.util.AttributedStringUtilities; //导入依赖的package包/类
/**
 * Tests the serialization of an {@link AttributedString}.
 */
public void testAttributedStringSerialization3() {
    AttributedString s1 = new AttributedString("ABC");
    s1.addAttribute(TextAttribute.LANGUAGE, "English");
    AttributedString s2 = null;
    try {
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(buffer);
        SerialUtilities.writeAttributedString(s1, out);
        out.close();

        ByteArrayInputStream bais = new ByteArrayInputStream(
            buffer.toByteArray()
        );
        ObjectInputStream in = new ObjectInputStream(bais);
        s2 = SerialUtilities.readAttributedString(in);
        in.close();
    }
    catch (Exception e) {
        e.printStackTrace();
    }
    assertTrue(AttributedStringUtilities.equal(s1, s2));
}
 
开发者ID:nologic,项目名称:nabs,代码行数:26,代码来源:SerialUtilitiesTests.java

示例7: equals

import org.jfree.util.AttributedStringUtilities; //导入依赖的package包/类
/**
 * Tests this item for equality with an arbitrary object.
 * 
 * @param obj  the object (<code>null</code> permitted).
 * 
 * @return A boolean.
 */
public boolean equals(Object obj) {
    if (obj == this) {
        return true;   
    }
    if (!(obj instanceof LegendItem)) {
            return false;
    }
    LegendItem that = (LegendItem) obj;
    if (this.datasetIndex != that.datasetIndex) {
        return false;
    }
    if (this.series != that.series) {
        return false;
    }
    if (!this.label.equals(that.label)) {
        return false;
    }
    if (!AttributedStringUtilities.equal(this.attributedLabel, 
            that.attributedLabel)) {
        return false;
    }
    if (!ObjectUtilities.equal(this.description, that.description)) {
        return false;
    }
    if (this.shapeVisible != that.shapeVisible) {
        return false;
    }
    if (!ShapeUtilities.equal(this.shape, that.shape)) {
        return false;
    }
    if (this.shapeFilled != that.shapeFilled) {
        return false;
    }
    if (!this.fillPaint.equals(that.fillPaint)) {
        return false;   
    }
    if (!ObjectUtilities.equal(this.fillPaintTransformer, 
            that.fillPaintTransformer)) {
        return false;
    }
    if (this.shapeOutlineVisible != that.shapeOutlineVisible) {
        return false;
    }
    if (!this.outlineStroke.equals(that.outlineStroke)) {
        return false;   
    }
    if (!this.outlinePaint.equals(that.outlinePaint)) {
        return false;   
    }
    if (!this.lineVisible == that.lineVisible) {
        return false;
    }
    if (!ShapeUtilities.equal(this.line, that.line)) {
        return false;
    }
    if (!this.lineStroke.equals(that.lineStroke)) {
        return false;   
    }
    if (!this.linePaint.equals(that.linePaint)) {
        return false;
    }
    return true;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:71,代码来源:LegendItem.java

示例8: equals

import org.jfree.util.AttributedStringUtilities; //导入依赖的package包/类
/**
 * Tests this item for equality with an arbitrary object.
 *
 * @param obj  the object (<code>null</code> permitted).
 *
 * @return A boolean.
 */
@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof LegendItem)) {
        return false;
    }
    LegendItem that = (LegendItem) obj;
    if (this.datasetIndex != that.datasetIndex) {
        return false;
    }
    if (this.series != that.series) {
        return false;
    }
    if (!this.label.equals(that.label)) {
        return false;
    }
    if (!AttributedStringUtilities.equal(this.attributedLabel,
            that.attributedLabel)) {
        return false;
    }
    if (!ObjectUtilities.equal(this.description, that.description)) {
        return false;
    }
    if (this.shapeVisible != that.shapeVisible) {
        return false;
    }
    if (!ShapeUtilities.equal(this.shape, that.shape)) {
        return false;
    }
    if (this.shapeFilled != that.shapeFilled) {
        return false;
    }
    if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {
        return false;
    }
    if (!ObjectUtilities.equal(this.fillPaintTransformer,
            that.fillPaintTransformer)) {
        return false;
    }
    if (this.shapeOutlineVisible != that.shapeOutlineVisible) {
        return false;
    }
    if (!this.outlineStroke.equals(that.outlineStroke)) {
        return false;
    }
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {
        return false;
    }
    if (!this.lineVisible == that.lineVisible) {
        return false;
    }
    if (!ShapeUtilities.equal(this.line, that.line)) {
        return false;
    }
    if (!this.lineStroke.equals(that.lineStroke)) {
        return false;
    }
    if (!PaintUtilities.equal(this.linePaint, that.linePaint)) {
        return false;
    }
    if (!ObjectUtilities.equal(this.labelFont, that.labelFont)) {
        return false;
    }
    if (!PaintUtilities.equal(this.labelPaint, that.labelPaint)) {
        return false;
    }
    return true;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:78,代码来源:LegendItem.java

示例9: equals

import org.jfree.util.AttributedStringUtilities; //导入依赖的package包/类
/**
 * Tests this item for equality with an arbitrary object.
 *
 * @param obj  the object (<code>null</code> permitted).
 *
 * @return A boolean.
 */
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof LegendItem)) {
            return false;
    }
    LegendItem that = (LegendItem) obj;
    if (this.datasetIndex != that.datasetIndex) {
        return false;
    }
    if (this.series != that.series) {
        return false;
    }
    if (!this.label.equals(that.label)) {
        return false;
    }
    if (!AttributedStringUtilities.equal(this.attributedLabel,
            that.attributedLabel)) {
        return false;
    }
    if (!ObjectUtilities.equal(this.description, that.description)) {
        return false;
    }
    if (this.shapeVisible != that.shapeVisible) {
        return false;
    }
    if (!ShapeUtilities.equal(this.shape, that.shape)) {
        return false;
    }
    if (this.shapeFilled != that.shapeFilled) {
        return false;
    }
    if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {
        return false;
    }
    if (!ObjectUtilities.equal(this.fillPaintTransformer,
            that.fillPaintTransformer)) {
        return false;
    }
    if (this.shapeOutlineVisible != that.shapeOutlineVisible) {
        return false;
    }
    if (!this.outlineStroke.equals(that.outlineStroke)) {
        return false;
    }
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {
        return false;
    }
    if (!this.lineVisible == that.lineVisible) {
        return false;
    }
    if (!ShapeUtilities.equal(this.line, that.line)) {
        return false;
    }
    if (!this.lineStroke.equals(that.lineStroke)) {
        return false;
    }
    if (!PaintUtilities.equal(this.linePaint, that.linePaint)) {
        return false;
    }
    if (!ObjectUtilities.equal(this.labelFont, that.labelFont)) {
        return false;
    }
    if (!PaintUtilities.equal(this.labelPaint, that.labelPaint)) {
        return false;
    }
    return true;
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:77,代码来源:LegendItem.java

示例10: equals

import org.jfree.util.AttributedStringUtilities; //导入依赖的package包/类
/**
 * Tests this item for equality with an arbitrary object.
 *
 * @param obj  the object (<code>null</code> permitted).
 *
 * @return A boolean.
 */
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof LegendItem)) {
        return false;
    }
    LegendItem that = (LegendItem) obj;
    if (this.datasetIndex != that.datasetIndex) {
        return false;
    }
    if (this.series != that.series) {
        return false;
    }
    if (!this.label.equals(that.label)) {
        return false;
    }
    if (!AttributedStringUtilities.equal(this.attributedLabel,
            that.attributedLabel)) {
        return false;
    }
    if (!ObjectUtilities.equal(this.description, that.description)) {
        return false;
    }
    if (this.shapeVisible != that.shapeVisible) {
        return false;
    }
    if (!ShapeUtilities.equal(this.shape, that.shape)) {
        return false;
    }
    if (this.shapeFilled != that.shapeFilled) {
        return false;
    }
    if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) {
        return false;
    }
    if (!ObjectUtilities.equal(this.fillPaintTransformer,
            that.fillPaintTransformer)) {
        return false;
    }
    if (this.shapeOutlineVisible != that.shapeOutlineVisible) {
        return false;
    }
    if (!this.outlineStroke.equals(that.outlineStroke)) {
        return false;
    }
    if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {
        return false;
    }
    if (!this.lineVisible == that.lineVisible) {
        return false;
    }
    if (!ShapeUtilities.equal(this.line, that.line)) {
        return false;
    }
    if (!this.lineStroke.equals(that.lineStroke)) {
        return false;
    }
    if (!PaintUtilities.equal(this.linePaint, that.linePaint)) {
        return false;
    }
    if (!ObjectUtilities.equal(this.labelFont, that.labelFont)) {
        return false;
    }
    if (!PaintUtilities.equal(this.labelPaint, that.labelPaint)) {
        return false;
    }
    return true;
}
 
开发者ID:pablopatarca,项目名称:proyecto-teoria-control-utn-frro,代码行数:77,代码来源:LegendItem.java


注:本文中的org.jfree.util.AttributedStringUtilities类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。