Package java.awt

Examples of java.awt.Stroke


        g2.draw(path);
    }

    private void drawGrid(Graphics2D g2) {
        Stroke stroke = g2.getStroke();

        drawVerticalGrid(g2);
        drawHorizontalGrid(g2);

        if (drawText) {
View Full Code Here


    private void drawHorizontalGrid(Graphics2D g2) {
        double minorSpacing = majorY / minorY;
        double axisV = xPositionToPixel(originX);

        Stroke gridStroke = new BasicStroke(STROKE_GRID);
        Stroke axisStroke = new BasicStroke(STROKE_AXIS);

        for (double y = originY + majorY; y < maxY + majorY; y += majorY) {
            g2.setStroke(gridStroke);
            g2.setColor(COLOR_MINOR_GRID);
            for (int i = 0; i < minorY; i++) {
View Full Code Here

    private void drawVerticalGrid(Graphics2D g2) {
        double minorSpacing = majorX / minorX;
        double axisH = yPositionToPixel(originY);

        Stroke gridStroke = new BasicStroke(STROKE_GRID);
        Stroke axisStroke = new BasicStroke(STROKE_AXIS);

        for (double x = originX + majorX; x < maxX + majorX; x += majorX) {
            g2.setStroke(gridStroke);
            g2.setColor(COLOR_MINOR_GRID);
            for (int i = 0; i < minorX; i++) {
View Full Code Here

    private void drawAxis(Graphics2D g2) {
        double axisH = yPositionToPixel(originY);
        double axisV = xPositionToPixel(originX);

        g2.setColor(COLOR_AXIS);
        Stroke stroke = g2.getStroke();
        g2.setStroke(new BasicStroke(STROKE_AXIS));

        g2.drawLine(0, (int) axisH, getWidth(), (int) axisH);
        g2.drawLine((int) axisV, 0, (int) axisV, getHeight());
View Full Code Here

                // This should not happen.
                throw new WorkflowRuntimeException();
            }
            g.setColor(Color.RED);

            Stroke originalStroke = g.getStroke();
            if (kind == Kind.CONTROL_IN || kind == Kind.CONTROL_OUT) {
                g.setStroke(EdgeGUI.CONTROL_EDGE_STROKE);
            }
            EdgeGUI.paintLine(p1, p2, g);
            g.setStroke(originalStroke);
View Full Code Here

      } // synchronized( bufSync )

      // System.err.println( "busyList.size() = "+busyList.size() );

      if( toPCM ) {
        final Stroke strkOrig = g2.getStroke();
        g2.setStroke( strkLine );
        g2.setPaint( pntLine );
        for( int ch = 0; ch < fullChannels; ch++ ) {
          r = view.rectForChannel( ch );
          g2.clipRect( r.x, r.y, r.width, r.height );
View Full Code Here

        if(shape.isFilled() || shape.hasShadow() && shape.shadowFillsShape()) {
          g.setColor(shape.getFillingCol());
          g.fill(bounds);
        }

        final Stroke oldStroke = g.getStroke();
        final double hAngle   = shape.getHatchingsAngle();

        if(fStyle==FillingStyle.VLINES || fStyle==FillingStyle.VLINES_PLAIN)
          paintHatchings2(g, hAngle, bounds);
        else
View Full Code Here

            }
            catch (InvalidArgumentException e) {
                // Should never happen, but leave the color null in case it does.
            }

            Stroke stroke = new BasicStroke(pointInfo.getWeight());

            if (pointInfo.getDataType() == DataTypes.NUMERIC) {
                point.setStats(new AnalogStatistics(start, end, pointInfo.getStartValue() == null ? null : pointInfo
                        .getStartValue().getDoubleValue()));
View Full Code Here

        throws IOException, ClassNotFoundException {

        if (stream == null) {
            throw new IllegalArgumentException("Null 'stream' argument.");
        }
        Stroke result = null;
        final boolean isNull = stream.readBoolean();
        if (!isNull) {
            final Class c = (Class) stream.readObject();
            if (c.equals(BasicStroke.class)) {
                final float width = stream.readFloat();
View Full Code Here

            }
        }
       
        if (style != null) {
            float dashPhase = 0;
            Stroke stroke = new BasicStroke(lineWidth,
                                            BasicStroke.CAP_ROUND,
                                            BasicStroke.JOIN_ROUND,
                                            2,
                                            style,
                                            dashPhase);
View Full Code Here

TOP

Related Classes of java.awt.Stroke

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.