1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-06-03 09:00:48 +00:00
plantuml/src/net/sourceforge/plantuml/UmlDiagram.java

155 lines
3.8 KiB
Java
Raw Normal View History

2010-11-15 20:35:36 +00:00
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009, Arnaud Roques
*
* Project Info: http://plantuml.sourceforge.net
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML 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 General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
* in the United States and other countries.]
*
* Original Author: Arnaud Roques
*
2011-02-14 11:56:34 +00:00
* Revision $Revision: 6097 $
2010-11-15 20:35:36 +00:00
*
*/
package net.sourceforge.plantuml;
import java.util.List;
import net.sourceforge.plantuml.graphic.HorizontalAlignement;
public abstract class UmlDiagram extends AbstractPSystem implements PSystem {
private boolean rotation;
2011-02-14 11:56:34 +00:00
private boolean hideUnlinkedData;
2010-11-15 20:35:36 +00:00
private int minwidth = Integer.MAX_VALUE;
private List<String> title;
private List<String> header;
private List<String> footer;
private HorizontalAlignement headerAlignement = HorizontalAlignement.RIGHT;
private HorizontalAlignement footerAlignement = HorizontalAlignement.CENTER;
private final Pragma pragma = new Pragma();
private Scale scale;
private final SkinParam skinParam = new SkinParam();
final public void setTitle(List<String> strings) {
this.title = strings;
}
final public List<String> getTitle() {
return title;
}
final public int getMinwidth() {
return minwidth;
}
final public void setMinwidth(int minwidth) {
this.minwidth = minwidth;
}
final public boolean isRotation() {
return rotation;
}
final public void setRotation(boolean rotation) {
this.rotation = rotation;
}
public final ISkinParam getSkinParam() {
return skinParam;
}
public void setParam(String key, String value) {
skinParam.setParam(key.toLowerCase(), value);
}
public final List<String> getHeader() {
return header;
}
public final void setHeader(List<String> header) {
this.header = header;
}
public final List<String> getFooter() {
return footer;
}
public final void setFooter(List<String> footer) {
this.footer = footer;
}
public final HorizontalAlignement getHeaderAlignement() {
return headerAlignement;
}
public final void setHeaderAlignement(HorizontalAlignement headerAlignement) {
this.headerAlignement = headerAlignement;
}
public final HorizontalAlignement getFooterAlignement() {
return footerAlignement;
}
public final void setFooterAlignement(HorizontalAlignement footerAlignement) {
this.footerAlignement = footerAlignement;
}
abstract public UmlDiagramType getUmlDiagramType();
public Pragma getPragma() {
return pragma;
}
final public void setScale(Scale scale) {
this.scale = scale;
}
2011-01-05 18:23:06 +00:00
2010-11-15 20:35:36 +00:00
final public Scale getScale() {
return scale;
}
2011-01-05 18:23:06 +00:00
public final double getDpiFactor(FileFormatOption fileFormatOption) {
if (getSkinParam().getDpi() == 96) {
return 1.0;
}
return getSkinParam().getDpi() / 96.0;
}
public final int getDpi(FileFormatOption fileFormatOption) {
return getSkinParam().getDpi();
}
2011-02-14 11:56:34 +00:00
public final boolean isHideUnlinkedData() {
return hideUnlinkedData;
}
public final void setHideUnlinkedData(boolean hideUnlinkedData) {
this.hideUnlinkedData = hideUnlinkedData;
}
2010-11-15 20:35:36 +00:00
}