热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

javax.swing.JSlider.getExtent()方法的使用及代码示例

本文整理了Java中javax.swing.JSlider.getExtent()方法的一些代码示例,展示了JSlider.getExtent()

本文整理了Java中javax.swing.JSlider.getExtent()方法的一些代码示例,展示了JSlider.getExtent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSlider.getExtent()方法的具体详情如下:
包路径:javax.swing.JSlider
类名称:JSlider
方法名:getExtent

JSlider.getExtent介绍

暂无

代码示例

代码示例来源:origin: palantir/Cinch

public void stateChanged(ChangeEvent e) {
try {
setter.getMethod().invoke(model1, slider.getExtent());
} catch (Exception ex) {
logger.error("could not invoke JSlider binding", ex);
}
}
};

代码示例来源:origin: org.gephi/ui-components

int trackTop = trackRect.y;
int trackBottom = trackRect.y + (trackRect.height - 1);
int vMax = yPositionForValue(slider.getValue() + slider.getExtent());
int trackLeft = trackRect.x;
int trackRight = trackRect.x + (trackRect.width - 1);
int hMax = xPositionForValue(slider.getValue() + slider.getExtent());

代码示例来源:origin: igvteam/igv

int trackTop = trackRect.y;
int trackBottom = trackRect.y + (trackRect.height - 1);
int vMax = yPositionForValue(slider.getValue() + slider.getExtent());
int trackLeft = trackRect.x;
int trackRight = trackRect.x + (trackRect.width - 1);
int hMax = xPositionForValue(slider.getValue() + slider.getExtent());

代码示例来源:origin: org.gephi/ui-components

int trackTop = trackRect.y;
int trackBottom = trackRect.y + (trackRect.height - 1);
int vMax = yPositionForValue(slider.getValue() + slider.getExtent());
int trackLeft = trackRect.x;
int trackRight = trackRect.x + (trackRect.width - 1);
int hMax = xPositionForValue(slider.getValue() + slider.getExtent());

代码示例来源:origin: palantir/Cinch

@Override
protected void paintMinorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x) {
super.paintMinorTickForHorizSlider(g, tickBounds, x);
Color original = g.getColor();
if (valueForXPosition(x) > slider.getMaximum() - slider.getExtent()) {
g.setColor(Color.RED);
}
g.drawLine(x, TICK_BUFFER, x, TICK_BUFFER + (tickLength / 2));
g.setColor(original);
}

代码示例来源:origin: palantir/Cinch

@Override
protected void paintMajorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x) {
super.paintMajorTickForHorizSlider(g, tickBounds, x);
Color original = g.getColor();
if (valueForXPosition(x) > slider.getMaximum() - slider.getExtent()) {
g.setColor(Color.RED);
}
g.drawLine(x, TICK_BUFFER, x, TICK_BUFFER + (tickLength - 1));
g.setColor(original);
}
}

代码示例来源:origin: org.gephi/ui-components

int upperValue = slider.getValue() + slider.getExtent();
int snappedValue = upperValue;
int majorTickSpacing = slider.getMajorTickSpacing();
int upperPosition = xPositionForValue(slider.getValue() + slider.getExtent());
upperThumbRect.x = upperPosition - (upperThumbRect.width / 2);
upperThumbRect.y = trackRect.y;
int upperPosition = yPositionForValue(slider.getValue() + slider.getExtent());
upperThumbRect.x = trackRect.x;
upperThumbRect.y = upperPosition - (upperThumbRect.height / 2);

代码示例来源:origin: igvteam/igv

int upperValue = slider.getValue() + slider.getExtent();
int snappedValue = upperValue;
int majorTickSpacing = slider.getMajorTickSpacing();
int upperPosition = xPositionForValue(slider.getValue() + slider.getExtent());
upperThumbRect.x = upperPosition - (upperThumbRect.width / 2);
upperThumbRect.y = trackRect.y;
int upperPosition = yPositionForValue(slider.getValue() + slider.getExtent());
upperThumbRect.x = trackRect.x;
upperThumbRect.y = upperPosition - (upperThumbRect.height / 2);

代码示例来源:origin: org.gephi/ui-components

