1 21 24 package org.lobobrowser.html.renderer; 25 26 import org.lobobrowser.html.style.HtmlLength; 27 28 class VirtualCell { 29 private final RTableCell actualCell; 30 private final boolean isTopLeft; 31 private int column; 32 private int row; 33 34 37 public VirtualCell(RTableCell cell, boolean isTopLeft) { 38 actualCell = cell; 39 this.isTopLeft = isTopLeft; 40 } 41 42 public boolean isTopLeft() { 43 return this.isTopLeft; 44 } 45 46 49 public int getColumn() { 50 return column; 51 } 52 53 54 55 58 public void setColumn(int column) { 59 this.column = column; 60 } 61 62 63 64 67 public int getRow() { 68 return row; 69 } 70 71 72 73 76 public void setRow(int row) { 77 this.row = row; 78 } 79 80 81 82 85 public RTableCell getActualCell() { 86 return actualCell; 87 } 88 89 public HtmlLength getHeightLength() { 90 RTableCell cell = this.actualCell; 92 String heightText = cell.getHeightText(); 93 HtmlLength length; 94 try { 95 length = heightText == null ? null : new HtmlLength(heightText); 96 } catch(Exception err) { 97 length = null; 98 } 99 if(length != null) { 100 length.divideBy(cell.getRowSpan()); 101 } 102 return length; 103 } 104 105 public HtmlLength getWidthLength() { 106 RTableCell cell = this.actualCell; 107 String widthText = cell.getWidthText(); 108 HtmlLength length; 109 try { 110 length = widthText == null ? null : new HtmlLength(widthText); 111 } catch(Exception err) { 112 length = null; 113 } 114 if(length != null) { 115 length.divideBy(cell.getColSpan()); 116 } 117 return length; 118 } 119 120 } 144 | Popular Tags |