Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/04/12 16:45:02 (13 years ago)
Author:
spimming
Message:

#1680:

  • merged changes from trunk into branch
Location:
branches/HeuristicLab.Hive.Azure
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive.Azure

  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/GraphVisualizationInfoView.Designer.cs

    r6036 r7270  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/GraphVisualizationInfoView.cs

    r6036 r7270  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/OperatorGraphView.Designer.cs

    r6036 r7270  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/OperatorGraphView.cs

    r6036 r7270  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/OperatorShape.cs

    r6036 r7270  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    7979    }
    8080
     81    public string Subtitle { get; set; }
     82
    8183    private IconMaterial iconMaterial;
    8284    public Bitmap Icon {
     
    216218      g.SmoothingMode = SmoothingMode.HighQuality;
    217219
    218       Pen pen = new Pen(lineColor, lineWidth);
    219 
    220       SizeF titleSize = g.MeasureString(this.Title, ArtPalette.DefaultBoldFont, Rectangle.Width - 45);
    221       if (titleSize.Height + 10 > Rectangle.Height) {
    222         headerHeight = (int)titleSize.Height + 10;
    223         this.UpdateLabels();
    224       }
    225 
    226       GraphicsPath path = new GraphicsPath();
    227       path.AddArc(Rectangle.X, Rectangle.Y, 20, 20, -180, 90);
    228       path.AddLine(Rectangle.X + 10, Rectangle.Y, Rectangle.X + Rectangle.Width - 10, Rectangle.Y);
    229       path.AddArc(Rectangle.X + Rectangle.Width - 20, Rectangle.Y, 20, 20, -90, 90);
    230       path.AddLine(Rectangle.X + Rectangle.Width, Rectangle.Y + 10, Rectangle.X + Rectangle.Width, Rectangle.Y + Rectangle.Height - 10);
    231       path.AddArc(Rectangle.X + Rectangle.Width - 20, Rectangle.Y + Rectangle.Height - 20, 20, 20, 0, 90);
    232       path.AddLine(Rectangle.X + Rectangle.Width - 10, Rectangle.Y + Rectangle.Height, Rectangle.X + 10, Rectangle.Y + Rectangle.Height);
    233       path.AddArc(Rectangle.X, Rectangle.Y + Rectangle.Height - 20, 20, 20, 90, 90);
    234       path.AddLine(Rectangle.X, Rectangle.Y + Rectangle.Height - 10, Rectangle.X, Rectangle.Y + 10);
    235       //shadow
    236       if (ArtPalette.EnableShadows) {
    237         Region darkRegion = new Region(path);
    238         darkRegion.Translate(5, 5);
    239         g.FillRegion(ArtPalette.ShadowBrush, darkRegion);
    240       }
    241       //background
    242       g.FillPath(Brush, path);
    243 
    244       using (LinearGradientBrush gradientBrush = new LinearGradientBrush(Rectangle.Location, new Point(Rectangle.X + Rectangle.Width, Rectangle.Y), this.Color, Color.White)) {
    245         Region gradientRegion = new Region(path);
    246         g.FillRegion(gradientBrush, gradientRegion);
    247       }
    248 
    249       if (!this.Collapsed) {
    250         TextStyle textStyle = new TextStyle(Color.Black, new Font("Arial", 7), StringAlignment.Near, StringAlignment.Near);
    251         StringFormat stringFormat = textStyle.StringFormat;
    252         stringFormat.Trimming = StringTrimming.EllipsisWord;
    253         stringFormat.FormatFlags = StringFormatFlags.LineLimit;
    254         Rectangle rect;
    255 
    256         for (int i = 0; i < this.labels.Count; i++) {
    257           rect = new Rectangle(Rectangle.X + 25, Rectangle.Y + headerHeight + i * (LABEL_HEIGHT + LABEL_SPACING), LABEL_WIDTH, LABEL_HEIGHT);
    258           g.DrawString(textStyle.GetFormattedText(this.labels[i]), textStyle.Font, textStyle.GetBrush(), rect, stringFormat);
    259         }
    260       }
    261 
    262       //the border
    263       g.DrawPath(pen, path);
    264 
    265       //the title
    266       g.DrawString(this.Title, ArtPalette.DefaultBoldFont, Brushes.Black, new Rectangle(Rectangle.X + 25, Rectangle.Y + 5, Rectangle.Width - 45, Rectangle.Height - 5));
    267 
    268 
    269       //the material
    270       foreach (IPaintable material in Children)
    271         material.Paint(g);
    272 
    273       //the connectors
    274       if (this.ShowConnectors) {
    275         for (int k = 0; k < Connectors.Count; k++)
    276           Connectors[k].Paint(g);
     220      using (Pen pen = new Pen(lineColor, lineWidth)) {
     221
     222        SizeF titleSize = g.MeasureString(this.Title, ArtPalette.DefaultBoldFont, Rectangle.Width - 45);
     223        titleSize.Height += 10; //add spacing
     224        SizeF subtitleSize = g.MeasureString(this.Subtitle, ArtPalette.DefaultFont, Rectangle.Width - 45);
     225        subtitleSize.Height += 5; //add spacing
     226        if (this.Title == this.Subtitle || string.IsNullOrEmpty(this.Subtitle)) subtitleSize = new SizeF(0, 0);
     227
     228        if ((int)titleSize.Height + (int)subtitleSize.Height != Rectangle.Height) {
     229          headerHeight = (int)titleSize.Height + (int)subtitleSize.Height;
     230          this.UpdateLabels();
     231        }
     232
     233        GraphicsPath path = new GraphicsPath();
     234        path.AddArc(Rectangle.X, Rectangle.Y, 20, 20, -180, 90);
     235        path.AddLine(Rectangle.X + 10, Rectangle.Y, Rectangle.X + Rectangle.Width - 10, Rectangle.Y);
     236        path.AddArc(Rectangle.X + Rectangle.Width - 20, Rectangle.Y, 20, 20, -90, 90);
     237        path.AddLine(Rectangle.X + Rectangle.Width, Rectangle.Y + 10, Rectangle.X + Rectangle.Width, Rectangle.Y + Rectangle.Height - 10);
     238        path.AddArc(Rectangle.X + Rectangle.Width - 20, Rectangle.Y + Rectangle.Height - 20, 20, 20, 0, 90);
     239        path.AddLine(Rectangle.X + Rectangle.Width - 10, Rectangle.Y + Rectangle.Height, Rectangle.X + 10, Rectangle.Y + Rectangle.Height);
     240        path.AddArc(Rectangle.X, Rectangle.Y + Rectangle.Height - 20, 20, 20, 90, 90);
     241        path.AddLine(Rectangle.X, Rectangle.Y + Rectangle.Height - 10, Rectangle.X, Rectangle.Y + 10);
     242        //shadow
     243        if (ArtPalette.EnableShadows) {
     244          Region darkRegion = new Region(path);
     245          darkRegion.Translate(5, 5);
     246          g.FillRegion(ArtPalette.ShadowBrush, darkRegion);
     247        }
     248        //background
     249        g.FillPath(Brush, path);
     250
     251        using (LinearGradientBrush gradientBrush = new LinearGradientBrush(Rectangle.Location, new Point(Rectangle.X + Rectangle.Width, Rectangle.Y), this.Color, Color.White)) {
     252          Region gradientRegion = new Region(path);
     253          g.FillRegion(gradientBrush, gradientRegion);
     254        }
     255
     256        if (!this.Collapsed) {
     257          TextStyle textStyle = new TextStyle(Color.Black, new Font("Arial", 7), StringAlignment.Near, StringAlignment.Near);
     258          StringFormat stringFormat = textStyle.StringFormat;
     259          stringFormat.Trimming = StringTrimming.EllipsisWord;
     260          stringFormat.FormatFlags = StringFormatFlags.LineLimit;
     261          Rectangle rect;
     262
     263          const int verticalHeaderSpacing = 5;
     264          Point separationLineStart = new Point(Rectangle.X + 25, Rectangle.Y + headerHeight - verticalHeaderSpacing);
     265          Point separationLineEnd = new Point(Rectangle.X + Rectangle.Width - 25, Rectangle.Y + headerHeight - verticalHeaderSpacing);
     266          using (LinearGradientBrush brush = new LinearGradientBrush(separationLineStart, separationLineEnd, Color.Black, Color.White)) {
     267            using (Pen separationLinePen = new Pen(brush)) {
     268              g.DrawLine(separationLinePen, separationLineStart, separationLineEnd);
     269            }
     270          }
     271
     272
     273          for (int i = 0; i < this.labels.Count; i++) {
     274            rect = new Rectangle(Rectangle.X + 25, Rectangle.Y + headerHeight + i * (LABEL_HEIGHT + LABEL_SPACING), LABEL_WIDTH, LABEL_HEIGHT);
     275            g.DrawString(textStyle.GetFormattedText(this.labels[i]), textStyle.Font, textStyle.GetBrush(), rect, stringFormat);
     276          }
     277        }
     278
     279        //the border
     280        g.DrawPath(pen, path);
     281
     282        //the title
     283        g.DrawString(this.Title, ArtPalette.DefaultBoldFont, Brushes.Black,
     284                     new Rectangle(Rectangle.X + 25, Rectangle.Y + 5,
     285                                   Rectangle.Width - 45, Rectangle.Height - 5 - (int)subtitleSize.Height));
     286
     287        //the subtitle
     288        if (this.Title != this.Subtitle || string.IsNullOrEmpty(this.Subtitle)) {
     289          g.DrawString(this.Subtitle, ArtPalette.DefaultFont, Brushes.Black,
     290                       new Rectangle(Rectangle.X + 25, Rectangle.Y + (int)titleSize.Height -5 ,
     291                                     Rectangle.Width - 45, Rectangle.Height - 5));
     292        }
     293
     294
     295        //the material
     296        foreach (IShapeMaterial material in Children)
     297          material.Paint(g);
     298
     299        //the connectors
     300        if (this.ShowConnectors) {
     301          foreach (IConnector t in Connectors)
     302            t.Paint(g);
     303        }
    277304      }
    278305    }
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/Plugin.cs.frame

    r6548 r7270  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2323
    2424namespace HeuristicLab.Operators.Views.GraphVisualization.Views {
    25   [Plugin("HeuristicLab.Operators.Views.GraphVisualization.Views-3.3", "3.3.5.$WCREV$")]
     25  [Plugin("HeuristicLab.Operators.Views.GraphVisualization.Views-3.3", "3.3.6.$WCREV$")]
    2626  [PluginFile("HeuristicLab.Operators.Views.GraphVisualization.Views-3.3.dll", PluginFileType.Assembly)]
    2727  [PluginDependency("HeuristicLab.Collections", "3.3")]
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/Properties/AssemblyInfo.cs.frame

    r6866 r7270  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3232[assembly: AssemblyCompany("HEAL")]
    3333[assembly: AssemblyProduct("HeuristicLab")]
    34 [assembly: AssemblyCopyright("(c) 2002-2011 HEAL")]
     34[assembly: AssemblyCopyright("(c) 2002-2012 HEAL")]
    3535[assembly: AssemblyTrademark("")]
    3636[assembly: AssemblyCulture("")]
     
    5555// [assembly: AssemblyVersion("1.0.*")]
    5656[assembly: AssemblyVersion("3.3.0.0")]
    57 [assembly: AssemblyFileVersion("3.3.5.$WCREV$")]
     57[assembly: AssemblyFileVersion("3.3.6.$WCREV$")]
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/ShapeInfoExtensions.cs

    r6036 r7270  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    5050      shape.Location = shapeInfo.Location;
    5151      shape.Title = shapeInfo.Title;
     52      shape.Subtitle = shapeInfo.TypeName;
    5253      shape.Color = shapeInfo.Color;
    5354      shape.LineColor = shapeInfo.LineColor;
     
    6566    public static void UpdateShape(IOperatorShapeInfo operatorShapeInfo, OperatorShape operatorShape) {
    6667      operatorShape.Title = operatorShapeInfo.Title;
     68      operatorShape.Subtitle = operatorShapeInfo.TypeName;
    6769      operatorShape.Color = operatorShapeInfo.Color;
    6870      operatorShape.LineColor = operatorShapeInfo.LineColor;
     
    105107    public static void UpdateShapeInfo(IOperatorShapeInfo operatorShapeInfo, OperatorShape operatorShape) {
    106108      operatorShapeInfo.Title = operatorShape.Title;
     109      operatorShapeInfo.TypeName = operatorShape.Subtitle;
    107110      operatorShapeInfo.Color = operatorShape.Color;
    108111      operatorShapeInfo.LineColor = operatorShape.LineColor;
Note: See TracChangeset for help on using the changeset viewer.