sun.awt.UNIXToolkit Java Examples

The following examples show how to use sun.awt.UNIXToolkit. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GTKPainter.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
void paintMetacityElement(SynthContext context, Graphics g,
        int gtkState, String detail, int x, int y, int w, int h,
        ShadowType shadow, ArrowType direction) {
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(
                g, x, y, w, h, gtkState, detail, shadow, direction)) {
            ENGINE.startPainting(
                    g, x, y, w, h, gtkState, detail, shadow, direction);
            if (detail == "metacity-arrow") {
                ENGINE.paintArrow(g, context, Region.INTERNAL_FRAME_TITLE_PANE,
                        gtkState, shadow, direction, "", x, y, w, h);

            } else if (detail == "metacity-box") {
                ENGINE.paintBox(g, context, Region.INTERNAL_FRAME_TITLE_PANE,
                        gtkState, shadow, "", x, y, w, h);

            } else if (detail == "metacity-vline") {
                ENGINE.paintVline(g, context, Region.INTERNAL_FRAME_TITLE_PANE,
                        gtkState, "", x, y, w, h);
            }
            ENGINE.finishPainting();
        }
    }
}
 
Example #2
Source File: GTKPainter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void paintBorder(Component c, Graphics g, int x, int y,
                        int w, int h) {
    SynthContext context = getContext((JComponent)c);
    Region id = context.getRegion();
    int state = context.getComponentState();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(id, state);

    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h, id)) {
            ENGINE.startPainting(g, x, y, w, h, id);
            ENGINE.paintShadow(g, context, id, gtkState, ShadowType.ETCHED_IN,
                              "frame", x, y, w, h);
            ENGINE.finishPainting();
        }
    }
}
 
Example #3
Source File: GTKPainter.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public void paintPopupMenuBackground(SynthContext context, Graphics g,
                                    int x, int y, int w, int h) {
    Region id = context.getRegion();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            id, context.getComponentState());
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (ENGINE.paintCachedImage(g, x, y, w, h, id, gtkState)) {
            return;
        }
        ENGINE.startPainting(g, x, y, w, h, id, gtkState);
        ENGINE.paintBox(g, context, id, gtkState,
                ShadowType.OUT, "menu", x, y, w, h);

        GTKStyle style = (GTKStyle)context.getStyle();
        int xThickness = style.getXThickness();
        int yThickness = style.getYThickness();
        ENGINE.paintBackground(g, context, id, gtkState,
                style.getGTKColor(context, gtkState, GTKColorType.BACKGROUND),
                x + xThickness, y + yThickness,
                w - xThickness - xThickness, h - yThickness - yThickness);
        ENGINE.finishPainting();
    }
}
 
Example #4
Source File: GTKPainter.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
void paintMetacityElement(SynthContext context, Graphics g,
        int gtkState, String detail, int x, int y, int w, int h,
        ShadowType shadow, ArrowType direction) {
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(
                g, x, y, w, h, gtkState, detail, shadow, direction)) {
            ENGINE.startPainting(
                    g, x, y, w, h, gtkState, detail, shadow, direction);
            if (detail == "metacity-arrow") {
                ENGINE.paintArrow(g, context, Region.INTERNAL_FRAME_TITLE_PANE,
                        gtkState, shadow, direction, "", x, y, w, h);

            } else if (detail == "metacity-box") {
                ENGINE.paintBox(g, context, Region.INTERNAL_FRAME_TITLE_PANE,
                        gtkState, shadow, "", x, y, w, h);

            } else if (detail == "metacity-vline") {
                ENGINE.paintVline(g, context, Region.INTERNAL_FRAME_TITLE_PANE,
                        gtkState, "", x, y, w, h);
            }
            ENGINE.finishPainting();
        }
    }
}
 
Example #5
Source File: GTKPainter.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void paintTreeCellBackground(SynthContext context, Graphics g,
                                    int x, int y, int w, int h) {
    Region id = context.getRegion();
    int state = context.getComponentState();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(id, state);
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h, id, state)) {
            ENGINE.startPainting(g, x, y, w, h, id, state);
            // the string arg should alternate based on row being painted,
            // but we currently don't pass that in.
            ENGINE.paintFlatBox(g, context, id, gtkState, ShadowType.NONE,
                    "cell_odd", x, y, w, h, ColorType.TEXT_BACKGROUND);
            ENGINE.finishPainting();
        }
    }
}
 
