use of com.ramussoft.pb.dmaster.SimpleTemplate in project ramus by Vitaliy-Yakovchuk.
the class ContextMasterDialog method init.
private void init() {
setTitle("Selecting_Template");
final JSplitPane splitPane = new JSplitPane();
final JPanel panel1 = new JPanel(new BorderLayout());
final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5));
panel3.add(new JLabel("Template"));
panel1.add(panel3, BorderLayout.NORTH);
panel1.add(sPane, BorderLayout.CENTER);
splitPane.setLeftComponent(panel1);
splitPane.setDividerLocation(200);
list.addListSelectionListener(lsl);
sPane.setViewportView(list);
final JPanel panel = new JPanel(new BorderLayout());
panel.add(prev, BorderLayout.CENTER);
final JPanel lp = new JPanel(new BorderLayout());
lp.add(new JLabel("Function.Count"), BorderLayout.WEST);
lp.add(new JPanel(new FlowLayout()), BorderLayout.CENTER);
lp.add(spinner, BorderLayout.EAST);
final JPanel panel2 = new JPanel(new BorderLayout());
final JPanel panel4 = new JPanel(new FlowLayout());
panel4.add(lp);
panel2.add(panel4, BorderLayout.CENTER);
panel.add(panel2, BorderLayout.SOUTH);
splitPane.setRightComponent(panel);
spinner.addChangeListener(new ChangeListener() {
public void stateChanged(final ChangeEvent arg0) {
if (active instanceof SimpleTemplate) {
((SimpleTemplate) active).setCount(((Number) spinner.getValue()).intValue());
prev.repaint();
}
}
});
JPanel panel5 = new JPanel(new FlowLayout(FlowLayout.LEFT));
panel5.add(idef0);
panel5.add(dfd);
panel5.add(dfds);
idef0.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
loadModels();
prev.setDiagramType(0);
prev.repaint();
}
});
dfd.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
loadModels();
prev.setDiagramType(MovingArea.DIAGRAM_TYPE_DFD);
prev.repaint();
}
});
dfds.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
loadModels();
prev.setDiagramType(MovingArea.DIAGRAM_TYPE_DFDS);
prev.repaint();
}
});
ButtonGroup group = new ButtonGroup();
group.add(idef0);
group.add(dfd);
group.add(dfds);
idef0.setSelected(true);
JPanel panel6 = new JPanel(new BorderLayout());
panel6.add(panel5, BorderLayout.SOUTH);
panel6.add(splitPane, BorderLayout.CENTER);
setMainPane(panel6);
ResourceLoader.setJComponentsText(this);
pack();
setMinimumSize(this.getSize());
setLocationRelativeTo(null);
}
Aggregations