Beispiel #1
0
  /** @param frameName title name for frame */
  public ShowSavedResults(String frameName) {
    super(frameName);
    aboutRes =
        new JTextArea(
            "Select a result set from"
                + "\nthose listed and details"
                + "\nof that analysis will be"
                + "\nshown here. Then you can"
                + "\neither delete or view those"
                + "\nresults using the buttons below.");
    aboutScroll = new JScrollPane(aboutRes);
    ss = new JScrollPane(sp);
    ss.getViewport().setBackground(Color.white);

    //  resMenu.setLayout(new FlowLayout(FlowLayout.LEFT,10,1));
    ClassLoader cl = getClass().getClassLoader();
    rfii = new ImageIcon(cl.getResource("images/Refresh_button.gif"));

    // results status
    resButtonStatus = new JPanel(new BorderLayout());
    Border loweredbevel = BorderFactory.createLoweredBevelBorder();
    Border raisedbevel = BorderFactory.createRaisedBevelBorder();
    Border compound = BorderFactory.createCompoundBorder(raisedbevel, loweredbevel);
    statusField = new JTextField();
    statusField.setBorder(compound);
    statusField.setEditable(false);
  }
Beispiel #2
0
 private JRadioButton getRegionButton(
     JRadioButton button, int x, int y, int w, int h, String tip) {
   button.setBounds(new Rectangle(x, y, w, h));
   button.setBorder(BorderFactory.createLoweredBevelBorder());
   button.setToolTipText(Messages.getString(tip));
   button.addActionListener(alRegion);
   regionButtons.add(button);
   return button;
 }
Beispiel #3
0
 private JRadioButton getShapeButton(
     JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) {
   button.setBounds(new Rectangle(x, y, w, h));
   button.setBorder(BorderFactory.createLoweredBevelBorder());
   button.setToolTipText(Messages.getString(tip));
   button.addActionListener(alShape);
   shapeButtons.add(button);
   shapes.put(shp, button);
   objects.put(shp, obj);
   return button;
 }
