Search in sources :

Example 1 with ColorTreeRenderer

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);
}
Also used : MoveInvertNodeAction(org.apache.cayenne.modeler.action.dbimport.MoveInvertNodeAction) ColorTreeRenderer(org.apache.cayenne.modeler.editor.dbimport.tree.ColorTreeRenderer) MoveImportNodeAction(org.apache.cayenne.modeler.action.dbimport.MoveImportNodeAction) DefaultTreeCellRenderer(javax.swing.tree.DefaultTreeCellRenderer) CayenneAction(org.apache.cayenne.modeler.util.CayenneAction)

Example 2 with ColorTreeRenderer

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);
}
Also used : FlowLayout(java.awt.FlowLayout) ReverseEngineering(org.apache.cayenne.dbsync.reverse.dbimport.ReverseEngineering) DbImportTreeNode(org.apache.cayenne.modeler.dialog.db.load.DbImportTreeNode) TransferableNode(org.apache.cayenne.modeler.dialog.db.load.TransferableNode) ColorTreeRenderer(org.apache.cayenne.modeler.editor.dbimport.tree.ColorTreeRenderer)

Aggregations

ColorTreeRenderer (org.apache.cayenne.modeler.editor.dbimport.tree.ColorTreeRenderer)2 FlowLayout (java.awt.FlowLayout)1 DefaultTreeCellRenderer (javax.swing.tree.DefaultTreeCellRenderer)1 ReverseEngineering (org.apache.cayenne.dbsync.reverse.dbimport.ReverseEngineering)1 MoveImportNodeAction (org.apache.cayenne.modeler.action.dbimport.MoveImportNodeAction)1 MoveInvertNodeAction (org.apache.cayenne.modeler.action.dbimport.MoveInvertNodeAction)1 DbImportTreeNode (org.apache.cayenne.modeler.dialog.db.load.DbImportTreeNode)1 TransferableNode (org.apache.cayenne.modeler.dialog.db.load.TransferableNode)1 CayenneAction (org.apache.cayenne.modeler.util.CayenneAction)1