Examples of Translation


Examples of com.sencha.gxt.chart.client.draw.Translation

    setOpacity(sprite.opacity);
    setSurface(sprite.surface);
    setStroke(sprite.stroke);
    setFill(sprite.fill);
    if (sprite.translation != null) {
      setTranslation(new Translation(sprite.translation));
    }
    if (sprite.rotation != null) {
      setRotation(new Rotation(sprite.rotation));
    }
    if (sprite.scaling != null) {
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.Translation

        }
        shadowSprite.setStrokeWidth(shadowBarAttr.getStrokeWidth());
        shadowSprite.setStrokeOpacity(shadowBarAttr.getStrokeOpacity());
        shadowSprite.setStroke(shadowBarAttr.getStroke());
        shadowSprite.setFill(Color.NONE);
        shadowSprite.setTranslation(new Translation(shadowBarAttr.getTranslation()));
        shadows.add(shadowSprite);
        chart.addSprite(shadowSprite);
      }
      if (chart.isAnimated() && chart.isResizing()) {
        if (column) {
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.Translation

    double deltaScaleX = 1;
    double deltaScaleY = 1;
    Matrix matrix = new Matrix();
    Rotation rotation = sprite.getRotation();
    Scaling scaling = sprite.getScaling();
    Translation translation = sprite.getTranslation();
    XElement element = getElement(sprite);
    Style style = element.getStyle();
    Element skew = element.getPropertyJSO("skew").cast();

    if (rotation != null) {
      matrix.rotate(rotation.getDegrees(), rotation.getX(), rotation.getY());
      deltaDegrees += rotation.getDegrees();
    }
    if (scaling != null) {
      matrix.scale(scaling.getX(), scaling.getY(), scaling.getCenterX(), scaling.getCenterY());
      deltaScaleX *= scaling.getX();
      deltaScaleY *= scaling.getY();
    }
    if (translation != null) {
      matrix.translate(translation.getX(), translation.getY());
    }
    if (viewBoxShift != null) {
      matrix.scale(viewBoxShift.getX(), viewBoxShift.getY(), -1, -1);
      matrix.add(1, 0, 0, 1, viewBoxShift.getCenterX(), viewBoxShift.getCenterY());
    }
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.Translation

      for (int i = 0; i < markerIndex; i++) {
        marker = sprites.get(i);
        sprites.remove(i);
        sprites.add(marker);
        Sprite markerTemp = sprites.get(sprites.size() - 2);
        marker.setTranslation(new Translation(markerTemp.getTranslation()));
        marker.redraw();
      }
    }

    calculateBounds();

    double x = 0;
    double y = 0;
    boolean gap = false;
    for (int i = 0; i < store.size(); i++) {
      PrecisePoint point = coordinates.get(i);
      if (point != null) {
        x = point.getX();
        y = point.getY();
      } else {
        x = y = Double.NaN;
      }
      if (!Double.isNaN(x) && !Double.isNaN(y)) {
        if (onbreak) {
          onbreak = false;
        }
        if (lineCommands.size() > 0 && !gap) {
          lineCommands.add(new LineTo(x, y));
        } else {
          lineCommands.add(new MoveTo(x, y));
          gap = false;
        }
        gapPosition.put(String.valueOf(lineCommands.size() - 1), i);
      } else if (!gapless) {
        gap = true;
      }

      if (Double.isNaN(firstY) && !Double.isNaN(y)) {
        firstY = y;
      }
    }

    List<PathCommand> renderCommands;

    if (smooth && lineCommands.size() > 0) {
      PathSprite smooth = new PathSprite();
      smooth.setCommands(lineCommands);
      renderCommands = smooth.copy().toSmooth(segments).getCommands();
    } else {
      renderCommands = PathSprite.copyCommands(lineCommands);
    }

    // Correct path if we're animating timeAxis intervals
    if (markerIndex > 0 && previousCommands != null && previousCommands.size() > 1) {
      previousCommands.remove(1);
      line.setCommands(previousCommands);
      if (chart.hasShadows()) {
        for (int i = 0; i < lineShadows.size(); i++) {
          PathSprite shadow = lineShadows.get(i);
          shadow.setCommands(previousCommands);
        }
      }
    }

    List<PathCommand> dummyCommands = new ArrayList<PathCommand>();
    dummyCommands.add(new MoveTo(bbox.getX(), bbox.getY() + bbox.getHeight() / 2.0));
    for (int k = 1; k < lineCommands.size(); k++) {
      dummyCommands.add(new LineTo(bbox.getX() + bbox.getWidth() / k, bbox.getY() + bbox.getHeight() / 2.0));
    }

    // Only create a line if one doesn't exist.
    if (line == null) {
      line = new PathSprite();
      line.setStroke(stroke);
      chart.addSprite(line);
      line.setCommands(dummyCommands);

      if (chart.hasShadows()) {
        // create shadows
        for (int i = 0; i < shadowGroups.size(); i++) {
          PathSprite shadow = new PathSprite();
          Sprite shadowAttr = shadowAttributes.get(i);
          shadow.setStrokeWidth(shadowAttr.getStrokeWidth());
          shadow.setStrokeOpacity(shadowAttr.getStrokeOpacity());
          shadow.setStroke(shadowAttr.getStroke());
          shadow.setTranslation(new Translation(shadowAttr.getTranslation()));
          shadow.setFill(Color.NONE);
          shadow.setCommands(line.getCommands());
          chart.addSprite(shadow);
          lineShadows.add(shadow);
        }
View Full Code Here

Examples of com.sencha.gxt.chart.client.draw.Translation

  }

  @Override
  protected int getIndex(PrecisePoint point) {
    for (int i = 0; i < sprites.size(); i++) {
      Translation trans = sprites.get(i).getTranslation();
      if (point.equalsNoPrecision(new PrecisePoint(trans.getX(), trans.getY()), selectionTolerance)) {
        return i;
      }
    }
    return -1;
  }
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.map.TranslationTable.Translation

        if (fields.length != 2) {
          this.log.warn("Skipping line with " +
              fields.length + " instead of 2 columns in CSV file " + this.url);
          continue;
        }
        result.add(new Translation(fields[0], fields[1]));
      }
      return result;
    } catch (IOException iex) {
      throw new D2RQException(iex);
    }
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.map.TranslationTable.Translation

