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


Java DropMode类代码示例

本文整理汇总了Java中javax.swing.DropMode的典型用法代码示例。如果您正苦于以下问题:Java DropMode类的具体用法?Java DropMode怎么用?Java DropMode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: buildList

import javax.swing.DropMode; //导入依赖的package包/类
/**
 * Creates the process list
 *
 * @return JComponent
 */
private JComponent buildList() {
    list = new JList<>();
    list.setCellRenderer(new CellRenderer(list.getCellRenderer()));
    list.setTransferHandler(new ProcessTransferHandler());
    list.setDragEnabled(true);
    list.setDropMode(DropMode.ON_OR_INSERT);
    list.addMouseListener(new MouseAdapter() {
        @Override
        public void mousePressed(MouseEvent e) {
            if (e.getClickCount() % 2 == 0) {
                ProcessInformationPane.showDialog(list.getSelectedValue());
            }
        }
    });
    return ScrollFactory.pane(list).create();
}
 
开发者ID:VISNode,项目名称:VISNode,代码行数:22,代码来源:ProcessBrowser.java

示例2: PlotConfigurationTree

import javax.swing.DropMode; //导入依赖的package包/类
public PlotConfigurationTree(PlotConfiguration plotConfiguration, DataTable dataTable,
		DataTableColumnListTransferHandler aTH) {
	super();
	expandAll();

	// forces the tree to ask the nodes for the correct row heights
	// must also be invoked after LaF changes...
	setRowHeight(0);

	getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
	setExpandsSelectedPaths(true);

	// DnD support
	setDragEnabled(true);
	setDropMode(DropMode.INSERT);

	// Rendering
	setShowsRootHandles(false);
	setBackground(Colors.WHITE);
	setCellRenderer(new PlotConfigurationTreeCellRenderer(aTH));
	putClientProperty("JTree.lineStyle", "Horizontal");

	createNewTreeModel(plotConfiguration);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:25,代码来源:PlotConfigurationTree.java

示例3: BagTree

import javax.swing.DropMode; //导入依赖的package包/类
/**
 * BagTree.
 *
 * @param bagView BagView
 * @param path    String
 */
public BagTree(final BagView bagView, final String path) {
    super();
    this.setShowsRootHandles(true);
    basePath = path;
    parentNode = new DefaultMutableTreeNode(basePath);
    initialize();
    initListeners();
    final JTextField nameTextField = new JTextField();
    bagtreeRowModifier = nameTextField.getFontMetrics(nameTextField.getFont()).getHeight() + 5;
    this.setDragEnabled(true);
    this.setDropMode(DropMode.ON_OR_INSERT);
    this.setTransferHandler(new BagTreeTransferHandler());
    this.getSelectionModel().setSelectionMode(TreeSelectionModel.CONTIGUOUS_TREE_SELECTION);
    bagView.registerTreeListener(path, this);
}
 
开发者ID:pan-dora,项目名称:modeller,代码行数:22,代码来源:BagTree.java

示例4: interactiveDropOnVisualsTable

import javax.swing.DropMode; //导入依赖的package包/类
/**
     * Issue #370-swingx: drop-on not shown correctly.
     * 
     * Check core default renderer as renderer in Table.
     */
    public void interactiveDropOnVisualsTable() {
        JXTable xTable = new JXTable(new AncientSwingTeam());
        installTransferHandler(xTable);
        xTable.getColumn(0).setCellRenderer(new DefaultTableCellRenderer());
        JTable table = new JTable(new AncientSwingTeam());
        installTransferHandler(table);
//        xTable.setDropMode(DropMode.USE_SELECTION);
//        table.setDropMode(DropMode.USE_SELECTION);
        xTable.setDropMode(DropMode.ON_OR_INSERT);
        table.setDropMode(DropMode.ON_OR_INSERT);
        JXFrame frame = wrapWithScrollingInFrame(xTable, table,
                "JXTable (first column core renderer) <-> core table: drop-on appearance");
        JTextField textField = new JTextField("drag me over first column....");
        textField.setDragEnabled(true);
        addStatusComponent(frame, textField);
        show(frame);
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:23,代码来源:DNDRendererVisualCheck.java

示例5: interactiveDropOnVisualsList

import javax.swing.DropMode; //导入依赖的package包/类
/**
     * Issue #370-swingx: drop-on not shown correctly.
     * 
     * Check core default renderer as renderer in Table.
     */
    public void interactiveDropOnVisualsList() {
        JXList xTable = new JXList(AncientSwingTeam.createNamedColorListModel());
        installTransferHandler(xTable);
        JList table = new JList(xTable.getModel());
        installTransferHandler(table);
//        xTable.setDropMode(DropMode.USE_SELECTION);
//        table.setDropMode(DropMode.USE_SELECTION);
        xTable.setDropMode(DropMode.ON_OR_INSERT);
        table.setDropMode(DropMode.ON_OR_INSERT);
        JXFrame frame = wrapWithScrollingInFrame(xTable, table,
                "JXList <-> core list: drop-on appearance");
        JTextField textField = new JTextField("drag me over first column....");
        textField.setDragEnabled(true);
        addStatusComponent(frame, textField);
        show(frame);
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:22,代码来源:DNDRendererVisualCheck.java

示例6: interactiveDropOnVisualsTree

import javax.swing.DropMode; //导入依赖的package包/类
/**
     * Issue #370-swingx: drop-on not shown correctly.
     * 
     * Check core default renderer as renderer in Table.
     */
    public void interactiveDropOnVisualsTree() {
        JXTree xTable = new JXTree(AncientSwingTeam.createNamedColorTreeModel());
        installTransferHandler(xTable);
        xTable.setCellRenderer(new DefaultTreeRenderer());
        JTree table = new JTree(xTable.getModel());
        installTransferHandler(table);
//        xTable.setDropMode(DropMode.USE_SELECTION);
//        table.setDropMode(DropMode.USE_SELECTION);
        xTable.setDropMode(DropMode.ON_OR_INSERT);
        table.setDropMode(DropMode.ON_OR_INSERT);
        JXFrame frame = wrapWithScrollingInFrame(xTable, table,
                "JXTree <-> core tree: drop-on appearance");
        JTextField textField = new JTextField("drag me over first column....");
        textField.setDragEnabled(true);
        addStatusComponent(frame, textField);
        show(frame);
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:23,代码来源:DNDRendererVisualCheck.java

示例7: ExtTextTable

import javax.swing.DropMode; //导入依赖的package包/类
/**
     * @param tableModel
     */
    public ExtTextTable() {
        super(new ExtTestModel());
        setSearchEnabled(true);

        setDragEnabled(true);
        setDropMode(DropMode.ON);

        final DragDropHelper ddh = new DragDropHelper();
        this.setTransferHandler(ddh);
        addRowHighlighter(new SelectionHighlighter(null, new Color(10, 10, 10, 40)));
//        getModel().addExtComponentRowHighlighter(new ExtComponentRowHighlighter<TextObject>(Color.BLACK,Color.RED,null) {
//            
//            @Override
//            public boolean accept(ExtColumn<TextObject> column, TextObject value, boolean selected, boolean focus, int row) {
//                // TODO Auto-generated method stub
//                return selected;
//            }
//        });
        // this.setShowHorizontalLines(false);
      
        setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
       

    }
 
开发者ID:friedlwo,项目名称:AppWoksUtils,代码行数:28,代码来源:ExtTextTable.java

示例8: init

import javax.swing.DropMode; //导入依赖的package包/类
/**
 * Initializer
 */
public void init() {
	super.init();

	firstClickStrategy = new BlinkingStrategy(this,
			MainFrame.METRONOM_COLOR_FIRST_CLICK,
			MainFrame.METRONOM_BLINK_RATE, 1);
	otherClickStrategy = new BlinkingStrategy(this,
			MainFrame.METRONOM_COLOR_OTHER_CLICK,
			MainFrame.METRONOM_BLINK_RATE, 1);

	setName(NAME);
	addMouseListener(doubleClickListener);
	setBlinkingStrategy(otherClickStrategy);
	setFont(new Font(FONT_FAMILY, Font.BOLD, FONT_SIZE));
	setCache(getSelectionBackground());
	setDropMode(DropMode.INSERT);
	setTransferHandler(transferHandler);
	setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	addListSelectionListener(selectionHandler);

	DragSource fileListDragSource = new DragSource();
	fileListDragSource.createDefaultDragGestureRecognizer(this,
			DnDConstants.ACTION_MOVE, itemListDragGestureListener);
}
 
开发者ID:aguelle,项目名称:MIDI-Automator,代码行数:28,代码来源:ItemList.java

示例9: PvExplorer

import javax.swing.DropMode; //导入依赖的package包/类
public PvExplorer(ProcessVar pv)
{
	setDividerSize(2);
	setPreferredSize(new Dimension(640, 480));

	pvTree = new JTree(new PvTreeNode(pv));
	pvTree.getSelectionModel().addTreeSelectionListener(this);
	pvTree.setDragEnabled(true);
	pvTree.setDropMode(DropMode.ON_OR_INSERT);
	pvTree.setTransferHandler(xferHdlr);

	pvTable = new PvTable(pv);
	pvTable.setDragEnabled(true);
	pvTable.setDropMode(DropMode.ON_OR_INSERT);
	pvTable.addMouseListener(tblMouseLstnr);
	pvTable.setTransferHandler(xferHdlr);

	JScrollPane spPvTree = new JScrollPane(pvTree);
	add(spPvTree, JSplitPane.LEFT);
	JScrollPane spPvTable = new JScrollPane(pvTable);
	add(spPvTable, JSplitPane.RIGHT);
}
 
开发者ID:fr3ts0n,项目名称:AndrOBD,代码行数:23,代码来源:PvExplorer.java

示例10: setCenterPane

import javax.swing.DropMode; //导入依赖的package包/类
/**
 * Creates the center pane that shows the pictures thumbnail list.
 */
private void setCenterPane() {
	DefaultListModel<PhotManImage> dlm = new DefaultListModel<>();
	m_thumbnails = new JList<>(dlm);
	m_thumbnails.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
	m_thumbnails.setTransferHandler(new PhotManListItemTransferHandler());
	m_thumbnails.setDropMode(DropMode.INSERT);
	m_thumbnails.setDragEnabled(true);
	m_thumbnails.setLayoutOrientation(JList.HORIZONTAL_WRAP);
	m_thumbnails.setVisibleRowCount(0);
	m_thumbnails.setFixedCellWidth(m_options.getThumbnailSize()+10);
	m_thumbnails.setFixedCellHeight(m_options.getThumbnailSize()+30);
	m_thumbnails.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));

	m_thumbnails.setCellRenderer(new PhotManListCellRenderer());
	JScrollPane imagesScroll = new JScrollPane(m_thumbnails);
	m_contentPane.add(imagesScroll,BorderLayout.CENTER); 		
}
 
开发者ID:geberle,项目名称:PhotMan,代码行数:21,代码来源:PhotManFrame.java

示例11: OliviaTree

import javax.swing.DropMode; //导入依赖的package包/类
public OliviaTree() {
  //設定
    this.setFocusable(true);
    //複数選択可能にする
    this.getSelectionModel().setSelectionMode(
            TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
    //ノード名を編集可能にする
    this.setEditable(true);
    this.setCellEditor(new OliviaCellEditor(this, new OliviaCellEditField(this)));
    //ドラッグドロップを可能にする
    this.setDragEnabled(true);
    this.setDropMode(DropMode.ON_OR_INSERT);
    
    
    //モデル側のプロジェクトを反映
    this.model = Olivia.getView().getComponents().getTreeArea();
    
    initialize(Olivia.getProjects().getCurrentProject());
    
}
 
开发者ID:tohhy,项目名称:olivia-swing,代码行数:21,代码来源:OliviaTree.java

示例12: PlotConfigurationTree

import javax.swing.DropMode; //导入依赖的package包/类
public PlotConfigurationTree(PlotConfiguration plotConfiguration, DataTable dataTable, DataTableColumnListTransferHandler aTH) {
	super();
	expandAll();

	// forces the tree to ask the nodes for the correct row heights
	// must also be invoked after LaF changes...
	setRowHeight(0);

	getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
	setExpandsSelectedPaths(true);

	// DnD support
	setDragEnabled(true);
	setDropMode(DropMode.INSERT);

	// Rendering
	setShowsRootHandles(false);
	setCellRenderer(new PlotConfigurationTreeCellRenderer(aTH));
	putClientProperty("JTree.lineStyle", "Horizontal");

	createNewTreeModel(plotConfiguration);
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:23,代码来源:PlotConfigurationTree.java

示例13: setDropMode

import javax.swing.DropMode; //导入依赖的package包/类
public void setDropMode(DropMode dropMode) {
    if (dropMode == null) {
        dropModeSet = false;
        updateDropMode();
    } else {
        switch (dropMode) {
        default:
            throw new IllegalArgumentException("Unsupported DropMode: " + dropMode);
        case ON:
        case INSERT:
        case INSERT_ROWS:
        case INSERT_COLS:
        case ON_OR_INSERT:
        case ON_OR_INSERT_ROWS:
        case ON_OR_INSERT_COLS:
        }
        dropModeSet = true;
        table.setDropMode(dropMode);
    }
}
 
开发者ID:Sciss,项目名称:TreeTable,代码行数:21,代码来源:TreeTable.java

示例14: ChecklistTreePanel

import javax.swing.DropMode; //导入依赖的package包/类
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 );
}
 
开发者ID:Vhati,项目名称:Slipstream-Mod-Manager,代码行数:19,代码来源:ChecklistTreePanel.java

示例15: JDragDropList

import javax.swing.DropMode; //导入依赖的package包/类
public JDragDropList(StandardListModel<T> model) {
	super(model);
	
	setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
	setDragEnabled(true);
	setDropMode(DropMode.INSERT);
	setTransferHandler(new JDDLTransferHandler());
}
 
开发者ID:mgropp,项目名称:pdfjumbler,代码行数:9,代码来源:JDragDropList.java


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