Package org.locationtech.udig.ui.graphics

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


      this.extent = new Rectangle((int) (point.getX() - halfsize), (int) (point.getY() - halfsize), EXTENT_SIZE,
            EXTENT_SIZE);

      graphics.fillOval(extent.x, extent.y, extent.width, extent.height);
      Rectangle2D stringBounds = graphics.getStringBounds(String.valueOf(getMarkModel().getID()));
      graphics.drawString(String.valueOf(getMarkModel().getID()), (int) point.getX(),
            (int) (point.getY() + stringBounds.getHeight()), ViewportGraphics.ALIGN_MIDDLE,
            ViewportGraphics.ALIGN_BOTTOM);
    }
  }
View Full Code Here


      } else {
        graphics.fillOval(extent.x, extent.y, extent.width, extent.height);
      }

      Rectangle2D stringBounds = graphics.getStringBounds(String.valueOf(mark.getID()));
      graphics.drawString(String.valueOf(mark.getID()), (int) point.getX(),
            (int) (point.getY() + stringBounds.getHeight()), ViewportGraphics.ALIGN_MIDDLE,
            ViewportGraphics.ALIGN_BOTTOM);

    }
View Full Code Here

        }               
             
        java.awt.Point p = context.worldToPixel(worldLocation);
        g.fillOval(p.x, p.y, 10, 10);
        String name = getDisplayName().toString();
        g.drawString(name, p.x + 15, p.y + 15,
                ViewportGraphics.ALIGN_MIDDLE, ViewportGraphics.ALIGN_MIDDLE);

        // draw an ellipse for this seagull
//        Ellipse2D e = new Ellipse2D.Double(coordinate.x-4, coordinate.y-4,10,10);
//        g.draw(e);
View Full Code Here

            }

            // draw the title
            if (textheight != 0) {
                graphics.setColor(legendStyle.fontColor);
                graphics.drawString(titleString, currentX,// +horizontalMargin,
                        currentY,// +textVerticalOffset,
                        ViewportGraphics.ALIGN_LEFT, ViewportGraphics.ALIGN_LEFT);
            }
            currentY = currentY + yInset;
View Full Code Here

                graphics.fillGradientRectangle(currentX, currentY, bWidth, bHeight, actualColor, nextColor, true);

                int tx = round(currentX + 1.5f * bWidth);
                graphics.setColor(legendStyle.fontColor);
                graphics.drawString(String.format("%-8.2f", Float.parseFloat(firstValue)), //$NON-NLS-1$
                        tx,// +horizontalMargin,
                        currentY, // - graphics.getFontAscent(),// +textVerticalOffset,
                        ViewportGraphics.ALIGN_LEFT, ViewportGraphics.ALIGN_MIDDLE);

                currentY = currentY + bHeight;
View Full Code Here

                if (i == colorRules.size() - 1) {
                    // add also last text
                    tx = round(currentX + 1.5f * bWidth);
                    graphics.setColor(legendStyle.fontColor);
                    graphics.drawString(String.format("%-8.2f", Float.parseFloat(secondValue)), //$NON-NLS-1$
                            tx,// +horizontalMargin,
                            currentY, // - graphics.getFontAscent(),// +textVerticalOffset,
                            ViewportGraphics.ALIGN_LEFT, ViewportGraphics.ALIGN_MIDDLE);
                }

View Full Code Here

            }

            // draw the title
            if (textheight != 0) {
                graphics.setColor(legendStyle.fontColor);
                graphics.drawString(titleString, currentX,// +horizontalMargin,
                        currentY,// +textVerticalOffset,
                        ViewportGraphics.ALIGN_LEFT, ViewportGraphics.ALIGN_LEFT);
            }
            currentY = currentY + yInset;
View Full Code Here

                int tx = round(currentX + 1.5f * bWidth);
                int tHeight = (int) round(graphics.getStringBounds(attribute).getHeight());
                graphics.setColor(legendStyle.fontColor);
                int ty = round(currentY - graphics.getFontAscent() + tHeight);// + tHeight -
                // bHeight/3f);
                graphics.drawString(attribute, tx,// +horizontalMargin,
                        ty, // - graphics.getFontAscent(),// +textVerticalOffset,
                        ViewportGraphics.ALIGN_LEFT, ViewportGraphics.ALIGN_MIDDLE);

                currentY = round(currentY + 4f / 3f * bHeight);

 
View Full Code Here

            anchorPointX = configBean.getWidth();
        } else {
            horizAlignment = ViewportGraphics.ALIGN_LEFT;
            anchorPointX = 0;
        }
        g.drawString(configBean.getLabel()+"1:"+denomStr, anchorPointX, configBean.getHeight() / 2, horizAlignment, ViewportGraphics.ALIGN_MIDDLE); //$NON-NLS-1$
    }

    private ScaleDenomMapGraphicBean getConfigBean(IStyleBlackboard styleBlackboard) {
        ScaleDenomMapGraphicBean configBean = (ScaleDenomMapGraphicBean) styleBlackboard.get(ScaleDenomMapGraphicBean.KEY);
       
View Full Code Here

      g.draw(right);

      //TODO: center the N properly.  presently it relies on the default font and font size
            // to be some particular values
            g.setColor(Color.BLACK);
            g.drawString("N", arrowCenterX-5, nTop, ViewportGraphics.ALIGN_LEFT, ViewportGraphics.ALIGN_MIDDLE); //$NON-NLS-1$
           
     
    } finally {
      g.setTransform( t );
    }
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.