Пример #1
0
 protected GObject(GType type)
 {
     id = type.Lib.GenerateId(this, ref updateAttr);
     if (type.GeomType != GeomType)
     {
         throw new Exception("GeomType mismatch.");
     }
 }
Пример #2
0
 internal GRange(Context context, GType type, IDataReader dr)
 {
     id        = dr.GetInt32((int)RangeField.Id);
     bounds    = context.Buf.GetRect(dr, (int)RangeField.Code);
     this.type = type;
     type.Add(this);
     Lib.Register(this);
 }
Пример #3
0
 internal GRange(GType type, Rect bounds)
 {
     id          = type.Lib.GenerateId(this, ref updateAttr);
     this.type   = type;
     this.bounds = bounds;
     type.Add(this);
     Lib.Register(this);
 }
Пример #4
0
        internal GRange(Context context, IDataReader dr)
        {
            id = dr.GetInt32((int)RangeField.Id);
            int typeId = dr.GetInt32((int)RangeField.TypeId);

            bounds = context.Buf.GetRect(dr, (int)RangeField.Code);
            type   = context.Lib.GetType(typeId);
            type.Add(this);
            Lib.Register(this);
        }
Пример #5
0
 public GPolyline(GType type, Point[] points) : base(type)
 {
     if (points.Length < 2)
     {
         throw new GmException("Polyline should have 2 points at least.");
     }
     this.points = points;
     bounds.Init(points);
     range = type.GetRangeStrong(this);
     range.Add(this);
 }
Пример #6
0
 internal void Add(GType type)
 {
     if (types == null)
     {
         types = new List <GType>();
     }
     types.Add(type); if (this is GType)
     {
         ((GType)this).UpdateBounds(type.Bounds);
     }
 }
Пример #7
0
 public GType(GType parent)
 {
     lib           = parent.Lib;
     id            = lib.GenerateId(this, ref updateAttr);
     parentId      = parent.Id;
     priority      = parent.LastPriority;
     this.geomType = parent.geomType;
     this.parent   = parent;
     parent.Add(this);
     lib.Register(this);
 }
Пример #8
0
        internal GRange(Context context, BinaryReader br)
        {
            id = br.ReadInt32();
//			context.Lib.UpdateGen(this);
            int typeId = br.ReadInt32();

            bounds = context.Buf.ReadRect(br);
            type   = context.Lib.GetType(typeId);
            type.Add(this);
            Lib.Register(this);
        }
Пример #9
0
 public static void Search(GLib lib, string text, int typeId, ArrayList ar)
 {
     text = text.ToLower();
     if (typeId == 0)
     {
         foreach (GType type in lib.Types)
         {
             Search(type, text, ar);
         }
     }
     else
     {
         GType type = lib.GetType(typeId);
         if (type != null)
         {
             Search(type, text, ar);
         }
     }
 }
Пример #10
0
        internal GType(Context context, BinaryReader br)
        {
            this.lib = context.Lib;
            id       = br.ReadInt32();
//			lib.UpdateGen(this);
            parentId = br.ReadInt32();
            priority = br.ReadInt32();
            attr     = br.ReadInt32();
            name     = br.ReadString();
            context.SetStyle(br.ReadString(), ref styleStr, ref style);
            geomType = (GeomType)br.ReadInt32();
            smin     = br.ReadInt32();
            smax     = br.ReadInt32();
            if (parentId != 0)
            {
                parent = lib.GetType(parentId);
            }
            this.ParentComposite.Add(this);
            lib.Register(this);
        }
Пример #11
0
        public void Move(GComposite comp)
        {
            if (comp is GType && ((GType)comp).GeomType != this.geomType)
            {
                throw new Exception("GeomType mismatch.");
            }
            int parentId0 = parentId;
            int priority0 = priority;

            ParentComposite.Remove(this);
            parent   = comp is GLib ? null : (GType)comp;
            parentId = parent != null ? parent.Id : 0;
            priority = ParentComposite.LastPriority;
            ParentComposite.Add(this);
            if (parentId != parentId0)
            {
                UpdateAttr((int)TypeField.ParentId);
            }
            if (priority != priority0)
            {
                UpdateAttr((int)TypeField.Priority);
            }
            lib.SetChanged();
        }
Пример #12
0
 internal void Unregister(GType type)
 {
     allTypes.Remove(type.Id); SetChanged(); SetStateAttr(LibStateAttr.AllObjectsLoaded, false);
 }
Пример #13
0
 public GPoint(GType type, Point point) : base(type)
 {
     this.point = point;
     range      = type.GetRangeStrong(this);
     range.Add(this);
 }
Пример #14
0
 internal void SetParent(GType parent)
 {
     this.parent = parent;
     ParentComposite.Add(this);
 }