本文整理了Java中javax.swing.JSlider.getInsets()
方法的一些代码示例,展示了JSlider.getInsets()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSlider.getInsets()
方法的具体详情如下:
包路径:javax.swing.JSlider
类名称:JSlider
方法名:getInsets
暂无
代码示例来源:origin: com.synaptix/SynaptixSwing
protected void recalculateIfInsetsChanged() {
Insets newInsets = slider.getInsets();
if (!newInsets.equals(insetCache)) {
insetCache = newInsets;
calculateGeometry();
}
}
代码示例来源:origin: com.synaptix/SynaptixSwing
protected void recalculateIfInsetsChanged() {
Insets newInsets = slider.getInsets();
if (!newInsets.equals(insetCache)) {
insetCache = newInsets;
calculateGeometry();
}
}
代码示例来源:origin: joel-costigliola/assertj-swing
@RunsInCurrentThread
final @Nonnull Point locationForValue(JSlider slider, int value) {
Point center = new Point(slider.getWidth() / 2, slider.getHeight() / 2);
int max = max(slider, checkNotNull(slider.getInsets()));
int coordinate = (int) (percent(slider, value) * max);
if (!slider.getInverted()) {
coordinate = max - coordinate;
}
return update(center, coordinate);
}
代码示例来源:origin: net.java.dev.swing-layout/swing-layout
private int getSliderBaseline(JSlider slider, int height) {
if (slider.getPaintLabels()) {
FontMetrics metrics = slider.getFontMetrics(slider.getFont());
Insets insets = slider.getInsets();
Insets focusInsets = (Insets)UIManager.get("Slider.focusInsets");
if (slider.getOrientation() == JSlider.HORIZONTAL) {
代码示例来源:origin: com.synaptix/SynaptixSwing
public void installUI(JComponent c) {
slider = (JSlider) c;
checkedLabelBaselines = false;
slider.setEnabled(slider.isEnabled());
LookAndFeel.installProperty(slider, "opaque", Boolean.TRUE); //$NON-NLS-1$
isDragging = false;
trackListener = createTrackListener(slider);
changeListener = createChangeListener(slider);
componentListener = createComponentListener(slider);
focusListener = createFocusListener(slider);
scrollListener = createScrollListener(slider);
propertyChangeListener = createPropertyChangeListener(slider);
installDefaults(slider);
installListeners(slider);
installKeyboardActions(slider);
scrollTimer = new Timer(100, scrollListener);
scrollTimer.setInitialDelay(300);
insetCache = slider.getInsets();
leftToRightCache = slider.getComponentOrientation().isLeftToRight();
focusRect = new Rectangle();
focusInsets = new Insets(0, 0, 0, 0);
contentRect = new Rectangle();
labelRect = new Rectangle();
tickRect = new Rectangle();
trackRect = new Rectangle();
thumbRect = new Rectangle();
calculateGeometry(); // This figures out where the labels, ticks,
// track, and thumb are.
}
代码示例来源:origin: com.synaptix/SynaptixSwing
public void installUI(JComponent c) {
slider = (JSlider) c;
checkedLabelBaselines = false;
slider.setEnabled(slider.isEnabled());
LookAndFeel.installProperty(slider, "opaque", Boolean.TRUE); //$NON-NLS-1$
isDragging = false;
trackListener = createTrackListener(slider);
changeListener = createChangeListener(slider);
componentListener = createComponentListener(slider);
focusListener = createFocusListener(slider);
scrollListener = createScrollListener(slider);
propertyChangeListener = createPropertyChangeListener(slider);
installDefaults(slider);
installListeners(slider);
installKeyboardActions(slider);
scrollTimer = new Timer(100, scrollListener);
scrollTimer.setInitialDelay(300);
insetCache = slider.getInsets();
leftToRightCache = slider.getComponentOrientation().isLeftToRight();
focusRect = new Rectangle();
focusInsets = new Insets(0, 0, 0, 0);
contentRect = new Rectangle();
labelRect = new Rectangle();
tickRect = new Rectangle();
trackRect = new Rectangle();
thumbRect = new Rectangle();
calculateGeometry(); // This figures out where the labels, ticks,
// track, and thumb are.
}
代码示例来源:origin: net.java.dev.swing-layout/swing-layout
boolean isAqua = isAqua();
FontMetrics metrics = slider.getFontMetrics(slider.getFont());
Insets insets = slider.getInsets();
Insets focusInsets = (Insets)UIManager.get("Slider.focusInsets");
if (slider.getOrientation() == JSlider.HORIZONTAL) {
代码示例来源:origin: abbot/abbot
private ComponentLocation valueToLocation(JSlider s, int value) {
int range = s.getMaximum() - s.getMinimum();
int x = s.getWidth()/2;
int y = s.getHeight()/2;
Insets insets = s.getInsets();
float percent = (float)(value - s.getMinimum()) / range;
if (s.getOrientation() == JSlider.VERTICAL) {
int max = s.getHeight() - insets.top - insets.bottom - 1;
y = (int)(percent * max);
if (!s.getInverted()) {
y = max - y;
}
}
else {
int max = s.getWidth() - insets.left - insets.right - 1;
x = (int)(percent * max);
if (s.getInverted()) {
x = max - x;
}
}
return new ComponentLocation(new Point(x, y));
}
代码示例来源:origin: com.synaptix/SynaptixSwing
if (slider.getPaintLabels() && labelsHaveSameBaselines()) {
FontMetrics metrics = slider.getFontMetrics(slider.getFont());
Insets insets = slider.getInsets();
Dimension thumbSize = getThumbSize();
if (slider.getOrientation() == JSlider.HORIZONTAL) {
代码示例来源:origin: com.synaptix/SynaptixSwing
if (slider.getPaintLabels() && labelsHaveSameBaselines()) {
FontMetrics metrics = slider.getFontMetrics(slider.getFont());
Insets insets = slider.getInsets();
Dimension thumbSize = getThumbSize();
if (slider.getOrientation() == JSlider.HORIZONTAL) {
代码示例来源:origin: com.synaptix/SynaptixWidget
private void paintSliderTrackSelected(Graphics2D graphics, boolean drawInverted, Rectangle paintRect, SubstanceColorScheme fillScheme, SubstanceColorScheme borderScheme, int width, int height) {
Insets insets = this.slider.getInsets();
insets.top /= 2;
insets.left /= 2;
代码示例来源:origin: com.github.insubstantial/substance
Insets insets = this.slider.getInsets();
insets.top /= 2;
insets.left /= 2;
代码示例来源:origin: org.java.net.substance/substance
Insets insets = this.slider.getInsets();
insets.top /= 2;
insets.left /= 2;
内容来源于网络,如有侵权,请联系作者删除!