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

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

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

JTextPane.setCursor介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

lblMessage.setCursor(null);
lblMessage.setFocusable(false);
lblMessage.setOpaque(false);

代码示例来源:origin: ron190/jsql-injection

/**
 * Build new instance of JTextArea to decorate.
 */
public JPopupTextPane(JTextPane proxy) {
  super(proxy);
  this.getProxy().addFocusListener(new FocusAdapter() {
    @Override
    public void focusGained(FocusEvent arg0) {
      JPopupTextPane.this.getProxy().getCaret().setVisible(true);
      JPopupTextPane.this.getProxy().getCaret().setSelectionVisible(true);
    }
  });
  this.getProxy().setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
  this.getProxy().setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
}

代码示例来源:origin: org.gosu-lang.gosu/gosu-lab

@Override
public void mouseMoved( MouseEvent e )
{
 SourceFileAttribute link = getLinkAtCursor( e );
 if( link != null )
 {
  _outputPanel.setCursor( Cursor.getPredefinedCursor( Cursor.HAND_CURSOR ) );
 }
 else
 {
  _outputPanel.setCursor( Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR ) );
 }
}

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

public void mouseMoved(MouseEvent e) {
  if (e.getSource().equals(textPane)) {
    textPane.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    linkerSupport.computeBounds(textPane, 0);
    linkerSupport.mouseMoved(e.getPoint(), textPane, messageOffset);
  }
  textPane.setToolTipText("");  // NOI18N
}

代码示例来源:origin: omegat-org/omegat

@Override
  public void mouseMoved(final MouseEvent e) {
    final StyledDocument doc = jTextPane.getStyledDocument();
    final Element characterElement = doc.getCharacterElement(jTextPane.viewToModel(e.getPoint()));
    final AttributeSet as = characterElement.getAttributes();
    final Object attr = as.getAttribute(ATTR_LINK);
    if (attr instanceof IAttributeAction) {
      jTextPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    } else {
      jTextPane.setCursor(Cursor.getDefaultCursor());
    }
  }
}

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

@Override
  public void mouseMoved(MouseEvent e) {
    JTextPane pane = (JTextPane)e.getSource();
    StyledDocument doc = pane.getStyledDocument();
    Element elem = doc.getCharacterElement(pane.viewToModel(e.getPoint()));
    AttributeSet as = elem.getAttributes();
    if (StyleConstants.isUnderline(as)) {
      pane.setCursor(new Cursor(Cursor.HAND_CURSOR));
    } else {
      pane.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    }
  }
};

代码示例来源:origin: otros-systems/otroslogviewer

return;
textPane.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
textPane.setToolTipText("");
   if (locationInfo != null && jumpToCodeService.isJumpable(locationInfo)) {
    Optional<Integer> lineNumber = locationInfo.getLineNumber();
    textPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    StringBuilder toolTipText = new StringBuilder("<HTML>On click will open ").append(locationInfo.stringForm()).append(" in IDEA using JumpToCode plugin<BR/>");
    String content = jumpToCodeService.getContent(locationInfo);
exceptionNameAndMsgUnderCursor.ifPresent(msg -> {
 textPane.setToolTipText("Open in browser: " + STACKOVERFLOW_QUERY + msg);
 textPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
});

代码示例来源:origin: Vhati/Slipstream-Mod-Manager

@Override
public void mouseMoved( MouseEvent e ) {
  AttributeSet tmpAttr = doc.getCharacterElement( textPane.viewToModel( e.getPoint() ) ).getAttributes();
  Object targetObj = tmpAttr.getAttribute( ATTR_HYPERLINK_TARGET );
  if ( targetObj != null ) {
    textPane.setCursor( linkCursor );
    if ( statusbar != null )
      statusbar.setStatusText( targetObj.toString() );
    wasOverLink = true;
  }
  else {
    if ( wasOverLink ) {
      textPane.setCursor( defaultCursor );
      if ( statusbar != null )
        statusbar.setStatusText( "" );
    }
    wasOverLink = false;
  }
}

代码示例来源:origin: blurpy/kouchat

/**
 * Updates the mouse cursor when hovering over a link.
 *
 * {@inheritDoc}
 */
@Override
public void mouseMoved(final MouseEvent e) {
  final int mousePos = textPane.viewToModel(e.getPoint());
  final AttributeSet attr = doc.getCharacterElement(mousePos).getAttributes();
  if (StyleConstants.isUnderline(attr)) {
    if (textPane.getCursor() != handCursor) {
      textPane.setCursor(handCursor);
    }
  }
  else {
    if (textPane.getCursor() == handCursor) {
      textPane.setCursor(null);
    }
  }
}

代码示例来源:origin: edu.illinois.lis/indri

setCursor(wait);
docTextFrame.setCursor(wait);
docTextPane.setCursor(wait);
docTextPane.setCursor(def);
getDocTextThread = null;

代码示例来源:origin: AlexFalappa/nb-springboot

tpDetails.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
tpDetails.setMinimumSize(new java.awt.Dimension(42, 63));
tpDetails.setPreferredSize(new java.awt.Dimension(42, 63));

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

.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
m_OutputArea.setCursor(null);

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

.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
m_OutputArea.setCursor(null);

代码示例来源:origin: edu.illinois.lis/indri

setCursor(wait);
docTextFrame.setCursor(wait);
docTextPane.setCursor(wait);
  setCursor(def);
  docTextFrame.setCursor(def);
  docTextPane.setCursor(def);
  getDocTextThread = null;
  return;
docTextPane.setCursor(def);
getDocTextThread = null;

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

public void hyperlinkUpdate(final HyperlinkEvent e) {
  if (e.getEventType() == HyperlinkEvent.EventType.ENTERED) {
    srcFeedPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    if (e.getDescription().startsWith("http://") || e.getDescription().startsWith("https://")) { //NOI18N
      srcFeedPane.setToolTipText(e.getDescription());
    srcFeedPane.setCursor(Cursor.getDefaultCursor());
    srcFeedPane.setToolTipText(""); //NOI18N
    return;

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

editor.setToolTipText(href);
if (editor.getCursor().getType() != Cursor.HAND_CURSOR) {
  editor.setCursor(new Cursor(Cursor.HAND_CURSOR));
editor.setToolTipText(null);
if (editor.getCursor().getType() != Cursor.DEFAULT_CURSOR) {
  editor.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));

代码示例来源:origin: realXuJiang/bigtable-sql

editor.setToolTipText(href);
if (editor.getCursor().getType() != Cursor.HAND_CURSOR) {
  editor.setCursor(new Cursor(Cursor.HAND_CURSOR));
editor.setToolTipText(null);
if (editor.getCursor().getType() != Cursor.DEFAULT_CURSOR) {
  editor.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));

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

holder.setBorder(ComponentFactory.createTitledBorder("Preview"));
holder.add(previewText);
previewText.setCursor(new Cursor(Cursor.HAND_CURSOR));
previewText.addMouseMotionListener(new MouseMotionAdapter() {
  @Override

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

imageLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
description.setText(LBL_description(getProductVersionValue(), getJavaValue(), getVMValue(), getOperatingSystemValue(), getEncodingValue(), getSystemLocaleValue(), getUserDirValue(), Places.getCacheDirectory().getAbsolutePath(), "", FONT_SIZE, getJavaRuntime()));
description.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
RequestProcessor.getDefault().post(new Runnable() {

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

textPane.setCursor(HAND_CURSOR);
} else {
  textPane.setCursor(NORMAL_CURSOR);

相关文章

JTextPane类方法