public class ResultModel
extends java.lang.Object
implements java.io.Serializable, java.io.Closeable
ResultModelData
where the persistable data
of the comparison result are stored. It is that instance can be used to serialize the result and save it across
sessions. ResultModelData
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
ResultModel.ChangeInfo
Event object with a page range for both documents where the differences data has changed
|
static interface |
ResultModel.ResultModelChangeListener
Defines a listener for the result model
|
static class |
ResultModel.STATE_CHANGE_TYPE
Defines the type of model change in an update event
|
Constructor and Description |
---|
ResultModel()
Creates the instance and sets all
DiffGroup.GroupType s to visible. |
ResultModel(com.inet.pdfc.results.ResultModelData data)
Creates the instance, sets all
DiffGroup.GroupType s to visible and sets the data. |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ResultModel.ResultModelChangeListener l)
Adds a
ResultModelChangeListener to this model. |
void |
clear()
Completely clears the model including the page images.
|
void |
close()
Clears all in memory and cached data of this
ResultModel . |
InfoData |
getComparisonParameters()
Returns the static data for the current comparison.
|
java.util.List<DiffGroup> |
getDifferences(boolean filtered)
Returns either all or only the visible differences in this mode, depending on the
DiffGroup.GroupType visibility settings. |
int |
getDifferences(Modification.ModificationType type,
boolean filtered)
Count all differences with the specified modification type.
|
int |
getDifferencesCount(boolean filtered)
Returns the number of differences held by this model.
|
HighlightData |
getHighlightData(java.lang.String key)
Return the highlight overlay data for a certain filter or type.
|
java.util.List<HighlightData.Highlight> |
getHighlightsForPage(int pageNr,
boolean firstDocument)
Returns the highlights for a page.
|
ResultPage |
getPage(int pageIndex,
boolean first)
Returns a page info object for a certain page.
|
ResultPage |
getPageAt(java.awt.Point pos,
boolean left)
Returns the page at the specified location or null if there is no page at the specified location.
|
int |
getPageCount(boolean first)
Returns the number of pages CURRENTLY AVAILABLE for one of the documents.
|
com.inet.pdfc.generator.rendercache.PageImageCache |
getPageImageCache()
Returns the page image cache.
|
Settings |
getSettings()
Returns a copy of the current settings.
|
boolean |
isEmpty()
Returns whether the list of page info objects is empty
|
boolean |
isTypeVisible(DiffGroup.GroupType t)
Deprecated.
As of i-net PDFC 4.1, use
isVisible(VisibilitySetting) instead |
boolean |
isVisible(VisibilitySetting setting)
Returns whether differences of a certain
VisibilitySetting is shown / used in the presentation of this result
model. |
void |
removeChangeListener(ResultModel.ResultModelChangeListener l)
Removes a
ResultModelChangeListener from this model. |
void |
setHighlightVisibile(java.lang.String key,
boolean visible)
Deprecated.
As of i-net PDFC 4.3, use
setSetting(Settings) instead |
void |
setSetting(Settings settings)
Set setting for this model.
|
void |
setTypeVisible(DiffGroup.GroupType t,
boolean visible)
Deprecated.
As of i-net PDFC 4.1, use
setSetting(Settings) instead |
void |
setVisible(boolean isVisible,
VisibilitySetting... visibles)
Deprecated.
As of i-net PDFC 4.3, use
setSetting(Settings) instead |
public ResultModel()
DiffGroup.GroupType
s to visible.public ResultModel(com.inet.pdfc.results.ResultModelData data)
DiffGroup.GroupType
s to visible and sets the data.data
- the data for this result modelpublic void addChangeListener(ResultModel.ResultModelChangeListener l)
ResultModelChangeListener
to this model. This listener will be notified whenever the model is
cleared, new differences are added, the comparison has finished or the filter has changed.l
- the ResultModelChangeListener
to add (not null)removeChangeListener(com.inet.pdfc.results.ResultModel.ResultModelChangeListener)
public void clear()
ResultModel.STATE_CHANGE_TYPE.CLEARED
public void close()
ResultModel
.ResultModel
the instance will just be empty when this call returns.public InfoData getComparisonParameters()
public java.util.List<DiffGroup> getDifferences(boolean filtered)
DiffGroup.GroupType
visibility settings.filtered
- if true
, only the type which are visible will be returned, if false
all
differences known to this model will be returned.null
but may be emptypublic int getDifferences(Modification.ModificationType type, boolean filtered)
type
- the modification type that should be countedfiltered
- if true
, only the types which are visible will be returned, if false
all
differences known to this model will be returned.Modification.ModificationType
public int getDifferencesCount(boolean filtered)
DiffGroup
s in the model. E.G. a DiffGroup
of type DiffGroup.GroupType.AddedOrRemoved
contains an
add and a remove modification, this will be counted as two differences here.filtered
- if true
, only the type which are visible as by isVisible(VisibilitySetting)
will be counted, if false
all differences known to this model will be counted.public HighlightData getHighlightData(java.lang.String key)
key
- type to get the Highlight data fornull
, if there is no such filter currently activepublic java.util.List<HighlightData.Highlight> getHighlightsForPage(int pageNr, boolean firstDocument)
pageNr
- the zero-based page numberfirstDocument
- true if the first document is references, false for the second onenull
or emptypublic int getPageCount(boolean first)
first
- true
if the first document is references, false
for the second onepublic ResultPage getPage(int pageIndex, boolean first)
DiffGroup
s may span several pages. If you'd like to get all
differences for a page, please use getDifferences(boolean)
and filter all differences with a y-location
inside the bounds of a page.pageIndex
- the zero-based index of the pagefirst
- true
to get a page of the first document, false
to get a page for the
second documentnull
if the index below zero or larger than getPageCount(boolean)
public ResultPage getPageAt(java.awt.Point pos, boolean left)
pos
- the locationleft
- flag indicating the left side documentpublic com.inet.pdfc.generator.rendercache.PageImageCache getPageImageCache()
public boolean isEmpty()
@Deprecated public boolean isTypeVisible(DiffGroup.GroupType t)
isVisible(VisibilitySetting)
insteadDiffGroup.GroupType
is shown / used in the presentation of this result
model.t
- the type to check forpublic boolean isVisible(VisibilitySetting setting)
VisibilitySetting
is shown / used in the presentation of this result
model.setting
- the type to check forpublic void removeChangeListener(ResultModel.ResultModelChangeListener l)
ResultModelChangeListener
from this model.l
- the ResultModelChangeListener
to remove (not null)addChangeListener(com.inet.pdfc.results.ResultModel.ResultModelChangeListener)
@Deprecated public void setHighlightVisibile(java.lang.String key, boolean visible)
setSetting(Settings)
insteadResultPage.getHighlights()
to be filtered according to this setting.key
- the key of the filter to plugin to show the highlights forvisible
- true
for visible, false
to hide@Deprecated public void setTypeVisible(DiffGroup.GroupType t, boolean visible)
setSetting(Settings)
insteadt
- the type to setvisible
- true for visiblepublic void setSetting(Settings settings)
settings
- the new setting@Deprecated public void setVisible(boolean isVisible, VisibilitySetting... visibles)
setSetting(Settings)
insteadisVisible
- true for visiblevisibles
- the type to setpublic Settings getSettings()
setSetting(Settings)
afterwards.Copyright © 2010-2022 by i-net software GmbH