net.sf.dynamicreports.report.base.style.DRBaseStyle Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dynamicreports-core Show documentation
Show all versions of dynamicreports-core Show documentation
DynamicReports is an open source Java reporting library based on
JasperReports. It allows to create dynamic report designs and it doesn't
need a visual report designer.
You can very quickly create reports and produce documents that can be
displayed, printed or exported into many popular formats such as PDF,
Excel, Word and others.
The newest version!
/*
* DynamicReports - Free Java reporting library for creating reports dynamically
*
* Copyright (C) 2010 - 2018 Ricardo Mariaca and the Dynamic Reports Contributors
*
* This file is part of DynamicReports.
*
* DynamicReports is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DynamicReports is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with DynamicReports. If not, see .
*/
package net.sf.dynamicreports.report.base.style;
import net.sf.dynamicreports.report.constant.Constants;
import net.sf.dynamicreports.report.constant.HorizontalImageAlignment;
import net.sf.dynamicreports.report.constant.HorizontalTextAlignment;
import net.sf.dynamicreports.report.constant.ImageScale;
import net.sf.dynamicreports.report.constant.Markup;
import net.sf.dynamicreports.report.constant.Rotation;
import net.sf.dynamicreports.report.constant.VerticalImageAlignment;
import net.sf.dynamicreports.report.constant.VerticalTextAlignment;
import net.sf.dynamicreports.report.definition.style.DRIBaseStyle;
import java.awt.Color;
/**
* Abstract DRBaseStyle class.
*
* @author Ricardo Mariaca
*
*/
public abstract class DRBaseStyle implements DRIBaseStyle {
private static final long serialVersionUID = Constants.SERIAL_VERSION_UID;
private Color foregroundColor;
private Color backgroundColor;
private Integer radius;
private ImageScale imageScale;
private HorizontalImageAlignment horizontalImageAlignment;
private VerticalImageAlignment verticalImageAlignment;
private HorizontalTextAlignment horizontalTextAlignment;
private VerticalTextAlignment verticalTextAlignment;
private DRBorder border;
private DRPadding padding;
private DRFont font;
private Rotation rotation;
private String pattern;
private Markup markup;
private DRParagraph paragraph;
private DRPen linePen;
/**
* Constructor for DRBaseStyle.
*/
public DRBaseStyle() {
init();
}
/**
* init.
*/
protected void init() {
font = new DRFont();
border = new DRBorder();
padding = new DRPadding();
paragraph = new DRParagraph();
linePen = new DRPen();
}
/** {@inheritDoc} */
@Override
public Color getForegroundColor() {
return foregroundColor;
}
/**
* Setter for the field foregroundColor
.
*
* @param foregroundColor a {@link java.awt.Color} object.
*/
public void setForegroundColor(Color foregroundColor) {
this.foregroundColor = foregroundColor;
}
/** {@inheritDoc} */
@Override
public Color getBackgroundColor() {
return backgroundColor;
}
/**
* Setter for the field backgroundColor
.
*
* @param backgroundColor a {@link java.awt.Color} object.
*/
public void setBackgroundColor(Color backgroundColor) {
this.backgroundColor = backgroundColor;
}
/** {@inheritDoc} */
@Override
public Integer getRadius() {
return radius;
}
/**
* Setter for the field radius
.
*
* @param radius a {@link java.lang.Integer} object.
*/
public void setRadius(Integer radius) {
this.radius = radius;
}
/** {@inheritDoc} */
@Override
public ImageScale getImageScale() {
return imageScale;
}
/**
* Setter for the field imageScale
.
*
* @param imageScale a {@link net.sf.dynamicreports.report.constant.ImageScale} object.
*/
public void setImageScale(ImageScale imageScale) {
this.imageScale = imageScale;
}
/** {@inheritDoc} */
@Override
public HorizontalImageAlignment getHorizontalImageAlignment() {
return horizontalImageAlignment;
}
/**
* Setter for the field horizontalImageAlignment
.
*
* @param horizontalImageAlignment a {@link net.sf.dynamicreports.report.constant.HorizontalImageAlignment} object.
*/
public void setHorizontalImageAlignment(HorizontalImageAlignment horizontalImageAlignment) {
this.horizontalImageAlignment = horizontalImageAlignment;
}
/** {@inheritDoc} */
@Override
public VerticalImageAlignment getVerticalImageAlignment() {
return verticalImageAlignment;
}
/**
* Setter for the field verticalImageAlignment
.
*
* @param verticalImageAlignment a {@link net.sf.dynamicreports.report.constant.VerticalImageAlignment} object.
*/
public void setVerticalImageAlignment(VerticalImageAlignment verticalImageAlignment) {
this.verticalImageAlignment = verticalImageAlignment;
}
/** {@inheritDoc} */
@Override
public HorizontalTextAlignment getHorizontalTextAlignment() {
return horizontalTextAlignment;
}
/**
* Setter for the field horizontalTextAlignment
.
*
* @param horizontalTextAlignment a {@link net.sf.dynamicreports.report.constant.HorizontalTextAlignment} object.
*/
public void setHorizontalTextAlignment(HorizontalTextAlignment horizontalTextAlignment) {
this.horizontalTextAlignment = horizontalTextAlignment;
}
/** {@inheritDoc} */
@Override
public VerticalTextAlignment getVerticalTextAlignment() {
return verticalTextAlignment;
}
/**
* Setter for the field verticalTextAlignment
.
*
* @param verticalTextAlignment a {@link net.sf.dynamicreports.report.constant.VerticalTextAlignment} object.
*/
public void setVerticalTextAlignment(VerticalTextAlignment verticalTextAlignment) {
this.verticalTextAlignment = verticalTextAlignment;
}
/** {@inheritDoc} */
@Override
public DRBorder getBorder() {
return border;
}
/**
* Setter for the field border
.
*
* @param border a {@link net.sf.dynamicreports.report.base.style.DRBorder} object.
*/
public void setBorder(DRBorder border) {
this.border = border;
}
/** {@inheritDoc} */
@Override
public DRPadding getPadding() {
return padding;
}
/**
* Setter for the field padding
.
*
* @param padding a {@link net.sf.dynamicreports.report.base.style.DRPadding} object.
*/
public void setPadding(DRPadding padding) {
this.padding = padding;
}
/** {@inheritDoc} */
@Override
public DRFont getFont() {
return font;
}
/**
* Setter for the field font
.
*
* @param font a {@link net.sf.dynamicreports.report.base.style.DRFont} object.
*/
public void setFont(DRFont font) {
this.font = font;
}
/** {@inheritDoc} */
@Override
public Rotation getRotation() {
return rotation;
}
/**
* Setter for the field rotation
.
*
* @param rotation a {@link net.sf.dynamicreports.report.constant.Rotation} object.
*/
public void setRotation(Rotation rotation) {
this.rotation = rotation;
}
/** {@inheritDoc} */
@Override
public String getPattern() {
return pattern;
}
/**
* Setter for the field pattern
.
*
* @param pattern a {@link java.lang.String} object.
*/
public void setPattern(String pattern) {
this.pattern = pattern;
}
/** {@inheritDoc} */
@Override
public Markup getMarkup() {
return markup;
}
/**
* Setter for the field markup
.
*
* @param markup a {@link net.sf.dynamicreports.report.constant.Markup} object.
*/
public void setMarkup(Markup markup) {
this.markup = markup;
}
/** {@inheritDoc} */
@Override
public DRParagraph getParagraph() {
return paragraph;
}
/**
* Setter for the field paragraph
.
*
* @param paragraph a {@link net.sf.dynamicreports.report.base.style.DRParagraph} object.
*/
public void setParagraph(DRParagraph paragraph) {
this.paragraph = paragraph;
}
/** {@inheritDoc} */
@Override
public DRPen getLinePen() {
return linePen;
}
/**
* Setter for the field linePen
.
*
* @param linePen a {@link net.sf.dynamicreports.report.base.style.DRPen} object.
*/
public void setLinePen(DRPen linePen) {
this.linePen = linePen;
}
}