public String toString() { return "(" + borderStyle[TOP].getValue() + "/" + borderColour[TOP].getValue() + "," + borderStyle[BOTTOM].getValue() + "/" + borderColour[BOTTOM].getValue() + "," + borderStyle[LEFT].getValue() + "/" + borderColour[LEFT].getValue() + "," + borderStyle[RIGHT].getValue() + "/" + borderColour[RIGHT].getValue() + ")"; } }
private static Boolean compareColours(Colour col, int r, int g, int b) { RGB rgb = col.getDefaultRGB(); if ((rgb.getRed() == r) && (rgb.getGreen() == g) && (rgb.getBlue() == b)) return true; else return false; }
/** * Gets the default red content of this colour. Used when writing the * default colour palette * * @return the red content of this colour * @deprecated use getDefaultRGB instead */ public int getDefaultRed() { return rgb.getRed(); }
/** * Gets the default blue content of this colour. Used when writing the * default colour palette * * @return the blue content of this colour * @deprecated use getDefaultRGB instead */ public int getDefaultBlue() { return rgb.getBlue(); }
/** * Gets the default green content of this colour. Used when writing the * default colour palette * * @return the green content of this colour * @deprecated use getDefaultRGB instead */ public int getDefaultGreen() { return rgb.getGreen(); }
/** * Gets the colour for this font * * @return the colour */ public Colour getColour() { return Colour.getInternalColour(colourIndex); }
/** * Gets the script style * * @return the script style */ public ScriptStyle getScriptStyle() { return ScriptStyle.getStyle(scriptStyle); }
/** * Gets the paper size for a specific value * * @param val the value * @return the paper size */ public static PaperSize getPaperSize(int val) { PaperSize p = val > paperSizes.length - 1 ? null : paperSizes[val]; return p == null ? new PaperSize(val, false) : p; }
/** * Gets the underline style for this font * * @return the underline style */ public UnderlineStyle getUnderlineStyle() { return UnderlineStyle.getStyle(underlineStyle); }
/** * Sets the paper size * * @param ps the paper size */ public void setPaperSize(PaperSize ps) { paperSize = ps.getValue(); }
private static int getRGB(Colour c) { RGB defaultRGB = c.getDefaultRGB(); return defaultRGB.getRed() << 16 | defaultRGB.getGreen() << 8 | defaultRGB.getBlue(); }
/** * Gets the default red content of this colour. Used when writing the * default colour palette * * @return the red content of this colour * @deprecated use getDefaultRGB instead */ public int getDefaultRed() { return rgb.getRed(); }
/** * Gets the default blue content of this colour. Used when writing the * default colour palette * * @return the blue content of this colour * @deprecated use getDefaultRGB instead */ public int getDefaultBlue() { return rgb.getBlue(); }
/** * Gets the default green content of this colour. Used when writing the * default colour palette * * @return the green content of this colour * @deprecated use getDefaultRGB instead */ public int getDefaultGreen() { return rgb.getGreen(); }
/** * Gets the colour for this font * * @return the colour */ public Colour getColour() { return Colour.getInternalColour(colourIndex); }
/** * Gets the script style * * @return the script style */ public ScriptStyle getScriptStyle() { return ScriptStyle.getStyle(scriptStyle); }
/** * Gets the paper size for a specific value * * @param val the value * @return the paper size */ public static PaperSize getPaperSize(int val) { PaperSize p = val > paperSizes.length - 1 ? null : paperSizes[val]; return p == null ? new PaperSize(val, false) : p; }
/** * Gets the underline style for this font * * @return the underline style */ public UnderlineStyle getUnderlineStyle() { return UnderlineStyle.getStyle(underlineStyle); }
/** * Sets the paper size * * @param ps the paper size */ public void setPaperSize(PaperSize ps) { paperSize = ps.getValue(); }
public static void dump() { Colour[] cols = getAllColours(); for (int i = 0; i < cols.length; i++) { RGB rgb = cols[i].getDefaultRGB(); System.out.println(i + ") " + rgb.getRed() + ", " + rgb.getGreen() + ", " + rgb.getBlue()); } }