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


Java Orientation类代码示例

本文整理汇总了Java中com.sun.java.swing.plaf.gtk.GTKConstants.Orientation的典型用法代码示例。如果您正苦于以下问题:Java Orientation类的具体用法?Java Orientation怎么用?Java Orientation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Orientation类属于com.sun.java.swing.plaf.gtk.GTKConstants包,在下文中一共展示了Orientation类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: paintSliderThumbBackground

import com.sun.java.swing.plaf.gtk.GTKConstants.Orientation; //导入依赖的package包/类
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();
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:GTKPainter.java

示例2: paintSplitPaneDividerBackground

import com.sun.java.swing.plaf.gtk.GTKConstants.Orientation; //导入依赖的package包/类
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();
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:GTKPainter.java

示例3: paintToolBarHandleIcon

import com.sun.java.swing.plaf.gtk.GTKConstants.Orientation; //导入依赖的package包/类
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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:GTKPainter.java

示例4: paintIcon

import com.sun.java.swing.plaf.gtk.GTKConstants.Orientation; //导入依赖的package包/类
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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:GTKIconFactory.java

示例5: paintSliderThumbBackground

import com.sun.java.swing.plaf.gtk.GTKConstants.Orientation; //导入依赖的package包/类
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();
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:GTKPainter.java


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