1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-06-03 17:10:49 +00:00
plantuml/src/net/sourceforge/plantuml/SkinParamColors.java

93 lines
2.6 KiB
Java
Raw Normal View History

2015-09-28 20:42:17 +00:00
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
2019-01-16 18:34:41 +00:00
* (C) Copyright 2009-2020, Arnaud Roques
2015-09-28 20:42:17 +00:00
*
2016-03-06 16:47:34 +00:00
* Project Info: http://plantuml.com
2015-09-28 20:42:17 +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:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
2015-09-28 20:42:17 +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
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
public class SkinParamColors extends SkinParamDelegator {
2019-08-26 17:07:21 +00:00
public final Colors getColors() {
return colors;
}
2015-09-28 20:42:17 +00:00
final private Colors colors;
public SkinParamColors(ISkinParam skinParam, Colors colors) {
super(skinParam);
this.colors = colors;
}
@Override
public String toString() {
return super.toString() + colors;
}
2015-11-01 18:37:20 +00:00
@Override
2018-09-23 12:15:14 +00:00
public boolean shadowing(Stereotype stereotype) {
2015-11-01 18:37:20 +00:00
if (colors.getShadowing() == null) {
2018-09-23 12:15:14 +00:00
return super.shadowing(stereotype);
2015-11-01 18:37:20 +00:00
}
return colors.getShadowing();
}
2016-01-09 12:15:40 +00:00
@Override
public HtmlColor getFontHtmlColor(Stereotype stereotype, FontParam... param) {
2015-09-28 20:42:17 +00:00
final HtmlColor value = colors.getColor(ColorType.TEXT);
if (value == null) {
2016-01-09 12:15:40 +00:00
return super.getFontHtmlColor(stereotype, param);
2015-09-28 20:42:17 +00:00
}
return value;
}
2016-01-09 12:15:40 +00:00
@Override
2015-09-28 20:42:17 +00:00
public HtmlColor getHtmlColor(ColorParam param, Stereotype stereotype, boolean clickable) {
final ColorType type = param.getColorType();
if (type == null) {
return super.getHtmlColor(param, stereotype, clickable);
}
final HtmlColor value = colors.getColor(type);
if (value != null) {
return value;
}
assert value == null;
return super.getHtmlColor(param, stereotype, clickable);
}
}