Example #6
Source File: GTKPainter.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
void paintMetacityElement(SynthContext context, Graphics g,
        int gtkState, String detail, int x, int y, int w, int h,
        ShadowType shadow, ArrowType direction) {
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(
                g, x, y, w, h, gtkState, detail, shadow, direction)) {
            ENGINE.startPainting(
                    g, x, y, w, h, gtkState, detail, shadow, direction);
            if (detail == "metacity-arrow") {
                ENGINE.paintArrow(g, context, Region.INTERNAL_FRAME_TITLE_PANE,
                        gtkState, shadow, direction, "", x, y, w, h);

            } else if (detail == "metacity-box") {
                ENGINE.paintBox(g, context, Region.INTERNAL_FRAME_TITLE_PANE,
                        gtkState, shadow, "", x, y, w, h);

            } else if (detail == "metacity-vline") {
                ENGINE.paintVline(g, context, Region.INTERNAL_FRAME_TITLE_PANE,
                        gtkState, "", x, y, w, h);
            }
            ENGINE.finishPainting();
        }
    }
}
 
Example #7
Source File: GTKPainter.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void paintTabbedPaneTabBackground(SynthContext context,
                                       Graphics g,
                                       int x, int y, int w, int h,
                                       int tabIndex) {
    Region id = context.getRegion();
    int state = context.getComponentState();
    int gtkState = ((state & SynthConstants.SELECTED) != 0 ?
        SynthConstants.ENABLED : SynthConstants.PRESSED);
    JTabbedPane pane = (JTabbedPane)context.getComponent();
    int placement = pane.getTabPlacement();

    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h,
                id, gtkState, placement, tabIndex)) {
            PositionType side = POSITIONS[placement - 1];
            ENGINE.startPainting(g, x, y, w, h,
                    id, gtkState, placement, tabIndex);
            ENGINE.paintExtension(g, context, id, gtkState,
                    ShadowType.OUT, "tab", x, y, w, h, side, tabIndex);
            ENGINE.finishPainting();
        }
    }
}
 
Example #8
Source File: GTKPainter.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public void paintProgressBarForeground(SynthContext context, Graphics g,
                                        int x, int y, int w, int h,
                                        int orientation) {
    Region id = context.getRegion();
    synchronized (UNIXToolkit.GTK_LOCK) {
        // Note that we don't call paintCachedImage() here.  Since the
        // progress bar foreground is painted differently for each value
        // it would be wasteful to try to cache an image for each state,
        // so instead we simply avoid caching in this case.
        if (w <= 0 || h <= 0) {
            return;
        }
        ENGINE.startPainting(g, x, y, w, h, id, "fg");
        ENGINE.paintBox(g, context, id, SynthConstants.MOUSE_OVER,
                        ShadowType.OUT, "bar", x, y, w, h);
        ENGINE.finishPainting(false); // don't bother caching the image
    }
}
 
Example #9
Source File: GTKPainter.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public void paintMenuItemBackground(SynthContext context,
                                 Graphics g,
                                 int x, int y, int w, int h) {
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            context.getRegion(), context.getComponentState());
    if (gtkState == SynthConstants.MOUSE_OVER) {
        Region id = Region.MENU_ITEM;
        synchronized (UNIXToolkit.GTK_LOCK) {
            if (! ENGINE.paintCachedImage(g, x, y, w, h, id)) {
                ShadowType shadow = (GTKLookAndFeel.is2_2() ?
                    ShadowType.NONE : ShadowType.OUT);
                ENGINE.startPainting(g, x, y, w, h, id);
                ENGINE.paintBox(g, context, id, gtkState, shadow,
                        "menuitem", x, y, w, h);
                ENGINE.finishPainting();
            }
        }
    }
}
 