Beispiel #4
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));
  }
  /** This method is called from within the constructor to initialize the form. */
  public void initComponents() {

    /** **************** The components ********************************* */
    firstPanel = new JPanel();
    firstPanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 5, 2));
    // If put to False: we see the container's background
    firstPanel.setOpaque(false);
    // rows, columns, horizontalGap, verticalGap
    firstPanel.setLayout(new GridLayout(4, 2, 3, 3));
    this.setLayout(new GridLayout(2, 1, 3, 3));
    this.add(firstPanel);

    proxyStackNameLabel = new JLabel("Proxy stack name:");
    proxyStackNameLabel.setToolTipText("The name of the stack to set");
    // Alignment of the text
    proxyStackNameLabel.setHorizontalAlignment(AbstractButton.CENTER);
    // Color of the text
    proxyStackNameLabel.setForeground(Color.black);
    // Size of the text
    proxyStackNameLabel.setFont(new Font("Dialog", 1, 12));
    // If put to true: we see the label's background
    proxyStackNameLabel.setOpaque(true);
    proxyStackNameLabel.setBackground(ProxyLauncher.labelBackGroundColor);
    proxyStackNameLabel.setBorder(ProxyLauncher.labelBorder);
    proxyStackNameTextField = new JTextField(20);
    proxyStackNameTextField.setHorizontalAlignment(AbstractButton.CENTER);
    proxyStackNameTextField.setFont(new Font("Dialog", 0, 14));
    proxyStackNameTextField.setBackground(ProxyLauncher.textBackGroundColor);
    proxyStackNameTextField.setForeground(Color.black);
    proxyStackNameTextField.setBorder(BorderFactory.createLoweredBevelBorder());
    firstPanel.add(proxyStackNameLabel);
    firstPanel.add(proxyStackNameTextField);

    proxyIPAddressLabel = new JLabel("Proxy IP address:");
    proxyIPAddressLabel.setToolTipText("The address of the proxy to set");
    // Alignment of the text
    proxyIPAddressLabel.setHorizontalAlignment(AbstractButton.CENTER);
    // Color of the text
    proxyIPAddressLabel.setForeground(Color.black);
    // Size of the text
    proxyIPAddressLabel.setFont(new Font("Dialog", 1, 12));
    // If put to true: we see the label's background
    proxyIPAddressLabel.setOpaque(true);
    proxyIPAddressLabel.setBackground(ProxyLauncher.labelBackGroundColor);
    proxyIPAddressLabel.setBorder(ProxyLauncher.labelBorder);
    proxyIPAddressTextField = new JTextField(20);
    proxyIPAddressTextField.setHorizontalAlignment(AbstractButton.CENTER);
    proxyIPAddressTextField.setFont(new Font("Dialog", 0, 14));
    proxyIPAddressTextField.setBackground(ProxyLauncher.textBackGroundColor);
    proxyIPAddressTextField.setForeground(Color.black);
    proxyIPAddressTextField.setBorder(BorderFactory.createLoweredBevelBorder());
    firstPanel.add(proxyIPAddressLabel);
    firstPanel.add(proxyIPAddressTextField);

    outboundProxyLabel = new JLabel("Next hop (IP:port/protocol):");
    outboundProxyLabel.setToolTipText(
        "Location where the message will be sent "
            + "if all the resolutions (DNS, router,...) fail. If not set: 404 will be replied");
    // Alignment of the text
    outboundProxyLabel.setHorizontalAlignment(AbstractButton.CENTER);
    // Color of the text
    outboundProxyLabel.setForeground(Color.black);
    // Size of the text
    outboundProxyLabel.setFont(new Font("Dialog", 1, 12));
    // If put to true: we see the label's background
    outboundProxyLabel.setOpaque(true);
    outboundProxyLabel.setBackground(ProxyLauncher.labelBackGroundColor);
    outboundProxyLabel.setBorder(ProxyLauncher.labelBorder);
    outboundProxyTextField = new JTextField(20);
    outboundProxyTextField.setHorizontalAlignment(AbstractButton.CENTER);
    outboundProxyTextField.setFont(new Font("Dialog", 0, 14));
    outboundProxyTextField.setBackground(ProxyLauncher.textBackGroundColor);
    outboundProxyTextField.setForeground(Color.black);
    outboundProxyTextField.setBorder(BorderFactory.createLoweredBevelBorder());
    firstPanel.add(outboundProxyLabel);
    firstPanel.add(outboundProxyTextField);

    routerClassLabel = new JLabel("The Router class name:");
    routerClassLabel.setToolTipText(
        "The class name (full java package name) of the router" + " used to forward the messages");
    // Alignment of the text
    routerClassLabel.setHorizontalAlignment(AbstractButton.CENTER);
    // Color of the text
    routerClassLabel.setForeground(Color.black);
    // Size of the text
    routerClassLabel.setFont(new Font("Dialog", 1, 12));
    // If put to true: we see the label's background
    routerClassLabel.setOpaque(true);
    routerClassLabel.setBackground(ProxyLauncher.labelBackGroundColor);
    routerClassLabel.setBorder(ProxyLauncher.labelBorder);
    routerClassTextField = new JTextField(20);
    routerClassTextField.setHorizontalAlignment(AbstractButton.CENTER);
    routerClassTextField.setFont(new Font("Dialog", 0, 12));
    routerClassTextField.setBackground(ProxyLauncher.textBackGroundColor);
    routerClassTextField.setForeground(Color.black);
    routerClassTextField.setBorder(BorderFactory.createLoweredBevelBorder());
    firstPanel.add(routerClassLabel);
    firstPanel.add(routerClassTextField);

    JPanel panel = new JPanel();
    // top, left, bottom, right
    panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 2));
    // If put to False: we see the container's background
    panel.setOpaque(false);
    // rows, columns, horizontalGap, verticalGap
    panel.setLayout(new BorderLayout());
    this.add(panel);

    JLabel lpLabel = new JLabel("Listening points list:");
    lpLabel.setVisible(true);
    lpLabel.setToolTipText("The listening points of the proxy");
    lpLabel.setHorizontalAlignment(AbstractButton.CENTER);
    lpLabel.setForeground(Color.black);
    lpLabel.setFont(new Font("Dialog", 1, 12));
    lpLabel.setOpaque(true);
    lpLabel.setBackground(ProxyLauncher.labelBackGroundColor);
    lpLabel.setBorder(ProxyLauncher.labelBorder);
    panel.add(lpLabel, BorderLayout.NORTH);

    // this.add(listeningPointsList);
    JScrollPane scrollPane =
        new JScrollPane(
            listeningPointsList,
            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    panel.add(scrollPane, BorderLayout.CENTER);

    thirdPanel = new JPanel();
    thirdPanel.setOpaque(false);
    // top, left, bottom, right
    thirdPanel.setBorder(BorderFactory.createEmptyBorder(3, 0, 5, 0));
    thirdPanel.setLayout(new GridLayout(1, 2, 3, 3));

    JButton addLPButton = new JButton(" Add ");
    addLPButton.setToolTipText("Add a listening point");
    addLPButton.setFocusPainted(false);
    addLPButton.setFont(new Font("Dialog", 1, 16));
    addLPButton.setBackground(ProxyLauncher.buttonBackGroundColor);
    addLPButton.setBorder(ProxyLauncher.buttonBorder);
    addLPButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            addLPButtonActionPerformed(evt);
          }
        });
    thirdPanel.add(addLPButton);

    JButton removeLPButton = new JButton(" Remove ");
    removeLPButton.setToolTipText("Remove a listening point");
    removeLPButton.setFocusPainted(false);
    removeLPButton.setFont(new Font("Dialog", 1, 16));
    removeLPButton.setBackground(ProxyLauncher.buttonBackGroundColor);
    removeLPButton.setBorder(ProxyLauncher.buttonBorder);
    removeLPButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            removeLPButtonActionPerformed(evt);
          }
        });
    thirdPanel.add(removeLPButton);

    panel.add(thirdPanel, BorderLayout.SOUTH);
  }
  // Initializes this component.
  private void jbInit() {
    fileChooser.setFileFilter(new ScriptFileFilter());
    this.getContentPane().setLayout(null);

    Hashtable<Integer, JLabel> labelTable = new Hashtable<Integer, JLabel>();

    JLabel slowLabel = new JLabel("Slow");
    slowLabel.setFont(Utilities.thinLabelsFont);
    JLabel fastLabel = new JLabel("Fast");
    fastLabel.setFont(Utilities.thinLabelsFont);
    labelTable.put(1, slowLabel);
    labelTable.put(5, fastLabel);

    speedSlider.addChangeListener(
        new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            SpeedSlider_stateChanged(e);
          }
        });
    speedSlider.setLabelTable(labelTable);
    speedSlider.setMajorTickSpacing(1);
    speedSlider.setPaintTicks(true);
    speedSlider.setPaintLabels(true);
    speedSlider.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
    speedSlider.setPreferredSize(new Dimension(95, 50));
    speedSlider.setMinimumSize(new Dimension(95, 50));
    speedSlider.setToolTipText("Speed");
    speedSlider.setMaximumSize(new Dimension(95, 50));

    final Dimension buttonSize = new Dimension(39, 39);

    loadProgramButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            loadProgramButton_actionPerformed();
          }
        });
    loadProgramButton.setMaximumSize(buttonSize);
    loadProgramButton.setMinimumSize(buttonSize);
    loadProgramButton.setPreferredSize(buttonSize);
    loadProgramButton.setSize(buttonSize);
    loadProgramButton.setToolTipText("Load Program");
    loadProgramButton.setIcon(loadProgramIcon);

    ffwdButton.setMaximumSize(buttonSize);
    ffwdButton.setMinimumSize(buttonSize);
    ffwdButton.setPreferredSize(buttonSize);
    ffwdButton.setToolTipText("Run");
    ffwdButton.setIcon(ffwdIcon);
    ffwdButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            ffwdButton_actionPerformed();
          }
        });

    stopButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            stopButton_actionPerformed();
          }
        });
    stopButton.setMaximumSize(buttonSize);
    stopButton.setMinimumSize(buttonSize);
    stopButton.setPreferredSize(buttonSize);
    stopButton.setToolTipText("Stop");
    stopButton.setIcon(stopIcon);

    rewindButton.setMaximumSize(buttonSize);
    rewindButton.setMinimumSize(buttonSize);
    rewindButton.setPreferredSize(buttonSize);
    rewindButton.setToolTipText("Reset");
    rewindButton.setIcon(rewindIcon);
    rewindButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            rewindButton_actionPerformed();
          }
        });

    scriptButton.setMaximumSize(buttonSize);
    scriptButton.setMinimumSize(buttonSize);
    scriptButton.setPreferredSize(buttonSize);
    scriptButton.setToolTipText("Load Script");
    scriptButton.setIcon(scriptIcon);
    scriptButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            scriptButton_actionPerformed();
          }
        });

    breakButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            breakButton_actionPerformed();
          }
        });
    breakButton.setMaximumSize(buttonSize);
    breakButton.setMinimumSize(buttonSize);
    breakButton.setPreferredSize(buttonSize);
    breakButton.setToolTipText("Open breakpoint panel");
    breakButton.setIcon(breakIcon);

    breakpointWindow.addBreakpointListener(this);

    singleStepButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            singleStepButton_actionPerformed();
          }
        });
    singleStepButton.setMaximumSize(buttonSize);
    singleStepButton.setMinimumSize(buttonSize);
    singleStepButton.setPreferredSize(buttonSize);
    singleStepButton.setSize(buttonSize);
    singleStepButton.setToolTipText("Single Step");
    singleStepButton.setIcon(singleStepIcon);

    stepOverButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            stepOverButton_actionPerformed();
          }
        });
    stepOverButton.setMaximumSize(buttonSize);
    stepOverButton.setMinimumSize(buttonSize);
    stepOverButton.setPreferredSize(buttonSize);
    stepOverButton.setSize(buttonSize);
    stepOverButton.setToolTipText("Step Over");
    stepOverButton.setIcon(stepOverIcon);

    animationCombo.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            animationCombo_actionPerformed();
          }
        });

    formatCombo.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            formatCombo_actionPerformed();
          }
        });

    additionalDisplayCombo.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            additionalDisplayCombo_actionPerformed();
          }
        });

    messageLbl.setFont(Utilities.statusLineFont);
    messageLbl.setBorder(BorderFactory.createLoweredBevelBorder());
    messageLbl.setBounds(new Rectangle(0, 667, CONTROLLER_WIDTH - 8, 25));

    toolBar = new JToolBar();
    toolBar.setSize(new Dimension(TOOLBAR_WIDTH, TOOLBAR_HEIGHT));
    toolBar.setLayout(new FlowLayout(FlowLayout.LEFT, 3, 0));
    toolBar.setFloatable(false);
    toolBar.setLocation(0, 0);
    toolBar.setBorder(BorderFactory.createEtchedBorder());
    arrangeToolBar();
    this.getContentPane().add(toolBar, null);
    toolBar.revalidate();
    toolBar.repaint();
    repaint();

    // Creating the menu bar
    menuBar = new JMenuBar();
    arrangeMenu();
    setJMenuBar(menuBar);

    this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    this.getContentPane().add(messageLbl, null);

    setControllerSize();

    // sets the frame to be visible.
    setVisible(true);
  }
