@Override public void visitLine(JRLine line) { JRBaseLine baseLine = null; if (line != null) { baseLine = (JRBaseLine)get(line); if (baseLine == null) { baseLine = new JRBaseLine(line, this); } } setVisitResult(baseLine); }
@Override public void visitLine(JRLine line) { JRFillLine fillLine = null; if (line != null) { fillLine = (JRFillLine)get(line); if (fillLine == null) { fillLine = new JRFillLine(filler, line, this); } } setVisitResult(fillLine); }
@Override public JRPrintElement convert(ReportConverter reportConverter, JRElement element) { JRBasePrintLine printLine = new JRBasePrintLine(reportConverter.getDefaultStyleProvider()); JRLine line = (JRLine)element; copyGraphicElement(reportConverter, line, printLine); printLine.setDirection(line.getDirectionValue()); return printLine; }
@Override public void visitLine(JRLine line) { try { xmlWriter.writeLine(line); } catch (IOException e) { throw new JRRuntimeException(e); } }
/** * */ public void writeLine(JRLine line) throws IOException { writer.startElement(JRXmlConstants.ELEMENT_line, getNamespace()); writer.addAttribute(JRXmlConstants.ATTRIBUTE_direction, line.getDirectionValue(), LineDirectionEnum.TOP_DOWN); writeReportElement(line); writeGraphicElement(line); writer.closeElement(); }
/** * */ public void writeLine( JRLine line, String lineName) { if(line != null) { write( "JRDesignLine " + lineName + " = new JRDesignLine(jasperDesign);\n"); write( lineName + ".setDirection({0});\n", line.getDirectionValue(), LineDirectionEnum.TOP_DOWN); writeReportElement( line, lineName); writeGraphicElement( line, lineName); flush(); } }
/** * */ protected JRTemplateLine(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRLine line) { super(origin, defaultStyleProvider); setLine(line); }
/** * */ protected void setLine(JRLine line) { super.setGraphicElement(line); setDirection(line.getDirectionValue()); }
/** * */ protected JRFillLine( JRBaseFiller filler, JRLine line, JRFillObjectFactory factory ) { super(filler, line, factory); }
@Override public void trasnferProperties(JRElement target){ super.trasnferProperties(target); JRLine jrSource = (JRLine) getValue(); if (jrSource != null){ JRLine jrTarget = (JRLine)target; jrTarget.setFill(jrSource.getOwnFillValue()); jrTarget.setDirection(jrSource.getDirectionValue()); } }
@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.visitLine((JRLine) jrElement); drawVisitor.setGraphics2D(oldGraphics); } cachedGraphics.setRealDrawer(drawVisitor.getGraphics2d()); cachedGraphics.paintStack(); }
@Override public void visitLine(JRLine line) { addElement(parentFrame, LineConverter.getInstance().convert(reportConverter, line)); }
@Override public void visitLine(JRLine line) { visitor.visitLine(line); }
@Override public void visitLine(JRLine line) { visitElement(line); }
@Override public void visitLine(JRLine line) { apiWriter.writeLine(line, name); }
@Override public void visitLine(JRLine line) { // NOOP }
@Override public LineDirectionEnum getDirectionValue() { return ((JRLine)this.parent).getDirectionValue(); }
/** * 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 visitLine(JRLine line) { name = "[" + line.getX() + ", " + line.getY() + ", " + line.getWidth() + ", " + line.getHeight() + "]"; }
/** * */ public void visitLine(JRLine line) { node = new ElementNode(jasperDesign, (JRDesignLine)line,doLkp); node.setIconBaseWithExtension(ICON_LINE); }
/** * */ public void visitLine(JRLine line) { collector.collect(line); }
@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 lines. Common properties are initialized by its * parent constructors. * @param line an element whose properties are copied to this element. Usually it is a * {@link net.sf.jasperreports.engine.design.JRDesignLine} that must be transformed into an * <tt>JRBaseLine</tt> at compile time. * @param factory a factory used in the compile process */ protected JRBaseLine(JRLine line, JRBaseObjectFactory factory) { super(line, factory); directionValue = line.getDirectionValue(); }