1 37 38 package org.jfree.chart.renderer; 39 40 import java.io.Serializable ; 41 42 import org.jfree.ui.TextAnchor; 43 44 49 public class ItemLabelPosition implements Serializable { 50 51 52 private ItemLabelAnchor itemLabelAnchor; 53 54 55 private TextAnchor textAnchor; 56 57 58 private TextAnchor rotationAnchor; 59 60 61 private double angle; 62 63 66 public ItemLabelPosition() { 67 this(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER, TextAnchor.CENTER, 0.0); 68 } 69 70 80 public ItemLabelPosition(ItemLabelAnchor itemLabelAnchor, 81 TextAnchor textAnchor, 82 TextAnchor rotationAnchor, 83 double angle) { 84 85 this.itemLabelAnchor = itemLabelAnchor; 86 this.textAnchor = textAnchor; 87 this.rotationAnchor = rotationAnchor; 88 this.angle = angle; 89 90 } 91 92 97 public ItemLabelAnchor getItemLabelAnchor() { 98 return this.itemLabelAnchor; 99 } 100 101 106 public TextAnchor getTextAnchor() { 107 return this.textAnchor; 108 } 109 110 115 public TextAnchor getRotationAnchor() { 116 return this.rotationAnchor; 117 } 118 119 124 public double getAngle() { 125 return this.angle; 126 } 127 128 135 public boolean equals(Object object) { 136 137 if (object == null) { 138 return false; 139 } 140 141 if (object == this) { 142 return true; 143 } 144 145 if (object instanceof ItemLabelPosition) { 146 147 ItemLabelPosition p = (ItemLabelPosition) object; 148 boolean b0 = (this.itemLabelAnchor.equals(p.itemLabelAnchor)); 149 boolean b1 = (this.textAnchor.equals(p.textAnchor)); 150 boolean b2 = (this.rotationAnchor.equals(p.rotationAnchor)); 151 boolean b3 = (this.angle == p.angle); 152 return b0 && b1 && b2 && b3; 153 } 154 155 return false; 156 157 } 158 159 } 160 | Popular Tags |