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

项目:jasperreports    文件:JRBaseObjectFactory.java   
@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);
}
项目:jasperreports    文件:JRFillObjectFactory.java   
@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);
}
项目:jasperreports    文件:RectangleConverter.java   
@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;
}
项目:jasperreports    文件:XmlWriterVisitor.java   
@Override
public void visitRectangle(JRRectangle rectangle)
{
    try
    {
        xmlWriter.writeRectangle(rectangle);
    }
    catch (IOException e)
    {
        throw new JRRuntimeException(e);
    }
}
项目:jasperreports    文件:JRXmlWriter.java   
/**
 *
 */
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();
}
项目:jasperreports    文件:JRApiWriter.java   
/**
 *
 */
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();
    }
}
项目:jasperreports    文件:JRFillRectangle.java   
/**
 *
 */
protected JRFillRectangle(
    JRBaseFiller filler,
    JRRectangle rectangle, 
    JRFillObjectFactory factory
    )
{
    super(filler, rectangle, factory);
}
项目:jasperreports    文件:JRTemplateRectangle.java   
/**
 *
 */
protected JRTemplateRectangle(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRRectangle rectangle)
{
    super(origin, defaultStyleProvider);

    setRectangle(rectangle);
}
项目:jasperreports    文件:JRTemplateRectangle.java   
/**
 *
 */
protected void setRectangle(JRRectangle rectangle)
{
    super.setGraphicElement(rectangle);

    setRadius(rectangle.getRadius());
}
项目:PDFReporter-Studio    文件:MRectangle.java   
@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());
    }
}
项目:PDFReporter-Studio    文件:RectangleFigure.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.visitRectangle((JRRectangle) jrElement);
        drawVisitor.setGraphics2D(oldGraphics);
    }
    cachedGraphics.setRealDrawer(drawVisitor.getGraphics2d());
    cachedGraphics.paintStack();
}
项目:ireport-fork    文件:ElementNodeVisitor.java   
/**
 *
 */
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);
}
项目:jasperreports    文件:ConvertVisitor.java   
@Override
public void visitRectangle(JRRectangle rectangle)
{
    addElement(parentFrame, RectangleConverter.getInstance().convert(reportConverter, rectangle));
}
项目:jasperreports    文件:JRDelegationVisitor.java   
@Override
public void visitRectangle(JRRectangle rectangle)
{
    visitor.visitRectangle(rectangle);
}
项目:jasperreports    文件:UniformElementVisitor.java   
@Override
public void visitRectangle(JRRectangle rectangle)
{
    visitElement(rectangle);
}
项目:jasperreports    文件:JRApiWriter.java   
@Override
public void visitRectangle(JRRectangle rectangle)
{
    apiWriter.writeRectangle(rectangle, name);
}
项目:jasperreports    文件:JRVisitorSupport.java   
@Override
public void visitRectangle(JRRectangle rectangle)
{
    // NOOP
}
项目:jasperreports    文件:JRFillRectangle.java   
@Override
public Integer getOwnRadius()
{
    return providerStyle == null || providerStyle.getOwnRadius() == null ? ((JRRectangle)this.parent).getOwnRadius() : providerStyle.getOwnRadius();
}
项目: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 visitRectangle(JRRectangle rectangle)
{
    name = "[" + rectangle.getX() + ", " + rectangle.getY() + ", " + rectangle.getWidth() + ", " + rectangle.getHeight() + "]";
}
项目:ireport-fork    文件:HasExpressionVisitor.java   
/**
 *
 */
public void visitRectangle(JRRectangle rectangle)
{
    collector.collect(rectangle);
}
项目: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    文件:JRBaseRectangle.java   
/**
 * 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();
}