本文整理了Java中javax.swing.JSlider.getForeground()
方法的一些代码示例,展示了JSlider.getForeground()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSlider.getForeground()
方法的具体详情如下:
包路径:javax.swing.JSlider
类名称:JSlider
方法名:getForeground
暂无
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/napkinlaf
@Override
public void paintTrack(Graphics g) {
trackBounds.width = trackRect.width;
trackBounds.height = trackRect.height;
trackBounds.x = trackRect.x;
trackBounds.y = trackRect.y;
g.setColor(slider.getForeground());
track = NapkinUtil.paintLine(g, vertical, track, trackBounds);
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
protected void paintMinorTickForHorizSlider(Graphics g,
Rectangle tickBounds, int x)
{
g.setColor(slider.isEnabled() ? slider.getForeground()
: TonicLookAndFeel.getControlShadow());
g.drawLine(x, TICK_BUFFER, x, TICK_BUFFER+(tickLength/2));
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
protected void paintMajorTickForHorizSlider(Graphics g,
Rectangle tickBounds, int x)
{
g.setColor(slider.isEnabled() ? slider.getForeground()
: TonicLookAndFeel.getControlShadow());
g.drawLine(x, TICK_BUFFER, x, TICK_BUFFER+(tickLength-1));
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/napkinlaf
private void paintTick(List<DrawnLineHolder> ticks, int pos, Graphics g,
int x, int y, int width, int height) {
boolean vertTicks = !vertical;
tickBounds.x = x;
tickBounds.y = y;
tickBounds.width = width;
tickBounds.height = height;
// I don't know why this is needed, but it works
if (vertTicks) {
tickBounds.x /= 4;
} else {
tickBounds.y /= 4;
}
while (pos >= ticks.size()) {
ticks.add(null);
}
DrawnLineHolder holder = ticks.get(pos);
g.setColor(slider.getForeground());
holder = NapkinUtil.paintLine(g, vertTicks, holder, tickBounds);
ticks.set(pos, holder);
}
代码示例来源:origin: atarw/material-ui-swing
@Override
public void paintTrack (Graphics g) {
g = MaterialDrawingUtils.getAliasedGraphics (g);
g.setColor (UIManager.getColor ("Slider.trackColor"));
Line unloaded = getTrack (false);
g.drawLine (unloaded.x1, unloaded.y1, unloaded.x2, unloaded.y2);
g.setColor (slider.getForeground ());
Line loaded = getTrack (true);
g.drawLine (loaded.x1, loaded.y1, loaded.x2, loaded.y2);
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
protected void paintMajorTickForVertSlider(Graphics g, Rectangle tickBounds,
int y)
{
g.setColor(slider.isEnabled() ? slider.getForeground()
: TonicLookAndFeel.getControlShadow());
if(TonicUtils.isLeftToRight(slider))
{
g.drawLine(TICK_BUFFER, y, TICK_BUFFER+tickLength, y);
}
else
{
g.drawLine(0, y, tickLength, y);
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
protected void paintMinorTickForVertSlider(Graphics g, Rectangle tickBounds,
int y)
{
g.setColor(slider.isEnabled() ? slider.getForeground()
: TonicLookAndFeel.getControlShadow());
if(TonicUtils.isLeftToRight(slider))
{
g.drawLine(TICK_BUFFER, y, TICK_BUFFER+(tickLength/2), y);
}
else
{
g.drawLine(0, y, tickLength/2, y);
}
}
代码示例来源:origin: atarw/material-ui-swing
@Override
public void paintThumb (Graphics g) {
g = MaterialDrawingUtils.getAliasedGraphics (g);
int cx = thumbRect.x + thumbRect.width / 2;
int cy = thumbRect.y + thumbRect.height / 2;
if (isDragging ()) {
g.setColor (MaterialColors.bleach (slider.getForeground (), 0.5f));
drawCircle (g, cx, cy, DRAG_THUMB_RADIUS);
}
g.setColor (slider.getForeground ());
drawCircle (g, cx, cy, NORMAL_THUMB_RADIUS);
// need to redraw loaded part of progress line
Line loaded = getTrack (true);
g.drawLine (loaded.x1, loaded.y1, loaded.x2, loaded.y2);
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
: slider.getForeground();
代码示例来源:origin: com.jtattoo/JTattoo
public void paintTicks(Graphics g) {
boolean leftToRight = JTattooUtilities.isLeftToRight(slider);
Rectangle tickBounds = tickRect;
g.setColor(slider.getForeground());
if (slider.getOrientation() == JSlider.HORIZONTAL) {
g.translate(0, tickBounds.y);
内容来源于网络,如有侵权,请联系作者删除!