public class PaperCatalog extends Object implements PaperCatalogService
| Constructor and Description |
|---|
PaperCatalog()
Creates a new empty instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFactory(PaperProvider factory)
Adds a factory (intended for use by the OSGi framework)
|
boolean |
addNewRollPaper(String name,
String desc,
Length across)
Adds a new roll paper to the collection.
|
boolean |
addNewSheetPaper(String name,
String desc,
Length width,
Length height)
Adds a new sheet paper to the collection.
|
boolean |
addNewTractorPaper(String name,
String desc,
Length across,
Length along)
Adds a new tractor paper to the collection.
|
Paper |
get(String identifier)
Gets a paper by identifier.
|
boolean |
isRemovable(Paper paper)
Returns true if the paper can be removed, false otherwise
|
Collection<Paper> |
list()
Lists all available papers.
|
Collection<Paper> |
list(PaperFilter filter)
Lists available papers that the filter accepts.
|
static PaperCatalog |
newInstance()
Creates a new PaperCatalog and populates it using the SPI
(java service provider interface).
|
boolean |
remove(Paper p)
Removes the specified paper from the collection.
|
void |
removeFactory(PaperProvider factory)
Removes a factory (intended for use by the OSGi framework)
|
boolean |
supportsUserPapers()
Returns true if user papers are supported, false otherwise.
|
public PaperCatalog()
public static PaperCatalog newInstance()
Creates a new PaperCatalog and populates it using the SPI (java service provider interface).
In an OSGi context, an instance should be retrieved using the service registry. It will be registered under the PaperCatalogService interface.
public void addFactory(PaperProvider factory)
factory - the factory to addpublic void removeFactory(PaperProvider factory)
factory - the factory to removepublic Paper get(String identifier)
PaperCatalogServiceget in interface PaperCatalogServiceidentifier - the identifier of the paperpublic Collection<Paper> list()
PaperCatalogServicelist in interface PaperCatalogServicepublic Collection<Paper> list(PaperFilter filter)
PaperCatalogServicelist in interface PaperCatalogServicefilter - the filterpublic boolean supportsUserPapers()
PaperCatalogServicePaperCatalogService.addNewSheetPaper(String, String, Length, Length),
PaperCatalogService.addNewRollPaper(String, String, Length),
PaperCatalogService.addNewTractorPaper(String, String, Length, Length),
PaperCatalogService.isRemovable(Paper),
PaperCatalogService.remove(Paper)
should not be used.supportsUserPapers in interface PaperCatalogServicepublic boolean addNewSheetPaper(String name, String desc, Length width, Length height)
PaperCatalogServiceaddNewSheetPaper in interface PaperCatalogServicename - the namedesc - the descriptionwidth - the widthheight - the heightpublic boolean addNewTractorPaper(String name, String desc, Length across, Length along)
PaperCatalogServiceaddNewTractorPaper in interface PaperCatalogServicename - the namedesc - the descriptionacross - the length across the feedalong - the length along the feedpublic boolean addNewRollPaper(String name, String desc, Length across)
PaperCatalogServiceaddNewRollPaper in interface PaperCatalogServicename - the namedesc - the descriptionacross - the length across the feedpublic boolean isRemovable(Paper paper)
PaperCatalogServiceisRemovable in interface PaperCatalogServicepaper - the paperpublic boolean remove(Paper p)
PaperCatalogServiceremove in interface PaperCatalogServicep - the paper to remove