Package java.awt

Examples of java.awt.Composite


      if (!isOnScreen(g2d, r)) {
        return;
      }
    }

    final Composite oldComposite = g2d.getComposite();

    try {
      g2d.setComposite(entityComposite);
      draw(g2d, r.x, r.y, r.width, r.height);
    } finally {
View Full Code Here


      if (!isOnScreen(g2d, r)) {
        return;
      }
    }

    final Composite oldComposite = g2d.getComposite();

    try {
      g2d.setComposite(entityComposite);
      drawTop(g2d, r.x, r.y, r.width, r.height);
    } finally {
View Full Code Here

                    curve * 2, curve * 2);
        }
    }

    protected void paintTrack(Graphics2D g) {
        Composite oldComposite = g.getComposite();
        float alpha = slider.isEnabled() ? 1 : .5f;
        g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));

        Shape frame = getFrame();

View Full Code Here

        int selected = slider.getSelectedThumb(false);
        float[] f = slider.getThumbPositions();
        int orientation = slider.getOrientation();
        Shape shape;

        Composite oldComposite = g.getComposite();

        g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
                indication));

        for (int a = 0; a < thumbPositions.length; a++) {
View Full Code Here

            if(mode != Mode.DEFAULT) {
                x = (getWidth() - image.getWidth()) / 2;
                y = (getHeight() - image.getHeight()) / 2;
            }

            Composite oldComposite = g2.getComposite();

            if(opacity != 1.0f) {
                g2.setComposite(AlphaComposite.SrcOver.derive(opacity));
            }
            g2.drawImage(image, null, x, y);
View Full Code Here

  }
 
  protected void paintChildren( Graphics g )
  {
    final Graphics2D  g2    = (Graphics2D) g;
    final Composite    origCmp  = g2.getComposite();
   
    if( (a != null) && (fade < 1f) ) {
      g2.setComposite( AlphaComposite.getInstance( AlphaComposite.SRC_OVER, 1.0f - fade ));
      a.paint( g );
    }
View Full Code Here

        throws IOException, ClassNotFoundException {

        if (stream == null) {
            throw new IllegalArgumentException("Null 'stream' argument.");
        }
        Composite result = null;
        final boolean isNull = stream.readBoolean();
        if (!isNull) {
            final Class c = (Class) stream.readObject();
            if (isSerializable(c)) {
                result = (Composite) stream.readObject();
View Full Code Here

     * Serialize an <code>AlphaComposite</code>, restore it, and check for
     * equality.
     */
    public void testAlphaCompositeSerialization() {

        final Composite c1 = AlphaComposite.getInstance(2, 0.345f);
        Composite c2 = null;

        try {
            final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            final ObjectOutputStream out = new ObjectOutputStream(buffer);
            SerialUtilities.writeComposite(c1, out);
View Full Code Here

  public void setCanvasPattern(CanvasPattern canvasPattern) {
    //NI
  }

  public void setComposite(int mode) {
    Composite comp = ctx.getComposite();
    float alpha = comp instanceof AlphaComposite ? ((AlphaComposite) comp)
        .getAlpha() : 1.0f;
    switch (mode) {
      case SRC_ATOP:
        compMode = AlphaComposite.SRC_ATOP;
View Full Code Here

        for (int i = 0; i < textRuns.size(); i++) {
            TextRun textRun = (TextRun)textRuns.get(i);
            AttributedCharacterIterator runaci = textRun.getACI();
            runaci.first();

            Composite opacity = (Composite)
                  runaci.getAttribute(GVTAttributedCharacterIterator.
                                              TextAttribute.OPACITY);
            if (opacity != null) {
                g2d.setComposite(opacity);
            }
View Full Code Here

TOP

Related Classes of java.awt.Composite

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.