public static void init(DropTarget obj, Thing thing, ActionContext actionContext){ Boolean active = JavaCreator.createBoolean(thing, "active"); if(active != null){ obj.setActive(active); } Integer defaultActions = JavaCreator.createInteger(thing, "defaultActions"); if(defaultActions != null){ obj.setDefaultActions(defaultActions); } } }
private void performAppInitialization() { int w = getWidth(); int h = getHeight(); if (w == 0 || h == 0) { // apparently things are not ready yet. return; } backplaneManager = new BackplaneManager(this, statusPanel); DataDropTargetListener dropTargetListener = new DataDropTargetListener(this); DropTarget dropTarget = new DropTarget( this, DnDConstants.ACTION_COPY, dropTargetListener, true); dropTarget.setDefaultActions(DnDConstants.ACTION_COPY); installStandardMouseListeners(); }
public IterationStrategyEditor() { super(); // Make this a drag source DragSource dragSource = DragSource.getDefaultDragSource(); dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE, this); // Also, make this JTree a drag target DropTarget dropTarget = new DropTarget(this, new CDropTargetListener()); dropTarget.setDefaultActions(DnDConstants.ACTION_MOVE); setCellRenderer(new DefaultTreeCellRenderer() { public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); if (value instanceof CrossNode) { setIcon(IterationStrategyEditor.joinIteratorIcon); setText("cross product"); } else if (value instanceof DotNode) { setIcon(IterationStrategyEditor.lockStepIteratorIcon); setText("dot product"); } else if (value instanceof LeafNode) { setIcon(IterationStrategyEditor.baclavaIteratorIcon); } return this; } }); // }
dt.setDefaultActions(DnDConstants.ACTION_COPY); dt.setActive(true); layerListController.getLayerList().setDropTarget(dt); dt.setDefaultActions(DnDConstants.ACTION_COPY); dt.setActive(true); mapPanel.getTopPanel().setDropTarget(dt2);
dt.setDefaultActions(DnDConstants.ACTION_COPY); dt.setActive(true); layerListPanel.setDropTarget(dt);