MCPcopy Create free account
hub / github.com/dumbledore/AlbiteREADER / saveOptionsToRMS

Method saveOptionsToRMS

src/org/albite/albite/BookCanvas.java:1990–2054  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1988 }
1989
1990 protected final void saveOptionsToRMS() {
1991
1992 /*
1993 * Has the bookcanvas been opened AT ALL?
1994 */
1995 if (isBookOpen()) {
1996 try {
1997 //serialize first record
1998 ByteArrayOutputStream boas = new ByteArrayOutputStream();
1999 DataOutputStream dout = new DataOutputStream(boas);
2000 try {
2001 RMSHelper.writeVersionNumber(app, dout);
2002
2003 /*
2004 * Save color schemes
2005 */
2006 currentScheme.save(dout);
2007 currentScheme.getOther().save(dout);
2008
2009 /*
2010 * Save font options
2011 */
2012 dout.writeBoolean(useNativeFonts);
2013 dout.writeByte(currentFontSizeIndex);
2014
2015 /*
2016 * Save scrolling options
2017 */
2018 dout.writeFloat(speedMultiplier);
2019 dout.writeBoolean(smoothScrolling);
2020 dout.writeBoolean(horizontalScrolling);
2021 dout.writeInt(currentHoldingTime);
2022
2023 /*
2024 * Save screen mode options
2025 */
2026 dout.writeInt(orientation);
2027 dout.writeBoolean(fullscreen);
2028 dout.writeBoolean(seenFullscreenAlert);
2029
2030 /*
2031 * Write page options
2032 */
2033 dout.writeInt(currentMarginWidth);
2034 dout.writeInt(currentLineSpacing);
2035 dout.writeBoolean(renderImages);
2036
2037 } catch (IOException ioe) {
2038 //#debug
2039 AlbiteMIDlet.LOGGER.log(ioe);
2040 }
2041
2042 byte[] data = boas.toByteArray();
2043
2044 if (rs.getNumRecords() > 0) {
2045 rs.setRecord(1, data, 0, data.length);
2046 } else {
2047 rs.addRecord(data, 0, data.length);

Callers 1

saveAllOptionsMethod · 0.95

Calls 8

isBookOpenMethod · 0.95
writeVersionNumberMethod · 0.95
saveMethod · 0.80
getOtherMethod · 0.80
writeByteMethod · 0.80
writeIntMethod · 0.80
logMethod · 0.80
toByteArrayMethod · 0.80

Tested by

no test coverage detected