/** Descripción de Método */ public void switchSingleRow() { if (m_onlyMultiRow) { return; } cardLayout.first(cardPanel); m_singleRow = true; dynamicDisplay(0); } // switchSingleRow
private void btnLogoutActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_btnLogoutActionPerformed if (preaparingAuth) return; int index = cboLoginMode.getSelectedIndex(); IAuthenticator l = IAuthenticator.LOGINS.get(index); CardLayout cl = (CardLayout) pnlPassword.getLayout(); if (l.isLoggedIn()) l.logout(); cl.first(pnlPassword); } // GEN-LAST:event_btnLogoutActionPerformed
/** Connect the vector of QV's into the main View */ public void installQVs() { Exam thisExam = theTD.curX; Vector qv = thisExam.getListData(); for (int i = 0; i < qv.size(); i++) { // Use question number (1-origin) as string name. // System.out.println("Add question " +i +" to " + questionsPanel); questionsPanel.add(Integer.toString(i + 1), new QView((Q) qv.elementAt(i))); } myCardLayout.first(questionsPanel); }
private void cboLoginModeItemStateChanged( java.awt.event.ItemEvent evt) { // GEN-FIRST:event_cboLoginModeItemStateChanged if (preaparingAuth) return; int index = cboLoginMode.getSelectedIndex(); if (index < 0) return; IAuthenticator l = IAuthenticator.LOGINS.get(index); if (l.isHidePasswordBox()) { pnlPassword.setVisible(false); lblUserName.setText(C.i18n("login.username")); } else { pnlPassword.setVisible(true); lblUserName.setText(C.i18n("login.account")); } CardLayout cl = (CardLayout) pnlPassword.getLayout(); if (l.isLoggedIn()) cl.last(pnlPassword); else cl.first(pnlPassword); String username = Settings.getInstance().getUsername(); if (StrUtils.isNotBlank(username)) txtPlayerName.setText(username); Settings.getInstance().setLoginType(index); } // GEN-LAST:event_cboLoginModeItemStateChanged
public Editor(JFrame parent, Evaluator evaluator) { super(parent, "Structure"); setModal(true); this.evaluator = evaluator; getContentPane().setLayout(new BorderLayout()); // name and type JPanel pNameType = new JPanel(new GridLayout(2, 1)); JPanel pName = new JPanel(new BorderLayout()); pName.add(new JLabel("Name: "), BorderLayout.WEST); tfName = new JTextField(evaluator.getName()); pName.add(tfName, BorderLayout.CENTER); pNameType.add(pName); JPanel pType = new JPanel(new BorderLayout()); pType.add(new JLabel("Type: "), BorderLayout.WEST); cbType = new JComboBox(types); cbType.setEditable(false); cbType.setSelectedIndex(evaluator.type); cbType.addItemListener(this); pType.add(cbType, BorderLayout.CENTER); pNameType.add(pType); getContentPane().add(pNameType, BorderLayout.NORTH); // options panel this.clOptions = new CardLayout(); this.pOptions = new JPanel(clOptions); JPanel pConstraintRoot = new JPanel(new BorderLayout()); Box pConstraintOpts = new Box(BoxLayout.Y_AXIS); JPanel pDiagonals = new JPanel(new BorderLayout()); cbDiagonals = new JCheckBox("Ignore Diagonals", evaluator.ignoreDiagonals); pDiagonals.add(cbDiagonals, BorderLayout.CENTER); pConstraintOpts.add(pDiagonals); JPanel pInvestment = new JPanel(new BorderLayout()); pInvestment.add(new Label("Investments "), BorderLayout.WEST); cbInvestment = new JComboBox(investments); cbInvestment.setEditable(false); cbInvestment.setSelectedIndex(evaluator.investments); pInvestment.add(cbInvestment, BorderLayout.CENTER); pConstraintOpts.add(pInvestment); JPanel pOrganization = new JPanel(new GridLayout(2, 1)); lOrgFileName = new JLabel("File: <none selected>"); pOrganization.add(lOrgFileName); JPanel pFileChoose = new JPanel(new FlowLayout(FlowLayout.CENTER)); JButton bFileChoose = new JButton("Choose File..."); bFileChoose.addActionListener(this); bFileChoose.setActionCommand(CMD_CHOOSE_FILE); pFileChoose.add(bFileChoose); pOrganization.add(pFileChoose); pConstraintOpts.add(pOrganization); pConstraintRoot.add(pConstraintOpts, BorderLayout.NORTH); pOptions.add(pConstraintRoot, types[CONSTRAINT]); JPanel pSizeRoot = new JPanel(new BorderLayout()); pOptions.add(pSizeRoot, types[EFFECTIVE_SIZE]); clOptions.first(pOptions); getContentPane().add(BorderLayout.CENTER, pOptions); // ok/cancel panel JOkCancelPanel okCancelPanel = new JOkCancelPanel(); okCancelPanel.addActionListener(this); getContentPane().add(BorderLayout.SOUTH, okCancelPanel); pack(); }