plantuml/src/net/sourceforge/plantuml/svek/AbstractEntityImage.java

92 lines
2.6 KiB
Java
Raw Normal View History

2011-08-08 17:48:29 +00:00
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
2023-02-22 18:43:48 +00:00
* (C) Copyright 2009-2024, Arnaud Roques
2011-08-08 17:48:29 +00:00
*
2023-02-22 18:43:48 +00:00
* Project Info: https://plantuml.com
2011-08-08 17:48:29 +00:00
*
2017-03-15 19:13:31 +00:00
* If you like this project or if you find it useful, you can support us at:
*
2023-02-22 18:43:48 +00:00
* https://plantuml.com/patreon (only 1$ per month!)
* https://plantuml.com/paypal
2017-03-15 19:13:31 +00:00
*
2011-08-08 17:48:29 +00:00
* 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
2013-12-10 19:36:50 +00:00
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
2011-08-08 17:48:29 +00:00
* 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.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.svek;
2021-05-09 21:14:40 +00:00
import java.util.Objects;
2023-02-22 18:43:48 +00:00
import net.sourceforge.plantuml.abel.Entity;
2023-02-02 17:59:43 +00:00
import net.sourceforge.plantuml.klimt.color.HColor;
import net.sourceforge.plantuml.klimt.font.StringBounder;
2023-02-26 18:51:17 +00:00
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
import net.sourceforge.plantuml.klimt.geom.MagneticBorderNone;
2023-02-22 18:43:48 +00:00
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
import net.sourceforge.plantuml.stereo.Stereotype;
import net.sourceforge.plantuml.style.ISkinParam;
2011-08-08 17:48:29 +00:00
2015-06-07 10:23:10 +00:00
public abstract class AbstractEntityImage extends AbstractTextBlock implements IEntityImage {
2011-08-08 17:48:29 +00:00
2023-02-06 21:04:53 +00:00
private final Entity entity;
2011-08-08 17:48:29 +00:00
private final ISkinParam skinParam;
2023-02-06 21:04:53 +00:00
public AbstractEntityImage(Entity entity, ISkinParam skinParam) {
2021-05-09 21:14:40 +00:00
this.entity = Objects.requireNonNull(entity);
this.skinParam = Objects.requireNonNull(skinParam);
2011-08-08 17:48:29 +00:00
}
2021-12-14 21:38:22 +00:00
@Override
2013-12-10 19:36:50 +00:00
public boolean isHidden() {
return entity.isHidden();
}
2011-08-08 17:48:29 +00:00
2023-02-06 21:04:53 +00:00
protected final Entity getEntity() {
2011-08-08 17:48:29 +00:00
return entity;
}
protected final ISkinParam getSkinParam() {
return skinParam;
}
2021-12-14 21:38:22 +00:00
@Override
2020-03-18 10:50:02 +00:00
public final HColor getBackcolor() {
return skinParam.getBackgroundColor();
2011-08-08 17:48:29 +00:00
}
protected final Stereotype getStereo() {
return entity.getStereotype();
}
2021-12-14 21:38:22 +00:00
@Override
2017-04-05 17:37:42 +00:00
public Margins getShield(StringBounder stringBounder) {
return Margins.NONE;
}
2021-12-14 21:38:22 +00:00
@Override
2018-12-22 11:11:40 +00:00
public double getOverscanX(StringBounder stringBounder) {
return 0;
}
2011-08-08 17:48:29 +00:00
}