Return-Path: X-Original-To: apmail-chemistry-commits-archive@www.apache.org Delivered-To: apmail-chemistry-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5764C17999 for ; Mon, 6 Apr 2015 17:13:51 +0000 (UTC) Received: (qmail 49707 invoked by uid 500); 6 Apr 2015 17:13:51 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 49598 invoked by uid 500); 6 Apr 2015 17:13:51 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 49382 invoked by uid 99); 6 Apr 2015 17:13:51 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Apr 2015 17:13:51 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id EAEA2AC0E1C for ; Mon, 6 Apr 2015 17:13:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1671603 [5/10] - in /chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test: ./ chemistry-opencmis-test-util/ chemistry-opencmis-test-util/css/ chemistry-opencmis-test-util/images/ chemistry-opencmis-test-util/images/logos/... Date: Mon, 06 Apr 2015 17:13:49 -0000 To: commits@chemistry.apache.org From: gabriele@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150406171350.EAEA2AC0E1C@hades.apache.org> Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref-test/overview-summary.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref-test/overview-summary.html?rev=1671603&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref-test/overview-summary.html (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref-test/overview-summary.html Mon Apr 6 17:13:48 2015 @@ -0,0 +1,64 @@ + + + + + + OpenCMIS Test Utilities 0.13.0 Reference + + + +
+
    +
  • Overview
  • +
  • Package
  • +
+
+
+ +
+ +

OpenCMIS Test Utilities 0.13.0 Reference

+ + + + + + + + + + + + +
Packages
+ org.apache.chemistry.opencmis.util.content.loremipsum +
+ +
+
    +
  • Overview
  • +
  • Package
  • +
+
+
+ +
+ +
+ Copyright © 2009-2015 The Apache Software Foundation. All Rights Reserved. + + \ No newline at end of file Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref-test/stylesheet.css URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref-test/stylesheet.css?rev=1671603&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref-test/stylesheet.css (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref-test/stylesheet.css Mon Apr 6 17:13:48 2015 @@ -0,0 +1,116 @@ +/* Javadoc style sheet */ +/* Define colors, fonts and other style attributes here to override the defaults */ +body { + background-color: #fff; + font-family: Arial, Helvetica, sans-serif; +} + +a:link { + color: #00f; +} +a:visited { + color: #00a; +} + +a:active, a:hover { + color: #f30 !important; +} + +ul, li { + list-style-type:none; + margin:0; + padding:0; +} + +table td { + padding: 3px; + border: 1px solid #000; +} +table { + width:100%; + border: 1px solid #000; + border-collapse: collapse; +} + +div.overview { + background-color:#ddd; + padding: 4px 4px 4px 0; +} +div.overview li, div.framenoframe li { + display: inline; +} +div.framenoframe { + text-align: center; + font-size: x-small; +} +div.framenoframe li { + margin: 0 3px 0 3px; +} +div.overview li { + margin:3px 3px 0 3px; + padding: 4px; +} +li.selected { + background-color:#888; + color: #fff; + font-weight: bold; +} + +table.summary { + margin-bottom: 20px; +} +table.summary td, table.summary th { + font-weight: bold; + text-align: left; + padding: 3px; +} +table.summary th { + background-color:#036; + color: #fff; +} +table.summary td { + background-color:#eee; + border: 1px solid black; +} + +em { + color: #A00; +} +em.comment { + color: #390; +} +.string { + color: #009; +} +div#footer { + text-align:center; +} +#overview { + padding:2px; +} + +hr { + height: 1px; + color: #000; +} + +/* JXR style sheet */ +.jxr_comment +{ + color: #390; +} + +.jxr_javadoccomment +{ + color: #A00; +} + +.jxr_string +{ + color: #009; +} + +.jxr_keyword +{ + color: #000; +} Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/allclasses-frame.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/allclasses-frame.html?rev=1671603&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/allclasses-frame.html (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/allclasses-frame.html Mon Apr 6 17:13:48 2015 @@ -0,0 +1,59 @@ + + + + + + All Classes + + + + +

All Classes

+ + + + + Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/index.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/index.html?rev=1671603&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/index.html (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/index.html Mon Apr 6 17:13:48 2015 @@ -0,0 +1,24 @@ + + + + + + OpenCMIS Test Utilities 0.13.0 Reference + + + + + + + + + <body> + <h1>Frame Alert</h1> + <p> + You don't have frames. Go <a href="overview-summary.html">here</a> + </p> + </body> + + + + Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/org/apache/chemistry/opencmis/util/content/fractal/ComplexPoint.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/org/apache/chemistry/opencmis/util/content/fractal/ComplexPoint.html?rev=1671603&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/org/apache/chemistry/opencmis/util/content/fractal/ComplexPoint.html (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/org/apache/chemistry/opencmis/util/content/fractal/ComplexPoint.html Mon Apr 6 17:13:48 2015 @@ -0,0 +1,68 @@ + + + + +ComplexPoint xref + + + +
+
+1   ////////////////////////////////////////////////////////////////////////////////
+2   /*
+3    * Licensed to the Apache Software Foundation (ASF) under one
+4    * or more contributor license agreements.  See the NOTICE file
+5    * distributed with this work for additional information
+6    * regarding copyright ownership.  The ASF licenses this file
+7    * to you under the Apache License, Version 2.0 (the
+8    * "License"); you may not use this file except in compliance
+9    * with the License.  You may obtain a copy of the License at
+10   *
+11   * http://www.apache.org/licenses/LICENSE-2.0
+12   *
+13   * Unless required by applicable law or agreed to in writing,
+14   * software distributed under the License is distributed on an
+15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+16   * KIND, either express or implied.  See the License for the
+17   * specific language governing permissions and limitations
+18   * under the License.
+19   */
+20  
+21  package org.apache.chemistry.opencmis.util.content.fractal;
+22  
+23  public class ComplexPoint {
+24      private double real;
+25      private double imaginary;
+26  
+27      public ComplexPoint(double real, double imaginary) {
+28          this.real = real;
+29          this.imaginary = imaginary;
+30      }
+31  
+32      public ComplexPoint() {
+33          real = 0.0;
+34          imaginary = 0.0;
+35      }
+36  
+37      public double getImaginary() {
+38          return imaginary;
+39      }
+40  
+41      public double getReal() {
+42          return real;
+43      }
+44  
+45      public void set(ComplexPoint cp) {
+46          real = cp.getReal();
+47          imaginary = cp.getImaginary();
+48      }
+49  
+50      public void set(double cr, double ci) {
+51          real = cr;
+52          imaginary = ci;
+53      }
+54  }
+
+
+ + Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/org/apache/chemistry/opencmis/util/content/fractal/ComplexRectangle.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/org/apache/chemistry/opencmis/util/content/fractal/ComplexRectangle.html?rev=1671603&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/org/apache/chemistry/opencmis/util/content/fractal/ComplexRectangle.html (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/org/apache/chemistry/opencmis/util/content/fractal/ComplexRectangle.html Mon Apr 6 17:13:48 2015 @@ -0,0 +1,105 @@ + + + + +ComplexRectangle xref + + + +
+
+1   ////////////////////////////////////////////////////////////////////////////////
+2   ////////////////////////////////////////////////////////////////////////////////
+3   /*
+4    * Licensed to the Apache Software Foundation (ASF) under one
+5    * or more contributor license agreements.  See the NOTICE file
+6    * distributed with this work for additional information
+7    * regarding copyright ownership.  The ASF licenses this file
+8    * to you under the Apache License, Version 2.0 (the
+9    * "License"); you may not use this file except in compliance
+10   * with the License.  You may obtain a copy of the License at
+11   *
+12   * http://www.apache.org/licenses/LICENSE-2.0
+13   *
+14   * Unless required by applicable law or agreed to in writing,
+15   * software distributed under the License is distributed on an
+16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+17   * KIND, either express or implied.  See the License for the
+18   * specific language governing permissions and limitations
+19   * under the License.
+20   */
+21  
+22  package org.apache.chemistry.opencmis.util.content.fractal;
+23  
+24  
+25  public class ComplexRectangle {
+26      private double iMin; // imaginary
+27      private double iMax;
+28      private double rMin; // real
+29      private double rMax;
+30  
+31      public ComplexRectangle(double r1, double r2, double i1, double i2) {
+32          set(r1, r2, i1, i2);
+33      }
+34  
+35      public ComplexRectangle() {
+36          set(0.0, 0.0, 0.0, 0.0);
+37      }
+38  
+39      public ComplexRectangle(ComplexRectangle cr) {
+40          set(cr);
+41      }
+42  
+43      public double getIMin() {
+44          return iMin;
+45      }
+46  
+47      public double getIMax() {
+48          return iMax;
+49      }
+50  
+51      public double getRMin() {
+52          return rMin;
+53      }
+54  
+55      public double getRMax() {
+56          return rMax;
+57      }
+58  
+59      public double getHeight() {
+60          return iMax - iMin;
+61      }
+62  
+63      public double getWidth() {
+64          return rMax - rMin;
+65      }
+66  
+67      public void set(ComplexRectangle cr) {
+68          set(cr.getRMin(), cr.getRMax(), cr.getIMin(), cr.getIMax());
+69      }
+70  
+71      public void set(ComplexPoint p1, ComplexPoint p2) {
+72          set(p1.getReal(), p2.getReal(), p1.getImaginary(), p2.getImaginary());
+73      }
+74  
+75      public void set(double r1, double r2, double i1, double i2) {
+76          if (r1 > r2) {
+77              rMin = r2;
+78              rMax = r1;
+79          } else {
+80              rMin = r1;
+81              rMax = r2;
+82          }
+83          if (i1 > i2) {
+84              iMin = i2;
+85              iMax = i1;
+86          } else {
+87              iMin = i1;
+88              iMax = i2;
+89          }
+90      }
+91  }
+
+
+ + Added: chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/org/apache/chemistry/opencmis/util/content/fractal/FractalCalculator.html URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/org/apache/chemistry/opencmis/util/content/fractal/FractalCalculator.html?rev=1671603&view=auto ============================================================================== --- chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/org/apache/chemistry/opencmis/util/content/fractal/FractalCalculator.html (added) +++ chemistry/site/trunk/content/java/0.13.0/maven/chemistry-opencmis-test/chemistry-opencmis-test-util/xref/org/apache/chemistry/opencmis/util/content/fractal/FractalCalculator.html Mon Apr 6 17:13:48 2015 @@ -0,0 +1,179 @@ + + + + +FractalCalculator xref + + + +
+
+1   ////////////////////////////////////////////////////////////////////////////////
+2   ////////////////////////////////////////////////////////////////////////////////
+3   /*
+4    * Licensed to the Apache Software Foundation (ASF) under one
+5    * or more contributor license agreements.  See the NOTICE file
+6    * distributed with this work for additional information
+7    * regarding copyright ownership.  The ASF licenses this file
+8    * to you under the Apache License, Version 2.0 (the
+9    * "License"); you may not use this file except in compliance
+10   * with the License.  You may obtain a copy of the License at
+11   *
+12   * http://www.apache.org/licenses/LICENSE-2.0
+13   *
+14   * Unless required by applicable law or agreed to in writing,
+15   * software distributed under the License is distributed on an
+16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+17   * KIND, either express or implied.  See the License for the
+18   * specific language governing permissions and limitations
+19   * under the License.
+20   */
+21  
+22  package org.apache.chemistry.opencmis.util.content.fractal;
+23  
+24  import java.awt.Color;
+25  import java.awt.image.BufferedImage;
+26  import java.util.Arrays;
+27  
+28  final class FractalCalculator {
+29      private int[] colorMap;
+30      protected int[][] noIterations;
+31      private double delta;
+32      private double iRangeMax;
+33      private double iRangeMin;
+34      private int maxIterations;
+35      private ComplexRectangle newRect;
+36      private int numColors;
+37      private int imageHeight;
+38      private int imageWidth;
+39      private double rRangeMax;
+40      private double rRangeMin;
+41      // For Julia set:
+42      private double cJuliaPointR = 0.0; // Real
+43      private double cJuliaPointI = 0.0; // Imaginary
+44      boolean useJulia = false;
+45  
+46      public FractalCalculator(ComplexRectangle complRect, int maxIters, int imgWidth, int imgHeight, int[] colMap,
+47              ComplexPoint juliaPoint) {
+48          maxIterations = maxIters;
+49          newRect = complRect;
+50          imageWidth = imgWidth;
+51          imageHeight = imgHeight;
+52          colorMap = Arrays.copyOf(colMap, colMap.length);
+53          numColors = colorMap.length;
+54          rRangeMin = newRect.getRMin();
+55          rRangeMax = newRect.getRMax();
+56          iRangeMin = newRect.getIMin();
+57          iRangeMax = newRect.getIMax();
+58          delta = (rRangeMax - rRangeMin) / imageWidth;
+59          if (null != juliaPoint) {
+60              cJuliaPointR = juliaPoint.getReal();
+61              cJuliaPointI = juliaPoint.getImaginary();
+62              useJulia = true;
+63          }
+64      }
+65  
+66      public int[][] calcFractal() {
+67          noIterations = new int[ imageWidth ][ imageHeight ];
+68  
+69          // For each pixel...
+70          for (int x = 0; x < imageWidth; x++) {
+71              for (int y = 0; y < imageHeight; y++) {
+72                  double zR = rRangeMin + x * delta;
+73                  double zI = iRangeMin + (imageHeight - y) * delta;
+74  
+75                  // Is the point inside the set?
+76                  if (useJulia) {
+77                      noIterations[x][y] = testPointJuliaSet(zR, zI, maxIterations);
+78                  } else {
+79                      noIterations[x][y] = testPointMandelbrot(zR, zI, maxIterations);
+80                  }            
+81              }
+82          }
+83          return noIterations;
+84      }
+85  
+86      public BufferedImage mapItersToColors(int[][] iterations) {
+87  
+88          // Assign a color to every pixel ( x , y ) in the Image, corresponding
+89          // to
+90          // one point, z, in the imaginary plane ( zr, zi ).
+91          BufferedImage image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_3BYTE_BGR );
+92  
+93          // For each pixel...
+94          for (int x = 0; x < imageWidth; x++) {
+95              for (int y = 0; y < imageHeight; y++) {
+96                  int color = getColor(iterations[x][y]);
+97                  image.setRGB(x, y, color);
+98              }
+99          }
+100         return image;
+101     }
+102 
+103     protected int getColor(int numIterations) {
+104         int c = Color.black.getRGB();
+105 
+106         if (numIterations != 0) {
+107             // The point is outside the set. It gets a color based on the number
+108             // of iterations it took to know this.
+109             int colorNum = (int) (numColors * (1.0 - (float) numIterations / (float) maxIterations));
+110             colorNum = (colorNum == numColors) ? 0 : colorNum;
+111 
+112             c = colorMap[colorNum];
+113         }
+114         return c;
+115     }
+116 
+117     private int testPointMandelbrot(double cR, double cI, int maxIterations) {
+118         // Is the given complex point, (cR, cI), in the Mandelbrot set?
+119         // Use the formula: z <= z*z + c, where z is initially equal to c.
+120         // If |z| >= 2, then the point is not in the set.
+121         // Return 0 if the point is in the set; else return the number of
+122         // iterations it took to decide that the point is not in the set.
+123         double zR = cR;
+124         double zI = cI;
+125 
+126         for (int i = 1; i <= maxIterations; i++) {
+127             // To square a complex number: (a+bi)(a+bi) = a*a - b*b + 2abi
+128             double zROld = zR;
+129             zR = zR * zR - zI * zI + cR;
+130             zI = 2 * zROld * zI + cI;
+131 
+132             // We know that if the distance from z to the origin is >= 2
+133             // then the point is out of the set. To avoid a square root,
+134             // we'll instead check if the distance squared >= 4.
+135             double distSquared = zR * zR + zI * zI;
+136             if (distSquared >= 4) {
+137                 return i;
+138             }
+139         }
+140         return 0;
+141     }
+142 
+143     private int testPointJuliaSet(double zR, double zI, int maxIterations) {
+144         // Is the given complex point, (zR, zI), in the Julia set?
+145         // Use the formula: z <= z*z + c, where z is the point being tested,
+146         // and c is the Julia Set constant.
+147         // If |z| >= 2, then the point is not in the set.
+148         // Return 0 if the point is in the set; else return the number of
+149         // iterations it took to decide that the point is not in the set.
+150         for (int i = 1; i <= maxIterations; i++) {
+151             double zROld = zR;
+152             // To square a complex number: (a+bi)(a+bi) = a*a - b*b + 2abi
+153             zR = zR * zR - zI * zI + cJuliaPointR;
+154             zI = 2 * zROld * zI + cJuliaPointI;
+155             // We know that if the distance from z to the origin is >= 2
+156             // then the point is out of the set. To avoid a square root,
+157             // we'll instead check if the distance squared >= 4.
+158             double distSquared = zR * zR + zI * zI;
+159             if (distSquared >= 4) {
+160                 return i;
+161             }
+162         }
+163         return 0;
+164     }
+165 }
+
+
+ +