use of org.compiere.swing.ShadowBorder in project adempiere by adempiere.
the class VTreePanel method jbInit.
/**
* Static Component initialization.
* <pre>
* - centerSplitPane
* - treePane
* - tree
* - bar
* - southPanel
* </pre>
*/
private void jbInit() {
this.setLayout(mainLayout);
mainLayout.setVgap(5);
//
// only one node to be selected
treeSelect.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION);
tree.setSelectionModel(treeSelect);
//
// allows to change the text
tree.setEditable(false);
tree.addMouseListener(mouseListener);
tree.addKeyListener(keyListener);
tree.setCellRenderer(new VTreeCellRenderer());
treePane.getViewport().add(tree, null);
treePane.setBorder(new ShadowBorder());
tree.setBorder(BorderFactory.createEmptyBorder());
CPanel treePart = new CPanel();
treePart.setLayout(new BorderLayout());
treePart.add(treePane, BorderLayout.CENTER);
treePart.setBorder(BorderFactory.createEmptyBorder());
//
treeExpand.setText(Msg.getMsg(Env.getCtx(), "ExpandTree"));
treeExpand.setActionCommand("Expand");
treeExpand.addMouseListener(mouseListener);
treeExpand.addActionListener(this);
//
treeSearchLabel.setText(Msg.getMsg(Env.getCtx(), "TreeSearch") + " ");
treeSearchLabel.setLabelFor(treeSearch);
treeSearchLabel.setToolTipText(Msg.getMsg(Env.getCtx(), "TreeSearchText"));
treeSearch.setBackground(AdempierePLAF.getInfoBackground());
treeSearch.addKeyListener(keyListener);
southPanel.setLayout(southLayout);
southPanel.add(treeExpand, BorderLayout.WEST);
southPanel.add(treeSearchLabel, BorderLayout.CENTER);
southPanel.add(treeSearch, BorderLayout.EAST);
treePart.add(southPanel, BorderLayout.SOUTH);
//
centerSplitPane.setOpaque(false);
barScrollPane = new JScrollPane();
barScrollPane.getViewport().add(bar);
//hengsin, jxtaskpane
centerSplitPane.add(barScrollPane, JSplitPane.LEFT);
centerSplitPane.add(treePart, JSplitPane.RIGHT);
centerSplitPane.setBorder(BorderFactory.createEmptyBorder());
removeSplitPaneBorder();
this.add(centerSplitPane, BorderLayout.CENTER);
//
mFrom.setText(Msg.getMsg(Env.getCtx(), "ItemMove"));
mFrom.setActionCommand((String) TransferHandler.getCutAction().getValue(Action.NAME));
mFrom.addActionListener(this);
mFrom.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK));
mTo.setText(Msg.getMsg(Env.getCtx(), "ItemInsert"));
mTo.setActionCommand((String) TransferHandler.getPasteAction().getValue(Action.NAME));
mTo.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, ActionEvent.CTRL_MASK));
mTo.setMnemonic(KeyEvent.VK_V);
mTo.addActionListener(this);
mBarAdd.setText(Msg.getMsg(Env.getCtx(), "BarAdd"));
mBarAdd.setActionCommand("BarAdd");
mBarAdd.addActionListener(this);
mBarRemove.setText(Msg.getMsg(Env.getCtx(), "BarRemove"));
mBarRemove.setActionCommand("BarRemove");
mBarRemove.addActionListener(this);
//
popMenuTree.setLightWeightPopupEnabled(false);
popMenuTree.add(mBarAdd);
popMenuTree.add(mFrom);
if (!m_hasBar) {
popMenuTree.addSeparator();
}
popMenuTree.add(mTo);
popMenuBar.setLightWeightPopupEnabled(false);
popMenuBar.add(mBarRemove);
}
Aggregations