com.sun.java.swing.plaf.gtk.GTKConstants.Orientation Java Examples

The following examples show how to use com.sun.java.swing.plaf.gtk.GTKConstants.Orientation. 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: GTKIconFactory.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void paintIcon(SynthContext context, Graphics g, int x, int y,
                      int w, int h) {
    if (context != null) {
        JToolBar toolbar = (JToolBar)context.getComponent();
        Orientation orientation =
                (toolbar.getOrientation() == JToolBar.HORIZONTAL ?
                    Orientation.HORIZONTAL : Orientation.VERTICAL);

        if (style == null) {
            style = SynthLookAndFeel.getStyleFactory().getStyle(
                    context.getComponent(), GTKRegion.HANDLE_BOX);
        }
        context = new SynthContext(toolbar, GTKRegion.HANDLE_BOX,
                style, SynthConstants.ENABLED);

        GTKPainter.INSTANCE.paintIcon(context, g,
                getMethod(), x, y, w, h, orientation);
    }
}
 
Example #2
Source File: GTKPainter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void paintToolBarHandleIcon(SynthContext context, Graphics g,
        int state, int x, int y, int w, int h, Orientation orientation) {
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            context.getRegion(), state);

    // The orientation parameter passed down by Synth refers to the
    // orientation of the toolbar, but the one we pass to GTK refers
    // to the orientation of the handle.  Therefore, we need to swap
    // the value here: horizontal toolbars have vertical handles, and
    // vice versa.
    orientation = (orientation == Orientation.HORIZONTAL) ?
        Orientation.VERTICAL : Orientation.HORIZONTAL;

    ENGINE.paintHandle(g, context, Region.TOOL_BAR, gtkState,
            ShadowType.OUT, "handlebox", x, y, w, h, orientation);
}
 
Example #3
Source File: GTKPainter.java    From openjdk-8 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 #4
Source File: GTKIconFactory.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public void paintIcon(SynthContext context, Graphics g, int x, int y,
                      int w, int h) {
    if (context != null) {
        JToolBar toolbar = (JToolBar)context.getComponent();
        Orientation orientation =
                (toolbar.getOrientation() == JToolBar.HORIZONTAL ?
                    Orientation.HORIZONTAL : Orientation.VERTICAL);

        if (style == null) {
            style = SynthLookAndFeel.getStyleFactory().getStyle(
                    context.getComponent(), GTKRegion.HANDLE_BOX);
        }
        context = new SynthContext(toolbar, GTKRegion.HANDLE_BOX,
                style, SynthConstants.ENABLED);

        GTKPainter.INSTANCE.paintIcon(context, g,
                getMethod(), x, y, w, h, orientation);
    }
}
 
Example #5
Source File: GTKPainter.java    From dragonwell8_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 #6
Source File: GTKPainter.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void paintSliderThumbBackground(SynthContext context,
        Graphics g, int x, int y, int w, int h, int dir) {
    Region id = context.getRegion();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            id, context.getComponentState());
    boolean hasFocus = GTKLookAndFeel.is3() &&
            ((context.getComponentState() & SynthConstants.FOCUSED) != 0);
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h, id, gtkState, dir, hasFocus)) {
            Orientation orientation = (dir == JSlider.HORIZONTAL ?
                Orientation.HORIZONTAL : Orientation.VERTICAL);
            String detail = (dir == JSlider.HORIZONTAL ?
                "hscale" : "vscale");
            ENGINE.startPainting(g, x, y, w, h, id, gtkState, dir);
            ENGINE.paintSlider(g, context, id, gtkState,
                    ShadowType.OUT, detail, x, y, w, h, orientation, hasFocus);
            ENGINE.finishPainting();
        }
    }
}
 
Example #7
Source File: GTKPainter.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public void paintToolBarHandleIcon(SynthContext context, Graphics g,
        int state, int x, int y, int w, int h, Orientation orientation) {
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            context.getRegion(), state);

    // The orientation parameter passed down by Synth refers to the
    // orientation of the toolbar, but the one we pass to GTK refers
    // to the orientation of the handle.  Therefore, we need to swap
    // the value here: horizontal toolbars have vertical handles, and
    // vice versa.
    orientation = (orientation == Orientation.HORIZONTAL) ?
        Orientation.VERTICAL : Orientation.HORIZONTAL;

    ENGINE.paintHandle(g, context, Region.TOOL_BAR, gtkState,
            ShadowType.OUT, "handlebox", x, y, w, h, orientation);
}
 
