public void testSetString()
        {
            JDFRectangleRangeList rangelist = new JDFRectangleRangeList();

            try
            {
                rangelist = new JDFRectangleRangeList("0 0 4 4 ~ 0 0 5 5 0 0 5 5");
            }
            catch (FormatException dfe)
            {
                Console.WriteLine(dfe.ToString());
            }

            // rangeList is not empty
            Assert.IsTrue(rangelist.Count == 2, "Bad setString: " + rangelist.Count);
        }
        public void testAppend()
        {
            JDFRectangleRangeList rangelist = new JDFRectangleRangeList();

            try
            {
                rangelist = new JDFRectangleRangeList("0 0 2 2 ~ 0 0 4 4");
                rangelist.Append(new JDFRectangleRange("0 0 4 4 ~ 0 0 6 6"));
            }
            catch (FormatException dfe)
            {
                Console.WriteLine(dfe.ToString());
            }

            Assert.AreEqual("0 0 2 2 ~ 0 0 4 4 0 0 4 4 ~ 0 0 6 6", rangelist.ToString());
            Assert.IsTrue(rangelist.Count == 2, "Bad append" + rangelist.ToString());
        }
        public void testIsUniqueOrdered_Reverse_False()
        {
            JDFRectangleRangeList rangelist = null;

            try
            {
                rangelist = new JDFRectangleRangeList("0 0 7 7");
                rangelist.Append(new JDFRectangle("0 0 5 5"));
                rangelist.Append(new JDFRectangleRange("0 0 4 4 ~ 0 0 2 2"));
                rangelist.Append(new JDFRectangle("0 0 5 5"));
            }
            catch (FormatException dfe)
            {
                Console.WriteLine(dfe.ToString());
            }

            if (rangelist != null)
            {
                Assert.IsFalse(rangelist.isUniqueOrdered(), "Bad isUniqueOrdered");
            }
        }
        public void testIsUniqueOrdered_True()
        {
            JDFRectangleRangeList rangelist = null;

            try
            {
                rangelist = new JDFRectangleRangeList("0 0 4 4");
                rangelist.Append(new JDFRectangle("0 0 5 5"));
                rangelist.Append(new JDFRectangleRange(new JDFRectangle("0 0 5.5 5.5"), new JDFRectangle("0 0 6 6")));
                // rangelist.append(new JDFRectangle("0 0 5 5"));
                rangelist.Append(new JDFRectangle("0 0 7 7"));
            }
            catch (FormatException dfe)
            {
                Console.WriteLine(dfe.ToString());
            }

            if (rangelist != null)
            {
                Assert.IsTrue(rangelist.isUniqueOrdered(), "Bad isUniqueOrdered");
            }
        }
Example #5
0
 ///
 ///	 <summary> * copy constructor<br>
 ///	 * constructs a JDFRectangleRangeList with the given JDFRectangleRangeList
 ///	 *  </summary>
 ///	 * <param name="rl"> </param>
 ///
 public JDFRectangleRangeList(JDFRectangleRangeList rl)
 {
     rangeList = new ArrayList(rl.rangeList);
 }