int upperValue = slider.getValue() + slider.getExtent();
int snappedValue = upperValue;
int majorTickSpacing = slider.getMajorTickSpacing();
int upperPosition = xPositionForValue(slider.getValue() + slider.getExtent());
upperThumbRect.x = upperPosition - (upperThumbRect.width / 2);
upperThumbRect.y = trackRect.y;
int upperPosition = yPositionForValue(slider.getValue() + slider.getExtent());
upperThumbRect.x = trackRect.x;
upperThumbRect.y = upperPosition - (upperThumbRect.height / 2);

代码示例来源:origin: com.synaptix/SynaptixSwing

public boolean shouldScroll(int direction) {
Rectangle r = thumbRect;
if (slider.getOrientation() == JSlider.VERTICAL) {
if (drawInverted() ? direction <0 : direction > 0) {
if (r.y <= currentMouseY) {
return false;
}
} else if (r.y + r.height >= currentMouseY) {
return false;
}
} else {
if (drawInverted() ? direction <0 : direction > 0) {
if (r.x + r.width >= currentMouseX) {
return false;
}
} else if (r.x <= currentMouseX) {
return false;
}
}
if (direction > 0
&& slider.getValue() + slider.getExtent() >= slider
.getMaximum()) {
return false;
} else if (direction <0
&& slider.getValue() <= slider.getMinimum()) {
return false;
}
return true;
}

代码示例来源:origin: com.synaptix/SynaptixSwing

public boolean shouldScroll(int direction) {
Rectangle r = thumbRect;
if (slider.getOrientation() == JSlider.VERTICAL) {
if (drawInverted() ? direction <0 : direction > 0) {
if (r.y <= currentMouseY) {
return false;
}
} else if (r.y + r.height >= currentMouseY) {
return false;
}
} else {
if (drawInverted() ? direction <0 : direction > 0) {
if (r.x + r.width >= currentMouseX) {
return false;
}
} else if (r.x <= currentMouseX) {
return false;
}
}
if (direction > 0
&& slider.getValue() + slider.getExtent() >= slider
.getMaximum()) {
return false;
} else if (direction <0
&& slider.getValue() <= slider.getMinimum()) {
return false;
}
return true;
}

代码示例来源:origin: khuxtable/seaglass

int trackTop = trackRect.y;
int trackBottom = trackRect.y + trackRect.height - halfThumbHeight - trackBorder;
int vMax = yPositionForValue(slider.getMaximum() - slider.getExtent());
int trackLeft = trackRect.x + halfThumbWidth + trackBorder;
int trackRight = trackRect.x + trackRect.width - halfThumbWidth - trackBorder;
int hMax = xPositionForValue(slider.getMaximum() - slider.getExtent());

代码示例来源:origin: com.synaptix/SynaptixSwing

int trackBottom = trackRect.y + (trackRect.height - 1);
int vMax = yPositionForValue(slider.getMaximum()
- slider.getExtent());
int trackRight = trackRect.x + (trackRect.width - 1);
int hMax = xPositionForValue(slider.getMaximum()
- slider.getExtent());

代码示例来源:origin: com.synaptix/SynaptixSwing

int trackBottom = trackRect.y + (trackRect.height - 1);
int vMax = yPositionForValue(slider.getMaximum()
- slider.getExtent());
int trackRight = trackRect.x + (trackRect.width - 1);
int hMax = xPositionForValue(slider.getMaximum()
- slider.getExtent());

代码示例来源:origin: stackoverflow.com

int oldExtent = getExtent();
super.setExtent(extent);
firePropertyChange(EXTENT_PROPERTY, Integer.valueOf(oldExtent), Integer.valueOf(extent));

代码示例来源:origin: palantir/Cinch

@Override
protected void paintHorizontalLabel(Graphics g, int value, Component label) {
final int extentLowerBound = slider.getMaximum() - slider.getExtent();
setOriginalLabelColor(label.getForeground());
if (value > extentLowerBound) {
label.setForeground(Color.RED);
} else {
label.setForeground(originalLabelColor);
}
super.paintHorizontalLabel(g, value, label);
}

推荐阅读
author-avatar
450651324_43c723
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有