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

项目:PDFReporter-Studio    文件:MTextElement.java   
@Override
public void setPropertyValue(Object id, Object value) {
    JRDesignTextElement jrElement = (JRDesignTextElement) getValue();
    if (id.equals(JRBaseStyle.PROPERTY_MARKUP))
        jrElement.setMarkup((String) value);

    else if (id.equals(JRBaseStyle.PROPERTY_HORIZONTAL_ALIGNMENT))
        jrElement.setHorizontalAlignment((HorizontalAlignEnum) hAlignD.getEnumValue(value));
    else if (id.equals(JRBaseStyle.PROPERTY_VERTICAL_ALIGNMENT)) {
        VerticalAlignEnum va = (VerticalAlignEnum) EnumHelper.getSetValue(VerticalAlignEnum.values(), value, 1, true);
        if (va != null && va.equals(VerticalAlignEnum.JUSTIFIED))
            va = VerticalAlignEnum.MIDDLE;
        jrElement.setVerticalAlignment(va);
    } else if (id.equals(JRBaseStyle.PROPERTY_ROTATION))
        jrElement.setRotation((RotationEnum) rotationD.getEnumValue(value));

    getMFont().setPropertyValue(id, value);

    super.setPropertyValue(id, value);
}
项目:PDFReporter-Studio    文件:TextualContributionItem.java   
public void widgetSelected(SelectionEvent e) {
    if (!refreshing){
            List<Object> selection = getSelectionForType(MTextElement.class);
            if (selection.isEmpty())
                return;

            JSSCompoundCommand changeSizeCommands = new JSSCompoundCommand(null);
            String property = "";
            Object data = e.widget.getData();
            if (data instanceof VerticalAlignEnum) property = JRBaseStyle.PROPERTY_VERTICAL_ALIGNMENT;
            else if (data instanceof HorizontalAlignEnum) property = JRBaseStyle.PROPERTY_HORIZONTAL_ALIGNMENT;
            else return;
            for (Object textElement : selection){   
                changeSizeCommands.setReferenceNodeIfNull(textElement);
                Command c = createCommand(textElement, data, property);
                if (c != null) {
                    changeSizeCommands.add(c);
                }
            }
            CommandStack cs = getCommandStack();
            cs.execute(changeSizeCommands);
    }
}
项目:PDFReporter-Studio    文件:MapDesignConverter.java   
/**
 *
 */
