Java 类net.sf.jasperreports.engine.JRLine 实例源码

项目:jasperreports    文件:JRBaseObjectFactory.java   
@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);
}
项目:jasperreports    文件:JRFillObjectFactory.java   
@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);
}
项目:jasperreports    文件:LineConverter.java   
@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;
}
项目:jasperreports    文件:XmlWriterVisitor.java   
@Override
public void visitLine(JRLine line)
{
    try
    {
        xmlWriter.writeLine(line);
    }
    catch (IOException e)
    {
        throw new JRRuntimeException(e);
    }
}
项目:jasperreports    文件:JRXmlWriter.java   
/**
 *
 */
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();
}
项目:jasperreports    文件:JRApiWriter.java   
/**
 *
 */
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();
    }
}
项目:jasperreports    文件:JRTemplateLine.java   
/**
 *
 */
protected JRTemplateLine(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRLine line)
{
    super(origin, defaultStyleProvider);

    setLine(line);
}
项目:jasperreports    文件:JRTemplateLine.java   
/**
 *
 */
protected void setLine(JRLine line)
{
    super.setGraphicElement(line);

    setDirection(line.getDirectionValue());
}
项目:jasperreports    文件:JRFillLine.java   
/**
 *
 */
protected JRFillLine(
    JRBaseFiller filler,
    JRLine line, 
    JRFillObjectFactory factory
    )
{
    super(filler, line, factory);
}
项目:PDFReporter-Studio    文件:MLine.java   
@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());
    }
}
项目:PDFReporter-Studio    文件:LineFigure.java   
@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();
}
项目:jasperreports    文件:ConvertVisitor.java   
@Override
public void visitLine(JRLine line)
{
    addElement(parentFrame, LineConverter.getInstance().convert(reportConverter, line));
}
项目:jasperreports    文件:JRDelegationVisitor.java   
@Override
public void visitLine(JRLine line)
{
    visitor.visitLine(line);
}
项目:jasperreports    文件:UniformElementVisitor.java   
@Override
public void visitLine(JRLine line)
{
    visitElement(line);
}
项目:jasperreports    文件:JRApiWriter.java   
@Override
public void visitLine(JRLine line)
{
    apiWriter.writeLine(line, name);
}
项目:jasperreports    文件:JRVisitorSupport.java   
@Override
public void visitLine(JRLine line)
{
    // NOOP
}
项目:jasperreports    文件:JRFillLine.java   
@Override
public LineDirectionEnum getDirectionValue()
{
    return ((JRLine)this.parent).getDirectionValue();
}
项目:PDFReporter-Studio    文件:CustomStyleResolver.java   
/**
 * 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());
        }
    }
}
项目:ireport-fork    文件:ElementNameVisitor.java   
/**
 *
 */
public void visitLine(JRLine line)
{
    name = "[" + line.getX() + ", " + line.getY() + ", " + line.getWidth() + ", " + line.getHeight() + "]";
}
项目:ireport-fork    文件:ElementNodeVisitor.java   
/**
 *
 */
public void visitLine(JRLine line)
{
    node = new ElementNode(jasperDesign, (JRDesignLine)line,doLkp);
    node.setIconBaseWithExtension(ICON_LINE);
}
项目:ireport-fork    文件:HasExpressionVisitor.java   
/**
 *
 */
public void visitLine(JRLine line)
{
    collector.collect(line);
}
项目:ireport-fork    文件:NodeCellRenderer.java   
@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;
}
项目:jasperreports    文件:JRBaseLine.java   
/**
 * 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();
}