Package com.barrybecker4.ui.table

Examples of com.barrybecker4.ui.table.BasicTableModel


        ButtonGroup buttonGroup = new ButtonGroup();
        consoleOutputButton_ = createRadioButton("CONSOLE");
        windowOutputButton_ = createRadioButton("SEPARATE_WINDOW");
        fileOutputButton_ = createRadioButton("THIS_FILE");

        p.add( new RadioButtonPanel( consoleOutputButton_, buttonGroup, true ) );
        p.add( new RadioButtonPanel( windowOutputButton_, buttonGroup, false ) );
        p.add( new RadioButtonPanel( fileOutputButton_, buttonGroup, false ) );
        logDestination_ = GameContext.getLogger().getDestination();
        switch (logDestination_) {
            case Log.LOG_TO_CONSOLE:
                consoleOutputButton_.setSelected( true );
                break;
View Full Code Here


     * initialize UI for server.
     */
    private void initUI(String gameName) {
        JPanel panel = new JPanel();
        JLabel label = new JLabel("Commands received over the socket:");
        textArea = new ScrollingTextArea(20, 44);

        panel.setLayout(new BorderLayout());
        panel.setBackground(Color.white);
        panel.add("North", label);
        JScrollPane scrollPane = new JScrollPane(textArea);
View Full Code Here

        }
    }

    @Override
    protected TableModel createTableModel(String[] columnNames) {
        return  new BasicTableModel(columnNames_, 0, false);
    }
View Full Code Here

        actionCol.setPreferredWidth(70);
    }

    @Override
    protected TableModel createTableModel(String[] columnNames) {
        return new BasicTableModel(columnNames, 0, true);
    }
View Full Code Here

        // + " found="+ found +  "  modelRows="+ model.getRowCount() +"   tables="+ model.getDataVector());
    }

    private void removeRowFromModel(OnlineGameTable table) {
        boolean found = false;
        BasicTableModel model = getPlayerModel();
        int ct = 0;
        while (ct < model.getRowCount() && !found)  {
            String names = (String) model.getValueAt(ct, PLAYER_NAMES_INDEX);
            if (names.equals(table.getPlayerNames())) {
                model.removeRow(ct);
                found = true;
            }
            ct++;
        }
    }
View Full Code Here

    /**
     * clear out all the rows in the table.
     */
    public void removeAllRows() {

        BasicTableModel m = this.getPlayerModel();
        for (int i = m.getRowCount() -1; i >= 0; i--) {
            m.removeRow(i);
        }
        tableList_.clear();
    }
View Full Code Here

     * indicating that they want to join that table.
     */
    public void joinDifferentTable(int joinRow) {

        System.out.println("in join different table. row="+ joinRow);
        BasicTableModel m = onlineGameTablesTable_.getPlayerModel();

        for (int i=0; i < m.getRowCount(); i++) {
            // you can join tables other than the one you are at as long as they are not already playing.
            boolean enableJoin = (i != joinRow) && !onlineGameTablesTable_.getGameTable(i).isReadyToPlay();
            m.setValueAt(enableJoin, i, 0);
        }
        connection_.joinTable(
            onlineGameTablesTable_.createPlayerForName(currentName_),
            onlineGameTablesTable_.getGameTable(joinRow));

View Full Code Here

    }


    @Override
    protected TableModel createTableModel(String[] columnNames)  {
        return  new BasicTableModel(columnNames, 0, false);
    }
View Full Code Here

        int[] selectedRows = table_.getSelectedRows();
        if (selectedRows.length == table_.getRowCount()) {
            JOptionPane.showMessageDialog(null, "You are not allowed to delete all the players!");
            return;
        }
        BasicTableModel model = (BasicTableModel)getModel();
        for (int i=nSelected-1; i>=0; i--) {
            int selRow = selectedRows[i];
            GameContext.log(0, "adding this to delete list:"
                    + model.getDataVector().elementAt(selRow).getClass().getName());
            deletedRows_.add((Vector)model.getDataVector().elementAt(selRow));
            model.removeRow(selRow);
        }
    }
View Full Code Here

        return (BasicTableModel) getModel();
    }

    @Override
    protected TableModel createTableModel(String[] columnNames) {
        return new BasicTableModel(columnNames, 0, true);
    }
View Full Code Here

TOP

Related Classes of com.barrybecker4.ui.table.BasicTableModel

Copyright © 2018 www.massapicom. 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.