@Override public void visitRectangle(JRRectangle rectangle) { JRBaseRectangle baseRectangle = null; if (rectangle != null) { baseRectangle = (JRBaseRectangle)get(rectangle); if (baseRectangle == null) { baseRectangle = new JRBaseRectangle(rectangle, this); } } setVisitResult(baseRectangle); }
@Override public void visitRectangle(JRRectangle rectangle) { JRFillRectangle fillRectangle = null; if (rectangle != null) { fillRectangle = (JRFillRectangle)get(rectangle); if (fillRectangle == null) { fillRectangle = new JRFillRectangle(filler, rectangle, this); } } setVisitResult(fillRectangle); }
@Override public JRPrintElement convert(ReportConverter reportConverter, JRElement element) { JRBasePrintRectangle printRectangle = new JRBasePrintRectangle(reportConverter.getDefaultStyleProvider()); JRRectangle rectangle = (JRRectangle)element; copyGraphicElement(reportConverter, rectangle, printRectangle); printRectangle.setRadius(rectangle.getOwnRadius()); return printRectangle; }
@Override public void visitRectangle(JRRectangle rectangle) { try { xmlWriter.writeRectangle(rectangle); } catch (IOException e) { throw new JRRuntimeException(e); } }
/** * */ public void writeRectangle(JRRectangle rectangle) throws IOException { writer.startElement(JRXmlConstants.ELEMENT_rectangle, getNamespace()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_radius, rectangle.getOwnRadius()); writeReportElement(rectangle); writeGraphicElement(rectangle); writer.closeElement(); }
/** * */ public void writeRectangle( JRRectangle rectangle, String rectangleName) { if(rectangle != null) { write( "JRDesignRectangle " + rectangleName + " = new JRDesignRectangle(jasperDesign);\n"); write( rectangleName + ".setRadius({0});\n", rectangle.getOwnRadius()); writeReportElement( rectangle, rectangleName); writeGraphicElement( rectangle, rectangleName); flush(); } }
/** * */ protected JRFillRectangle( JRBaseFiller filler, JRRectangle rectangle, JRFillObjectFactory factory ) { super(filler, rectangle, factory); }
/** * */ protected JRTemplateRectangle(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRRectangle rectangle) { super(origin, defaultStyleProvider); setRectangle(rectangle); }
/** * */ protected void setRectangle(JRRectangle rectangle) { super.setGraphicElement(rectangle); setRadius(rectangle.getRadius()); }
@Override public void trasnferProperties(JRElement target){ super.trasnferProperties(target); JRRectangle jrSource = (JRRectangle) getValue(); if (jrSource != null){ JRRectangle jrTarget = (JRRectangle)target; jrTarget.setFill(jrSource.getOwnFillValue()); jrTarget.setRadius(jrSource.getOwnRadius()); } }
@Override protected void draw(JSSDrawVisitor drawVisitor, JRElement jrElement) { if (cachedGraphics == null || model.hasChangedProperty()){ model.setChangedProperty(false); Graphics2D oldGraphics = drawVisitor.getGraphics2d(); cachedGraphics = new StackGraphics2D(oldGraphics); drawVisitor.setGraphics2D(cachedGraphics); drawVisitor.visitRectangle((JRRectangle) jrElement); drawVisitor.setGraphics2D(oldGraphics); } cachedGraphics.setRealDrawer(drawVisitor.getGraphics2d()); cachedGraphics.paintStack(); }
/** * */ public void visitRectangle(JRRectangle rectangle) { node = new ElementNode(jasperDesign, (JRDesignRectangle)rectangle,doLkp); if (rectangle.getRadius() > 0) node.setIconBaseWithExtension(ICON_ROUND_RECTANGLE); else node.setIconBaseWithExtension(ICON_RECTANGLE); }
@Override public void visitRectangle(JRRectangle rectangle) { addElement(parentFrame, RectangleConverter.getInstance().convert(reportConverter, rectangle)); }
@Override public void visitRectangle(JRRectangle rectangle) { visitor.visitRectangle(rectangle); }
@Override public void visitRectangle(JRRectangle rectangle) { visitElement(rectangle); }
@Override public void visitRectangle(JRRectangle rectangle) { apiWriter.writeRectangle(rectangle, name); }
@Override public void visitRectangle(JRRectangle rectangle) { // NOOP }
@Override public Integer getOwnRadius() { return providerStyle == null || providerStyle.getOwnRadius() == null ? ((JRRectangle)this.parent).getOwnRadius() : providerStyle.getOwnRadius(); }
/** * When an element is imported this allow to copy inside the element the attribute of its style, if any. But * this dosent copy inside the element the default properties */ public static void copyInheritedAttributes(MGraphicElement sourceModel, JRDesignElement jrTarget){ JRDesignElement jrSource = sourceModel.getValue(); JRStyle style = JRStyleResolver.getBaseStyle(jrSource); if (style != null){ if (jrSource.getOwnBackcolor() == null) jrTarget.setBackcolor(style.getBackcolor()); if (jrSource.getOwnForecolor() == null) jrTarget.setForecolor(style.getForecolor()); if (jrSource.getOwnModeValue() == null) jrTarget.setMode(style.getModeValue()); if (sourceModel instanceof MGraphicElementLineBox){ copyIntheritedLineBox(jrTarget, style); } if (sourceModel instanceof MGraphicElementLinePen){ JRDesignGraphicElement jrTargetPenContainer = (JRDesignGraphicElement) jrTarget; inheritLinePenProeprties(jrTargetPenContainer.getLinePen(), style.getLinePen()); } if (sourceModel instanceof MTextElement){ copyInheritedTextualAttributes(jrTarget, style); } if (sourceModel instanceof MTextField){ copyInheritedTextFieldAttributes(jrTarget, style); } if (sourceModel instanceof MImage){ copyInheritedImageAttributes(jrTarget, style); } if (sourceModel instanceof MEllipse){ JREllipse jrEllipse = (JREllipse) jrTarget; if (jrEllipse.getOwnFillValue() == null) jrEllipse.setFill(style.getFillValue()); } if (sourceModel instanceof MLine){ JRLine jrLine = (JRLine) jrTarget; if (jrLine.getOwnFillValue() == null) jrLine.setFill(style.getFillValue()); } if (sourceModel instanceof MRectangle){ JRRectangle jrRectangle = (JRRectangle) jrTarget; if (jrRectangle.getOwnFillValue() == null) jrRectangle.setFill(style.getFillValue()); if (jrRectangle.getOwnRadius() == null) jrRectangle.setRadius(style.getRadius()); } } }
/** * */ public void visitRectangle(JRRectangle rectangle) { name = "[" + rectangle.getX() + ", " + rectangle.getY() + ", " + rectangle.getWidth() + ", " + rectangle.getHeight() + "]"; }
/** * */ public void visitRectangle(JRRectangle rectangle) { collector.collect(rectangle); }
@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JLabel label = (JLabel)super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); label.setIcon(null); if (value instanceof Node) { Node node = (Node)value; String text = node.getDisplayName(); if (node instanceof ElementNode) { text = ""; JRDesignElement element = ((ElementNode)node).getElement(); if (element instanceof JRBreak) text += "Break"; if (element instanceof JRChart) text += "Chart"; if (element instanceof JRCrosstab) text += "Crosstab"; if (element instanceof JRElementGroup) text += "Element Group"; if (element instanceof JREllipse) text += "Ellipse"; if (element instanceof JRFrame) text += "Frame"; if (element instanceof JRImage) text += "Image"; if (element instanceof JRLine) text += "Line"; if (element instanceof JRRectangle) text += "Rectangle"; if (element instanceof JRStaticText) text += "Static Text"; if (element instanceof JRSubreport) text += "Subreport"; if (element instanceof JRTextField) text += "Text Field"; JRElementGroup parent = ModelUtils.getTopElementGroup(element); if (parent != null && parent instanceof JRDesignBand) text += " in band " + ModelUtils.nameOf(((JRDesignBand)parent).getOrigin()); else if (parent != null && parent instanceof JRDesignCellContents) text += " in cell " + ModelUtils.nameOf(((JRDesignCellContents)parent).getOrigin()); text += " " + node.getDisplayName(); } label.setText(text); label.setIcon( new ImageIcon(node.getIcon(BeanInfo.ICON_COLOR_16x16))); } else if (value instanceof JRDesignExpression) { JRDesignExpression exp = (JRDesignExpression)value; label.setText(exp.getText()); label.setIcon(expressionIcon); } return label; }
/** * Initializes properties that are specific to rectangles. Common properties are initialized by its * parent constructors. * @param rectangle an element whose properties are copied to this element. Usually it is a * {@link net.sf.jasperreports.engine.design.JRDesignRectangle} that must be transformed into an * <tt>JRBaseRectangle</tt> at compile time. * @param factory a factory used in the compile process */ protected JRBaseRectangle(JRRectangle rectangle, JRBaseObjectFactory factory) { super(rectangle, factory); radius = rectangle.getOwnRadius(); }