Browse Source

Rename method for color from "RBG" to "RGB"

It's a protected method that is not intended to be used
outside anyway.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1906276 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_5_2_4
Dominik Stadler 1 year ago
parent
commit
83bb4b4da5

+ 1
- 1
poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFColor.java View File

@@ -217,7 +217,7 @@ public class XSSFColor extends ExtendedColor {
}

@Override
protected byte[] getStoredRBG() {
protected byte[] getStoredRGB() {
return ctColor.getRgb();
}


+ 5
- 5
poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFExtendedColor.java View File

@@ -28,16 +28,16 @@ import org.apache.poi.ss.usermodel.ExtendedColor;
/**
* The HSSF file format normally stores Color information in the
* Palette (see PaletteRecord), but for a few cases (eg Conditional
* Formatting, Sheet Extensions), this XSSF-style color record
* Formatting, Sheet Extensions), this XSSF-style color record
* can be used.
*/
public class HSSFExtendedColor extends ExtendedColor {
private org.apache.poi.hssf.record.common.ExtendedColor color;
public HSSFExtendedColor(org.apache.poi.hssf.record.common.ExtendedColor color) {
this.color = color;
}
protected org.apache.poi.hssf.record.common.ExtendedColor getExtendedColor() {
return color;
}
@@ -80,7 +80,7 @@ public class HSSFExtendedColor extends ExtendedColor {
return argb;
}

protected byte[] getStoredRBG() {
protected byte[] getStoredRGB() {
return getARGB();
}

@@ -108,7 +108,7 @@ public class HSSFExtendedColor extends ExtendedColor {
public void setTint(double tint) {
color.setTint(tint);
}
protected byte[] getIndexedRGB() {
if (isIndexed() && getIndex() > 0) {
int indexNum = getIndex();

+ 10
- 10
poi/src/main/java/org/apache/poi/ss/usermodel/ExtendedColor.java View File

@@ -21,7 +21,7 @@ import java.util.Locale;
/**
* Represents a XSSF-style color (based on either a
* {@link org.apache.poi.xssf.usermodel.XSSFColor} or a
* {@link org.apache.poi.hssf.record.common.ExtendedColor}
* {@link org.apache.poi.hssf.record.common.ExtendedColor}
*/
public abstract class ExtendedColor implements Color {

@@ -47,17 +47,17 @@ public abstract class ExtendedColor implements Color {
* @return true if the color is RGB / ARGB
*/
public abstract boolean isRGB();
/**
* @return true if the color is from a Theme
*/
public abstract boolean isThemed();
/**
* @return Indexed Color index value, if {@link #isIndexed()} is true
*/
public abstract short getIndex();
/**
* @return Index of Theme color, if {@link #isThemed()} is true
*/
@@ -77,8 +77,8 @@ public abstract class ExtendedColor implements Color {
/**
* @return RGB or ARGB bytes or null
*/
protected abstract byte[] getStoredRBG();
protected abstract byte[] getStoredRGB();
/**
* Sets the Red Green Blue or Alpha Red Green Blue
* @param rgb bytes
@@ -97,9 +97,9 @@ public abstract class ExtendedColor implements Color {
}

// Grab the colour
return getStoredRBG();
return getStoredRGB();
}
/**
* @return index color RGB bytes, if {@link #isIndexed()} == true, null if not indexed or index is invalid
*/
@@ -110,7 +110,7 @@ public abstract class ExtendedColor implements Color {
* Alpha values are ignored.
*/
public byte[] getRGBWithTint() {
byte[] rgb = getStoredRBG();
byte[] rgb = getStoredRGB();
if (rgb != null) {
if(rgb.length == 4) {
byte[] tmp = new byte[3];
@@ -146,7 +146,7 @@ public abstract class ExtendedColor implements Color {
}
return sb.toString().toUpperCase(Locale.ROOT);
}
/**
* Sets the ARGB value from hex format, eg FF0077FF.
* Only works for regular (non-indexed) colours

Loading…
Cancel
Save