Package org.odftoolkit.simple.style

Examples of org.odftoolkit.simple.style.Border


      SpreadsheetDocument document;
      document = SpreadsheetDocument.newSpreadsheetDocument();
      Table table1 = document.getTableByName("Sheet1");
      Cell cell1 = table1.getCellByPosition("A1");
      cell1.setStringValue("four border");
      Border border = new Border(Color.RED, 1, StyleTypeDefinitions.SupportedLinearMeasure.PT);
      cell1.setBorders(CellBordersType.ALL_FOUR, border);
      Border bottomBorder = cell1.getStyleHandler().getBorder(CellBordersType.BOTTOM);
      Assert.assertEquals(border, bottomBorder);

      Cell cell2 = table1.getCellByPosition("C2");
      cell2.setStringValue("top bottom");
      Border border2 = new Border(Color.BLUE, 5, 1, 2, StyleTypeDefinitions.SupportedLinearMeasure.PT);
      cell2.setBorders(CellBordersType.TOP_BOTTOM, border2);
      Border bottomBorder2 = cell2.getStyleHandler().getBorder(CellBordersType.BOTTOM);
      Assert.assertEquals(border2, bottomBorder2);
      Border bottomBorder22 = cell2.getStyleHandler().getBorder(CellBordersType.LEFT);
      Assert.assertEquals(Border.NONE, bottomBorder22);
      document.save(ResourceUtilities.newTestOutputFile("TestSetGetBorder.ods"));
    } catch (Exception e) {
      Logger.getLogger(TableCellTest.class.getName()).log(Level.SEVERE, e.getMessage(), e);
      Assert.fail();
View Full Code Here


 
 
  @Test
  public void testGetCountry() {
    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);
View Full Code Here

 
 
  @Test
  public void testGetLanguage() {
    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);
View Full Code Here

 
 
  @Test
  public void testSetColor() {
    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);
View Full Code Here

  }
 
 
  @Test
  public void testSetBorder() {
    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");
     
      borderbase.setLinearMeasure(StyleTypeDefinitions.SupportedLinearMeasure.CM);
     
      Cell cell = table.getCellByPosition("A14");
      cell.setBorders(CellBordersType.LEFT, borderbase);
     

      CellStyleHandler cellHandler = cell.getStyleHandler();
      Border border = cellHandler.getBorder(CellBordersType.LEFT);
      Assert.assertEquals(borderbase, border);
      //save
      //doc.save(ResourceUtilities.newTestOutputFile("testSetWidth.ods"));

    } catch (Exception e) {
View Full Code Here

   
  }
 
  @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

      SpreadsheetDocument document;
      document = SpreadsheetDocument.newSpreadsheetDocument();
      Table table1 = document.getTableByName("Sheet1");
      Cell cell1 = table1.getCellByPosition("A1");
      cell1.setStringValue("four border");
      Border border = new Border(Color.RED, 1, StyleTypeDefinitions.SupportedLinearMeasure.PT);
      cell1.setBorders(CellBordersType.ALL_FOUR, border);
      Border bottomBorder = cell1.getStyleHandler().getBorder(CellBordersType.BOTTOM);
      Assert.assertEquals(border, bottomBorder);

      Cell cell2 = table1.getCellByPosition("C2");
      cell2.setStringValue("top bottom");
      Border border2 = new Border(Color.BLUE, 5, 1, 2, StyleTypeDefinitions.SupportedLinearMeasure.PT);
      cell2.setBorders(CellBordersType.TOP_BOTTOM, border2);
      Border bottomBorder2 = cell2.getStyleHandler().getBorder(CellBordersType.BOTTOM);
      Assert.assertEquals(border2, bottomBorder2);
      Border bottomBorder22 = cell2.getStyleHandler().getBorder(CellBordersType.LEFT);
      Assert.assertEquals(Border.NONE, bottomBorder22);
      document.save(ResourceUtilities.newTestOutputFile("TestSetGetBorder.ods"));
    } catch (Exception e) {
      Logger.getLogger(TableCellTest.class.getName()).log(Level.SEVERE, e.getMessage(), e);
      Assert.fail();
View Full Code Here

 
 
  @Test
  public void testGetCountry() {
    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);
View Full Code Here

 
 
  @Test
  public void testGetLanguage() {
    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);
View Full Code Here

 
 
  @Test
  public void testSetColor() {
    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);
View Full Code Here

TOP

Related Classes of org.odftoolkit.simple.style.Border

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.