當前位置: 首頁>>代碼示例>>Java>>正文


Java CaretEvent.getDot方法代碼示例

本文整理匯總了Java中javax.swing.event.CaretEvent.getDot方法的典型用法代碼示例。如果您正苦於以下問題:Java CaretEvent.getDot方法的具體用法?Java CaretEvent.getDot怎麽用?Java CaretEvent.getDot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.event.CaretEvent的用法示例。


在下文中一共展示了CaretEvent.getDot方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: caretUpdate

import javax.swing.event.CaretEvent; //導入方法依賴的package包/類
/**
 * Called when the text component's caret moves.
 *
 * @param e The event.
 */
@Override
public void caretUpdate(CaretEvent e) {
	if (maxPos==null) { // Sanity check
		deactivate();
		return;
	}
	int dot = e.getDot();
	if (dot<minPos || dot>maxPos.getOffset()) {
		deactivate();
		return;
	}
	paramPrefix = updateToolTipText();
	if (active) {
		prepareParamChoicesWindow();
	}
}
 
開發者ID:Thecarisma,項目名稱:powertext,代碼行數:22,代碼來源:ParameterizedCompletionContext.java

示例2: fireCaretUpdate

import javax.swing.event.CaretEvent; //導入方法依賴的package包/類
/**
 * Notifies all listeners that a caret change has occurred.
 *
 * @param e The caret event.
 */
@Override
protected void fireCaretUpdate(CaretEvent e) {

	// Decide whether we need to repaint the current line background.
	possiblyUpdateCurrentLineHighlightLocation();

	// Now, if there is a highlighted region of text, allow them to cut
	// and copy.
	if (e!=null && e.getDot()!=e.getMark()) {// && !cutAction.isEnabled()) {
		cutAction.setEnabled(true);
		copyAction.setEnabled(true);
	}

	// Otherwise, if there is no highlighted region, don't let them cut
	// or copy.  The condition here should speed things up, because this
	// way, we will only enable the actions the first time the selection
	// becomes nothing.
	else if (cutAction.isEnabled()) {
		cutAction.setEnabled(false);
		copyAction.setEnabled(false);
	}

	super.fireCaretUpdate(e);

}
 
開發者ID:Thecarisma,項目名稱:powertext,代碼行數:31,代碼來源:RTextArea.java

示例3: caretUpdate