public class TranslationTableParserTest extends TestCase {
  private Collection<Translation> simpleTranslations;
 
  public void setUp() {
    this.simpleTranslations = new HashSet<Translation>();
    this.simpleTranslations.add(new Translation("db1", "rdf1"));
    this.simpleTranslations.add(new Translation("db2", "rdf2"));
  }
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.map.TranslationTable.Translation

  public void testSimple() {
    String csv = "key,value";
    Collection<Translation> translations = new TranslationTableParser(
        new StringReader(csv)).parseTranslations();
    assertEquals(1, translations.size());
    Translation t = (Translation) translations.iterator().next();
    assertEquals("key", t.dbValue());
    assertEquals("value", t.rdfValue());
  }
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.map.TranslationTable.Translation

    assertNull(translator.toRDFValue(null));
    assertNull(translator.toDBValue(null));
  }
 
  public void testTranslationsWithSameValuesAreEqual() {
    Translation t1 = new Translation("foo", "bar");
    Translation t2 = new Translation("foo", "bar");
    assertEquals(t1, t2);
    assertEquals(t1.hashCode(), t2.hashCode());
  }
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.map.TranslationTable.Translation

    assertEquals(t1, t2);
    assertEquals(t1.hashCode(), t2.hashCode());
  }
 
  public void testTranslationsWithDifferentValuesAreNotEqual() {
    Translation t1 = new Translation("foo", "bar");
    Translation t2 = new Translation("foo", "bar2");
    Translation t3 = new Translation("foo2", "bar");
    assertFalse(t1.equals(t2));
    assertFalse(t2.equals(t1));
    assertFalse(t1.hashCode() == t2.hashCode());
    assertFalse(t1.equals(t3));
    assertFalse(t3.equals(t1));
    assertFalse(t1.hashCode() == t3.hashCode());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.