Beispiel #7
0
 /**
  * Component initialization.
  *
  * @throws java.lang.Exception
  */
 private void jbInit() throws Exception {
   contentPane = (JPanel) getContentPane();
   contentPane.setLayout(xYLayoutServer);
   setSize(new Dimension(365, 327));
   setTitle("ProgDan® Codename Avalon: Parser Server v. 0.1");
   statusBar.setBorder(BorderFactory.createLoweredBevelBorder());
   statusBar.setText("Server stopped!");
   jPanelFiles.setBorder(BorderFactory.createEtchedBorder());
   jPanelFiles.setToolTipText("");
   jPanelFiles.setLayout(xYLayout1);
   jLabelFiles.setFont(new java.awt.Font("Dialog", Font.BOLD, 11));
   jLabelFiles.setText("Files received:");
   jLabelConverted.setText("Files converted:");
   jProgressBarConvert.setMaximum(0);
   jProgressBarConvert.setString("0");
   jProgressBarConvert.setStringPainted(true);
   jLabelNoConvert.setText("Files not converted:");
   jProgressBarNoConvert.setMaximum(0);
   jProgressBarNoConvert.setString("0");
   jProgressBarNoConvert.setStringPainted(true);
   jProgressBarNoConvert.addPropertyChangeListener(
       new FrameServer_jProgressBarNoConvert_propertyChangeAdapter(this));
   jButtonStart.setSelected(false);
   jButtonStart.setText("Start");
   jButtonStart.addActionListener(new FrameServer_jButtonStart_actionAdapter(this));
   jButtonStop.setEnabled(false);
   jButtonStop.setText("Stop");
   jButtonStop.addActionListener(new FrameServer_jButtonStop_actionAdapter(this));
   jButtonExit.setText("Exit");
   jButtonExit.addActionListener(new FrameServer_jButtonExit_actionAdapter(this));
   jButtonConfig.setText("Config");
   jButtonConfig.addActionListener(new FrameServer_jButtonConfig_actionAdapter(this));
   jLabelActiveConnections.setText("Active Connections:");
   jTextFieldConnections.setEditable(false);
   jTextFieldConnections.setText("0");
   jTextFieldConnections.setHorizontalAlignment(SwingConstants.CENTER);
   jProgressBarFiles.setMaximum(0);
   jProgressBarFiles.setString("0");
   jProgressBarFiles.setStringPainted(true);
   jButtonText.setEnabled(false);
   jButtonText.setText("...");
   jButtonText.addActionListener(new FrameServer_jButtonText_actionAdapter(this));
   jPanelLogo.setBorder(null);
   jPanelLogo.setMinimumSize(new Dimension(10, 10));
   jPanelLogo.setPreferredSize(new Dimension(10, 10));
   jPanelLogo.setLayout(null);
   jLabelTitle.setFont(new java.awt.Font("Dialog", Font.BOLD, 14));
   jLabelTitle.setText("ProgDan® Codename Avalon");
   jLabelApplication.setFont(new java.awt.Font("Dialog", Font.BOLD, 24));
   jLabelApplication.setForeground(Color.red);
   jLabelApplication.setText("Parser Server");
   jLabelRelease.setFont(new java.awt.Font("Dialog", Font.BOLD, 11));
   jLabelRelease.setForeground(Color.red);
   jLabelRelease.setText("Release 0.1 - Beta");
   jLabelCopyright.setText("Copyright 2004-2005 - ProgDan® Software");
   jPanelFiles.add(jLabelFiles, new XYConstraints(8, 5, -1, -1));
   jPanelFiles.add(jLabelNoConvert, new XYConstraints(8, 50, -1, -1));
   jPanelFiles.add(jLabelConverted, new XYConstraints(8, 28, -1, -1));
   jPanelFiles.add(jProgressBarFiles, new XYConstraints(108, 3, 160, -1));
   jPanelFiles.add(jProgressBarConvert, new XYConstraints(108, 26, 160, -1));
   jPanelFiles.add(jProgressBarNoConvert, new XYConstraints(108, 48, 160, -1));
   jPanelFiles.add(jButtonText, new XYConstraints(279, 46, -1, -1));
   contentPane.add(jTextFieldConnections, new XYConstraints(158, 118, 131, -1));
   contentPane.add(jLabelActiveConnections, new XYConstraints(45, 121, -1, -1));
   contentPane.add(jButtonExit, new XYConstraints(277, 238, 65, -1));
   contentPane.add(jButtonStart, new XYConstraints(11, 238, 65, -1));
   contentPane.add(jButtonStop, new XYConstraints(100, 238, 65, -1));
   contentPane.add(jButtonConfig, new XYConstraints(188, 238, 65, -1));
   contentPane.add(statusBar, new XYConstraints(6, 272, 344, -1));
   contentPane.add(jPanelFiles, new XYConstraints(13, 148, 327, 77));
   contentPane.add(jPanelLogo, new XYConstraints(13, 15, 112, 96));
   contentPane.add(jLabelTitle, new XYConstraints(141, 14, -1, -1));
   contentPane.add(jLabelApplication, new XYConstraints(165, 40, -1, -1));
   contentPane.add(jLabelRelease, new XYConstraints(250, 66, -1, -1));
   contentPane.add(jLabelCopyright, new XYConstraints(137, 95, -1, -1));
 }
  private void jbInit() throws Exception {
    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    this.setIconImage(icon.getImage());
    this.addComponentListener(
        new java.awt.event.ComponentAdapter() {
          public void componentShown(ComponentEvent e) {
            this_componentShown(e);
          }
        });
    this.getContentPane().setLayout(borderLayout1);
    this.addWindowListener(
        new java.awt.event.WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            this_windowClosing(e);
          }
        });
    this.setJMenuBar(menuBar);

    // This size is chosen so that when the user hits the Info tool, the
    // window
    // fits between the lower edge of the TaskFrame and the lower edge of
    // the
    // WorkbenchFrame. See the call to #setSize in InfoFrame. [Jon Aquino]
    setSize(900, 665);

    // OUTLINE_DRAG_MODE is excruciatingly slow in JDK 1.4.1, so don't use
    // it.
    // (although it's supposed to be fixed in 1.4.2, which has not yet been
    // released). (see Sun Java Bug ID 4665237). [Jon Aquino]
    // desktopPane.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
    messageLabel.setOpaque(true);
    memoryLabel.setText("jLabel1");
    wmsLabel.setHorizontalAlignment(SwingConstants.LEFT);
    wmsLabel.setText(" ");
    this.getContentPane().add(statusPanel, BorderLayout.SOUTH);
    exitMenuItem.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            exitMenuItem_actionPerformed(e);
          }
        });
    windowMenu.addMenuListener(
        new javax.swing.event.MenuListener() {
          public void menuCanceled(MenuEvent e) {}

          public void menuDeselected(MenuEvent e) {}

          public void menuSelected(MenuEvent e) {
            windowMenu_menuSelected(e);
          }
        });
    coordinateLabel.setBorder(BorderFactory.createLoweredBevelBorder());
    wmsLabel.setBorder(BorderFactory.createLoweredBevelBorder());
    coordinateLabel.setText(" ");
    statusPanel.setLayout(gridBagLayout1);
    statusPanel.setBorder(BorderFactory.createRaisedBevelBorder());
    messageLabel.setBorder(BorderFactory.createLoweredBevelBorder());
    messageLabel.setText(" ");
    timeLabel.setBorder(BorderFactory.createLoweredBevelBorder());
    timeLabel.setText(" ");
    memoryLabel.setBorder(BorderFactory.createLoweredBevelBorder());
    memoryLabel.setText(" ");
    menuBar.add(fileMenu);
    menuBar.add(windowMenu);
    getContentPane().add(toolBar, BorderLayout.NORTH);
    getContentPane().add(desktopPane, BorderLayout.CENTER);
    fileMenu.addSeparator();
    fileMenu.add(exitMenuItem);
    statusPanel.add(
        coordinateLabel,
        new GridBagConstraints(
            5,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(0, 0, 0, 0),
            0,
            0));
    statusPanel.add(
        timeLabel,
        new GridBagConstraints(
            2,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(0, 0, 0, 0),
            0,
            0));
    statusPanel.add(
        messageLabel,
        new GridBagConstraints(
            1,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(0, 0, 0, 0),
            0,
            0));

    // Give memoryLabel the 1.0 weight. All the rest should have their
    // sizes
    // configured using #configureStatusLabel. [Jon Aquino]
    statusPanel.add(
        memoryLabel,
        new GridBagConstraints(
            3,
            1,
            1,
            1,
            1.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(0, 0, 0, 0),
            0,
            0));
    statusPanel.add(
        wmsLabel,
        new GridBagConstraints(
            4,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 0),
            0,
            0));
  }
