本文整理汇总了Java中net.sf.jasperreports.engine.type.RunDirectionEnum.RTL属性的典型用法代码示例。如果您正苦于以下问题:Java RunDirectionEnum.RTL属性的具体用法?Java RunDirectionEnum.RTL怎么用?Java RunDirectionEnum.RTL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.sf.jasperreports.engine.type.RunDirectionEnum
的用法示例。
在下文中一共展示了RunDirectionEnum.RTL属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: concreteHorizontalPosition
protected HorizontalPosition concreteHorizontalPosition()
{
HorizontalPosition position = getHorizontalPosition();
if (position == null)
{
position = getRunDirectionValue() == RunDirectionEnum.RTL
? HorizontalPosition.RIGHT : HorizontalPosition.LEFT;
}
return position;
}
示例2: setOffsetX
/**
*
*/
private void setOffsetX()
{
if (columnDirection == RunDirectionEnum.RTL)
{
offsetX = pageWidth - rightMargin - columnWidth - columnIndex * (columnSpacing + columnWidth);
}
else
{
offsetX = leftMargin + columnIndex * (columnSpacing + columnWidth);
}
}
示例3: getCrosstabChildren
/**
*
*/
private List<JRPrintElement> getCrosstabChildren(ReportConverter reportConverter, JRCrosstab crosstab)
{
List<JRPrintElement> crosstabElements = new ArrayList<JRPrintElement>();
int yOffset = 0;
if (crosstab.getTitleCell() != null
&& crosstab.getTitleCell().getHeight() > 0
&& crosstab.getTitleCell().getCellContents() != null)
{
crosstabElements.add(getCrosstabCellFrame(reportConverter, crosstab.getTitleCell().getCellContents(),
0, yOffset, false, false, false));
yOffset += crosstab.getTitleCell().getHeight();
}
JRCrosstabRowGroup[] rowGroups = crosstab.getRowGroups();
int rowHeadersXOffset = 0;
for (int i = 0; i < rowGroups.length; i++)
{
rowHeadersXOffset += rowGroups[i].getWidth();
}
JRCrosstabColumnGroup[] columnGroups = crosstab.getColumnGroups();
int colHeadersYOffset = yOffset;
for (int i = 0; i < columnGroups.length; i++)
{
colHeadersYOffset += columnGroups[i].getHeight();
}
JRCellContents headerCell = crosstab.getHeaderCell();
if (headerCell != null)
{
if (headerCell.getWidth() != 0 && headerCell.getHeight() != 0)
{
crosstabElements.add(
getCrosstabCellFrame(
reportConverter,
headerCell,
0,
yOffset,
false,
false,
false
));
}
}
addCrosstabColumnHeaders(
reportConverter,
crosstab,
rowHeadersXOffset,
yOffset,
crosstabElements
);
addCrosstabRows(
reportConverter,
crosstab,
rowHeadersXOffset,
colHeadersYOffset,
crosstabElements
);
if (crosstab.getRunDirectionValue() == RunDirectionEnum.RTL)
{
mirrorElements(crosstabElements, crosstab.getX(), crosstab.getWidth());
}
return crosstabElements;
}
示例4: ParagraphStyle
/**
*
*/
public ParagraphStyle(WriterHelper styleWriter, JRPrintText text, boolean isIgnoreTextFormatting)
{
super(styleWriter);
horizontalAlignment = getHorizontalAlignment(
text.getHorizontalTextAlign(),
text.getVerticalTextAlign(),
(isIgnoreTextFormatting ? RotationEnum.NONE : text.getRotationValue()));
verticalAlignment = getVerticalAlignment(
text.getHorizontalTextAlign(),
text.getVerticalTextAlign(),
(isIgnoreTextFormatting ? RotationEnum.NONE : text.getRotationValue()));
if(isIgnoreTextFormatting)
{
textRotation = "0";
}
else
{
switch(text.getRotationValue())
{
case LEFT:
{
textRotation = "90";
break;
}
case RIGHT:
{
textRotation = "270";
break;
}
case UPSIDE_DOWN://FIXMEODT possible?
case NONE:
default:
{
textRotation = "0";
}
}
}
runDirection = null;
if (text.getRunDirectionValue() == RunDirectionEnum.RTL)
{
runDirection = "rl";
}
paragraph = text.getParagraph();
}
示例5: addCrosstabChunk
protected void addCrosstabChunk(List<JRPrintElement> elements, int yOffset)
{
JRTemplatePrintFrame printFrame = new JRTemplatePrintFrame(getTemplateFrame(), printElementOriginator);
//printFrame.setUUID(getUUID());
printFrame.setX(0);
printFrame.setY(yOffset);
Collections.sort(elements, new JRYXComparator());//FIXME make singleton comparator; same for older comparator
int xLimit = Integer.MIN_VALUE;
int yLimit = Integer.MIN_VALUE;
for (Iterator<JRPrintElement> it = elements.iterator(); it.hasNext();)
{
JRPrintElement element = it.next();
if (element.getX() + element.getWidth() > xLimit)
{
xLimit = element.getX() + element.getWidth();
}
if (element.getY() + element.getHeight() > yLimit)
{
yLimit = element.getY() + element.getHeight();
}
}
JRLineBox lineBox = getLineBox();
int width = xLimit + lineBox.getLeftPadding() + lineBox.getRightPadding();
printFrame.setWidth(width);
HorizontalPosition position = concreteHorizontalPosition();
switch (position)
{
case RIGHT:
// the position does not apply when the crosstab is bigger than the element (ignoreWidth is set)
// still, it applies if the crosstab is RTL
if (width < getWidth() || getRunDirectionValue() == RunDirectionEnum.RTL)
{
// move to the right
printFrame.setX(getWidth() - width);
}
break;
case CENTER:
// the position does not apply when the crosstab is bigger than the element (ignoreWidth is set)
if (width < getWidth())
{
int centeredX = (getWidth() - width) / 2;
printFrame.setX(centeredX);
}
break;
case LEFT:
default:
// x = 0 already set
break;
}
int height = yLimit + lineBox.getTopPadding() + lineBox.getBottomPadding();
printFrame.setHeight(height);
if (getRunDirectionValue() == RunDirectionEnum.RTL)
{
mirrorPrintElements(elements, xLimit);
}
int chunkIndex = getChunkIndex();
String chunkId = getUUID().toString() + "." + chunkIndex;
if (interactive)
{
printFrame.getPropertiesMap().setProperty(CrosstabInteractiveJsonHandler.PROPERTY_CROSSTAB_ID,
chunkId);
JRTemplateGenericPrintElement genericElement = createInteractiveElement(chunkId, floatingHeaders);
printFrame.addElement(genericElement);
}
// dump all elements into the print frame
printFrame.addElements(elements);
// add this frame to the list to the list of crosstab chunks
printFrames.add(printFrame);
}
示例6: getRunDirectionValue
/**
*
*/
public RunDirectionEnum getRunDirectionValue()
{
return isLeftToRight ? RunDirectionEnum.LTR : RunDirectionEnum.RTL;
}
示例7: readVirtualized
@Override
public void readVirtualized(VirtualizationInput in) throws IOException
{
super.readVirtualized(in);
int flags = in.readIntCompressed();
text = (String) in.readJRObject();
if ((flags & SERIALIZATION_FLAG_HAS_VALUE) != 0)
{
value = in.readJRObject();
}
else
{
value = text;
}
lineSpacingFactor = in.readFloat();
leadingOffset = in.readFloat();
textHeight = in.readFloat();
if ((flags & SERIALIZATION_FLAG_TRUNCATION) != 0)
{
textTruncateIndex = (Integer) in.readJRObject();
textTruncateSuffix = (String) in.readJRObject();
}
if ((flags & SERIALIZATION_FLAG_LINE_BREAK_OFFSETS) != 0)
{
if ((flags & SERIALIZATION_FLAG_ZERO_LINE_BREAK_OFFSETS) != 0)
{
lineBreakOffsets = JRPrintText.ZERO_LINE_BREAK_OFFSETS;
}
else
{
int offsetCount = in.readIntCompressed();
lineBreakOffsets = new short[offsetCount];
for (int i = 0; i < offsetCount; i++)
{
lineBreakOffsets[i] = (short) in.readIntCompressed();
}
}
}
if ((flags & SERIALIZATION_FLAG_ANCHOR) != 0)
{
anchorName = (String) in.readJRObject();
bookmarkLevel = in.readIntCompressed();
}
else
{
bookmarkLevel = JRAnchor.NO_BOOKMARK;
}
if ((flags & SERIALIZATION_FLAG_HYPERLINK_OMITTED) != 0)
{
hyperlinkOmitted = true;
}
if ((flags & SERIALIZATION_FLAG_HYPERLINK) != 0)
{
hyperlinkReference = (String) in.readJRObject();
hyperlinkAnchor = (String) in.readJRObject();
hyperlinkPage = (Integer) in.readJRObject();
hyperlinkTooltip = (String) in.readJRObject();
hyperlinkParameters = (JRPrintHyperlinkParameters) in.readJRObject();
}
runDirectionValue = (flags & SERIALIZATION_FLAG_RTL) != 0 ? RunDirectionEnum.RTL : RunDirectionEnum.LTR;
PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID;
}
示例8: fillVertical
public void fillVertical(JRDesignCrosstab crosstab) {
Guide west = new Guide(0);
vGuides.add(west);
Guide gwest = null;
Guide east = fillTitleCellV(west, addNext(west, vGuides), crosstab);
Guide heast = fillHeaderCellV(west, addNext(west, vGuides), crosstab);
fillRowGroupV(west, heast, crosstab);
gwest = heast;
fillColumnGroupV(heast, east, crosstab);
fillDetailsV(gwest, crosstab);
if (crosstab.getRunDirectionValue() == RunDirectionEnum.RTL)
mirrorV();
}
示例9: paintRestrictedArea
private void paintRestrictedArea(JasperDesign jd, Graphics2D g) {
if (jd.getColumnCount() <= 1) return;
// Column header
int c_x = jd.getLeftMargin();
// if (jd.getPrintOrderValue() != null &&
// jd.getPrintOrderValue() == PrintOrderEnum.VERTICAL)
// {
// int c_y0 = ModelUtils.getBandLocation(jd.getColumnHeader(), jd);
// int c_y1 = ModelUtils.getBandLocation(jd.getPageFooter(), jd);
//
// Paint oldPaint = g.getPaint();
// g.setPaint(getRestrictedAreaTexture());
// int x0 = jd.getLeftMargin() + jd.getColumnWidth();
// int width = jd.getPageWidth() - x0 - jd.getRightMargin();
//
// if (jd.getColumnDirection() == RunDirectionEnum.RTL)
// {
// x0 = jd.getLeftMargin();
// width = (jd.getColumnCount()-1)*jd.getColumnWidth() + (jd.getColumnCount()-1)*jd.getColumnSpacing();
// }
//
// g.fillRect(x0, c_y0, width, c_y1-c_y0);
// g.setPaint(oldPaint);
// }
// else
// {
List<JRBand> bands = new ArrayList<JRBand>();
if (jd.getColumnHeader() != null) bands.add(jd.getColumnHeader());
if (jd.getColumnFooter() != null) bands.add(jd.getColumnFooter());
if (jd.getDetailSection()!= null && jd.getDetailSection().getBands() != null
&& jd.getDetailSection().getBands().length > 0)
{
bands.addAll( Arrays.asList(jd.getDetailSection().getBands()) );
}
if (jd.getPrintOrderValue() != null &&
jd.getPrintOrderValue() == PrintOrderEnum.VERTICAL)
{
// Add all the group header and footers as well..
List groups = jd.getGroupsList();
for (Object grpObj : groups)
{
JRGroup grp = (JRGroup)grpObj;
if (grp.getGroupHeaderSection() != null &&
grp.getGroupHeaderSection().getBands() != null &&
grp.getGroupHeaderSection().getBands().length > 0)
{
bands.addAll( Arrays.asList( grp.getGroupHeaderSection().getBands() ) );
}
if (grp.getGroupFooterSection() != null &&
grp.getGroupFooterSection().getBands() != null &&
grp.getGroupFooterSection().getBands().length > 0)
{
bands.addAll( Arrays.asList( grp.getGroupFooterSection().getBands() ) );
}
}
}
int x0 = jd.getLeftMargin() + jd.getColumnWidth();
int width = jd.getPageWidth() - x0 - jd.getRightMargin();
if (jd.getColumnDirection() == RunDirectionEnum.RTL)
{
x0 = jd.getLeftMargin();
width = (jd.getColumnCount()-1)*jd.getColumnWidth() + (jd.getColumnCount()-1)*jd.getColumnSpacing();
}
Paint oldPaint = g.getPaint();
g.setPaint(getRestrictedAreaTexture());
for (JRBand b : bands)
{
int c_y0 = ModelUtils.getBandLocation(b, jd);
g.fillRect(x0, c_y0, width, b.getHeight());
}
g.setPaint(oldPaint);
}