use of net.sourceforge.pmd.util.viewer.model.ViewerModel in project pmd by pmd.
the class MainFrame method init.
private void init() {
model = new ViewerModel();
model.addViewerModelListener(this);
sourcePanel = new SourceCodePanel(model);
ASTPanel astPanel = new ASTPanel(model);
xPathPanel = new XPathPanel(model);
getContentPane().setLayout(new BorderLayout());
JSplitPane editingPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sourcePanel, astPanel);
editingPane.setResizeWeight(0.5d);
JPanel interactionsPane = new JPanel(new BorderLayout());
interactionsPane.add(xPathPanel, BorderLayout.SOUTH);
interactionsPane.add(editingPane, BorderLayout.CENTER);
getContentPane().add(interactionsPane, BorderLayout.CENTER);
JButton compileBtn = new JButton(NLS.nls("MAIN.FRAME.COMPILE_BUTTON.TITLE"));
compileBtn.setActionCommand(ActionCommands.COMPILE_ACTION);
compileBtn.addActionListener(this);
evalBtn = new JButton(NLS.nls("MAIN.FRAME.EVALUATE_BUTTON.TITLE"));
evalBtn.setActionCommand(ActionCommands.EVALUATE_ACTION);
evalBtn.addActionListener(this);
evalBtn.setEnabled(false);
statusLbl = new JLabel();
statusLbl.setHorizontalAlignment(SwingConstants.RIGHT);
JPanel btnPane = new JPanel(new FlowLayout(FlowLayout.LEFT));
btnPane.add(compileBtn);
btnPane.add(evalBtn);
btnPane.add(statusLbl);
getContentPane().add(btnPane, BorderLayout.SOUTH);
JMenuBar menuBar = new JMenuBar();
JMenu menu = new JMenu("Language");
ButtonGroup group = new ButtonGroup();
jdk13MenuItem = new JRadioButtonMenuItem("JDK 1.3");
jdk13MenuItem.setSelected(false);
group.add(jdk13MenuItem);
menu.add(jdk13MenuItem);
jdk14MenuItem = new JRadioButtonMenuItem("JDK 1.4");
jdk14MenuItem.setSelected(true);
group.add(jdk14MenuItem);
menu.add(jdk14MenuItem);
jdk15MenuItem = new JRadioButtonMenuItem("JDK 1.5");
jdk15MenuItem.setSelected(false);
group.add(jdk15MenuItem);
menu.add(jdk15MenuItem);
jdk16MenuItem = new JRadioButtonMenuItem("JDK 1.6");
jdk16MenuItem.setSelected(false);
group.add(jdk16MenuItem);
menu.add(jdk16MenuItem);
jdk17MenuItem = new JRadioButtonMenuItem("JDK 1.7");
jdk17MenuItem.setSelected(false);
group.add(jdk17MenuItem);
menu.add(jdk17MenuItem);
// PLSQL
plsqlMenuItem = new JRadioButtonMenuItem("PLSQL");
plsqlMenuItem.setSelected(false);
group.add(plsqlMenuItem);
menu.add(plsqlMenuItem);
menuBar.add(menu);
setJMenuBar(menuBar);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
pack();
setSize(800, 600);
setVisible(true);
}
Aggregations