import javax.swing.event.CaretEvent; //導入方法依賴的package包/類
public void caretUpdate(CaretEvent e) {
    synchronized (this) {
        lastCaretPosition = e.getDot();
    }
    
    LOG.fine("scheduling hints computation");
    
    computeHint.schedule(100);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:ComponentPeer.java

示例4: caretUpdate

import javax.swing.event.CaretEvent; //導入方法依賴的package包/類
public void caretUpdate (CaretEvent e) {
    int position = e.getDot ();
    try {
        selectPath (position);
    } catch (ConcurrentModificationException ex) {
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:TokensBrowserTopComponent.java

示例5: caretUpdate

import javax.swing.event.CaretEvent; //導入方法依賴的package包/類
@Override
public void caretUpdate(CaretEvent e) {
    JTextComponent cc = currentComponent != null ? currentComponent.get() : null;
    if (e.getSource() != cc) {
        ((JTextComponent)e.getSource()).removeCaretListener(this);
        //just a double check we do't get a persistent leak here..
        return;
    }
    currentDot = e.getDot();
    caretTask.schedule(1000);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:POMModelPanel.java

示例6: caretUpdate

import javax.swing.event.CaretEvent; //導入方法依賴的package包/類
public void caretUpdate(CaretEvent evt) {
    if (evt.getDot() != evt.getMark()) {
        surroundsWithTimer.setInitialDelay(SURROUND_WITH_DELAY);
        surroundsWithTimer.restart();
    } else {
        surroundsWithTimer.stop();
        hideSurroundWithHint();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:AbbrevDetection.java

示例7: caretUpdate

import javax.swing.event.CaretEvent; //導入方法依賴的package包/類
@Override
public void caretUpdate(CaretEvent ce) {
    if (ce.getDot() != currentCaretPos + 1
            && ce.getDot() != currentCaretPos) {
        msgAllListener(ce.getDot());
    }
    currentCaretPos = ce.getDot();
}
 
開發者ID:Skypr,項目名稱:BEAST,代碼行數:9,代碼來源:StoppedTypingContinuouslyMessager.java

示例8: caretUpdate

import javax.swing.event.CaretEvent; //導入方法依賴的package包/類
@Override        
    public void caretUpdate(CaretEvent evt) {
       JTextArea textPane1 =(JTextArea)evt.getSource();
        int row = getRow(evt.getDot(), textPane1); //row += 1;
        int col = getColumn(evt.getDot(), textPane1);
        
cal.setText("Line: " + row + " Column: " + col);
cln = row;
                
        //Get the location in the text
int dot = evt.getDot();
int mark = evt.getMark();
int totalsel = mark - dot ;
int totalsele = dot - mark ;
if (dot == mark) {  
    //Rectangle caretCoords = textPane.modelToView(dot);
    
    Totalsel.setText("Caret Position: " + dot ); doti = dot;
    //jLabel17.setText("Caret Position : " + dot);
    //jLabel18.setText("Current Line : " + row);
    jLabel500.setText(""+row);   jLabel501.setText(""+col);
    //jLabel19.setText("Current Column : " + col);
    mark +=1 ;
 } else if (dot < mark) {
    statusLabel.setText("Selection : " + totalsel + "\t | \t" + row);
    jLabel26.setText("Selection : " + totalsel + "\t | \t" + row);
    
 } else {
    jLabel26.setText("Selection : " + totalsele + "\t | " + row);
    statusLabel.setText("Selection : " + totalsele + "\t | \t" + row);
 }
    }
 
開發者ID:Thecarisma,項目名稱:powertext,代碼行數:33,代碼來源:Caretlistener.java

示例9: caretUpdate

import javax.swing.event.CaretEvent; //導入方法依賴的package包/類
@Override
public void caretUpdate(CaretEvent e) {
	int dot = e.getDot();
	if (dot != origDot) {
		stop();
		removeCaretListener(this);
		if (popup != null) {
			popup.dispose();
		}
	}
}
 
開發者ID:Thecarisma,項目名稱:powertext,代碼行數:12,代碼來源:RSyntaxTextArea.java

示例10: handleCaretUpdateEvent

import javax.swing.event.CaretEvent; //導入方法依賴的package包/類
/**
 * @param event
 */
private void handleCaretUpdateEvent(CaretEvent event) {
    if (event.getSource() == currentTextComponent) {
        boolean enabled = event.getDot() != event.getMark();
        // Read controls
        setCopyControlsEnabled(enabled);

        // Write controls
        enabled &= currentTextComponent.isEditable();
        setCutControlsEnabled(enabled);
        setDeleteControlsEnabled(enabled);
    }
}
 
開發者ID:YcheCourseProject,項目名稱:DIA-Umpire-Maven,代碼行數:16,代碼來源:AlignWindow.java

示例11: caretUpdate

import javax.swing.event.CaretEvent; //導入方法依賴的package包/類
@Override
public void caretUpdate(CaretEvent e) {
	this.caretPosition = e.getDot();
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:5,代碼來源:AutomaticTextField.java

示例12: caretUpdate

import javax.swing.event.CaretEvent; //導入方法依賴的package包/類
@Override
public void caretUpdate(CaretEvent ce) {
    currentCaretPosition = ce.getDot();
    currentInserter = newlineInserterChooser.getNewlineInserter();        
}
 
開發者ID:Skypr,項目名稱:BEAST,代碼行數:6,代碼來源:UserInsertToCode.java


注:本文中的javax.swing.event.CaretEvent.getDot方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。