1 32 33 package it.businesslogic.ireport; 34 35 import it.businesslogic.ireport.gui.*; 36 import it.businesslogic.ireport.util.*; 37 import java.awt.*; 38 import java.awt.image.*; 39 import java.awt.geom.*; 40 41 public abstract class GraphicReportElement extends ReportElement 42 { 43 44 47 public static final String FILL = "FILL"; 48 public static final String PEN = "PEN"; 49 50 54 public static final String DEFAULT_FILL = "Solid"; 55 public static final String DEFAULT_PEN = "Thin"; 56 57 60 public GraphicReportElement(int x, int y, int width, int height) 61 { 62 super(x,y, Math.abs(width), Math.abs(height)); 63 setKey("graphic"); 68 } 69 70 public void drawObject(Graphics2D g,double zoom_factor, int x_shift_origin, int y_shift_origin) 71 { 72 super.drawGraphicsElement(g, getGraphicElementPen(), zoom_factor, x_shift_origin, y_shift_origin ); 73 } 74 75 79 public java.lang.String getFill() { 80 if (getPropertyValue(FILL) == null) 81 { 82 if (getStyle() != null) 84 { 85 return getStyle().getAttributeString( getStyle().ATTRIBUTE_fill, DEFAULT_FILL, true); 86 } 87 } 88 return getStringValue(FILL, DEFAULT_FILL ); 89 } 90 91 95 public void setFill(java.lang.String fill) { 96 setPropertyValue(FILL, fill); 97 } 98 99 103 public java.lang.String getGraphicElementPen() { 104 if (getPropertyValue(PEN) == null) 105 { 106 if (getStyle() != null) 108 { 109 return getStyle().getAttributeString( getStyle().ATTRIBUTE_pen, DEFAULT_PEN, true); 110 } 111 } 112 return getStringValue(PEN, DEFAULT_PEN ); 113 } 114 115 119 public void setGraphicElementPen(java.lang.String graphicElementPen) { 120 setPropertyValue(PEN, graphicElementPen); 121 } 122 123 public void copyBaseReportElement(ReportElement destination, ReportElement source) 124 { 125 super.copyBaseReportElement(destination, source); 126 127 if (destination instanceof GraphicReportElement && 128 source instanceof GraphicReportElement ) 129 { 130 131 destination.setPropertyValue(PEN, getPropertyValue(PEN)); 132 destination.setPropertyValue(FILL, getPropertyValue(FILL)); 133 } 137 } 138 139 public void setStyle(Style style) { 140 super.setStyle(style); 141 if (style != null) 142 { 143 } 146 } 147 } 148 149 | Popular Tags |