本文整理汇总了Java中net.sf.jasperreports.engine.type.BandTypeEnum.BACKGROUND属性的典型用法代码示例。如果您正苦于以下问题:Java BandTypeEnum.BACKGROUND属性的具体用法?Java BandTypeEnum.BACKGROUND怎么用?Java BandTypeEnum.BACKGROUND使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.sf.jasperreports.engine.type.BandTypeEnum
的用法示例。
在下文中一共展示了BandTypeEnum.BACKGROUND属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBandLocation
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() == BandTypeEnum.BACKGROUND)
{
if (IReportManager.getInstance().isBackgroundSeparated())
{
yLocation += jd.getTopMargin();
yLocation += jd.getBottomMargin();
yLocation += 40;
}
}
}
if (tmpBand == b) return yLocation;
yLocation += tmpBand.getHeight();
}
return yLocation;
}
示例2: getActions
@Override
public Action[] getActions(boolean popup) {
java.util.List<Action> list = new ArrayList<Action>();
list.add( SystemAction.get(AddBandAction.class));
if (band.getOrigin().getBandTypeValue() == BandTypeEnum.BACKGROUND)
{
list.add(SystemAction.get(MaximizeBackgroundAction.class));
}
JRDesignGroup group = getGroup();
if (group != null)
{
list.add( null );
list.add( SystemAction.get(MoveGroupUpAction.class));
list.add( SystemAction.get(MoveGroupDownAction.class));
list.add( DeleteGroupAction.getInstance() );
}
return list.toArray(new Action[list.size()]);
}
示例3: addBandSeparatorWidget
public void addBandSeparatorWidget(JRBand b, int yLocation)
{
if (b == null) return;
if (b instanceof JRDesignBand &&
((JRDesignBand)b).getOrigin().getBandTypeValue() == BandTypeEnum.BACKGROUND)
{
((JRDesignBand)b).getEventSupport().removePropertyChangeListener(JRDesignBand.PROPERTY_HEIGHT, this);
if (IReportManager.getInstance().isBackgroundSeparated() && b.getHeight() == 0)
{
((JRDesignBand)b).getEventSupport().addPropertyChangeListener(JRDesignBand.PROPERTY_HEIGHT, this);
return;
}
}
BandSeparatorWidget bbw = new BandSeparatorWidget(this, b);
bbw.getActions().addAction( new BandMoveAction(true, InputEvent.SHIFT_DOWN_MASK) );
bbw.getActions().addAction( new BandMoveAction() );
bbw.getActions().addAction( new BandDblClickResizeAction());
bandSeparatorsLayer.addChild(bbw);
bandLayer.addChild(new BandWidget(this, b));
}
示例4: getBandAt
/**
* Return the band at the specified point.
* In the point is not inside a band, it returns null;
**/
public static JRDesignBand getBandAt(JasperDesign jd, Point p)
{
if (p.x < jd.getLeftMargin()) return null;
if (p.x > jd.getPageWidth() - jd.getRightMargin()) return null;
if (p.y < jd.getTopMargin()) return null;
List<JRBand> bands = ModelUtils.getBands(jd);
int currentHeight = jd.getTopMargin();
for (JRBand tmpBand : bands)
{
if (tmpBand instanceof JRDesignBand)
{
if (((JRDesignBand)tmpBand).getOrigin().getBandTypeValue() == BandTypeEnum.BACKGROUND &&
IReportManager.getInstance().isBackgroundSeparated())
{
continue;
}
}
currentHeight += tmpBand.getHeight();
if (p.y < currentHeight) return (JRDesignBand)tmpBand;
}
if (IReportManager.getInstance().isBackgroundSeparated() &&
jd.getBackground() != null &&
jd.getBackground().getHeight() > 0 )
{
currentHeight += 40 + jd.getTopMargin() + jd.getBottomMargin();
if (p.y >= currentHeight &&
p.y < jd.getBackground().getHeight() + currentHeight)
{
return (JRDesignBand)jd.getBackground();
}
}
return null;
}
示例5: getActions
@Override
public Action[] getActions(boolean popup) {
java.util.List<Action> list = new ArrayList<Action>();
list.add( SystemAction.get(PasteAction.class));
list.add( SystemAction.get(RefreshNodes.class));
if (getBand().getOrigin().getBandTypeValue() == BandTypeEnum.BACKGROUND)
{
list.add(SystemAction.get(MaximizeBackgroundAction.class));
}
else
{
list.add(SystemAction.get(MaximizeBandAction.class));
}
if (getBand().getOrigin().getBandTypeValue() == BandTypeEnum.DETAIL)
{
list.add(SystemAction.get(AddAnotherDetailBandAction.class));
}
if (group != null)
{
list.add( null );
list.add( SystemAction.get(MoveGroupUpAction.class));
list.add( SystemAction.get(MoveGroupDownAction.class));
list.add( DeleteGroupAction.getInstance() );
list.add(null);
list.add( SystemAction.get(AddAnotherGroupHeaderBandAction.class));
list.add( SystemAction.get(AddAnotherGroupFooterBandAction.class));
}
list.add( DeleteBandAction.getInstance());
return list.toArray(new Action[list.size()]);
}