Example #8
Source File: GTKPainter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void paintToolBarHandleIcon(SynthContext context, Graphics g,
        int state, int x, int y, int w, int h, Orientation orientation) {
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            context.getRegion(), state);

    // The orientation parameter passed down by Synth refers to the
    // orientation of the toolbar, but the one we pass to GTK refers
    // to the orientation of the handle.  Therefore, we need to swap
    // the value here: horizontal toolbars have vertical handles, and
    // vice versa.
    orientation = (orientation == Orientation.HORIZONTAL) ?
        Orientation.VERTICAL : Orientation.HORIZONTAL;

    ENGINE.paintHandle(g, context, Region.TOOL_BAR, gtkState,
            ShadowType.OUT, "handlebox", x, y, w, h, orientation);
}
 
Example #9
Source File: GTKIconFactory.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void paintIcon(SynthContext context, Graphics g, int x, int y,
                      int w, int h) {
    if (context != null) {
        JToolBar toolbar = (JToolBar)context.getComponent();
        Orientation orientation =
                (toolbar.getOrientation() == JToolBar.HORIZONTAL ?
                    Orientation.HORIZONTAL : Orientation.VERTICAL);

        if (style == null) {
            style = SynthLookAndFeel.getStyleFactory().getStyle(
                    context.getComponent(), GTKRegion.HANDLE_BOX);
        }
        context = new SynthContext(toolbar, GTKRegion.HANDLE_BOX,
                style, SynthConstants.ENABLED);

        GTKPainter.INSTANCE.paintIcon(context, g,
                getMethod(), x, y, w, h, orientation);
    }
}
 
Example #10
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();
        }
    }
}
 
Example #11
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();
        }
    }
}
 
Example #12
Source File: GTKPainter.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void paintSliderThumbBackground(SynthContext context,
        Graphics g, int x, int y, int w, int h, int dir) {
    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, dir)) {
            Orientation orientation = (dir == JSlider.HORIZONTAL ?
                Orientation.HORIZONTAL : Orientation.VERTICAL);
            String detail = (dir == JSlider.HORIZONTAL ?
                "hscale" : "vscale");
            ENGINE.startPainting(g, x, y, w, h, id, gtkState, dir);
            ENGINE.paintSlider(g, context, id, gtkState,
                    ShadowType.OUT, detail, x, y, w, h, orientation);
            ENGINE.finishPainting();
        }
    }
}
 
Example #13
Source File: GTKPainter.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void paintSliderThumbBackground(SynthContext context,
        Graphics g, int x, int y, int w, int h, int dir) {
    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, dir)) {
            Orientation orientation = (dir == JSlider.HORIZONTAL ?
                Orientation.HORIZONTAL : Orientation.VERTICAL);
            String detail = (dir == JSlider.HORIZONTAL ?
                "hscale" : "vscale");
            ENGINE.startPainting(g, x, y, w, h, id, gtkState, dir);
            ENGINE.paintSlider(g, context, id, gtkState,
                    ShadowType.OUT, detail, x, y, w, h, orientation);
            ENGINE.finishPainting();
        }
    }
}
 
Example #14
Source File: GTKIconFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void paintIcon(SynthContext context, Graphics g, int x, int y,
                      int w, int h) {
    if (context != null) {
        JToolBar toolbar = (JToolBar)context.getComponent();
        Orientation orientation =
                (toolbar.getOrientation() == JToolBar.HORIZONTAL ?
                    Orientation.HORIZONTAL : Orientation.VERTICAL);

        if (style == null) {
            style = SynthLookAndFeel.getStyleFactory().getStyle(
                    context.getComponent(), GTKRegion.HANDLE_BOX);
        }
        context = new SynthContext(toolbar, GTKRegion.HANDLE_BOX,
                style, SynthConstants.ENABLED);

        GTKPainter.INSTANCE.paintIcon(context, g,
                getMethod(), x, y, w, h, orientation);
    }
}
 
Example #15
Source File: GTKIconFactory.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public void paintIcon(SynthContext context, Graphics g, int x, int y,
                      int w, int h) {
    if (context != null) {
        JToolBar toolbar = (JToolBar)context.getComponent();
        Orientation orientation =
                (toolbar.getOrientation() == JToolBar.HORIZONTAL ?
                    Orientation.HORIZONTAL : Orientation.VERTICAL);

        if (style == null) {
            style = SynthLookAndFeel.getStyleFactory().getStyle(
                    context.getComponent(), GTKRegion.HANDLE_BOX);
        }
        context = new SynthContext(toolbar, GTKRegion.HANDLE_BOX,
                style, SynthConstants.ENABLED);

        GTKPainter.INSTANCE.paintIcon(context, g,
                getMethod(), x, y, w, h, orientation);
    }
}
 
Example #16
Source File: GTKPainter.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public void paintToolBarHandleIcon(SynthContext context, Graphics g,
        int state, int x, int y, int w, int h, Orientation orientation) {
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            context.getRegion(), state);

    // The orientation parameter passed down by Synth refers to the
    // orientation of the toolbar, but the one we pass to GTK refers
    // to the orientation of the handle.  Therefore, we need to swap
    // the value here: horizontal toolbars have vertical handles, and
    // vice versa.
    orientation = (orientation == Orientation.HORIZONTAL) ?
        Orientation.VERTICAL : Orientation.HORIZONTAL;

    ENGINE.paintHandle(g, context, Region.TOOL_BAR, gtkState,
            ShadowType.OUT, "handlebox", x, y, w, h, orientation);
}
 