Beispiel #9
0
  // initializes the internal component of the translator
  protected void jbInit() {
    this.getContentPane().setLayout(new GridBagLayout());

    loadButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            loadButton_actionPerformed(e);
          }
        });
    loadButton.setMaximumSize(new Dimension(39, 39));
    loadButton.setMinimumSize(new Dimension(39, 39));
    loadButton.setPreferredSize(new Dimension(39, 39));
    loadButton.setSize(new Dimension(39, 39));
    loadButton.setToolTipText("Load Source File");
    loadButton.setIcon(loadIcon);

    saveButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            saveButton_actionPerformed(e);
          }
        });
    saveButton.setMaximumSize(new Dimension(39, 39));
    saveButton.setMinimumSize(new Dimension(39, 39));
    saveButton.setPreferredSize(new Dimension(39, 39));
    saveButton.setSize(new Dimension(39, 39));
    saveButton.setToolTipText("Save Destination File");
    saveButton.setIcon(saveIcon);

    singleStepButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            singleStepButton_actionPerformed(e);
          }
        });
    singleStepButton.setMaximumSize(new Dimension(39, 39));
    singleStepButton.setMinimumSize(new Dimension(39, 39));
    singleStepButton.setPreferredSize(new Dimension(39, 39));
    singleStepButton.setSize(new Dimension(39, 39));
    singleStepButton.setToolTipText("Single Step");
    singleStepButton.setIcon(singleStepIcon);

    ffwdButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            ffwdButton_actionPerformed(e);
          }
        });
    ffwdButton.setMaximumSize(new Dimension(39, 39));
    ffwdButton.setMinimumSize(new Dimension(39, 39));
    ffwdButton.setPreferredSize(new Dimension(39, 39));
    ffwdButton.setSize(new Dimension(39, 39));
    ffwdButton.setToolTipText("Fast Forward");
    ffwdButton.setIcon(ffwdIcon);

    rewindButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            rewindButton_actionPerformed(e);
          }
        });
    rewindButton.setMaximumSize(new Dimension(39, 39));
    rewindButton.setMinimumSize(new Dimension(39, 39));
    rewindButton.setPreferredSize(new Dimension(39, 39));
    rewindButton.setSize(new Dimension(39, 39));
    rewindButton.setToolTipText("Rewind");
    rewindButton.setIcon(rewindIcon);

    stopButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            stopButton_actionPerformed(e);
          }
        });
    stopButton.setMaximumSize(new Dimension(39, 39));
    stopButton.setMinimumSize(new Dimension(39, 39));
    stopButton.setPreferredSize(new Dimension(39, 39));
    stopButton.setSize(new Dimension(39, 39));
    stopButton.setToolTipText("Stop");
    stopButton.setIcon(stopIcon);

    fullTranslationButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            fullTranslationButton_actionPerformed(e);
          }
        });
    fullTranslationButton.setMaximumSize(new Dimension(39, 39));
    fullTranslationButton.setMinimumSize(new Dimension(39, 39));
    fullTranslationButton.setPreferredSize(new Dimension(39, 39));
    fullTranslationButton.setSize(new Dimension(39, 39));
    fullTranslationButton.setToolTipText("Fast Translation");
    fullTranslationButton.setIcon(fullTranslationIcon);

    messageLbl.setFont(Utilities.statusLineFont);
    messageLbl.setLineWrap(true);
    messageLbl.setEditable(false);
    messageLbl.setCursor(null);
    messageLbl.setOpaque(false);
    messageLbl.setFocusable(false);
    messageLblPane.setBorder(BorderFactory.createLoweredBevelBorder());
    // messageLblPane.setBounds(new Rectangle(0, 672, TRANSLATOR_WIDTH - 8, 20));
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 1;
    c.weighty = 0;
    c.gridwidth = 3;
    c.anchor = GridBagConstraints.CENTER;
    c.gridx = 0;
    c.gridy = 2;
    this.getContentPane().add(messageLblPane, c);

    // arrowLabel.setBounds(new Rectangle(290, 324, 88, 71));
    arrowLabel.setIcon(arrowIcon);

    // source.setVisibleRows(31);
    // destination.setVisibleRows(31);
    // source.setBounds(new Rectangle(35,100,source.getWidth(),source.getHeight()));
    // destination.setBounds(new Rectangle(375,100,destination.getWidth(),destination.getHeight()));

    c.fill = GridBagConstraints.BOTH;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 1;
    c.weighty = 1;
    c.gridwidth = 1;
    c.anchor = GridBagConstraints.CENTER;
    c.gridx = 0;
    c.gridy = 1;
    this.getContentPane().add(source, c);

    c.fill = GridBagConstraints.NONE;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 0;
    c.weighty = 0;
    c.gridwidth = 1;
    c.anchor = GridBagConstraints.CENTER;
    c.gridx = 1;
    c.gridy = 1;
    this.getContentPane().add(arrowLabel, c);

    c.fill = GridBagConstraints.BOTH;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 1;
    c.weighty = 1;
    c.gridwidth = 1;
    c.anchor = GridBagConstraints.CENTER;
    c.gridx = 2;
    c.gridy = 1;
    this.getContentPane().add(destination, c);

    // Adding the tool bar to this container.
    toolBar.setFloatable(false);
    toolBar.setLocation(0, 0);
    toolBar.setLayout(new FlowLayout(FlowLayout.LEFT, 3, 0));
    toolBar.setBorder(BorderFactory.createEtchedBorder());
    arrangeToolBar();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 1;
    c.weighty = 0;
    c.gridwidth = 3;
    c.anchor = GridBagConstraints.CENTER;
    c.gridx = 0;
    c.gridy = 0;
    this.getContentPane().add(toolBar, c);
    toolBar.revalidate();
    toolBar.repaint();
    repaint();

    // Creating the menu bar
    arrangeMenu();
    setJMenuBar(menuBar);

    // initializing the window size and visibility
    setDefaultCloseOperation(3);
    setSize(new Dimension(TRANSLATOR_WIDTH, TRANSLATOR_HEIGHT));
    setVisible(true);
  }
