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

x33g5p2x  于2022-01-21 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(88)

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

JSlider.getHeight介绍

暂无

代码示例

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

public void paintTrack(Graphics g) {
  g.drawImage(IMAGE_ZOOM_SLIDER_NORM, trackRect.x - trackBuffer,
      0, trackRect.width + trackBuffer * 2,
      slider.getHeight() - 1, null);
}

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

protected void calculateFocusRect() {
  focusRect.x = insetCache.left;
  focusRect.y = insetCache.top;
  focusRect.width = slider.getWidth()
      - (insetCache.left + insetCache.right);
  focusRect.height = slider.getHeight()
      - (insetCache.top + insetCache.bottom);
}

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

protected void calculateFocusRect() {
  focusRect.x = insetCache.left;
  focusRect.y = insetCache.top;
  focusRect.width = slider.getWidth()
      - (insetCache.left + insetCache.right);
  focusRect.height = slider.getHeight()
      - (insetCache.top + insetCache.bottom);
}

代码示例来源:origin: joel-costigliola/assertj-swing

@RunsInCurrentThread
@Override
int max(@Nonnull JSlider slider, @Nonnull Insets insets) {
 return slider.getHeight() - insets.top - insets.bottom - 1;
}

代码示例来源:origin: lbalazscs/Pixelitor

@Override
protected void calculateTrackRect() {
  super.calculateTrackRect();
  ColorPickerPanel cp = colorPicker.getColorPanel();
  int size = Math.min(ColorPickerPanel.MAX_SIZE, Math.min(cp.getWidth(), cp.getHeight()));
  int max = slider.getHeight()-ARROW_HALF*2-2;
  if(size>max) {
    size = max;
  }
  trackRect.y = slider.getHeight()/2-size/2;
  trackRect.height = size;
}

代码示例来源: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: 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: it.unibo.alchemist/alchemist-swingui

/**
 * 
 */
public ReactivityPanel() {
  super(UI_REACTIVITY);
  slider.setPreferredSize(new Dimension(SLIDE_SIZE, slider.getHeight()));
  // setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
  // button = new JButton(max);
  btnMax = new JToggleButton(MAX_REACTIVITY, max, true);
  btnReal = new JToggleButton(REALTIME, real, false);
  btnUser = new JToggleButton(USER_SELECTED, user, false);
  /*
   * add(button); add(slider); button.addActionListener(this);
   */
  btnMax.addItemListener(this);
  btnReal.addItemListener(this);
  btnUser.addItemListener(this);
  slider.setEnabled(false);
  stack1.registerFeature(btnMax);
  stack1.registerFeature(btnReal);
  buttMF.registerFeature(btnUser);
  sliderMF.registerFeature(slider);
  registerSection(stack1);
  registerSection(buttMF);
  registerSection(sliderMF);
}

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

valueRect.width = trackRect.width = tickRect.width = labelRect.width = (contentDim.width - (pad * 2));
int centerY = slider.getHeight() / 2 - contentDim.height / 2;
int w2 = trackRect.width / 2 + trackInsets.right + tickRect.width + labelRect.width;
contentDim.width = Math.max(w1, l) + Math.max(w2, l) + 2 + insetCache.left + insetCache.right;
contentDim.height = slider.getHeight() - insetCache.top - insetCache.bottom;

相关文章

JSlider类方法