public class ReplacePictureFragment extends com.sodius.mdw.internal.metamodel.doors.io.commands.ReplacePictureFragmentImpl implements ShareModuleFragment
This fragment is intended to be combined into an EditModuleCommand
instance.
Below is a snippet illustrating how to use this fragment (see CommandRunner
for a full snippet):
ModuleRef module = ModuleRef.qualifiedName("/MyFolder/MyModule"); EditModuleCommand command = new EditModuleCommand(module, TerminationMode.SAVE_AND_CLOSE); ObjectRef object = ObjectRef.absoluteNumber(5); File picture = new File(new File("c:\\pictures\\myPicture.png")); command.add(new ReplacePictureFragment(object, picture)); myCommandRunner.run(command);
CommandRunner
,
EditModuleCommand
,
SoftDeleteObjectFragment
Constructor and Description |
---|
ReplacePictureFragment(ObjectRef object,
File pictureFile)
Instantiates a fragment to replace an existing picture by a new one.
|
ReplacePictureFragment(ObjectRef object,
PictureRef picture)
Instantiates a fragment to replace an existing picture by a new one.
|
public ReplacePictureFragment(ObjectRef object, File pictureFile)
object
- the object containing a picture to be replaced.pictureFile
- the file containing the new picture to insert.public ReplacePictureFragment(ObjectRef object, PictureRef picture)
object
- the object containing a picture to be replaced.picture
- contains information on the picture to replace in the object.