当前位置: 首页>>代码示例>>Java>>正文


Java SunToolkit.awtUnlock方法代码示例

本文整理汇总了Java中sun.awt.SunToolkit.awtUnlock方法的典型用法代码示例。如果您正苦于以下问题:Java SunToolkit.awtUnlock方法的具体用法?Java SunToolkit.awtUnlock怎么用?Java SunToolkit.awtUnlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.awt.SunToolkit的用法示例。


在下文中一共展示了SunToolkit.awtUnlock方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doPath

import sun.awt.SunToolkit; //导入方法依赖的package包/类
private void doPath(SunGraphics2D sg2d, Shape s, boolean isFill) {
    Path2D.Float p2df;
    int transx, transy;
    if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
        if (s instanceof Path2D.Float) {
            p2df = (Path2D.Float)s;
        } else {
            p2df = new Path2D.Float(s);
        }
        transx = sg2d.transX;
        transy = sg2d.transY;
    } else {
        p2df = new Path2D.Float(s, sg2d.transform);
        transx = 0;
        transy = 0;
    }
    SunToolkit.awtLock();
    try {
        long xgc = validate(sg2d);
        XDoPath(sg2d, sg2d.surfaceData.getNativeOps(), xgc,
                transx, transy, p2df, isFill);
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:X11Renderer.java

示例2: fillSpans

import sun.awt.SunToolkit; //导入方法依赖的package包/类
protected void fillSpans(SunGraphics2D sg2d, SpanIterator si,
                         int transx, int transy) {
    SunToolkit.awtLock();
    try {
        validateSurface(sg2d);
        int[] spanBox = new int[4];
        while (si.nextSpan(spanBox)) {
            rectBuffer.pushRectValues(spanBox[0] + transx,
                                spanBox[1] + transy,
                                spanBox[2] - spanBox[0],
                                spanBox[3] - spanBox[1]);
        }
        tileManager.fillMask(((XRSurfaceData) sg2d.surfaceData));
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:XRRenderer.java

示例3: Blit

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) {
    // If the blit is write-only (putimge), no need for a temporary VI.
    if (CompositeType.SrcOverNoEa.equals(comp) && (src.getTransparency() == Transparency.OPAQUE)) {
        Blit opaqueSwToSurfaceBlit = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, dst.getSurfaceType());
        opaqueSwToSurfaceBlit.Blit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
    } else {
        try {
            SunToolkit.awtLock();

            XRSurfaceData vImgSurface = XRPMBlitLoops.cacheToTmpSurface(src, (XRSurfaceData) dst, w, h, sx, sy);
            pmToSurfaceBlit.Blit(vImgSurface, dst, comp, clip, 0, 0, dx, dy, w, h);
        } finally {
            SunToolkit.awtUnlock();
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:XRPMBlitLoops.java

示例4: fillOval

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void fillOval(SunGraphics2D sg2d,
                     int x, int y, int width, int height)
{
    SunToolkit.awtLock();
    try {
        long xgc = validate(sg2d);
        XFillOval(sg2d.surfaceData.getNativeOps(), xgc,
                  x+sg2d.transX, y+sg2d.transY, width, height);
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:X11Renderer.java

示例5: Scale

import sun.awt.SunToolkit; //导入方法依赖的package包/类
@SuppressWarnings("cast")
public void Scale(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1,
        double dx2, double dy2) {
    try {
        SunToolkit.awtLock();

        XRSurfaceData x11sdDst = (XRSurfaceData) dst;
        x11sdDst.validateAsDestination(null, clip);
        XRSurfaceData x11sdSrc = (XRSurfaceData) src;
        x11sdDst.maskBuffer.validateCompositeState(comp, null, null, null);

        double xScale = (dx2 - dx1) / (sx2 - sx1);
        double yScale = (dy2 - dy1) / (sy2 - sy1);

        sx1 *= xScale;
        sx2 *= xScale;
        sy1 *= yScale;
        sy2 *= yScale;

        dx1 = Math.ceil(dx1 - 0.5);
        dy1 = Math.ceil(dy1 - 0.5);
        dx2 = Math.ceil(dx2 - 0.5);
        dy2 = Math.ceil(dy2 - 0.5);

        AffineTransform xForm = AffineTransform.getScaleInstance(1 / xScale, 1 / yScale);

        x11sdSrc.validateAsSource(xForm, XRUtils.RepeatNone, XRUtils.FAST);
        x11sdDst.maskBuffer.compositeBlit(x11sdSrc, x11sdDst, (int) sx1, (int) sy1, (int) dx1, (int) dy1, (int) (dx2 - dx1), (int) (dy2 - dy1));
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:33,代码来源:XRPMBlitLoops.java

示例6: init

import sun.awt.SunToolkit; //导入方法依赖的package包/类
/**
 * Sets the toolkit global error handler, stores the connection to X11 server,
 * which will be used during an error handling process. This method is called
 * once from {@code awt_init_Display} function defined in {@code awt_GraphicsEnv.c}
 * file immediately after the connection to X11 window server is opened.
 * @param display the connection to X11 server which should be stored
 */
private static void init(long display) {
    SunToolkit.awtLock();
    try {
        if (!initPassed) {
            XErrorHandlerUtil.display = display;
            saved_error_handler = XlibWrapper.SetToolkitErrorHandler();
            initPassed = true;
        }
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:XErrorHandlerUtil.java

示例7: dispose

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void dispose() {
    if (isGrabbed()) {
        if (grabLog.isLoggable(PlatformLogger.Level.FINE)) {
            grabLog.fine("Generating UngrabEvent on {0} because of the window disposal", this);
        }
        postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource()));
    }

    SunToolkit.awtLock();

    try {
        windows.remove(this);
    } finally {
        SunToolkit.awtUnlock();
    }

    if (warningWindow != null) {
        warningWindow.destroy();
    }

    removeRootPropertyEventDispatcher();
    mustControlStackPosition = false;
    super.dispose();

    /*
     * Fix for 6457980.
     * When disposing an owned Window we should implicitly
     * return focus to its decorated owner because it won't
     * receive WM_TAKE_FOCUS.
     */
    if (isSimpleWindow()) {
        if (target == XKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow()) {
            Window owner = getDecoratedOwner((Window)target);
            ((XWindowPeer)AWTAccessor.getComponentAccessor().getPeer(owner)).requestWindowFocus();
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:38,代码来源:XWindowPeer.java

示例8: Scale

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void Scale(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1,
        double dx2, double dy2) {
    {
        int w = sx2 - sx1;
        int h = sy2 - sy1;

        try {
            SunToolkit.awtLock();
            XRSurfaceData vImgSurface = XRPMBlitLoops.cacheToTmpSurface(src, (XRSurfaceData) dst, w, h, sx1, sy1);
            pmToSurfaceBlit.Scale(vImgSurface, dst, comp, clip, 0, 0, w, h, dx1, dy1, dx2, dy2);
        } finally {
            SunToolkit.awtUnlock();
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:16,代码来源:XRPMBlitLoops.java

示例9: drawGlyphList

import sun.awt.SunToolkit; //导入方法依赖的package包/类
protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl) {
    SunToolkit.awtLock();
    try {
        X11SurfaceData x11sd = (X11SurfaceData)sg2d.surfaceData;
        Region clip = sg2d.getCompClip();
        long xgc = x11sd.getRenderGC(clip, SunGraphics2D.COMP_ISCOPY,
                                     null, sg2d.pixel);
        doDrawGlyphList(x11sd.getNativeOps(), xgc, clip, gl);
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:X11TextRenderer.java

示例10: fillArc

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void fillArc(SunGraphics2D sg2d,
                    int x, int y, int width, int height,
                    int startAngle, int arcAngle)
{
    SunToolkit.awtLock();
    try {
        long xgc = validate(sg2d);
        XFillArc(sg2d.surfaceData.getNativeOps(), xgc,
                 x+sg2d.transX, y+sg2d.transY, width, height,
                 startAngle, arcAngle);
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:X11Renderer.java

示例11: drawOval

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void drawOval(SunGraphics2D sg2d,
                     int x, int y, int width, int height)
{
    SunToolkit.awtLock();
    try {
        long xgc = validate(sg2d);
        XDrawOval(sg2d.surfaceData.getNativeOps(), xgc,
                  x+sg2d.transX, y+sg2d.transY, width, height);
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:X11Renderer.java

示例12: fillPath

import sun.awt.SunToolkit; //导入方法依赖的package包/类
protected void fillPath(SunGraphics2D sg2d, Path2D.Float p2df,
                        int transx, int transy) {
    SunToolkit.awtLock();
    try {
        validateSurface(sg2d);
        drawHandler.validate(sg2d);
        ProcessPath.fillPath(drawHandler, p2df, transx, transy);
        tileManager.fillMask(((XRSurfaceData) sg2d.surfaceData));
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:XRRenderer.java

示例13: drawArc

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void drawArc(SunGraphics2D sg2d,
                    int x, int y, int width, int height,
                    int startAngle, int arcAngle)
{
    SunToolkit.awtLock();
    try {
        long xgc = validate(sg2d);
        XDrawArc(sg2d.surfaceData.getNativeOps(), xgc,
                 x+sg2d.transX, y+sg2d.transY, width, height,
                 startAngle, arcAngle);
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:X11Renderer.java

示例14: makePipes

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public synchronized void makePipes() {
    if (x11pipe == null) {
        SunToolkit.awtLock();
        try {
            xgc = XCreateGC(getNativeOps());
        } finally {
            SunToolkit.awtUnlock();
        }
        x11pipe = X11Renderer.getInstance();
        x11txpipe = new PixelToShapeConverter(x11pipe);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:X11SurfaceData.java

示例15: fillRect

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void fillRect(SunGraphics2D sg2d, int x, int y, int width, int height) {
    x = Region.clipAdd(x, sg2d.transX);
    y = Region.clipAdd(y, sg2d.transY);

    /*
     * Limit x/y to signed short, width/height to unsigned short,
     * to match the X11 coordinate limits for rectangles.
     * Correct width/height in case x/y have been modified by clipping.
     */
    if (x > Short.MAX_VALUE || y > Short.MAX_VALUE) {
        return;
    }

    int x2 = Region.dimAdd(x, width);
    int y2 = Region.dimAdd(y, height);

    if (x2 < Short.MIN_VALUE || y2 < Short.MIN_VALUE) {
        return;
    }

    x = clampToShort(x);
    y = clampToShort(y);
    width = clampToUShort(x2 - x);
    height = clampToUShort(y2 - y);

    if (width == 0 || height == 0) {
        return;
    }

    SunToolkit.awtLock();
    try {
        validateSurface(sg2d);
        rectBuffer.pushRectValues(x, y, width, height);
        tileManager.fillMask((XRSurfaceData) sg2d.surfaceData);
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:39,代码来源:XRRenderer.java


注:本文中的sun.awt.SunToolkit.awtUnlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。