001package armyc2.c2sd.renderer.utilities; 002 003import android.graphics.Paint; 004import android.graphics.PointF; 005import android.graphics.Rect; 006import android.graphics.RectF; 007import android.graphics.drawable.shapes.Shape; 008 009public class ModifierInfo { 010 011 private String _key = null; 012 private String _text = null; 013 private PointF _drawPoint = null; 014 private RectF _bounds = null; 015 private Paint _paint = null; 016 private Shape _shape = null; 017 018 /** 019 * 020 * @param text 021 * @param key like ModifiersTS, ModifiersUnits, MilStdAttributes 022 * @param drawPoint 023 * @param paint 024 */ 025 public ModifierInfo(String text, String key, PointF drawPoint, Paint paint) 026 { 027 _key = key; 028 _text = text; 029 _drawPoint = drawPoint; 030 _paint = paint; 031 Rect rTemp = new Rect(); 032 paint.getTextBounds(text, 0, text.length(), rTemp); 033 _bounds = new RectF(rTemp.left,rTemp.top,rTemp.width(),rTemp.height()); 034 } 035 036 public ModifierInfo(Shape shape, String key, Paint paint, RectF bounds) 037 { 038 _shape = shape; 039 _key = key; 040 _paint = paint; 041 if(bounds != null) 042 _bounds = bounds; 043 else 044 _bounds = new RectF(0,0,shape.getWidth(),shape.getWidth()); 045 } 046 047 public Paint getPaint() 048 { 049 return _paint; 050 } 051 052 public Shape getShape() 053 { 054 return _shape; 055 } 056 057 public String getKey() 058 { 059 return _key; 060 } 061 062 public String getText() 063 { 064 return _text; 065 } 066 067 public RectF getBounds() 068 { 069 return _bounds; 070 } 071 072 public PointF getDrawPoint() 073 { 074 return _drawPoint; 075 } 076 077 public void setDrawPoint(PointF value) 078 { 079 _drawPoint = value; 080 } 081}