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


Java StretchTypeEnum类代码示例

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


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

示例1: writeStretchType

import net.sf.jasperreports.engine.type.StretchTypeEnum; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private void writeStretchType(StretchTypeEnum stretchType)
{
	if (isOlderVersionThan(JRConstants.VERSION_6_2_2))
	{
		switch (stretchType)
		{
			case CONTAINER_HEIGHT :
			case CONTAINER_BOTTOM :
			{
				stretchType = StretchTypeEnum.RELATIVE_TO_BAND_HEIGHT;
				break;
			}
			case ELEMENT_GROUP_HEIGHT :
			case ELEMENT_GROUP_BOTTOM :
			{
				stretchType = StretchTypeEnum.RELATIVE_TO_TALLEST_OBJECT;
				break;
			}
		}
	}
	writer.addAttribute(JRXmlConstants.ATTRIBUTE_stretchType, stretchType, StretchTypeEnum.NO_STRETCH);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:24,代码来源:JRXmlWriter.java

示例2: JRFillContext

import net.sf.jasperreports.engine.type.StretchTypeEnum; //导入依赖的package包/类
/**
 * Constructs a fill context.
 */
public JRFillContext(BaseReportFiller masterFiller)
{
	this.masterFiller = masterFiller;
	this.jasperReportsContext = masterFiller.getJasperReportsContext();
	this.styledTextUtil = JRStyledTextUtil.getInstance(jasperReportsContext);
	
	loadedImageRenderers = new HashMap<Object,Renderable>();
	renderersCache = new RenderersCache(jasperReportsContext);
	loadedSubreports = new HashMap<Object,JasperReport>();
	loadedTemplates = new HashMap<Object,JRTemplate>();
	deduplicableRegistry = new DeduplicableRegistry();
	
	FontUtil.getInstance(jasperReportsContext).resetThreadMissingFontsCache();
	
	legacyElementStretchEnabled = 
		JRPropertiesUtil.getInstance(jasperReportsContext).getBooleanProperty(
			StretchTypeEnum.PROPERTY_LEGACY_ELEMENT_STRETCH_ENABLED
			);
	
	legacyBandEvaluationEnabled = 
		JRPropertiesUtil.getInstance(jasperReportsContext).getBooleanProperty(
			JRCalculator.PROPERTY_LEGACY_BAND_EVALUATION_ENABLED
			);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:28,代码来源:JRFillContext.java

示例3: createDesign

import net.sf.jasperreports.engine.type.StretchTypeEnum; //导入依赖的package包/类
/**
 * Create a very minimal jasperdesign where the static text is placed. It is cached
 * since we don't need to create it everytime
 */
private static void createDesign()
 {
      jasperDesign = new JasperDesign();
      JRDesignBand jrBand = new JRDesignBand();
  		 jasperDesign.setTitle(jrBand);
      textElement = new JRDesignStaticText();
      jasperDesign.setLeftMargin(0);
      jasperDesign.setRightMargin(0);
      jasperDesign.setTopMargin(0);
      jasperDesign.setBottomMargin(0);
      jrBand.addElement(textElement);
      jrBand.setSplitType(SplitTypeEnum.STRETCH);
      textElement.setStretchType(StretchTypeEnum.NO_STRETCH);
      textElement.setPrintRepeatedValues(false);
      textElement.setPrintWhenDetailOverflows(true);
  }
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:21,代码来源:PreviewGenerator.java

示例4: test

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

示例5: addFieldValue

import net.sf.jasperreports.engine.type.StretchTypeEnum; //导入依赖的package包/类
private void addFieldValue(GridColumnVO columnVO) throws JRException {
  JRDesignBand bDetalle = (JRDesignBand) jasperDesign.getDetailSection().getBands()[0];

  JRDesignField f = new JRDesignField();
  f.setName(columnVO.getDbName());
  f.setValueClass(columnVO.getFieldClass());
  jasperDesign.addField(f);

  JRDesignExpressionChunk chunk = new JRDesignExpressionChunk();
  chunk.setText(columnVO.getDbName());
  chunk.setType(JRDesignExpressionChunk.TYPE_FIELD);
  JRDesignExpression expression = new JRDesignExpression();
  expression.addChunk(chunk);
  JRDesignTextField textField = new JRDesignTextField();
  textField.setWidth(columnVO.getWidth());
  textField.setHeight(bDetalle.getHeight());
  textField.setX(px);
  textField.setExpression(expression);
  textField.setBlankWhenNull(true);
  textField.setFontName(gridReportVO.getDetailBandStyle().getFontName());
  textField.setFontSize(new Float(gridReportVO.getDetailBandStyle().getFontSize()));
  textField.setForecolor(gridReportVO.getDetailBandStyle().getForeColor());
  textField.setBold(gridReportVO.getDetailBandStyle().isBold());
  textField.setItalic(gridReportVO.getDetailBandStyle().isItalic());
  textField.setUnderline(gridReportVO.getDetailBandStyle().isUnderline());
  textField.setStretchWithOverflow(true);
  textField.setStretchType(StretchTypeEnum.RELATIVE_TO_TALLEST_OBJECT);

  bDetalle.addElement(textField);
}
 
开发者ID:mauyr,项目名称:openbravo-brazil,代码行数:31,代码来源:ReportDesignBO.java

示例6: setStretchType

import net.sf.jasperreports.engine.type.StretchTypeEnum; //导入依赖的package包/类
@Override
public void setStretchType(StretchTypeEnum stretchTypeValue)
{
	StretchTypeEnum old = this.stretchTypeValue;
	this.stretchTypeValue = stretchTypeValue;
	getEventSupport().firePropertyChange(PROPERTY_STRETCH_TYPE, old, this.stretchTypeValue);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:8,代码来源:JRBaseElement.java

示例7: readObject

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

示例8: createObject

import net.sf.jasperreports.engine.type.StretchTypeEnum; //导入依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
	JRDesignGraphicElement graphicElement = (JRDesignGraphicElement)digester.peek();
	
	StretchTypeEnum stretchType = StretchTypeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_stretchType));
	if (stretchType != null)
	{
		if (log.isWarnEnabled())
		{
			log.warn("The 'stretchType' attribute in <graphicElement> tag is deprecated. Use the same attribut in <reportElement> tag instead.");
		}
			
		graphicElement.setStretchType(stretchType);
	}

	PenEnum pen = PenEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_pen));
	if (pen != null)
	{
		if (log.isWarnEnabled())
		{
			log.warn("The 'pen' attribute is deprecated. Use the <pen> tag instead.");
		}
			
		JRPenUtil.setLinePenFromPen(pen, graphicElement.getLinePen());
	}

	FillEnum fill = FillEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_fill));
	if (fill != null)
	{
		graphicElement.setFill(fill);
	}

	return graphicElement;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:36,代码来源:JRGraphicElementFactory.java

