public void DeinitViews()
        {
            MainContainer.Children.Remove(bottomLayer);
            MainContainer.Children.Remove(linkingGestureLayer);
            MainContainer.Children.Remove(sortingGestureLayer);
            MainContainer.Children.Remove(groupingGestureLayer);
            MainContainer.Children.Remove(cardLayer);
            MainContainer.Children.Remove(gestureIndicatorLayer);
            MainContainer.Children.Remove(menuLayer);
            sortingGestureLayer   = null;
            groupingGestureLayer  = null;
            linkingGestureLayer   = null;
            bottomLayer           = null;
            gestureIndicatorLayer = null;
            menuLayer             = null;
            cardLayer             = null;
            if (STATICS.SCREEN_NUM == 2)
            {
                cloudWindow.Close();
            }

            Card_List.CardList.Clear();
            Gesture_List.GestureList.Clear();
            Group_List.CardGroups.Clear();
            Group_List.GroupBox.Clear();
            Link_List.CardLinks.Clear();
            Point_List.TouchPointList.Clear();
        }
        public Menu_Container(Menu_Layer menuLayer, String user)
        {
            this.User = user;
            recycleButton = new Menu_Recycle_Bin(this);
            ImageBrush ib = new ImageBrush();
            ib.ImageSource = new BitmapImage(new Uri(@"Resource\Image\menu_bg.png", UriKind.Relative));
            this.Background = ib;
            this.menuLayer = menuLayer;
            this.Height = STATICS.MENU_BAR_SIZE.Height;
            this.Width = STATICS.MENU_BAR_SIZE.Width;
            addBoxButton.Width = (this.Width - 200) / 3;
            addBoxButton.Height = (this.Height - 10);
            addBoxButton.Content = "Create Box";
            Canvas.SetLeft(addBoxButton, 50);
            Canvas.SetTop(addBoxButton, 5);
            this.Children.Add(addBoxButton);
            addBoxButton.Click += AddBoxButton_Click;

            RecycleButton.Width = (this.Width - 200) / 3;
            RecycleButton.Height = (this.Height - 10);
            Canvas.SetLeft(RecycleButton, 100 + addBoxButton.Width);
            Canvas.SetTop(RecycleButton, 5);
            this.Children.Add(RecycleButton);

            resetButton.Width = (this.Width - 200) / 3;
            resetButton.Height = (this.Height - 10);
            resetButton.Content = "Reset";
            resetButton.TouchDown += ResetButton_Pressed;
            resetButton.TouchUp += ResetButton_Released;
            Canvas.SetLeft(resetButton, 150 + addBoxButton.Width + RecycleButton.Width);
            Canvas.SetTop(resetButton, 5);
            this.Children.Add(resetButton);

            InitializeComponent();
        }
 public Menu_Sort_Box(Menu_Layer menuLayer, String owner, String id, String text, String textbrief)
 {
     InitializeComponent();
     ImageBrush brush = new ImageBrush();
     switch (owner)
     {
         case "Alex":
             brush.ImageSource = new BitmapImage(new Uri(fileInfo[0].FullName, UriKind.RelativeOrAbsolute));
             break;
         case "Ben":
             brush.ImageSource = new BitmapImage(new Uri(fileInfo[1].FullName, UriKind.RelativeOrAbsolute));
             break;
         case "Chris":
             brush.ImageSource = new BitmapImage(new Uri(fileInfo[2].FullName, UriKind.RelativeOrAbsolute));
             break;
         case "Danny":
             brush.ImageSource = new BitmapImage(new Uri(fileInfo[3].FullName, UriKind.RelativeOrAbsolute));
             break;
         default:
             brush.ImageSource = new BitmapImage(new Uri(fileInfo[4].FullName, UriKind.RelativeOrAbsolute));
             break;
     }
     //rect.Fill = brush;
     //this.owner = null;
     this.groupID = id;
     this.ButtonText1.Text = text;
     this.ButtonText2.Text = text;
     this.groupText = text;
     this.groupTextBrief = textbrief;
     this.menuLayer = menuLayer;
 }
 public Menu_Container(Menu_Layer menuLayer)
 {
     ImageBrush ib = new ImageBrush();
     ib.ImageSource = new BitmapImage(new Uri(@"Resource\Image\menu_bg.png", UriKind.Relative));
     this.Background = ib;
     this.menuLayer = menuLayer;
     this.Height = STATICS.MENU_BAR_SIZE.Height;
     this.Width = STATICS.MENU_BAR_SIZE.Width;
     InitializeComponent();
 }
 public void InitializeViews()
 {
     cardLayer             = new Card_Layer(this);
     menuLayer             = new Menu_Layer(this);
     gestureIndicatorLayer = new Gesture_Indicator_Layer();
     bottomLayer           = new Bottom_Layer();
     linkingGestureLayer   = new Linking_Gesture_Layer();
     groupingGestureLayer  = new Grouping_Gesture_Layer();
     sortingGestureLayer   = new Sorting_Gesture_Layer(this);
     if (STATICS.SCREEN_NUM == 2)
     {
         InitializeCloudView();
         cloudWindow.Visibility = Visibility.Visible;
     }
     MainContainer.Children.Add(bottomLayer);
     MainContainer.Children.Add(linkingGestureLayer);
     MainContainer.Children.Add(sortingGestureLayer);
     MainContainer.Children.Add(groupingGestureLayer);
     MainContainer.Children.Add(cardLayer);
     MainContainer.Children.Add(gestureIndicatorLayer);
     MainContainer.Children.Add(menuLayer);
 }
