Package org.locationtech.udig.ui.graphics

Examples of org.locationtech.udig.ui.graphics.ViewportGraphics.drawLine()


            Point startPoint = (Point) start.getObject();
            Point endPoint = (Point) end.getObject();           
            java.awt.Point startPixel = context.worldToPixel( startPoint.getCoordinate() );
            java.awt.Point endPixel = context.worldToPixel( endPoint.getCoordinate() );
           
            graphics.drawLine(startPixel.x, startPixel.y, endPixel.x, endPixel.y);           
            double angle = Angle.angle(startPoint.getCoordinate(), endPoint.getCoordinate());
            double dx = Math.cos( angle+0.1 );
            double dy = Math.sin( angle+0.1 );
            graphics.drawLine(
                    endPixel.x, endPixel.y,
View Full Code Here


           
            graphics.drawLine(startPixel.x, startPixel.y, endPixel.x, endPixel.y);           
            double angle = Angle.angle(startPoint.getCoordinate(), endPoint.getCoordinate());
            double dx = Math.cos( angle+0.1 );
            double dy = Math.sin( angle+0.1 );
            graphics.drawLine(
                    endPixel.x, endPixel.y,
                    (int)(endPixel.x - (10.0*dx)),
                    (int)(endPixel.y + (10.0*dy)));
            dx = Math.cos( angle-0.1 );
            dy = Math.sin( angle-0.1 );
View Full Code Here

                    endPixel.x, endPixel.y,
                    (int)(endPixel.x - (10.0*dx)),
                    (int)(endPixel.y + (10.0*dy)));
            dx = Math.cos( angle-0.1 );
            dy = Math.sin( angle-0.1 );
            graphics.drawLine(
                    endPixel.x, endPixel.y,
                    (int)(endPixel.x - (10.0*dx)),
                    (int)(endPixel.y + (10.0*dy)));
            if( path.contains(edge)){
                graphics.setColor( Color.DARK_GRAY);
View Full Code Here

            path.closePath();

            g.fill(path);
            if (style.doGrid && xyRes.x > 1 && xyRes.y > 1) {
                for( int x = ulPoint.x + xyRes.x; x < urPoint.x; x = x + xyRes.x ) {
                    g.drawLine(x, ulPoint.y, x, llPoint.y);
                }
                for( int y = ulPoint.y + xyRes.y; y < llPoint.y; y = y + xyRes.y ) {
                    g.drawLine(urPoint.x, y, ulPoint.x, y);
                }
            }
View Full Code Here

            if (style.doGrid && xyRes.x > 1 && xyRes.y > 1) {
                for( int x = ulPoint.x + xyRes.x; x < urPoint.x; x = x + xyRes.x ) {
                    g.drawLine(x, ulPoint.y, x, llPoint.y);
                }
                for( int y = ulPoint.y + xyRes.y; y < llPoint.y; y = y + xyRes.y ) {
                    g.drawLine(urPoint.x, y, ulPoint.x, y);
                }
            }

            rgba = style.foregroundColor.getColorComponents(null);
            g.setColor(new Color(rgba[0], rgba[1], rgba[2], style.fAlpha));
View Full Code Here

               
            
                Point lastPixel = context.worldToPixel(lastCoord);
                Point thisPixel = context.worldToPixel(thisCoord);
           
                graphics.drawLine(lastPixel.x,
                        lastPixel.y,
                        thisPixel.x,
                        thisPixel.y);
            }
        }
View Full Code Here

               
                Point lastPixel = context.worldToPixel(lastCoord);
                Point thisPixel = context.worldToPixel(thisCoord);
               
                graphics.drawLine(lastPixel.x,
                        lastPixel.y,
                        thisPixel.x,
                        thisPixel.y);
   
            }
View Full Code Here

            if( (pixel.x>=mapPixelWidth && pixel.y>=mapPixelHeight) )
                break;
           
            //draw vertical lines and labels
            if( pixel.x<mapPixelWidth)
                graphics.drawLine(pixel.x,
                                  0,
                                  pixel.x,
                                  mapPixelHeight - BOTTOM_STRIP_HEIGHT + GRID_LINE_EXTENSION);
                if (showLabels) {
                    graphics.drawString((int)(coord.y)+"",
View Full Code Here

                                    ViewportGraphics.ALIGN_TOP);
                }
           
            //draw horizontal lines and labels
            if( pixel.y<mapPixelHeight)
                graphics.drawLine(0,
                                  pixel.y,
                                  mapPixelWidth - RIGHT_STRIP_WIDTH + GRID_LINE_EXTENSION,
                                  pixel.y);
                if (showLabels) {
                    graphics.drawString((int)(coord.x)+"",
View Full Code Here

               
            
                Point lastPixel = context.worldToPixel(lastCoord);
                Point thisPixel = context.worldToPixel(thisCoord);
           
                graphics.drawLine(lastPixel.x,
                        lastPixel.y,
                        thisPixel.x,
                        thisPixel.y);
            }
        }
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.