Beispiel #1
0
 public void TransformGeometries(DrawableCollection drawables)
 {
     foreach (var drawable in drawables)
     {
         drawable.TransformGeometry(DrawableVisitor);
     }
 }
Beispiel #2
0
 public WatchItem()
 {
     Drawables = new DrawableCollection();
     isLoading = true;
     isVisible = true;
     color     = "Black";
 }
        public StateCadImporter(string text, DrawableCollection ownerDraw, float scale)
        {
            Text      = text;
            OwnerDraw = ownerDraw;
            Scale     = scale;
            string[] lines = text.Split(new string[] { "\x02\x0A" }, StringSplitOptions.RemoveEmptyEntries);
            Instructions = new List <Instruction>();

            Rectangle rect = Rectangle.Empty;

            DrawArea = Rectangle.Empty;
            foreach (string line in lines)
            {
                Instruction inst = new Instruction(line, this);
                Instructions.Add(inst);
                if (inst.GetDrawRectangle(out rect))
                {
                    DrawArea = GetDrawRectangle(DrawArea, rect);
                }
            }

            var sheet = new Rectangle(Util.InvertSign(Util.Middle(DrawArea.Size)), DrawArea.Size);

            Transform = new Matrix();
            Transform.Translate(DrawArea.X - sheet.X, -sheet.Y + DrawArea.Y);
            Transform.Scale(Scale, -Scale);
        }
Beispiel #4
0
 public Transition(DrawableCollection ownerDraw, Point[] splinePoints, DrawableObject startObject)
     : base(ownerDraw)
 {
     guides.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
     points           = (Point[])splinePoints.Clone();
     textPointOffset  = Point.Empty;
     StartObject      = startObject;
     maxDist          = new double[2];
     maxDist[0]       = points[0] == points[1] ? 50d : Math.Sqrt(Math.Pow(points[0].X - points[1].X, 2) + Math.Pow(points[0].Y - points[1].Y, 2));
     maxDist[1]       = points[2] == points[3] ? 50d : Math.Sqrt(Math.Pow(points[2].X - points[3].X, 2) + Math.Pow(points[2].Y - points[3].Y, 2));
 }
Beispiel #5
0
 public void Save(DrawableCollection drawables)
 {
     if (_currentDrawingHasFile)
     {
         _saver.Save(drawables);
     }
     else
     {
         _saver.SaveAsNewFile(drawables);
         _currentDrawingHasFile = true;
     }
 }
Beispiel #6
0
        public static Transition Create(ObjectType objectType, DrawableCollection ownerDraw, Point[] splinePoints, DrawableObject startObject)
        {
            switch (objectType)
            {
            case ObjectType.SimpleTransition:
                return(new SimpleTransition(ownerDraw, splinePoints, startObject));

            case ObjectType.SuperTransition:
                return(new SuperTransition(ownerDraw, splinePoints, startObject));

            default:
                throw new Exception("Invalid Transition type.");
            }
        }
Beispiel #7
0
        public static State Create(ObjectType objectType, DrawableCollection ownerDraw, Rectangle startRect)
        {
            switch (objectType)
            {
            case ObjectType.SimpleState:
                return(new SimpleState(ownerDraw, startRect));

            case ObjectType.StateAlias:
                return(new StateAlias(ownerDraw, startRect));

            case ObjectType.SuperState:
                return(new SuperState(ownerDraw, startRect));

            case ObjectType.Nested:
                return(new Nested(ownerDraw, startRect));

            default:
                throw new Exception("Invalid State type.");
            }
        }
Beispiel #8
0
        public static Link Create(ObjectType objectType, DrawableCollection ownerDraw, Point _location)
        {
            switch (objectType)
            {
            case ObjectType.Abort:
                return(new Abort(ownerDraw, _location));

            case ObjectType.Alias:
                return(new Alias(ownerDraw, _location));

            case ObjectType.End:
                return(new End(ownerDraw, _location));

            case ObjectType.Origin:
                return(new Origin(ownerDraw, _location));

            case ObjectType.Relation:
                return(new Relation(ownerDraw, _location));

            default:
                throw new Exception("Invalid State type.");
            }
        }
Beispiel #9
0
 public Text(DrawableCollection ownerDraw, Rectangle startRect)
     : base(ownerDraw)
 {
     rect = startRect;
 }
Beispiel #10
0
 public Origin(DrawableCollection ownerDraw, Point location)
     : base(ownerDraw, location)
 {
 }
Beispiel #11
0
 public Relation(DrawableCollection ownerDraw, Point location)
     : base(ownerDraw, location)
 {
     this.location = location;
 }
Beispiel #12
0
 public Abort(DrawableCollection ownerDraw, Point location)
     : base(ownerDraw, location)
 {
 }
 public VisualElectricSystem(IElectricSystem system)
 {
     _system = system;
     Drawables = new DrawableCollection();
 }
Beispiel #14
0
 public Nested(DrawableCollection ownerDraw, Rectangle startRect)
     : base(ownerDraw, startRect)
 {
     rect = startRect;
 }
Beispiel #15
0
 public Transition(DrawableCollection ownerDraw, string _name, string _description)
     : base(ownerDraw, _name, _description)
 {
     points  = new Point[4];
     maxDist = new double[2];
 }
Beispiel #16
0
 public StateAlias(DrawableCollection ownerDraw, Rectangle startRect)
     : base(ownerDraw, startRect)
 {
     rect = startRect;
 }
Beispiel #17
0
 public StateAlias(DrawableCollection ownerDraw, string _name, string _description)
     : base(ownerDraw, _name, _description)
 {
 }
Beispiel #18
0
 public SuperTransition(DrawableCollection ownerDraw, Point[] splinePoints, DrawableObject startObject)
     : base(ownerDraw, splinePoints, startObject)
 {
 }
Beispiel #19
0
 public SuperTransition(DrawableCollection ownerDraw, string _name, string _description)
     : base(ownerDraw, _name, _description)
 {
 }
Beispiel #20
0
 public Link(DrawableCollection ownerDraw, Point _location)
     : base(ownerDraw)
 {
     location = _location;
 }
Beispiel #21
0
 public Relation(DrawableCollection ownerDraw, string _name, string _description)
     : base(ownerDraw, _name, _description)
 {
 }
 public VisualElectricSystem(IElectricSystem system)
 {
     _system   = system;
     Drawables = new DrawableCollection();
 }