コード例 #1
0
ファイル: Package_.cs プロジェクト: asish-aryal/KSE
 public void add_child(Package_ package)
 {
     package.Parent = this;
     children_packages.Add(package);
 }
コード例 #2
0
ファイル: ViewManager.cs プロジェクト: asish-aryal/KSE
 private String get_package_heirarchy(Package_ package)
 {
     if (package.Parent != null)
     { return get_package_heirarchy(package.Parent) + " > " + package.Name; }
     else
     { return package.Name; }
 }
コード例 #3
0
ファイル: ViewManager.cs プロジェクト: asish-aryal/KSE
 public void zoom_out(double factor)
 {
     if (!doc_loaded)
     { return; }
     int proposed_zoom = (int)((double)current_item_width / factor);
     if ((current_item_width == min_zoom) && (current_package.Parent != null))
     {
         Package_ pkg;
         for (int i = 0; i < current_package.Parent.Children_Packages.Count; i++)
         {
             pkg = current_package.Parent.Children_Packages[i];
             if (pkg.Equals(current_package))
             {
                 item_location_manager.SELECTED_ITEM = i + 1;
                 break;
             }
         }
         current_package = current_package.Parent;
         if (max_zoom_width * aspect_ratio > max_zoom_height)
         {
             current_item_width = (int)((double)max_zoom_height / aspect_ratio);
         }
         else
         {
             current_item_width = max_zoom_width;
         }
         repaint();
     }
     else if (proposed_zoom > min_zoom)
     {
         current_item_width = proposed_zoom;
         repaint();
     }
     else if (proposed_zoom <= min_zoom)
     {
         current_item_width = min_zoom;
         repaint();
     }
 }
コード例 #4
0
ファイル: ViewManager.cs プロジェクト: asish-aryal/KSE
        public void zoom_in(double factor)
        {
            if (!doc_loaded)
            { return; }
            int proposed_zoom = (int)((double)current_item_width * factor);
            if ((proposed_zoom <= max_zoom_width) && (proposed_zoom * aspect_ratio <= max_zoom_height))
            {
                current_item_width = proposed_zoom;

                repaint();
            }
            else if ((proposed_zoom > max_zoom_width) && (proposed_zoom * aspect_ratio <= max_zoom_height) && (isClassifier(item_location_manager.SELECTED_ITEM)))
            {
                current_item_width = max_zoom_width;
                repaint();
            }
            else if ((proposed_zoom <= max_zoom_width) && (proposed_zoom * aspect_ratio > max_zoom_height) && (isClassifier(item_location_manager.SELECTED_ITEM)))
            {
                current_item_width = (int)((max_zoom_height) / aspect_ratio);
                repaint();
            }

            else if ((item_location_manager.ITEMS_PER_PAGE == 1) && (isPackage(item_location_manager.SELECTED_ITEM)))
            {
                current_package = current_package.Children_Packages[item_location_manager.CURRENT_PAGE - 1];
                current_item_width = min_zoom;
                repaint();
            }
        }
コード例 #5
0
ファイル: ViewManager.cs プロジェクト: asish-aryal/KSE
        public void load_root_package()
        {
            Package_ temp = null;
            if (browse_dialogue_displayed == false)
            {
                browse_dialogue_displayed = true;
                temp = controller.get_package();
                browse_dialogue_displayed = false;
            }
            if (temp != null)
            {
                root = temp;
                current_package = root;
                doc_loaded = true;
                current_item_width = min_zoom;
                repaint();

            }
        }
コード例 #6
0
ファイル: File_handler.cs プロジェクト: asish-aryal/KSE
 private Package_ traverse_nodes(XmlNodeList nodes, String node_name)
 {
     //node.Attributes.Item(0).Name
     Package_ package = new Package_(node_name);
     foreach (XmlNode node in nodes)
     {
         if (node.Name.ToUpper() == "PACKAGE")
         {
             package.add_child(traverse_nodes(node.ChildNodes, node.Attributes["name"].Value));
         }
         else if((node.Name.ToUpper() == "CLASS") || (node.Name.ToUpper() == "INTERFACE"))
         {
             package.add_child(get_classifier_info(node));
             //package.add_child(new Class_(node.Attributes["name"].Value));
         }
     }
     return package;
 }