Beispiel #6
0
        public Menu_Container(Menu_Layer menuLayer, String user)
        {
            this.User     = user;
            recycleButton = new Menu_Recycle_Bin(this);
            ImageBrush ib = new ImageBrush();

            ib.ImageSource       = new BitmapImage(new Uri(@"Resource\Image\menu_bg.png", UriKind.Relative));
            this.Background      = ib;
            this.menuLayer       = menuLayer;
            this.Height          = STATICS.MENU_BAR_SIZE.Height;
            this.Width           = STATICS.MENU_BAR_SIZE.Width;
            addBoxButton.Width   = (this.Width - 200) / 3;
            addBoxButton.Height  = (this.Height - 10);
            addBoxButton.Content = "Create Box";
            Canvas.SetLeft(addBoxButton, 50);
            Canvas.SetTop(addBoxButton, 5);
            this.Children.Add(addBoxButton);
            addBoxButton.Click += AddBoxButton_Click;

            RecycleButton.Width  = (this.Width - 200) / 3;
            RecycleButton.Height = (this.Height - 10);
            Canvas.SetLeft(RecycleButton, 100 + addBoxButton.Width);
            Canvas.SetTop(RecycleButton, 5);
            this.Children.Add(RecycleButton);

            resetButton.Width      = (this.Width - 200) / 3;
            resetButton.Height     = (this.Height - 10);
            resetButton.Content    = "Reset";
            resetButton.TouchDown += ResetButton_Pressed;
            resetButton.TouchUp   += ResetButton_Released;
            Canvas.SetLeft(resetButton, 150 + addBoxButton.Width + RecycleButton.Width);
            Canvas.SetTop(resetButton, 5);
            this.Children.Add(resetButton);

            InitializeComponent();
        }
        public Menu_Sort_Box(Menu_Layer menuLayer, String owner, String id, String text, String textbrief)
        {
            InitializeComponent();
            ImageBrush brush = new ImageBrush();

            switch (owner)
            {
            case "Alex":
                brush.ImageSource = new BitmapImage(new Uri(fileInfo[0].FullName, UriKind.RelativeOrAbsolute));
                break;

            case "Ben":
                brush.ImageSource = new BitmapImage(new Uri(fileInfo[1].FullName, UriKind.RelativeOrAbsolute));
                break;

            case "Chris":
                brush.ImageSource = new BitmapImage(new Uri(fileInfo[2].FullName, UriKind.RelativeOrAbsolute));
                break;

            case "Danny":
                brush.ImageSource = new BitmapImage(new Uri(fileInfo[3].FullName, UriKind.RelativeOrAbsolute));
                break;

            default:
                brush.ImageSource = new BitmapImage(new Uri(fileInfo[4].FullName, UriKind.RelativeOrAbsolute));
                break;
            }
            //rect.Fill = brush;
            //this.owner = null;
            this.groupID          = id;
            this.ButtonText1.Text = text;
            this.ButtonText2.Text = text;
            this.groupText        = text;
            this.groupTextBrief   = textbrief;
            this.menuLayer        = menuLayer;
        }
 public void InitializeViews()
 {
     cardLayer = new Card_Layer(this);
     menuLayer = new Menu_Layer(this);
     gestureIndicatorLayer = new Gesture_Indicator_Layer();
     bottomLayer = new Bottom_Layer();
     linkingGestureLayer = new Linking_Gesture_Layer();
     groupingGestureLayer = new Grouping_Gesture_Layer();
     sortingGestureLayer = new Sorting_Gesture_Layer(this);
     if (STATICS.SCREEN_NUM == 2) {
         InitializeCloudView();
         cloudWindow.Visibility = Visibility.Visible;
     }
     MainContainer.Children.Add(bottomLayer);
     MainContainer.Children.Add(linkingGestureLayer);
     MainContainer.Children.Add(sortingGestureLayer);
     MainContainer.Children.Add(groupingGestureLayer);
     MainContainer.Children.Add(cardLayer);
     MainContainer.Children.Add(gestureIndicatorLayer);
     MainContainer.Children.Add(menuLayer);
 }
        public void DeinitViews()
        {
            MainContainer.Children.Remove(bottomLayer);
            MainContainer.Children.Remove(linkingGestureLayer);
            MainContainer.Children.Remove(sortingGestureLayer);
            MainContainer.Children.Remove(groupingGestureLayer);
            MainContainer.Children.Remove(cardLayer);
            MainContainer.Children.Remove(gestureIndicatorLayer);
            MainContainer.Children.Remove(menuLayer);
            sortingGestureLayer = null;
            groupingGestureLayer = null;
            linkingGestureLayer = null;
            bottomLayer = null;
            gestureIndicatorLayer = null;
            menuLayer = null;
            cardLayer = null;
            if (STATICS.SCREEN_NUM == 2)
                cloudWindow.Close();

            Card_List.CardList.Clear();
            Gesture_List.GestureList.Clear();
            Group_List.CardGroups.Clear();
            Group_List.GroupBox.Clear();
            Link_List.CardLinks.Clear();
            Point_List.TouchPointList.Clear();
        }
        public void InitializeControlers()
        {
            STATICS.USER_COLOR["Alex"] = Color.FromArgb(255, 255, 102, 0);
            STATICS.USER_COLOR["Ben"] = Color.FromArgb(255, 0, 255, 0);
            STATICS.USER_COLOR["Chris"] = Color.FromArgb(255, 255, 255, 255);
            STATICS.USER_COLOR["Danny"] = Color.FromArgb(255, 128, 0, 128);

            userControler = new User_Controler(this);
            cardLayer = new Card_Layer(this);
            cardControler = new Card_Controler(this);
            cardControler.LoadCardLayout(layoutFile);
            touchControler = new Touch_Controler(this);
            menuLayer = new Menu_Layer(this);
            iconControler = new Sorting_Icon_Controler(this);
            iconControler.InitializeSortButton();
            gestureIndicatorLayer = new Gesture_Indicator_Layer();
            bottomLayer = new Bottom_Layer();

            linkingGestureLayer = new Linking_Gesture_Layer();
            groupingGestureLayer = new Grouping_Gesture_Layer();
            gestureControler = new Gesture_Controler(this);
            gestureControler.start();
            //For Lab
            //jointInterestControler = new Joint_Interest_Controler(this);//test
            //jointInterestControler.Start();
            sortingGestureLayer = new Sorting_Gesture_Layer(this);

            MainContainer.Children.Add(bottomLayer);
            MainContainer.Children.Add(linkingGestureLayer);
            MainContainer.Children.Add(sortingGestureLayer);
            MainContainer.Children.Add(groupingGestureLayer);
            MainContainer.Children.Add(cardLayer);
            MainContainer.Children.Add(gestureIndicatorLayer);
            MainContainer.Children.Add(menuLayer);
        }
        public void DeinitControlers()
        {
            MainContainer.Children.Remove(bottomLayer);
            MainContainer.Children.Remove(linkingGestureLayer);
            MainContainer.Children.Remove(sortingGestureLayer);
            MainContainer.Children.Remove(groupingGestureLayer);
            MainContainer.Children.Remove(cardLayer);
            MainContainer.Children.Remove(gestureIndicatorLayer);
            MainContainer.Children.Remove(menuLayer);
            sortingGestureLayer = null;
            gestureControler.quit();
            gestureControler = null;
            groupingGestureLayer = null;
            linkingGestureLayer = null;
            bottomLayer = null;
            gestureIndicatorLayer = null;
            iconControler = null;
            menuLayer = null;
            touchControler = null;
            cardControler = null;
            cardLayer = null;
            userControler.UserList.Clear();
            userControler = null;

            Card_List.CardList.Clear();
            Gesture_List.GestureList.Clear();
            Group_List.CardGroups.Clear();
            Group_List.GroupButtons.Clear();
            Link_List.CardLinks.Clear();
            Point_List.TouchPointList.Clear();
        }