public JRPrintElement convert(final ReportConverter reportConverter, final JRComponentElement element) {
    MapComponent map = (MapComponent) element.getComponent();
    JRBasePrintImage printImage = new JRBasePrintImage(element.getDefaultStyleProvider());
    Renderable cacheRenderer = getRenderable(reportConverter, element, map, printImage);

    printImage.setUUID(element.getUUID());
    printImage.setX(element.getX());
    printImage.setY(element.getY());
    printImage.setWidth(element.getWidth());
    printImage.setHeight(element.getHeight());
    printImage.setStyle(element.getStyle());
    printImage.setMode(element.getModeValue());
    printImage.setBackcolor(element.getBackcolor());
    printImage.setForecolor(element.getForecolor());
    printImage.setLazy(false);

    // FIXMEMAP there are no scale image, alignment and onError attributes
    // defined for the map element
    printImage.setScaleImage(ScaleImageEnum.CLIP);
    printImage.setHorizontalAlignment(HorizontalAlignEnum.LEFT);
    printImage.setVerticalAlignment(VerticalAlignEnum.TOP);
    printImage.setRenderable(cacheRenderer);
    return printImage;
}
项目:ireport-fork    文件:NewTypesUtils.java   
private JRDesignStaticText createLabel(JasperDesign jd, String text, int w, int h, String styleName)
{
    JRDesignStaticText element = new JRDesignStaticText();
    element.setX(0);
    element.setY(0);
    element.setWidth(w);
    element.setHeight(h);
    element.setText(text);
    element.setHorizontalAlignment( HorizontalAlignEnum.CENTER );
    element.setVerticalAlignment( VerticalAlignEnum.MIDDLE);

    if (styleName != null && jd.getStylesMap().containsKey(styleName))
    {
        element.setStyle( (JRStyle) jd.getStylesMap().get(styleName) );
    }
    return element;
}
项目:ireport-fork    文件:TextElementsToolbar.java   
private void modifyHorizontalAlignment() {
    if (isInit()) return;
    boolean oldChanging = isChanging();
    setChanging(true);

    if (getSelectedTextElements().size() > 0)
    {
        boolean isFirstUndo = true;
        HorizontalAlignEnum newValue = getSelectedHorizontalAlignment();
        for (JRDesignTextElement element : getSelectedTextElements())
        {
            // TODO: add undo operation...
            if ((newValue == null && element.getOwnHorizontalAlignmentValue() != null) || (newValue != null && newValue != element.getHorizontalAlignmentValue()))
            {
                HorizontalAlignEnum oldValue = element.getOwnHorizontalAlignmentValue();
                element.setHorizontalAlignment(newValue);
                ObjectPropertyUndoableEdit opUndo = new ObjectPropertyUndoableEdit(element, "HorizontalAlignment",HorizontalAlignEnum.class, oldValue , newValue);
                IReportManager.getInstance().addUndoableEdit(opUndo, !isFirstUndo);
                isFirstUndo = false;
            }
        }
    }

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

    numberOfPagesTest(1);

    columnDetailStyleTest(column1, 0, null, null, "Arial", 10f, true, null);
    columnDetailBorderTest(column1, 0, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1);
    columnDetailBorderTest(column2, 0, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1);
    columnDetailBorderTest(column3, 0, null, LineStyleEnum.SOLID, 2, null, LineStyleEnum.SOLID, 2, null, LineStyleEnum.SOLID, 2, null, LineStyleEnum.SOLID, 2);
    columnDetailStyleTest(column4, 0, null, null, "Arial", 10f, true, null);
    columnDetailBorderTest(column4, 0, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1);

    columnDetailAlignmentTest(column1, 0, HorizontalAlignEnum.CENTER);
    columnDetailAlignmentTest(column2, 0, HorizontalAlignEnum.LEFT);
    columnDetailAlignmentTest(column3, 0, HorizontalAlignEnum.CENTER);

    columnDetailAlignmentTest(column1, 0, VerticalAlignEnum.TOP);
    columnDetailAlignmentTest(column2, 0, VerticalAlignEnum.TOP);
    columnDetailAlignmentTest(column3, 0, VerticalAlignEnum.MIDDLE);
}
项目:dynamicreports-jasper    文件:Style5Test.java   
@Override
public void test() {
    super.test();

    numberOfPagesTest(1);

    //column1
    styleTest("pageFooter.textField1", 0, null, null, "Arial", 10f, null, null);
    horizontalAlignmentTest("pageFooter.textField1", 0, HorizontalAlignEnum.RIGHT);
    paddingTest("pageFooter.textField1", 0, 2, 2, 2, 0);
    borderTest("pageFooter.textField1", 0, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 0);

    styleTest("pageFooter.textField2", 0, null, null, "Arial", 10f, null, null);
    horizontalAlignmentTest("pageFooter.textField2", 0, HorizontalAlignEnum.LEFT);
    paddingTest("pageFooter.textField2", 0, 2, 2, 0, 2);
    borderTest("pageFooter.textField2", 0, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 0, null, LineStyleEnum.SOLID, 1);
}
项目:PDFReporter-Studio    文件:MHtml.java   
@Override
public void setPropertyValue(Object id, Object value) {
    JRDesignComponentElement jrElement = (JRDesignComponentElement) getValue();
    HtmlComponent htmlComp = (HtmlComponent) jrElement.getComponent();

    if (id.equals(HtmlComponent.PROPERTY_EVALUATION_TIME))
        htmlComp.setEvaluationTime((EvaluationTimeEnum) evaluationTimeD
                .getEnumValue(value));
    else if (id.equals(HtmlComponent.PROPERTY_EVALUATION_GROUP))
        htmlComp.setEvaluationGroup((String) value);
    else if (id.equals(HtmlComponent.PROPERTY_SCALE_TYPE))
        htmlComp.setScaleType((ScaleImageEnum) scaleTypeD
                .getEnumValue(value));
    else if (id.equals(HtmlComponent.PROPERTY_HORIZONTAL_ALIGN))
        htmlComp.setHorizontalAlign((HorizontalAlignEnum) hAlignD
                .getEnumValue(value));
    else if (id.equals(HtmlComponent.PROPERTY_VERTICAL_ALIGN))
        htmlComp.setVerticalAlign((VerticalAlignEnum) vAlignD
                .getEnumValue(value));
    else if (id.equals(HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION))
        htmlComp.setHtmlContentExpression(ExprUtil.setValues(
                htmlComp.getHtmlContentExpression(), value));
    else if (id.equals(HtmlComponent.PROPERTY_CLIP_ON_OVERFLOW))
        htmlComp.setClipOnOverflow((Boolean) value);
    else
        super.setPropertyValue(id, value);
}
项目:PDFReporter-Studio    文件:MSort.java   
@Override
public void setPropertyValue(Object id, Object value) {
    JRDesignComponentElement jrElement = (JRDesignComponentElement) getValue();
    SortComponent component = (SortComponent) jrElement.getComponent();

    if (id.equals(SortComponent.PROPERTY_HANDLER_COLOR))
        component.setHandlerColor(Colors.getAWT4SWTRGBColor((AlfaRGB) value));
    else if (id.equals(SortComponent.PROPERTY_COLUMN_NAME))
        component.setSortFieldName((String) value);
    else if (id.equals(SortComponent.PROPERTY_COLUMN_TYPE))
        component.setSortFieldType((SortFieldTypeEnum) EnumHelper
                .getSetValue(SortFieldTypeEnum.values(), value, 0, false));

    else if (id.equals(SortComponent.PROPERTY_EVALUATION_TIME))
        component.setEvaluationTime((EvaluationTimeEnum) EnumHelper
                .getSetValue(EvaluationTimeEnum.values(), value, 1, false));
    else if (id.equals(SortComponent.PROPERTY_EVALUATION_GROUP)) {
        component.setEvaluationGroup((String) value);
    } else if (id.equals(SortComponent.PROPERTY_HANDLER_HORIZONTAL_ALIGN)) {
        component
                .setHandlerHorizontalAlign((HorizontalAlignEnum) EnumHelper
                        .getSetValue(HorizontalAlignEnum.values(), value,
                                1, false));
    } else if (id.equals(SortComponent.PROPERTY_HANDLER_VERTICAL_ALIGN)) {
        component.setHandlerVerticalAlign((VerticalAlignEnum) EnumHelper
                .getSetValue(VerticalAlignEnum.values(), value, 1, false));
    } else
        super.setPropertyValue(id, value);
}
项目:PDFReporter-Studio    文件:TextStyleWizardPage.java   
private void setHorizonltalAlignment(){
    HorizontalAlignEnum align = element.getHorizontalAlignmen();
    if (HorizontalAlignEnum.RIGHT.equals(align)) rightHAlignment.setSelection(true);
    else if (HorizontalAlignEnum.CENTER.equals(align)) centerHAlignment.setSelection(true);
    else if (HorizontalAlignEnum.JUSTIFIED.equals(align)) justifiedHAlignment.setSelection(true);
    else  leftHAlignment.setSelection(true);
}
项目:PDFReporter-Studio    文件:TextStyleWizardPage.java   
private TextStyle createDefaultElement(){
    TextStyle defaultTextStyle = new TextStyle();
    defaultTextStyle.setBackGround(AlfaRGB.getFullyOpaque(new RGB(255,255,255)));
    defaultTextStyle.setForeGround(AlfaRGB.getFullyOpaque(new RGB(0,0,0)));
    defaultTextStyle.setHorizontalAlignmen(HorizontalAlignEnum.LEFT);
    defaultTextStyle.setVerticalAlignmen(VerticalAlignEnum.TOP);
    defaultTextStyle.setTransparent(true);
    defaultTextStyle.setRotation(RotationEnum.NONE);

    JRBaseFont font = new JRBaseFont();
    font.setFontName("Arial"); //$NON-NLS-1$
    font.setFontSize(8f);
    font.setBold(false);
    font.setItalic(false);
    font.setUnderline(false);
    font.setStrikeThrough(false);
    defaultTextStyle.setFont(font);


    JRBaseLineBox box = new JRBaseLineBox(null);
    box.setPadding(null);
    box.setTopPadding(0);
    box.setBottomPadding(0);
    box.setLeftPadding(0);
    box.setRightPadding(0);

    defaultTextStyle.setBorders(box);
    defaultTextStyle.setDescription(Messages.TextStyleView_sampleText);

    return defaultTextStyle;
}
项目:PDFReporter-Studio    文件:TextStyle.java   
public TextStyle(JRStyle style){
    super(null,null);
    setTransparent(style.getOwnModeValue() != null ? ModeEnum.TRANSPARENT.equals(style.getOwnModeValue()) : true);
    setBackGround(style.getOwnBackcolor());
    setForeGround(style.getOwnForecolor());
    setVerticalAlignmen(style.getOwnVerticalAlignmentValue() != null ? style.getOwnVerticalAlignmentValue() : VerticalAlignEnum.TOP);
    setHorizontalAlignmen(style.getOwnHorizontalAlignmentValue() != null ? style.getOwnHorizontalAlignmentValue() : HorizontalAlignEnum.LEFT);
    setRotation(style.getOwnRotationValue() != null ? style.getOwnRotationValue() : RotationEnum.NONE);

    JRFont font = new JRBaseFont();
    font.setBold(style.isOwnBold() != null ? style.isOwnBold() : false);
    font.setItalic(new Boolean(style.isOwnItalic() != null ? style.isOwnItalic() : false));
    style.isItalic();
    font.setUnderline(new Boolean(style.isOwnUnderline() != null ? style.isOwnUnderline() : false));
    font.setStrikeThrough(new Boolean(style.isOwnStrikeThrough() != null ? style.isOwnStrikeThrough() : false));
    font.setFontName(new String(style.getOwnFontName()));
    font.setFontSize(new Float(style.getOwnFontsize()));
    setFont(font);

    JRLineBox originBox = style.getLineBox();
    JRBaseLineBox copyBox = new JRBaseLineBox(null);
    copyBox.setPadding(originBox.getOwnPadding() != null ? new Integer(originBox.getOwnPadding()): null);
    copyBox.setTopPadding(originBox.getOwnTopPadding() != null ? new Integer(originBox.getOwnTopPadding()): null);
    copyBox.setBottomPadding(originBox.getOwnBottomPadding() != null ? new Integer(originBox.getOwnBottomPadding()): null);
    copyBox.setLeftPadding(originBox.getOwnLeftPadding() != null ? new Integer(originBox.getOwnLeftPadding()): null);
    copyBox.setRightPadding(originBox.getOwnRightPadding() != null ? new Integer(originBox.getOwnRightPadding()): null);
    copyLinePen(originBox.getPen(), copyBox.getPen());
    copyLinePen(originBox.getLeftPen(), copyBox.getLeftPen());
    copyLinePen(originBox.getRightPen(), copyBox.getRightPen());
    copyLinePen(originBox.getBottomPen(), copyBox.getBottomPen());
    copyLinePen(originBox.getTopPen(), copyBox.getTopPen());
    setBorders(copyBox);

    String name = style.getName();
    if (name != null && !name.isEmpty()) setDescription(name);
}
项目:ireport-fork    文件:HandlerHorizontalAlignmentProperty.java   
@Override
public List getTagList() 
{
    List tags = new java.util.ArrayList();
    tags.add(new Tag(HorizontalAlignEnum.LEFT, I18n.getString("Global.Property.Left")));
    tags.add(new Tag(HorizontalAlignEnum.CENTER, I18n.getString("Global.Property.Center")));
    tags.add(new Tag(HorizontalAlignEnum.RIGHT, I18n.getString("Global.Property.Right")));
   // tags.add(new Tag(HorizontalAlignEnum.JUSTIFIED, I18n.getString("Global.Property.Justified")));
    return tags;
}
项目:ireport-fork    文件:HorizontalAlignmentProperty.java   
@Override
public List getTagList() 
{
    List tags = new java.util.ArrayList();
    tags.add(new Tag(HorizontalAlignEnum.LEFT, I18n.getString("Global.Property.Left")));
    tags.add(new Tag(HorizontalAlignEnum.CENTER, I18n.getString("Global.Property.Center")));
    tags.add(new Tag(HorizontalAlignEnum.RIGHT, I18n.getString("Global.Property.Right")));
    return tags;
}
项目:ireport-fork    文件:CreateCrosstabAction.java   
private JRDesignStaticText createLabel(String text, int w, int h)
{
    JRDesignStaticText element = new JRDesignStaticText();
    element.setX(0);
    element.setY(0);
    element.setWidth(w);
    element.setHeight(h);
    element.setText(text);
    element.setHorizontalAlignment( HorizontalAlignEnum.CENTER );
    element.setVerticalAlignment( VerticalAlignEnum.MIDDLE);
    return element;
}
项目:ireport-fork    文件:CreatePageXOfYAction.java   
@Override
public JRDesignElement[] createReportElements(JasperDesign jd) {
    JRDesignTextField[] elements = new JRDesignTextField[2];

    elements[0] = (JRDesignTextField)super.createReportElement( jd );

    ((JRDesignExpression)elements[0].getExpression()).setText("\"" + I18n.getString("Page_X_Of_Y.page", "\"+$V{PAGE_NUMBER}+\"") + "\"");
    ((JRDesignExpression)elements[0].getExpression()).setValueClassName("java.lang.String");

    elements[0].setHorizontalAlignment( HorizontalAlignEnum.RIGHT);
    setMatchingClassExpression(
        ((JRDesignExpression)elements[0].getExpression()),
        "java.lang.String",
        true
        );


    elements[1] = (JRDesignTextField)super.createReportElement( jd );

    ((JRDesignExpression)elements[1].getExpression()).setText("\" \" + $V{PAGE_NUMBER}");
    ((JRDesignExpression)elements[1].getExpression()).setValueClassName("java.lang.String");

    setMatchingClassExpression(
        ((JRDesignExpression)elements[1].getExpression()),
        "java.lang.String",
        true
        );

    elements[1].setEvaluationTime( EvaluationTimeEnum.REPORT);

    return elements;
}
项目:ireport-fork    文件:TextElementsToolbar.java   
private HorizontalAlignEnum getSelectedHorizontalAlignment()
{
    if (jToggleButtonAlignLeft.isSelected()) return HorizontalAlignEnum.LEFT;
    if (jToggleButtonAlignRight.isSelected()) return HorizontalAlignEnum.RIGHT;
    if (jToggleButtonAlignJustify.isSelected()) return HorizontalAlignEnum.JUSTIFIED;
    if (jToggleButtonAlignCenter.isSelected()) return HorizontalAlignEnum.CENTER;
    return null;
}
项目:ireport-fork    文件:TextElementsToolbar.java   
private void setSelectedHorizontalAlignment(HorizontalAlignEnum b)
{
    jToggleButtonAlignLeft.setSelected(b != null && b == HorizontalAlignEnum.LEFT);
    jToggleButtonAlignRight.setSelected(b != null && b == HorizontalAlignEnum.RIGHT);
    jToggleButtonAlignJustify.setSelected(b != null && b == HorizontalAlignEnum.JUSTIFIED);
    jToggleButtonAlignCenter.setSelected(b != null && b == HorizontalAlignEnum.CENTER);
}
项目:ireport-fork    文件:TextElementsToolbar.java   
private boolean setHorizontalAlignment(boolean firstElement, HorizontalAlignEnum horizontalAlignment) {

    if (!firstElement)
    {
        HorizontalAlignEnum selectedValue = getSelectedHorizontalAlignment();
        if (selectedValue != null && selectedValue != horizontalAlignment)
        {
            setSelectedHorizontalAlignment(null);
        }
    }
    setSelectedHorizontalAlignment(horizontalAlignment);
    return true;
}
项目:ireport-fork    文件:HorizontalAlignmentProperty.java   
@Override
public List getTagList() 
{
    List tags = new java.util.ArrayList();
    tags.add(new Tag(HorizontalAlignEnum.LEFT, I18n.getString("Global.Property.Left")));
    tags.add(new Tag(HorizontalAlignEnum.CENTER, I18n.getString("Global.Property.Center")));
    tags.add(new Tag(HorizontalAlignEnum.RIGHT, I18n.getString("Global.Property.Right")));
    tags.add(new Tag(HorizontalAlignEnum.JUSTIFIED, I18n.getString("Global.Property.Justified")));
    return tags;
}
项目:ireport-fork    文件:HorizontalAlignmentProperty.java   
@SuppressWarnings(value = "unchecked")
public HorizontalAlignmentProperty(JRBaseStyle style) {

    super(HorizontalAlignEnum.class, style);
    this.style = style;
    setValue("suppressCustomEditor", Boolean.TRUE);
}
项目:ireport-fork    文件:HorizontalAlignmentProperty.java   
@Override
public List getTagList()
{
    List tags = new java.util.ArrayList();
    tags.add(new Tag(HorizontalAlignEnum.LEFT, I18n.getString("AbstractStyleNode.Property.Left")));
    tags.add(new Tag(HorizontalAlignEnum.CENTER, I18n.getString("AbstractStyleNode.Property.Center")));
    tags.add(new Tag(HorizontalAlignEnum.RIGHT, I18n.getString("AbstractStyleNode.Property.Right")));
    tags.add(new Tag(HorizontalAlignEnum.JUSTIFIED, I18n.getString("AbstractStyleNode.Property.Justified")));
    return tags;
}
项目:dynamicreports-jasper    文件:AbstractJasperStyleTest.java   
protected void horizontalAlignmentTest(String name, int index, HorizontalAlignEnum horizontalAlignment) {
    JRAlignment element = (JRAlignment) getElementAt(name, index);
    if (horizontalAlignment == null) {
        Assert.assertEquals("horizontalAlignment", HorizontalAlignEnum.LEFT, element.getHorizontalAlignmentValue());
    }
    Assert.assertEquals("horizontalAlignment", horizontalAlignment, element.getHorizontalAlignmentValue());
}
项目:dynamicreports-jasper    文件:CrosstabStyle1Test.java   
@Override
public void test() {
    super.test();

    numberOfPagesTest(1);

    setCrosstabBand("summary");

    crosstabHeaderElementStyleTest("textField1", 0, null, null, "Arial", 12f, true, null);

    crosstabGroupHeaderStyleTest(rowGroup, 0, null, Color.LIGHT_GRAY, "Arial", 12f, true, null);
    crosstabGroupTotalHeaderStyleTest(rowGroup, 0, null, Color.LIGHT_GRAY, "Arial", 12f, true, null);
    crosstabGroupTotalHeaderHorizontalAlignmentTest(rowGroup, 0, HorizontalAlignEnum.CENTER);

    crosstabGroupHeaderStyleTest(columnGroup, 0, null, Color.LIGHT_GRAY, "Arial", 12f, true, null);
    crosstabGroupTotalHeaderStyleTest(columnGroup, 0, null, Color.LIGHT_GRAY, "Arial", 12f, true, null);
    crosstabGroupTotalHeaderHorizontalAlignmentTest(columnGroup, 0, HorizontalAlignEnum.CENTER);

    for (int i = 0; i < 4; i++) {
        crosstabCellStyleTest(measure1, null, null, i, null, null, "Arial", 10f, true, null);
    }
    for (int i = 0; i < 2; i++) {
        crosstabCellStyleTest(measure1, rowGroup, null, i, null, Color.BLUE, "Arial", 10f, true, null);
        crosstabCellStyleTest(measure1, null, columnGroup, i, null, Color.ORANGE, "Arial", 10f, true, null);
    }
    crosstabCellStyleTest(measure1, rowGroup, columnGroup, 0, null, Color.RED, "Arial", 10f, true, null);

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

    numberOfPagesTest(1);

    //column1
    columnDetailStyleTest(column1, 0, Color.BLACK, null, "Arial", 10f, null, null);
    columnDetailAlignmentTest(column1, 0, HorizontalAlignEnum.RIGHT);

    //group1
    groupHeaderStyleTest(group1, 0, null, null, "Arial", 10f, true, null);
    groupHeaderAlignmentTest(group1, 0, HorizontalAlignEnum.LEFT);
}
项目:jasperreports-wms-component    文件:WmsMapElementImageProvider.java   
public static JRPrintImage getImage(
    JasperReportsContext jasperReportsContext, JRGenericPrintElement element)
    throws JRException, IOException {

  JRBasePrintImage printImage = new JRBasePrintImage(
      element.getDefaultStyleProvider());

  printImage.setUUID(element.getUUID());
  printImage.setX(element.getX());
  printImage.setY(element.getY());
  printImage.setWidth(element.getWidth());
  printImage.setHeight(element.getHeight());
  printImage.setStyle(element.getStyle());
  printImage.setMode(element.getModeValue());
  printImage.setBackcolor(element.getBackcolor());
  printImage.setForecolor(element.getForecolor());
  printImage.setLazy(false);
  printImage.setScaleImage(ScaleImageEnum.CLIP);
  printImage.setHorizontalAlignment(HorizontalAlignEnum.LEFT);
  printImage.setVerticalAlignment(VerticalAlignEnum.TOP);

  Renderable cacheRenderer = (Renderable) element
      .getParameterValue(WmsMapPrintElement.PARAMETER_CACHE_RENDERER);

  if (cacheRenderer == null) {
    cacheRenderer = getImageRenderable(jasperReportsContext, element);
    element.setParameterValue(WmsMapPrintElement.PARAMETER_CACHE_RENDERER,
        cacheRenderer);
  }

  printImage.setRenderable(cacheRenderer);

  return printImage;
}
项目:PDFReporter-Studio    文件:MHtml.java   
/**
 * Creates the property descriptors.
 * 
 * @param desc
 *            the desc
 */
