Examples of ColourConverter


Examples of org.openoffice.xmerge.util.ColourConverter

        // TODO: Font changes need to be worked out here

        try {
            if (pStyle != null) {
                if (pStyle.getFontColor() != null) {
          ColourConverter cc = new ColourConverter();
                    short colourCode = cc.convertFromRGB(pStyle.getFontColor());
                    if (colourCode != 0) {  // not black
                        data.write(COLOUR_TAG);
                        data.write(EndianConverter.writeShort(colourCode));
                        colourSet = true;
                    }
View Full Code Here

Examples of org.openoffice.xmerge.util.ColourConverter

    cch = (byte) fontName.length();
    rgch = fontName.getBytes("UTF-16LE");

    Color foreground  = fmt.getForeground();
    if( foreground != null ) {
      ColourConverter cc = new ColourConverter(PocketExcelConstants.cLookup);
      icvFore = EndianConverter.writeShort(cc.convertFromRGB(foreground));
    } else {
      icvFore  = new byte[] {(byte)0xFF,(byte)0x00};
    }

    Reserved2    = EndianConverter.writeShort((short) 0);
View Full Code Here

Examples of org.openoffice.xmerge.util.ColourConverter

   */
  public Color getForeground() {
    short rgb = EndianConverter.readShort(icvFore);
    Color c = null;
    if(rgb!=0xFF) {
      ColourConverter cc = new ColourConverter(PocketExcelConstants.cLookup);
      c = cc.convertToRGB(rgb);
    }
    return c;
  }
View Full Code Here

Examples of org.openoffice.xmerge.util.ColourConverter

      fTextAttr[1] |= BOTTOM_BORDER;
    }
   
    Color background = fmt.getBackground();
    if( background != null ) {
      ColourConverter cc = new ColourConverter(PocketExcelConstants.cLookup);
      icvFill = EndianConverter.writeShort(cc.convertFromRGB(background));
    } else {
      icvFill    = new byte[] {(byte)0xFF,(byte)0x00};
    }
   
      icvFore    = new byte[] {(byte)0xFF,(byte)0x00};
View Full Code Here

Examples of org.openoffice.xmerge.util.ColourConverter

   */
  public Color getBackground() {
    short rgb = EndianConverter.readShort(icvFill);
    Color c = null;
    if(rgb!=0xFF) {
      ColourConverter cc = new ColourConverter(PocketExcelConstants.cLookup);
      c = cc.convertToRGB(rgb);
    }
    return c;
  }
View Full Code Here

Examples of org.openoffice.xmerge.util.ColourConverter

                        break;
                       
                       
                    case COLOUR_TAG:
                        if (data[i + 1] != 0) {
              ColourConverter cc = new ColourConverter();
                            textColour = cc.convertToRGB(
                                EndianConverter.readShort(new byte[] { data[i + 1],
                                                                    data[i + 2] } ));                                      
                            attrsSet++;           
                        }
                        else {
View Full Code Here

Examples of org.openoffice.xmerge.util.ColourConverter

    cch = (byte) fontName.length();
    rgch = fontName.getBytes("UTF-16LE");

    Color foreground  = fmt.getForeground();
    if( foreground != null ) {
      ColourConverter cc = new ColourConverter(PocketExcelConstants.cLookup);
      icvFore = EndianConverter.writeShort(cc.convertFromRGB(foreground));
    } else {
      icvFore  = new byte[] {(byte)0xFF,(byte)0x00};
    }

    Reserved2    = EndianConverter.writeShort((short) 0);
View Full Code Here

Examples of org.openoffice.xmerge.util.ColourConverter

   */
  public Color getForeground() {
    short rgb = EndianConverter.readShort(icvFore);
    Color c = null;
    if(rgb!=0xFF) {
      ColourConverter cc = new ColourConverter(PocketExcelConstants.cLookup);
      c = cc.convertToRGB(rgb);
    }
    return c;
  }
View Full Code Here

Examples of org.openoffice.xmerge.util.ColourConverter

                        break;
                       
                       
                    case COLOUR_TAG:
                        if (data[i + 1] != 0) {
              ColourConverter cc = new ColourConverter();
                            textColour = cc.convertToRGB(
                                EndianConverter.readShort(new byte[] { data[i + 1],
                                                                    data[i + 2] } ));                                      
                            attrsSet++;           
                        }
                        else {
View Full Code Here

Examples of org.openoffice.xmerge.util.ColourConverter

        // TODO: Font changes need to be worked out here

        try {
            if (pStyle != null) {
                if (pStyle.getFontColor() != null) {
          ColourConverter cc = new ColourConverter();
                    short colourCode = cc.convertFromRGB(pStyle.getFontColor());
                    if (colourCode != 0) {  // not black
                        data.write(COLOUR_TAG);
                        data.write(EndianConverter.writeShort(colourCode));
                        colourSet = true;
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.