Package java.awt

Examples of java.awt.Graphics2D.create()


  public void clip(final StrictBounds bounds)
  {
    final Graphics2D g = getGraphics();
    graphicsContexts.push(g);

    graphics = (Graphics2D) g.create();
    graphics.clip(StrictGeomUtility.createAWTRectangle(bounds));
  }

  public void clearClipping()
  {
View Full Code Here


  {
    Graphics2D g2 = state.g;

    if (flipH || flipV)
    {
      g2 = (Graphics2D) g2.create();
      int sx = 1;
      int sy = 1;
      int dx = 0;
      int dy = 0;
View Full Code Here

                            if (currentSnippetCodeFileInfo != codeFileInfo ||
                                    currentSnippet != snippet) {
                                // if not painting the "current" snippet, then fade the glyph
                                if (g2Alpha == null) {
                                    // first time, so create composite
                                    g2Alpha = (Graphics2D)g2.create();                               
                                    g2Alpha.setComposite(AlphaComposite.getInstance(
                                            AlphaComposite.SRC_OVER, 0.6f));
                                }
                                g2 = g2Alpha;
                            }
View Full Code Here

  public void paint (Graphics g) {
    if (!displayEnabled) return;
    if (!isValid()) super.validate();
    Graphics2D g2d = (Graphics2D)g;
    if (tappedAngle > 0) {
      g2d = (Graphics2D)g2d.create();
      float edgeOffset = cardWidth / 2f;
      g2d.rotate(tappedAngle, cardXOffset + edgeOffset, cardYOffset + cardHeight - edgeOffset);
    }
    super.paint(g2d);
  }
View Full Code Here

        g = image.createGraphics();
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        LanesRenderer renderer = new LanesRenderer();
        for (int i = 0; i < commitList.size(); i++) {
          PlotCommit<Lane> commit = commitList.get(i);
          Graphics row = g.create(0, i*rowHeight, graphWidth, rowHeight);
          try {
            renderer.paint(row, commit, rowHeight, graphWidth);
          } finally {
            row.dispose();
            row = null;
View Full Code Here

        g = image.createGraphics();
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        LanesRenderer renderer = new LanesRenderer();
        for (int i = 0; i < commitList.size(); i++) {
          PlotCommit<Lane> commit = commitList.get(i);
          Graphics row = g.create(0, i*rowHeight, graphWidth, rowHeight);
          try {
            renderer.paint(row, commit, rowHeight, graphWidth);
          } finally {
            row.dispose();
            row = null;
View Full Code Here

            float edgeOffset = (cardWidth + cardXOffset) / 2f;
            g2d.translate(edgeOffset * (1 - transformAngle), 0);
            g2d.scale(transformAngle, 1);
        }
        if (tappedAngle + flippedAngle > 0) {
            g2d = (Graphics2D) g2d.create();
            float edgeOffset = cardWidth / 2f;
            double angle = tappedAngle + (Math.abs(flippedAngle - FLIPPED_ANGLE) < 0.001 ? 0 : flippedAngle);
            g2d.rotate(angle, cardXOffset + edgeOffset, cardYOffset + cardHeight - edgeOffset);
        }
        super.paint(g2d);
View Full Code Here

   
    worldMap.width = getWidth();
    worldMap.height = getHeight();
   
    g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
    worldMap.draw((Graphics2D)g2d.create(), time);
    g2d.drawImage(dropShadowTopLeft,     0,               0,                null);
    g2d.drawImage(dropShadowTopRight,    getWidth() - 10, 0,                null);
    g2d.drawImage(dropShadowBottomLeft,  0,               getHeight() - 10, null);
    g2d.drawImage(dropShadowBottomRight, getWidth() - 10, getHeight() - 10, null);
   
View Full Code Here

  {
    Graphics2D g2 = state.g;

    if (flipH || flipV)
    {
      g2 = (Graphics2D) g2.create();
     
      if (flipV && flipH)
      {
        g2.rotate(Math.toRadians(180), x + w / 2, y + h / 2);
      }
View Full Code Here

  public void paint(java.awt.Graphics g_) {
    Graphics2D g = (Graphics2D) g_;
    g.setColor(Color.LIGHT_GRAY);
    g.fillRect(0, 0, getWidth(), getHeight());
    Utilities.drawCheckerPattern(g.create(0, 0, getViewWidth(), getViewHeight()),checkerSize);
    g.drawImage(image,0,0, image.getWidth()*zoom, image.getHeight()*zoom,0,0,image.getWidth(),image.getHeight(),null);
    for(Object selected: editorFrame.animationManager.getSelectedObjects()) {
      if(selected instanceof Animation) {
        Animation animation = (Animation) selected;
        for(Frame frame: animation.getFrames()) {
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.