Beispiel #10
0
    public PlayerView(String player) {
      playerName = new String(player);

      // Set-Up Top of Score Area
      namePanel = new JPanel();
      nameText = new JLabel(player);
      nameText.setFont(ScoreFont);
      namePanel.setLayout(new BorderLayout());
      namePanel.add(nameText, BorderLayout.CENTER);

      scorePanel = new JPanel();
      scoreText = new JLabel("  0");
      scoreText.setFont(ScoreFont);
      scorePanel.setLayout(new BorderLayout());
      scorePanel.add(scoreText, BorderLayout.CENTER);

      topPanel = new JPanel();
      BoxLayout layout = new BoxLayout(topPanel, BoxLayout.LINE_AXIS);

      topPanel.setLayout(layout);
      topPanel.add(namePanel);
      topPanel.add(Box.createRigidArea(new Dimension(10, 0)));
      topPanel.add(scorePanel);
      topPanel.add(Box.createRigidArea(new Dimension(10, 0)));

      //
      // topPanel.setLayout( new BorderLayout());
      // topPanel.add(namePanel, BorderLayout.WEST);
      // topPanel.add(scorePanel, BorderLayout.EAST);
      //
      // Create bordering for top panel
      Border raisedBevel, loweredBevel, compound;

      raisedBevel = BorderFactory.createRaisedBevelBorder();
      loweredBevel = BorderFactory.createLoweredBevelBorder();
      compound = BorderFactory.createCompoundBorder(raisedBevel, loweredBevel);
      topPanel.setBorder(compound);

      // Set-Up area to display word list
      wordPanel = new JPanel();
      Border etched = BorderFactory.createEtchedBorder();
      TitledBorder etchedTitle = BorderFactory.createTitledBorder(etched, "Word List");
      etchedTitle.setTitleJustification(TitledBorder.RIGHT);
      wordPanel.setBorder(etchedTitle);
      myWordList = new ExpandableList();
      myWordList.addActionListener(
          new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
              String word = e.getActionCommand();
              java.util.List<BoardCell> list = myFinder.cellsForWord(myBoard, word);
              myBoardPanel.highlightDice(list);
            }
          });
      wordPanel.add(
          new JScrollPane(
              myWordList,
              JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
              JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED));

      setLayout(new BorderLayout(30, 30));
      add(topPanel, BorderLayout.NORTH);
      add(wordPanel, BorderLayout.CENTER);
    }
