com.levigo.jadice.document
Class PageSegmentEvent

java.lang.Object
  extended by com.levigo.jadice.document.AbstractDocumentEvent
      extended by com.levigo.jadice.document.AbstractPageEvent
          extended by 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
static class PageSegmentEvent.Type
          The type is used to describe page segment (modify) events more in detail.
 
Constructor Summary
PageSegmentEvent(Document document, Page page, PageSegment segment, DocumentLayer layer)
          Constructor
PageSegmentEvent(Document document, Page page, PageSegment segment, DocumentLayer layer, PageSegmentEvent.Type type)
          Constructor
PageSegmentEvent(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
 PageSegmentEvent clone()
           
 Rectangle2D getDamage()
          Returns the damage region for this event.
 Document getDocument()
          Returns a reference of the document container which holds the page and the event concerning page segment or null if not available at the creation time of this event.
 DocumentLayer getLayer()
          Returns the document layer in which the changed page segment resides if available otherwise null
 PageSegment getPageSegment()
          Returns the changed page segment
 PageSegmentEvent.Type getType()
          Returns the type of this event
 void setDamage(Rectangle2D damage)
          Sets a damage area for this event.
 void setLayer(DocumentLayer layer)
          Sets the document layer in which the changed page segment resides.
protected  void setPageSegment(PageSegment pageSegment)
          Sets the changed page segment
 void setType(PageSegmentEvent.Type type)
           
 
Methods inherited from class com.levigo.jadice.document.AbstractPageEvent
getPage, setPage
 
Methods inherited from class com.levigo.jadice.document.AbstractDocumentEvent
setDocument
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageSegmentEvent

public PageSegmentEvent(Document document,
                        Page page,
                        PageSegment segment,
                        DocumentLayer layer)
Constructor

Creates a page segment event

Parameters:
document - the concerned document if available, otherwise null
page - which causes the the page segment change
segment - the concerned page segment
layer - the document layer in which the page segment resides if available otherwise null

PageSegmentEvent

public PageSegmentEvent(Document document,
                        Page page,
                        PageSegment segment,
                        DocumentLayer layer,
                        PageSegmentEvent.Type type)
Constructor

Creates a page segment event

Parameters:
document - the concerned document if available, otherwise null
page - which causes the the page segment change
segment - the concerned page segment
layer - the document layer in which the page segment resides if available otherwise null
type - The type of this page segment event
See Also:
PageSegmentEvent.Type.CONTENT, PageSegmentEvent.Type.SIZE

PageSegmentEvent

public PageSegmentEvent(Page page,
                        PageSegment segment,
                        DocumentLayer layer)
Constructor

Creates a page segment event

Parameters:
page - which causes the the page segment change
segment - the concerned page segment
layer - the document layer in which the page segment resides if available otherwise null

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 reference
event - 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

Parameters:
pageSegment -

getLayer

public DocumentLayer getLayer()
Returns the document layer in which the changed page segment resides if available otherwise null

Returns:
the relevant document layer or null

setLayer

public void setLayer(DocumentLayer layer)
Sets the document layer in which the changed page segment resides.

Parameters:
layer -

getDocument

public Document getDocument()
Returns a reference of the document container which holds the page and the event concerning page segment or null if not available at the creation time of this event.

Overrides:
getDocument in class AbstractPageEvent
Returns:
the document the document container or null if 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 is null

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()
Overrides:
clone in class Object


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.