Package java.awt

Examples of java.awt.BasicStroke$DashIterator


            posY= (int)Math.round(((oy - currentPoint.y) * sy));
        }

        // draw current point
        g2.setColor(Color.RED);
        g2.setStroke(new BasicStroke());
        g2.fillOval(posX - 5, posY - 5, 10, 10);


        // Display slope
        double slopeX =  currentPoint.slop_x * sx;
        double slopeY =  currentPoint.slop_y * sy;

        // Normalize slope vector
        double lenth =  Math.sqrt(slopeX*slopeX + slopeY*slopeY);
        slopeX = (slopeX/lenth) * SLOP_LENGTH;
        slopeY = (slopeY/lenth) * SLOP_LENGTH;

        int slopeEndposX = (int)Math.round(posX  + slopeX );
        int slopeEndposY = (int)Math.round(posY -slopeY);

        g2.setStroke(new BasicStroke(2));
        g2.draw(new Line2D.Double(posX, posY, slopeEndposX, slopeEndposY));

        // Draw arrow
        double  theta = Math.atan2((slopeEndposY-posY),(slopeEndposX-posX));

View Full Code Here


                float bb=(float)((hsbs[2]+0.5)%1.0);
                Color newColor = Color.getHSBColor(hsbs[0], hsbs[1], bb);
                g2.setColor(newColor);

                Stroke oldStroke = g2.getStroke();
                g2.setStroke(new BasicStroke());

                PathIterator p=getPathIterator(null);
                if (p instanceof CurveIterator){
                    CurveIterator cu = (CurveIterator)p;
                    double[] v=new double[2];
View Full Code Here

            AffineTransform oldTrasfrom = g.getTransform();
            Stroke oldStroke = g.getStroke();
           
            g.translate(_ox, _oy - _h);
            g.scale(_w / 10., _h/ 10.);
            g.setStroke(new BasicStroke(0.1f));
           
            for(int i=0;i<symbol.length;i++){
               g.draw(symbol[i]);
               g.fill(symbol[i]);
            }
View Full Code Here

    Line2D line = new Line2D.Double(one, two);
    if (stroke != null) {
      g2.setStroke(stroke);
    }
    else{
      g2.setStroke(new BasicStroke());
    }
    g2.draw(line);
  }
View Full Code Here

  }

  private void createGridStroke(){
    if(_withDashedGrid==true){
      final float dash[] = {5.0f,5.0f};
      _gridStroke=new BasicStroke(0.1f, 0, 0, 1.0f,dash, 0.0f);
    }
    else{
      _gridStroke=new BasicStroke(0.1f);
    }
  }
View Full Code Here

     * @param g graphics context
     * @param t 2D affine transform
     */
    public void paintShape (Graphics2D g, AffineTransform t)
    {
        g.setStroke (new BasicStroke (this.getThickness (),
          BasicStroke.CAP_ROUND,BasicStroke.CAP_ROUND));
        if (fill)
        {
            g.fill (createPoly (t));
        }
View Full Code Here

      jasperPrint.getPageWidth(),
      jasperPrint.getPageHeight()
      );

    grx.setColor(Color.black);
    grx.setStroke(new BasicStroke(1));

    /*   */
    frameDrawer.draw(grx, page.getElements(), getOffsetX(), getOffsetY());
   
    if (progressMonitor != null)
View Full Code Here

      switch (lineStyle)
      {
        case DOUBLE :
        {
          return
            new BasicStroke(
              lineWidth / 3,
              lineCap,
              BasicStroke.JOIN_MITER
              );
        }
        case DOTTED :
        {
          switch (lineCap)
          {
            case BasicStroke.CAP_SQUARE :
            {
              return
                new BasicStroke(
                  lineWidth,
                  lineCap,
                  BasicStroke.JOIN_MITER,
                  10f,
                  new float[]{0, 2 * lineWidth},
                  0f
                  );
            }
            case BasicStroke.CAP_BUTT :
            {
              return
                new BasicStroke(
                  lineWidth,
                  lineCap,
                  BasicStroke.JOIN_MITER,
                  10f,
                  new float[]{lineWidth, lineWidth},
                  0f
                  );
            }
          }
        }
        case DASHED :
        {
          switch (lineCap)
          {
            case BasicStroke.CAP_SQUARE :
            {
              return
                new BasicStroke(
                  lineWidth,
                  lineCap,
                  BasicStroke.JOIN_MITER,
                  10f,
                  new float[]{4 * lineWidth, 4 * lineWidth},
                  0f
                  );
            }
            case BasicStroke.CAP_BUTT :
            {
              return
                new BasicStroke(
                  lineWidth,
                  lineCap,
                  BasicStroke.JOIN_MITER,
                  10f,
                  new float[]{5 * lineWidth, 3 * lineWidth},
                  0f
                  );
            }
          }
        }
        case SOLID :
        default :
        {
          return
            new BasicStroke(
              lineWidth,
              lineCap,
              BasicStroke.JOIN_MITER
              );
        }
View Full Code Here

     * @param g graphics context
     * @param t 2D affine transform
     */
    public void paintShape (Graphics2D g, AffineTransform t)
    {
        g.setStroke (new BasicStroke (this.getThickness (),
          BasicStroke.CAP_ROUND,BasicStroke.CAP_ROUND));
        if (fill)
        {
            g.fill (createPoly (t));
        }
View Full Code Here

  }

  private void drawPolygon(Graphics2D gr, FeatureStyleInfo fsi, int iconSize) throws AdvancedviewsException {
    int x = 0, y = 0, w = iconSize - 1, h = iconSize - 1;
    float[] paniponidash = toDashArray(fsi.getDashArray());
    Stroke stroke = new BasicStroke(fsi.getStrokeWidth(), BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, 1.0f,
        paniponidash, 0.0f);
    gr.setColor(toColor(fsi.getFillColor(), fsi.getFillOpacity()));
    int linewidth = fsi.getStrokeWidth();
    int halfLinewidth = linewidth / 2; // cut int value !!
    w -= halfLinewidth * 2;
 
View Full Code Here

TOP

Related Classes of java.awt.BasicStroke$DashIterator

Copyright © 2018 www.massapicom. 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.