Example #17
Source File: GTKPainter.java    From openjdk-jdk8u 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 #18
Source File: GTKPainter.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void paintToolBarHandleIcon(SynthContext context, Graphics g,
        int state, int x, int y, int w, int h, Orientation orientation) {
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            context.getRegion(), state);

    // The orientation parameter passed down by Synth refers to the
    // orientation of the toolbar, but the one we pass to GTK refers
    // to the orientation of the handle.  Therefore, we need to swap
    // the value here: horizontal toolbars have vertical handles, and
    // vice versa.
    orientation = (orientation == Orientation.HORIZONTAL) ?
        Orientation.VERTICAL : Orientation.HORIZONTAL;

    ENGINE.paintHandle(g, context, Region.TOOL_BAR, gtkState,
            ShadowType.OUT, "handlebox", x, y, w, h, orientation);
}
 
Example #19
Source File: GTKPainter.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public void paintSliderThumbBackground(SynthContext context,
        Graphics g, int x, int y, int w, int h, int dir) {
    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, dir)) {
            Orientation orientation = (dir == JSlider.HORIZONTAL ?
                Orientation.HORIZONTAL : Orientation.VERTICAL);
            String detail = (dir == JSlider.HORIZONTAL ?
                "hscale" : "vscale");
            ENGINE.startPainting(g, x, y, w, h, id, gtkState, dir);
            ENGINE.paintSlider(g, context, id, gtkState,
                    ShadowType.OUT, detail, x, y, w, h, orientation);
            ENGINE.finishPainting();
        }
    }
}
 
Example #20
Source File: GTKIconFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void paintIcon(SynthContext context, Graphics g, int x, int y,
                      int w, int h) {
    if (context != null) {
        JToolBar toolbar = (JToolBar)context.getComponent();
        Orientation orientation =
                (toolbar.getOrientation() == JToolBar.HORIZONTAL ?
                    Orientation.HORIZONTAL : Orientation.VERTICAL);

        if (style == null) {
            style = SynthLookAndFeel.getStyleFactory().getStyle(
                    context.getComponent(), GTKRegion.HANDLE_BOX);
        }
        context = new SynthContext(toolbar, GTKRegion.HANDLE_BOX,
                style, SynthConstants.ENABLED);

        GTKPainter.INSTANCE.paintIcon(context, g,
                getMethod(), x, y, w, h, orientation);
    }
}
 
Example #21
Source File: GTKPainter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void paintSliderThumbBackground(SynthContext context,
        Graphics g, int x, int y, int w, int h, int dir) {
    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, dir)) {
            Orientation orientation = (dir == JSlider.HORIZONTAL ?
                Orientation.HORIZONTAL : Orientation.VERTICAL);
            String detail = (dir == JSlider.HORIZONTAL ?
                "hscale" : "vscale");
            ENGINE.startPainting(g, x, y, w, h, id, gtkState, dir);
            ENGINE.paintSlider(g, context, id, gtkState,
                    ShadowType.OUT, detail, x, y, w, h, orientation);
            ENGINE.finishPainting();
        }
    }
}
 
Example #22
Source File: GTKPainter.java    From openjdk-jdk8u-backup 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 #23
Source File: GTKPainter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void paintToolBarHandleIcon(SynthContext context, Graphics g,
        int state, int x, int y, int w, int h, Orientation orientation) {
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            context.getRegion(), state);

    // The orientation parameter passed down by Synth refers to the
    // orientation of the toolbar, but the one we pass to GTK refers
    // to the orientation of the handle.  Therefore, we need to swap
    // the value here: horizontal toolbars have vertical handles, and
    // vice versa.
    orientation = (orientation == Orientation.HORIZONTAL) ?
        Orientation.VERTICAL : Orientation.HORIZONTAL;

    ENGINE.paintHandle(g, context, Region.TOOL_BAR, gtkState,
            ShadowType.OUT, "handlebox", x, y, w, h, orientation);
}
 
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 paintToolBarHandleIcon(SynthContext context, Graphics g,
        int state, int x, int y, int w, int h, Orientation orientation) {
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            context.getRegion(), state);

    // The orientation parameter passed down by Synth refers to the
    // orientation of the toolbar, but the one we pass to GTK refers
    // to the orientation of the handle.  Therefore, we need to swap
    // the value here: horizontal toolbars have vertical handles, and
    // vice versa.
    orientation = (orientation == Orientation.HORIZONTAL) ?
        Orientation.VERTICAL : Orientation.HORIZONTAL;

    ENGINE.paintHandle(g, context, Region.TOOL_BAR, gtkState,
            ShadowType.OUT, "handlebox", x, y, w, h, orientation);
}
 