Example #10
Source File: GTKPainter.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void paintProgressBarForeground(SynthContext context, Graphics g,
                                        int x, int y, int w, int h,
                                        int orientation) {
    Region id = context.getRegion();
    synchronized (UNIXToolkit.GTK_LOCK) {
        // Note that we don't call paintCachedImage() here.  Since the
        // progress bar foreground is painted differently for each value
        // it would be wasteful to try to cache an image for each state,
        // so instead we simply avoid caching in this case.
        if (w <= 0 || h <= 0) {
            return;
        }
        ENGINE.startPainting(g, x, y, w, h, id, "fg");
        ENGINE.paintBox(g, context, id, SynthConstants.MOUSE_OVER,
                        ShadowType.OUT, "bar", x, y, w, h);
        ENGINE.finishPainting(false); // don't bother caching the image
    }
}
 
Example #11
Source File: GTKPainter.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public void paintTabbedPaneTabBackground(SynthContext context,
                                       Graphics g,
                                       int x, int y, int w, int h,
                                       int tabIndex) {
    Region id = context.getRegion();
    int state = context.getComponentState();
    int gtkState = ((state & SynthConstants.SELECTED) != 0 ?
        SynthConstants.ENABLED : SynthConstants.PRESSED);
    JTabbedPane pane = (JTabbedPane)context.getComponent();
    int placement = pane.getTabPlacement();

    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h,
                id, gtkState, placement, tabIndex)) {
            PositionType side = POSITIONS[placement - 1];
            ENGINE.startPainting(g, x, y, w, h,
                    id, gtkState, placement, tabIndex);
            ENGINE.paintExtension(g, context, id, gtkState,
                    ShadowType.OUT, "tab", x, y, w, h, side, tabIndex);
            ENGINE.finishPainting();
        }
    }
}
 
Example #12
Source File: GTKPainter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void paintSplitPaneDividerBackground(SynthContext context,
                                   Graphics g,
                                   int x, int y, int w, int h) {
    Region id = context.getRegion();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            id, context.getComponentState());
    JSplitPane splitPane = (JSplitPane)context.getComponent();
    Orientation orientation =
            (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT ?
                Orientation.VERTICAL : Orientation.HORIZONTAL);
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h,
                id, gtkState, orientation)) {
            ENGINE.startPainting(g, x, y, w, h, id, gtkState, orientation);
            ENGINE.paintHandle(g, context, id, gtkState,
                    ShadowType.OUT, "paned", x, y, w, h, orientation);
            ENGINE.finishPainting();
        }
    }
}
 
Example #13
Source File: GTKPainter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void paintMenuItemBackground(SynthContext context,
                                 Graphics g,
                                 int x, int y, int w, int h) {
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            context.getRegion(), context.getComponentState());
    if (gtkState == SynthConstants.MOUSE_OVER) {
        Region id = Region.MENU_ITEM;
        synchronized (UNIXToolkit.GTK_LOCK) {
            if (! ENGINE.paintCachedImage(g, x, y, w, h, id)) {
                ShadowType shadow = (GTKLookAndFeel.is2_2() ?
                    ShadowType.NONE : ShadowType.OUT);
                ENGINE.startPainting(g, x, y, w, h, id);
                ENGINE.paintBox(g, context, id, gtkState, shadow,
                        "menuitem", x, y, w, h);
                ENGINE.finishPainting();
            }
        }
    }
}
 
Example #14
Source File: GTKPainter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void paintSplitPaneDividerBackground(SynthContext context,
                                   Graphics g,
                                   int x, int y, int w, int h) {
    Region id = context.getRegion();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            id, context.getComponentState());
    JSplitPane splitPane = (JSplitPane)context.getComponent();
    Orientation orientation =
            (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT ?
                Orientation.VERTICAL : Orientation.HORIZONTAL);
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h,
                id, gtkState, orientation)) {
            ENGINE.startPainting(g, x, y, w, h, id, gtkState, orientation);
            ENGINE.paintHandle(g, context, id, gtkState,
                    ShadowType.OUT, "paned", x, y, w, h, orientation);
            ENGINE.finishPainting();
        }
    }
}
 
