Search in sources :

Example 1 with SimpleTemplate

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);
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) SimpleTemplate(com.ramussoft.pb.dmaster.SimpleTemplate) ActionEvent(java.awt.event.ActionEvent) JLabel(javax.swing.JLabel) BorderLayout(java.awt.BorderLayout) ChangeEvent(javax.swing.event.ChangeEvent) ActionListener(java.awt.event.ActionListener) ButtonGroup(javax.swing.ButtonGroup) ChangeListener(javax.swing.event.ChangeListener) JSplitPane(javax.swing.JSplitPane)

Aggregations

SimpleTemplate (com.ramussoft.pb.dmaster.SimpleTemplate)1 BorderLayout (java.awt.BorderLayout)1 FlowLayout (java.awt.FlowLayout)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 ButtonGroup (javax.swing.ButtonGroup)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JSplitPane (javax.swing.JSplitPane)1 ChangeEvent (javax.swing.event.ChangeEvent)1 ChangeListener (javax.swing.event.ChangeListener)1