Package org.odftoolkit.simple

Examples of org.odftoolkit.simple.SpreadsheetDocument$ChartContainerImpl


    }
  }

  @Test
  public void testAppendRowsWithCoveredCell() {
    SpreadsheetDocument odsDoc = null;
    Table table = null;
    try {
      odsDoc = SpreadsheetDocument.newSpreadsheetDocument();
      table = Table.newTable(odsDoc);
      mergeCells(table, 1, 1, 3, 2);
View Full Code Here


  }

  @Test
  public void testAppendRowsWithRowsRepeated() {
    SpreadsheetDocument odsDoc = null;
    Table table = null;
    try {
      odsDoc = SpreadsheetDocument.newSpreadsheetDocument();
      table = Table.newTable(odsDoc, 1, 1);
      table.appendRows(12);
View Full Code Here

    }
  }

  @Test
  public void testAppendColumnsWithColumnsRepeated() {
    SpreadsheetDocument odsDoc = null;
    Table table = null;
    try {
      odsDoc = SpreadsheetDocument.newSpreadsheetDocument();
      table = Table.newTable(odsDoc, 1, 1);
      table.appendColumns(12);
View Full Code Here

  // Bug 97 - Row.getCellAt(int) returns null when the cell is a repeat cell
  @Test
  public void testGetCellAt() {
    try {
      SpreadsheetDocument doc = (SpreadsheetDocument) SpreadsheetDocument.loadDocument(ResourceUtilities
          .getTestResourceAsStream("testGetCellAt.ods"));
      Table odfTable = doc.getTableList().get(0);
      Row valueRows = odfTable.getRowByIndex(0);
      for (int i = 0; i < 4; i++) {
        Cell cell = valueRows.getCellByIndex(i);
        Assert.assertNotNull(cell);
        int value = cell.getDoubleValue().intValue();
View Full Code Here

  public void testSetBorders() {
    try {
     
        Border borderbase = new Border(Color.LIME, 1.0701, 0.0208, 0.0346, SupportedLinearMeasure.CM);
      borderbase.setLineStyle(StyleTypeDefinitions.LineType.SINGLE);
      SpreadsheetDocument doc = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = doc.getTableByName("Sheet1");
     
      Cell cell = table.getCellByPosition(2, 2);
      cell.setBorders(CellBordersType.BOTTOM, borderbase);
      cell.setBorders(CellBordersType.RIGHT, borderbase);
      cell.setBorders(CellBordersType.DIAGONALTLBR, borderbase);

      //verification
      Border base = cell.getBorder(CellBordersType.BOTTOM);
      base = cell.getBorder(CellBordersType.RIGHT);
      base = cell.getBorder(CellBordersType.DIAGONALTLBR);
      Assert.assertEquals(borderbase, base);
      Assert.assertEquals(StyleTypeDefinitions.LineType.SINGLE, borderbase.getLineStyle());
     
      //save
      doc.save(ResourceUtilities.newTestOutputFile("testSupportedLinearMeasure.ods"));
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

  public void testSetBorders_NONE() {
    try {
     
        Border borderbase = new Border(Color.LIME, 3.0701, 0.0208, 0.0346, SupportedLinearMeasure.CM);
      borderbase.setLineStyle(StyleTypeDefinitions.LineType.SINGLE);
      SpreadsheetDocument doc = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = doc.getTableByName("Sheet1");
     
      Cell cell = table.getCellByPosition(0, 0);
      //cell.setBorders(CellBordersType.DIAGONAL_LINES, borderbase);
      cell.setBorders(CellBordersType.RIGHT, borderbase);
View Full Code Here

  public void testSetBorders_DIAGONAL_LINES() {
    try {
     
        Border borderbase = new Border(Color.LIME, 3.0701, 0.0208, 0.0346, SupportedLinearMeasure.CM);
      borderbase.setLineStyle(StyleTypeDefinitions.LineType.SINGLE);
      SpreadsheetDocument doc = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = doc.getTableByName("Sheet1");
     
      Cell cell = table.getCellByPosition(0, 0);
      cell.setBorders(CellBordersType.DIAGONAL_LINES, borderbase);

      //validate
View Full Code Here

  @Test
  public void testGetBorder() {
    try {
      Border borderbase = new Border(Color.LIME, 3.0701, 0.0208, 0.0346, SupportedLinearMeasure.CM);
      borderbase.setLineStyle(StyleTypeDefinitions.LineType.SINGLE);
      SpreadsheetDocument doc = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = doc.getTableByName("Sheet1");
     
      Cell cell = table.getCellByPosition(2, 2);
      cell.setBorders(CellBordersType.ALL_FOUR, borderbase);

      //validate
      TableCellProperties styleCell = cell.getStyleHandler().getTableCellPropertiesForWrite();
      Border bor = styleCell.getBorder();
      Assert.assertEquals(borderbase, bor);
     
      //save
      doc.save(ResourceUtilities.newTestOutputFile("testSupportedLinearMeasure.ods"));
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

  @Test
  public void testGetLeftBorder() {
    try {
      Border borderbase = new Border(Color.LIME, 3.0701, 0.0208, 0.0346, SupportedLinearMeasure.CM);
      borderbase.setLineStyle(StyleTypeDefinitions.LineType.DOUBLE);
      SpreadsheetDocument doc = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = doc.getTableByName("Sheet1");
     
      Cell cell = table.getCellByPosition(2, 2);
      cell.setBorders(CellBordersType.RIGHT, borderbase);

      //validate
      TableCellProperties styleCell = cell.getStyleHandler().getTableCellPropertiesForWrite();
      Border bor = styleCell.getRightBorder();
      Assert.assertEquals(borderbase, bor);
     
      //save
      doc.save(ResourceUtilities.newTestOutputFile("testSupportedLinearMeasure.ods"));
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

    }
  }
 
        @Test
  public void testSettingNullBackgroundOnProperties() throws Exception {
            SpreadsheetDocument doc = SpreadsheetDocument.newSpreadsheetDocument();
            Table table = doc.getTableByName("Sheet1");
            Cell cell = table.getCellByPosition(1, 1);
            cell.setCellBackgroundColor(Color.BLACK);
            // setting null resets the element, see ODFTOOLKIT-326
            cell.getStyleHandler().getTableCellPropertiesForWrite().setBackgroundColor(null);
            Assert.assertNull(cell.getStyleHandler().getTableCellPropertiesForRead().getBackgroundColor());
View Full Code Here

TOP

Related Classes of org.odftoolkit.simple.SpreadsheetDocument$ChartContainerImpl

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.