Java 类net.sf.jasperreports.engine.type.PositionTypeEnum 实例源码

项目:dynamicreports-jasper    文件:Component3Test.java   
@Override
public void test() {
    super.test();

    numberOfPagesTest(1);

    JRElement textField = getJasperReport().getTitle().getElementByKey("title.textField1");
    Assert.assertEquals("position type", PositionTypeEnum.FIX_RELATIVE_TO_TOP, textField.getPositionTypeValue());
    Assert.assertEquals("stretch type", StretchTypeEnum.NO_STRETCH, textField.getStretchTypeValue());
    Assert.assertTrue("print in first whole band", textField.isPrintInFirstWholeBand());
    Assert.assertTrue("print when detail overflows", textField.isPrintWhenDetailOverflows());
    Assert.assertEquals("print when group changes", "group1", textField.getPrintWhenGroupChanges().getName());

    textField = getJasperReport().getDetailSection().getBands()[0].getElementByKey("detail.column_column11");
    Assert.assertTrue("print when detail overflows", textField.isPrintWhenDetailOverflows());
}
项目:jasperreports    文件:JRBaseElement.java   
@Override
public void setPositionType(PositionTypeEnum positionTypeValue)
{
    PositionTypeEnum old = this.positionTypeValue;
    this.positionTypeValue = positionTypeValue;
    getEventSupport().firePropertyChange(PROPERTY_POSITION_TYPE, old, this.positionTypeValue);
}
项目:jasperreports    文件:JRBaseElement.java   
@SuppressWarnings("deprecation")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
    in.defaultReadObject();

    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2)
    {
        modeValue = ModeEnum.getByValue(mode);
        positionTypeValue = PositionTypeEnum.getByValue(positionType);
        stretchTypeValue = StretchTypeEnum.getByValue(stretchType);

        mode = null;
    }
}
项目:jasperreports    文件:JRXmlWriter.java   
/**
 *
 */
private void writeReportElement(JRElement element) throws IOException
{
    writer.startElement(JRXmlConstants.ELEMENT_reportElement);
    writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_key, element.getKey());
    writeStyleReferenceAttr(element);
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_positionType, element.getPositionTypeValue(), PositionTypeEnum.FIX_RELATIVE_TO_TOP);
    writeStretchType(element.getStretchTypeValue());
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_isPrintRepeatedValues, element.isPrintRepeatedValues(), true);
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_mode, element.getOwnModeValue());

    writer.addAttribute(JRXmlConstants.ATTRIBUTE_x, element.getX());
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_y, element.getY());
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_width, element.getWidth());
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_height, element.getHeight());
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_isRemoveLineWhenBlank, element.isRemoveLineWhenBlank(), false);
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_isPrintInFirstWholeBand, element.isPrintInFirstWholeBand(), false);
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_isPrintWhenDetailOverflows, element.isPrintWhenDetailOverflows(), false);

    if (element.getPrintWhenGroupChanges() != null)
    {
        writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_printWhenGroupChanges, element.getPrintWhenGroupChanges().getName());
    }

    writer.addAttribute(JRXmlConstants.ATTRIBUTE_forecolor, element.getOwnForecolor());
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_backcolor, element.getOwnBackcolor());

    if (
        isNewerVersionOrEqual(JRConstants.VERSION_4_6_0)
        && !isExcludeUuids()
        )
    {
        writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_uuid, element.getUUID().toString());
    }

    writeProperties(element);
    writePropertyExpressions(element.getPropertyExpressions());
    writeExpression(JRXmlConstants.ELEMENT_printWhenExpression, element.getPrintWhenExpression(), false);
    writer.closeElement();
}
项目:jasperreports    文件:JRDesignElement.java   
/**
 *
 */
protected JRDesignElement(JRDefaultStyleProvider defaultStyleProvider)
{
    super(defaultStyleProvider);

    positionTypeValue = PositionTypeEnum.FIX_RELATIVE_TO_TOP;
}
项目:jasperreports    文件:JRFillElementContainer.java   
/**
 *
 */
