001    /*
002     * Copyright (C) 2008 Adam Cornett This program is free software; you can
003     * redistribute it and/or modify it under the terms of the GNU General Public
004     * License as published by the Free Software Foundation; either version 3 of the
005     * License, or (at your option) any later version. This program is distributed
006     * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
007     * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
008     * See the GNU General Public License for more details. You should have received
009     * a copy of the GNU General Public License along with this program; if not, see
010     * <http://www.gnu.org/licenses>.
011     */
012    
013    package net.codescore.ui.scoreboard;
014    
015    import java.util.List;
016    
017    import org.zkoss.zul.Window;
018    
019    import net.codescore.dbo.Competition;
020    import net.codescore.dbo.Team;
021    import net.codescore.ui.components.list.ZKObjectList;
022    import net.codescore.ui.components.list.renderers.ScoreboardRenderer;
023    import net.codescore.ui.i18n.Style;
024    
025    public abstract class ScoreBoard extends Window {
026            protected final Competition comp;
027            protected final ZKObjectList<Team> teamList;
028    
029            public ScoreBoard(Competition c) {
030                    setWidth(Style.getString("bigWidth"));
031                    comp = c;
032                    teamList = new ZKObjectList<Team>();
033                    final ScoreboardRenderer renderer =
034                            new ScoreboardRenderer(teamList, comp);
035                    teamList.initRenderer(renderer);
036                    final List<Team> teams = comp.getTeams();
037                    teamList.initListModel(teams);
038                    teamList.setParent(this);
039            }
040    
041            public void onCreate() {
042    
043            }
044    }