Exemplo n.º 1
0
 public ToolBox(ISubGraphViewerDrawer drawer)
 {
     m_Drawer = drawer;
     m_ToolItemList = new List<ToolItem>();
     m_Name2ToolItemDic = new Dictionary<string, ToolItem>();
     LoadResouces();
 }
        public ViewerResultGraph(int id, ISubGraphViewerDrawer drawer, Point leftTop, ViewerQueryGraph vqg, Match m)
        {
            m_AllNodes = new Dictionary<int, ViewerResultNode>();
            m_ID = id;
            m_Drawer = drawer;
            m_Region = new Rectangle(leftTop, new Size(vqg.Region.Width, vqg.Region.Height));

            Construct(vqg, m);
            Transfer(leftTop, vqg);
            GetAllEdges();
        }
 private void ConstructAllResultGraph(ISubGraphViewerDrawer drawer, List<Match> matches, ViewerQueryGraph vqg)
 {
     int width = ViewerConfig.QueryResultWidth;
     int margin = ViewerConfig.QueryResultMargin;
     Rectangle queryRegion = vqg.Region;
     int col = (width - margin) / (queryRegion.Width + margin);
     int count = matches.Count;
     int row = count / col;
     int index = 0;
     Point rowStartLocation = new Point();
     for (int i = 0; i < row; ++i)
     {
         rowStartLocation.X = margin;
         rowStartLocation.Y = margin + i * (queryRegion.Height + margin);
         for (int j = 0; j < col; ++j)
         {
             Point myLocation = new Point();
             myLocation.X = rowStartLocation.X + j * (queryRegion.Width + margin);
             myLocation.Y = rowStartLocation.Y;
             ViewerResultGraph vrg = new ViewerResultGraph(index, drawer, myLocation, vqg, matches[index]);
             index += 1;
             m_AllResultGraph.Add(vrg);
         }
     }
     //last row
     rowStartLocation.X = margin;
     rowStartLocation.Y = margin + row * (queryRegion.Height + margin);
     int left = count % col;
     for (int j = 0; j < left; ++j)
     {
         Point myLocation = new Point();
         myLocation.X = rowStartLocation.X + j * (queryRegion.Width + margin);
         myLocation.Y = rowStartLocation.Y;
         ViewerResultGraph vrg = new ViewerResultGraph(index, drawer, myLocation, vqg, matches[index]);
         index += 1;
         m_AllResultGraph.Add(vrg);
     }
 }
Exemplo n.º 4
0
 public void Draw(ISubGraphViewerDrawer drawer)
 {
     if (m_Selected == false)
     {
         drawer.DrawImage(ImageResources.GetImageByName(m_Name), m_Location);
     }
     else
     {
         drawer.DrawImage(ImageResources.GetImageByName(m_Name + "_selected"), m_Location);
     }
 }
 public ViewerResult(ISubGraphViewerDrawer drawer, List<Match> matches, ViewerQueryGraph vqg)
 {
     m_AllResultGraph = new List<ViewerResultGraph>();
     ConstructAllResultGraph(drawer, matches, vqg);
 }
 public void Draw(ISubGraphViewerDrawer drawer, Image icon)
 {
     Point location = new Point();
     location.X = Center.X - (int)ViewerConfig.NodeRadius;
     location.Y = Center.Y - (int)ViewerConfig.NodeRadius;
     drawer.DrawImage(icon, location);
     Point labelLocation = new Point();
     labelLocation.X = Center.X - (int)ViewerConfig.NodeRadius / 2;
     labelLocation.Y = Center.Y - (int)ViewerConfig.NodeRadius / 2;
     drawer.DrawString(m_ID.ToString(), labelLocation);
     //drawer.DrawEcllipse(location, 32, 32);
 }
 public void Draw(ISubGraphViewerDrawer drawer)
 {
     drawer.DrawArrow(StartLocation, EndLocation);
 }
 public ViewerQueryGraph(ISubGraphViewerDrawer drawer)
 {
     m_Drawer = drawer;
     m_AllNodes = new Dictionary<int, ViewerQueryNode>();
     m_Transfer = new ViewerGraphToLogicQueryTransfer(this);
     m_Region = new Rectangle(-1, -1, 0, 0);
 }