diff --git a/de.bmotionstudio.gef.editor/icons/icon_canister.gif b/de.bmotionstudio.gef.editor/icons/icon_canister.gif deleted file mode 100644 index f5a20232c661c5afea954c41cb11a8d839e407b2..0000000000000000000000000000000000000000 Binary files a/de.bmotionstudio.gef.editor/icons/icon_canister.gif and /dev/null differ diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/AttributeConstants.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/AttributeConstants.java index 49a11fee08c328bdb9a5cadb6191836330c19772..30a8655e4f2ad8f757cd253baa3778b936534a4a 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/AttributeConstants.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/AttributeConstants.java @@ -23,11 +23,6 @@ public final class AttributeConstants { public static final String ATTRIBUTE_IMAGE = "de.bmotionstudio.gef.editor.attribute.BAttributeImage"; public static final String ATTRIBUTE_TEXT = "de.bmotionstudio.gef.editor.attribute.BAttributeText"; public static final String ATTRIBUTE_TEXT_COLOR = "de.bmotionstudio.gef.editor.attribute.BAttributeTextColor"; - public static final String ATTRIBUTE_FILL_HEIGHT = "de.bmotionstudio.gef.editor.attribute.BAttributeFillHeight"; - public static final String ATTRIBUTE_FILL_COLOR = "de.bmotionstudio.gef.editor.attribute.BAttributeFillColor"; - public static final String ATTRIBUTE_SHOWS_MEASURE = "de.bmotionstudio.gef.editor.attribute.BAttributeShowMeasure"; - public static final String ATTRIBUTE_MEASURE_MAXPOS = "de.bmotionstudio.gef.editor.attribute.BAttributeMeasureMaxPos"; - public static final String ATTRIBUTE_MEASURE_INTERVAL = "de.bmotionstudio.gef.editor.attribute.BAttributeMeasureInterval"; public static final String ATTRIBUTE_ALPHA = "de.bmotionstudio.gef.editor.attribute.BAttributeAlpha"; public static final String ATTRIBUTE_OUTLINEALPHA = "de.bmotionstudio.gef.editor.attribute.BAttributeOutlineAlpha"; public static final String ATTRIBUTE_FONT = "de.bmotionstudio.gef.editor.attribute.BAttributeFont"; diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeFillColor.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeFillColor.java deleted file mode 100644 index 22686e0e46b102955a8717ba2259873f5bd4a564..0000000000000000000000000000000000000000 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeFillColor.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, - * Heinrich Heine Universitaet Duesseldorf - * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) - * */ - -package de.bmotionstudio.gef.editor.attribute; - -import org.eclipse.swt.graphics.RGB; -import org.eclipse.ui.views.properties.ColorPropertyDescriptor; -import org.eclipse.ui.views.properties.PropertyDescriptor; - -public class BAttributeFillColor extends AbstractAttribute { - - public BAttributeFillColor(Object value) { - super(value); - } - - public PropertyDescriptor preparePropertyDescriptor() { - return new ColorPropertyDescriptor(getID(), getName()); - } - - @Override - public String getName() { - return "Fill-Color"; - } - - @Override - public Object unmarshal(String s) { - - String colorStr = s.toLowerCase().replace(" ", ""); - colorStr = colorStr.replace("rgb", ""); - colorStr = colorStr.replace("}", ""); - colorStr = colorStr.replace("{", ""); - String[] str = String.valueOf(colorStr).split("\\,"); - if (str.length == 3) { - int red = Integer.valueOf(str[0]); - int green = Integer.valueOf(str[1]); - int blue = Integer.valueOf(str[2]); - return new RGB(red, green, blue); - } else { - return new RGB(192, 192, 192); - } - - } - -} diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeFillHeight.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeFillHeight.java deleted file mode 100644 index a413e887dfe55ba718af36203bdf13d490f81643..0000000000000000000000000000000000000000 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeFillHeight.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, - * Heinrich Heine Universitaet Duesseldorf - * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) - * */ - -package de.bmotionstudio.gef.editor.attribute; - -import org.eclipse.ui.views.properties.PropertyDescriptor; -import org.eclipse.ui.views.properties.TextPropertyDescriptor; - -public class BAttributeFillHeight extends AbstractAttribute { - - public BAttributeFillHeight(Object value) { - super(value); - } - - public PropertyDescriptor preparePropertyDescriptor() { - return new TextPropertyDescriptor(getID(), getName()); - } - - @Override - public String getName() { - return "Fill-Height"; - } - -} diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeMeasureInterval.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeMeasureInterval.java deleted file mode 100644 index 8e36529da97e4f28f377a5bab68dd903a1ac4db0..0000000000000000000000000000000000000000 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeMeasureInterval.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, - * Heinrich Heine Universitaet Duesseldorf - * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) - * */ - -package de.bmotionstudio.gef.editor.attribute; - -import org.eclipse.ui.views.properties.PropertyDescriptor; -import org.eclipse.ui.views.properties.TextPropertyDescriptor; - -public class BAttributeMeasureInterval extends AbstractAttribute { - - public BAttributeMeasureInterval(Object value) { - super(value); - } - - public PropertyDescriptor preparePropertyDescriptor() { - return new TextPropertyDescriptor(getID(), getName()); - } - - @Override - public String getName() { - return "Measure-Interval"; - } - -} diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeMeasureMaxPos.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeMeasureMaxPos.java deleted file mode 100644 index 7adafa6618d7a569717a072dc82ffb156e080480..0000000000000000000000000000000000000000 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeMeasureMaxPos.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, - * Heinrich Heine Universitaet Duesseldorf - * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) - * */ - -package de.bmotionstudio.gef.editor.attribute; - -import org.eclipse.ui.views.properties.PropertyDescriptor; -import org.eclipse.ui.views.properties.TextPropertyDescriptor; - -public class BAttributeMeasureMaxPos extends AbstractAttribute { - - public BAttributeMeasureMaxPos(Object value) { - super(value); - } - - public PropertyDescriptor preparePropertyDescriptor() { - return new TextPropertyDescriptor(getID(), getName()); - } - - @Override - public String getName() { - return "Measure-Max-Pos"; - } - -} diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeShowMeasure.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeShowMeasure.java deleted file mode 100644 index f8777dd552528ebab78e23ddfcf55a74763fb1f9..0000000000000000000000000000000000000000 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/attribute/BAttributeShowMeasure.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, - * Heinrich Heine Universitaet Duesseldorf - * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) - * */ - -package de.bmotionstudio.gef.editor.attribute; - -import org.eclipse.ui.views.properties.PropertyDescriptor; - -import de.bmotionstudio.gef.editor.model.BControl; -import de.bmotionstudio.gef.editor.property.CheckboxPropertyDescriptor; - -public class BAttributeShowMeasure extends AbstractAttribute { - - public BAttributeShowMeasure(Object value) { - super(value); - } - - public PropertyDescriptor preparePropertyDescriptor() { - return new CheckboxPropertyDescriptor(getID(), getName()); - } - - @Override - public String validateValue(Object value, BControl control) { - if ((String.valueOf(value)).trim().equalsIgnoreCase("true") - || (String.valueOf(value)).trim().equalsIgnoreCase("false")) { - return null; - } else { - return "Value must be a Boolean value (\"true\" or \"false\")"; - } - } - - @Override - public String getName() { - return "Show-Measure"; - } - - @Override - public Object unmarshal(String s) { - return Boolean.valueOf(s); - } - -} diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/CanisterFigure.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/CanisterFigure.java deleted file mode 100644 index f04abbd7011c631262473726ee75318def355721..0000000000000000000000000000000000000000 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/CanisterFigure.java +++ /dev/null @@ -1,190 +0,0 @@ -/** - * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, - * Heinrich Heine Universitaet Duesseldorf - * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) - * */ - -package de.bmotionstudio.gef.editor.figure; - -import org.eclipse.draw2d.BorderLayout; -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.Figure; -import org.eclipse.draw2d.Graphics; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.PositionConstants; -import org.eclipse.draw2d.RectangleFigure; -import org.eclipse.draw2d.XYLayout; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.PaletteData; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; - -public class CanisterFigure extends AbstractBMotionFigure { - - private RectangleFigure axisRect; - private Figure axisFigure; - private RectangleFigure fillRect; - private Figure fillFigure; - - private Image layerImage; - private ImageData imageData; - - private int fill_height; - private double positions; - private int show_pos; - - private Boolean showMeasure; - - public CanisterFigure() { - - XYLayout layout = new XYLayout(); - setLayoutManager(layout); - - PaletteData palette = new PaletteData( - new RGB[] { ColorConstants.white.getRGB() }); - imageData = new ImageData(1, 1, 8, palette); - imageData.alpha = 255; - imageData.setPixel(0, 0, 0); - layerImage = new Image(null, imageData); - - axisFigure = new Figure(); - axisFigure.setLocation(new Point(0, 0)); - axisFigure.setLayoutManager(new XYLayout()); - add(axisFigure); - - fillFigure = new Figure(); - fillFigure.setLayoutManager(new BorderLayout()); - add(fillFigure); - - fillRect = new RectangleFigure(); - fillRect.setOutline(false); - fillFigure.add(fillRect); - fillFigure.setConstraint(fillRect, BorderLayout.BOTTOM); - - setOpaque(true); - - } - - public void setLayout(Rectangle rect) { - - getParent().setConstraint(this, rect); - - // Set the right size and position of the y-axis - axisFigure.removeAll(); - - int fillPos = 0; - - double one_pos = Double.valueOf(rect.height) / positions; - - if (showMeasure) { - - axisFigure.setSize(100, rect.height); - - axisRect = new RectangleFigure(); - axisFigure.add(axisRect); - axisRect.setBackgroundColor(ColorConstants.black); - axisFigure.setConstraint(axisRect, new Rectangle(14, 0, 1, - rect.height)); - - RectangleFigure line; - Label lb; - - for (int i = 0; i <= positions; i = i + show_pos) { - - lb = new Label(); - axisFigure.add(lb); - lb.setText(String.valueOf((int) (positions - i))); - lb.setBackgroundColor(ColorConstants.red); - lb.setTextAlignment(PositionConstants.LEFT); - - if (i == 0) { - axisFigure.setConstraint(lb, new Rectangle(18, - (int) (i * one_pos), 30, 10)); - } else if (i == positions) { - axisFigure.setConstraint(lb, new Rectangle(18, - (int) (i * one_pos) - 10, 30, 10)); - } else { - axisFigure.setConstraint(lb, new Rectangle(18, - (int) (i * one_pos) - 5, 30, 10)); - } - - line = new RectangleFigure(); - line.setBackgroundColor(ColorConstants.black); - line.setOutline(false); - axisFigure.add(line); - - if (i == positions) { - axisFigure.setConstraint(line, new Rectangle(10, - (int) (i * one_pos) - 1, 10, 1)); - } else { - axisFigure.setConstraint(line, new Rectangle(10, - (int) (i * one_pos), 10, 1)); - } - - } - - fillPos = 60; - - } - - // Set right size of the fill figure - setConstraint(fillFigure, new Rectangle(fillPos, 0, rect.width - - fillPos, rect.height)); - - double tmp = one_pos * (positions - Double.valueOf(fill_height)); - int f_fill_height = (int) tmp; - fillRect.setSize(rect.width - fillPos, rect.height - f_fill_height); - fillFigure.setConstraint(fillRect, BorderLayout.BOTTOM); - fillFigure.repaint(); - - } - - public void setAlpha(int alpha) { - imageData.alpha = alpha; - if (layerImage != null && !layerImage.isDisposed()) { - layerImage.dispose(); - } - layerImage = new Image(null, imageData); - repaint(); - } - - public void paintFigure(Graphics g) { - Rectangle rectangle = getClientArea(); - g.drawImage(layerImage, new Rectangle(layerImage.getBounds()), - rectangle); - } - - public void setFillColor(RGB rgb) { - fillRect.setBackgroundColor(new Color(Display.getDefault(), rgb)); - } - - public void setFillHeight(Integer height) { - this.fill_height = height; - } - - public void setMaxPos(Integer maxPos) { - this.positions = maxPos; - } - - public void setInterval(Integer interval) { - this.show_pos = interval; - } - - public void setMeasure(Boolean bol) { - this.showMeasure = bol; - } - - public void setBackgroundColor(RGB rgb) { - imageData.palette.colors[0] = rgb; - if (layerImage != null && !layerImage.isDisposed()) { - layerImage.dispose(); - } - layerImage = new Image(null, imageData); - repaint(); - } - -} diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BCanisterPart.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BCanisterPart.java deleted file mode 100644 index ca67098a873d9fabdd7c26867b887401834853d1..0000000000000000000000000000000000000000 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BCanisterPart.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, - * Heinrich Heine Universitaet Duesseldorf - * This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html) - * */ - -package de.bmotionstudio.gef.editor.part; - -import java.beans.PropertyChangeEvent; - -import org.eclipse.draw2d.IFigure; -import org.eclipse.swt.graphics.RGB; - -import de.bmotionstudio.gef.editor.AttributeConstants; -import de.bmotionstudio.gef.editor.figure.CanisterFigure; -import de.bmotionstudio.gef.editor.model.BControl; - -public class BCanisterPart extends AppAbstractEditPart { - - @Override - protected IFigure createEditFigure() { - IFigure figure = new CanisterFigure(); - return figure; - } - - @Override - public void refreshEditFigure(IFigure figure, BControl model, - PropertyChangeEvent evt) { - ((CanisterFigure) figure).setAlpha(Integer.valueOf(model - .getAttributeValue(AttributeConstants.ATTRIBUTE_ALPHA) - .toString())); - ((CanisterFigure) figure).setFillColor((RGB) model - .getAttributeValue(AttributeConstants.ATTRIBUTE_FILL_COLOR)); - ((CanisterFigure) figure).setFillHeight(Integer.valueOf(model - .getAttributeValue(AttributeConstants.ATTRIBUTE_FILL_HEIGHT) - .toString())); - ((CanisterFigure) figure).setMaxPos(Integer.valueOf(model - .getAttributeValue(AttributeConstants.ATTRIBUTE_MEASURE_MAXPOS) - .toString())); - ((CanisterFigure) figure).setInterval(Integer.valueOf(model - .getAttributeValue( - AttributeConstants.ATTRIBUTE_MEASURE_INTERVAL) - .toString())); - ((CanisterFigure) figure).setMeasure(Boolean.valueOf(model - .getAttributeValue(AttributeConstants.ATTRIBUTE_SHOWS_MEASURE) - .toString())); - ((CanisterFigure) figure) - .setBackgroundColor((RGB) model - .getAttributeValue(AttributeConstants.ATTRIBUTE_BACKGROUND_COLOR)); - } - - @Override - protected void prepareEditPolicies() { - } - - @Override - protected void prepareRunPolicies() { - } - -}