internal void SetDataCursor()
        {
            try
            {
                m_objDataCursor = new DataCursor(m_objChartView, m_objCartesianCordinates, GraphObj.MARKER_VLINE, 8.0);
                m_objDataCursor.SetColor(Color.Black);
                m_objDataCursor.SetEnable(true);
                m_objDataCursor.LineStyle = DashStyle.Solid;
                m_objDataCursor.SetLineStyle(DashStyle.Solid);
                m_objDataCursor.LineColor = Color.Black;
                m_objChartView.SetCurrentMouseListener(m_objDataCursor);
                m_objChartView.AddChartObject(m_objDataCursor);

                if (m_objMarker != null)
                {
                    m_objChartView.DeleteChartObject(m_objMarker);

                    m_objChartView.UpdateDraw();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message, ex.StackTrace);
            }
            finally
            {
            }
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCountDistinctValues()
        public virtual void ShouldCountDistinctValues()
        {
            // given
            Value[]    strings = GenerateRandomStrings();
            DataCursor source  = new DataCursor(AsHitData(strings));
            GatheringNodeValueClient client = new GatheringNodeValueClient();

            // when
            NativeDistinctValuesProgressor <StringIndexKey, NativeIndexValue> progressor = new NativeDistinctValuesProgressor <StringIndexKey, NativeIndexValue>(source, client, new List <RawCursor <Hit <KEY, VALUE>, IOException> >(), _layout, _layout.compareValue);

            client.Initialize(null, progressor, new IndexQuery[0], IndexOrder.NONE, true);
            IDictionary <Value, MutableInt> expectedCounts = AsDistinctCounts(strings);

            // then
            int uniqueValues    = 0;
            int nonUniqueValues = 0;

            while (progressor.Next())
            {
                Value      @string       = client.Values[0];
                MutableInt expectedCount = expectedCounts.Remove(@string);
                assertNotNull(expectedCount);
                assertEquals(expectedCount.intValue(), client.Reference);

                if (expectedCount.intValue() > 1)
                {
                    nonUniqueValues++;
                }
                else
                {
                    uniqueValues++;
                }
            }
            assertTrue(expectedCounts.Count == 0);
            assertTrue(uniqueValues > 0);
            assertTrue(nonUniqueValues > 0);
        }