@Override public Object createObject(Attributes atts) { JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2); JRDesignLine line = new JRDesignLine(jasperDesign); LineDirectionEnum direction = LineDirectionEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_direction)); if (direction != null) { line.setDirection(direction); } return line; }
@Override public Object getPropertyValue(Object id) { JRDesignLine jrElement = (JRDesignLine) getValue(); if (id.equals(JRBaseLine.PROPERTY_DIRECTION)) return directionD.getEnumValue(jrElement.getDirectionValue()); if (id.equals(JRBaseStyle.PROPERTY_FILL)) return fillD.getEnumValue(jrElement.getOwnFillValue()); return super.getPropertyValue(id); }
@Override public void setPropertyValue(Object id, Object value) { JRDesignLine jrElement = (JRDesignLine) getValue(); if (id.equals(JRBaseLine.PROPERTY_DIRECTION)) jrElement.setDirection((LineDirectionEnum) directionD.getEnumValue(value)); if (id.equals(JRBaseStyle.PROPERTY_FILL)) jrElement.setFill((FillEnum) fillD.getEnumValue(value)); else super.setPropertyValue(id, value); }
@Override public JRDesignElement createJRElement(JasperDesign jasperDesign) { JRDesignLine jrDesignLine = new JRDesignLine(jasperDesign); DefaultManager.INSTANCE.applyDefault(this.getClass(), jrDesignLine); jrDesignLine.setWidth(getDefaultWidth()); jrDesignLine.setHeight(getDefaultHeight()); return jrDesignLine; }
public JRDesignElement createReportElement(JasperDesign jd) { JRDesignElement element = new JRDesignLine();//FIXMETD why lines have empty constructor? element.setWidth(100); element.setHeight(1); return element; }
private static void addColumnHeaderToBand(ODLTableDefinition table, int elementWidth, JRDesignBand chBand) { JRDesignStaticText back = new JRDesignStaticText(); back.setBackcolor(new Color(230, 230, 230)); back.setWidth(elementWidth); back.setHeight(20); back.setMode(ModeEnum.OPAQUE); chBand.addElement(back); List<Double> colWidths = getColumnWidths(table, elementWidth); int nc = table.getColumnCount(); if (nc > 0) { double dx=0; for (int i = 0; i < nc; i++) { JRDesignStaticText text = new JRDesignStaticText(); int x = (int) Math.round(dx); text.setX(x); text.setY(4); text.setWidth((int) Math.floor(colWidths.get(i))); text.setHeight(15); text.setText(table.getColumnName(i)); text.setFontSize(11); // int fs = text.getFontSize(); text.setForecolor(new Color(0, 0, 80)); text.setBold(true); chBand.addElement(text); dx += colWidths.get(i); } } JRDesignLine line = new JRDesignLine(); // line.setX(-ret.getLeftMargin()); line.setY(19); line.setWidth(elementWidth); line.setHeight(0); line.setPositionType(PositionTypeEnum.FLOAT); chBand.addElement(line); }
/** * */ public void visitLine(JRLine line) { node = new ElementNode(jasperDesign, (JRDesignLine)line,doLkp); node.setIconBaseWithExtension(ICON_LINE); }
/** * Get the GraphicElement properties... */ public static List<Sheet.Set> getGraphicPropertySets(JRDesignGraphicElement element, JasperDesign jd) { JRDesignDataset dataset = ModelUtils.getElementDataset(element, jd); List<Sheet.Set> list = new ArrayList<Sheet.Set>(); Sheet.Set propertySet = Sheet.createPropertiesSet(); propertySet.setName("GRAPHIC_ELEMENT_PROPERTIES"); propertySet.setDisplayName("Graphic properties"); //propertySet.put(new PenProperty( element )); propertySet.put(new JRPenProperty(element.getLinePen(), element)); propertySet.put(new FillProperty( element )); list.add(propertySet); if (element instanceof JRDesignImage) { Sheet.Set imagePropertySet = Sheet.createPropertiesSet(); imagePropertySet.setName("IMAGE_ELEMENT_PROPERTIES"); imagePropertySet.setDisplayName("Image properties"); imagePropertySet.put(new ImageExpressionProperty((JRDesignImage)element, dataset)); imagePropertySet.put(new ImageExpressionClassNameProperty((JRDesignImage)element) ); imagePropertySet.put(new ScaleImageProperty( (JRDesignImage)element )); imagePropertySet.put(new HorizontalAlignmentProperty( (JRDesignImage)element )); imagePropertySet.put(new VerticalAlignmentProperty( (JRDesignImage)element )); imagePropertySet.put(new ImageUsingCacheProperty( (JRDesignImage)element )); imagePropertySet.put(new LazyProperty( (JRDesignImage)element )); imagePropertySet.put(new OnErrorTypeProperty( (JRDesignImage)element )); imagePropertySet.put(new ImageEvaluationTimeProperty((JRDesignImage)element, dataset));//, dataset)); imagePropertySet.put(new EvaluationGroupProperty((JRDesignImage)element, dataset)); list.add(imagePropertySet); } else if (element instanceof JRDesignLine) { Sheet.Set linePropertySet = Sheet.createPropertiesSet(); linePropertySet.setName("LINE_ELEMENT_PROPERTIES"); linePropertySet.setDisplayName("Line properties"); linePropertySet.put(new LineDirectionProperty( (JRDesignLine)element )); list.add(linePropertySet); } else if (element instanceof JRDesignRectangle) { Sheet.Set rectanglePropertySet = Sheet.createPropertiesSet(); rectanglePropertySet.setName("RECTANGLE_ELEMENT_PROPERTIES"); rectanglePropertySet.setDisplayName("Rectangle properties"); rectanglePropertySet.put(new RadiusProperty( (JRDesignRectangle)element )); list.add(rectanglePropertySet); } else if (element instanceof JRDesignEllipse) { // Nothing to do... } return list; }
@SuppressWarnings("unchecked") public LineDirectionProperty(JRDesignLine line) { super(LineDirectionEnum.class, line); this.line = line; }
/** * Instantiates a new m line. * * @param parent * the parent * @param jrLine * the jr line * @param newImage * the new image */ public MLine(ANode parent, JRDesignLine jrLine, int newImage) { super(parent, newImage); setValue(jrLine); }