git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352975 13f79535-47bb-0310-9956-ffa450edef68tags/REL_1_10
<classpathentry kind="src" path="src/testcases"/> | <classpathentry kind="src" path="src/testcases"/> | ||||
<classpathentry kind="src" path="src/java"/> | <classpathentry kind="src" path="src/java"/> | ||||
<classpathentry kind="src" path="src/examples/src"/> | <classpathentry kind="src" path="src/examples/src"/> | ||||
<classpathentry kind="src" path="src/documentation/xdocs"/> | |||||
<classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/> | <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/> | ||||
<classpathentry exported="true" kind="lib" path="D:/cygwin/opt/eclipse/workspace/jakarta-poi/tools/cents/junit.cent/lib/junit-3.7.jar"/> | |||||
<classpathentry kind="lib" path="tools/cents/junit.cent/lib/junit-3.7.jar"/> | |||||
<classpathentry kind="lib" path="lib/core/commons-logging-1.0.jar"/> | |||||
<classpathentry kind="output" path="build"/> | <classpathentry kind="output" path="build"/> | ||||
</classpath> | </classpath> |
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
<projectDescription> | <projectDescription> | ||||
<name>jakarta-poi</name> | |||||
<name>POI</name> | |||||
<comment></comment> | <comment></comment> | ||||
<projects> | <projects> | ||||
</projects> | </projects> |
return record.getVCenter(); | return record.getVCenter(); | ||||
} | } | ||||
/** | |||||
* determines whether the output is horizontally centered on the page. | |||||
* @param value true to horizontally center, false otherwise. | |||||
*/ | |||||
public void setHorizontallyCenter(boolean value) | |||||
{ | |||||
HCenterRecord record = | |||||
(HCenterRecord) sheet.findFirstRecordBySid(HCenterRecord.sid); | |||||
record.setHCenter(value); | |||||
} | |||||
/** | |||||
* Determine whether printed output for this sheet will be horizontally centered. | |||||
*/ | |||||
public boolean getHorizontallyCenter() | |||||
{ | |||||
HCenterRecord record = | |||||
(HCenterRecord) sheet.findFirstRecordBySid(HCenterRecord.sid); | |||||
return record.getHCenter(); | |||||
} | |||||
/** | /** | ||||
* removes a merged region of cells (hence letting them free) | * removes a merged region of cells (hence letting them free) | ||||
* @param index of the region to unmerge | * @param index of the region to unmerge |
import junit.framework.TestCase; | import junit.framework.TestCase; | ||||
import org.apache.poi.hssf.model.Sheet; | import org.apache.poi.hssf.model.Sheet; | ||||
import org.apache.poi.hssf.record.HCenterRecord; | |||||
import org.apache.poi.hssf.record.VCenterRecord; | import org.apache.poi.hssf.record.VCenterRecord; | ||||
import org.apache.poi.hssf.record.WSBoolRecord; | import org.apache.poi.hssf.record.WSBoolRecord; | ||||
// wb.write(new FileOutputStream("c:\\test.xls")); | // wb.write(new FileOutputStream("c:\\test.xls")); | ||||
} | } | ||||
/** | |||||
* Test horizontally centered output. | |||||
*/ | |||||
public void testHorizontallyCenter() | |||||
throws Exception | |||||
{ | |||||
HSSFWorkbook wb = new HSSFWorkbook(); | |||||
HSSFSheet s = wb.createSheet(); | |||||
Sheet sheet = s.getSheet(); | |||||
HCenterRecord record = | |||||
(HCenterRecord) sheet.findFirstRecordBySid(HCenterRecord.sid); | |||||
assertEquals(false, record.getHCenter()); | |||||
s.setHorizontallyCenter(true); | |||||
assertEquals(true, record.getHCenter()); | |||||
} | |||||
/** | /** | ||||
* Test WSBboolRecord fields get set in the user model. | * Test WSBboolRecord fields get set in the user model. | ||||
*/ | */ |