public void createPropertyDescriptors(List<IPropertyDescriptor> desc,
        Map<String, Object> defaultsMap) {
    super.createPropertyDescriptors(desc, defaultsMap);

    JRExpressionPropertyDescriptor contentExprD = new JRExpressionPropertyDescriptor(
            HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION,
            Messages.MHtml_content_expression);
    contentExprD
            .setDescription(Messages.MHtml_content_expression_description);
    desc.add(contentExprD);

    scaleTypeD = new JSSEnumPropertyDescriptor(
            HtmlComponent.PROPERTY_SCALE_TYPE, Messages.MHtml_scaletype,
            ScaleImageEnum.class, NullEnum.NOTNULL);
    scaleTypeD.setDescription(Messages.MHtml_scaletype_description);
    desc.add(scaleTypeD);

    CheckBoxPropertyDescriptor clipOverflow = new CheckBoxPropertyDescriptor(
            HtmlComponent.PROPERTY_CLIP_ON_OVERFLOW,
            Messages.MHtml_cliponoverflow, NullEnum.NULL);
    clipOverflow.setDescription(Messages.MHtml_cliponoverflow_desc);
    desc.add(clipOverflow);

    hAlignD = new JSSEnumPropertyDescriptor(
            HtmlComponent.PROPERTY_HORIZONTAL_ALIGN,
            Messages.MHtml_horizontalalign, HorizontalAlignEnum.class,
            NullEnum.NOTNULL, 3);
    hAlignD.setDescription(Messages.MHtml_horizontalalign_description);
    desc.add(hAlignD);

    vAlignD = new JSSEnumPropertyDescriptor(
            HtmlComponent.PROPERTY_VERTICAL_ALIGN,
            Messages.MHtml_verticalalign, VerticalAlignEnum.class,
            NullEnum.NOTNULL, 3);
    vAlignD.setDescription(Messages.MHtml_verticalalign_description);
    desc.add(vAlignD);

    evaluationTimeD = new JSSEnumPropertyDescriptor(
            HtmlComponent.PROPERTY_EVALUATION_TIME,
            Messages.MHtml_evaluation_time, EvaluationTimeEnum.class,
            NullEnum.NOTNULL);
    evaluationTimeD
            .setDescription(Messages.MHtml_evaluation_time_description);
    desc.add(evaluationTimeD);

    evaluationGroupNameD = new RComboBoxPropertyDescriptor(
            HtmlComponent.PROPERTY_EVALUATION_GROUP,
            Messages.MHtml_evaluation_group, new String[] { "" }); //$NON-NLS-1$
    evaluationGroupNameD
            .setDescription(Messages.MHtml_evaluation_group_description);
    desc.add(evaluationGroupNameD);

    contentExprD.setCategory(Messages.common_properties_category);
    scaleTypeD.setCategory(Messages.common_properties_category);
    hAlignD.setCategory(Messages.common_properties_category);
    vAlignD.setCategory(Messages.common_properties_category);
    evaluationTimeD.setCategory(Messages.common_properties_category);
    evaluationGroupNameD.setCategory(Messages.common_properties_category);
    clipOverflow.setCategory(Messages.common_properties_category);

    defaultsMap.put(HtmlComponent.PROPERTY_EVALUATION_TIME,
            evaluationTimeD.getEnumValue(EvaluationTimeEnum.NOW));
    defaultsMap.put(HtmlComponent.PROPERTY_SCALE_TYPE,
            scaleTypeD.getEnumValue(ScaleImageEnum.RETAIN_SHAPE));
    defaultsMap.put(HtmlComponent.PROPERTY_HORIZONTAL_ALIGN,
            hAlignD.getEnumValue(HorizontalAlignEnum.LEFT));
    defaultsMap.put(HtmlComponent.PROPERTY_VERTICAL_ALIGN,
            vAlignD.getEnumValue(VerticalAlignEnum.MIDDLE));
    defaultsMap.put(HtmlComponent.PROPERTY_CLIP_ON_OVERFLOW, Boolean.FALSE);
}
项目:PDFReporter-Studio    文件:MSort.java   
/**
 * Creates the property descriptors.
 * 
 * @param desc
 *            the desc
 */
