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

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

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

JTextComponent.getHeight介绍

暂无

代码示例

代码示例来源:origin: bobbylight/RSyntaxTextArea

private int constrainY(JTextComponent textArea, int y, int vis, int screenHeight) {
  if (y < 0) {
    y = 0;
  }
  else if (y + vis > textArea.getHeight()) {
    //y = Math.max(0, textArea.getHeight() - vis);
    y = Math.max(0, textArea.getHeight()-screenHeight);
  }
  return y;
}

代码示例来源:origin: com.fifesoft/rsyntaxtextarea

private int constrainY(JTextComponent textArea, int y, int vis, int screenHeight) {
  if (y < 0) {
    y = 0;
  }
  else if (y + vis > textArea.getHeight()) {
    //y = Math.max(0, textArea.getHeight() - vis);
    y = Math.max(0, textArea.getHeight()-screenHeight);
  }
  return y;
}

代码示例来源:origin: org.nuiton.thirdparty/rsyntaxtextarea

private int constrainY(JTextComponent textArea, int y, int vis, int screenHeight) {
  if (y < 0)
    y = 0;
  else if (y + vis > textArea.getHeight()) {
    //y = Math.max(0, textArea.getHeight() - vis);
    y = Math.max(0, textArea.getHeight()-screenHeight);
  }
  return y;
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

/**
 * {@inheritDoc}
 */
@Override
public void paint(Graphics g) {
  Graphics2D g2d = (Graphics2D) g.create();
  try {
    painter.paint(g2d, c, c.getWidth(), c.getHeight());
  } finally {
    g2d.dispose();
  }
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

/**
 * {@inheritDoc}
 */
@Override
public void paint(Graphics g) {
  Graphics2D g2d = (Graphics2D) g.create();
  try {
    painter.paint(g2d, c, c.getWidth(), c.getHeight());
  } finally {
    g2d.dispose();
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

private void enableSideBarComponent(boolean enable){
  if (enable){
    setPreferredSize(new Dimension(getColoringFont().getSize(), component.getHeight()));    
    setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
  }else{
    setPreferredSize(new Dimension(0,0));
    setMaximumSize(new Dimension(0,0));
  }
}

代码示例来源:origin: org.bitbucket.goalhub.simpleide/jedit

public void showPopupMenu(boolean search)
{
  if(search)
    showPopupMenu(getText().substring(getInputStart(),
      text.getSelectionStart()),0,text.getHeight());
  else
    showPopupMenu("",0,text.getHeight());
} //}}}

代码示例来源:origin: org.gephi/directory-chooser

public void showPopup(JTextComponent source, int x, int y) {
  if(list.getModel().getSize() == 0) {
    return;
  }
  setPreferredSize(new Dimension(source.getWidth(), source.getHeight() * 4));
  show(source,  x, y);
  ensureSelection();
}

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

@Override
  protected void paint(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g) {
    g.setColor(color);
    g.fillRect(3, 3, getComponent().getWidth()-3, getComponent().getHeight()-6);
    super.paint(context, g);
  };
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-editor-fold-nbui

private void updatePreferredSize() {
  // do not show at all, if there are no providers registered.
  if (enabled && !alreadyPresent) {
    setPreferredSize(new Dimension(getColoring().getFont().getSize(), component.getHeight()));
    setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
  }else{
    setPreferredSize(new Dimension(0,0));
    setMaximumSize(new Dimension(0,0));
  }
  revalidate();
}

代码示例来源:origin: net.sf.nimrod/nimrod-laf

protected void paintFocus( Graphics g) {
 JTextComponent c = getComponent();
 
 if ( c.isEnabled() && c.isEditable() && !canijo ) {
  if ( focus ) {
   NimRODUtils.paintFocus( g, 1,1, c.getWidth()-2, c.getHeight()-2, 4,4, 3, NimRODLookAndFeel.getFocusColor());
  }
  else if ( rollover ) {
   NimRODUtils.paintFocus( g, 1,1, c.getWidth()-2, c.getHeight()-2, 4,4, 3, NimRODUtils.getColorAlfa( NimRODLookAndFeel.getFocusColor(), 150));
  }
 }
}

代码示例来源:origin: com.jtattoo/JTattoo

protected void paintBackground(Graphics g) {
  g.setColor(getComponent().getBackground());
  if (AbstractLookAndFeel.getTheme().doShowFocusFrame()) {
    Boolean doShow = (Boolean) getComponent().getClientProperty("doShowFocusFrame");
    if (doShow == null || doShow.booleanValue()) {
      if (getComponent().hasFocus() && getComponent().isEditable()) {
        g.setColor(AbstractLookAndFeel.getTheme().getFocusBackgroundColor());
      }
    }
  }
  g.fillRect(0, 0, getComponent().getWidth(), getComponent().getHeight());
}

代码示例来源:origin: com.jtattoo/JTattoo

protected void paintBackground(Graphics g) {
  g.setColor(getComponent().getBackground());
  if (AbstractLookAndFeel.getTheme().doShowFocusFrame()) {
    if (getComponent().hasFocus() && getComponent().isEditable()) {
      g.setColor(AbstractLookAndFeel.getTheme().getFocusBackgroundColor());
    }
  }
  g.fillRect(0, 0, getComponent().getWidth(), getComponent().getHeight());
}

代码示例来源:origin: com.jtattoo/JTattoo

protected void paintBackground(Graphics g) {
  g.setColor(getComponent().getBackground());
  if (AbstractLookAndFeel.getTheme().doShowFocusFrame()) {
    if (getComponent().hasFocus() && getComponent().isEditable()) {
      g.setColor(AbstractLookAndFeel.getTheme().getFocusBackgroundColor());
    }
  }
  g.fillRect(0, 0, getComponent().getWidth(), getComponent().getHeight());
}

代码示例来源:origin: com.jtattoo/JTattoo

protected void paintBackground(Graphics g) {
  g.setColor(getComponent().getBackground());
  if (AbstractLookAndFeel.getTheme().doShowFocusFrame()) {
    if (getComponent().hasFocus() && getComponent().isEditable()) {
      g.setColor(AbstractLookAndFeel.getTheme().getFocusBackgroundColor());
    }
  }
  g.fillRect(0, 0, getComponent().getWidth(), getComponent().getHeight());
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

protected void paintPromptComponent(Graphics g, JTextComponent txt) {
  JTextComponent lbl = getPromptComponent(txt);
  SwingUtilities.paintComponent(g, lbl, txt, 0, 0, txt.getWidth(), txt.getHeight());
  if (txt.getCaret() != null) {
    txt.getCaret().paint(g);
  }
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

protected void paintPromptComponent(Graphics g, JTextComponent txt) {
  JTextComponent lbl = getPromptComponent(txt);
  SwingUtilities.paintComponent(g, lbl, txt, 0, 0, txt.getWidth(), txt.getHeight());
  if (txt.getCaret() != null) {
    txt.getCaret().paint(g);
  }
}

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

protected void paintPromptComponent(Graphics g, JTextComponent txt) {
  JTextComponent lbl = getPromptComponent(txt);
  SwingUtilities.paintComponent(g, lbl, txt, 0, 0, txt.getWidth(), txt.getHeight());
  if (txt.getCaret() != null) {
    txt.getCaret().paint(g);
  }
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

protected void paintPromptComponent(Graphics g, JTextComponent txt) {
  JTextComponent lbl = getPromptComponent(txt);
  SwingUtilities.paintComponent(g, lbl, txt, 0, 0, txt.getWidth(), txt.getHeight());
  if (txt.getCaret() != null) {
    txt.getCaret().paint(g);
  }
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
  public void paintBackground(Graphics g) {
    JTextComponent c = getComponent();
    if (c.getBorder() instanceof BackdropBorder) {
      BackdropBorder bb = (BackdropBorder) c.getBorder();
      bb.getBackdropBorder().paintBorder(c, g, 0, 0, c.getWidth(), c.getHeight());
    } else {
      super.paintBackground(g);
    }
  }
}

相关文章

JTextComponent类方法