本文整理了Java中javax.swing.JTree.setTransferHandler()
方法的一些代码示例,展示了JTree.setTransferHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTree.setTransferHandler()
方法的具体详情如下:
包路径:javax.swing.JTree
类名称:JTree
方法名:setTransferHandler
暂无
代码示例来源:origin: net.sf.taverna.t2.ui-components/workflow-explorer
private void assignWfTree(JTree tree) {
wfTree = tree;
wfTree.setTransferHandler(new ServiceTransferHandler());
}
代码示例来源:origin: Vhati/Slipstream-Mod-Manager
public ChecklistTreePanel() {
super( new BorderLayout() );
DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode( "Root", true );
treeModel = new DefaultTreeModel( rootNode, true );
tree = new JTree( treeModel );
tree.setCellRenderer( new DefaultTreeCellRenderer() );
tree.setRootVisible( false );
tree.getSelectionModel().setSelectionMode( TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION );
checklistManager = new ChecklistTreeManager( tree, true, null );
JScrollPane scrollPane = new JScrollPane( tree, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
this.add( scrollPane, BorderLayout.CENTER );
tree.setTransferHandler( new TreeTransferHandler( tree ) );
tree.setDropMode( DropMode.ON_OR_INSERT ); // Drop between rows, or onto groups.
tree.setDragEnabled( true );
}
代码示例来源:origin: stackoverflow.com
tree.setDragEnabled(true);
tree.setDropMode(DropMode.INSERT);
tree.setTransferHandler(...);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.expandRow(CONTAINER_ROW);
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
tree.setBorder(BorderFactory.createEmptyBorder(15, 10, 15, 0));
tree.setTransferHandler(new TransferHandler()
代码示例来源:origin: MegaMek/mekhq
orgTree.setDragEnabled(true);
orgTree.setDropMode(DropMode.ON);
orgTree.setTransferHandler(new TOETransferHandler(getCampaignGui()));
代码示例来源:origin: stackoverflow.com
tree.setTransferHandler(treeHandler);
JLabel labelTarget = new JLabel("I'm a drop target!");
TransferHandler labelHandler = new TransferHandler() {
代码示例来源:origin: jawi/ols
this.tree.setTransferHandler( new JLxTreeTransferHandler() );
this.tree.addTreeSelectionListener( new TreeSelectionListener()
代码示例来源:origin: net.sourceforge.jadex/jadex-runtimetools-swing
ftp.getTree().setTransferHandler(new TreeTransferHandler());
代码示例来源:origin: org.activecomponents.jadex/jadex-runtimetools-swing
ftp.getTree().setTransferHandler(new TreeTransferHandler());
代码示例来源:origin: org.orbisgis/toc
/**
* Create the Toc JTree
*
* @return the Toc JTree
*/
private JTree makeTree() {
tree = new JTree();
//Items can be selected freely
tree.getSelectionModel().setSelectionMode(
TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
TocTransferHandler handler = new TocTransferHandler(this);
//Add a drop listener
handler.getTransferEditableEvent().addListener(this,
EventHandler.create(EditableTransferListener.class, this, "onDropEditableElement", ""));
tree.setDragEnabled(true);
tree.setTransferHandler(handler);
tree.setRootVisible(false);
tree.setShowsRootHandles(true);
tree.setEditable(true);
treeRenderer = new TocRenderer(tree);
tree.setCellRenderer(treeRenderer);
setEmptyLayerModel(tree);
tree.setCellEditor(new TocTreeEditor(tree));
tree.addMouseListener(new PopupMouselistener());
//Add a tree selection listener
tree.getSelectionModel().addTreeSelectionListener(
EventHandler.create(TreeSelectionListener.class, this, "onTreeSelectionChange"));
return tree;
}
代码示例来源:origin: khuxtable/seaglass
/**
* @inheritDoc
*/
@Override
protected void uninstallDefaults() {
SeaGlassContext context = getContext(tree, ENABLED);
style.uninstallDefaults(context);
context.dispose();
style = null;
context = getContext(tree, Region.TREE_CELL, ENABLED);
cellStyle.uninstallDefaults(context);
context.dispose();
cellStyle = null;
if (tree.getTransferHandler() instanceof UIResource) {
tree.setTransferHandler(null);
}
}
代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core
treevar.setTransferHandler(new JMeterTreeTransferHandler());
代码示例来源:origin: cpesch/RouteConverter
treeCategories.setDragEnabled(true);
treeCategories.setDropMode(ON);
treeCategories.setTransferHandler(new TreeDragAndDropHandler());
treeCategories.getSelectionModel().setSelectionMode(CONTIGUOUS_TREE_SELECTION);
内容来源于网络,如有侵权,请联系作者删除!