mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
refactor
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1925498 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1f6c32bd55
commit
bbccb5217f
@ -16,8 +16,6 @@
|
||||
==================================================================== */
|
||||
package org.apache.poi.xssf.usermodel;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import org.apache.poi.ooxml.util.POIXMLUnits;
|
||||
import org.apache.poi.util.Units;
|
||||
import org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun;
|
||||
@ -58,7 +56,7 @@ public class XSSFTextRun {
|
||||
return _r;
|
||||
}
|
||||
|
||||
public void setFontColor(Color color) {
|
||||
public void setFontColor(java.awt.Color color) {
|
||||
setFontColor(new byte[]{(byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue()});
|
||||
}
|
||||
|
||||
@ -79,12 +77,12 @@ public class XSSFTextRun {
|
||||
if(fill.isSetSysClr()) fill.unsetSysClr();
|
||||
}
|
||||
|
||||
public Color getFontColor() {
|
||||
public java.awt.Color getFontColor() {
|
||||
final byte[] rgb = getFontColorAsBytes();
|
||||
if (rgb.length == 3) {
|
||||
return new Color(0xFF & rgb[0], 0xFF & rgb[1], 0xFF & rgb[2]);
|
||||
return new java.awt.Color(0xFF & rgb[0], 0xFF & rgb[1], 0xFF & rgb[2]);
|
||||
} else {
|
||||
return new Color(0xFF & rgb[1], 0xFF & rgb[2], 0xFF & rgb[3], 0xFF & rgb[0]);
|
||||
return new java.awt.Color(0xFF & rgb[1], 0xFF & rgb[2], 0xFF & rgb[3], 0xFF & rgb[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user