Package net.geco.live

Source Code of net.geco.live.ResultPanel

/**
* Copyright (c) 2010 Simon Denier
* Released under the MIT License (see LICENSE file)
*/
package net.geco.live;

import java.awt.BorderLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import net.geco.model.RunnerRaceData;
import net.geco.model.Status;
import net.geco.ui.basics.PunchPanel;


/**
* @author Simon Denier
* @since Sep 26, 2010
*
*/
public abstract class ResultPanel extends JPanel {

  protected PunchPanel punchP;
  protected JLabel statusL;

  public ResultPanel() {
    setLayout(new BorderLayout());
    initRunnerPanel();
    initPunchPanel();
  }

  protected abstract void initRunnerPanel();

  public abstract void updateRunnerData(RunnerRaceData runnerData);

  protected void updateStatusLabel(Status status) {
    statusL.setOpaque(true);
    statusL.setBackground( status.color() );
    statusL.setHorizontalAlignment(SwingConstants.CENTER);
    statusL.setText(status.toString());
  }

  protected void initPunchPanel() {
    punchP = new PunchPanel();
    add(punchP, BorderLayout.CENTER);
  }

}
TOP

Related Classes of net.geco.live.ResultPanel

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.