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

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

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

JSlider.getFont介绍

暂无

代码示例

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing-widget

protected void createSlider() {
  slider = new javax.swing.JSlider();
  $objectMap.put("slider", slider);
  slider.setName("slider");
  slider.setValue(0);
  slider.setMajorTickSpacing(60);
  slider.setPaintTicks(true);
  slider.setPaintLabels(true);
  slider.setMinorTickSpacing(30);
  if (slider.getFont() != null) slider.setFont(slider.getFont().deriveFont((float) 11));
  slider.addChangeListener((javax.swing.event.ChangeListener) jaxx.runtime.Util.getEventListener(javax.swing.event.ChangeListener.class, "stateChanged", $JPanel0, "doStateChanged__on__slider"));
}

代码示例来源: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");

代码示例来源:origin: net.java.dev.swing-layout/swing-layout

FontMetrics metrics = slider.getFontMetrics(slider.getFont());
Insets insets = slider.getInsets();
Insets focusInsets = (Insets)UIManager.get("Slider.focusInsets");

代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets

protected void createSlider() {
  $objectMap.put("slider", slider = new JSlider());
  
  slider.setName("slider");
  slider.setValue(0);
  slider.setPaintLabels(true);
  slider.setPaintTicks(true);
  if (slider.getFont() != null) {
    slider.setFont(slider.getFont().deriveFont((float) 11));
  }
  slider.setMajorTickSpacing(60);
  slider.setMinorTickSpacing(30);
  slider.addChangeListener(JAXXUtil.getEventListener(ChangeListener.class, "stateChanged", this, "doStateChanged__on__slider"));
}

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

super.getBaseline(c, width, height);
if (slider.getPaintLabels() && labelsHaveSameBaselines()) {
  FontMetrics metrics = slider.getFontMetrics(slider.getFont());
  Insets insets = slider.getInsets();
  Dimension thumbSize = getThumbSize();

代码示例来源:origin: com.github.insubstantial/substance

@Override
protected void installDefaults(JSlider slider) {
  super.installDefaults(slider);
  Font f = slider.getFont();
  if (f == null || f instanceof UIResource) {
    slider.setFont(new FontUIResource(SubstanceLookAndFeel
        .getFontPolicy().getFontSet("Substance", null)
        .getControlFont()));
  }
  int size = SubstanceSizeUtils.getSliderIconSize(SubstanceSizeUtils
      .getComponentFontSize(slider));
  // System.out.println("Slider size : " + size);
  this.horizontalIcon = SubstanceIconFactory.getSliderHorizontalIcon(
      size, false);
  this.roundIcon = SubstanceIconFactory.getSliderRoundIcon(size);
  this.verticalIcon = SubstanceIconFactory.getSliderVerticalIcon(size,
      false);
  int focusIns = (int) Math.ceil(2.0 * SubstanceSizeUtils
      .getFocusStrokeWidth(SubstanceSizeUtils
          .getComponentFontSize(slider)));
  this.focusInsets = new Insets(focusIns, focusIns, focusIns, focusIns);
}

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

super.getBaseline(c, width, height);
if (slider.getPaintLabels() && labelsHaveSameBaselines()) {
  FontMetrics metrics = slider.getFontMetrics(slider.getFont());
  Insets insets = slider.getInsets();
  Dimension thumbSize = getThumbSize();

代码示例来源:origin: org.java.net.substance/substance

@Override
protected void installDefaults(JSlider slider) {
  super.installDefaults(slider);
  Font f = slider.getFont();
  if (f == null || f instanceof UIResource) {
    slider.setFont(new FontUIResource(SubstanceLookAndFeel
        .getFontPolicy().getFontSet("Substance", null)
        .getControlFont()));
  }
  int size = SubstanceSizeUtils.getSliderIconSize(SubstanceSizeUtils
      .getComponentFontSize(slider));
  // System.out.println("Slider size : " + size);
  this.horizontalIcon = SubstanceIconFactory.getSliderHorizontalIcon(
      size, false);
  this.roundIcon = SubstanceIconFactory.getSliderRoundIcon(size);
  this.verticalIcon = SubstanceIconFactory.getSliderVerticalIcon(size,
      false);
  int focusIns = (int) Math.ceil(2.0 * SubstanceSizeUtils
      .getFocusStrokeWidth(SubstanceSizeUtils
          .getComponentFontSize(slider)));
  this.focusInsets = new Insets(focusIns, focusIns, focusIns, focusIns);
}

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

FontMetrics fm = slider.getFontMetrics(slider.getFont());
valueRect.width = Math.max(synthGraphics.computeStringWidth(context, slider.getFont(), fm, "" + slider.getMaximum()),
  synthGraphics.computeStringWidth(context, slider.getFont(), fm, "" + slider.getMinimum()));

相关文章

JSlider类方法