/** Activates or deactivates Drag support on asociated JTree * component * @param active true if the support should be active, false * otherwise */ public void activate(boolean active) { if (this.active == active) { return; } this.active = active; if (GraphicsEnvironment.isHeadless()) { return; } getDropTarget().setActive(active); //we want to support drop into scroll pane's free area and treat it as 'root node drop' if( null == outerDropTarget ) { outerDropTarget = new DropTarget(view.getViewport(), view.getAllowedDropActions(), this, false); } outerDropTarget.setActive(active); }
/** Initializes the component and lookup explorer manager. */ @Override public void addNotify () { super.addNotify (); lookupExplorerManager (); ViewUtil.adjustBackground(outline); ViewUtil.adjustBackground(getViewport()); if (selection != null) { selection.setTo(outline.getSelectionModel()); } }
getViewport().setBackground(UIManager.getColor("Table.background")); // NOI18N getViewport().addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) {
getViewport().setBackground(c);
JViewport v = getViewport(); if (v != null) { Rectangle rect = outline.getCellRect(firstSelection, 0, true);