当前位置: 首页>>代码示例>>Java>>正文


Java HorizontalAlignEnum类代码示例

本文整理汇总了Java中net.sf.jasperreports.engine.type.HorizontalAlignEnum的典型用法代码示例。如果您正苦于以下问题:Java HorizontalAlignEnum类的具体用法?Java HorizontalAlignEnum怎么用?Java HorizontalAlignEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HorizontalAlignEnum类属于net.sf.jasperreports.engine.type包,在下文中一共展示了HorizontalAlignEnum类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setPropertyValue

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
@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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:21,代码来源:MTextElement.java

示例2: widgetSelected

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
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);
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:TextualContributionItem.java

示例3: convert

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
/**
 *
 */
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;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:28,代码来源:MapDesignConverter.java

示例4: createLabel

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
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;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:18,代码来源:NewTypesUtils.java

示例5: modifyHorizontalAlignment

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
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);
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:26,代码来源:TextElementsToolbar.java

示例6: test

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
@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);
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:22,代码来源:Style8Test.java

示例7: test

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
@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);
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:18,代码来源:Style5Test.java

示例8: setPropertyValue

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
@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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:28,代码来源:MHtml.java

示例9: setPropertyValue

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
@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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:30,代码来源:MSort.java

示例10: setHorizonltalAlignment

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:8,代码来源:TextStyleWizardPage.java

示例11: createDefaultElement

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
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;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:32,代码来源:TextStyleWizardPage.java

示例12: TextStyle

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:37,代码来源:TextStyle.java

示例13: getTagList

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
@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;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:11,代码来源:HandlerHorizontalAlignmentProperty.java

示例14: getTagList

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
@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;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:10,代码来源:HorizontalAlignmentProperty.java

示例15: createLabel

import net.sf.jasperreports.engine.type.HorizontalAlignEnum; //导入依赖的package包/类
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;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:13,代码来源:CreateCrosstabAction.java


注:本文中的net.sf.jasperreports.engine.type.HorizontalAlignEnum类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。