Package java.awt

Examples of java.awt.Graphics2D.drawRect()


                (400, 400, BufferedImage.TYPE_INT_ARGB);
            Graphics2D g2d = img.createGraphics();
            g2d.setColor(Color.black);
            g2d.fillRect(0, 0, 400, 400);
            g2d.setColor(Color.red);
            g2d.drawRect(100, 50, 100, 50);
            ByteArrayOutputStream ostream = new ByteArrayOutputStream();
            PNGTranscoder t = new PNGTranscoder();
            TranscoderOutput output = new TranscoderOutput(ostream);
            t.writeImage(img, output);
            return ostream.toByteArray();
View Full Code Here


        iter.toShape();

        map.addPoint(10, 10, geom.getShell());

        testG.draw(iter.toShape());
        exampleG.drawRect(8,8,4,4);
        update();
        assertImagesEqual();
    }
   
    @Test
View Full Code Here

       
        path=new GeneralPath();
        path.append(PrimitiveShapeIterator.getPathIterator(geom.getShell()), false);
       
        testG.draw(path);
        exampleG.drawRect(8,8,4,4);
        update();
        assertImagesEqual();
    }
   
    @Test
View Full Code Here

    } else if (dropStatus == DROPPING_PERMITTED) {
      Graphics2D g2d = (Graphics2D) clipg;
      g2d.setStroke(STROKE);
      g2d.setColor(GREEN_COLOR);
      Rectangle bounds = adaptable.getContentPane().getBounds();
      g2d.drawRect(0, 0, bounds.width, 22);
    }
  }

  protected static Color RED_COLOR = new Color(255, 164, 0);
  protected static Color GREEN_COLOR = new Color(164, 255, 0);
View Full Code Here

      int w = adaptable.getWidget().getWidth();
      int h = adaptable.getWidget().getHeight();
      g2d.fillRect(0, 0, w, h);
      g2d.setColor(((JScrollPaneDesignOperation)getOperation()).isPermitted() ? RED_COLOR : GREEN_COLOR);
      g2d.setStroke(STROKE);
      g2d.drawRect(0, 0, w - 1, h - 1);
      g2d.setComposite(oldc);
      g2d.setStroke(olds);
    }
  }
View Full Code Here

      g2d.setComposite(composite);
      g2d.fillRect(0, 0, w, h);
      Stroke oldStroke = g2d.getStroke();
      g2d.setColor(RED_COLOR);
      g2d.setStroke(STROKE);
      g2d.drawRect(0, 0, w, h);
      g2d.setStroke(oldStroke);
      g2d.setComposite(oldComposite);
    }
  }
 
View Full Code Here

        JInternalFrame jif = (JInternalFrame) adaptable.getWidget();
        JMenuBar jmenuBar = jif.getJMenuBar();
        bounds = SwingUtilities.getLocalBounds(jmenuBar);
        bounds = SwingUtilities.convertRectangle(jmenuBar, bounds, adaptable.getWidget());
      }
      g2d.drawRect(bounds.x, bounds.y, bounds.width, 22);
    } else if (dropStatus == DROPPING_PERMITTED) {
      Graphics2D g2d = (Graphics2D) clipg;
      g2d.setStroke(STROKE);
      g2d.setColor(GREEN_COLOR);
      Rectangle bounds;
View Full Code Here

        bounds = SwingUtilities.convertRectangle(rootPane, bounds, jif);
      }else{
        bounds = SwingUtilities.getLocalBounds(adaptable.getContentPane());
        bounds = SwingUtilities.convertRectangle(adaptable.getContentPane(), bounds, adaptable.getWidget());
      }
      g2d.drawRect(bounds.x, bounds.y, bounds.width, 22);
    }
  }

  protected static Color RED_COLOR = new Color(255, 164, 0);
  protected static Color GREEN_COLOR = new Color(164, 255, 0);
View Full Code Here

    } else if (dropStatus == DROPPING_FORBIDDEN) {
      Rectangle bounds = adaptable.getRootPane().getBounds();
      Graphics2D g2d = (Graphics2D) clipg;
      g2d.setStroke(STROKE);
      g2d.setColor(RED_COLOR);
      g2d.drawRect(0, 0, bounds.width, 22);
    } else if (dropStatus == DROPPING_PERMITTED) {
      Graphics2D g2d = (Graphics2D) clipg;
      g2d.setStroke(STROKE);
      g2d.setColor(GREEN_COLOR);
      Rectangle bounds = adaptable.getRootPane().getBounds();
View Full Code Here

    } else if (dropStatus == DROPPING_PERMITTED) {
      Graphics2D g2d = (Graphics2D) clipg;
      g2d.setStroke(STROKE);
      g2d.setColor(GREEN_COLOR);
      Rectangle bounds = adaptable.getRootPane().getBounds();
      g2d.drawRect(0, 0, bounds.width, 22);
    }
  }

  protected static Color RED_COLOR = new Color(255, 164, 0);
  protected static Color GREEN_COLOR = new Color(164, 255, 0);
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.