Exemple #1
0
  void jbInit() throws Exception {
    titledBorder1 =
        new TitledBorder(
            BorderFactory.createLineBorder(new Color(153, 153, 153), 2), "Assembler messages");
    this.getContentPane().setLayout(borderLayout1);

    this.setIconifiable(true);
    this.setMaximizable(true);
    this.setResizable(true);

    this.setTitle("EDIT");

    splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    splitPane.setDividerLocation(470);
    sourceArea.setFont(new java.awt.Font("Monospaced", 0, 12));
    controlPanel.setLayout(gridBagLayout1);
    controlPanel.setBorder(BorderFactory.createLoweredBevelBorder());
    positionPanel.setLayout(gridBagLayout2);
    fileLabel.setText("Source file:");
    fileText.setEditable(false);
    browseButton.setSelected(false);
    browseButton.setText("Browse ...");
    assembleButton.setEnabled(false);
    assembleButton.setText("Assemble file");
    saveButton.setEnabled(false);
    saveButton.setText("Save file");
    lineLabel.setText("Line:");
    lineText.setMinimumSize(new Dimension(50, 20));
    lineText.setPreferredSize(new Dimension(50, 20));
    lineText.setEditable(false);
    columnLabel.setText("Column:");
    columnText.setMinimumSize(new Dimension(41, 20));
    columnText.setPreferredSize(new Dimension(41, 20));
    columnText.setEditable(false);
    columnText.setText("");
    messageScrollPane.setBorder(titledBorder1);
    messageScrollPane.setMinimumSize(new Dimension(33, 61));
    messageScrollPane.setPreferredSize(new Dimension(60, 90));
    optionsButton.setEnabled(false);
    optionsButton.setText("Assembler options ...");
    messageScrollPane.getViewport().add(messageList, null);
    messageList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    this.getContentPane().add(splitPane, BorderLayout.CENTER);
    splitPane.add(textScrollPane, JSplitPane.TOP);
    splitPane.add(controlPanel, JSplitPane.BOTTOM);
    textScrollPane.getViewport().add(sourceArea, null);

    controlPanel.add(
        fileLabel,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 0, 0),
            0,
            0));
    controlPanel.add(
        fileText,
        new GridBagConstraints(
            1,
            0,
            3,
            1,
            1.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(5, 5, 0, 0),
            0,
            0));
    controlPanel.add(
        browseButton,
        new GridBagConstraints(
            4,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(5, 5, 0, 5),
            0,
            0));
    controlPanel.add(
        optionsButton,
        new GridBagConstraints(
            2,
            1,
            1,
            1,
            1.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 0, 0),
            0,
            0));
    controlPanel.add(
        assembleButton,
        new GridBagConstraints(
            3,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 0, 0),
            0,
            0));
    controlPanel.add(
        saveButton,
        new GridBagConstraints(
            4,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(5, 5, 0, 5),
            0,
            0));
    controlPanel.add(
        positionPanel,
        new GridBagConstraints(
            0,
            1,
            2,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.NONE,
            new Insets(5, 5, 0, 0),
            0,
            0));
    positionPanel.add(
        lineLabel,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 0),
            0,
            0));
    positionPanel.add(
        lineText,
        new GridBagConstraints(
            1,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(0, 5, 0, 0),
            0,
            0));
    positionPanel.add(
        columnLabel,
        new GridBagConstraints(
            2,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(0, 10, 0, 0),
            0,
            0));
    positionPanel.add(
        columnText,
        new GridBagConstraints(
            3,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.EAST,
            GridBagConstraints.NONE,
            new Insets(0, 5, 0, 0),
            0,
            0));
    controlPanel.add(
        messageScrollPane,
        new GridBagConstraints(
            0,
            2,
            5,
            1,
            1.0,
            1.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(5, 5, 5, 5),
            0,
            0));
  }
 private void jbInit() throws Exception {
   this.getContentPane().setLayout(gridBagLayout2);
   bottomPanel.setLayout(gridBagLayout1);
   messagePanel.setBorder(BorderFactory.createLoweredBevelBorder());
   replaceButton.setToolTipText("Save the new trace replacing the old trace.");
   replaceButton.setText("Replace old trace");
   replaceButton.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
           replaceOldTrace();
         }
       });
   buttonPanel.setBorder(BorderFactory.createLoweredBevelBorder());
   discardButton.setToolTipText("Discard the new trace");
   discardButton.setText("Discard new trace");
   discardButton.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
           DoneReplayDialog.this.setVisible(false);
         }
       });
   saveButton.setToolTipText("Save the new trace in a file.");
   saveButton.setText("Save as new file");
   saveButton.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
           saveNewToFile();
         }
       });
   this.setModal(true);
   this.setTitle("Replay Complete");
   jScrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
   jScrollPane1.setMinimumSize(new Dimension(200, 200));
   jScrollPane1.setPreferredSize(new Dimension(200, 200));
   jTextPane.setMinimumSize(new Dimension(25, 80));
   jTextPane.setPreferredSize(new Dimension(40, 80));
   tracePanel.setLayout(borderLayout1);
   commentPanel.setLayout(borderLayout3);
   jPanel6.setLayout(borderLayout2);
   jScrollPane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
   jScrollPane2.setMinimumSize(new Dimension(200, 100));
   jScrollPane2.setPreferredSize(new Dimension(200, 100));
   jLabel1.setText("Comment");
   jLabel2.setText("Traces (Old is Yellow, New is Pink)");
   tracePanel.setBorder(BorderFactory.createEtchedBorder());
   bottomPanel.setBorder(BorderFactory.createEtchedBorder());
   commentPanel.setBorder(BorderFactory.createEtchedBorder());
   this.getContentPane()
       .add(
           bottomPanel,
           new GridBagConstraints(
               0,
               3,
               1,
               1,
               1.0,
               1.0,
               GridBagConstraints.CENTER,
               GridBagConstraints.HORIZONTAL,
               new Insets(0, 5, 5, 5),
               0,
               0));
   buttonPanel.add(saveButton, null);
   buttonPanel.add(replaceButton, null);
   buttonPanel.add(discardButton, null);
   bottomPanel.add(
       messagePanel,
       new GridBagConstraints(
           0,
           0,
           1,
           1,
           1.0,
           1.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.BOTH,
           new Insets(0, 0, 0, 0),
           0,
           0));
   messagePanel.add(messageLabel, null);
   this.getContentPane()
       .add(
           tracePanel,
           new GridBagConstraints(
               0,
               2,
               1,
               1,
               1.0,
               1.0,
               GridBagConstraints.CENTER,
               GridBagConstraints.BOTH,
               new Insets(0, 0, 0, 0),
               0,
               0));
   tracePanel.add(jScrollPane1, BorderLayout.CENTER);
   tracePanel.add(jLabel2, BorderLayout.NORTH);
   this.getContentPane()
       .add(
           commentPanel,
           new GridBagConstraints(
               0,
               1,
               1,
               1,
               1.0,
               1.0,
               GridBagConstraints.CENTER,
               GridBagConstraints.BOTH,
               new Insets(0, 5, 5, 5),
               0,
               0));
   commentPanel.add(jPanel6, BorderLayout.CENTER);
   jPanel6.add(jScrollPane2, BorderLayout.CENTER);
   commentPanel.add(jLabel1, BorderLayout.NORTH);
   jScrollPane2.getViewport().add(commentPane, null);
   jScrollPane1.getViewport().add(jTextPane, null);
   bottomPanel.add(
       buttonPanel,
       new GridBagConstraints(
           0,
           1,
           2,
           2,
           1.0,
           1.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.NONE,
           new Insets(0, 0, 0, 0),
           0,
           0));
 }