Class LFileModel
java.lang.Object
com.io7m.laurel.filemodel.internal.LFileModel
- All Implemented Interfaces:
LFileModelType,AutoCloseable
The file model.
-
Method Summary
Modifier and TypeMethodDescriptioncaptionAdd(LCaptionName text) Add a caption.com.io7m.jattribute.core.AttributeReadableType<Set<LCaptionID>> captionModify(LCaptionID id, LCaptionName name) Modify a caption.captionRemove(Set<LCaptionID> captions) Delete captions.voidcaptionsCopy(Set<LCaptionID> captions) Move a set of captions to the clipboard.captionsPaste(Set<LImageID> images) Assign the captions in the clipboard to each of the given images, and then clear the clipboard.voidSet the filter for the caption list.categoryAdd(LCategoryName text) Add a category.com.io7m.jattribute.core.AttributeReadableType<SortedMap<LCategoryID, List<LCaption>>> categoryCaptionsAssign(List<LCategoryCaptionsAssignment> categories) Assign the given captions to the given categories.categoryCaptionsUnassign(List<LCategoryCaptionsAssignment> categories) Unassign the given captions from the given categories.Select a category.categorySetNotRequired(Set<LCategoryID> categories) Set categories as not required.categorySetRequired(Set<LCategoryID> categories) Set categories as required.voidclose()compact()Compact the file, deleting the undo/redo log and cleaning up any unused data in the file.events()export(LExportRequest request) Execute an export.voidClear the export events.com.io7m.jattribute.core.AttributeReadableType<List<LFileModelEventType>> globalCaptionAdd(LCaptionName text) Add a global caption.com.io7m.jattribute.core.AttributeReadableType<List<LGlobalCaption>> globalCaptionModify(LCaptionID id, LCaptionName newName) Change the text for a global caption.Lower the order of the given caption (making it higher priority).Increase the order of the given caption (making it lower priority).Remove a global caption.Load an image and add it to the file.imageCaptionsAssign(List<LImageCaptionsAssignment> assignments) Assign captions to an image.imageCaptionsUnassign(List<LImageCaptionsAssignment> assignments) Unassign captions from an image.com.io7m.jattribute.core.AttributeReadableType<Optional<LImageComparison>> com.io7m.jattribute.core.AttributeReadableType<List<LImageWithID>> com.io7m.jattribute.core.AttributeReadableType<List<LImageWithID>> voidimageListFilterSet(String filter) Set the filter for the image list.imagesCompare(LImageID imageA, LImageID imageB) Compare captions on images.imagesDelete(List<LImageID> ids) Delete images.imageSelect(Optional<LImageID> name) Select an image.com.io7m.jattribute.core.AttributeReadableType<Optional<LImageWithID>> imageSourceSet(LImageID image, URI source) Change the source of an image.imageStream(LImageID id) loading()com.io7m.jattribute.core.AttributeReadableType<List<LMetadataValue>> metadataPut(List<LMetadataValue> values) Add or update metadata.metadataRemove(List<LMetadataValue> values) Remove metadata.static LFileModelTypeOpen a file model.redo()Redo the operation on the top of the redo stackcom.io7m.jattribute.core.AttributeReadableType<List<LCommandRecord>> redoText()com.io7m.jattribute.core.AttributeReadableType<LFileModelStatusType> status()undo()Undo the operation on the top of the undo stackcom.io7m.jattribute.core.AttributeReadableType<List<LCommandRecord>> undoText()validate()Execute a validation.com.io7m.jattribute.core.AttributeReadableType<List<LValidationProblemType>>
-
Method Details
-
open
Open a file model.- Parameters:
file- The filereadOnly-trueif the file should be read-only- Returns:
- A file model
- Throws:
LException- On errors
-
events
- Specified by:
eventsin interfaceLFileModelType- Returns:
- The file model events
-
status
- Specified by:
statusin interfaceLFileModelType- Returns:
- An observable status value for the file model
-
globalCaptionAdd
Description copied from interface:LFileModelTypeAdd a global caption.- Specified by:
globalCaptionAddin interfaceLFileModelType- Parameters:
text- The caption- Returns:
- The operation in progress
-
globalCaptionRemove
Description copied from interface:LFileModelTypeRemove a global caption.- Specified by:
globalCaptionRemovein interfaceLFileModelType- Parameters:
id- The caption- Returns:
- The operation in progress
-
globalCaptionOrderLower
Description copied from interface:LFileModelTypeLower the order of the given caption (making it higher priority).- Specified by:
globalCaptionOrderLowerin interfaceLFileModelType- Parameters:
id- The caption- Returns:
- The operation in progress
-
globalCaptionOrderUpper
Description copied from interface:LFileModelTypeIncrease the order of the given caption (making it lower priority).- Specified by:
globalCaptionOrderUpperin interfaceLFileModelType- Parameters:
id- The caption- Returns:
- The operation in progress
-
globalCaptionModify
Description copied from interface:LFileModelTypeChange the text for a global caption.- Specified by:
globalCaptionModifyin interfaceLFileModelType- Parameters:
id- The captionnewName- The new text- Returns:
- The operation in progress
-
categoryAdd
Description copied from interface:LFileModelTypeAdd a category.- Specified by:
categoryAddin interfaceLFileModelType- Parameters:
text- The category- Returns:
- The operation in progress
-
captionAdd
Description copied from interface:LFileModelTypeAdd a caption.- Specified by:
captionAddin interfaceLFileModelType- Parameters:
text- The caption- Returns:
- The operation in progress
-
captionModify
Description copied from interface:LFileModelTypeModify a caption.- Specified by:
captionModifyin interfaceLFileModelType- Parameters:
id- The caption IDname- The caption text- Returns:
- The operation in progress
-
captionRemove
Description copied from interface:LFileModelTypeDelete captions.- Specified by:
captionRemovein interfaceLFileModelType- Parameters:
captions- The captions- Returns:
- The operation in progress
-
categorySetRequired
Description copied from interface:LFileModelTypeSet categories as required.- Specified by:
categorySetRequiredin interfaceLFileModelType- Parameters:
categories- The categories- Returns:
- The operation in progress
-
categorySetNotRequired
Description copied from interface:LFileModelTypeSet categories as not required.- Specified by:
categorySetNotRequiredin interfaceLFileModelType- Parameters:
categories- The categories- Returns:
- The operation in progress
-
imageAdd
Description copied from interface:LFileModelTypeLoad an image and add it to the file.- Specified by:
imageAddin interfaceLFileModelType- Parameters:
name- The (unique) namefile- The filesource- The URI source, if any- Returns:
- The operation in progress
-
imagesDelete
Description copied from interface:LFileModelTypeDelete images.- Specified by:
imagesDeletein interfaceLFileModelType- Parameters:
ids- The ids- Returns:
- The operation in progress
-
imageCaptionsAssign
Description copied from interface:LFileModelTypeAssign captions to an image.- Specified by:
imageCaptionsAssignin interfaceLFileModelType- Parameters:
assignments- The assignments- Returns:
- The operation in progress
-
imageCaptionsUnassign
Description copied from interface:LFileModelTypeUnassign captions from an image.- Specified by:
imageCaptionsUnassignin interfaceLFileModelType- Parameters:
assignments- The assignments- Returns:
- The operation in progress
-
imagesCompare
Description copied from interface:LFileModelTypeCompare captions on images.- Specified by:
imagesComparein interfaceLFileModelType- Parameters:
imageA- The left imageimageB- The right image- Returns:
- The operation in progress
-
imageSelect
Description copied from interface:LFileModelTypeSelect an image.- Specified by:
imageSelectin interfaceLFileModelType- Parameters:
name- The name- Returns:
- The operation in progress
-
categoryCaptionsAssign
Description copied from interface:LFileModelTypeAssign the given captions to the given categories.- Specified by:
categoryCaptionsAssignin interfaceLFileModelType- Parameters:
categories- The categories/captions- Returns:
- The operation in progress
-
categoryCaptionsUnassign
Description copied from interface:LFileModelTypeUnassign the given captions from the given categories.- Specified by:
categoryCaptionsUnassignin interfaceLFileModelType- Parameters:
categories- The categories/captions- Returns:
- The operation in progress
-
categorySelect
Description copied from interface:LFileModelTypeSelect a category.- Specified by:
categorySelectin interfaceLFileModelType- Parameters:
id- The id- Returns:
- The operation in progress
-
metadataPut
Description copied from interface:LFileModelTypeAdd or update metadata.- Specified by:
metadataPutin interfaceLFileModelType- Parameters:
values- The metadata values- Returns:
- The operation in progress
-
metadataRemove
Description copied from interface:LFileModelTypeRemove metadata.- Specified by:
metadataRemovein interfaceLFileModelType- Parameters:
values- The metadata values- Returns:
- The operation in progress
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceLFileModelType- Throws:
LException
-
metadataList
- Specified by:
metadataListin interfaceLFileModelType- Returns:
- The current complete list of metadata
-
categorySelected
- Specified by:
categorySelectedin interfaceLFileModelType- Returns:
- The currently selected category
-
imageSelected
- Specified by:
imageSelectedin interfaceLFileModelType- Returns:
- The currently selected image
-
imageList
- Specified by:
imageListin interfaceLFileModelType- Returns:
- The current complete list of images
-
imageListFilterSet
Description copied from interface:LFileModelTypeSet the filter for the image list.- Specified by:
imageListFilterSetin interfaceLFileModelType- Parameters:
filter- The filter
-
imageListFiltered
- Specified by:
imageListFilteredin interfaceLFileModelType- Returns:
- The current complete list of images with a search filter applied
-
categoriesRequired
- Specified by:
categoriesRequiredin interfaceLFileModelType- Returns:
- The current complete list of required caption categories
-
captionList
- Specified by:
captionListin interfaceLFileModelType- Returns:
- The current complete list of captions
-
imageCaptionsAssigned
- Specified by:
imageCaptionsAssignedin interfaceLFileModelType- Returns:
- The list of captions assigned to the current image
-
imageCaptionsUnassigned
- Specified by:
imageCaptionsUnassignedin interfaceLFileModelType- Returns:
- The list of captions not assigned to the current image
-
imageCaptionsUnassignedFiltered
public com.io7m.jattribute.core.AttributeReadableType<List<LCaption>> imageCaptionsUnassignedFiltered()- Specified by:
imageCaptionsUnassignedFilteredin interfaceLFileModelType- Returns:
- The filtered list of captions not assigned to the current image
-
captionsUnassignedListFilterSet
Description copied from interface:LFileModelTypeSet the filter for the caption list.- Specified by:
captionsUnassignedListFilterSetin interfaceLFileModelType- Parameters:
filter- The filter
-
undoText
- Specified by:
undoTextin interfaceLFileModelType- Returns:
- Text describing the top of the undo stack, if any
-
undoStack
- Specified by:
undoStackin interfaceLFileModelType- Returns:
- The undo stack
-
redoStack
- Specified by:
redoStackin interfaceLFileModelType- Returns:
- The redo stack
-
categoryCaptionsAssigned
- Specified by:
categoryCaptionsAssignedin interfaceLFileModelType- Returns:
- The list of captions assigned to the current category
-
categoryCaptionsUnassigned
- Specified by:
categoryCaptionsUnassignedin interfaceLFileModelType- Returns:
- The list of captions not assigned to the current category
-
undo
Description copied from interface:LFileModelTypeUndo the operation on the top of the undo stack- Specified by:
undoin interfaceLFileModelType- Returns:
- The operation in progress
-
redo
Description copied from interface:LFileModelTypeRedo the operation on the top of the redo stack- Specified by:
redoin interfaceLFileModelType- Returns:
- The operation in progress
-
compact
Description copied from interface:LFileModelTypeCompact the file, deleting the undo/redo log and cleaning up any unused data in the file.- Specified by:
compactin interfaceLFileModelType- Returns:
- The operation in progress
-
redoText
- Specified by:
redoTextin interfaceLFileModelType- Returns:
- Text describing the top of the redo stack, if any
-
categoryList
- Specified by:
categoryListin interfaceLFileModelType- Returns:
- The current complete list of categories
-
categoryCaptions
public com.io7m.jattribute.core.AttributeReadableType<SortedMap<LCategoryID,List<LCaption>>> categoryCaptions()- Specified by:
categoryCaptionsin interfaceLFileModelType- Returns:
- The captions for every available category
-
imageStream
- Specified by:
imageStreamin interfaceLFileModelType- Parameters:
id- The image ID- Returns:
- The image data stream
-
globalCaptionList
- Specified by:
globalCaptionListin interfaceLFileModelType- Returns:
- The current complete list of global captions
-
imageComparisonA
- Specified by:
imageComparisonAin interfaceLFileModelType- Returns:
- The list of captions that are on image A, but not on image B
-
imageComparisonB
- Specified by:
imageComparisonBin interfaceLFileModelType- Returns:
- The list of captions that are on image B, but not on image A
-
imageComparison
- Specified by:
imageComparisonin interfaceLFileModelType- Returns:
- The current image comparison
-
captionClipboard
- Specified by:
captionClipboardin interfaceLFileModelType- Returns:
- The current caption clipboard
-
captionsCopy
Description copied from interface:LFileModelTypeMove a set of captions to the clipboard.- Specified by:
captionsCopyin interfaceLFileModelType- Parameters:
captions- The captions
-
captionsPaste
Description copied from interface:LFileModelTypeAssign the captions in the clipboard to each of the given images, and then clear the clipboard.- Specified by:
captionsPastein interfaceLFileModelType- Parameters:
images- The images- Returns:
- The operation in progress
-
validate
Description copied from interface:LFileModelTypeExecute a validation.- Specified by:
validatein interfaceLFileModelType- Returns:
- The operation in progress
-
validationProblems
public com.io7m.jattribute.core.AttributeReadableType<List<LValidationProblemType>> validationProblems()- Specified by:
validationProblemsin interfaceLFileModelType- Returns:
- The list of validation problems
-
export
Description copied from interface:LFileModelTypeExecute an export.- Specified by:
exportin interfaceLFileModelType- Parameters:
request- The export request- Returns:
- The operation in progress
-
exportEvents
- Specified by:
exportEventsin interfaceLFileModelType- Returns:
- The export events
-
exportClear
public void exportClear()Description copied from interface:LFileModelTypeClear the export events.- Specified by:
exportClearin interfaceLFileModelType
-
imageSourceSet
Description copied from interface:LFileModelTypeChange the source of an image.- Specified by:
imageSourceSetin interfaceLFileModelType- Parameters:
image- The imagesource- The source- Returns:
- The operation in progress
-
loading
- Specified by:
loadingin interfaceLFileModelType- Returns:
- A future that represents the file model's loading process
-