sun.swing.text.TextComponentPrintable Java Examples

The following examples show how to use sun.swing.text.TextComponentPrintable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JTextComponent.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #2
Source File: JTextComponent.java    From jdk8u-dev-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #3
Source File: JTextComponent.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #4
Source File: JTextComponent.java    From jdk8u_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #5
Source File: JTextComponent.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #6
Source File: JTextComponent.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #7
Source File: JTextComponent.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #8
Source File: JTextComponent.java    From Java8CN with Apache License 2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #9
Source File: JTextComponent.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #10
Source File: JTextComponent.java    From jdk1.8-source-analysis with Apache License 2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #11
Source File: JTextComponent.java    From Bytecoder with Apache License 2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #12
Source File: JTextComponent.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #13
Source File: JTextComponent.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #14
Source File: JTextComponent.java    From JDKSourceCode1.8 with MIT License 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #15
Source File: JTextComponent.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #16
Source File: JTextComponent.java    From TencentKona-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}
 
Example #17
Source File: JTextComponent.java    From dragonwell8_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a {@code Printable} to use for printing the content of this
 * {@code JTextComponent}. The returned {@code Printable} prints
 * the document as it looks on the screen except being reformatted
 * to fit the paper.
 * The returned {@code Printable} can be wrapped inside another
 * {@code Printable} in order to create complex reports and
 * documents.
 *
 *
 * <p>
 * The returned {@code Printable} shares the {@code document} with this
 * {@code JTextComponent}. It is the responsibility of the developer to
 * ensure that the {@code document} is not mutated while this {@code Printable}
 * is used. Printing behavior is undefined when the {@code document} is
 * mutated during printing.
 *
 * <p>
 * Page header and footer text can be added to the output by providing
 * {@code MessageFormat} arguments. The printing code requests
 * {@code Strings} from the formats, providing a single item which may be
 * included in the formatted string: an {@code Integer} representing the
 * current page number.
 *
 * <p>
 * The returned {@code Printable} when printed, formats the
 * document content appropriately for the page size. For correct
 * line wrapping the {@code imageable width} of all pages must be the
 * same. See {@link java.awt.print.PageFormat#getImageableWidth}.
 *
 * <p>
 * This method is thread-safe, although most Swing methods are not. Please
 * see <A
 * HREF="https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html">
 * Concurrency in Swing</A> for more information.
 *
 * <p>
 * The returned {@code Printable} can be printed on any thread.
 *
 * <p>
 * This implementation returned {@code Printable} performs all painting on
 * the <i>Event Dispatch Thread</i>, regardless of what thread it is
 * used on.
 *
 * @param headerFormat the text, in {@code MessageFormat}, to be
 *        used as the header, or {@code null} for no header
 * @param footerFormat the text, in {@code MessageFormat}, to be
 *        used as the footer, or {@code null} for no footer
 * @return a {@code Printable} for use in printing content of this
 *         {@code JTextComponent}
 *
 *
 * @see java.awt.print.Printable
 * @see java.awt.print.PageFormat
 * @see javax.swing.text.Document#render(java.lang.Runnable)
 *
 * @since 1.6
 */
public Printable getPrintable(final MessageFormat headerFormat,
                              final MessageFormat footerFormat) {
    return TextComponentPrintable.getPrintable(
               this, headerFormat, footerFormat);
}