@Override
public void createPropertyDescriptors(List<IPropertyDescriptor> desc,
        Map<String, Object> defaultsMap) {
    super.createPropertyDescriptors(desc, defaultsMap);

    ComboBoxPropertyDescriptor evaluationTimeD = new ComboBoxPropertyDescriptor(
            SortComponent.PROPERTY_EVALUATION_TIME,
            Messages.common_evaluation_time, EnumHelper.getEnumNames(
                    EvaluationTimeEnum.values(), NullEnum.NOTNULL));
    evaluationTimeD
            .setDescription(Messages.MGenericElement_evaluation_time_description);
    desc.add(evaluationTimeD);

    evaluationGroupNameD = new RComboBoxPropertyDescriptor(
            SortComponent.PROPERTY_EVALUATION_GROUP,
            Messages.MGenericElement_evaluation_group_name,
            new String[] { "" }); //$NON-NLS-2$
    evaluationGroupNameD
            .setDescription(Messages.MGenericElement_evaluation_group_name_description);
    desc.add(evaluationGroupNameD);

    ColorPropertyDescriptor color = new ColorPropertyDescriptor(
            SortComponent.PROPERTY_HANDLER_COLOR, "Handler Color",
            NullEnum.NULL);
    color.setDescription("Handler color");
    desc.add(color);

    ComboBoxPropertyDescriptor horizAlign = new ComboBoxPropertyDescriptor(
            SortComponent.PROPERTY_HANDLER_HORIZONTAL_ALIGN,
            "Handler Horizontal Alignement", EnumHelper.getEnumNames(
                    HorizontalAlignEnum.values(), NullEnum.NOTNULL));
    horizAlign.setDescription("Handler horizontal alignement");
    desc.add(horizAlign);

    ComboBoxPropertyDescriptor vertAlign = new ComboBoxPropertyDescriptor(
            SortComponent.PROPERTY_HANDLER_VERTICAL_ALIGN,
            "Handler Vertical Alignement", EnumHelper.getEnumNames(
                    VerticalAlignEnum.values(), NullEnum.NOTNULL));
    vertAlign.setDescription("Handler vertical alignement");
    desc.add(vertAlign);

    ComboBoxPropertyDescriptor sortFieldType = new ComboBoxPropertyDescriptor(
            SortComponent.PROPERTY_COLUMN_TYPE, "SortField Type",
            EnumHelper.getEnumNames(SortFieldTypeEnum.values(),
                    NullEnum.NOTNULL));
    sortFieldType.setDescription("SortField type");
    desc.add(sortFieldType);

    NTextPropertyDescriptor sortFieldName = new NTextPropertyDescriptor(
            SortComponent.PROPERTY_COLUMN_NAME, "SortField Name");
    sortFieldName.setDescription("SortField name");
    desc.add(sortFieldName);

    color.setCategory("Sort Properties");
    sortFieldType.setCategory("Sort Properties");
    sortFieldName.setCategory("Sort Properties");

    horizAlign.setCategory("Sort Properties");
    vertAlign.setCategory("Sort Properties");
    evaluationTimeD.setCategory("Sort Properties");
    evaluationGroupNameD.setCategory("Sort Properties");

    defaultsMap.put(SortComponent.PROPERTY_HANDLER_VERTICAL_ALIGN,
            VerticalAlignEnum.MIDDLE);
    defaultsMap.put(SortComponent.PROPERTY_HANDLER_HORIZONTAL_ALIGN,
            HorizontalAlignEnum.LEFT);
    defaultsMap.put(SortComponent.PROPERTY_EVALUATION_TIME,
            EvaluationTimeEnum.NOW);
    defaultsMap.put(SortComponent.PROPERTY_HANDLER_COLOR, null);
    defaultsMap.put(SortComponent.PROPERTY_COLUMN_TYPE,
            SortFieldTypeEnum.FIELD);

}
项目:PDFReporter-Studio    文件:DefaultValuesMap.java   
/**
 * Create the default property map for a wide range of object
 * @param type the type of the element for which the properties are requested
 * @return the default properties of the requested element
 */
