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

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

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

JTextComponent.addMouseMotionListener介绍

暂无

代码示例

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

public SmartFixManager( GosuEditor gosuEditor )
{
 _mode = SmartFixMode.NONE;
 _gosuEditor = gosuEditor;
 _editor = gosuEditor.getEditor();
 _editor.addMouseMotionListener( this );
 _editor.addKeyListener( this );
}

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

public SmartFixManager( GosuEditor gosuEditor )
{
 _mode = SmartFixMode.NONE;
 _gosuEditor = gosuEditor;
 _editor = gosuEditor.getEditor();
 _editor.addMouseMotionListener( this );
 _editor.addKeyListener( this );
}

代码示例来源:origin: khuxtable/seaglass

/**
 * DOCUMENT ME!
 */
private void installMouseListeners() {
  if (mouseListener == null) {
    mouseListener = createMouseListener();
    getComponent().addMouseListener(mouseListener);
    getComponent().addMouseMotionListener(mouseListener);
  }
}

代码示例来源:origin: com.bitplan.antlr/com.bitplan.antlr

public LinePainter(JTextComponent component, Color color) {
 this.component = component;
 setColor(color);
 // Add listeners so we know when to change highlighting
 component.addCaretListener(this);
 component.addMouseListener(this);
 component.addMouseMotionListener(this);
 // Turn highlighting on by adding a dummy highlight
 try {
  component.getHighlighter().addHighlight(0, 0, this);
 } catch (BadLocationException ble) {
 }
}

代码示例来源:origin: robo-code/robocode

/**
 * Installs CurrentLineHilighter for the given JTextComponent.
 * @param c is the text component
 */
public static void install(JTextComponent c) {
  try {
    Object obj = c.getHighlighter().addHighlight(0, 0, painter);
    c.putClientProperty(LINE_HIGHLIGHT, obj);
    c.putClientProperty(PREVIOUS_CARET, new Integer(c.getCaretPosition()));
    c.addCaretListener(caretListener);
    c.addMouseListener(mouseListener);
    c.addMouseMotionListener(mouseMotionListener);
    color = EditorThemePropertiesManager.getCurrentEditorThemeProperties().getHighlightedLineColor();
    EditorThemePropertiesManager.addListener(editorThemePropertyChangeListener);
  } catch (BadLocationException ex) {}
}

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

component.addMouseMotionListener(this);

代码示例来源:origin: net.java.abeille/abeille

/** Called when UI is being installed into JTextComponent */
public void install(JTextComponent c) {
  component = c;
  component.addPropertyChangeListener(this);
  focusListener = new FocusHandler(this);
  component.addFocusListener(focusListener);
  component.addMouseListener(this);
  component.addMouseMotionListener(this);
  EditorUI editorUI = Utilities.getEditorUI(component);
  editorUI.addLayer(new DrawLayerFactory.CaretLayer(), DrawLayerFactory.CARET_LAYER_VISIBILITY);
  caretMark.setEditorUI(editorUI);
  selectionMark.setEditorUI(editorUI);
  editorUI.addPropertyChangeListener(this);
  BaseDocument doc = Utilities.getDocument(c);
  if (doc != null) {
    modelChanged(null, doc);
  }
  if (component.hasFocus()) {
    focusGained(null); // emulate focus gained
    if (debugCaretFocus) {
      System.err.println("Component has focus, calling focusGained() on doc=" + component.getDocument().getProperty(Document.TitleProperty));
    }
  }
}

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

component.addFocusListener(focusListener);
component.addMouseListener(this);
component.addMouseMotionListener(this);

相关文章

JTextComponent类方法