本文整理汇总了Java中net.sf.jasperreports.engine.design.JRDesignBand.getHeight方法的典型用法代码示例。如果您正苦于以下问题:Java JRDesignBand.getHeight方法的具体用法?Java JRDesignBand.getHeight怎么用?Java JRDesignBand.getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.jasperreports.engine.design.JRDesignBand
的用法示例。
在下文中一共展示了JRDesignBand.getHeight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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);
}
示例9: 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;
}
示例10: ResizeCommand
import net.sf.jasperreports.engine.design.JRDesignBand; //导入方法依赖的package包/类
public ResizeCommand(int alignement, MGraphicElement m) {
super();
this.alignement = alignement;
jrElement = (JRDesignElement) m.getValue();
INode n = m.getParent();
//Get the real parent of the element if it's inside a subeditor
if (n instanceof MPage){
MPage page = (MPage)n;
n = page.getRealParent();
}
if (n instanceof IContainer) {
if (n instanceof MBand) {
// height of band, width of Report - margins
JRDesignBand band = (JRDesignBand) ((MBand) n).getValue();
int h = band.getHeight();
JasperDesign jasperDesign = m.getJasperDesign();
int w = jasperDesign.getPageWidth() - jasperDesign.getLeftMargin() - jasperDesign.getRightMargin();
parent = new Dimension(w, h);
} else if (n instanceof IGraphicElementContainer)
parent = ((IGraphicElementContainer) n).getSize();
}
}
示例11: getDisplayText
import net.sf.jasperreports.engine.design.JRDesignBand; //导入方法依赖的package包/类
@Override
public String getDisplayText() {
if (getJrGroup() == null) return super.getDisplayText();
JRDesignBand value = (JRDesignBand) getValue();
String index = "";
if (bandIndex != -1) index = " " + String.valueOf(bandIndex);
if (value != null){
return jrGroup.getName() + " " + Messages.MBandGroupHeader_group_header + index + " [" + value.getHeight() + "px] ";// + value.hashCode(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return jrGroup.getName() + " " + Messages.MBandGroupHeader_group_header + index;//$NON-NLS-1$
}
示例12: getBandResizeCommand
import net.sf.jasperreports.engine.design.JRDesignBand; //导入方法依赖的package包/类
public Command getBandResizeCommand(MBand mband, JasperDesign jDesign) {
JRDesignBand band = mband.getValue();
int w = jDesign.getPageWidth() - jDesign.getLeftMargin() - jDesign.getRightMargin();
// Check if the size is valid
int maxHeight = BandResizeTracker.getMaxBandHeight(band, jDesign);
if (band.getHeight() > maxHeight) {
band.setHeight(maxHeight - 1);
}
Dimension d = new Dimension(w, band.getHeight());
ILayout layout = LayoutManager.getLayout(new JRPropertiesHolder[] { band }, jDesign, null);
return new LayoutCommand(band, layout, d);
}
示例13: getDisplayText
import net.sf.jasperreports.engine.design.JRDesignBand; //导入方法依赖的package包/类
@Override
public String getDisplayText() {
if (getJrGroup() == null)
return super.getDisplayText();
JRDesignBand value = (JRDesignBand) getValue();
String index = "";
if (bandIndex != -1)
index = " " + String.valueOf(bandIndex);
if (value != null)
return jrGroup.getName()
+ " " + Messages.MBandGroupFooter_group_footer + index + " [" + value.getHeight() + "px] ";// + value.hashCode(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
return jrGroup.getName() + " " + Messages.MBandGroupFooter_group_footer + index; //$NON-NLS-1$
}
示例14: setupBandFigure
import net.sf.jasperreports.engine.design.JRDesignBand; //导入方法依赖的package包/类
private void setupBandFigure(IFigure rect) {
JRDesignBand jrBand = getBand();
MBand bandNode = (MBand) getModel();
Rectangle bounds = (bandNode).getBounds();
JasperDesign jasperDesign = getJasperDesign();
BandFigure bfig = (BandFigure) rect;
bfig.setMarginLeft(jasperDesign.getLeftMargin());
bfig.setMarginRight(jasperDesign.getRightMargin());
bfig.setColumnNumber(jasperDesign.getColumnCount());
bfig.setColumnWidth(jasperDesign.getColumnWidth());
bfig.setColumnSpacing(jasperDesign.getColumnSpacing());
// int width = jasperDesign.getPageWidth() + PageFigure.PAGE_BORDER.left + 1;
int width = jasperDesign.getPageWidth() + 1;
int height = jrBand != null ? jrBand.getHeight() + 1 : 0;
rect.setBounds(new Rectangle(ReportPageFigure.PAGE_BORDER.left, bounds.y + ReportPageFigure.PAGE_BORDER.top, width,
height));
// rect.setBounds(new Rectangle(0, bounds.y + PageFigure.PAGE_BORDER.top, width, height));
// update tooltip and band text (shown in background)
bfig.setToolTip(new Label(bandNode.getToolTip()));
bfig.setBandText(bandNode.getSimpleDisplayName());
if (getSelected() == 1)
updateRulers();
else {
List<?> selected = getViewer().getSelectedEditParts();
if (selected.isEmpty())
updateRulers();
else
for (Object obj : selected) {
if (obj instanceof FigureEditPart) {
FigureEditPart figEditPart = (FigureEditPart) obj;
if (figEditPart.getModel().getParent() == bandNode)
figEditPart.updateRulers();
}
}
}
}
示例15: performAction
import net.sf.jasperreports.engine.design.JRDesignBand; //导入方法依赖的package包/类
protected void performAction(org.openide.nodes.Node[] activatedNodes) {
JRDesignBand band = ((BandNode)activatedNodes[0]).getBand();
int height = ModelUtils.getMaxBandHeight(band, ((BandNode)activatedNodes[0]).getJasperDesign() );
int oldValue = band.getHeight();
if (oldValue < height)
{
band.setHeight(height);
ObjectPropertyUndoableEdit undo = new ObjectPropertyUndoableEdit(band,"Height",Integer.TYPE,oldValue,height);
IReportManager.getInstance().addUndoableEdit(undo);
IReportManager.getInstance().notifyReportChange();
}
}