• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JRDesignTextField类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: copyOwnTextElementStyle

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
public static void copyOwnTextElementStyle(EditTextElementData textElementData, JRDesignTextElement textElement, Locale locale) {
	textElementData.setFontName(textElement.getOwnFontName());
	textElementData.setFontSize(textElement.getOwnFontsize() != null ? NumberFormat.getNumberInstance(locale).format(textElement.getOwnFontsize()) : null);
	textElementData.setFloatFontSize(textElement.getOwnFontsize() != null ? textElement.getOwnFontsize() : null);
	textElementData.setFontBold(textElement.isOwnBold());
	textElementData.setFontItalic(textElement.isOwnItalic());
	textElementData.setFontUnderline(textElement.isOwnUnderline());
	textElementData.setFontColor(textElement.getOwnForecolor() != null ? JRColorUtil.getColorHexa(textElement.getOwnForecolor()) : null);
	textElementData.setFontBackColor(textElement.getOwnBackcolor() != null ? JRColorUtil.getColorHexa(textElement.getOwnBackcolor()) : null);
	textElementData.setFontHAlign(textElement.getOwnHorizontalTextAlign() != null ? textElement.getOwnHorizontalTextAlign().getName() : null);
	textElementData.setMode(textElement.getOwnModeValue() != null ? textElement.getOwnModeValue().getName() : null);
	
	if (textElement instanceof JRDesignTextField && TableUtil.hasSingleChunkExpression((JRDesignTextField) textElement)) {
		textElementData.setFormatPattern(((JRDesignTextField) textElement).getOwnPattern());
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:17,代码来源:HeaderToolbarElementUtils.java


示例2: copyTextElementStyle

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
public static void copyTextElementStyle(EditTextElementData textElementData, JRDesignTextElement textElement, Locale locale) {
	textElementData.setFontName(JRStringUtil.htmlEncode(textElement.getFontName()));
	textElementData.setFontSize(NumberFormat.getNumberInstance(locale).format(textElement.getFontsize()));
	textElementData.setFloatFontSize(textElement.getFontsize());
	textElementData.setFontBold(textElement.isBold());
	textElementData.setFontItalic(textElement.isItalic());
	textElementData.setFontUnderline(textElement.isUnderline());
	textElementData.setFontColor(JRColorUtil.getColorHexa(textElement.getForecolor()));
	textElementData.setFontBackColor(JRColorUtil.getColorHexa(textElement.getBackcolor()));
	textElementData.setFontHAlign(textElement.getHorizontalTextAlign().getName());
	textElementData.setMode(textElement.getModeValue().getName());
	
	if (textElement instanceof JRDesignTextField && TableUtil.hasSingleChunkExpression((JRDesignTextField) textElement)) {
		textElementData.setFormatPattern(JRStringUtil.htmlEncode(((JRDesignTextField) textElement).getPattern()));
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:17,代码来源:HeaderToolbarElementUtils.java


示例3: createDetailCells

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
private void createDetailCells(JRDesignCrosstab jdc) {
	List<JRCrosstabCell> cells = jdc.getCellsList();
	JRCrosstabMeasure[] measures = jdc.getMeasures();
	if (measures != null && cells != null)
		for (JRCrosstabCell c : cells) {
			int y = 0;
			if (c.getHeight() != null && measures.length > 0) {
				int h = c.getHeight() / measures.length;
				for (int i = 0; i < measures.length; i++) {
					JRDesignExpression exp = new JRDesignExpression();
					exp.setText("$V{" + measures[i].getName() + "}"); //$NON-NLS-1$ //$NON-NLS-2$

					JRDesignTextField tf = (JRDesignTextField) new MTextField()
							.createJRElement(getConfig().getJasperDesign());
					tf.setX(0);
					tf.setY(y);
					tf.setWidth(c.getWidth());
					tf.setHeight(h);
					tf.setExpression(exp);
					((JRDesignCellContents) c.getContents()).addElement(tf);
					y += h;
				}
			}
		}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:26,代码来源:CrosstabWizard.java


示例4: isDetailPlaceholder

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
/**
 * Check if a JRDesignTextField element is a placeholder for the text field appearance in
 * the detail
 * 
 * @param element the element
 * @return true if it is a place holder, false otherwise
 */
private boolean isDetailPlaceholder(JRDesignTextField element){
	JRExpression expression = element.getExpression();
	if (expression != null && expression.getText() != null){
		String text = expression.getText().toLowerCase();
		if (text.startsWith("\"")) { //$NON-NLS-1$
			text = text.substring(1);
		}
		if (text.endsWith("\"")) { //$NON-NLS-1$
			text = text.substring(0, text.length() - 1);
		}
		if (text.equals(FIELD_MARKER) || text.equals(FIELD_COMPATIBILITY_MARKER)){
			return true;
		}
	}
	return false;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:TableTemplateEngine.java


示例5: isGroupPlaceholder

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
/**
 * Check if a JRDesignTextField element is a placeholder for the text field appearance in
 * the detail
 * 
 * @param element the element
 * @return true if it is a place holder, false otherwise
 */
private boolean isGroupPlaceholder(JRDesignTextField element){
	JRExpression expression = element.getExpression();
	if (expression != null && expression.getText() != null){
		String text = expression.getText().toLowerCase();
		if (text.startsWith("\"")) { //$NON-NLS-1$
			text = text.substring(1);
		}
		if (text.endsWith("\"")) { //$NON-NLS-1$
			text = text.substring(0, text.length() - 1);
		}
		if (text.equals(GROUP_MARKER)){
			return true;
		}
	}
	return false;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:TableTemplateEngine.java


示例6: findTextFieldElement

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
/**
 * Find a JRDesignTextField element having exp as expression value.
 * 
 * @param band
 * @param exp
 * @return the first matching element or null.
 */
public static JRDesignTextField findTextFieldElement(JRElementGroup band, String exp) {
	JRElement[] elements = band.getElements();
	for (int i = 0; i < elements.length; ++i) {
		JRElement ele = elements[i];
		if (ele instanceof JRDesignTextField) {
			String s = ExprUtil.getExpressionText(((JRDesignTextField) ele).getExpression());
			if (s.startsWith("\"")) { //$NON-NLS-1$
				s = s.substring(1);
			}
			if (s.endsWith("\"")) { //$NON-NLS-1$
				s = s.substring(0, s.length() - 1);
			}
			if (s.equalsIgnoreCase(exp))
				return (JRDesignTextField) ele;
		} else if (ele instanceof JRElementGroup) {
			JRDesignTextField ele2 = findTextFieldElement((JRElementGroup) ele, exp);
			if (ele2 != null)
				return ele2;
		}
	}
	return null;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:30,代码来源:DefaultTemplateEngine.java


示例7: showDialog

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
public int showDialog() {
	if(!ExpressionEditorSupportUtil.isExpressionEditorDialogOpen()) {
		JRExpressionEditor wizard = new JRExpressionEditor();
		wizard.setValue(JRCloneUtils.nullSafeClone(originalExpression));
		ExpressionContext ec = ModelUtils.getElementExpressionContext((JRDesignTextField) textField.getValue(), textField);
		wizard.setExpressionContext(ec);

		WizardDialog dialog = ExpressionEditorSupportUtil.getExpressionEditorWizardDialog(UIUtils.getShell(), wizard);
		if (dialog.open() == Dialog.OK) {
			isExpressionChanged = true;
			newExpression=wizard.getValue();
			return Window.OK;
		}
	}
	isExpressionChanged=false;
	return Window.CANCEL;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:EditTextFieldExpressionCommand.java


示例8: propertyChange

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
/**
 * Wait the changes of the expression
 */
@Override
public void propertyChange(PropertyChangeEvent evt) {
	if (JRDesignExpression.PROPERTY_TEXT.equals(evt.getPropertyName()) && element != null){
		ANode parent = element.getParent();
		//Refresh also the container if it is a table or something like that
		while (parent != null){
			if (parent instanceof IGraphicalPropertiesHandler){
				((IGraphicalPropertiesHandler)parent).setChangedProperty(true);
				if (parent.getValue() instanceof JRChangeEventsSupport){
					((JRChangeEventsSupport)parent.getValue()).getEventSupport().firePropertyChange(FORCE_GRAPHICAL_REFRESH, null, null);
				}
				
			}
			parent = parent.getParent();
		}
		//Notify the change to the element, no need to set the the refresh to true, it will be done by
		//the property change since the PROPERTY_EXPRESSION is a graphical property
		element.getValue().getEventSupport().firePropertyChange(JRDesignTextField.PROPERTY_EXPRESSION, evt.getOldValue(), evt.getNewValue());
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:MTextField.java


示例9: findTextFieldElement

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
/**
 * Find in band a JRDesignTextField element having exp as expression value.
 * 
 * @param band
 * @param exp
 * @return the first matching element or null.
 */
public static JRDesignTextField findTextFieldElement(JRElementGroup band, String exp) {
	JRElement[] elements = band.getElements();
	for (int i = 0; i < elements.length; ++i) {
		JRElement ele = elements[i];
		if (ele instanceof JRDesignTextField) {
			String s = ExprUtil.getExpressionText(((JRDesignTextField) ele).getExpression());
			if (s.startsWith("\"")) {
				s = s.substring(1);
			}
			if (s.endsWith("\"")) {
				s = s.substring(0, s.length() - 1);
			}
			if (s.equalsIgnoreCase(exp))
				return (JRDesignTextField) ele;
		} else if (ele instanceof JRElementGroup) {
			JRDesignTextField ele2 = findTextFieldElement((JRElementGroup) ele, exp);
			if (ele2 != null)
				return ele2;
		}
	}
	return null;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:30,代码来源:ReportGenerator.java


示例10: execute

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
@Override
public void execute() {
	MStaticText modelText = new MStaticText();
	
	JRDesignStaticText labelObject = (JRDesignStaticText)modelText.createJRElement(elementToCopy.getJasperDesign());
	JRDesignTextField textObject = (JRDesignTextField)elementToCopy.getValue();

	cloneTextField(labelObject, textObject);
	
	
	modelText.setValue(labelObject);
	Rectangle position = new Rectangle(textObject.getX(),textObject.getY(),textObject.getWidth(),textObject.getHeight());

	int oldIndex = ModelUtils.getChildrenPosition(elementToCopy);
	cmd = new CreateElementCommand(parent, modelText, position, oldIndex);
	cmd.setJasperDesign(parent.getJasperDesign());
	cmd.execute();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:19,代码来源:ConvertTextIntoStatic.java


示例11: execute

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
@Override
public void execute() {
	MTextField modelText = new MTextField();
	
	JRDesignStaticText labelObject = (JRDesignStaticText)elementToCopy.getValue();
	JRDesignTextField textObject =  (JRDesignTextField)modelText.createJRElement(elementToCopy.getJasperDesign());

	cloneTextField(textObject, labelObject);
	
	modelText.setValue(textObject);
	Rectangle position = new Rectangle(labelObject.getX(),labelObject.getY(),labelObject.getWidth(),labelObject.getHeight());

	int oldIndex = ModelUtils.getChildrenPosition(elementToCopy);
	cmd = new CreateElementCommand(parent, modelText, position, oldIndex);
	cmd.setJasperDesign(parent.getJasperDesign());
	cmd.execute();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:ConvertStaticIntoText.java


示例12: fixElementsExpressions

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
public static void fixElementsExpressions(JRDesignElementGroup group, String oldName, String newName, byte chunckType, String newClassName) {
    
    List list = group.getChildren();
    for (int i=0; i<list.size(); ++i)
    {
        Object obj = list.get(i);
        if (obj == null) continue;
        if (obj instanceof JRDesignElementGroup)
        {
            fixElementsExpressions((JRDesignElementGroup)obj,oldName,newName,chunckType,newClassName);
        }
        else if (obj instanceof JRDesignTextField)
        {
            fixElementExpressionText((JRDesignTextField)obj,oldName,newName,chunckType,newClassName);
        }
        else if (obj instanceof JRDesignImage)
        {
            fixElementExpressionImage((JRDesignImage)obj,oldName,newName,chunckType,newClassName);
        }
        
        
    }
    
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:25,代码来源:ModelUtils.java


示例13: setString

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
@Override
public void setString(String value) {
   if (getBucket().getExpression() != null)
   {
       getBucket().setValueClassName(value);
       ((JRDesignExpression)getBucket().getExpression()).setValueClassName(value);

       // Introspect the crosstab and change the class for all the expressions which use this group name...
       List<JRDesignElement> elements = ModelUtils.getAllElements(crosstab);
       for (JRDesignElement ele : elements)
       {
           if (ele instanceof JRDesignTextField)
           {
               JRDesignTextField dtf = (JRDesignTextField)ele;
               if (dtf.getExpression() != null &&
                   dtf.getExpression().getText() != null &&
                   dtf.getExpression().getText().trim().equals("$V{" + group.getName() + "}"))
               {
                   ((JRDesignExpression)dtf.getExpression()).setValueClassName(value);
               }
           }
       }
   }
    
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:26,代码来源:CrosstabGroupNode.java


示例14: getTextFieldPropertySet

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
/**
 * Get the static text properties...
 */
public static Sheet.Set getTextFieldPropertySet(JRDesignTextField element, JasperDesign jd)
{
    
    JRDesignDataset dataset = ModelUtils.getElementDataset(element, jd);
    Sheet.Set propertySet = Sheet.createPropertiesSet();
    propertySet.setName("TEXTFIELD_ELEMENT_PROPERTIES");
    propertySet.setDisplayName("Text field properties");
    propertySet.put(new TextFieldExpressionProperty(element, dataset));
    propertySet.put(new TextFieldExpressionClassNameProperty(element));
    propertySet.put(new BlankWhenNullProperty(element));
    propertySet.put(new TextFieldPatternProperty(element));
    propertySet.put(new TextfieldPatternExpressionProperty(element,dataset));
    propertySet.put(new StretchWithOverflowProperty( element ));
    propertySet.put(new TextFieldEvaluationTimeProperty(element, dataset));
    propertySet.put(new TextFieldEvaluationGroupProperty(element, dataset));
    
    //propertySet.put(new LeftProperty( element ));
    return propertySet;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:23,代码来源:TextElementPropertiesFactory.java


示例15: getPropertySets

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
/**
 * Convenient way to get all the properties of an element.
 * Properties positions could be reordered to have a better order.
 */
public static List<Sheet.Set> getPropertySets(JRDesignElement element, JasperDesign jd)
{
    List<Sheet.Set> sets = new ArrayList<Sheet.Set>();
    
    if (element instanceof  JRDesignStaticText)
    {
        sets.add( getStaticTextPropertySet((JRDesignStaticText)element, jd ));
    }
    else if (element instanceof  JRDesignTextField)
    {
        sets.add( getTextFieldPropertySet((JRDesignTextField)element, jd ));
    }
    
    if (element instanceof  JRDesignTextElement)
    {
        sets.add( getTextPropertySet((JRDesignTextElement)element, jd) );
    }
    
    return sets;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:25,代码来源:TextElementPropertiesFactory.java


示例16: createField

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
private JRDesignTextField createField(JasperDesign jd, JRDesignExpression exp, int w, int h, String styleName)
{
    JRDesignTextField element = new JRDesignTextField();
    element.setX(0);
    element.setY(0);
    element.setWidth(w);
    element.setHeight(h);
    
    if (styleName != null && jd.getStylesMap().containsKey(styleName))
    {
        element.setStyle( (JRStyle) jd.getStylesMap().get(styleName) );
    }
    
    try {
        CreateTextFieldAction.setMatchingClassExpression(exp,exp.getValueClassName(), true);
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    element.setExpression(exp);
    return element;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:22,代码来源:NewTypesUtils.java


示例17: createReportElement

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
@Override
public JRDesignElement createReportElement(JasperDesign jasperDesign)
{
    JRDesignTextField element = (JRDesignTextField)super.createReportElement( jasperDesign );

    JRDesignField field = (JRDesignField)getPaletteItem().getData();

    ((JRDesignExpression)element.getExpression()).setText("$F{"+ field.getName() + "}");
    setMatchingClassExpression(
        ((JRDesignExpression)element.getExpression()), 
        field.getValueClassName(), 
        true
        );

    return element;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:17,代码来源:CreateTextFieldFromFieldAction.java


示例18: createReportElement

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
@Override
public JRDesignElement createReportElement(JasperDesign jd)
{
     JRDesignTextField element = (JRDesignTextField)super.createReportElement( jd );

    ((JRDesignExpression)element.getExpression()).setText("$V{PAGE_NUMBER}");
    ((JRDesignExpression)element.getExpression()).setValueClassName("java.lang.Integer");

    element.setEvaluationTime( EvaluationTimeEnum.REPORT);
    setMatchingClassExpression(
        ((JRDesignExpression)element.getExpression()),
        "java.lang.Integer",
        true
        );

    return element;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:18,代码来源:CreateTotalPagesTextfieldAction.java


示例19: createReportElement

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
@Override
public JRDesignElement createReportElement(JasperDesign jd)
{
    JRDesignTextField element = (JRDesignTextField)super.createReportElement( jd );

    ((JRDesignExpression)element.getExpression()).setText("$V{PAGE_NUMBER}");
    ((JRDesignExpression)element.getExpression()).setValueClassName("java.lang.Integer");

    setMatchingClassExpression(
        ((JRDesignExpression)element.getExpression()),
        "java.lang.Integer",
        true
        );

    return element;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:17,代码来源:CreatePageNumberTextfieldAction.java


示例20: actionPerformed

import net.sf.jasperreports.engine.design.JRDesignTextField; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
    // Look for selected elements...
    JrxmlVisualView view = IReportManager.getInstance().getActiveVisualView();

    if (view == null) return;

    AbstractReportObjectScene scene = view.getReportDesignerPanel().getActiveScene();
    if (scene == null) return;

    if (scene.getSelectedObjects().isEmpty()) return;

    Object selectedObject = scene.getSelectedObjects().iterator().next();

    if (selectedObject instanceof JRDesignTextField)
    {
       // Find the node for this element...
        Node node = IReportManager.getInstance().findNodeOf(selectedObject, view.getExplorerManager().getRootContext());
        if (node != null)
        {
            SystemAction.get(EditTextfieldExpressionAction.class).performAction(new Node[]{node});
        }
    }


}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:26,代码来源:ElementF2Action.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CompilationUnitEditor类代码示例发布时间:2022-05-22
下一篇:
Java EmptyProgressIndicator类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap