public class ParagraphKeeptogetherContext {
- private static int m_paraKeepTogetherOpen = 0;
- private static boolean m_paraResetProperties = false;
- private static ParagraphKeeptogetherContext m_instance = null;
+ private static int paraKeepTogetherOpen = 0;
+ private static boolean paraResetProperties = false;
+ private static ParagraphKeeptogetherContext instance = null;
ParagraphKeeptogetherContext() {
}
* @return The instance of ParagraphKeeptogetherContext
*/
public static ParagraphKeeptogetherContext getInstance() {
- if (m_instance == null) {
- m_instance = new ParagraphKeeptogetherContext();
+ if (instance == null) {
+ instance = new ParagraphKeeptogetherContext();
}
- return m_instance;
+ return instance;
}
/**
* @return the level of current "keep whith next" paragraph
*/
public static int getKeepTogetherOpenValue() {
- return m_paraKeepTogetherOpen;
+ return paraKeepTogetherOpen;
}
- /** Open a new "keep whith next" paragraph */
- public static void KeepTogetherOpen() {
- m_paraKeepTogetherOpen++;
+ /** Open a new "keep with next" paragraph */
+ public static void keepTogetherOpen() {
+ paraKeepTogetherOpen++;
}
- /** Close a "keep whith next" paragraph */
- public static void KeepTogetherClose() {
- if (m_paraKeepTogetherOpen > 0) {
- m_paraKeepTogetherOpen--;
+ /** Close a "keep with next" paragraph */
+ public static void keepTogetherClose() {
+ if (paraKeepTogetherOpen > 0) {
+ paraKeepTogetherOpen--;
//If the \pard control word is not present, the current paragraph
//inherits all paragraph properties.
//Also the next paragraph must reset the properties otherwise the \keepn don't stop.
- m_paraResetProperties = (m_paraKeepTogetherOpen == 0);
+ paraResetProperties = (paraKeepTogetherOpen == 0);
}
}
- /** Determine if the next paragraph must reset the properites */
+ /**
+ * @return true if the next paragraph must reset the properties
+ */
public static boolean paragraphResetProperties() {
- return m_paraResetProperties;
+ return paraResetProperties;
}
/** Reset the flag if the paragraph properties have been resested */
public static void setParagraphResetPropertiesUsed() {
- m_paraResetProperties = false;
+ paraResetProperties = false;
}
}
public class RtfAfter extends RtfAfterBeforeBase {
/**RtfBefore attributes*/
public static final String FOOTER = "footer";
+ /** String array of footer attributes */
public static final String[] FOOTER_ATTR = new String[]{
FOOTER
};
super(parent, w, attrs);
}
+ /**
+ *
+ * @throws IOException for I/O problems
+ */
protected void writeMyAttributes() throws IOException {
- writeAttributes(m_attrib, FOOTER_ATTR);
+ writeAttributes(attrib, FOOTER_ATTR);
}
}
\ No newline at end of file
abstract class RtfAfterBeforeBase
extends RtfContainer
implements IRtfParagraphContainer, IRtfExternalGraphicContainer, IRtfTableContainer {
- protected RtfAttributes m_attrib;
- private RtfParagraph m_para;
- private RtfExternalGraphic m_externalGraphic;
- private RtfTable m_table;
+ protected RtfAttributes attrib;
+ private RtfParagraph para;
+ private RtfExternalGraphic externalGraphic;
+ private RtfTable table;
RtfAfterBeforeBase(RtfSection parent, Writer w, RtfAttributes attrs) throws IOException {
super((RtfContainer)parent, w, attrs);
- m_attrib = attrs;
+ attrib = attrs;
}
public RtfParagraph newParagraph() throws IOException {
closeAll();
- m_para = new RtfParagraph(this, m_writer);
- return m_para;
+ para = new RtfParagraph(this, m_writer);
+ return para;
}
public RtfParagraph newParagraph(RtfAttributes attrs) throws IOException {
closeAll();
- m_para = new RtfParagraph(this, m_writer, attrs);
- return m_para;
+ para = new RtfParagraph(this, m_writer, attrs);
+ return para;
}
public RtfExternalGraphic newImage() throws IOException {
closeAll();
- m_externalGraphic = new RtfExternalGraphic(this, m_writer);
- return m_externalGraphic;
+ externalGraphic = new RtfExternalGraphic(this, m_writer);
+ return externalGraphic;
}
private void closeCurrentParagraph() throws IOException {
- if (m_para != null) {
- m_para.close();
+ if (para != null) {
+ para.close();
}
}
private void closeCurrentExternalGraphic() throws IOException {
- if (m_externalGraphic != null) {
- m_externalGraphic.close();
+ if (externalGraphic != null) {
+ externalGraphic.close();
}
}
private void closeCurrentTable() throws IOException {
- if (m_table != null) {
- m_table.close();
+ if (table != null) {
+ table.close();
}
}
}
public RtfAttributes getAttributes() {
- return m_attrib;
+ return attrib;
}
public void closeAll() throws IOException {
*/
public RtfTable newTable(RtfAttributes attrs, ITableColumnsInfo tc) throws IOException {
closeAll();
- m_table = new RtfTable(this, m_writer, attrs, tc);
- return m_table;
+ table = new RtfTable(this, m_writer, attrs, tc);
+ return table;
}
/** close current table if any and start a new one */
public RtfTable newTable(ITableColumnsInfo tc) throws IOException {
closeAll();
- m_table = new RtfTable(this, m_writer, tc);
- return m_table;
+ table = new RtfTable(this, m_writer, tc);
+ return table;
}
}
\ No newline at end of file
}
protected void writeMyAttributes() throws IOException {
- writeAttributes(m_attrib, HEADER_ATTR);
+ writeAttributes(attrib, HEADER_ATTR);
}
}
\ No newline at end of file
final String cmd = (String)it.next();
if (cmd.equals(PARA_KEEP_ON)) {
- m_paragraphKeeptogetherContext.KeepTogetherOpen();
+ m_paragraphKeeptogetherContext.keepTogetherOpen();
} else if (cmd.equals(PARA_KEEP_OFF)) {
- m_paragraphKeeptogetherContext.KeepTogetherClose();
+ m_paragraphKeeptogetherContext.keepTogetherClose();
} else {
// this.getRtfFile ().getLog ().logInfo
// ("JFOR-CMD ignored, command not recognised:"+cmd);