示例9: writeReportElement

import net.sf.jasperreports.engine.type.StretchTypeEnum; //导入依赖的package包/类
/**
 *
 */
private void writeReportElement( JRElement element, String elementName)
{
	if(element != null)
	{
		write( elementName + ".setKey(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(element.getKey()));
		writeStyleReferenceAttr( element, elementName);
		write( elementName + ".setPositionType({0});\n", element.getPositionTypeValue());
		write( elementName + ".setStretchType({0});\n", element.getStretchTypeValue(), StretchTypeEnum.NO_STRETCH);
		write( elementName + ".setPrintRepeatedValues({0});\n", element.isPrintRepeatedValues(),true);
		write( elementName + ".setMode({0});\n", element.getOwnModeValue());
		write( elementName + ".setX({0, number, #});\n", element.getX());
		write( elementName + ".setY({0, number, #});\n", element.getY());
		write( elementName + ".setWidth({0, number, #});\n", element.getWidth());
		write( elementName + ".setHeight({0, number, #});\n", element.getHeight());
		write( elementName + ".setRemoveLineWhenBlank({0});\n", element.isRemoveLineWhenBlank(), false);
		write( elementName + ".setPrintInFirstWholeBand({0});\n", element.isPrintInFirstWholeBand(), false);
		write( elementName + ".setPrintWhenDetailOverflows({0});\n", element.isPrintWhenDetailOverflows(), false);

		if (element.getPrintWhenGroupChanges() != null)
		{
			String groupName = getGroupName( element.getPrintWhenGroupChanges());
			write( elementName + ".setPrintWhenGroupChanges(" + groupName + ");\n");
		}
		
		write( elementName + ".setForecolor({0});\n", element.getOwnForecolor());
		write( elementName + ".setBackcolor({0});\n", element.getOwnBackcolor());

		writeProperties( element, elementName + ".getPropertiesMap()");
		writePropertyExpressions( element.getPropertyExpressions(), elementName);
		writeExpression( element.getPrintWhenExpression(), elementName, "PrintWhenExpression");
		flush();
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:37,代码来源:JRApiWriter.java

示例10: getTagList

import net.sf.jasperreports.engine.type.StretchTypeEnum; //导入依赖的package包/类
@Override
public List getTagList() 
{
    List tags = new java.util.ArrayList();
    tags.add(new Tag(StretchTypeEnum.NO_STRETCH, I18n.getString("Global.Property.Nostretch")));
    tags.add(new Tag(StretchTypeEnum.RELATIVE_TO_BAND_HEIGHT, I18n.getString("Global.Property.RelativeBandHeight")));
    tags.add(new Tag(StretchTypeEnum.RELATIVE_TO_TALLEST_OBJECT, I18n.getString("Global.Property.RBHdetail")));
    return tags;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:10,代码来源:StretchTypeProperty.java

示例11: addAlternativeRowBackground

import net.sf.jasperreports.engine.type.StretchTypeEnum; //导入依赖的package包/类
private static void addAlternativeRowBackground(int width, int height, JRDesignBand band) {
	JRDesignStaticText alt = new JRDesignStaticText();
	alt.setBackcolor(new Color(240, 240, 250));
	alt.setPrintWhenExpression(new JRDesignExpression("new java.lang.Boolean(($V{REPORT_COUNT}.intValue() % 2)==0)"));
	alt.setWidth(width);
	alt.setHeight(height);
	alt.setMode(ModeEnum.OPAQUE);
	alt.setStretchType(StretchTypeEnum.RELATIVE_TO_BAND_HEIGHT);
	band.addElement(alt);
}
 
开发者ID:PGWelch,项目名称:com.opendoorlogistics,代码行数:11,代码来源:ReportBuilderUtils.java

示例12: getStretchTypeValue

import net.sf.jasperreports.engine.type.StretchTypeEnum; //导入依赖的package包/类
@Override
public StretchTypeEnum getStretchTypeValue()
{
	return stretchTypeValue;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:6,代码来源:JRBaseElement.java

示例13: getStretchTypeValue

import net.sf.jasperreports.engine.type.StretchTypeEnum; //导入依赖的package包/类
@Override
public StretchTypeEnum getStretchTypeValue()
{
	return element.getStretchTypeValue();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:6,代码来源:ElementDecorator.java

示例14: setStretchType

import net.sf.jasperreports.engine.type.StretchTypeEnum; //导入依赖的package包/类
@Override
public void setStretchType(StretchTypeEnum stretchTypeEnum)
{
	throw new UnsupportedOperationException();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:6,代码来源:ElementDecorator.java

示例15: getStretchTypeValue

import net.sf.jasperreports.engine.type.StretchTypeEnum; //导入依赖的package包/类
@Override
public StretchTypeEnum getStretchTypeValue()
{
	return parent.getStretchTypeValue();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:6,代码来源:JRFillElement.java


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