Example #25
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 #26
Source File: GTKPainter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void paintSliderThumbBackground(SynthContext context,
        Graphics g, int x, int y, int w, int h, int dir) {
    Region id = context.getRegion();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            id, context.getComponentState());
    boolean hasFocus = GTKLookAndFeel.is3() &&
            ((context.getComponentState() & SynthConstants.FOCUSED) != 0);
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h, id, gtkState, dir,
                                                                hasFocus)) {
            Orientation orientation = (dir == JSlider.HORIZONTAL ?
                Orientation.HORIZONTAL : Orientation.VERTICAL);
            String detail = (dir == JSlider.HORIZONTAL ?
                "hscale" : "vscale");
            ENGINE.startPainting(g, x, y, w, h, id, gtkState, dir);
            ENGINE.paintSlider(g, context, id, gtkState,
                    ShadowType.OUT, detail, x, y, w, h, orientation,
                                                                 hasFocus);
            ENGINE.finishPainting();
        }
    }
}
 
Example #27
Source File: GTKIconFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void paintIcon(SynthContext context, Graphics g, int x, int y,
                      int w, int h) {
    if (context != null) {
        JToolBar toolbar = (JToolBar)context.getComponent();
        Orientation orientation =
                (toolbar.getOrientation() == JToolBar.HORIZONTAL ?
                    Orientation.HORIZONTAL : Orientation.VERTICAL);

        if (style == null) {
            style = SynthLookAndFeel.getStyleFactory().getStyle(
                    context.getComponent(), GTKRegion.HANDLE_BOX);
        }
        context = new SynthContext(toolbar, GTKRegion.HANDLE_BOX,
                style, SynthConstants.ENABLED);

        GTKPainter.INSTANCE.paintIcon(context, g,
                getMethod(), x, y, w, h, orientation);
    }
}
 
Example #28
Source File: GTKPainter.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public void paintSliderThumbBackground(SynthContext context,
        Graphics g, int x, int y, int w, int h, int dir) {
    Region id = context.getRegion();
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            id, context.getComponentState());
    boolean hasFocus = GTKLookAndFeel.is3() &&
            ((context.getComponentState() & SynthConstants.FOCUSED) != 0);
    synchronized (UNIXToolkit.GTK_LOCK) {
        if (! ENGINE.paintCachedImage(g, x, y, w, h, id, gtkState, dir,
                                                                hasFocus)) {
            Orientation orientation = (dir == JSlider.HORIZONTAL ?
                Orientation.HORIZONTAL : Orientation.VERTICAL);
            String detail = (dir == JSlider.HORIZONTAL ?
                "hscale" : "vscale");
            ENGINE.startPainting(g, x, y, w, h, id, gtkState, dir);
            ENGINE.paintSlider(g, context, id, gtkState,
                    ShadowType.OUT, detail, x, y, w, h, orientation,
                                                                 hasFocus);
            ENGINE.finishPainting();
        }
    }
}
 
Example #29
Source File: GTKIconFactory.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public void paintIcon(SynthContext context, Graphics g, int x, int y,
                      int w, int h) {
    if (context != null) {
        JToolBar toolbar = (JToolBar)context.getComponent();
        Orientation orientation =
                (toolbar.getOrientation() == JToolBar.HORIZONTAL ?
                    Orientation.HORIZONTAL : Orientation.VERTICAL);

        if (style == null) {
            style = SynthLookAndFeel.getStyleFactory().getStyle(
                    context.getComponent(), GTKRegion.HANDLE_BOX);
        }
        context = new SynthContext(toolbar, GTKRegion.HANDLE_BOX,
                style, SynthConstants.ENABLED);

        GTKPainter.INSTANCE.paintIcon(context, g,
                getMethod(), x, y, w, h, orientation);
    }
}
 
Example #30
Source File: GTKPainter.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public void paintToolBarHandleIcon(SynthContext context, Graphics g,
        int state, int x, int y, int w, int h, Orientation orientation) {
    int gtkState = GTKLookAndFeel.synthStateToGTKState(
            context.getRegion(), state);

    // The orientation parameter passed down by Synth refers to the
    // orientation of the toolbar, but the one we pass to GTK refers
    // to the orientation of the handle.  Therefore, we need to swap
    // the value here: horizontal toolbars have vertical handles, and
    // vice versa.
    orientation = (orientation == Orientation.HORIZONTAL) ?
        Orientation.VERTICAL : Orientation.HORIZONTAL;

    ENGINE.paintHandle(g, context, Region.TOOL_BAR, gtkState,
            ShadowType.OUT, "handlebox", x, y, w, h, orientation);
}