Class PageSegmentEvent

Direct Known Subclasses:
AnnotationPageSegmentEvent, AnnotationPageSegmentEvent

public class PageSegmentEvent extends AbstractPageEvent
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
  • Constructor Details

    • 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

      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 Details

    • 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:
    • 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