本文整理汇总了Java中com.sun.java.swing.plaf.gtk.GTKConstants.PositionType类的典型用法代码示例。如果您正苦于以下问题:Java PositionType类的具体用法?Java PositionType怎么用?Java PositionType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PositionType类属于com.sun.java.swing.plaf.gtk.GTKConstants包,在下文中一共展示了PositionType类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paintTabbedPaneTabBackground
import com.sun.java.swing.plaf.gtk.GTKConstants.PositionType; //导入依赖的package包/类
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();
}
}
}
示例2: SwingOrientationConstantToGTK
import com.sun.java.swing.plaf.gtk.GTKConstants.PositionType; //导入依赖的package包/类
/**
* Maps a swing constant to a GTK constant.
*/
static PositionType SwingOrientationConstantToGTK(int side) {
switch (side) {
case SwingConstants.LEFT:
return PositionType.LEFT;
case SwingConstants.RIGHT:
return PositionType.RIGHT;
case SwingConstants.TOP:
return PositionType.TOP;
case SwingConstants.BOTTOM:
return PositionType.BOTTOM;
}
assert false : "Unknown orientation: " + side;
return PositionType.TOP;
}
示例3: paintTabbedPaneContentBackground
import com.sun.java.swing.plaf.gtk.GTKConstants.PositionType; //导入依赖的package包/类
public void paintTabbedPaneContentBackground(SynthContext context,
Graphics g, int x, int y, int w, int h) {
JTabbedPane pane = (JTabbedPane)context.getComponent();
int selectedIndex = pane.getSelectedIndex();
PositionType placement = GTKLookAndFeel.SwingOrientationConstantToGTK(
pane.getTabPlacement());
int gapStart = 0;
int gapSize = 0;
if (selectedIndex != -1) {
Rectangle tabBounds = pane.getBoundsAt(selectedIndex);
if (placement == PositionType.TOP ||
placement == PositionType.BOTTOM) {
gapStart = tabBounds.x - x;
gapSize = tabBounds.width;
}
else {
gapStart = tabBounds.y - y;
gapSize = tabBounds.height;
}
}
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, placement, gapStart, gapSize)) {
ENGINE.startPainting(g, x, y, w, h,
id, gtkState, placement, gapStart, gapSize);
ENGINE.paintBoxGap(g, context, id, gtkState, ShadowType.OUT,
"notebook", x, y, w, h, placement, gapStart, gapSize);
ENGINE.finishPainting();
}
}
}
示例4: paintBoxGap
import com.sun.java.swing.plaf.gtk.GTKConstants.PositionType; //导入依赖的package包/类
public void paintBoxGap(Graphics g, SynthContext context,
Region id, int state, ShadowType shadowType,
String detail, int x, int y, int w, int h,
PositionType boxGapType, int tabBegin, int size) {
state = GTKLookAndFeel.synthStateToGTKStateType(state).ordinal();
int widget = getWidgetType(context.getComponent(), id).ordinal();
native_paint_box_gap(widget, state, shadowType.ordinal(), detail,
x - x0, y - y0, w, h, boxGapType.ordinal(), tabBegin, size);
}
示例5: paintExtension
import com.sun.java.swing.plaf.gtk.GTKConstants.PositionType; //导入依赖的package包/类
public void paintExtension(Graphics g, SynthContext context,
Region id, int state, ShadowType shadowType, String detail,
int x, int y, int w, int h, PositionType placement, int tabIndex) {
state = GTKLookAndFeel.synthStateToGTKStateType(state).ordinal();
int widget = getWidgetType(context.getComponent(), id).ordinal();
native_paint_extension(widget, state, shadowType.ordinal(), detail,
x - x0, y - y0, w, h, placement.ordinal());
}