Example #15
Source File: GTKPainter.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public void paintProgressBarForeground(SynthContext context, Graphics g,
                                        int x, int y, int w, int h,
                                        int orientation) {
    Region id = context.getRegion();
    synchronized (UNIXToolkit.GTK_LOCK) {
        // Note that we don't call paintCachedImage() here.  Since the
        // progress bar foreground is painted differently for each value
        // it would be wasteful to try to cache an image for each state,
        // so instead we simply avoid caching in this case.
        if (w <= 0 || h <= 0) {
            return;
        }
        ENGINE.startPainting(g, x, y, w, h, id, "fg");
        ENGINE.paintBox(g, context, id, SynthConstants.MOUSE_OVER,
                        ShadowType.OUT, "bar", x, y, w, h);
        ENGINE.finishPainting(false); // don't bother caching the image
    }
}
 
Example #16
Source File: GTKPainter.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void paintSplitPaneDividerBackground(SynthContext context,
                                   Graphics g,
                                   int x, int y, int w, int h) {
    Region id = context.getRegion();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            id, context.getComponentState());
    JSplitPane splitPane = (JSplitPane)context.getComponent();
    Orientation orientation =
            (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT ?
                Orientation.VERTICAL : Orientation.HORIZONTAL);
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h,
                id, gtkState, orientation)) {
            ENGINE.startPainting(g, x, y, w, h, id, gtkState, orientation);
            ENGINE.paintHandle(g, context, id, gtkState,
                    ShadowType.OUT, "paned", x, y, w, h, orientation);
            ENGINE.finishPainting();
        }
    }
}
 
Example #17
Source File: GTKPainter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void paintTabbedPaneTabBackground(SynthContext context,
                                       Graphics g,
                                       int x, int y, int w, int h,
                                       int tabIndex) {
    Region id = context.getRegion();
    int state = context.getComponentState();
    int gtkState = ((state & SynthConstants.SELECTED) != 0 ?
        SynthConstants.ENABLED : SynthConstants.PRESSED);
    JTabbedPane pane = (JTabbedPane)context.getComponent();
    int placement = pane.getTabPlacement();

    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h,
                id, gtkState, placement, tabIndex)) {
            PositionType side = POSITIONS[placement - 1];
            ENGINE.startPainting(g, x, y, w, h,
                    id, gtkState, placement, tabIndex);
            ENGINE.paintExtension(g, context, id, gtkState,
                    ShadowType.OUT, "tab", x, y, w, h, side, tabIndex);
            ENGINE.finishPainting();
        }
    }
}
 
Example #18
Source File: GTKPainter.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public void paintToolBarBackground(SynthContext context,
                                 Graphics g, int x, int y,
                                 int w, int h) {
    Region id = context.getRegion();
    int state = context.getComponentState();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(id, state);
    int orientation = ((JToolBar)context.getComponent()).getOrientation();
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h, id,
                                      state, orientation))
        {
            ENGINE.startPainting(g, x, y, w, h, id, state, orientation);
            ENGINE.paintBox(g, context, id, gtkState, ShadowType.OUT,
                            "handlebox_bin", x, y, w, h);
            ENGINE.finishPainting();
        }
    }
}
 
Example #19
Source File: XClipboard.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private void getTargetsDelayed() {
    XToolkit.awtLock();
    try {
        long curTime = System.currentTimeMillis();
        if (isSelectionNotifyProcessed || curTime >= (convertSelectionTime + UNIXToolkit.getDatatransferTimeout()))
        {
            convertSelectionTime = curTime;
            XlibWrapper.XConvertSelection(XToolkit.getDisplay(),
                                          selection.getSelectionAtom().getAtom(),
                                          XDataTransferer.TARGETS_ATOM.getAtom(),
                                          getTargetsPropertyAtom().getAtom(),
                                          XWindow.getXAWTRootWindow().getWindow(),
                                          XConstants.CurrentTime);
            isSelectionNotifyProcessed = false;
        }
    } finally {
        XToolkit.awtUnlock();
    }
}
 
