private static void Level1Config(AureaColor systemColor, UPMCoIEdgeViewConfig parentEdgeConfigurationLevel1, UPMCoIEdgeViewConfig additionalEdgeConfiguration, UPMCoIViewConfig config)
        {
            var level = new UPMCoILevelViewConfig();

            var node = new UPMCoINodeViewConfig(AureaColor.RedGreenBlue(1.0, 1.0, 1.0), new Size(58, 58),
                                                AureaColor.RedGreenBlueAlpha(100.0 / 255.0, 162.0 / 255.0, 160.0 / 255.0, 1.0), 5.0f, 50.0f, true, true, true, new Size(75, 75),
                                                new Size(175, 175), int.MaxValue, new Size(150, 60), new Size(25, 40), new Size(0, 0), new Size(0, 0), 0.0f, new Size(0, 1), 1.0f,
                                                AureaColor.RedGreenBlue(219.0f / 255.0f, 219.0f / 255.0f, 219.0f / 255.0f), false, new Size(150, 100), 60.0f, 55, true,
                                                parentEdgeConfigurationLevel1, additionalEdgeConfiguration, 5, UPNodeViewAction.SelectNodeAndExpandCollapse, UPNodeViewAction.SelectNode,
                                                UPNodeViewAction.CustomViaDelegate, AureaColor.RedGreenBlueAlpha(187.0f / 255.0f, 187.0f / 255.0f, 187.0f / 255.0f, 1.0),
                                                AureaColor.RedGreenBlueAlpha(1.0, 1.0, 1.0, 1.0), 1.5f, 5, 17, AureaColor.RedGreenBlue(1.0, 1.0, 1.0), null, systemColor,
                                                null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
                                                null, null, null, null, null, null, null, null, null, null);

            level.AddConfig(node);

            UpdateRowConfig(
                systemColor,
                node,
                UIFont.FontWithNameSize(HelveticaNeue, 12),
                UIFont.FontWithNameSize(HelveticaNeue, 12),
                UIFont.FontWithNameSize(HelveticaNeue, 12),
                UIFont.FontWithNameSize(HelveticaNeue, 12));

            config.AddConfig(level);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="UPMCoIViewConfigProvider"/> class.
        /// </summary>
        public UPMCoIViewConfigProvider()
        {
            var systemColor = AureaColor.UpCurrentSystemColor();

            this.configurations        = new List <UPMCoIViewConfig>();
            this.NodesViewType         = UPNodesViewType.Circle;
            this.EdgeViewType          = UPEdgeViewType.Line;
            this.ChildMoveType         = UPChildNodeMoveType.Always;
            this.MinNodes              = 3;
            this.PreAnimationDuration  = 0.25f;
            this.PostAnimationDuration = 0.25f;
            this.AnimationDuration     = 0.25f;
            this.FrameAndLabelAsBase   = true;
            this.LessOrMoreChildrenAnimationDuration = 0.4f;

            var parentEdgeConfigurationLevel1 = new UPMCoIEdgeViewConfig(UIFont.SystemFontOfSize(12), 5.0f,
                                                                         AureaColor.RedGreenBlue(2.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0), AureaColor.RedGreenBlue(238.0f / 255.0f, 238.0f / 255.0f, 238.0f / 255.0f),
                                                                         5.0f, 0.2f, /*kCALineJoinMiter*/ null, null, 0.0f, 1.0f, 0.4f, 0.0f, new Size(0, 1), AureaColor.RedGreenBlue(219.0f / 255.0f, 219.0f / 255.0f, 219.0f / 255.0f),
                                                                         1.0f, 1.0f, new Size(0, 1), AureaColor.RedGreenBlue(1.0, 1.0, 1.0), null, 12.0f, AureaColor.RedGreenBlue(51.0 / 255.0f, 51.0 / 255.0f, 51.0 / 255.0f),
                                                                         AureaColor.RedGreenBlue(255.0 / 255.0, 90.0 / 255.0, 16.0 / 255.0), null, null, null, null, 1.0f, 1.0f, null, null, null, null, null, null, null, null);

            var parentEdgeConfigurationLevel2 = new UPMCoIEdgeViewConfig(UIFont.SystemFontOfSize(12), 5.0f,
                                                                         AureaColor.RedGreenBlue(2.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0), AureaColor.RedGreenBlue(238.0f / 255.0f, 238.0f / 255.0f, 238.0f / 255.0f),
                                                                         3.0f, 0.2f, /*kCALineJoinMiter*/ null, null, 0.0f, 1.0f, 0.4f, 0.0f, new Size(0, 1), AureaColor.RedGreenBlue(219.0f / 255.0f, 219.0f / 255.0f, 219.0f / 255.0f),
                                                                         1.0f, 1.0f, new Size(0, 1), AureaColor.RedGreenBlue(1.0, 1.0, 1.0), null, 12.0f, AureaColor.RedGreenBlue(51.0 / 255.0f, 51.0 / 255.0f, 51.0 / 255.0f),
                                                                         AureaColor.RedGreenBlue(255.0 / 255.0f, 90.0 / 255.0f, 16.0 / 255.0f), null, null, null, null, 1.0f, 1.0f, null, null, null, null, null, null, null, null);

            var additionalEdgeConfiguration = new UPMCoIEdgeViewConfig(UIFont.SystemFontOfSize(12), 5.0f,
                                                                       AureaColor.RedGreenBlue(2.0 / 3.0, 2.0 / 3.0, 2.0 / 3.0), AureaColor.RedGreenBlue(238.0f / 255.0f, 238.0f / 255.0f, 238.0f / 255.0f),
                                                                       3.0f, 0.2f, /*kCALineJoinMiter*/ null, new List <int> {
                5, 5
            }, 0.0f, 1.0f, 0.4f, 0.0f, new Size(0, 1),
                                                                       AureaColor.RedGreenBlue(219.0f / 255.0f, 219.0f / 255.0f, 219.0f / 255.0f), 1.0f, 1, new Size(0, 1), AureaColor.RedGreenBlue(1.0, 1.0, 1.0),
                                                                       null, null, AureaColor.RedGreenBlue(51.0 / 255.0f, 51.0 / 255.0f, 51.0 / 255.0f), AureaColor.RedGreenBlue(255.0 / 255.0f, 90.0 / 255.0f, 16.0 / 255.0f),
                                                                       null, null, null, null, 1.0f, 1.0f, null, null, null, null, null, null, null, null);

            var config = new UPMCoIViewConfig();

            this.configurations.Add(config);

            Level0Config(systemColor, additionalEdgeConfiguration, config);
            Level1Config(systemColor, parentEdgeConfigurationLevel1, additionalEdgeConfiguration, config);
            Level2Config(systemColor, parentEdgeConfigurationLevel2, additionalEdgeConfiguration, config);
            Level3Config(systemColor, parentEdgeConfigurationLevel2, additionalEdgeConfiguration, config);
            Level4Config(systemColor, parentEdgeConfigurationLevel2, additionalEdgeConfiguration, config);
        }
        private static void Level0Config(AureaColor systemColor, UPMCoIEdgeViewConfig additionalEdgeConfiguration, UPMCoIViewConfig config)
        {
            var level = new UPMCoILevelViewConfig();
            var node  = new UPMCoINodeViewConfig(AureaColor.RedGreenBlue(1.0, 1.0, 1.0), new Size(117, 117),
                                                 AureaColor.RedGreenBlueAlpha(179.0 / 255.0, 210.0 / 255.0, 103.0 / 255.0, 1.0), 8.0f, 50.0f, true, true, true, new Size(175, 175),
                                                 new Size(100, 100), int.MinValue, new Size(75, 50), new Size(40, 40), new Size(0, -25), new Size(0, 10), 0.0f, new Size(0, 1), 1.0f,
                                                 AureaColor.RedGreenBlue(219.0f / 255.0f, 219.0f / 255.0f, 219.0f / 255.0f), false, new Size(150, 100), 60.0f, 55, true, null,
                                                 additionalEdgeConfiguration, 5, UPNodeViewAction.SelectNodeAndExpandCollapse, UPNodeViewAction.SelectNode, UPNodeViewAction.RelayoutNode,
                                                 AureaColor.RedGreenBlueAlpha(187.0f / 255.0f, 187.0f / 255.0f, 187.0f / 255.0f, 1.0), AureaColor.RedGreenBlueAlpha(1.0, 1.0, 1.0, 1.0),
                                                 1.5f, 5, 26, AureaColor.RedGreenBlue(1.0, 1.0, 1.0), null, systemColor, null, null, null, null, null, null, null, null, null, null,
                                                 null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);

            level.AddConfig(node);

            var rowConfig0 = node.TextRowConfigAtIndex(0);

            rowConfig0.Color = AureaColor.RedGreenBlue(51.0 / 255.0f, 51.0 / 255.0f, 51.0 / 255.0f);
            rowConfig0.Font  = UIFont.FontWithNameSize(HelveticaNeueBold, 13);

            var rowConfigS0 = node.SelectedTextRowConfigAtIndex(0);

            rowConfigS0.Color = systemColor;
            rowConfigS0.Font  = UIFont.FontWithNameSize(HelveticaNeueBold, 13);

            var rowConfig1 = node.TextRowConfigAtIndex(1);

            rowConfig1.Color = AureaColor.RedGreenBlue(102.0 / 255.0f, 102.0 / 255.0f, 102.0 / 255.0f);
            rowConfig1.Font  = UIFont.FontWithNameSize(HelveticaNeueMedium, 12);

            var rowConfigS1 = node.SelectedTextRowConfigAtIndex(1);

            rowConfigS1.Color = systemColor;
            rowConfigS1.Font  = UIFont.FontWithNameSize(HelveticaNeueMedium, 12);

            config.AddConfig(level);
        }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UPMCoINodeViewConfig"/> class.
 /// </summary>
 /// <param name="backgroundColor">Color of the background.</param>
 /// <param name="size">The size.</param>
 /// <param name="borderColor">Color of the border.</param>
 /// <param name="borderWidth">Width of the border.</param>
 /// <param name="cornerRadius">The corner radius.</param>
 /// <param name="cornerRadiusInPercent">if set to <c>true</c> [corner radius in percent].</param>
 /// <param name="imageVisible">if set to <c>true</c> [image visible].</param>
 /// <param name="textVisible">if set to <c>true</c> [text visible].</param>
 /// <param name="childOffset">The child offset.</param>
 /// <param name="rootOffset">The root offset.</param>
 /// <param name="textAngle">The text angle.</param>
 /// <param name="maxTextSize">Maximum size of the text.</param>
 /// <param name="maxImageSize">Maximum size of the image.</param>
 /// <param name="imageOffset">The image offset.</param>
 /// <param name="textOffset">The text offset.</param>
 /// <param name="shadowRadius">The shadow radius.</param>
 /// <param name="shadowOffset">The shadow offset.</param>
 /// <param name="shadowOpacity">The shadow opacity.</param>
 /// <param name="shadowColor">Color of the shadow.</param>
 /// <param name="flatShadow">if set to <c>true</c> [flat shadow].</param>
 /// <param name="buttonsFrameSize">Size of the buttons frame.</param>
 /// <param name="buttonGap">The button gap.</param>
 /// <param name="buttonsStartGap">The buttons start gap.</param>
 /// <param name="centerButtons">if set to <c>true</c> [center buttons].</param>
 /// <param name="parentEdgeConfiguration">The parent edge configuration.</param>
 /// <param name="additionalEdgeConfiguration">The additional edge configuration.</param>
 /// <param name="maxChildren">The maximum children.</param>
 /// <param name="tapAction">The tap action.</param>
 /// <param name="longPressedAction">The long pressed action.</param>
 /// <param name="doubleTapAction">The double tap action.</param>
 /// <param name="progressIndicatorFillColor">Color of the progress indicator fill.</param>
 /// <param name="progressIndicatorStrokeColor">Color of the progress indicator stroke.</param>
 /// <param name="progressIndicatorLoopDuration">Duration of the progress indicator loop.</param>
 /// <param name="childrenStepCount">The children step count.</param>
 /// <param name="initialFontSize">Initial size of the font.</param>
 /// <param name="selectedBackgroundColor">Color of the selected background.</param>
 /// <param name="selectedSize">Size of the selected.</param>
 /// <param name="selectedBorderColor">Color of the selected border.</param>
 /// <param name="selectedBorderWidth">Width of the selected border.</param>
 /// <param name="selectedCornerRadius">The selected corner radius.</param>
 /// <param name="selectedCornerRadiusInPercent">The selected corner radius in percent.</param>
 /// <param name="selectedImageVisible">The selected image visible.</param>
 /// <param name="selectedTextVisible">The selected text visible.</param>
 /// <param name="selectedChildOffset">The selected child offset.</param>
 /// <param name="selectedRootOffset">The selected root offset.</param>
 /// <param name="selectedTextAngle">The selected text angle.</param>
 /// <param name="selectedMaxTextSize">Size of the selected maximum text.</param>
 /// <param name="selectedMaxImageSize">Size of the selected maximum image.</param>
 /// <param name="selectedImageOffset">The selected image offset.</param>
 /// <param name="selectedTextOffset">The selected text offset.</param>
 /// <param name="selectedShadowRadius">The selected shadow radius.</param>
 /// <param name="selectedShadowOffset">The selected shadow offset.</param>
 /// <param name="selectedShadowOpacity">The selected shadow opacity.</param>
 /// <param name="selectedShadowColor">Color of the selected shadow.</param>
 /// <param name="selectedButtonsFrameSize">Size of the selected buttons frame.</param>
 /// <param name="selectedButtonGap">The selected button gap.</param>
 /// <param name="selectedButtonsStartGap">The selected buttons start gap.</param>
 /// <param name="selectedCenterButtons">The selected center buttons.</param>
 /// <param name="selectedParentEdgeConfiguration">The selected parent edge configuration.</param>
 /// <param name="selectedAdditionalEdgeConfiguration">The selected additional edge configuration.</param>
 /// <param name="selectedMaxChildren">The selected maximum children.</param>
 /// <param name="selectedTapAction">The selected tap action.</param>
 /// <param name="selectedLongPressedAction">The selected long pressed action.</param>
 /// <param name="selectedDoubleTapAction">The selected double tap action.</param>
 /// <param name="selectedProgressIndicatorFillColor">Color of the selected progress indicator fill.</param>
 /// <param name="selectedProgressIndicatorStrokeColor">Color of the selected progress indicator stroke.</param>
 /// <param name="selectedProgressIndicatorLoopDuration">Duration of the selected progress indicator loop.</param>
 /// <param name="selectedChildrenStepCount">The selected children step count.</param>
 /// <param name="selectedInitialFontSize">Size of the selected initial font.</param>
 public UPMCoINodeViewConfig(AureaColor backgroundColor, Size size, AureaColor borderColor, float borderWidth, float cornerRadius,
                             bool cornerRadiusInPercent, bool imageVisible, bool textVisible, Size childOffset, Size rootOffset, int textAngle,
                             Size maxTextSize, Size maxImageSize, Size imageOffset, Size textOffset, float shadowRadius, Size shadowOffset,
                             float shadowOpacity, AureaColor shadowColor, bool flatShadow, Size buttonsFrameSize, float buttonGap, float buttonsStartGap,
                             bool centerButtons, UPMCoIEdgeViewConfig parentEdgeConfiguration, UPMCoIEdgeViewConfig additionalEdgeConfiguration, int maxChildren,
                             UPNodeViewAction tapAction, UPNodeViewAction longPressedAction, UPNodeViewAction doubleTapAction, AureaColor progressIndicatorFillColor,
                             AureaColor progressIndicatorStrokeColor, float progressIndicatorLoopDuration, int childrenStepCount, int initialFontSize,
                             AureaColor selectedBackgroundColor, Size?selectedSize, AureaColor selectedBorderColor, float?selectedBorderWidth,
                             float?selectedCornerRadius, bool?selectedCornerRadiusInPercent, bool?selectedImageVisible, bool?selectedTextVisible,
                             Size?selectedChildOffset, Size?selectedRootOffset, int?selectedTextAngle, Size?selectedMaxTextSize,
                             Size?selectedMaxImageSize, Size?selectedImageOffset, Size?selectedTextOffset, float?selectedShadowRadius,
                             Size?selectedShadowOffset, float?selectedShadowOpacity, AureaColor selectedShadowColor, Size?selectedButtonsFrameSize,
                             float?selectedButtonGap, float?selectedButtonsStartGap, bool?selectedCenterButtons,
                             UPMCoIEdgeViewConfig selectedParentEdgeConfiguration, UPMCoIEdgeViewConfig selectedAdditionalEdgeConfiguration,
                             int?selectedMaxChildren, UPNodeViewAction?selectedTapAction, UPNodeViewAction?selectedLongPressedAction, UPNodeViewAction?selectedDoubleTapAction,
                             AureaColor selectedProgressIndicatorFillColor, AureaColor selectedProgressIndicatorStrokeColor, float?selectedProgressIndicatorLoopDuration,
                             int?selectedChildrenStepCount, int?selectedInitialFontSize)
 {
     this.textRowConfig         = new List <UPMCoITextRowViewConfig>();
     this.selectedTextRowConfig = new List <UPMCoITextRowViewConfig>();
     this.BackgroundColor       = backgroundColor;
     this.Size                                  = size;
     this.BorderColor                           = borderColor;
     this.BorderWidth                           = borderWidth;
     this.CornerRadius                          = cornerRadius;
     this.CornerRadiusInPercent                 = cornerRadiusInPercent;
     this.ImageVisible                          = imageVisible;
     this.TextVisible                           = textVisible;
     this.ChildOffset                           = childOffset;
     this.RootOffset                            = rootOffset;
     this.TextAngle                             = textAngle;
     this.MaxTextSize                           = maxTextSize;
     this.MaxImageSize                          = maxImageSize;
     this.ImageOffset                           = imageOffset;
     this.TextOffset                            = textOffset;
     this.ShadowColor                           = shadowColor;
     this.ShadowOffset                          = shadowOffset;
     this.ShadowOpacity                         = shadowOpacity;
     this.ShadowRadius                          = shadowRadius;
     this.FlatShadow                            = flatShadow;
     this.ButtonsFrameSize                      = buttonsFrameSize;
     this.ButtonGap                             = buttonGap;
     this.ButtonsStartGap                       = buttonsStartGap;
     this.CenterButtons                         = centerButtons;
     this.ParentEdgeConfiguration               = parentEdgeConfiguration;
     this.AdditionalEdgeConfiguration           = additionalEdgeConfiguration;
     this.MaxChildren                           = maxChildren < 1 ? int.MaxValue : maxChildren;
     this.TapAction                             = tapAction;
     this.DoubleTapAction                       = doubleTapAction;
     this.LongPressedAction                     = longPressedAction;
     this.ProgressIndicatorFillColor            = progressIndicatorFillColor;
     this.ProgressIndicatorStrokeColor          = progressIndicatorStrokeColor;
     this.ProgressIndicatorLoopDuration         = progressIndicatorLoopDuration;
     this.ChildrenStepCount                     = childrenStepCount;
     this.InitialFontSize                       = initialFontSize;
     this.SelectedBackgroundColor               = selectedBackgroundColor ?? backgroundColor;
     this.SelectedSize                          = selectedSize ?? size;
     this.SelectedBorderColor                   = selectedBorderColor ?? borderColor;
     this.SelectedBorderWidth                   = selectedBorderWidth ?? borderWidth;
     this.SelectedCornerRadius                  = selectedCornerRadius ?? cornerRadius;
     this.SelectedCornerRadiusInPercent         = selectedCornerRadiusInPercent == true ? selectedCornerRadius != null && selectedCornerRadius != 0 : cornerRadiusInPercent;
     this.SelectedImageVisible                  = selectedImageVisible ?? imageVisible;
     this.SelectedTextVisible                   = selectedTextVisible ?? textVisible;
     this.SelectedChildOffset                   = selectedChildOffset ?? childOffset;
     this.SelectedRootOffset                    = selectedRootOffset ?? rootOffset;
     this.SelectedTextAngle                     = selectedTextAngle ?? textAngle;
     this.SelectedMaxTextSize                   = selectedMaxTextSize ?? maxTextSize;
     this.SelectedMaxImageSize                  = selectedMaxImageSize ?? maxImageSize;
     this.SelectedImageOffset                   = selectedImageOffset ?? imageOffset;
     this.SelectedTextOffset                    = selectedTextOffset ?? textOffset;
     this.SelectedShadowColor                   = selectedShadowColor ?? this.ShadowColor;
     this.SelectedShadowOffset                  = selectedShadowOffset ?? this.ShadowOffset;
     this.SelectedShadowOpacity                 = selectedShadowOpacity ?? this.ShadowOpacity;
     this.SelectedShadowRadius                  = selectedShadowRadius ?? this.ShadowRadius;
     this.SelectedButtonsFrameSize              = selectedButtonsFrameSize ?? buttonsFrameSize;
     this.SelectedButtonGap                     = selectedButtonGap ?? buttonGap;
     this.SelectedButtonsStartGap               = selectedButtonsStartGap ?? buttonsStartGap;
     this.SelectedCenterButtons                 = selectedCenterButtons ?? centerButtons;
     this.SelectedParentEdgeConfiguration       = selectedParentEdgeConfiguration ?? parentEdgeConfiguration;
     this.SelectedAdditionalEdgeConfiguration   = selectedAdditionalEdgeConfiguration ?? additionalEdgeConfiguration;
     this.SelectedMaxChildren                   = selectedMaxChildren ?? this.MaxChildren;
     this.SelectedTapAction                     = selectedTapAction ?? tapAction;
     this.SelectedDoubleTapAction               = selectedDoubleTapAction ?? doubleTapAction;
     this.SelectedLongPressedAction             = selectedLongPressedAction ?? longPressedAction;
     this.SelectedProgressIndicatorFillColor    = selectedProgressIndicatorFillColor ?? progressIndicatorFillColor;
     this.SelectedProgressIndicatorStrokeColor  = selectedProgressIndicatorStrokeColor ?? progressIndicatorStrokeColor;
     this.SelectedProgressIndicatorLoopDuration = selectedProgressIndicatorLoopDuration ?? progressIndicatorLoopDuration;
     this.SelectedChildrenStepCount             = selectedChildrenStepCount ?? childrenStepCount;
     this.SelectedInitialFontSize               = selectedInitialFontSize ?? initialFontSize;
 }