Class BmPictureModel

All Implemented Interfaces:
IAttribute<IBmObject,org.eclipse.emf.ecore.EStructuralFeature>, IEditableModel, IEmfAttribute<IBmObject>, IModel, IEmfValueAttribute<Picture,IBmObject>, IValue<Picture>, IValidable, IModelApiAwareModel, IPictureModel

public class BmPictureModel extends BmValue<Picture> implements IPictureModel
Picture model implementation IPictureModel}.
  • Constructor Details

    • BmPictureModel

      public BmPictureModel(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, IV8Project v8project)
      Instantiates a new picture model.
      Parameters:
      object - the object, can not be null
      feature - the object feature, can not be null
      v8project - the V8 project, can not be null
    • BmPictureModel

      public BmPictureModel(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, IV8Project v8project, IPictureService pictureService, boolean canChoiseFromFile)
      Instantiates a new picture model.
      Parameters:
      object - the object, can not be null
      feature - the object feature, can not be null
      v8project - the V8 project, can not be null
      pictureService - the pictureService, can be null
      canChoiseFromFile - is this picture can choise from file, must be false if pictureService is null
  • Method Details

    • dispose

      public void dispose()
      Description copied from interface: IModel
      Disposes this model.
      Specified by:
      dispose in interface IModel
      Overrides:
      dispose in class BmValue<Picture>
    • getV8project

      public IV8Project getV8project()
      Returns configuration params.
      Specified by:
      getV8project in interface IPictureModel
      Returns:
      the project parameters.
    • getPictureService

      public IPictureService getPictureService()
      Description copied from interface: IPictureModel
      Returns picture service.
      Specified by:
      getPictureService in interface IPictureModel
      Returns:
      the picture service
    • isPictureCanChoiseFromFile

      public boolean isPictureCanChoiseFromFile()
      Description copied from interface: IPictureModel
      true if this picture can be stored as file in file system. This option affect to show tab "from file" in choise picture dialog.
      Specified by:
      isPictureCanChoiseFromFile in interface IPictureModel
      Returns:
      true if this picture can be stored as file, false in otherwise.
    • isEqual

      public boolean isEqual(Picture other)
      Description copied from interface: IValue
      Checks the value for equality with the current stored value.
      Specified by:
      isEqual in interface IValue<Picture>
      Overrides:
      isEqual in class Value<Picture>
      Parameters:
      other - the other value to check.
      Returns:
      true if other value is equal to this value, false otherwise.
    • commit

      public void commit()
      Description copied from interface: IModel
      Commits the changes to the data model.
      Specified by:
      commit in interface IModel
      Overrides:
      commit in class Model
    • set

      public void set(Object object, Point transparentPoint)
      Description copied from interface: IPictureModel
      Sets picture parts.
      Specified by:
      set in interface IPictureModel
      Parameters:
      object - the picture to set - null, Picture or String type
      transparentPoint - the transparentPoint
    • clean

      public void clean()
      Description copied from interface: IPictureModel
      Clean picture value
      Specified by:
      clean in interface IPictureModel
    • getModelObject

      public org.eclipse.emf.ecore.EObject getModelObject()
      Description copied from interface: IPictureModel
      Gets model object for setting picture
      Specified by:
      getModelObject in interface IPictureModel
      Returns:
      model object for setting picture, never null
    • setObjectValue

      protected void setObjectValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, Picture valueToApply)
      Description copied from class: BmValue
      Sets the new value of the provided model object feature during the commit.
      The method is invoked within the task, so the given objects have the relevant state (e.g. attached to transaction).
      Overrides:
      setObjectValue in class BmValue<Picture>
      Parameters:
      object - the object to set new value, cannot be null.
      feature - the feture to set, cannot be null.
      valueToApply - the new value to set, can be null.