Example #20
Source File: GTKPainter.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void paintToolBarBackground(SynthContext context,
                                 Graphics g, int x, int y,
                                 int w, int h) {
    Region id = context.getRegion();
    int state = context.getComponentState();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(id, state);
    int orientation = ((JToolBar)context.getComponent()).getOrientation();
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h, id,
                                      state, orientation))
        {
            ENGINE.startPainting(g, x, y, w, h, id, state, orientation);
            ENGINE.paintBox(g, context, id, gtkState, ShadowType.OUT,
                            "handlebox_bin", x, y, w, h);
            ENGINE.finishPainting();
        }
    }
}
 
Example #21
Source File: GTKPainter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void paintTreeCellBackground(SynthContext context, Graphics g,
                                    int x, int y, int w, int h) {
    Region id = context.getRegion();
    int state = context.getComponentState();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(id, state);
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h, id, state)) {
            ENGINE.startPainting(g, x, y, w, h, id, state);
            // the string arg should alternate based on row being painted,
            // but we currently don't pass that in.
            ENGINE.paintFlatBox(g, context, id, gtkState, ShadowType.NONE,
                    "cell_odd", x, y, w, h, ColorType.TEXT_BACKGROUND);
            ENGINE.finishPainting();
        }
    }
}
 
Example #22
Source File: GTKPainter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void paintRadioButtonBackground(SynthContext context,
                                 Graphics g, int x, int y,
                                 int w, int h) {
    Region id = context.getRegion();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            id, context.getComponentState());
    if (gtkState == SynthConstants.MOUSE_OVER) {
        synchronized (UNIXToolkit.GTK_LOCK) {
            if (! ENGINE.paintCachedImage(g, x, y, w, h, id)) {
                ENGINE.startPainting(g, x, y, w, h, id);
                ENGINE.paintFlatBox(g, context, id,
                        SynthConstants.MOUSE_OVER, ShadowType.ETCHED_OUT,
                        "checkbutton", x, y, w, h, ColorType.BACKGROUND);
                ENGINE.finishPainting();
            }
        }
    }
}
 
Example #23
Source File: GTKPainter.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void paintMenuBarBackground(SynthContext context, Graphics g,
                                   int x, int y, int w, int h) {
    Region id = context.getRegion();
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (ENGINE.paintCachedImage(g, x, y, w, h, id)) {
            return;
        }
        GTKStyle style = (GTKStyle)context.getStyle();
        int shadow = style.getClassSpecificIntValue(
                context, "shadow-type", 2);
        ShadowType shadowType = SHADOWS[shadow];
        int gtkState = GTKLookAndFeel.synthStateToGTKState(
                id, context.getComponentState());
        ENGINE.startPainting(g, x, y, w, h, id);
        ENGINE.paintBox(g, context, id, gtkState,
            shadowType, "menubar", x, y, w, h);
        ENGINE.finishPainting();
    }
}
 
Example #24
Source File: GTKPainter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void paintMenuBarBackground(SynthContext context, Graphics g,
                                   int x, int y, int w, int h) {
    Region id = context.getRegion();
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (ENGINE.paintCachedImage(g, x, y, w, h, id)) {
            return;
        }
        GTKStyle style = (GTKStyle)context.getStyle();
        int shadow = style.getClassSpecificIntValue(
                context, "shadow-type", 2);
        ShadowType shadowType = SHADOWS[shadow];
        int gtkState = GTKLookAndFeel.synthStateToGTKState(
                id, context.getComponentState());
        ENGINE.startPainting(g, x, y, w, h, id);
        ENGINE.paintBox(g, context, id, gtkState,
            shadowType, "menubar", x, y, w, h);
        ENGINE.finishPainting();
    }
}
 
Example #25
Source File: GTKPainter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void paintRadioButtonBackground(SynthContext context,
                                 Graphics g, int x, int y,
                                 int w, int h) {
    Region id = context.getRegion();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            id, context.getComponentState());
    if (gtkState == SynthConstants.MOUSE_OVER) {
        synchronized (UNIXToolkit.GTK_LOCK) {
            if (! ENGINE.paintCachedImage(g, x, y, w, h, id)) {
                ENGINE.startPainting(g, x, y, w, h, id);
                ENGINE.paintFlatBox(g, context, id,
                        SynthConstants.MOUSE_OVER, ShadowType.ETCHED_OUT,
                        "checkbutton", x, y, w, h, ColorType.BACKGROUND);
                ENGINE.finishPainting();
            }
        }
    }
}
 
