Пример #1
0
 public void updateTabSize(int tabSize) {
   miniMapPanel.updateTabSize(tabSize);
 }
Пример #2
0
 @Override
 public void setForeground(Color fg) {
   miniMapPanel.setForeground(fg);
 }
Пример #3
0
 public void setHighlightColor(Color c) {
   miniMapPanel.setHighlightColor(c);
 }
Пример #4
0
 @Override
 public void setBackground(Color bg) {
   miniMapPanel.setBackground(bg);
 }
Пример #5
0
  public MainScreenPanel() {
    this.setSize(800, 600);
    this.setLayout(null);
    this.setVisible(true);
    Crowcing.bomb = new JButton("BOMB!");
    Crowcing.boost = new JButton("BOOST!");
    // racingPanel.setPreferredSize(new Dimension(600,600));
    Crowcing.bomb.setFont(new Font("Dialog", 1, 18));
    Crowcing.boost.setFont(new Font("Dialog", 1, 18));
    chatPanel.setBounds(600, 0, 200, 600);
    miniMapPanel.setBounds(500, 0, 100, 100);
    racingPanel.setBounds(0, 0, 800, 600);
    Crowcing.bomb.setBounds(25, 525, 100, 25);
    Crowcing.boost.setBounds(25, 450, 125, 25);
    Crowcing.whitePanel.setBounds(0, 0, 800, 600);
    Crowcing.whitePanel.setBackground(Color.WHITE);
    // whitePanel.setOpacity(0f);

    id = (int) (Math.random() * (9999 - 1000 + 1) + 1000);

    Socket s;

    try {
      s = new Socket("172.20.10.3", 2232);
      br = new BufferedReader(new InputStreamReader(s.getInputStream()));
      pw = new PrintWriter(s.getOutputStream());
      Crowcing.bomb.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              pw.println("BOMB!" + id);
              pw.flush();
              //					Crowcing.whitePanel.setVisible(true);
              if (RacingPanel.chosenID > RacingPanel.opponentID) {
                RacingPanel.carThread2.reduceCurrentSpeed(10);
              } else {
                RacingPanel.carThread.reduceCurrentSpeed(10);
              }
              Crowcing.bomb.setEnabled(false);
              //					timer.start();
              cooldown.start();
            }
          });
    } catch (IOException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }

    cooldown =
        new Timer(
            10000,
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                Crowcing.bomb.setEnabled(true);
                ((Timer) e.getSource()).stop();
              }
            });

    this.add(racingPanel);
    this.add(chatPanel);
    this.add(miniMapPanel);
  }