Beispiel #11
0
  public PanelSpec(SmedAction dia) {
    dlg = dia;
    setLayout(null);
    add(getShapeButton(pillarButton, 0, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYSPP));
    add(getShapeButton(sparButton, 34, 0, 34, 32, "Spar", Shp.SPAR, Obj.BOYSPP));
    add(getShapeButton(canButton, 68, 0, 34, 32, "Can", Shp.CAN, Obj.BOYSPP));
    add(getShapeButton(coneButton, 102, 0, 34, 32, "Cone", Shp.CONI, Obj.BOYSPP));
    add(getShapeButton(sphereButton, 0, 32, 34, 32, "Sphere", Shp.SPHERI, Obj.BOYSPP));
    add(getShapeButton(barrelButton, 34, 32, 34, 32, "Barrel", Shp.BARREL, Obj.BOYSPP));
    add(getShapeButton(superButton, 68, 32, 34, 32, "Super", Shp.SUPER, Obj.BOYSPP));
    add(getShapeButton(floatButton, 102, 32, 34, 32, "Float", Shp.FLOAT, Obj.LITFLT));
    add(getShapeButton(beaconButton, 0, 64, 34, 32, "Beacon", Shp.BEACON, Obj.BCNSPP));
    add(getShapeButton(towerButton, 34, 64, 34, 32, "TowerB", Shp.TOWER, Obj.BCNSPP));
    add(getShapeButton(stakeButton, 68, 64, 34, 32, "Stake", Shp.STAKE, Obj.BCNSPP));
    add(getShapeButton(cairnButton, 102, 64, 34, 32, "CairnB", Shp.CAIRN, Obj.BCNSPP));

    categoryLabel = new JLabel(Messages.getString("Category"), SwingConstants.CENTER);
    categoryLabel.setBounds(new Rectangle(5, 125, 160, 18));
    add(categoryLabel);
    categoryBox = new JComboBox();
    categoryBox.setBounds(new Rectangle(5, 142, 160, 18));
    add(categoryBox);
    categoryBox.setVisible(true);
    categoryBox.addActionListener(alCategoryBox);
    addCatItem("", Cat.NOCAT);
    addCatItem(Messages.getString("UKPurpose"), Cat.SPM_UNKN);
    addCatItem(Messages.getString("Warning"), Cat.SPM_WARN);
    addCatItem(Messages.getString("ChanSeparation"), Cat.SPM_CHBF);
    addCatItem(Messages.getString("Yachting"), Cat.SPM_YCHT);
    addCatItem(Messages.getString("Cable"), Cat.SPM_CABL);
    addCatItem(Messages.getString("Outfall"), Cat.SPM_OFAL);
    addCatItem(Messages.getString("ODAS"), Cat.SPM_ODAS);
    addCatItem(Messages.getString("RecreationZone"), Cat.SPM_RECN);
    addCatItem(Messages.getString("Mooring"), Cat.SPM_MOOR);
    addCatItem(Messages.getString("LANBY"), Cat.SPM_LNBY);
    addCatItem(Messages.getString("Leading"), Cat.SPM_LDNG);
    addCatItem(Messages.getString("Notice"), Cat.SPM_NOTC);
    addCatItem(Messages.getString("TSS"), Cat.SPM_TSS);
    addCatItem(Messages.getString("FoulGround"), Cat.SPM_FOUL);
    addCatItem(Messages.getString("Diving"), Cat.SPM_DIVE);
    addCatItem(Messages.getString("FerryCross"), Cat.SPM_FRRY);
    addCatItem(Messages.getString("Anchorage"), Cat.SPM_ANCH);
    mooringBox = new JComboBox();
    mooringBox.setBounds(new Rectangle(5, 142, 160, 18));
    add(mooringBox);
    mooringBox.setVisible(false);
    mooringBox.addActionListener(alMooringBox);
    addMorItem("", Cat.NOCAT);
    addMorItem(Messages.getString("Dolphin"), Cat.MOR_DLPN);
    addMorItem(Messages.getString("DevDolphin"), Cat.MOR_DDPN);
    addMorItem(Messages.getString("Bollard"), Cat.MOR_BLRD);
    addMorItem(Messages.getString("Wall"), Cat.MOR_WALL);
    addMorItem(Messages.getString("Post"), Cat.MOR_POST);
    addMorItem(Messages.getString("Chain"), Cat.MOR_CHWR);
    addMorItem(Messages.getString("Rope"), Cat.MOR_ROPE);
    addMorItem(Messages.getString("Automatic"), Cat.MOR_AUTO);
    addMorItem(Messages.getString("MooringBuoy"), Cat.MOR_BUOY);
    addMorItem(Messages.getString("CALM"), Cat.INB_CALM);
    addMorItem(Messages.getString("SBM"), Cat.INB_SBM);

    topmarkButton.setBounds(new Rectangle(136, 0, 34, 32));
    topmarkButton.setToolTipText(Messages.getString("Topmark"));
    topmarkButton.setBorder(BorderFactory.createLoweredBevelBorder());
    topmarkButton.addActionListener(alTop);
    add(topmarkButton);

    //		noticeButton.setBounds(new Rectangle(136, 32, 34, 32));
    //		noticeButton.setToolTipText(Messages.getString("Notice"));
    //		noticeButton.setBorder(BorderFactory.createLoweredBevelBorder());
    //		noticeButton.addActionListener(alNotice);
    //		add(noticeButton);

    mooringButton.setBounds(new Rectangle(136, 64, 34, 32));
    mooringButton.setToolTipText(Messages.getString("Mooring"));
    mooringButton.setBorder(BorderFactory.createLoweredBevelBorder());
    mooringButton.addActionListener(alMooring);
    add(mooringButton);
  }
