1 19 20 package jxl.biff; 21 22 import common.Logger; 23 import jxl.write.biff.CellValue; 24 import jxl.biff.drawing.Comment; 25 26 29 public class BaseCellFeatures 30 { 31 34 public static Logger logger = Logger.getLogger(BaseCellFeatures.class); 35 36 39 private String comment; 40 41 44 private double commentWidth; 45 46 49 private double commentHeight; 50 51 54 private Comment commentDrawing; 55 56 59 private CellValue writableCell; 60 61 private final static double defaultCommentWidth = 3; 63 private final static double defaultCommentHeight = 4; 64 65 68 protected BaseCellFeatures() 69 { 70 } 71 72 77 public BaseCellFeatures(BaseCellFeatures cf) 78 { 79 comment = cf.comment; 80 commentWidth = cf.commentWidth; 81 commentHeight = cf.commentHeight; 82 } 83 84 87 protected String getComment() 88 { 89 return comment; 90 } 91 92 95 public double getCommentWidth() 96 { 97 return commentWidth; 98 } 99 100 103 public double getCommentHeight() 104 { 105 return commentHeight; 106 } 107 108 113 public final void setWritableCell(CellValue wc) 114 { 115 writableCell = wc; 116 } 117 118 121 public void setReadComment(String s, double w, double h) 122 { 123 comment = s; 124 commentWidth = w; 125 commentHeight = h; 126 } 127 128 133 public void setComment(String s) 134 { 135 setComment(s, defaultCommentWidth, defaultCommentHeight); 136 } 137 138 145 public void setComment(String s, double width, double height) 146 { 147 comment = s; 148 commentWidth = width; 149 commentHeight = height; 150 151 if (commentDrawing != null) 152 { 153 commentDrawing.setCommentText(s); 154 commentDrawing.setWidth(width); 155 commentDrawing.setWidth(height); 156 } 158 } 159 160 163 public final void setCommentDrawing(Comment c) 164 { 165 commentDrawing = c; 166 } 167 168 171 public final Comment getCommentDrawing() 172 { 173 return commentDrawing; 174 } 175 } 176 | Popular Tags |