本文整理汇总了Java中net.sf.jasperreports.engine.design.JRDesignBand类的典型用法代码示例。如果您正苦于以下问题:Java JRDesignBand类的具体用法?Java JRDesignBand怎么用?Java JRDesignBand使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JRDesignBand类属于net.sf.jasperreports.engine.design包,在下文中一共展示了JRDesignBand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addFieldHeader
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
private void addFieldHeader(GridColumnVO columnVO) {
JRDesignBand bHeader = (JRDesignBand) jasperDesign.getColumnHeader();
JRDesignStaticText text = new JRDesignStaticText();
text.setText(columnVO.getTitle());
text.setWidth(columnVO.getWidth());
text.setHeight(bHeader.getHeight());
text.setX(px);
// Set syle
text.setFontName(gridReportVO.getHeaderBandStyle().getFontName());
text.setFontSize(new Float(gridReportVO.getHeaderBandStyle().getFontSize()));
text.setForecolor(gridReportVO.getHeaderBandStyle().getForeColor());
text.setBold(gridReportVO.getHeaderBandStyle().isBold());
text.setItalic(gridReportVO.getHeaderBandStyle().isItalic());
text.setUnderline(gridReportVO.getHeaderBandStyle().isUnderline());
if (log4j.isDebugEnabled())
log4j.debug("Field Header, field: " + columnVO.getTitle() + " Width: " + columnVO.getWidth()
+ " X: " + px);
bHeader.addElement(text);
}
示例2: createDetailBand
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
protected JRBand createDetailBand(List<FillColumn> fillColumns)
{
final JRDesignBand detailBand = new JRDesignBand();
detailBand.setSplitType(SplitTypeEnum.PREVENT);
ReportBandInfo bandInfo = new ReportBandInfo(detailBand, BandTypeEnum.DETAIL.getName());
int xOffset = 0;
for (FillColumn subcolumn : fillColumns)
{
DetailBandCreator subVisitor = new DetailBandCreator(
bandInfo, subcolumn, xOffset, 0, 0);
subVisitor.visit();
xOffset = subVisitor.xOffset;
}
setPdfTags(bandInfo, false);
return detailBand;
}
示例3: createColumnHeader
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
protected JRDesignBand createColumnHeader(List<FillColumn> fillColumns)
{
JRDesignBand columnHeader = new JRDesignBand();
columnHeader.setSplitType(SplitTypeEnum.PREVENT);
ReportBandInfo bandInfo = new ReportBandInfo(columnHeader, BandTypeEnum.COLUMN_HEADER.getName());
int xOffset = 0;
for (FillColumn subcolumn : fillColumns)
{
ColumnHeaderCreator subVisitor = new ColumnHeaderCreator(
bandInfo, subcolumn, xOffset, 0, 0, headerHtmlBaseProperties,
new AtomicBoolean());
subVisitor.visit();
xOffset = subVisitor.xOffset;
}
setPdfTags(bandInfo, true);
if (columnHeader.getHeight() == 0)
{
columnHeader = null;
}
return columnHeader;
}
示例4: createPageFooter
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
protected JRDesignBand createPageFooter(List<FillColumn> fillColumns)
{
JRDesignBand pageFooter = new JRDesignBand();
pageFooter.setSplitType(SplitTypeEnum.PREVENT);
ReportBandInfo bandInfo = new ReportBandInfo(pageFooter, BandTypeEnum.PAGE_FOOTER.getName());
int xOffset = 0;
for (FillColumn subcolumn : fillColumns)
{
PageFooterCreator subVisitor = new PageFooterCreator(
bandInfo, subcolumn, xOffset, 0, 0);
subVisitor.visit();
xOffset = subVisitor.xOffset;
}
setPdfTags(bandInfo, false);
if (pageFooter.getHeight() == 0)
{
pageFooter = null;
}
return pageFooter;
}
示例5: createTitle
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
protected JRDesignBand createTitle(List<FillColumn> fillColumns)
{
JRDesignBand title = new JRDesignBand();
title.setSplitType(SplitTypeEnum.PREVENT);
ReportBandInfo bandInfo = new ReportBandInfo(title, BandTypeEnum.TITLE.getName());
int xOffset = 0;
for (FillColumn subcolumn : fillColumns)
{
TitleCreator subVisitor = new TitleCreator(
bandInfo, subcolumn, xOffset, 0, 0);
subVisitor.visit();
xOffset = subVisitor.xOffset;
}
setPdfTags(bandInfo, false);
if (title.getHeight() == 0) //FIXMETABLE not sure we actually need this; maybe check the section is truly empty; do the same for the other sections as well
{
title = null;
}
return title;
}
示例6: createSummary
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
protected JRDesignBand createSummary(List<FillColumn> fillColumns)
{
JRDesignBand summary = new JRDesignBand();
summary.setSplitType(SplitTypeEnum.PREVENT);
ReportBandInfo bandInfo = new ReportBandInfo(summary, BandTypeEnum.SUMMARY.getName());
int xOffset = 0;
for (FillColumn subcolumn : fillColumns)
{
SummaryCreator subVisitor = new SummaryCreator(
bandInfo, subcolumn, xOffset, 0, 0);
subVisitor.visit();
xOffset = subVisitor.xOffset;
}
setPdfTags(bandInfo, false);
if (summary.getHeight() == 0)
{
summary = null;
}
return summary;
}
示例7: createGroupHeader
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
protected JRBand createGroupHeader(String groupName, List<FillColumn> fillColumns)
{
JRDesignBand header = new JRDesignBand();
header.setSplitType(SplitTypeEnum.PREVENT);
ReportBandInfo bandInfo = new ReportBandInfo(header, BandTypeEnum.GROUP_HEADER + "-" + groupName);
int xOffset = 0;
for (FillColumn subcolumn : fillColumns)
{
GroupHeaderCreator subVisitor = new GroupHeaderCreator(groupName,
bandInfo, subcolumn, xOffset, 0, 0);
subVisitor.visit();
xOffset = subVisitor.xOffset;
}
setPdfTags(bandInfo, false);
if (header.getHeight() == 0)
{
header = null;
}
return header;
}
示例8: createGroupFooter
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
protected JRBand createGroupFooter(String groupName, List<FillColumn> fillColumns)
{
JRDesignBand footer = new JRDesignBand();
footer.setSplitType(SplitTypeEnum.PREVENT);
ReportBandInfo bandInfo = new ReportBandInfo(footer, BandTypeEnum.GROUP_FOOTER + "-" + groupName);
int xOffset = 0;
for (FillColumn subcolumn : fillColumns)
{
GroupFooterCreator subVisitor = new GroupFooterCreator(groupName,
bandInfo, subcolumn, xOffset, 0, 0);
subVisitor.visit();
xOffset = subVisitor.xOffset;
}
setPdfTags(bandInfo, false);
if (footer.getHeight() == 0)
{
footer = null;
}
return footer;
}
示例9: getBand4Point
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
/**
* Gets the band4 point.
*
* @param jd
* the jd
* @param point
* the point
* @return the band4 point
*/
public static MBand getBand4Point(INode jd, Point point) {
INode res = jd;
INode rNode = jd; // root node from drag&drop operation
int xband = jd.getJasperDesign().getTopMargin();
// iterate IGraphicElements, and look at their position
// find the top level container for this element
for (INode n : rNode.getChildren()) {
if (n instanceof IGraphicElement) {
Object de = n.getValue();
if (de instanceof JRDesignBand) {
JRDesignBand deband = (JRDesignBand) de;
res = (ANode) n;
if (point.y >= xband && point.y < xband + deband.getHeight()) {
// go to children, we have the band allready
break;
}
xband += deband.getHeight();
}
}
}
if (res instanceof MBand)
return (MBand) res;
return null;
}
示例10: getBandLocation
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
/**
* Gets the band location.
*
* @param b
* the b
* @param jd
* the jd
* @return the band location
*/
public static int getBandLocation(JRBand b, JasperDesign jd) {
int yLocation = jd.getTopMargin();
List<JRBand> bands = ModelUtils.getBands(jd);
for (JRBand tmpBand : bands) {
// Detached background...
if (tmpBand instanceof JRDesignBand) {
if (((JRDesignBand) tmpBand).getOrigin().getBandTypeValue().equals(BandTypeEnum.BACKGROUND)) {
// if (IReportManager.getInstance().isBackgroundSeparated())
// {
// yLocation += jd.getTopMargin();
// yLocation += jd.getBottomMargin();
// yLocation += 40;
// }
}
}
if (tmpBand == b)
return yLocation;
yLocation += tmpBand.getHeight();
}
return yLocation;
}
示例11: getDisplayText
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
public String getDisplayText() {
JRDesignBand value = (JRDesignBand) getValue();
String hiddenText = new String();
if (!isVisible()){
hiddenText = Messages.MBand_hiddenLabel;
}
if (bandType.equals(BandTypeEnum.DETAIL)) {
String index = ""; //$NON-NLS-1$
if (bandIndex != -1)
index = " " + String.valueOf(bandIndex); //$NON-NLS-1$
if (value != null)
return Messages.MBand_detail + index + " [" + value.getHeight() + "px]"+hiddenText;// + value.hashCode(); //$NON-NLS-1$ //$NON-NLS-2$
return Messages.MBand_detail + index + " "; //$NON-NLS-1$
}
if (value == null)
return MessagesByKeys.getString(bandType.getName());
return MessagesByKeys.getString(value.getOrigin().getBandTypeValue().getName()+hiddenText);
}
示例12: getPropertyValue
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
public Object getPropertyValue(Object id) {
JRDesignBand jrband = (JRDesignBand) getValue();
if (jrband != null) {
if (id.equals(JRDesignBand.PROPERTY_HEIGHT))
return new Integer(jrband.getHeight());
if (id.equals(JRDesignBand.PROPERTY_SPLIT_TYPE))
return splitStyleD.getEnumValue(jrband.getSplitTypeValue());
if (id.equals(JRDesignBand.PROPERTY_PRINT_WHEN_EXPRESSION)) {
return ExprUtil.getExpression(jrband.getPrintWhenExpression());
}
if (id.equals(MGraphicElement.PROPERTY_MAP)) {
// to avoid duplication I remove it first
return jrband.getPropertiesMap().cloneProperties();
}
}
return null;
}
示例13: setPropertyValue
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
public void setPropertyValue(Object id, Object value) {
JRDesignBand jrband = (JRDesignBand) getValue();
if (jrband != null) {
if (id.equals(JRDesignBand.PROPERTY_HEIGHT)) {
jrband.setHeight(Math.max(0, (Integer) Misc.nvl(value, Integer.valueOf(0))));
} else if (id.equals(JRDesignBand.PROPERTY_SPLIT_TYPE))
jrband.setSplitType((SplitTypeEnum) splitStyleD.getEnumValue(value));
else if (id.equals(JRDesignBand.PROPERTY_PRINT_WHEN_EXPRESSION))
jrband.setPrintWhenExpression(ExprUtil.setValues(jrband.getPrintWhenExpression(), value, null));
else if (id.equals(MGraphicElement.PROPERTY_MAP)) {
JRPropertiesMap v = (JRPropertiesMap) value;
String[] names = jrband.getPropertiesMap().getPropertyNames();
for (int i = 0; i < names.length; i++) {
jrband.getPropertiesMap().removeProperty(names[i]);
}
names = v.getPropertyNames();
for (int i = 0; i < names.length; i++)
jrband.getPropertiesMap().setProperty(names[i], v.getProperty(names[i]));
this.getPropertyChangeSupport().firePropertyChange(MGraphicElement.PROPERTY_MAP, false, true);
}
}
}
示例14: getBounds
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
public Rectangle getBounds() {
INode parent = getParent();
Rectangle parentBounds = ((IGraphicElement) parent).getBounds();
Rectangle bounds = new Rectangle(parentBounds);
if (getValue() == null) {
return parentBounds;
} else {
bounds.setSize(parentBounds.width, ((JRDesignBand) getValue()).getHeight());
int h = 0;
for (INode b : parent.getChildren()) {
if (b == this)
break;
if (b instanceof MBand) {
if (b.getValue() != null)
h += ((JRDesignBand) b.getValue()).getHeight() + BAND_GAP;
}
}
bounds.setLocation(parentBounds.x, h + getJasperDesign().getTopMargin());
}
return bounds;
}
示例15: handleBandChanged
import net.sf.jasperreports.engine.design.JRDesignBand; //导入依赖的package包/类
/**
* Handle band changed.
*
* @param evt
* the evt
*/
private void handleBandChanged(PropertyChangeEvent evt) {
for (Iterator<?> it = getChildren().iterator(); it.hasNext();) {
ANode node = (ANode) it.next();
if (node instanceof MBand) {
MBand mBand = (MBand) node;
if (evt.getPropertyName().equals(mBand.getBandType().getName())) {
mBand.setValue(evt.getNewValue());
if (evt.getNewValue() != null)
ReportFactory.createElementsForBand(mBand, ((JRDesignBand) evt.getNewValue()).getChildren());
else
mBand.removeChildren();
mBand.propertyChange(new PropertyChangeEvent(mBand, "VALUE", evt.getOldValue(), evt.getNewValue())); //$NON-NLS-1$
break;
}
}
}
}