Package org.odftoolkit.odfdom.type

Examples of org.odftoolkit.odfdom.type.Color


   
  }
 
  @Test
  public void testIsTextWrapped() {
    Border borderbase = new Border(new Color("#00ccff"), 0.0701, 0.0008, 0.0346, SupportedLinearMeasure.CM);
    try {
      SpreadsheetDocument doc = SpreadsheetDocument.loadDocument(ResourceUtilities
          .getTestResourceAsStream(filename));
      Table table = doc.getTableByName("A");
      Cell cell = table.getCellByPosition("A14");
View Full Code Here


  static final String filename = "testGetCellAt.ods";

  @Test
  public void testGetSetFont() {
    Font font1Base = new Font("Arial", FontStyle.ITALIC, 10, Color.BLACK, TextLinePosition.THROUGH);
    Font font2Base = new Font("'Times New Roman'", FontStyle.REGULAR, (float) 13.95, new Color("#ff3333"),
        TextLinePosition.THROUGHUNDER);
    Font font3Base = new Font("SimSun", FontStyle.BOLD, 8, Color.BLACK, TextLinePosition.REGULAR);
    Font font4Base = new Font("Arial", FontStyle.REGULAR, 10, Color.BLACK, TextLinePosition.UNDER);
    try {
      SpreadsheetDocument doc = SpreadsheetDocument.loadDocument(ResourceUtilities
View Full Code Here

   * If no background color is set, default background color "#FFFFFF" will be returned.
   *
   * @return the background color of this cell
   */
  public Color getCellBackgroundColor() {
    Color color = Color.WHITE;
    OdfStyleBase styleElement = getCellStyleElement();
    if (styleElement != null) {
      OdfStyleProperty bkColorProperty = OdfStyleProperty.get(OdfStylePropertiesSet.TableCellProperties,
          OdfName.newName(OdfDocumentNamespace.FO, "background-color"));
      String property = styleElement.getProperty(bkColorProperty);
      if (property != null) {
        try {
          color = new Color(property);
        } catch (Exception e) {
          // use default background color White
          color = Color.WHITE;
          Logger.getLogger(OdfTableCell.class.getName()).log(Level.WARNING, e.getMessage());
        }
View Full Code Here

    double size = getFontSizeInPoint(type);
    StyleTypeDefinitions.FontStyle fontStyle = getFontStyle(type);
    StyleTypeDefinitions.TextLinePosition lineStyle = getTextLineStyle();
    Font aFont = new Font(familyName, fontStyle, size, lineStyle);

    Color color = getFontColor();
    // String language = getLanguage(type);
    // String country = getCountry(type);

    if (color != null)
      aFont.setColor(color);
View Full Code Here

      throw new IllegalArgumentException(
          "The border description is invalid. Border description contains width, style and color, such as '0.0154in double #9900ff'");

    String borderWidth = st.nextToken();
    String borderStyle = st.nextToken();
    Color borderColor = new Color(st.nextToken());

    if (borderStyle.equals("solid"))
      borderStyle = StyleTypeDefinitions.LineType.SINGLE.toString();

    StyleTypeDefinitions.LineType borderStyleType = StyleTypeDefinitions.LineType.enumValueOf(borderStyle);
View Full Code Here

     
      TextProperties textProperties = cell.getStyleHandler().getTextPropertiesForWrite();
      textProperties.setFontColor(Color.GREEN);
     
      //validate
      Color green = textProperties.getFontColor();
      Assert.assertEquals(Color.GREEN.toString(), green.toString());
     
      //save
      document.save(ResourceUtilities.newTestOutputFile("testFontOutput1.ods"));
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
View Full Code Here

  static final String filename = "testGetCellAt.ods";

  @Test
  public void testGetSetBorder() {
    Border borderbase1 = new Border(new Color("#ff3333"), 5, SupportedLinearMeasure.PT);
    Border borderbase2 = new Border(new Color("#0000ff"), 0.0154, 0.0008, 0.0008, SupportedLinearMeasure.IN);
    Border borderbase3 = new Border(new Color("#ff3333"), 0.0362, 0.0008, 0.0008, SupportedLinearMeasure.IN);
    Border borderbase4 = new Border(new Color("#00ccff"), 0.0701, 0.0008, 0.0346, SupportedLinearMeasure.IN);
    try {
      SpreadsheetDocument doc = SpreadsheetDocument.loadDocument(ResourceUtilities
          .getTestResourceAsStream(filename));
      Table table = doc.getTableByName("A");
      Cell cell1 = table.getCellByPosition("A8");
View Full Code Here

  }
 
 
  @Test
  public void testSetWidth() {
    Border borderbase = new Border(new Color("#00ccff"), 0.0701, 0.0008, 0.0346, SupportedLinearMeasure.IN);
    try {
      SpreadsheetDocument doc = SpreadsheetDocument.loadDocument(ResourceUtilities
          .getTestResourceAsStream(filename));
      Table table = doc.getTableByName("A");
      //setWidth
View Full Code Here

  }
 
 
  @Test
  public void testSGetInnerLineWidth() {
    Border borderbase = new Border(new Color("#00ccff"), 0.0701, 0.0008, 0.0346, SupportedLinearMeasure.IN);
    try {
      SpreadsheetDocument doc = SpreadsheetDocument.loadDocument(ResourceUtilities
          .getTestResourceAsStream(filename));
      Table table = doc.getTableByName("A");
      //setWidth
View Full Code Here

  }
 
 
  @Test
  public void testSGetDistance() {
    Border borderbase = new Border(new Color("#00ccff"), 0.0701, 0.0008, 0.0346, SupportedLinearMeasure.IN);
    try {
      SpreadsheetDocument doc = SpreadsheetDocument.loadDocument(ResourceUtilities
          .getTestResourceAsStream(filename));
      Table table = doc.getTableByName("A");
      //setWidth
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.type.Color

Copyright © 2018 www.massapicom. 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.