Skip to content
Snippets Groups Projects
Commit 67595a32 authored by Lukas Ladenberger's avatar Lukas Ladenberger
Browse files

implemented PROBPLUGIN-43

parent 0c5abded
Branches
Tags
No related merge requests found
...@@ -12,6 +12,7 @@ import java.util.HashMap; ...@@ -12,6 +12,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.ImageFigure; import org.eclipse.draw2d.ImageFigure;
import org.eclipse.draw2d.StackLayout; import org.eclipse.draw2d.StackLayout;
import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.draw2d.geometry.Rectangle;
...@@ -24,6 +25,8 @@ public class BMSImageFigure extends AbstractBMotionFigure { ...@@ -24,6 +25,8 @@ public class BMSImageFigure extends AbstractBMotionFigure {
private ImageFigure imageFigure; private ImageFigure imageFigure;
private int alpha;
final ImageLoader loader = new ImageLoader(); final ImageLoader loader = new ImageLoader();
private Map<String, List<Image>> images = new HashMap<String, List<Image>>(); private Map<String, List<Image>> images = new HashMap<String, List<Image>>();
...@@ -39,6 +42,12 @@ public class BMSImageFigure extends AbstractBMotionFigure { ...@@ -39,6 +42,12 @@ public class BMSImageFigure extends AbstractBMotionFigure {
getParent().setConstraint(imageFigure, rect); getParent().setConstraint(imageFigure, rect);
} }
@Override
public void paint(Graphics g) {
g.setAlpha(alpha);
super.paint(g);
}
public void setImage(String myPath) { public void setImage(String myPath) {
if (currentGIFThread != null) if (currentGIFThread != null)
...@@ -139,4 +148,9 @@ public class BMSImageFigure extends AbstractBMotionFigure { ...@@ -139,4 +148,9 @@ public class BMSImageFigure extends AbstractBMotionFigure {
} }
public void setAlpha(int alpha) {
this.alpha = alpha;
repaint();
}
} }
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
package de.bmotionstudio.gef.editor.model; package de.bmotionstudio.gef.editor.model;
import de.bmotionstudio.gef.editor.attribute.BAttributeAlpha;
import de.bmotionstudio.gef.editor.attribute.BAttributeImage; import de.bmotionstudio.gef.editor.attribute.BAttributeImage;
/** /**
...@@ -27,9 +28,8 @@ public class BImage extends BControl { ...@@ -27,9 +28,8 @@ public class BImage extends BControl {
@Override @Override
protected void initAttributes() { protected void initAttributes() {
initAttribute(new BAttributeImage(null)); initAttribute(new BAttributeImage(null));
initAttribute(new BAttributeAlpha(255));
} }
} }
...@@ -13,8 +13,8 @@ import org.eclipse.draw2d.IFigure; ...@@ -13,8 +13,8 @@ import org.eclipse.draw2d.IFigure;
import org.eclipse.gef.EditPolicy; import org.eclipse.gef.EditPolicy;
import de.bmotionstudio.gef.editor.AttributeConstants; import de.bmotionstudio.gef.editor.AttributeConstants;
import de.bmotionstudio.gef.editor.editpolicy.BMSDeletePolicy;
import de.bmotionstudio.gef.editor.editpolicy.BMSConnectionEditPolicy; import de.bmotionstudio.gef.editor.editpolicy.BMSConnectionEditPolicy;
import de.bmotionstudio.gef.editor.editpolicy.BMSDeletePolicy;
import de.bmotionstudio.gef.editor.editpolicy.ChangeAttributePolicy; import de.bmotionstudio.gef.editor.editpolicy.ChangeAttributePolicy;
import de.bmotionstudio.gef.editor.figure.BMSImageFigure; import de.bmotionstudio.gef.editor.figure.BMSImageFigure;
import de.bmotionstudio.gef.editor.library.AbstractLibraryCommand; import de.bmotionstudio.gef.editor.library.AbstractLibraryCommand;
...@@ -47,6 +47,10 @@ public class BImagePart extends BMSAbstractEditPart { ...@@ -47,6 +47,10 @@ public class BImagePart extends BMSAbstractEditPart {
((BMSImageFigure) figure).setVisible(Boolean.valueOf(value ((BMSImageFigure) figure).setVisible(Boolean.valueOf(value
.toString())); .toString()));
if (aID.equals(AttributeConstants.ATTRIBUTE_ALPHA))
((BMSImageFigure) figure)
.setAlpha(Integer.valueOf(value.toString()));
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment