diff --git a/de.bmotionstudio.gef.editor/icons/icon_invisible.gif b/de.bmotionstudio.gef.editor/icons/icon_invisible.gif new file mode 100644 index 0000000000000000000000000000000000000000..2b5ef47f3c817f65e6f2b16eed6091735fc6588c Binary files /dev/null and b/de.bmotionstudio.gef.editor/icons/icon_invisible.gif differ diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/EditorImageRegistry.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/EditorImageRegistry.java index 5829e8f85304e9f030a9b896bc0aefaa917bfd21..56b16757ec2c66df568c7fcd22408130837cacc3 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/EditorImageRegistry.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/EditorImageRegistry.java @@ -27,6 +27,7 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry { public static final String IMG_ICON_DELETE_EDIT = "icon_delete_edit"; public static final String IMG_ICON_TR_UP = "icon_tr_up"; public static final String IMG_ICON_TR_LEFT = "icon_tr_left"; + public static final String IMG_ICON_CONTROL_HIDDEN = "icon_control_hidden"; public static final String IMG_ICON_JPG = "icon_jpg"; public static final String IMG_ICON_GIF = "icon_gif"; @@ -63,11 +64,14 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry { BMotionEditorPlugin.PLUGIN_ID, "icons/icon_connection16.gif"); BMotionStudioImage.registerImage(IMG_ICON_CONNECTION24, BMotionEditorPlugin.PLUGIN_ID, "icons/icon_connection24.gif"); + BMotionStudioImage.registerImage(IMG_ICON_CONTROL_HIDDEN, + BMotionEditorPlugin.PLUGIN_ID, "icons/icon_invisible.gif"); BMotionStudioImage.registerImage(IMG_ICON_NEW_WIZ, "org.eclipse.ui", "$nl$/icons/full/etool16/new_wiz.gif"); BMotionStudioImage.registerImage(IMG_ICON_DELETE_EDIT, "org.eclipse.ui", "$nl$/icons/full/etool16/delete_edit.gif"); - + BMotionStudioImage.registerImage(IMG_ICON_DELETE_EDIT, + "org.eclipse.ui", "$nl$/icons/full/etool16/delete_edit.gif"); BMotionStudioImage .registerImage(IMG_ICON_TR_UP, BMotionEditorPlugin.PLUGIN_ID, "icons/eclipse16/updated_co.gif"); diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/AbstractBMotionFigure.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/AbstractBMotionFigure.java index 515708559eb92a881c4b82f1dc43f3f40d805f56..479b6923fb817ab333ffdc67c08d29c8408c61bf 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/AbstractBMotionFigure.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/AbstractBMotionFigure.java @@ -8,6 +8,10 @@ package de.bmotionstudio.gef.editor.figure; import org.eclipse.draw2d.Clickable; import org.eclipse.draw2d.Graphics; +import org.eclipse.draw2d.geometry.Rectangle; + +import de.bmotionstudio.gef.editor.BMotionStudioImage; +import de.bmotionstudio.gef.editor.EditorImageRegistry; /** * @author Lukas Ladenberger @@ -15,8 +19,9 @@ import org.eclipse.draw2d.Graphics; */ public class AbstractBMotionFigure extends Clickable { - private boolean visible; - private boolean isRunning; + protected boolean visible; + protected boolean isRunning; + public static final int HIDDEN_ALPHA_VALUE = 35; public AbstractBMotionFigure() { this.visible = true; @@ -41,8 +46,13 @@ public class AbstractBMotionFigure extends Clickable { @Override public void paint(Graphics g) { - if (!this.visible && !isRunning) - g.setAlpha(25); + Rectangle clientArea = getClientArea(); + if (!this.visible && !isRunning()) { + g.drawImage(BMotionStudioImage + .getImage(EditorImageRegistry.IMG_ICON_CONTROL_HIDDEN), + clientArea.x, clientArea.y); + g.setAlpha(HIDDEN_ALPHA_VALUE); + } super.paint(g); } diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/ShapeFigure.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/ShapeFigure.java index 6d647b3b55834a52d4ab578cbab7fe4cdd4bf469..9ddf860ff85bf9c074c77be4a97e385f98f6834b 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/ShapeFigure.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/ShapeFigure.java @@ -83,7 +83,10 @@ public class ShapeFigure extends AbstractBMotionFigure { @Override protected void fillShape(Graphics g) { - g.setAlpha(alpha); + if (!visible && !isRunning) + g.setAlpha(AbstractBMotionFigure.HIDDEN_ALPHA_VALUE); + else + g.setAlpha(alpha); g.setAntialias(SWT.ON); if (fillType == FILL_TYPE_GRADIENT) { // Gradient fill type @@ -168,7 +171,10 @@ public class ShapeFigure extends AbstractBMotionFigure { @Override protected void outlineShape(Graphics g) { - g.setAlpha(outlineAlpha); + if (!visible && !isRunning) + g.setAlpha(AbstractBMotionFigure.HIDDEN_ALPHA_VALUE); + else + g.setAlpha(outlineAlpha); g.setAntialias(SWT.ON); g.setForegroundColor(this.getForegroundColor()); diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/SwitchPart.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/SwitchPart.java index 6b17cb7005708a61f18f97a597b7a6c192e4e5c8..cb28c2111e4f9f9e8bf8b630e481616ff8c70e18 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/SwitchPart.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/SwitchPart.java @@ -64,6 +64,10 @@ public class SwitchPart extends BMSAbstractEditPart { if (aID.equals(AttributeConstants.ATTRIBUTE_SWITCH_DIRECTION)) refreshEditLayout(figure, model); + if (aID.equals(AttributeConstants.ATTRIBUTE_VISIBLE)) + ((SwitchFigure) figure) + .setVisible(Boolean.valueOf(value.toString())); + } @Override