@SuppressWarnings("deprecation")
private static HashMap<String, Object> initializeType(Object type){
    HashMap<String, Object> result = new HashMap<String, Object>();
    result.put(JRDesignStyle.PROPERTY_FONT_NAME, JRProperties.getProperty(JRFont.DEFAULT_FONT_NAME));
    result.put(JRBaseLineBox.PROPERTY_PADDING, INTEGER_ZERO);
    result.put(JRBaseLineBox.PROPERTY_TOP_PADDING, INTEGER_ZERO);
    result.put(JRBaseLineBox.PROPERTY_RIGHT_PADDING, INTEGER_ZERO);
    result.put(JRDesignStyle.PROPERTY_PDF_FONT_NAME, JRProperties.getProperty(JRFont.DEFAULT_PDF_FONT_NAME));
    result.put(JRDesignStyle.PROPERTY_PDF_ENCODING,JRProperties.getProperty(JRFont.DEFAULT_PDF_ENCODING));
    result.put(JRDesignStyle.PROPERTY_PATTERN, null);
    result.put(JRDesignStyle.PROPERTY_MARKUP,JRCommonText.MARKUP_NONE);
    result.put(JRBasePen.PROPERTY_LINE_STYLE, LineStyleEnum.SOLID);

    if (type instanceof JRStyle){

        result.put(JRDesignStyle.PROPERTY_FONT_SIZE, null);
        result.put(JRDesignStyle.PROPERTY_BOLD, null);
        result.put(JRDesignStyle.PROPERTY_ITALIC, null);
        result.put(JRDesignStyle.PROPERTY_UNDERLINE, null);
        result.put(JRDesignStyle.PROPERTY_STRIKE_THROUGH, null);
        result.put(JRDesignStyle.PROPERTY_PDF_EMBEDDED,null);
        result.put(JRDesignStyle.PROPERTY_BLANK_WHEN_NULL,null);
        result.put(JRDesignStyle.PROPERTY_VERTICAL_ALIGNMENT,null);
        result.put(JRDesignStyle.PROPERTY_HORIZONTAL_ALIGNMENT,null);
        result.put(JRDesignStyle.PROPERTY_SCALE_IMAGE,null);
        result.put(JRDesignStyle.PROPERTY_ROTATION,null);
        result.put(JRDesignStyle.PROPERTY_RADIUS,null);
        result.put(JRBasePen.PROPERTY_LINE_WIDTH, null);
        result.put(JRBasePen.PROPERTY_LINE_COLOR, null);
        result.put(JRDesignStyle.PROPERTY_BACKCOLOR, null);
        result.put(JRDesignStyle.PROPERTY_FORECOLOR, null);
        result.put(JRDesignStyle.PROPERTY_FILL, null);
        result.put(JRDesignStyle.PROPERTY_MODE, null);
    } else {
        result.put(JRDesignStyle.PROPERTY_FONT_SIZE, JRProperties.getIntegerProperty(JRFont.DEFAULT_FONT_SIZE));
        result.put(JRDesignStyle.PROPERTY_BOLD, false);
        result.put(JRDesignStyle.PROPERTY_ITALIC, false);
        result.put(JRDesignStyle.PROPERTY_UNDERLINE, false);
        result.put(JRDesignStyle.PROPERTY_STRIKE_THROUGH, false);
        result.put(JRDesignStyle.PROPERTY_PDF_EMBEDDED,JRProperties.getBooleanProperty(JRFont.DEFAULT_PDF_EMBEDDED));
        result.put(JRDesignStyle.PROPERTY_BLANK_WHEN_NULL,false);
        result.put(JRDesignStyle.PROPERTY_VERTICAL_ALIGNMENT,VerticalAlignEnum.TOP);
        result.put(JRDesignStyle.PROPERTY_HORIZONTAL_ALIGNMENT,HorizontalAlignEnum.LEFT);
        result.put(JRDesignStyle.PROPERTY_SCALE_IMAGE,ScaleImageEnum.RETAIN_SHAPE);
        result.put(JRDesignStyle.PROPERTY_ROTATION,RotationEnum.NONE);
        result.put(JRDesignStyle.PROPERTY_RADIUS,INTEGER_ZERO);
        result.put(JRBasePen.PROPERTY_LINE_WIDTH,JRPen.LINE_WIDTH_0);
        result.put(JRBasePen.PROPERTY_LINE_COLOR, Color.black);
        result.put(MGraphicElementLinePen.LINE_PEN, createBaseLinePen(type));
        result.put(MGraphicElementLineBox.LINE_BOX, createBaseLineBox(type));
        result.put(JRDesignStyle.PROPERTY_BACKCOLOR, Color.white);
        result.put(JRDesignStyle.PROPERTY_FORECOLOR, Color.black);
        result.put(JRDesignStyle.PROPERTY_FILL, FillEnum.SOLID);
        ModeEnum opaqueValue = ModeEnum.getByValue(ModeEnum.OPAQUE.getValue());
        ModeEnum transparentValue = ModeEnum.getByValue(ModeEnum.TRANSPARENT.getValue());
        if (type instanceof JRDesignTextElement){
            result.put(JRDesignStyle.PROPERTY_MODE, transparentValue);
        } else if (type instanceof JRTemplateElement){
            result.put(JRDesignStyle.PROPERTY_MODE, opaqueValue);
        } else if (type instanceof JRBaseElement) {
            result.put(JRDesignStyle.PROPERTY_MODE, opaqueValue);
        } else if (type instanceof JRBasePrintElement) {
            result.put(JRDesignStyle.PROPERTY_MODE, opaqueValue);
        } else if (type instanceof JRFillElement){
            result.put(JRDesignStyle.PROPERTY_MODE, opaqueValue);
        } else {
            result.put(JRDesignStyle.PROPERTY_MODE, transparentValue);
        }
    }
    return result;
}
项目:PDFReporter-Studio    文件:MTextElement.java   
@Override
public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) {
    super.createPropertyDescriptors(desc, defaultsMap);

    RWComboBoxPropertyDescriptor markupD = new RWComboBoxPropertyDescriptor(JRBaseStyle.PROPERTY_MARKUP,
            Messages.MTextElement_markup, ModelUtils.getMarkups(getJasperConfiguration()), NullEnum.INHERITED);
    markupD.setDescription(Messages.MTextElement_markup_description);
    desc.add(markupD);

    hAlignD = new HAlignPropertyDescriptor(JRBaseStyle.PROPERTY_HORIZONTAL_ALIGNMENT,
            Messages.common_horizontal_alignment, HorizontalAlignEnum.class, NullEnum.INHERITED);
    hAlignD.setDescription(Messages.MTextElement_horizontal_alignment_description);
    desc.add(hAlignD);

    vAlignD = new VAlignPropertyDescriptor(JRBaseStyle.PROPERTY_VERTICAL_ALIGNMENT, Messages.common_vertical_alignment,
            VerticalAlignEnum.class, NullEnum.INHERITED);
    vAlignD.setDescription(Messages.MTextElement_vertical_alignment_description);
    desc.add(vAlignD);

    rotationD = new RotationPropertyDescriptor(JRBaseStyle.PROPERTY_ROTATION, Messages.common_rotation,
            RotationEnum.class, NullEnum.INHERITED);
    rotationD.setDescription(Messages.MTextElement_rotation_description);
    desc.add(rotationD);

    JRPropertyDescriptor paragraph = new JRPropertyDescriptor(PARAGRAPH, "Paragraph");
    desc.add(paragraph);

    setHelpPrefix(desc, "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#textElement");

    tFont = getMFont();
    tFont.createPropertyDescriptors(desc, defaultsMap);

    paragraph.setCategory(Messages.MTextElement_text_properties_category);
    markupD.setCategory(Messages.MTextElement_text_properties_category);
    hAlignD.setCategory(Messages.MTextElement_text_properties_category);
    vAlignD.setCategory(Messages.MTextElement_text_properties_category);
    rotationD.setCategory(Messages.MTextElement_text_properties_category);

    defaultsMap.put(JRBaseStyle.PROPERTY_HORIZONTAL_ALIGNMENT, null);
    defaultsMap.put(JRBaseStyle.PROPERTY_VERTICAL_ALIGNMENT, null);
    defaultsMap.put(JRBaseStyle.PROPERTY_ROTATION, null);

}
项目:PDFReporter-Studio    文件:MImage.java   
@Override
public void setPropertyValue(Object id, Object value) {
    JRDesignImage jrElement = (JRDesignImage) getValue();
    if (id.equals(JRBaseStyle.PROPERTY_FILL))
        jrElement.setFill((FillEnum) fillD.getEnumValue(value));
    else if (id.equals(JRBaseStyle.PROPERTY_SCALE_IMAGE))
        jrElement.setScaleImage((ScaleImageEnum) scaleImageD.getEnumValue(value));
    else if (id.equals(JRBaseStyle.PROPERTY_HORIZONTAL_ALIGNMENT))
        jrElement.setHorizontalAlignment((HorizontalAlignEnum) hAlignD.getEnumValue(value));
    else if (id.equals(JRBaseStyle.PROPERTY_VERTICAL_ALIGNMENT))
        jrElement.setVerticalAlignment((VerticalAlignEnum) vAlignD.getEnumValue(value));
    else if (id.equals(JRBaseImage.PROPERTY_ON_ERROR_TYPE))
        jrElement.setOnErrorType((OnErrorTypeEnum) onErrorTypeD.getEnumValue(value));
    else if (id.equals(JRDesignImage.PROPERTY_EVALUATION_TIME))
        jrElement.setEvaluationTime((EvaluationTimeEnum) evaluationTimeD.getEnumValue(value));
    else if (id.equals(JRDesignImage.PROPERTY_EVALUATION_GROUP)) {
        if (value != null && !value.equals("")) { //$NON-NLS-1$
            JRDesignDataset dataset = (JRDesignDataset)getElementDataset();
            JRGroup group = (JRGroup) dataset.getGroupsMap().get(value);
            jrElement.setEvaluationGroup(group);
        }
    } else if (id.equals(JRDesignImage.PROPERTY_EXPRESSION))
        jrElement.setExpression(ExprUtil.setValues(jrElement.getExpression(), value));
    else if (id.equals(JRBaseImage.PROPERTY_USING_CACHE))
        jrElement.setUsingCache((Boolean) value);
    else if (id.equals(JRBaseImage.PROPERTY_LAZY))
        jrElement.setLazy(((Boolean) value).booleanValue());
    else if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TARGET))
        jrElement.setLinkTarget((String) value);
    else if (id.equals(JRDesignHyperlink.PROPERTY_LINK_TYPE))
        jrElement.setLinkType((String) value);
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_ANCHOR_EXPRESSION))
        jrElement.setHyperlinkAnchorExpression(ExprUtil.setValues(jrElement.getHyperlinkAnchorExpression(), value));
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PAGE_EXPRESSION))
        jrElement.setHyperlinkPageExpression(ExprUtil.setValues(jrElement.getHyperlinkPageExpression(), value));
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_REFERENCE_EXPRESSION))
        jrElement.setHyperlinkReferenceExpression(ExprUtil.setValues(jrElement.getHyperlinkReferenceExpression(), value));
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_TOOLTIP_EXPRESSION))
        jrElement.setHyperlinkTooltipExpression(ExprUtil.setValues(jrElement.getHyperlinkTooltipExpression(), value));
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_WHEN_EXPRESSION)) {
        jrElement.setHyperlinkWhenExpression(ExprUtil.setValues(jrElement.getHyperlinkWhenExpression(), value));
    } else if (id.equals(JRDesignImage.PROPERTY_ANCHOR_NAME_EXPRESSION))
        jrElement.setAnchorNameExpression(ExprUtil.setValues(jrElement.getAnchorNameExpression(), value));
    else if (id.equals(JRDesignImage.PROPERTY_BOOKMARK_LEVEL))
        jrElement.setBookmarkLevel(value != null ? Integer.parseInt(value.toString()) : 0); 
    else if (id.equals(JRDesignHyperlink.PROPERTY_HYPERLINK_PARAMETERS)) {
        if (value instanceof ParameterDTO) {
            ParameterDTO v = (ParameterDTO) value;

            JRHyperlinkParameter[] hyperlinkParameters = jrElement.getHyperlinkParameters();
            if (hyperlinkParameters != null)
                for (JRHyperlinkParameter prm : hyperlinkParameters)
                    jrElement.removeHyperlinkParameter(prm);

            for (JRHyperlinkParameter param : v.getValue())
                jrElement.addHyperlinkParameter(param);

            propertyDTO = v;
        }
    }
    super.setPropertyValue(id, value);
}
项目:PDFReporter-Studio    文件:TextStyleWizardPage.java   
private HorizontalAlignEnum getHorizonltalAlignment(){
    if (rightHAlignment.getSelection()) return HorizontalAlignEnum.RIGHT;
    else if (centerHAlignment.getSelection()) return HorizontalAlignEnum.CENTER;
    else if (justifiedHAlignment.getSelection()) return HorizontalAlignEnum.JUSTIFIED;
    else return HorizontalAlignEnum.LEFT;
}
项目:PDFReporter-Studio    文件:TextStyle.java   
public HorizontalAlignEnum getHorizontalAlignmen(){
    return (HorizontalAlignEnum)getProperty(HORIZONTAL_ALIGNMENT);
}
项目:PDFReporter-Studio    文件:TextStyle.java   
public void setHorizontalAlignmen(HorizontalAlignEnum value){
    storePropertiy(HORIZONTAL_ALIGNMENT, value);
}
项目:PDFReporter-Studio    文件:TextStyle.java   
/**
 * Rebuild a CrosstabStyle from its XML representation
 * 
 * @param xmlNode an XML node with the representation of a CrosstabStyle
 * @return the CrosstabStyle builded from the xmlNode, or null if something goes wrong during the rebuilding
 */
