Beispiel #1
0
        static Plugs()
        {
            var PlugPen    = new Pen(Brushes.Black, 1.0);
            var PlugTarget = new Point(0.0, 8.0);
            var PlugSource = new Point(32.0, 8.0);

            PredefinedPlugs.Add(new SimplePresentationElement("<None>", None, "", PlugDrawer.CreatePlug(None, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Filled-Arrow", FilledArrow, "", PlugDrawer.CreatePlug(FilledArrow, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Double-Filled-Arrow", DoubleFilledArrow, "", PlugDrawer.CreatePlug(DoubleFilledArrow, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Empty-Arrow", EmptyArrow, "", PlugDrawer.CreatePlug(EmptyArrow, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Double-Empty-Arrow", DoubleEmptyArrow, "", PlugDrawer.CreatePlug(DoubleEmptyArrow, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Simple-Arrow", SimpleArrow, "", PlugDrawer.CreatePlug(SimpleArrow, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Double-Simple-Arrow", DoubleSimpleArrow, "", PlugDrawer.CreatePlug(DoubleSimpleArrow, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            // POSTPONED: PredefinedPlugs.Add(new SimplePresentationElement("Electro-Wave", ElectroWave, "", PlugDrawer.CreatePlug(ElectroWave, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Filled-Circle", FilledCircle, "", PlugDrawer.CreatePlug(FilledCircle, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Empty-Circle", EmptyCircle, "", PlugDrawer.CreatePlug(EmptyCircle, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Filled-Rhomb", FilledRhomb, "", PlugDrawer.CreatePlug(FilledRhomb, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Empty-Rhomb", EmptyRhomb, "", PlugDrawer.CreatePlug(EmptyRhomb, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Line-Dash", LineDash, "", PlugDrawer.CreatePlug(LineDash, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Line-Double-Dash", LineDoubleDash, "", PlugDrawer.CreatePlug(LineDoubleDash, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Triline-Circle", TrilineCircle, "", PlugDrawer.CreatePlug(TrilineCircle, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Triline-Dash", TrilineDash, "", PlugDrawer.CreatePlug(TrilineDash, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Filled-Circle-Arrow", FilledCircleArrow, "", PlugDrawer.CreatePlug(FilledCircleArrow, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Empty-Circle-Arrow", EmptyCircleArrow, "", PlugDrawer.CreatePlug(EmptyCircleArrow, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Empty-Circle-Simple-Arrow", EmptyCircleSimpleArrow, "", PlugDrawer.CreatePlug(EmptyCircleSimpleArrow, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Line-X", LineX, "", PlugDrawer.CreatePlug(LineX, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Pointer-Arrow", PointerArrow, "", PlugDrawer.CreatePlug(PointerArrow, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Chevron", Chevron, "", PlugDrawer.CreatePlug(Chevron, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Plumb-Bob", PlumbBob, "", PlugDrawer.CreatePlug(PlumbBob, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Circle-Dash", CircleDash, "", PlugDrawer.CreatePlug(CircleDash, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Circle-Plus", CirclePlus, "", PlugDrawer.CreatePlug(CirclePlus, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Circle-Minus", CircleMinus, "", PlugDrawer.CreatePlug(CircleMinus, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
            PredefinedPlugs.Add(new SimplePresentationElement("Circle-Asterisk", CircleAsterisk, "", PlugDrawer.CreatePlug(CircleAsterisk, PlugPen, PlugTarget, PlugSource, 1.0, false).ToDrawingImage()));
        }
Beispiel #2
0
        public static Tuple <SimplePresentationElement, string> GetRelDefVariantRepresentation(string NamePrefix, IIdentifiableElement RelDefVariant,
                                                                                               IDictionary <SimplePresentationElement, string> PlugDefs, Pen Pencil)
        {
            var PlugCode = PlugDefs.GetMatchingOrFirst((key, value) => key.TechName == RelDefVariant.TechName);
            var Result   = Tuple.Create(new SimplePresentationElement("[" + NamePrefix + "] " + RelDefVariant.Name,
                                                                      RelDefVariant.TechName, RelDefVariant.Summary),
                                        PlugCode);

            var AreaWidth      = MasterDrawer.BASE_WIDTH;
            var TargetPosition = MasterDrawer.SAMPLE_CONN_TARGET;
            var SourcePosition = new Point(TargetPosition.X + AreaWidth, TargetPosition.Y);

            var ShowEmptyPlugLine = (PlugCode == Plugs.None);
            var PlugDraw          = PlugDrawer.CreatePlug(PlugCode, Pencil, TargetPosition, SourcePosition, 0.75,
                                                          ShowEmptyPlugLine, ShowEmptyPlugLine).ToDrawingImage();

            Result.Item1.Pictogram = PlugDraw;

            return(Result);
        }