aboutsummaryrefslogtreecommitdiffstats
path: root/poi
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2022-12-28 17:56:26 +0000
committerPJ Fanning <fanningpj@apache.org>2022-12-28 17:56:26 +0000
commit537dc7a9334586116cf12fc04ebc4c75a1915929 (patch)
tree4c99262f1d832801238a341359fd883325df2885 /poi
parent1709aa988daaf4ee0598b24e555e15c94a22ba57 (diff)
downloadpoi-537dc7a9334586116cf12fc04ebc4c75a1915929.tar.gz
poi-537dc7a9334586116cf12fc04ebc4c75a1915929.zip
[github-409] Textruns not honouring highlight. Thans to gffloodg. This closes #409
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1906250 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi')
-rw-r--r--poi/src/main/java/org/apache/poi/sl/usermodel/HighlightColorSupport.java67
1 files changed, 67 insertions, 0 deletions
diff --git a/poi/src/main/java/org/apache/poi/sl/usermodel/HighlightColorSupport.java b/poi/src/main/java/org/apache/poi/sl/usermodel/HighlightColorSupport.java
new file mode 100644
index 0000000000..cb8befe90b
--- /dev/null
+++ b/poi/src/main/java/org/apache/poi/sl/usermodel/HighlightColorSupport.java
@@ -0,0 +1,67 @@
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.sl.usermodel;
+
+import java.awt.Color;
+
+import org.apache.poi.common.usermodel.fonts.FontGroup;
+import org.apache.poi.common.usermodel.fonts.FontInfo;
+import org.apache.poi.sl.usermodel.PaintStyle.SolidPaint;
+import org.apache.poi.util.Internal;
+
+/**
+ * An interface to provide support for get/set of highlight color in <code>XLSFTextRuns</code> instances.
+ * Spec Ref: 21.1.2.3.4 (ECMA-376-1 5th ed. Ecma Office Open XML Part 1 - Fundamentals And Markup Language Reference.pdf)
+ *
+ * @since POI 5.2.4
+ */
+@SuppressWarnings({"unused","java:S1452"})
+public interface HighlightColorSupport
+{
+
+ /**
+ * Returns the font highlight (background) color for this text run.
+ * This returns a {@link SolidPaint}, or null if no highlight is set.
+ *
+ * @return The font highlight (background) colour associated with the run, null if no highlight.
+ *
+ * @see org.apache.poi.sl.draw.DrawPaint#getPaint(java.awt.Graphics2D, PaintStyle)
+ * @see SolidPaint#getSolidColor()
+ * @since POI 5.2.4
+ */
+ PaintStyle getHighlightColor();
+
+ /**
+ * Set the highlight (background) color for this text run.
+ *
+ * @param color The highlight (background) color to set.
+ *
+ * @see org.apache.poi.sl.draw.DrawPaint#createSolidPaint(Color)
+ * @since POI 5.2.4
+ */
+ void setHighlightColor(final PaintStyle color);
+
+ /**
+ * Sets the font highlight (background) color for this text run - convenience function
+ *
+ * @param color The highlight (background) color to set.
+ * @since POI 5.2.4
+ */
+ void setHighlightColor(final Color color);
+
+}