예제 #1
0
  public MainFrame() {
    setTitle(Labels.TITLE);
    setLayout(new GridLayout(5, 1));
    setResizable(false);
    setVisible(true);

    topLabel = new Label(Labels.TOP);
    topLabel.setBorder(FRAME_PADDING);
    add(topLabel);

    inputPanel = new InputPanel(Labels.IP, Labels.START_PORT, Labels.END_PORT);
    inputPanel.setBorder(FRAME_PADDING);
    add(inputPanel);

    buttonPanel = new ButtonPanel(Labels.SCAN, Labels.RESET);
    buttonPanel.setBorder(BUTTON_PADDING);
    add(buttonPanel);

    outputPanel = new OutputPanel();
    outputPanel.setBorder(FRAME_PADDING);
    add(outputPanel);

    bottomLabel = new Label(Labels.PRESS_SCAN);
    bottomLabel.setBorder(FRAME_PADDING);
    add(bottomLabel);

    setSize(FRAME_WIDTH, FRAME_HEIGHT);
    setLocationRelativeTo(null);
  }
예제 #2
0
 public void blockScanButton(boolean b) {
   buttonPanel.getScanButton().setEnabled(!b);
   String label = (b) ? Labels.STOP : Labels.RESET;
   buttonPanel.getResetButton().setLabel(label);
 }
예제 #3
0
 public JButton getResetButton() {
   return buttonPanel.getResetButton();
 }
예제 #4
0
 public JButton getScanButton() {
   return buttonPanel.getScanButton();
 }
예제 #5
0
 public boolean isStopButton() {
   return Labels.STOP.equals(buttonPanel.getResetButton().getText());
 }