Beispiel #12
0
  public OrderTrans2() {
    super(windowTitle);
    int i;
    int currentPanel; // Value to specify which is the current panel in the vector
    JPanel subPanel = new JPanel(); // value used when adding sliders to the frame
    Runtime program = Runtime.getRuntime();
    Container content = getContentPane();

    createSliderVector();
    createPanelVector();
    getCodeSwapString();
    /** Set code-swap strings' value. */

    /** Get current OS of the system. */
    if (System.getProperty("os.name").startsWith("Windows")) isWindows = true;
    else isWindows = false;

    /** Add the radio buttons to the group */
    radioGrp.add(firstBox);
    radioGrp.add(secondBox);
    /** Set interactive buttons for the user interface */
    JButton exeButton = new JButton("Execute");
    exeButton.setToolTipText("Re-execute the program");
    JButton resetButton = new JButton("Reset");
    resetButton.setToolTipText("Reset Value");
    JButton exitButton = new JButton("Exit");
    exitButton.setToolTipText("Exit the Program");

    // Create the main panel that contains everything.
    JPanel mainPanel = new JPanel();
    // Create the panel that contains the sliders
    JPanel subPanel1 = new JPanel();
    // Create the panel that contains the checkboxes
    JPanel subPanel2 = new JPanel();
    // Create the panel that contains the buttons
    JPanel subPanel3 = new JPanel();

    // JScrollPane scrollPane = new JScrollPane(); // main text pane with scroll bars
    content.add(mainPanel, BorderLayout.SOUTH);
    mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
    mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

    content.add(scrollPane, BorderLayout.CENTER);
    scrollPane.setBorder(BorderFactory.createLoweredBevelBorder());
    scrollPane.getViewport().add(textPane);

    mainPanel.add(subPanel1);
    mainPanel.add(subPanel2);
    mainPanel.add(subPanel3);
    subPanel1.setLayout(new GridLayout(0, 1));
    /** Add subPanel elements to the subPanel1, each would be a row of sliders */
    for (i = 0; i < ROWS; i++) subPanel1.add((JPanel) vSubPanel.elementAt(i));
    /** Set the first element in the Panel Vector as the current subPanel. */
    currentPanel = 0;
    subPanel = (JPanel) vSubPanel.elementAt(currentPanel);
    /** Allocate sliders to the sub-panels. */
    for (i = 0; i < COMPONENTS; i++) {
      PSlider slider = (PSlider) vSlider.elementAt(i);
      if (slider.getResideValue() == 'n') {
        currentPanel += 1;
        subPanel = (JPanel) vSubPanel.elementAt(currentPanel);
      }
      subPanel.add((PSlider) vSlider.elementAt(i));
    }

    /** Set and view the source code on the frame */
    textPane.setEditable(false);
    textPane.setContentType("text/html; charset=EUC-JP");

    subPanel2.setLayout(new GridLayout(0, 2));
    subPanel2.add(firstBox);
    subPanel2.add(secondBox);
    subPanel3.setLayout(new GridLayout(0, 3));
    subPanel3.add(exeButton);
    exeButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            doExeCommand();
          }
        });
    subPanel3.add(resetButton);
    resetButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            doResetCommand();
          }
        });
    subPanel3.add(exitButton);
    exitButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            doExitCommand();
          }
        });

    /** Run the illustrated program */
    try {
      pid = program.exec(cmd);
      if (isWindows == false) {
        Process pid2 = null;
        pid2 = program.exec("getpid " + cmd.substring(4));
      }
    } catch (IOException ie) {
      System.err.println("Couldn't run " + ie);
      // System.exit(-1);;
    }
    /** Set the initial status for the window */
    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            File fp = new File(dataFile);
            doResetCommand();
            boolean delete = fp.delete();
            pid.destroy();
          }
        });

    doExeCommand();
    setSize(WIDTH, HEIGHT);
    setLocation(500, 0);
    setVisible(true);
  }
