Package java.awt

Examples of java.awt.Graphics2D.clip()


        Graphics2D g2d = bi.createGraphics();
        if (hints != null)
            g2d.addRenderingHints(hints);
        g2d.setRenderingHint(RenderingHintsKeyExt.KEY_BUFFERED_IMAGE,
                             new WeakReference(bi));
        g2d.clip(new Rectangle(0, 0, bi.getWidth(), bi.getHeight()));
        return g2d;
    }


    public static Graphics2D createGraphics(BufferedImage bi) {
View Full Code Here


    public static Graphics2D createGraphics(BufferedImage bi) {
        Graphics2D g2d = bi.createGraphics();
        g2d.setRenderingHint(RenderingHintsKeyExt.KEY_BUFFERED_IMAGE,
                             new WeakReference(bi));
        g2d.clip(new Rectangle(0, 0, bi.getWidth(), bi.getHeight()));
        return g2d;
    }


    public final static boolean WARN_DESTINATION = true;
View Full Code Here

                    unselectedArea.add(new Area(new Rectangle(0, 0, width, height)));
                    unselectedArea.subtract(new Area(selection));

                    Graphics2D textGraphics = (Graphics2D)graphics.create();
                    textGraphics.setColor(color);
                    textGraphics.clip(unselectedArea);
                    textGraphics.drawGlyphVector(glyphVector, padding.left - scrollLeft + 1,
                        (height - textHeight) / 2 + ascent);
                    textGraphics.dispose();

                    // Paint the selection
View Full Code Here

                    graphics.setColor(selectionBackgroundColor);
                    graphics.fill(selection);

                    Graphics2D selectedTextGraphics = (Graphics2D)graphics.create();
                    selectedTextGraphics.setColor(selectionColor);
                    selectedTextGraphics.clip(selection.getBounds());
                    selectedTextGraphics.drawGlyphVector(glyphVector, padding.left - scrollLeft + 1,
                        (height - textHeight) / 2 + ascent);
                    selectedTextGraphics.dispose();
                }
            }
View Full Code Here

                    lineTo(ex1, clipy);
                    lineTo(ex2, innery);
                    lineTo(sx2, innery);
                    closePath();
                    //clip();
                    g.clip(currentPath);
                    currentPath = null;
                    Rectangle2D.Float lineRect = new Rectangle2D.Float(
                            sx1a, outery, ex1a - sx1a, innery - outery);
                    Java2DRenderer.drawBorderLine(lineRect, true, true,
                            bpsBefore.style, bpsBefore.color, g);
View Full Code Here

                componentY += rowHeights[i] + verticalSpacing;
            }

            if (gridClip != null) {
                gridGraphics.clip(gridClip);
            }

            boolean[][] occupiedCells = getOccupiedCells();

            if (showHorizontalGridLines
View Full Code Here

                unselectedArea.add(new Area(new Rectangle(0, 0, width, height)));
                unselectedArea.subtract(new Area(selection));

                Graphics2D textGraphics = (Graphics2D)graphics.create();
                textGraphics.setColor(getEffectiveForegroundColor());
                textGraphics.clip(unselectedArea);
                textGraphics.drawGlyphVector(glyphVector, 0, ascent);
                if (underline) {
                    textGraphics.drawLine(x0, underlineX, x1 - x0, underlineX);
                }
                if (strikethrough) {
View Full Code Here

                }

                Graphics2D selectedTextGraphics = (Graphics2D)graphics.create();
                selectedTextGraphics.setColor(textPane.isFocused() &&
                    textPane.isEditable() ? selectionColor : textPaneSkin.getInactiveSelectionColor());
                selectedTextGraphics.clip(selection.getBounds());
                selectedTextGraphics.drawGlyphVector(glyphVector, 0, ascent);
                if (underline) {
                    selectedTextGraphics.drawLine(0, underlineX, width, underlineX);
                }
                if (strikethrough) {
View Full Code Here

            unselectedArea.add(new Area(new Rectangle2D.Float(0, 0, width, height)));
            unselectedArea.subtract(new Area(selectedArea));

            // Paint the unselected text
            Graphics2D unselectedGraphics = (Graphics2D)graphics.create();
            unselectedGraphics.clip(unselectedArea);
            paint(unselectedGraphics, focused, editable, false);
            unselectedGraphics.dispose();

            // Paint the selected text
            Graphics2D selectedGraphics = (Graphics2D)graphics.create();
View Full Code Here

            paint(unselectedGraphics, focused, editable, false);
            unselectedGraphics.dispose();

            // Paint the selected text
            Graphics2D selectedGraphics = (Graphics2D)graphics.create();
            selectedGraphics.clip(selectedArea);
            paint(selectedGraphics, focused, editable, true);
            selectedGraphics.dispose();
        } else {
            paint(graphics, textArea.isFocused(), textArea.isEditable(), false);
        }
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.