当前位置: 首页>>代码示例>>Java>>正文


Java TransferHandler.NONE属性代码示例

本文整理汇总了Java中javax.swing.TransferHandler.NONE属性的典型用法代码示例。如果您正苦于以下问题:Java TransferHandler.NONE属性的具体用法?Java TransferHandler.NONE怎么用?Java TransferHandler.NONE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.swing.TransferHandler的用法示例。


在下文中一共展示了TransferHandler.NONE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: mapDragOperationFromModifiers

protected int mapDragOperationFromModifiers(MouseEvent e) {
    int mods = e.getModifiersEx();
    
    if ((mods & InputEvent.BUTTON1_DOWN_MASK) == 0) {
        return TransferHandler.NONE;
    }
    
    return TransferHandler.COPY_OR_MOVE;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:BaseCaret.java

示例2: mapDragOperationFromModifiers

private int mapDragOperationFromModifiers(MouseEvent e) {
    int mods = e.getModifiersEx();
    
    if ((mods & InputEvent.BUTTON1_DOWN_MASK) == 0) {
        return TransferHandler.NONE;
    }
    
    return TransferHandler.COPY_OR_MOVE;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:EditorCaret.java

示例3: mousePressed

@Override
public void mousePressed(MouseEvent evt) {
    if (LOG.isLoggable(Level.FINE)) {
        LOG.fine("mousePressed: " + logMouseEvent(evt) + ", state=" + mouseState + '\n'); // NOI18N
    }

    JTextComponent c = component;
    if (c != null && isLeftMouseButtonExt(evt)) {
        // Expand fold if offset is in collapsed fold
        int offset = mouse2Offset(evt);
        switch (evt.getClickCount()) {
            case 1: // Single press
                if (c.isEnabled() && !c.hasFocus()) {
                    c.requestFocus();
                }
                c.setDragEnabled(true);
                if (evt.isShiftDown()) { // Select till offset
                    moveDot(offset);
                    adjustRectangularSelectionMouseX(evt.getX(), evt.getY()); // also fires state change
                    mouseState = MouseState.CHAR_SELECTION;
                } else { // Regular press
                    // check whether selection drag is possible
                    if (isDragPossible(evt) && mapDragOperationFromModifiers(evt) != TransferHandler.NONE) {
                        mouseState = MouseState.DRAG_SELECTION_POSSIBLE;
                    } else { // Drag not possible
                        mouseState = MouseState.CHAR_SELECTION;
                        setDot(offset);
                    }
                }
                break;

            case 2: // double-click => word selection
                mouseState = MouseState.WORD_SELECTION;
                // Disable drag which would otherwise occur when mouse would be over text
                c.setDragEnabled(false);
                // Check possible fold expansion
                try {
                    // hack, to get knowledge of possible expansion. Editor depends on Folding, so it's not really possible
                    // to have Folding depend on BaseCaret (= a cycle). If BaseCaret moves to editor.lib2, this contract
                    // can be formalized as an interface.
                    Callable<Boolean> cc = (Callable<Boolean>)c.getClientProperty("org.netbeans.api.fold.expander");
                    if (cc == null || !cc.equals(this)) {
                        if (selectWordAction == null) {
                            selectWordAction = ((BaseKit) c.getUI().getEditorKit(
                                    c)).getActionByName(BaseKit.selectWordAction);
                        }
                        if (selectWordAction != null) {
                            selectWordAction.actionPerformed(null);
                        }
                        // Select word action selects forward i.e. dot > mark
                        minSelectionStartOffset = getMark();
                        minSelectionEndOffset = getDot();
                    }
                } catch (Exception ex) {
                    Exceptions.printStackTrace(ex);
                }
                break;
                
            case 3: // triple-click => line selection
                mouseState = MouseState.LINE_SELECTION;
                // Disable drag which would otherwise occur when mouse would be over text
                c.setDragEnabled(false);
                if (selectLineAction == null) {
                    selectLineAction = ((BaseKit) c.getUI().getEditorKit(
                            c)).getActionByName(BaseKit.selectLineAction);
                }
                if (selectLineAction != null) {
                    selectLineAction.actionPerformed(null);
                    // Select word action selects forward i.e. dot > mark
                    minSelectionStartOffset = getMark();
                    minSelectionEndOffset = getDot();
                }
                break;

            default: // multi-click
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:78,代码来源:BaseCaret.java

示例4: getSourceActions

@Override final public int getSourceActions(JComponent objPjComponent) {
	return this.objGtextTransferHandler != null ? this.objGtextTransferHandler.getSourceActions(objPjComponent) : TransferHandler.NONE;
}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:3,代码来源:ExtendedTransferHandler.java

示例5: exportDone

@Override
protected void exportDone(JComponent c, Transferable t, int act) {
   if ((act == TransferHandler.MOVE) || (act == TransferHandler.NONE)) {
      table.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
   }
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:6,代码来源:Digitizer.java


注:本文中的javax.swing.TransferHandler.NONE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。