Example #26
Source File: GTKPainter.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public void paintSplitPaneDividerBackground(SynthContext context,
                                   Graphics g,
                                   int x, int y, int w, int h) {
    Region id = context.getRegion();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            id, context.getComponentState());
    JSplitPane splitPane = (JSplitPane)context.getComponent();
    Orientation orientation =
            (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT ?
                Orientation.VERTICAL : Orientation.HORIZONTAL);
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h,
                id, gtkState, orientation)) {
            ENGINE.startPainting(g, x, y, w, h, id, gtkState, orientation);
            ENGINE.paintHandle(g, context, id, gtkState,
                    ShadowType.OUT, "paned", x, y, w, h, orientation);
            ENGINE.finishPainting();
        }
    }
}
 
Example #27
Source File: GTKPainter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void paintRadioButtonMenuItemBackground(SynthContext context,
                                 Graphics g, int x, int y,
                                 int w, int h) {
    Region id = context.getRegion();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            id, context.getComponentState());
    if (gtkState == SynthConstants.MOUSE_OVER) {
        synchronized (UNIXToolkit.GTK_LOCK) {
            if (! ENGINE.paintCachedImage(g, x, y, w, h, id)) {
                ShadowType shadow = (GTKLookAndFeel.is2_2() ?
                    ShadowType.NONE : ShadowType.OUT);
                ENGINE.startPainting(g, x, y, w, h, id);
                ENGINE.paintBox(g, context, id, gtkState,
                        shadow, "menuitem", x, y, w, h);
                ENGINE.finishPainting();
            }
        }
    }
}
 
Example #28
Source File: GTKPainter.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void paintMenuBarBackground(SynthContext context, Graphics g,
                                   int x, int y, int w, int h) {
    Region id = context.getRegion();
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (ENGINE.paintCachedImage(g, x, y, w, h, id)) {
            return;
        }
        GTKStyle style = (GTKStyle)context.getStyle();
        int shadow = style.getClassSpecificIntValue(
                context, "shadow-type", 2);
        ShadowType shadowType = SHADOWS[shadow];
        int gtkState = GTKLookAndFeel.synthStateToGTKState(
                id, context.getComponentState());
        ENGINE.startPainting(g, x, y, w, h, id);
        ENGINE.paintBox(g, context, id, gtkState,
            shadowType, "menubar", x, y, w, h);
        ENGINE.finishPainting();
    }
}
 
Example #29
Source File: GTKPainter.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void paintMenuBarBackground(SynthContext context, Graphics g,
                                   int x, int y, int w, int h) {
    Region id = context.getRegion();
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (ENGINE.paintCachedImage(g, x, y, w, h, id)) {
            return;
        }
        GTKStyle style = (GTKStyle)context.getStyle();
        int shadow = style.getClassSpecificIntValue(
                context, "shadow-type", 2);
        ShadowType shadowType = SHADOWS[shadow];
        int gtkState = GTKLookAndFeel.synthStateToGTKState(
                id, context.getComponentState());
        ENGINE.startPainting(g, x, y, w, h, id);
        ENGINE.paintBox(g, context, id, gtkState,
            shadowType, "menubar", x, y, w, h);
        ENGINE.finishPainting();
    }
}
 
Example #30
Source File: GTKPainter.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void paintSplitPaneDividerBackground(SynthContext context,
                                   Graphics g,
                                   int x, int y, int w, int h) {
    Region id = context.getRegion();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            id, context.getComponentState());
    JSplitPane splitPane = (JSplitPane)context.getComponent();
    Orientation orientation =
            (splitPane.getOrientation() == JSplitPane.HORIZONTAL_SPLIT ?
                Orientation.VERTICAL : Orientation.HORIZONTAL);
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h,
                id, gtkState, orientation)) {
            ENGINE.startPainting(g, x, y, w, h, id, gtkState, orientation);
            ENGINE.paintHandle(g, context, id, gtkState,
                    ShadowType.OUT, "paned", x, y, w, h, orientation);
            ENGINE.finishPainting();
        }
    }
}