本文整理汇总了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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}