1 19 package jcckit.graphic; 20 21 26 public class Text extends BasicGraphicalElement { 27 private final GraphPoint _position; 28 private final String _text; 29 30 31 37 public Text(GraphPoint position, String text, GraphicAttributes attributes) { 38 super(attributes); 39 _position = position; 40 _text = text; 41 } 42 43 44 public GraphPoint getPosition() { 45 return _position; 46 } 47 48 49 public String getText() { 50 return _text; 51 } 52 53 59 public void renderWith(Renderer renderer) { 60 if (renderer instanceof TextRenderer) { 61 ((TextRenderer) renderer).render(this); 62 } else { 63 throw new IllegalArgumentException (renderer 64 + " does not implements TextRenderer."); 65 } 66 } 67 } 68 | Popular Tags |