/// <summary>
        /// Initializes a new instance of the <see cref="SPBasicSuiteProvider"/> class.
        /// </summary>
        /// <param name="picaSuiteData">The filter record provider.</param>
        /// <param name="propertySuite">The property suite.</param>
        /// <param name="colorPicker">The color picker.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="picaSuiteData"/> is null.
        /// </exception>
        public SPBasicSuiteProvider(IPICASuiteDataProvider picaSuiteData, IPropertySuite propertySuite, IColorPicker colorPicker)
        {
            if (picaSuiteData == null)
            {
                throw new ArgumentNullException(nameof(picaSuiteData));
            }

            this.picaSuiteData      = picaSuiteData;
            this.propertySuite      = propertySuite;
            this.colorPicker        = colorPicker;
            spAcquireSuite          = new SPBasicAcquireSuite(SPBasicAcquireSuite);
            spReleaseSuite          = new SPBasicReleaseSuite(SPBasicReleaseSuite);
            spIsEqual               = new SPBasicIsEqual(SPBasicIsEqual);
            spAllocateBlock         = new SPBasicAllocateBlock(SPBasicAllocateBlock);
            spFreeBlock             = new SPBasicFreeBlock(SPBasicFreeBlock);
            spReallocateBlock       = new SPBasicReallocateBlock(SPBasicReallocateBlock);
            spUndefined             = new SPBasicUndefined(SPBasicUndefined);
            actionSuites            = new ActionSuiteProvider();
            activePICASuites        = new ActivePICASuites();
            descriptorRegistrySuite = null;
            bufferSuite             = null;
            colorSpaceSuite         = null;
            errorSuite              = null;
            handleSuite             = null;
            disposed = false;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PICAColorSpaceSuite"/> class.
        /// </summary>
        /// <param name="zstringSuite">The ASZString suite.</param>
        /// <param name="colorPicker">The color picker.</param>
        /// <exception cref="ArgumentNullException"><paramref name="zstringSuite"/> is null.</exception>
        public PICAColorSpaceSuite(IASZStringSuite zstringSuite, IColorPicker colorPicker)
        {
            if (zstringSuite == null)
            {
                throw new ArgumentNullException(nameof(zstringSuite));
            }
            if (colorPicker == null)
            {
                throw new ArgumentNullException(nameof(colorPicker));
            }

            csMake                = new CSMake(Make);
            csDelete              = new CSDelete(Delete);
            csStuffComponent      = new CSStuffComponents(StuffComponents);
            csExtractComponent    = new CSExtractComponents(ExtractComponents);
            csStuffXYZ            = new CSStuffXYZ(StuffXYZ);
            csExtractXYZ          = new CSExtractXYZ(ExtractXYZ);
            csConvert8            = new CSConvert8(Convert8);
            csConvert16           = new CSConvert16(Convert16);
            csGetNativeSpace      = new CSGetNativeSpace(GetNativeSpace);
            csIsBookColor         = new CSIsBookColor(IsBookColor);
            csExtractColorName    = new CSExtractColorName(ExtractColorName);
            csPickColor           = new CSPickColor(PickColor);
            csConvert8to16        = new CSConvert(Convert8to16);
            csConvert16to8        = new CSConvert(Convert16to8);
            csConvertToMonitorRGB = new CSConvertToMonitorRGB(ConvertToMonitorRGB);

            colors            = new Dictionary <IntPtr, Color>(IntPtrEqualityComparer.Instance);
            colorsIndex       = 0;
            lookup16To8       = null;
            lookup8To16       = null;
            this.zstringSuite = zstringSuite;
            this.colorPicker  = colorPicker;
        }
Example #3
0
 public TagsCloudVisualizator(ITagsCloudContainer tagsCloudContainer, IColorPicker[] colorPickers, Point center, Font textFont)
 {
     this.tagsCloudContainer   = tagsCloudContainer;
     this.rectangleColorPicker = colorPickers[0];
     this.textColorPicker      = colorPickers[1];
     this.image = new Bitmap(center.X * 2, center.Y * 2);
     TextFont   = textFont;
 }
Example #4
0
        void ColorChanged(Base control, EventArgs args)
        {
            IColorPicker picker = control as IColorPicker;
            Color        c      = picker.SelectedColor;
            HSV          hsv    = c.ToHSV();
            String       text   = String.Format("Color changed: RGB: {0:X2}{1:X2}{2:X2} HSV: {3:F1} {4:F2} {5:F2}",
                                                c.R, c.G, c.B, hsv.h, hsv.s, hsv.v);

            UnitPrint(text);
        }
        public DependencyPageModel() : base()
        {
            OpenGalleryCommand     = new Command(OpenGallery);
            ShowColorPickerCommand = new Command(ShowColorPickerCommandTapped);

            BorderColor      = Colors.ORANGE;
            this.colorPicker = DependencyService.Get <IColorPicker>();

            AppVersion = DependencyService.Get <IEnvironment>().GetAppVersion();
        }
Example #6
0
        void ColorChanged(Base control)
        {
            IColorPicker picker = control as IColorPicker;
            Color        c      = picker.SelectedColor;

            Alt.GUI.Temporary.Gwen.HSV hsv = //c.ToHSV();
                                             Alt.GUI.Temporary.Gwen.Util.ToHSV(c);
            String text = String.Format("Color changed: RGB: {0:X2}{1:X2}{2:X2} HSV: {3:F1} {4:F2} {5:F2}",
                                        c.R, c.G, c.B, hsv.h, hsv.s, hsv.v);

            UnitPrint(text);
        }
Example #7
0
 private void SetConnectedColorPicker(IColorPicker oldValue, IColorPicker newValue)
 {
     if (newValue != oldValue)
     {
         if (oldValue != null)
         {
             oldValue.PropertyChanged -= BindedIColorPicker_PropertyChanged;
         }
         if (newValue != null)
         {
             newValue.PropertyChanged += BindedIColorPicker_PropertyChanged;
             newValue.SelectedColor    = SelectedColor;
         }
         SetValue(ConnectedColorPickerProperty, newValue);
     }
 }
Example #8
0
        public ColorTimePointSlider(ColorTimeLineDrawingConfig drawingConfig, byte id, SKColor color, float time, IColorPicker colorPicker, IPhotonLedControllerCommunicator photonLedControllerCommunicator)
        {
            _drawingConfig   = drawingConfig;
            _worldDimensions = _drawingConfig.WorldDimensions();
            _id = id;
            var sliderBody = new CircularSliderBody(_worldDimensions.Center, _worldDimensions.ColorsCircleRadius);

            _slider = new Slider <float>(_drawingConfig, time, color, _worldDimensions.ColorsCircleWidth, false, true, sliderBody);
            AddChild(_slider);
            _colorPicker = colorPicker;
            _photonLedControllerCommunicator = photonLedControllerCommunicator;

            _slider.ValueChanged      += _slider_ValueChanged;
            _slider.IsSelectedChanged += _slider_IsSelectedChanged;

            _colorPicker.ColorChanged += ColorComponent_ColorChanged;
        }
        public override void Dispose()
        {
            base.Dispose();
            General.Actions.UnbindMethods(this);

            if (form != null)
            {
                form.Close();
            }
            form = null;

            if (toolsform != null)
            {
                toolsform.Unregister();
                toolsform.Dispose();
                toolsform = null;
            }
        }
Example #10
0
        public void SetUp()
        {
            tagsCloudContainer = Substitute.For <ITagsCloudContainer>();
            randomColorPiker   = Substitute.For <IColorPicker>();
            whiteColorPicker   = Substitute.For <IColorPicker>();
            center             = new Point(1000, 1000);
            font = new Font(FontFamily.GenericMonospace, 16, FontStyle.Italic, GraphicsUnit.Point);

            tagsCloudVisualizator = new TagsCloudVisualizator(tagsCloudContainer, new IColorPicker[] { randomColorPiker, whiteColorPicker }, center, font);

            randomColorPiker.GenerateColor().Returns(new SolidBrush(Color.FromArgb(21, 213, 222)));
            whiteColorPicker.GenerateColor().Returns(Brushes.White);
            tagsCloudContainer.GetTagsRectangleData().Returns(new Dictionary <string, Rectangle>()
            {
                { "dasda", new Rectangle() },
                { "das21da", new Rectangle() },
            });
        }
        public RootSurfaceComponent(IPhotonLedControllerCommunicator photonLedControllerCommunicator)
        {
            // Dependencies.

            _photonLedControllerCommunicator = photonLedControllerCommunicator;

            // Drawing configuration.

            _drawingConfig   = new ColorTimeLineDrawingConfig();
            _worldDimensions = _drawingConfig.WorldDimensions();

            // Initialize color positions.
            _colorPositions = new ColorPositions(new ColorPosition[0]);

            // Gradient circle component.

            _gradientCircularTrack = new CircularTrack(_worldDimensions.Center, _worldDimensions.GradientCircleRadius, _worldDimensions.GradientCircleWidth, 360, _colorPositions);
            AddChild(_gradientCircularTrack);

            // Track for color time points.

            _colorTimePointsTrack = new CircularTrack(_worldDimensions.Center, _worldDimensions.ColorsCircleRadius, _worldDimensions.ColorsCircleWidth, _drawingConfig.SliderTrackBackgroundColor);
            AddChild(_colorTimePointsTrack);

            // Container for color time point sliders - the only sliders which number is dynamic so generic list is used here.

            _colorTimePointSliders = new List <ColorTimePointSlider>();

            // Color picker.
            _colorPicker           = new HsvColorPicker(_drawingConfig);
            _colorPicker.IsEnabled = false;
            AddChild(_colorPicker);

            // Time progress slider with cycle time slider inside.

            _timeProgressSlider = new TimeProgressSlider(_drawingConfig, SKColors.Black, _timeProgress, _photonLedControllerCommunicator);
            _timeProgressSlider.Slider.IsSelectedChanged += Slider_IsSelectedChanged;
            AddChild(_timeProgressSlider);
        }
 private void form_FormClosed(object sender, FormClosedEventArgs e)
 {
     formLocation = form.Location;
     form.Dispose();
     form = null;
 }
        private void ToggleLightPannel()
        {
            SelectableElement deselectelement = null;

            if (General.Editing.Mode == null || General.Map.DOOM)
            {
                return;
            }
            string currentModeName = General.Editing.Mode.GetType().Name;

            //display one of colorPickers or tell the user why we can't do that
            if (currentModeName == "ThingsMode")
            {
                if (General.Map.Map.SelectedThingsCount == 0)
                {
                    // If nothing is selected try to use a highlighted object
                    if (General.Editing.Mode.HighlightedObject != null)
                    {
                        ((Thing)General.Editing.Mode.HighlightedObject).Selected = true;
                        deselectelement = (Thing)General.Editing.Mode.HighlightedObject;
                    }
                    else
                    {
                        General.Interface.DisplayStatus(StatusType.Warning, "Select or highlight some lights first!");
                        return;
                    }
                }
                form = new LightColorPicker();
            }
            else if (currentModeName == "SectorsMode")
            {
                if (General.Map.UDMF)
                {
                    if (General.Map.Map.SelectedSectorsCount == 0)
                    {
                        if (General.Editing.Mode.HighlightedObject != null)
                        {
                            ((Sector)General.Editing.Mode.HighlightedObject).Selected = true;
                        }
                        else
                        {
                            General.Interface.DisplayStatus(StatusType.Warning, "Select or highlight some sectors first!");
                            return;
                        }
                    }
                    form = new SectorColorPicker();
                }
                else
                {
                    General.Interface.DisplayStatus(StatusType.Warning, "Sector colors can only be set if map is in UDMF format!");
                    return;
                }
            }
            else if (currentModeName == "BaseVisualMode")
            {
                //nothing selected in visual mode?
                if (((VisualMode)General.Editing.Mode).GetSelectedVisualThings(true).Count == 0)
                {
                    //check sectors
                    int selectedSectorsCount = ((VisualMode)General.Editing.Mode).GetSelectedVisualSectors(true).Count;
                    if (General.Map.UDMF && (selectedSectorsCount > 0 || General.Map.Map.SelectedSectorsCount > 0))
                    {
                        form = new SectorColorPicker();
                    }
                    else
                    {
                        General.Interface.DisplayStatus(StatusType.Warning, "Select some lights " + (General.Map.UDMF ? ", sectors or surfaces " : "") + "first!");
                        return;
                    }
                }
                else
                {
                    form = new LightColorPicker();
                }
            }
            else             //wrong mode
            {
                General.Interface.DisplayStatus(StatusType.Warning, "Switch to" + (General.Map.UDMF ? " Sectors," : "") + " Things or GZDoom Visual Mode first!");
                return;
            }

            if (form.Setup(currentModeName))
            {
                if (formLocation.X == 0 && formLocation.Y == 0)
                {
                    Size  displaySize     = General.Interface.Display.Size;
                    Point displayLocation = General.Interface.Display.LocationAbs;
                    formLocation = new Point(displayLocation.X + displaySize.Width - form.Width - 16, displayLocation.Y + 16);
                }
                form.Location    = formLocation;
                form.FormClosed += form_FormClosed;
                form.ShowDialog(General.Interface);

                if (deselectelement != null)
                {
                    deselectelement.Selected = false;
                }
            }
            else
            {
                form.Dispose();
                form = null;
            }

            General.Interface.RedrawDisplay();
        }
Example #14
0
 public CloudDrawer(IColorPicker colorPicker)
 {
     this.colorPicker = colorPicker;
 }
 public ClockRowFacade(IColorPicker colorPicker)
 {
     _colorPicker = colorPicker;
 }