Class CompatibleHardcopyWriter

java.lang.Object
java.io.Writer
jmri.util.davidflanagan.HardcopyWriter
jmri.util.davidflanagan.CompatibleHardcopyWriter
All Implemented Interfaces:
Printable, Closeable, Flushable, Appendable, AutoCloseable

  • Constructor Details

  • Method Details

    • getCurrentLineNumber

      public int getCurrentLineNumber()
      Get the current line number -- this is nasty since it makes the implicit assumption that the line height is constant over the whole page. Further, things like images can throw this off.

      We may want to adjust the current v_pos to align it with an integer line number (when this is called).

      Returns:
      the current line number
    • getLinesPerPage

      public int getLinesPerPage()
      Get the number of lines per page. Again, this assumes that the line height is constant over the whole page.
      Returns:
      the number of lines per page
    • write

      public void write(int startLine, int startColumn, int endLine, int endColumn)
      This draws a line from the start position to the end position (in characters/lines). This has the same sort of issues as getCurrentLineNumber(). We may want to tweak this to behave differently.
      Parameters:
      startLine - The starting line number
      startColumn - The starting column number
      endLine - The ending line number
      endColumn - The ending column number
    • setFontStyle

      public void setFontStyle(int style)
      Set the font style
      Parameters:
      style - The font style
    • setFontName

      public void setFontName(String name)
      Set the font name
      Parameters:
      name - The font name