コード例 #1
0
ファイル: AWTDrawer.java プロジェクト: NetLand-NTU/NetLand
 /*
  * (non-Javadoc)
  *
  * @see org.math.plot.render.AbstractDrawer#drawLineRatio(double[],
  *      double[])
  */
 public void drawLineBase(double[]... rC) {
   int[][] sC = new int[rC.length][];
   for (int i = 0; i < sC.length; i++) {
     sC[i] = projection.screenProjectionBase(rC[i]);
   }
   drawLine(sC);
 }
コード例 #2
0
ファイル: AWTDrawer.java プロジェクト: NetLand-NTU/NetLand
  /*
   * (non-Javadoc)
   *
   * @see org.math.plot.render.AbstractDrawer#drawStringRatio(java.lang.String,
   *      double[], double, double, double)
   */
  public void drawTextBase(String label, double... rC) {
    int[] sC = projection.screenProjectionBase(rC);

    // Corner offset adjustment : Text Offset is used Here
    FontRenderContext frc = comp2D.getFontRenderContext();
    Font font1 = comp2D.getFont();
    int x = sC[0];
    int y = sC[1];
    double w = font1.getStringBounds(label, frc).getWidth();
    double h = font1.getSize2D();
    x -= (int) (w * text_Eastoffset);
    y += (int) (h * text_Northoffset);

    int wc = (int) (w * FastMath.cos(text_angle) + h * FastMath.sin(text_angle));
    int hc = (int) (h * FastMath.cos(text_angle) + w * FastMath.sin(text_angle));
    if (!comp2D.hitClip(x, y, wc, hc)) {
      return;
    }

    if (text_angle != 0) {
      comp2D.rotate(text_angle, x + w / 2, y - h / 2);
    }

    String[] lines = label.split("\n");
    for (int i = 0; i < lines.length; i++) {
      comp2D.drawString(lines[i], x, y);
      y += h;
    }
    // comp2D.drawString(label, x, y);

    if (text_angle != 0) {
      comp2D.rotate(-text_angle, x + w / 2, y - h / 2);
    }
  }
コード例 #3
0
ファイル: AWTDrawer.java プロジェクト: NetLand-NTU/NetLand
 /*
  * (non-Javadoc)
  *
  * @see org.math.plot.render.AbstractDrawer#projectRatio(double[])
  */
 public int[] projectBase(double... rC) {
   return projection.screenProjectionBase(rC);
 }