@Override
public TemplateStyle buildFromXML(Node xmlNode) {
    try{
        NamedNodeMap rootAttributes = xmlNode.getAttributes();
        VerticalAlignEnum verticalAlignment = VerticalAlignEnum.getByValue(Byte.valueOf(rootAttributes.getNamedItem("verticalAlignment").getNodeValue()));
        HorizontalAlignEnum horizontalAlignment = HorizontalAlignEnum.getByValue(Byte.valueOf(rootAttributes.getNamedItem("horizontalAlignment").getNodeValue()));
        RotationEnum rotation = RotationEnum.getByValue(Byte.valueOf(rootAttributes.getNamedItem("rotation").getNodeValue()));
        boolean transparent = rootAttributes.getNamedItem("isTransparent").getNodeValue().equals("true"); 

        AlfaRGB background = null;
        AlfaRGB foreground = null;
        JRFont font = null;
        JRLineBox box = null;

        Node firstChild = xmlNode.getFirstChild();
        String description = null;
        while(firstChild!=null){
            if (firstChild.getNodeName().equals("foreground")){
                foreground = rgbColor(firstChild);
            } else if (firstChild.getNodeName().equals("background")) {
                background = rgbColor(firstChild);
            } else if (firstChild.getNodeName().equals("font")) {
                font = buildFont(firstChild);
            } else if (firstChild.getNodeName().equals("linebox")) {
                box = buildBox(firstChild);
            }  else if (firstChild.getNodeName().equals("description")) {
                Node descriptionNode = firstChild.getChildNodes().item(0);
                description = descriptionNode != null ? descriptionNode.getNodeValue() : "";            
            }
            firstChild = firstChild.getNextSibling();
        }
        TextStyle result = new TextStyle();
        result.setVerticalAlignmen(verticalAlignment);
        result.setHorizontalAlignmen(horizontalAlignment);
        result.setRotation(rotation);
        result.setTransparent(transparent);
        result.setBackGround(background);
        result.setForeGround(foreground);
        result.setFont(font);
        result.setBorders(box);
        result.setDescription(description);
        return result;
    } catch(Exception ex){
        System.out.println("Unable to rebuild the text style");
        ex.printStackTrace();
        return null;
    }
}
项目:ireport-fork    文件:HandlerHorizontalAlignmentProperty.java   
@SuppressWarnings("unchecked")
public HandlerHorizontalAlignmentProperty(SortComponent component)
{
    super(HorizontalAlignEnum.class,  component);
    this.component = component;
}
项目:ireport-fork    文件:HandlerHorizontalAlignmentProperty.java   
@Override
public void setPropertyValue(Object alignment)
{
    component.setHandlerHorizontalAlign((HorizontalAlignEnum)alignment);
}
项目:ireport-fork    文件:CreateSortAction.java   
@Override
public JRDesignElement createReportElement(JasperDesign jd) {




    JRDesignComponentElement component = new JRDesignComponentElement();
    SortComponent componentImpl = new SortComponent();


    componentImpl.setHandlerHorizontalAlign(HorizontalAlignEnum.CENTER);
    componentImpl.setHandlerColor(Color.BLACK);


    component.setComponent(componentImpl);
    component.setComponentKey(new ComponentKey(
                                "http://jasperreports.sourceforge.net/jasperreports/components",
                                "sr", "sort"));

    component.setWidth(13);
    component.setHeight(21);

    return component;
}
项目:ireport-fork    文件:HorizontalAlignmentProperty.java   
@SuppressWarnings("unchecked")
public HorizontalAlignmentProperty(HtmlComponent component)
{
    super(HorizontalAlignEnum.class,  component);
    this.component = component;
}
项目:ireport-fork    文件:HorizontalAlignmentProperty.java   
@Override
public void setPropertyValue(Object alignment)
{
    component.setHorizontalAlign((HorizontalAlignEnum)alignment);
}