Package com.levigo.jadice.document
Class PageSegmentEvent
- java.lang.Object
-
- com.levigo.jadice.document.AbstractDocumentEvent
-
- com.levigo.jadice.document.AbstractPageEvent
-
- com.levigo.jadice.document.PageSegmentEvent
-
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
AnnotationPageSegmentEvent
public class PageSegmentEvent extends AbstractPageEvent implements Cloneable
An event of this type will indicate the addition, the removal or the modification of page segments within a page.- Since:
- 4.3
- See Also:
Page,AbstractPageSegment
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPageSegmentEvent.TypeThe type is used to describe page segment (modify) events more in detail.
-
Constructor Summary
Constructors Constructor Description PageSegmentEvent(Document document, Page page, PageSegment segment, DocumentLayer layer)ConstructorPageSegmentEvent(Document document, Page page, PageSegment segment, DocumentLayer layer, PageSegmentEvent.Type type)ConstructorPageSegmentEvent(Document document, PageSegmentEvent event)Clones a page segment event but changing the associated document reference.PageSegmentEvent(Page page, PageSegment segment, DocumentLayer layer)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PageSegmentEventclone()Rectangle2DgetDamage()Returns the damage region for this event.DocumentgetDocument()Returns a reference of the document container which holds the page and the event concerning page segment ornullif not available at the creation time of this event.DocumentLayergetLayer()Returns the document layer in which the changed page segment resides if available otherwisenullPageSegmentgetPageSegment()Returns the changed page segmentPageSegmentEvent.TypegetType()Returns the type of this eventvoidsetDamage(Rectangle2D damage)Sets a damage area for this event.voidsetLayer(DocumentLayer layer)Sets the document layer in which the changed page segment resides.protected voidsetPageSegment(PageSegment pageSegment)Sets the changed page segmentvoidsetType(PageSegmentEvent.Type type)-
Methods inherited from class com.levigo.jadice.document.AbstractPageEvent
getPage, setPage
-
Methods inherited from class com.levigo.jadice.document.AbstractDocumentEvent
setDocument
-
-
-
-
Constructor Detail
-
PageSegmentEvent
public PageSegmentEvent(Document document, Page page, PageSegment segment, DocumentLayer layer)
ConstructorCreates a page segment event
- Parameters:
document- the concerned document if available, otherwisenullpage- which causes the the page segment changesegment- the concerned page segmentlayer- the document layer in which the page segment resides if available otherwisenull
-
PageSegmentEvent
public PageSegmentEvent(Document document, Page page, PageSegment segment, DocumentLayer layer, PageSegmentEvent.Type type)
ConstructorCreates a page segment event
- Parameters:
document- the concerned document if available, otherwisenullpage- which causes the the page segment changesegment- the concerned page segmentlayer- the document layer in which the page segment resides if available otherwisenulltype- The type of this page segment event- See Also:
PageSegmentEvent.Type.CONTENT,PageSegmentEvent.Type.SIZE
-
PageSegmentEvent
public PageSegmentEvent(Page page, PageSegment segment, DocumentLayer layer)
ConstructorCreates a page segment event
- Parameters:
page- which causes the the page segment changesegment- the concerned page segmentlayer- the document layer in which the page segment resides if available otherwisenull
-
PageSegmentEvent
public PageSegmentEvent(Document document, PageSegmentEvent event)
Clones a page segment event but changing the associated document reference. For future use and for a correct propagation of page segment events for multi document pages.- Parameters:
document- the new document referenceevent- the event to be cloned
-
-
Method Detail
-
getPageSegment
public PageSegment getPageSegment()
Returns the changed page segment- Returns:
- page segment
-
setPageSegment
protected void setPageSegment(PageSegment pageSegment)
Sets the changed page segment
-
getLayer
public DocumentLayer getLayer()
Returns the document layer in which the changed page segment resides if available otherwisenull- Returns:
- the relevant document layer or
null
-
setLayer
public void setLayer(DocumentLayer layer)
Sets the document layer in which the changed page segment resides.
-
getDocument
public Document getDocument()
Returns a reference of the document container which holds the page and the event concerning page segment ornullif not available at the creation time of this event.- Overrides:
getDocumentin classAbstractPageEvent- Returns:
- the document the document container or
nullif not known at the creation time of this event. - See Also:
AbstractDocumentEvent.getDocument()
-
setDamage
public void setDamage(Rectangle2D damage)
Sets a damage area for this event.Use this method if the origin of this event causes a dirty area, which means a damage region within the pagesegment area, which should be updated.
- Parameters:
damage- the a damage region within the pagesegment area to be updated. The damage should be given in document base units.- Throws:
NullPointerException- if damage isnull
-
getDamage
public Rectangle2D getDamage()
Returns the damage region for this event.- Returns:
- the damage in document base units.
- See Also:
setDamage(Rectangle2D)
-
getType
public PageSegmentEvent.Type getType()
Returns the type of this event- Returns:
- the type
-
setType
public void setType(PageSegmentEvent.Type type)
- Parameters:
type- the type to set
-
clone
public PageSegmentEvent clone()
-
-