public abstract class AbstractPreviewModel extends Object implements PreviewModel, GridAwareModel
| Modifier and Type | Field and Description |
|---|---|
protected GridModel[] |
grids |
protected List<List<Integer>> |
gridsSlotsIDs |
protected boolean |
pagesStartLeft |
protected List<PreviewPage> |
previewPages
model of PreviewPages and UIplacements = current state of previewPages and their placements
|
protected boolean |
sameGridsSizes
indicates if all grids have the same quantity of slots - it speeds up computations
|
protected int |
totalQaOfPreviewPages
Total quantity of preview pages generated by this preview model for given page model
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractPreviewModel(TypedObject typedPage) |
| Modifier and Type | Method and Description |
|---|---|
protected List<PreviewElementUpdate> |
addEmptyPage()
Adds empty previewPage(s) to view if it's necessary e.g.
|
void |
addPreviewModelListener(PreviewModelListener listener) |
protected GridPreviewPage |
createNewPage(int pageIndex) |
TypeService |
getCockpitTypeService() |
List<PreviewPage[]> |
getDoublePages() |
protected int |
getGridsCapacity() |
protected SpreadPosition |
getGridType(int pageIndex) |
SpreadPosition |
getGridType(PlacementModel placement) |
LayoutService |
getLayoutService() |
ModelHelper |
getModelHelper() |
ModelService |
getModelService() |
protected int[] |
getNextPageAndSlotId(int pageIndex,
int slotIndex) |
protected PlacementModel |
getNextPlacement(PreviewSlot slot,
Collection<Object> placementsToSkip) |
protected int |
getNextPlacementIndex(PreviewSlot slot,
Collection<Object> placementsToSkip) |
protected PreviewSlot |
getNextSlot(PreviewSlot slot,
boolean createNewSlots) |
protected int[] |
getPageDimensions(int pageIndex) |
PageFormatModel |
getPageFormat()
Returns the publication page format.
|
PageModel |
getPageModel() |
List<PreviewPage> |
getPreviewPages() |
PrintcockpitService |
getPrintcockpitService() |
PublicationService |
getPublicationService() |
int |
getSlotsCapacity() |
protected int |
getSlotsQuantity(int pageIndex) |
TypedObject |
getTypedPage() |
boolean |
hasUnequalGrids() |
void |
initModel()
Initializes the model with data from Model/typedObjects layer
|
protected abstract List<PreviewElementUpdate> |
initPreviewPagesModel()
creates previewPages with order determined by positionModel implementation (fixed/dynamic/etc) and fills it with placements
(again according to positionModel implementation).
|
boolean |
isFixed() |
boolean |
isModelInvalid(PageModel page) |
boolean |
isPagesStartLeft() |
boolean |
isPagesStartsLeft() |
boolean |
isShowDoublePages() |
void |
notifyListeners(List<PreviewElementUpdate> changes)
Sends given list of changes to every interested listener (e.g.
|
void |
removeLastEmptyPage()
Removes last empty page
|
void |
removePreviewModelListener(PreviewModelListener listener) |
protected void |
save(PlacementModel placement,
int position)
Saves given placement in current pageModel at given position, if current pageModel contains this placement, it's moved from
it's old position to new position
|
void |
setCockpitTypeService(TypeService typeService) |
void |
setDefaultTemplate(PageModel pageModel,
ItemPlacementModel placement)
Sets default layout template (placeholder group) in given placement.
|
void |
setLayoutService(LayoutService layoutService) |
void |
setModelHelper(ModelHelper modelHelper) |
void |
setModelService(ModelService modelService) |
protected void |
setNotification(Notification notification) |
void |
setPrintcockpitService(PrintcockpitService printcockpitService) |
void |
setPublicationService(PublicationService publicationService) |
void |
setShowDoublePages(boolean show) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddNewEmptyPreviewPage, addPlacements, addPlacements, copyPlacements, copyPlacements, copyPreviewPages, deletePlacements, deletePreviewPages, getPreviewPagesTotalQuantity, movePlacements, movePlacements, movePreviewPagesprotected GridModel[] grids
protected boolean pagesStartLeft
protected boolean sameGridsSizes
protected final List<PreviewPage> previewPages
protected int totalQaOfPreviewPages
protected AbstractPreviewModel(TypedObject typedPage)
public final void initModel()
PreviewModelinitModel in interface PreviewModelprotected int getGridsCapacity()
protected List<PreviewElementUpdate> addEmptyPage()
public boolean isModelInvalid(PageModel page)
protected abstract List<PreviewElementUpdate> initPreviewPagesModel()
protected GridPreviewPage createNewPage(int pageIndex)
protected int getSlotsQuantity(int pageIndex)
public PageModel getPageModel()
public SpreadPosition getGridType(PlacementModel placement)
getGridType in interface GridAwareModelprotected SpreadPosition getGridType(int pageIndex)
public List<PreviewPage> getPreviewPages()
getPreviewPages in interface PreviewModelpublic void addPreviewModelListener(PreviewModelListener listener)
addPreviewModelListener in interface PreviewModelpublic void removePreviewModelListener(PreviewModelListener listener)
removePreviewModelListener in interface PreviewModelpublic void notifyListeners(List<PreviewElementUpdate> changes)
PreviewModelnotifyListeners in interface PreviewModelpublic boolean hasUnequalGrids()
public boolean isFixed()
public int getSlotsCapacity()
getSlotsCapacity in interface PreviewModelpublic boolean isShowDoublePages()
isShowDoublePages in interface PreviewModelpublic void setShowDoublePages(boolean show)
setShowDoublePages in interface PreviewModelpublic PageFormatModel getPageFormat()
public List<PreviewPage[]> getDoublePages()
getDoublePages in interface PreviewModelpublic boolean isPagesStartLeft()
protected int[] getNextPageAndSlotId(int pageIndex,
int slotIndex)
pageIndex - slotIndex - public PublicationService getPublicationService()
public void setPublicationService(PublicationService publicationService)
public void setDefaultTemplate(PageModel pageModel, ItemPlacementModel placement)
PreviewModelsetDefaultTemplate in interface PreviewModelprotected int getNextPlacementIndex(PreviewSlot slot, Collection<Object> placementsToSkip)
protected PlacementModel getNextPlacement(PreviewSlot slot, Collection<Object> placementsToSkip)
slot - placementsToSkip - protected PreviewSlot getNextSlot(PreviewSlot slot, boolean createNewSlots)
slot - createNewSlots - - if true new pages/slots will be created (if necessary)protected void save(PlacementModel placement, int position)
placement - position - public TypedObject getTypedPage()
getTypedPage in interface PreviewModelprotected int[] getPageDimensions(int pageIndex)
public boolean isPagesStartsLeft()
isPagesStartsLeft in interface PreviewModelpublic TypeService getCockpitTypeService()
public void setCockpitTypeService(TypeService typeService)
typeService - the typeService to setpublic ModelService getModelService()
public void setModelService(ModelService modelService)
modelService - the modelService to setpublic PrintcockpitService getPrintcockpitService()
public void setPrintcockpitService(PrintcockpitService printcockpitService)
printcockpitService - the printcockpitService to setpublic LayoutService getLayoutService()
public void setLayoutService(LayoutService layoutService)
layoutService - the layoutService to setpublic void removeLastEmptyPage()
PreviewModelremoveLastEmptyPage in interface PreviewModelpublic ModelHelper getModelHelper()
public void setModelHelper(ModelHelper modelHelper)
modelHelper - the modelHelper to setprotected void setNotification(Notification notification)
Copyright © 2017 SAP SE. All Rights Reserved.