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

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

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

JPanel.getFont介绍

暂无

代码示例

代码示例来源:origin: apache/pdfbox

private JPanel getHeaderPanel(Map<String, String> attributes)
{
  JPanel headerPanel = new JPanel(new GridBagLayout());
  headerPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 5, 0));
  if (attributes != null)
  {
    Iterator<String> keys = attributes.keySet().iterator();
    int row = 0;
    while (keys.hasNext())
    {
      int fontSize = Integer.parseInt(PDFDebugger.configuration.getProperty(
                "headerFontSize", "" + headerPanel.getFont().getSize()));
      String key = keys.next();
      JLabel encodingNameLabel = new JLabel(key + ": " + attributes.get(key));
      encodingNameLabel.setFont(new Font(Font.DIALOG, Font.PLAIN, fontSize));
      encodingNameLabel.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
      GridBagConstraints gbc = new GridBagConstraints();
      gbc.gridx = 0;
      gbc.gridy = row++;
      gbc.weighty = 0.1;
      gbc.anchor = GridBagConstraints.LINE_START;
      headerPanel.add(encodingNameLabel, gbc);
    }
  }
  return headerPanel;
}

代码示例来源:origin: edu.stanford.protege/org.coode.owlviz

public OWLClsNodeRenderer(Controller controller,
             VisualisedObjectManager manager,
             NodeLabelRenderer labelRenderer,
             OWLModelManager owlModelManager) {
  this.owlModelManager = owlModelManager;
  if (manager == null) {
    throw new NullPointerException("VisualisedObjectManager must not be null");
  }
  if (labelRenderer == null) {
    throw new NullPointerException("NodeLabelRenderer must not be null");
  }
  this.controller = controller;
  visualisedObjectManager = manager;
  JPanel pan = new JPanel();
  Font font = pan.getFont();
  labelFont = font.deriveFont(10.0f);
  if (labelFont == null) {
    logger.warn("Font is NULL!");
  }
  fontMetrics = pan.getFontMetrics(labelFont);
  if (fontMetrics == null) {
    logger.warn("Font metrics is NULL!");
  }
  setupArrows();
}

代码示例来源:origin: org.softsmithy.lib/softsmithy-lib-swing

@Override
public Font getDefaultFont() {
  return super.getFont();
}

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

protected void enableIdOnTitleBar() {
  TableLayout layout = (TableLayout) titleBar.getLayout();
  layout.setColumn(0,
           titleBar
               .getFontMetrics(titleBar.getFont())
               .stringWidth(
                   resourceManager.getUserString(toolWindow.getId())
               )
           + 12);
  SwingUtil.repaint(titleBar);
}

代码示例来源:origin: GoldenGnu/jeveassets

@Override
public final Font getFont() {
  return super.getFont();
}

代码示例来源:origin: info.aduna.commons/aduna-commons-graphics

public java.awt.Font getFont() {
  return panel.getFont();
}

代码示例来源:origin: org.softsmithy.lib/lib-core

public Font getDefaultFont() {
 return super.getFont();
}

代码示例来源:origin: sing-group/GC4S

/**
 * Returns the heat map font.
 *
 * @return the heat map font
 */
public Font getHeatmapFont() {
  return this.font.orElse(super.getFont());
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction
@Override
public Font getFont() {
  return super.getFont();
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = FONT_JSDOC)
@Override
public Font getFont() {
  return super.getFont();
}

代码示例来源:origin: edu.stanford.protege/org.coode.owlviz

public DefaultEdgeRenderer(Controller controller)
{
  this.controller = controller;
  updateEdgeColor();
  parentEdgeColor = new Color(125, 0, 125);
  childEdgeColor = new Color(0, 125, 0);
  selEdgeStroke = new BasicStroke(2, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
  edgeStroke = new BasicStroke(1, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
  JPanel pan = new JPanel();
  Font font = pan.getFont();
  labelFont = font.deriveFont(10.0f);
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = FONT_JSDOC)
@Override
public Font getFont() {
  return super.getFont();
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = FONT_JSDOC)
@Override
public Font getFont() {
  return super.getFont();
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = FONT_JSDOC)
@Override
public Font getFont() {
  return super.getFont();
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = FONT_JSDOC)
@Override
public Font getFont() {
  return super.getFont();
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = FONT_JSDOC)
@Override
public Font getFont() {
  return super.getFont();
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction
@Override
public Font getFont() {
  return super.getFont();
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

/**
 * Gets the font of this component.
 *
 * @return this component's font; if a font has not been set
 *         for this component, the font of its parent is returned
 */
public Font getFont() {
  Font font = super.getFont();
  if ((font == null) && (tree != null)) {
    // Strive to return a non-null value, otherwise the html support
    // will typically pick up the wrong font in certain situations.
    font = tree.getFont();
  }
  return font;
}

代码示例来源:origin: tinyMediaManager/tinyMediaManager

private ImageIcon getScaledIcon(ImageIcon original) {
 Canvas c = new Canvas();
 FontMetrics fm = c.getFontMetrics(new JPanel().getFont());
 int height = (int) (fm.getHeight() * 2f);
 int width = original.getIconWidth() / original.getIconHeight() * height;
 BufferedImage scaledImage;
 if (!scraper.isEnabled()) {
  scaledImage = Scalr.resize(ImageCache.createImage(original.getImage()), Scalr.Method.QUALITY, Scalr.Mode.AUTOMATIC, width, height,
    Scalr.OP_GRAYSCALE);
 }
 else {
  scaledImage = Scalr.resize(ImageCache.createImage(original.getImage()), Scalr.Method.QUALITY, Scalr.Mode.AUTOMATIC, width, height,
    Scalr.OP_ANTIALIAS);
 }
 return new ImageIcon(scaledImage);
}

代码示例来源:origin: tinyMediaManager/tinyMediaManager

private ImageIcon getScaledIcon(ImageIcon original) {
 Canvas c = new Canvas();
 FontMetrics fm = c.getFontMetrics(new JPanel().getFont());
 int height = (int) (fm.getHeight() * 2f);
 int width = original.getIconWidth() / original.getIconHeight() * height;
 BufferedImage scaledImage;
 if (!scraper.isEnabled()) {
  scaledImage = Scalr.resize(ImageCache.createImage(original.getImage()), Scalr.Method.QUALITY, Scalr.Mode.AUTOMATIC, width, height,
    Scalr.OP_GRAYSCALE);
 }
 else {
  scaledImage = Scalr.resize(ImageCache.createImage(original.getImage()), Scalr.Method.QUALITY, Scalr.Mode.AUTOMATIC, width, height,
    Scalr.OP_ANTIALIAS);
 }
 return new ImageIcon(scaledImage);
}

相关文章

JPanel类方法