Class ExtendedPrintable.Wrapper
- java.lang.Object
-
- com.biomatters.geneious.publicapi.plugin.ExtendedPrintable
-
- com.biomatters.geneious.publicapi.plugin.ExtendedPrintable.Wrapper
-
- Enclosing class:
- ExtendedPrintable
public abstract static class ExtendedPrintable.Wrapper extends ExtendedPrintable
Wrapper that delegates all methods to the source ExtendedPrintable. Override the methods you want to.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.biomatters.geneious.publicapi.plugin.ExtendedPrintable
ExtendedPrintable.Factory, ExtendedPrintable.Wrapper
-
-
Field Summary
-
Fields inherited from class com.biomatters.geneious.publicapi.plugin.ExtendedPrintable
IS_HIGH_RESOLUTION_GRAPHICS_OPTION_NAME, IS_PREVIEW_OPTION_NAME, SUPPORTS_GRADIENT_PAINTING_OPTION_NAME
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Wrapper(ExtendedPrintable source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDefaultHeight(int width, Options options)
If this component does not have a required height (i.e.int
getDefaultWidth(Options options)
If this component does not have a required width (i.e.java.lang.String
getDocumentName()
Returns the name of the document that we are printing (if applicable)int
getMaximumHeight(int width, Options options)
Get the maximum height (inclusive) of the component when saved as an image.int
getMaximumWidth(Options options)
Get the maximum width (inclusive) of the component when saved as an image.int
getMinimumHeight(int width, Options options)
Get the minimum height (inclusive) of the component when saved as an image.int
getMinimumWidth(Options options)
Get the minimum width (inclusive) of the component when saved as an image.Options
getOptions(boolean isSavingToFile)
Optionally provide additional printing and/or saving image to file options.int
getPagesRequired(java.awt.Dimension dimensions, Options options)
int
getRequiredHeight(int width, Options options)
int
getRequiredWidth(Options options)
int
print(java.awt.Graphics2D graphics, java.awt.Dimension dimensions, int pageIndex, Options options)
print a single page of this component.
-
-
-
Constructor Detail
-
Wrapper
protected Wrapper(ExtendedPrintable source)
-
-
Method Detail
-
getOptions
public Options getOptions(boolean isSavingToFile)
Description copied from class:ExtendedPrintable
Optionally provide additional printing and/or saving image to file options.- Overrides:
getOptions
in classExtendedPrintable
- Parameters:
isSavingToFile
- true when saving to a file, false when printing- Returns:
- a panel of options specific to this printable component or null if it has no options. The default implementation returns null.
-
getDocumentName
public java.lang.String getDocumentName()
Description copied from class:ExtendedPrintable
Returns the name of the document that we are printing (if applicable)- Overrides:
getDocumentName
in classExtendedPrintable
- Returns:
- the name of the document we're printing, or null if there isn't one
-
print
public int print(java.awt.Graphics2D graphics, java.awt.Dimension dimensions, int pageIndex, Options options) throws java.awt.print.PrinterException
Description copied from class:ExtendedPrintable
print a single page of this component.- Specified by:
print
in classExtendedPrintable
- Parameters:
graphics
- the graphics to render to.dimensions
- the dimensions of the page to be printed to.pageIndex
- index of the page to be printed or saved as an image.options
- an options panel returned byExtendedPrintable.getOptions(boolean)
- Returns:
Printable.PAGE_EXISTS
orPrintable.NO_SUCH_PAGE
- Throws:
java.awt.print.PrinterException
- the printerexception
-
getRequiredWidth
public int getRequiredWidth(Options options)
- Overrides:
getRequiredWidth
in classExtendedPrintable
- Parameters:
options
- an options panel returned byExtendedPrintable.getOptions(boolean)
- Returns:
- a required width for this component when saved as an image. May return 0 to let the user choose the width.
-
getDefaultWidth
public int getDefaultWidth(Options options)
Description copied from class:ExtendedPrintable
If this component does not have a required width (i.e.ExtendedPrintable.getRequiredWidth(Options)
returned 0)), then this returns the default width for the component, which the user may adjust.- Overrides:
getDefaultWidth
in classExtendedPrintable
- Parameters:
options
- an options panel returned byExtendedPrintable.getOptions(boolean)
- Returns:
- a default width for this component when saved as an image.
- See Also:
ExtendedPrintable.getMinimumWidth(Options)
,ExtendedPrintable.getMinimumWidth(Options)
,ExtendedPrintable.getDefaultHeight(int, Options)
-
getMaximumWidth
public int getMaximumWidth(Options options)
Description copied from class:ExtendedPrintable
Get the maximum width (inclusive) of the component when saved as an image.- Overrides:
getMaximumWidth
in classExtendedPrintable
- Parameters:
options
- an options panel returned byExtendedPrintable.getOptions(boolean)
- Returns:
- the maximum width (inclusive) of the component when saved as an image.
-
getMinimumWidth
public int getMinimumWidth(Options options)
Description copied from class:ExtendedPrintable
Get the minimum width (inclusive) of the component when saved as an image.- Overrides:
getMinimumWidth
in classExtendedPrintable
- Parameters:
options
- an options panel returned byExtendedPrintable.getOptions(boolean)
- Returns:
- the minimum width (inclusive) of the component when saved as an image.
-
getRequiredHeight
public int getRequiredHeight(int width, Options options)
- Overrides:
getRequiredHeight
in classExtendedPrintable
- Parameters:
width
- a width chosen either by the user or returned fromExtendedPrintable.getRequiredWidth(Options)
options
- an options panel returned byExtendedPrintable.getOptions(boolean)
- Returns:
- a required height for this component when saved as an image using the given width. May return 0 to let the user choose the height.
-
getDefaultHeight
public int getDefaultHeight(int width, Options options)
Description copied from class:ExtendedPrintable
If this component does not have a required height (i.e.ExtendedPrintable.getRequiredHeight(int, Options)
returned 0), then this returns the default height for the component, which the user may adjust.- Overrides:
getDefaultHeight
in classExtendedPrintable
- Parameters:
width
- a width chosen either by the user or returned fromExtendedPrintable.getDefaultWidth(Options)
options
- an options panel returned byExtendedPrintable.getOptions(boolean)
- Returns:
- a default height for this component when saved as an image using the given width.
- See Also:
ExtendedPrintable.getMinimumHeight(int, Options)
,ExtendedPrintable.getMaximumHeight(int, Options)
,ExtendedPrintable.getDefaultWidth(Options)
-
getMaximumHeight
public int getMaximumHeight(int width, Options options)
Description copied from class:ExtendedPrintable
Get the maximum height (inclusive) of the component when saved as an image.- Overrides:
getMaximumHeight
in classExtendedPrintable
- Parameters:
width
- a width chosen either by the user or returned fromExtendedPrintable.getDefaultWidth(Options)
options
- an options panel returned byExtendedPrintable.getOptions(boolean)
- Returns:
- the maximum height (inclusive) of the component when saved as an image.
-
getMinimumHeight
public int getMinimumHeight(int width, Options options)
Description copied from class:ExtendedPrintable
Get the minimum height (inclusive) of the component when saved as an image.- Overrides:
getMinimumHeight
in classExtendedPrintable
- Parameters:
width
- a width chosen either by the user or returned fromExtendedPrintable.getDefaultWidth(Options)
options
- an options panel returned byExtendedPrintable.getOptions(boolean)
- Returns:
- the minimum height (inclusive) of the component when saved as an image.
-
getPagesRequired
public int getPagesRequired(java.awt.Dimension dimensions, Options options)
- Specified by:
getPagesRequired
in classExtendedPrintable
- Parameters:
dimensions
- the dimensionsoptions
- an options panel returned byExtendedPrintable.getOptions(boolean)
- Returns:
- the number of pages required to print this document with the specified dimensions and options
-
-