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); }
public void blockScanButton(boolean b) { buttonPanel.getScanButton().setEnabled(!b); String label = (b) ? Labels.STOP : Labels.RESET; buttonPanel.getResetButton().setLabel(label); }
public JButton getResetButton() { return buttonPanel.getResetButton(); }
public JButton getScanButton() { return buttonPanel.getScanButton(); }
public boolean isStopButton() { return Labels.STOP.equals(buttonPanel.getResetButton().getText()); }