[Icons] Copy image with Format Painter Tool
@@ -24,9 +24,11 @@ import com.archimatetool.editor.diagram.commands.LineWidthCommand;
import com.archimatetool.editor.diagram.commands.TextAlignmentCommand;
import com.archimatetool.editor.diagram.commands.TextPositionCommand;
import com.archimatetool.editor.diagram.tools.FormatPainterInfo.PaintFormat;
+import com.archimatetool.editor.model.commands.EObjectFeatureCommand;
import com.archimatetool.editor.model.commands.FeatureCommand;
import com.archimatetool.editor.ui.ColorFactory;
import com.archimatetool.model.IArchimateElement;
+import com.archimatetool.model.IArchimatePackage;
import com.archimatetool.model.IBorderObject;
import com.archimatetool.model.IDiagramModelArchimateConnection;
import com.archimatetool.model.IDiagramModelArchimateObject;
@@ -35,6 +37,7 @@ import com.archimatetool.model.IDiagramModelConnection;
import com.archimatetool.model.IDiagramModelImage;
import com.archimatetool.model.IDiagramModelObject;
import com.archimatetool.model.IFontAttribute;
+import com.archimatetool.model.IIconic;
import com.archimatetool.model.IJunction;
import com.archimatetool.model.ILineObject;
import com.archimatetool.model.ILockable;
@@ -220,6 +223,24 @@ public class FormatPainterTool extends AbstractTool {
}
}
+ // IIconic
+ if(pf.getSourceComponent() instanceof IIconic && targetComponent instanceof IIconic) {
+ IIconic source = (IIconic)pf.getSourceComponent();
+ IIconic target = (IIconic)targetComponent;
+
+ // Image Path
+ Command cmd = new EObjectFeatureCommand("", target, IArchimatePackage.Literals.DIAGRAM_MODEL_IMAGE_PROVIDER__IMAGE_PATH, source.getImagePath()); //$NON-NLS-1$
+ if(cmd.canExecute()) {
+ result.add(cmd);
+ }
+
+ // Image position
+ cmd = new EObjectFeatureCommand("", target, IArchimatePackage.Literals.ICONIC__IMAGE_POSITION, source.getImagePosition()); //$NON-NLS-1$
+ if(cmd.canExecute()) {
+ result.add(cmd);
+ }
+ }
+
return result;
}
