use of org.apache.cayenne.modeler.editor.dbimport.tree.ColorTreeRenderer in project cayenne by apache.
the class DraggableTreePanel method initElement.
private void initElement() {
sourceTree.setDragEnabled(true);
sourceTree.setCellRenderer(new ColorTreeRenderer());
sourceTree.setDropMode(DropMode.INSERT);
MoveImportNodeAction action = projectController.getApplication().getActionManager().getAction(MoveImportNodeAction.class);
action.setPanel(this);
action.setSourceTree(sourceTree);
action.setTargetTree(targetTree);
moveButton = (CayenneAction.CayenneToolbarButton) action.buildButton();
moveButton.setShowingText(true);
moveButton.setText(MOVE_BUTTON_LABEL);
MoveInvertNodeAction actionInv = projectController.getApplication().getActionManager().getAction(MoveInvertNodeAction.class);
actionInv.setPanel(this);
actionInv.setSourceTree(sourceTree);
actionInv.setTargetTree(targetTree);
moveInvertButton = (CayenneAction.CayenneToolbarButton) actionInv.buildButton();
moveInvertButton.setShowingText(true);
moveInvertButton.setText(MOVE_INV_BUTTON_LABEL);
DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) sourceTree.getCellRenderer();
renderer.setLeafIcon(null);
renderer.setClosedIcon(null);
renderer.setOpenIcon(null);
}
use of org.apache.cayenne.modeler.editor.dbimport.tree.ColorTreeRenderer in project cayenne by apache.
the class DbImportView method initFormElements.
private void initFormElements() {
DbImportTreeNode root = new DbImportTreeNode(new ReverseEngineering());
DbImportTreeNode draggableTreeRoot = new DbImportTreeNode(new ReverseEngineering());
DbImportTree reverseEngineeringTree = new DbImportTree(root);
DbImportTree draggableTree = new DbImportTree(new TransferableNode(draggableTreeRoot));
DbImportModel model = new DbImportModel(root);
model.setCanBeCleaned(true);
DbImportModel draggableTreeModel = new DbImportModel(draggableTreeRoot);
draggableTreeModel.setCanBeCleaned(false);
draggableTree.setRootVisible(false);
draggableTree.setShowsRootHandles(true);
draggableTree.setModel(draggableTreeModel);
reverseEngineeringTree.setRootVisible(false);
reverseEngineeringTree.setModel(model);
reverseEngineeringTree.setShowsRootHandles(true);
draggableTreePanel = new DraggableTreePanel(projectController, draggableTree, reverseEngineeringTree);
treeToolbar = new TreeToolbarPanel(projectController, reverseEngineeringTree, draggableTreePanel);
treePanel = new ReverseEngineeringTreePanel(projectController, reverseEngineeringTree, draggableTree);
treePanel.setTreeToolbar(treeToolbar);
model.setDbSchemaTree(draggableTree);
draggableTreeModel.setDbSchemaTree(draggableTree);
((ColorTreeRenderer) draggableTreePanel.getSourceTree().getCellRenderer()).setReverseEngineeringTree(reverseEngineeringTree);
configPanel = new ReverseEngineeringConfigPanel(projectController, this);
configPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
configPanel.setVisible(false);
}
Aggregations