javax.swing.JTextPane.getUI()方法的使用及代码示例

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

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

JTextPane.getUI介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

pane.setText(s);
final Dimension preferredSize = pane.getUI().getPreferredSize(pane);
int w = preferredSize.width;
int h = preferredSize.height;
final Graphics2D d = img.createGraphics();
d.setClip(0, 0, w, h); // throws a NullPointerException if I leave this out
pane.getUI().paint(d, pane);
d.dispose();
JOptionPane.showMessageDialog(null, new JLabel(new ImageIcon(img)));

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

@Override
  public void computeBounds (JTextPane textPane) {
    Rectangle tpBounds = textPane.getBounds();
    TextUI tui = textPane.getUI();
    this.bounds = new Rectangle();
    try {
      Rectangle startr = tui.modelToView(textPane, docstart, Position.Bias.Forward).getBounds();
      Rectangle endr = tui.modelToView(textPane, docend, Position.Bias.Backward).getBounds();
      this.bounds = new Rectangle(tpBounds.x + startr.x, startr.y, endr.x - startr.x, startr.height);
    } catch (BadLocationException ex) {
      Exceptions.printStackTrace(ex);
    }
  }
}

代码示例来源:origin: stackoverflow.com

public void run() {
      try {
        View baseView = pane.getUI().getRootView( pane );
        View root = baseView.getView(0);
        for( int i = 0; i < root.getViewCount()-MAX; i++ ) {
public void actionPerformed( ActionEvent e ) {
  try {
    View baseView = pane.getUI().getRootView( pane );
    View root = baseView.getView(0);
    int line = root.getViewIndex( 0, Bias.Forward );

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

trgQueryTextPane.getUI().getRootView(trgQueryTextPane);
srcQueryTextPane.getUI().getRootView(srcQueryTextPane);
mapTextPane.getUI().getRootView(mapTextPane);

代码示例来源:origin: org.protege/protege-editor-owl

View v = textPane.getUI().getRootView(textPane);
v.setSize(textWidth, Integer.MAX_VALUE);
textHeight = (int) v.getMinimumSpan(View.Y_AXIS);

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

View v = textPane.getUI().getRootView(textPane);
v.setSize(textWidth, Integer.MAX_VALUE);
textHeight = (int) v.getMinimumSpan(View.Y_AXIS);

代码示例来源:origin: org.protege/protege-editor-owl

if (preferredWidth != -1) {
  textWidth = preferredWidth - iconWidth - rcInsets.left - rcInsets.right;
  View v = textPane.getUI().getRootView(textPane);
  v.setSize(textWidth, Integer.MAX_VALUE);
  textHeight = (int) v.getMinimumSpan(View.Y_AXIS);

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

if (preferredWidth != -1) {
  textWidth = preferredWidth - iconWidth - rcInsets.left - rcInsets.right;
  View v = textPane.getUI().getRootView(textPane);
  v.setSize(textWidth, Integer.MAX_VALUE);
  textHeight = (int) v.getMinimumSpan(View.Y_AXIS);

代码示例来源:origin: Waikato/weka-trunk

m_PrintPane.validate();
rootView = m_PrintPane.getUI().getRootView(m_PrintPane);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

m_PrintPane.validate();
rootView = m_PrintPane.getUI().getRootView(m_PrintPane);

代码示例来源:origin: protegeproject/protege

View v = textPane.getUI().getRootView(textPane);
v.setSize(textWidth, Integer.MAX_VALUE);
textHeight = (int) v.getMinimumSpan(View.Y_AXIS);

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

View v = textPane.getUI().getRootView(textPane);
v.setSize(textWidth, Integer.MAX_VALUE);
textHeight = (int) v.getMinimumSpan(View.Y_AXIS);

代码示例来源:origin: protegeproject/protege

if (preferredWidth != -1) {
  textWidth = preferredWidth - iconPreferredSize.width - rcInsets.left - rcInsets.right;
  View v = textPane.getUI().getRootView(textPane);
  v.setSize(textWidth, Integer.MAX_VALUE);
  textHeight = (int) v.getMinimumSpan(View.Y_AXIS);

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

if (preferredWidth != -1) {
  textWidth = preferredWidth - iconPreferredSize.width - rcInsets.left - rcInsets.right;
  View v = textPane.getUI().getRootView(textPane);
  v.setSize(textWidth, Integer.MAX_VALUE);
  textHeight = (int) v.getMinimumSpan(View.Y_AXIS);

相关文章

JTextPane类方法