Beispiel #13
0
  public BoxOnTable() {
    super(windowTitle);
    int i;

    Runtime program = Runtime.getRuntime();
    Container content = getContentPane();

    /** Get current OS of the system. */
    if (System.getProperty("os.name").startsWith("Windows")) isWindows = true;
    else isWindows = false;
    /** Set interactive buttons for the user interface */
    JButton exitButton = new JButton("Exit");
    exitButton.setToolTipText("Exit the Program");

    JPanel mainPanel = new JPanel();

    content.add(mainPanel, BorderLayout.SOUTH);
    mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

    content.add(scrollPane, BorderLayout.CENTER);
    scrollPane.setBorder(BorderFactory.createLoweredBevelBorder());
    scrollPane.getViewport().add(textPane);

    mainPanel.add(exitButton, BorderLayout.CENTER);

    /** Set and view the source code on the frame */
    textPane.setEditable(false);
    textPane.setContentType("text/html; charset=EUC-JP");
    try {
      URL url = new URL("file:" + exampleSource);
      textPane.setPage(url);
    } catch (IOException ie) {
      System.err.println("Error in opening html source file " + ie);
      System.exit(-1);
    }

    exitButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            doExitCommand();
          }
        });

    /** Run the illustrated program */
    try {
      pid = program.exec(cmd);
    } catch (IOException ie) {
      System.err.println("Couldn't run " + ie);
      System.exit(-1);
    }
    /** Set the initial status for the window */
    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            pid.destroy();
          }
        });
    setSize(WIDTH, HEIGHT);
    setLocation(500, 0);
    setVisible(true);
  }