protected override void ComputeNextPosition(RowOrientation orientation, ref double xPos, ref double yPos, double width, double height)
 {
     if (orientation == RowOrientation.Horizontal)
         yPos += height;
     else
         xPos += width;
 }
 protected override Rect GetRectangle(RowOrientation orientation, TreeMapItem item, double x, double y, double width, double height)
 {
     if (orientation == RowOrientation.Horizontal)
         return new Rect(x, y, width, item.RealArea / width);
     else
         return new Rect(x, y, item.RealArea / height, height);
 }
Ejemplo n.º 3
0
 protected virtual void ComputeNextPosition(RowOrientation orientation, ref double xPos, ref double yPos, double width, double height)
 {
     if (orientation == RowOrientation.Horizontal)
         xPos += width;
     else
         yPos += height;
 }
Ejemplo n.º 4
0
 protected virtual void ComputeNextPosition(RowOrientation orientation, ref double xPos, ref double yPos, double width, double height)
 {
     if (orientation == RowOrientation.Horizontal)
     {
         xPos += width;
     }
     else
     {
         yPos += height;
     }
 }
Ejemplo n.º 5
0
 protected virtual Rect GetRectangle(RowOrientation orientation, WeightUIElement item, double x, double y, double width, double height)
 {
     if (orientation == RowOrientation.Horizontal)
     {
         return(new Rect(x, y, item.RealArea / height, height));
     }
     else
     {
         return(new Rect(x, y, width, item.RealArea / width));
     }
 }
Ejemplo n.º 6
0
        public static RowOrientation GetRowOrientation(string value)
        {
            RowOrientation rowOrientation = RowOrientation.Unknown;

            if (value.Equals("North"))
            {
                rowOrientation = RowOrientation.North;
            }
            else if (value.Equals("South"))
            {
                rowOrientation = RowOrientation.South;
            }

            return(rowOrientation);
        }
Ejemplo n.º 7
0
        protected void ComputeTreeMaps(List <WeightUIElement> items)
        {
            RowOrientation orientation = this.GetOrientation();

            double areaSum = 0;

            foreach (WeightUIElement item in items)
            {
                areaSum += item.RealArea;
            }

            Rect currentRow;

            if (orientation == RowOrientation.Horizontal)
            {
                currentRow = new Rect(_emptyArea.X, _emptyArea.Y, areaSum / _emptyArea.Height, _emptyArea.Height);
                _emptyArea = new Rect(_emptyArea.X + currentRow.Width, _emptyArea.Y, Math.Max(0, _emptyArea.Width - currentRow.Width), _emptyArea.Height);
            }
            else
            {
                currentRow = new Rect(_emptyArea.X, _emptyArea.Y, _emptyArea.Width, areaSum / _emptyArea.Width);
                _emptyArea = new Rect(_emptyArea.X, _emptyArea.Y + currentRow.Height, _emptyArea.Width, Math.Max(0, _emptyArea.Height - currentRow.Height));
            }

            double prevX = currentRow.X;
            double prevY = currentRow.Y;

            foreach (WeightUIElement item in items)
            {
                Rect rect = this.GetRectangle(orientation, item, prevX, prevY, currentRow.Width, currentRow.Height);

                item.AspectRatio      = rect.Width / rect.Height;
                item.ComputedSize     = rect.Size;
                item.ComputedLocation = rect.Location;

                this.ComputeNextPosition(orientation, ref prevX, ref prevY, rect.Width, rect.Height);
            }
        }
Ejemplo n.º 8
0
 protected virtual Rect GetRectangle(RowOrientation orientation, WeightUIElement item, double x, double y, double width, double height)
 {
   if (orientation == RowOrientation.Horizontal)
     return new Rect(x, y, item.RealArea / height, height);
   else
     return new Rect(x, y, width, item.RealArea / width);
 }