private void setDependentElements()
{
    if (ySortedElements != null && ySortedElements.length > 0)
    {
        for(int i = 0; i < ySortedElements.length - 1; i++)
        {
            JRFillElement iElem = ySortedElements[i];
            boolean isBreakElem = iElem instanceof JRFillBreak;

            for(int j = i + 1; j < ySortedElements.length; j++)
            {
                JRFillElement jElem = ySortedElements[j];

                int left = Math.min(iElem.getX(), jElem.getX());
                int right = Math.max(iElem.getX() + iElem.getWidth(), jElem.getX() + jElem.getWidth());

                if (
                    ((isBreakElem && jElem.getPositionTypeValue() == PositionTypeEnum.FIX_RELATIVE_TO_TOP) || jElem.getPositionTypeValue() == PositionTypeEnum.FLOAT) &&
                    iElem.getY() + iElem.getHeight() <= jElem.getY() &&
                    iElem.getWidth() + jElem.getWidth() > right - left // FIXME band bottom elements should not have dependent elements
                    )
                {
                    iElem.addDependantElement(jElem);
                }
            }

            /*
            if (iElem.getParent().getElementGroup() != null) //parent might be null
            {
                iElem.setGroupElements(
                    iElem.getParent().getElementGroup().getElements()
                    );
            }
            */
        }
    }
}
项目:ireport-fork    文件:PositionTypeProperty.java   
@Override
public List getTagList() 
{
    List tags = new java.util.ArrayList();
    tags.add(new Tag(PositionTypeEnum.FIX_RELATIVE_TO_TOP, I18n.getString("Global.Property.FixTop")));
    tags.add(new Tag(PositionTypeEnum.FLOAT, I18n.getString("Global.Property.PositionFloat")));
    tags.add(new Tag(PositionTypeEnum.FIX_RELATIVE_TO_BOTTOM, I18n.getString("Global.Property.FixBottom")));
    return tags;
}
项目:com.opendoorlogistics    文件:ReportBuilderUtils.java   
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);
}
项目:jasperreports    文件:JRBaseElement.java   
@Override
public PositionTypeEnum getPositionTypeValue()
{
    return positionTypeValue;
}
项目:jasperreports    文件:ElementDecorator.java   
@Override
public PositionTypeEnum getPositionTypeValue()
{
    return element.getPositionTypeValue();
}
项目:jasperreports    文件:ElementDecorator.java   
@Override
public void setPositionType(PositionTypeEnum positionType)
{
    throw new UnsupportedOperationException();
}
项目:jasperreports    文件:JRFillElement.java   
@Override
public PositionTypeEnum getPositionTypeValue()
{
    return parent.getPositionTypeValue();//FIXME optimize this by consolidating style properties
}
项目:jasperreports    文件:JRFillElement.java   
@Override
public void setPositionType(PositionTypeEnum positionType)
{
    throw new UnsupportedOperationException();
}
项目:ireport-fork    文件:PositionTypeProperty.java   
@SuppressWarnings("unchecked")
public PositionTypeProperty(JRDesignElement element)
{
    super(PositionTypeEnum.class, element);
    this.element = element;
}
项目:ireport-fork    文件:PositionTypeProperty.java   
@Override
public Object getDefaultValue()
{
    return PositionTypeEnum.FIX_RELATIVE_TO_TOP;
}
项目:ireport-fork    文件:PositionTypeProperty.java   
@Override
public void setPropertyValue(Object positionType)
{
    element.setPositionType((PositionTypeEnum)positionType);
}
项目:jasperreports    文件:JRElement.java   
/**
 * Returns the position type for the element
 * @return the position type
 */
public PositionTypeEnum getPositionTypeValue();
项目:jasperreports    文件:JRElement.java   
/**
 * Sets the position type for the element.
 * @param positionType the position type
 */
public void setPositionType(PositionTypeEnum positionType);