示例#1
0
        // registers connection in StaticView structures:
        public void ConnectionCreated(StaticView parent_view, string role1, string role2, string name, string stereo)
        {
            //  1. register connection ipoints in objects
            first.item.add_connection_point(first);
            second.item.add_connection_point(second);
            //  2. create ID for connection
            id = parent_view.RegisterItemID(type.ToString(), this);
            //  3. create default roles
            first.role  = create_label(role1 != null ? role1 : "Left", -1, 0f, first.hyphen_dir, 0, role1 == null);
            second.role = create_label(role2 != null ? role2 : "Right", -second.number_in_conn - 1, 0f, second.hyphen_dir, 0, role2 == null);
            conn_name   = create_label(name != null ? name : "Name", Int32.MaxValue, 0f, Geometry.Direction.Null, 0, name == null);
            conn_stereo = new GuiBoundStereotype(stereo != null ? stereo : "Usage", this, 0, -15, Int32.MaxValue, 0f, stereo == null);
            //  4. register children, make them drawable and serializable
            add_child(first, "LeftPoint");
            add_child(second, "RightPoint");
            add_child(first.role, "Role 1");
            add_child(second.role, "Role 2");
            add_child(conn_name, "Name");
            add_child(conn_stereo, "Stereotype");

            for (int i = 1; i < ipoints.Count - 1; i++)
            {
                add_child(ipoints[i] as GuiBound, null);
            }

            //  5. Redraw
            created = true;
            invalidate_children();
            Invalidate();
        }
示例#2
0
 public static GuiMemo CreateMemo( StaticView parent, int x, int y )
 {
     GuiMemo m = new GuiMemo();
     m.X = x;
     m.Y = y;
     parent.AddObject( m, "memo" );
     return m;
 }
示例#3
0
 public static GuiClass CreateClass( StaticView parent, int x, int y, UmlClass cl )
 {
     GuiClass c = GuiClass.fromUML(cl);
     c.X = x;
     c.Y = y;
     parent.AddObject( c, UmlModel.GetUniversal(cl) );
     return c;
 }
示例#4
0
        public static GuiMemo CreateMemo(StaticView parent, int x, int y)
        {
            GuiMemo m = new GuiMemo();

            m.X = x;
            m.Y = y;
            parent.AddObject(m, "memo");
            return(m);
        }
示例#5
0
        public static GuiClass CreateClass(StaticView parent, int x, int y, UmlClass cl)
        {
            GuiClass c = GuiClass.fromUML(cl);

            c.X = x;
            c.Y = y;
            parent.AddObject(c, UmlModel.GetUniversal(cl));
            return(c);
        }
示例#6
0
 public GUI.View newStaticView()
 {
     GUI.StaticView d = new GUI.StaticView();
     SelectNameFor(d);
     diagrams.Add(d);
     d.proj = this;
     container.SolutionTree.RefreshDiagrams();
     return(d);
 }
 public StaticViewMouseAgent( StaticView p )
 {
     parent = p;
     dropitem = null;
     action = MouseAction.None;
     scroll_active = false;
     scroll_dx = scroll_dy = 0;
     scroll_buttons = MouseButtons.None;
     scroll_timer = new System.Threading.Timer( new TimerCallback( ScrollTimerCallback ), null, Timeout.Infinite, SCROLL_TIMEOUT );
 }
 public StaticViewMouseAgent(StaticView p)
 {
     parent         = p;
     dropitem       = null;
     action         = MouseAction.None;
     scroll_active  = false;
     scroll_dx      = scroll_dy = 0;
     scroll_buttons = MouseButtons.None;
     scroll_timer   = new System.Threading.Timer(new TimerCallback(ScrollTimerCallback), null, Timeout.Infinite, SCROLL_TIMEOUT);
 }
示例#9
0
 public static GuiPackage CreatePackage( StaticView parent, int x, int y )
 {
     GuiPackage m = new GuiPackage();
     m.name = "Package1";
     m.source_dependant = false;
     m.X = x;
     m.Y = y;
     m.Created();
     parent.AddObject( m, "package" );
     return m;
 }
示例#10
0
        public static GuiPackage CreatePackage(StaticView parent, int x, int y)
        {
            GuiPackage m = new GuiPackage();

            m.name             = "Package1";
            m.source_dependant = false;
            m.X = x;
            m.Y = y;
            m.Created();
            parent.AddObject(m, "package");
            return(m);
        }
示例#11
0
 public GuiConnection(GuiConnectionPoint p1, GuiConnectionPoint p2, UmlRelationType t, StaticView par, GuiConnectionStyle style)
 {
     first      = p1;
     second     = p2;
     type       = t;
     parent     = par;
     this.style = style;
     nav        = GuiConnectionNavigation.None;
     p1.parent  = p2.parent = par;
     p1.root    = p2.root = this;
     ipoints.Add(p1);
     ipoints.Add(p2);
 }
示例#12
0
 public StereoTypeHelper( IHasStereotype obj )
 {
     this.obj = obj;
     this.parent = ((GuiObject)obj).parent;
 }
示例#13
0
 public GUI.View newStaticView()
 {
     GUI.StaticView d = new GUI.StaticView();
     SelectNameFor( d );
     diagrams.Add( d );
     d.proj = this;
     container.SolutionTree.RefreshDiagrams();
     return d;
 }
示例#14
0
 public WrappedElement(StaticView view, GuiActive active)
 {
     this.view   = view;
     this.active = active;
 }
示例#15
0
 public StereoTypeHelper(IHasStereotype obj)
 {
     this.obj    = obj;
     this.parent = ((GuiObject)obj).parent;
 }
示例#16
0
 public WrappedElement( StaticView view, GuiActive active )
 {
     this.view = view;
     this.active = active;
 }