本文整理汇总了Java中net.sf.jasperreports.engine.type.VerticalAlignEnum类的典型用法代码示例。如果您正苦于以下问题:Java VerticalAlignEnum类的具体用法?Java VerticalAlignEnum怎么用?Java VerticalAlignEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VerticalAlignEnum类属于net.sf.jasperreports.engine.type包,在下文中一共展示了VerticalAlignEnum类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPropertyValue
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
@Override
public void setPropertyValue(Object id, Object value) {
JRDesignTextElement jrElement = (JRDesignTextElement) getValue();
if (id.equals(JRBaseStyle.PROPERTY_MARKUP))
jrElement.setMarkup((String) value);
else if (id.equals(JRBaseStyle.PROPERTY_HORIZONTAL_ALIGNMENT))
jrElement.setHorizontalAlignment((HorizontalAlignEnum) hAlignD.getEnumValue(value));
else if (id.equals(JRBaseStyle.PROPERTY_VERTICAL_ALIGNMENT)) {
VerticalAlignEnum va = (VerticalAlignEnum) EnumHelper.getSetValue(VerticalAlignEnum.values(), value, 1, true);
if (va != null && va.equals(VerticalAlignEnum.JUSTIFIED))
va = VerticalAlignEnum.MIDDLE;
jrElement.setVerticalAlignment(va);
} else if (id.equals(JRBaseStyle.PROPERTY_ROTATION))
jrElement.setRotation((RotationEnum) rotationD.getEnumValue(value));
getMFont().setPropertyValue(id, value);
super.setPropertyValue(id, value);
}
示例2: widgetSelected
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
public void widgetSelected(SelectionEvent e) {
if (!refreshing){
List<Object> selection = getSelectionForType(MTextElement.class);
if (selection.isEmpty())
return;
JSSCompoundCommand changeSizeCommands = new JSSCompoundCommand(null);
String property = "";
Object data = e.widget.getData();
if (data instanceof VerticalAlignEnum) property = JRBaseStyle.PROPERTY_VERTICAL_ALIGNMENT;
else if (data instanceof HorizontalAlignEnum) property = JRBaseStyle.PROPERTY_HORIZONTAL_ALIGNMENT;
else return;
for (Object textElement : selection){
changeSizeCommands.setReferenceNodeIfNull(textElement);
Command c = createCommand(textElement, data, property);
if (c != null) {
changeSizeCommands.add(c);
}
}
CommandStack cs = getCommandStack();
cs.execute(changeSizeCommands);
}
}
示例3: convert
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
/**
*
*/
public JRPrintElement convert(final ReportConverter reportConverter, final JRComponentElement element) {
MapComponent map = (MapComponent) element.getComponent();
JRBasePrintImage printImage = new JRBasePrintImage(element.getDefaultStyleProvider());
Renderable cacheRenderer = getRenderable(reportConverter, element, map, printImage);
printImage.setUUID(element.getUUID());
printImage.setX(element.getX());
printImage.setY(element.getY());
printImage.setWidth(element.getWidth());
printImage.setHeight(element.getHeight());
printImage.setStyle(element.getStyle());
printImage.setMode(element.getModeValue());
printImage.setBackcolor(element.getBackcolor());
printImage.setForecolor(element.getForecolor());
printImage.setLazy(false);
// FIXMEMAP there are no scale image, alignment and onError attributes
// defined for the map element
printImage.setScaleImage(ScaleImageEnum.CLIP);
printImage.setHorizontalAlignment(HorizontalAlignEnum.LEFT);
printImage.setVerticalAlignment(VerticalAlignEnum.TOP);
printImage.setRenderable(cacheRenderer);
return printImage;
}
示例4: createLabel
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
private JRDesignStaticText createLabel(JasperDesign jd, String text, int w, int h, String styleName)
{
JRDesignStaticText element = new JRDesignStaticText();
element.setX(0);
element.setY(0);
element.setWidth(w);
element.setHeight(h);
element.setText(text);
element.setHorizontalAlignment( HorizontalAlignEnum.CENTER );
element.setVerticalAlignment( VerticalAlignEnum.MIDDLE);
if (styleName != null && jd.getStylesMap().containsKey(styleName))
{
element.setStyle( (JRStyle) jd.getStylesMap().get(styleName) );
}
return element;
}
示例5: createTextField
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
private static JRDesignTextField createTextField(ODLTableDefinition table, int columnIndex) {
JRDesignTextField textField = new JRDesignTextField();
textField.setVerticalAlignment(VerticalAlignEnum.MIDDLE);
JRDesignExpression expression = new JRDesignExpression();
String fld = "$F{" + table.getColumnName(columnIndex) + "}";
if (table.getColumnType(columnIndex) == ODLColumnType.DOUBLE) {
String combined = fld + "!=null ? new DecimalFormat(\"###,###.###\").format(" + fld + "):\"\"";
expression.setText(combined);
} else {
expression.setText(fld);
}
textField.setExpression(expression);
textField.setPrintWhenDetailOverflows(false);
return textField;
}
示例6: test
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
@Override
public void test() {
super.test();
numberOfPagesTest(1);
columnDetailStyleTest(column1, 0, null, null, "Arial", 10f, true, null);
columnDetailBorderTest(column1, 0, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1);
columnDetailBorderTest(column2, 0, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1);
columnDetailBorderTest(column3, 0, null, LineStyleEnum.SOLID, 2, null, LineStyleEnum.SOLID, 2, null, LineStyleEnum.SOLID, 2, null, LineStyleEnum.SOLID, 2);
columnDetailStyleTest(column4, 0, null, null, "Arial", 10f, true, null);
columnDetailBorderTest(column4, 0, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1, null, LineStyleEnum.SOLID, 1);
columnDetailAlignmentTest(column1, 0, HorizontalAlignEnum.CENTER);
columnDetailAlignmentTest(column2, 0, HorizontalAlignEnum.LEFT);
columnDetailAlignmentTest(column3, 0, HorizontalAlignEnum.CENTER);
columnDetailAlignmentTest(column1, 0, VerticalAlignEnum.TOP);
columnDetailAlignmentTest(column2, 0, VerticalAlignEnum.TOP);
columnDetailAlignmentTest(column3, 0, VerticalAlignEnum.MIDDLE);
}
示例7: setPropertyValue
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
@Override
public void setPropertyValue(Object id, Object value) {
JRDesignComponentElement jrElement = (JRDesignComponentElement) getValue();
HtmlComponent htmlComp = (HtmlComponent) jrElement.getComponent();
if (id.equals(HtmlComponent.PROPERTY_EVALUATION_TIME))
htmlComp.setEvaluationTime((EvaluationTimeEnum) evaluationTimeD
.getEnumValue(value));
else if (id.equals(HtmlComponent.PROPERTY_EVALUATION_GROUP))
htmlComp.setEvaluationGroup((String) value);
else if (id.equals(HtmlComponent.PROPERTY_SCALE_TYPE))
htmlComp.setScaleType((ScaleImageEnum) scaleTypeD
.getEnumValue(value));
else if (id.equals(HtmlComponent.PROPERTY_HORIZONTAL_ALIGN))
htmlComp.setHorizontalAlign((HorizontalAlignEnum) hAlignD
.getEnumValue(value));
else if (id.equals(HtmlComponent.PROPERTY_VERTICAL_ALIGN))
htmlComp.setVerticalAlign((VerticalAlignEnum) vAlignD
.getEnumValue(value));
else if (id.equals(HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION))
htmlComp.setHtmlContentExpression(ExprUtil.setValues(
htmlComp.getHtmlContentExpression(), value));
else if (id.equals(HtmlComponent.PROPERTY_CLIP_ON_OVERFLOW))
htmlComp.setClipOnOverflow((Boolean) value);
else
super.setPropertyValue(id, value);
}
示例8: setPropertyValue
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
@Override
public void setPropertyValue(Object id, Object value) {
JRDesignComponentElement jrElement = (JRDesignComponentElement) getValue();
SortComponent component = (SortComponent) jrElement.getComponent();
if (id.equals(SortComponent.PROPERTY_HANDLER_COLOR))
component.setHandlerColor(Colors.getAWT4SWTRGBColor((AlfaRGB) value));
else if (id.equals(SortComponent.PROPERTY_COLUMN_NAME))
component.setSortFieldName((String) value);
else if (id.equals(SortComponent.PROPERTY_COLUMN_TYPE))
component.setSortFieldType((SortFieldTypeEnum) EnumHelper
.getSetValue(SortFieldTypeEnum.values(), value, 0, false));
else if (id.equals(SortComponent.PROPERTY_EVALUATION_TIME))
component.setEvaluationTime((EvaluationTimeEnum) EnumHelper
.getSetValue(EvaluationTimeEnum.values(), value, 1, false));
else if (id.equals(SortComponent.PROPERTY_EVALUATION_GROUP)) {
component.setEvaluationGroup((String) value);
} else if (id.equals(SortComponent.PROPERTY_HANDLER_HORIZONTAL_ALIGN)) {
component
.setHandlerHorizontalAlign((HorizontalAlignEnum) EnumHelper
.getSetValue(HorizontalAlignEnum.values(), value,
1, false));
} else if (id.equals(SortComponent.PROPERTY_HANDLER_VERTICAL_ALIGN)) {
component.setHandlerVerticalAlign((VerticalAlignEnum) EnumHelper
.getSetValue(VerticalAlignEnum.values(), value, 1, false));
} else
super.setPropertyValue(id, value);
}
示例9: createDefaultElement
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
private TextStyle createDefaultElement(){
TextStyle defaultTextStyle = new TextStyle();
defaultTextStyle.setBackGround(AlfaRGB.getFullyOpaque(new RGB(255,255,255)));
defaultTextStyle.setForeGround(AlfaRGB.getFullyOpaque(new RGB(0,0,0)));
defaultTextStyle.setHorizontalAlignmen(HorizontalAlignEnum.LEFT);
defaultTextStyle.setVerticalAlignmen(VerticalAlignEnum.TOP);
defaultTextStyle.setTransparent(true);
defaultTextStyle.setRotation(RotationEnum.NONE);
JRBaseFont font = new JRBaseFont();
font.setFontName("Arial"); //$NON-NLS-1$
font.setFontSize(8f);
font.setBold(false);
font.setItalic(false);
font.setUnderline(false);
font.setStrikeThrough(false);
defaultTextStyle.setFont(font);
JRBaseLineBox box = new JRBaseLineBox(null);
box.setPadding(null);
box.setTopPadding(0);
box.setBottomPadding(0);
box.setLeftPadding(0);
box.setRightPadding(0);
defaultTextStyle.setBorders(box);
defaultTextStyle.setDescription(Messages.TextStyleView_sampleText);
return defaultTextStyle;
}
示例10: TextStyle
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
public TextStyle(JRStyle style){
super(null,null);
setTransparent(style.getOwnModeValue() != null ? ModeEnum.TRANSPARENT.equals(style.getOwnModeValue()) : true);
setBackGround(style.getOwnBackcolor());
setForeGround(style.getOwnForecolor());
setVerticalAlignmen(style.getOwnVerticalAlignmentValue() != null ? style.getOwnVerticalAlignmentValue() : VerticalAlignEnum.TOP);
setHorizontalAlignmen(style.getOwnHorizontalAlignmentValue() != null ? style.getOwnHorizontalAlignmentValue() : HorizontalAlignEnum.LEFT);
setRotation(style.getOwnRotationValue() != null ? style.getOwnRotationValue() : RotationEnum.NONE);
JRFont font = new JRBaseFont();
font.setBold(style.isOwnBold() != null ? style.isOwnBold() : false);
font.setItalic(new Boolean(style.isOwnItalic() != null ? style.isOwnItalic() : false));
style.isItalic();
font.setUnderline(new Boolean(style.isOwnUnderline() != null ? style.isOwnUnderline() : false));
font.setStrikeThrough(new Boolean(style.isOwnStrikeThrough() != null ? style.isOwnStrikeThrough() : false));
font.setFontName(new String(style.getOwnFontName()));
font.setFontSize(new Float(style.getOwnFontsize()));
setFont(font);
JRLineBox originBox = style.getLineBox();
JRBaseLineBox copyBox = new JRBaseLineBox(null);
copyBox.setPadding(originBox.getOwnPadding() != null ? new Integer(originBox.getOwnPadding()): null);
copyBox.setTopPadding(originBox.getOwnTopPadding() != null ? new Integer(originBox.getOwnTopPadding()): null);
copyBox.setBottomPadding(originBox.getOwnBottomPadding() != null ? new Integer(originBox.getOwnBottomPadding()): null);
copyBox.setLeftPadding(originBox.getOwnLeftPadding() != null ? new Integer(originBox.getOwnLeftPadding()): null);
copyBox.setRightPadding(originBox.getOwnRightPadding() != null ? new Integer(originBox.getOwnRightPadding()): null);
copyLinePen(originBox.getPen(), copyBox.getPen());
copyLinePen(originBox.getLeftPen(), copyBox.getLeftPen());
copyLinePen(originBox.getRightPen(), copyBox.getRightPen());
copyLinePen(originBox.getBottomPen(), copyBox.getBottomPen());
copyLinePen(originBox.getTopPen(), copyBox.getTopPen());
setBorders(copyBox);
String name = style.getName();
if (name != null && !name.isEmpty()) setDescription(name);
}
示例11: getTagList
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
@Override
public List getTagList()
{
List tags = new java.util.ArrayList();
tags.add(new Tag(VerticalAlignEnum.TOP, I18n.getString("Global.Property.Top")));
tags.add(new Tag(VerticalAlignEnum.MIDDLE, I18n.getString("Global.Property.Middle")));
tags.add(new Tag(VerticalAlignEnum.BOTTOM, I18n.getString("Global.Property.Bottom")));
return tags;
}
示例12: createLabel
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
private JRDesignStaticText createLabel(String text, int w, int h)
{
JRDesignStaticText element = new JRDesignStaticText();
element.setX(0);
element.setY(0);
element.setWidth(w);
element.setHeight(h);
element.setText(text);
element.setHorizontalAlignment( HorizontalAlignEnum.CENTER );
element.setVerticalAlignment( VerticalAlignEnum.MIDDLE);
return element;
}
示例13: modifyVerticalAlignment
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
private void modifyVerticalAlignment() {
if (isInit()) return;
boolean oldChanging = isChanging();
setChanging(true);
if (getSelectedTextElements().size() > 0)
{
boolean isFirstUndo = true;
VerticalAlignEnum newValue = getSelectedVerticalAlignment();
for (JRDesignTextElement element : getSelectedTextElements())
{
// if newValue is null does not do anything
// since the vertical alignment could be justified for which we do not
// provide an icon...
if (newValue != null && newValue != element.getVerticalAlignmentValue())
{
VerticalAlignEnum oldValue = element.getOwnVerticalAlignmentValue();
element.setVerticalAlignment(newValue);
ObjectPropertyUndoableEdit opUndo = new ObjectPropertyUndoableEdit(element, "VerticalAlignment",VerticalAlignEnum.class, oldValue , newValue);
IReportManager.getInstance().addUndoableEdit(opUndo, !isFirstUndo);
isFirstUndo = false;
}
}
}
setChanging(oldChanging);
}
示例14: getSelectedVerticalAlignment
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
private VerticalAlignEnum getSelectedVerticalAlignment()
{
if (jToggleButtonAlignTop.isSelected()) return VerticalAlignEnum.TOP;
if (jToggleButtonAlignMiddle.isSelected()) return VerticalAlignEnum.MIDDLE;
if (jToggleButtonAlignBottom.isSelected()) return VerticalAlignEnum.BOTTOM;
return null;
}
示例15: setVerticalAlignment
import net.sf.jasperreports.engine.type.VerticalAlignEnum; //导入依赖的package包/类
private boolean setVerticalAlignment(boolean firstElement, VerticalAlignEnum verticalAlignment) {
if (!firstElement)
{
VerticalAlignEnum selectedValue = getSelectedVerticalAlignment();
if (selectedValue != null && selectedValue != verticalAlignment)
{
setSelectedVerticalAlignment(null);
}
}
setSelectedVerticalAlignment(verticalAlignment);
return true;
}