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

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

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

JTextPane.addMouseMotionListener介绍

暂无

代码示例

代码示例来源:origin: stanfordnlp/CoreNLP

textPane.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
 @Override
 public void mouseDragged(java.awt.event.MouseEvent evt) {

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

private void initUI(StyledDocument document)
{
  mainPanel = new JPanel();
  textPane = new JTextPane(document);
  textPane.addMouseMotionListener(this);
  textPane.setFont(new Font("monospaced", Font.PLAIN, 13));
  searcher = new Searcher(textPane);
  JScrollPane scrollPane = new JScrollPane(textPane);
  BoxLayout boxLayout = new BoxLayout(mainPanel, BoxLayout.Y_AXIS);
  mainPanel.setLayout(boxLayout);
  mainPanel.add(searcher.getSearchPanel());
  mainPanel.add(scrollPane);
  searcher.getSearchPanel().setVisible(false);
  mainPanel.addAncestorListener(this);
}

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

@Override
  public void run() {
    registerLinkIntern(pane, pos, link);
    pane.removeMouseMotionListener(motionListener);
    pane.addMouseMotionListener(motionListener);
  }
});

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

private void registerForStacktraces(final JTextPane pane) {
  pane.removeMouseMotionListener(motionListener);
  StackTraceSupport.register(pane);
  pane.removeMouseMotionListener(motionListener);
  pane.addMouseMotionListener(motionListener);
}

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

private void registerForURLs(final JTextPane pane) {
  pane.removeMouseMotionListener(motionListener);
  WebUrlHyperlinkSupport.register(pane);
  pane.removeMouseMotionListener(motionListener);
  pane.addMouseMotionListener(motionListener);
}

代码示例来源:origin: edu.stanford.nlp/stanford-parser

textPane.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
 @Override
 public void mouseDragged(java.awt.event.MouseEvent evt) {

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

private void registerForTypes(final JTextPane pane) {
  pane.removeMouseMotionListener(motionListener);
  FindTypesSupport.getInstance().register(pane);
  pane.removeMouseMotionListener(motionListener);
  pane.addMouseMotionListener(motionListener);
}

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

private void registerForIssueLinks(final JTextPane pane, final Link issueLink, final IssueRefProvider issueIdProvider) {
  pane.removeMouseMotionListener(motionListener);
  try {
    String text = "";
    try {
      text = pane.getStyledDocument().getText(0, pane.getStyledDocument().getLength());
    } catch (BadLocationException ex) {
      Support.LOG.log(Level.INFO, null, ex);
    }
    registerLinkIntern(pane, issueIdProvider.getIssueRefSpans(text), issueLink);
  } catch (Exception ex) {
    Exceptions.printStackTrace(ex);
  }
  pane.addMouseMotionListener(motionListener);
}

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

public static void linkify(JTextPane jTextPane) {
  final MouseAdapter mouseAdapter = new AttributeInserterMouseListener(jTextPane);
  // Adding mouse listner for actions
  jTextPane.addMouseListener(mouseAdapter);
  // settings for mouseover (changing cursor)
  jTextPane.addMouseMotionListener(mouseAdapter);
  // Those are the main called points from user's activities.
  setDocumentFilter(jTextPane);
  jTextPane.addPropertyChangeListener("document", new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      Object source = evt.getSource();
      if (source instanceof JTextPane) {
        setDocumentFilter((JTextPane) source);
      }
    }
  });
}

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

@Override
  public void run() {
    StyledDocument doc = pane.getStyledDocument();
    Style hlStyle = doc.addStyle("regularBlue-findtype", defStyle);     // NOI18N
    hlStyle.addAttribute(HyperlinkSupport.TYPE_ATTRIBUTE, new TypeLink());
    StyleConstants.setForeground(hlStyle, UIUtils.getLinkColor());
    StyleConstants.setUnderline(hlStyle, true);            
    List<Integer> l = Collections.emptyList();
    try {
      l = getHighlightOffsets(doc.getText(0, doc.getLength()));
    } catch (BadLocationException ex) {
      Support.LOG.log(Level.SEVERE, null, ex);
    }
    List<Highlight> highlights = new ArrayList<Highlight>(l.size());
    for (int i = 0; i < l.size(); i++) {
      highlights.add(new Highlight(l.get(i), l.get(++i)));
    }
    pane.putClientProperty(HIGHLIGHTS_PROPERTY, highlights);
    pane.removeMouseMotionListener(FindTypesSupport.this);
    pane.addMouseMotionListener(FindTypesSupport.this);
    pane.removeMouseListener(FindTypesSupport.this);
    pane.addMouseListener(FindTypesSupport.this);
  }
});

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

textPane.addMouseMotionListener( hyperlinkListener );

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

_outputPanel.addMouseMotionListener( ml );
_outputPanel.addMouseListener( ml );
_outputPanel.addMouseWheelListener( ml );

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

holder.add(previewText);
previewText.setCursor(new Cursor(Cursor.HAND_CURSOR));
previewText.addMouseMotionListener(new MouseMotionAdapter() {
  @Override
  public void mouseMoved(MouseEvent e) {

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

final URLMouseListener urlML = new URLMouseListener(viewerTP, settings, errorHandler, swingMessages);
viewerTP.addMouseListener(urlML);
viewerTP.addMouseMotionListener(urlML);
final AbstractDocument doc = (AbstractDocument) viewerDoc;
doc.setDocumentFilter(new URLDocumentFilter(true));

代码示例来源:origin: eu.mihosoft.vrl/vrl

new FieldAdapter());
messageField.addMouseMotionListener(new MouseMotionListener() {

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

chatTP.addMouseMotionListener(urlML);

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

chatTP.addMouseMotionListener(urlML);

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

textPane.addMouseMotionListener(TooltipWindow.this);
JScrollPane jsp = new JScrollPane(textPane);
jsp.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.BLACK));

相关文章

JTextPane类方法