public void updateComponents() {
    try {
      CardLayout cl = (CardLayout) (wizardPanelsContainer.getLayout());
      cl.show(wizardPanelsContainer, currentIndex + "");

      if (currentIndex == 0) {
        backButton.setEnabled(false);
      } else {
        backButton.setEnabled(true);
      }

      if (onLastPanel()) {
        nextButton.setEnabled(false);
        finishButton.setEnabled(true);
      } else {
        finishButton.setEnabled(false);
        nextButton.setEnabled(true);
      }
      // let panel to update itself
      getCurrentPanel().update();

      // inform PropertyChangeListeners
      PropertyChangeEvent event =
          new PropertyChangeEvent(
              this, WizardComponents.CURRENT_PANEL_PROPERTY, null, getCurrentPanel());
      propertyChangeListeners.firePropertyChange(event);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
 protected void showFirstPage() {
   if (tabbedPanel.getTabCount() <= 0) cardLayout.show(finalPanel, "FirstPanel");
   else {
     cardLayout.show(finalPanel, "TabbedPanel");
     tabbedPanel.setSelectedIndex(0);
   }
 }
  private void updateEditorText() {
    disposeNonTextEditor();

    final PsiElement elt = myElements[myIndex].getNavigationElement();
    Project project = elt.getProject();
    PsiFile psiFile = getContainingFile(elt);
    final VirtualFile vFile = psiFile.getVirtualFile();
    if (vFile == null) return;
    final FileEditorProvider[] providers =
        FileEditorProviderManager.getInstance().getProviders(project, vFile);
    for (FileEditorProvider provider : providers) {
      if (provider instanceof TextEditorProvider) {
        updateTextElement(elt);
        myBinarySwitch.show(myViewingPanel, TEXT_PAGE_KEY);
        break;
      } else if (provider.accept(project, vFile)) {
        myCurrentNonTextEditorProvider = provider;
        myNonTextEditor = myCurrentNonTextEditorProvider.createEditor(project, vFile);
        myBinaryPanel.removeAll();
        myBinaryPanel.add(myNonTextEditor.getComponent());
        myBinarySwitch.show(myViewingPanel, BINARY_PAGE_KEY);
        break;
      }
    }
  }
Beispiel #4
0
 private void accountActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_accountActionPerformed
   CardLayout card = (CardLayout) display.getLayout();
   admiinAccount1.vsetTextField();
   admiinAccount1.repaint();
   card.show(display, "account");
 } // GEN-LAST:event_accountActionPerformed
  private void SettingsOKButtonActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_SettingsOKButtonActionPerformed
    this.FieldParent.setText(NumberField.getText());

    CardLayout cl = (CardLayout) (Parent.GetCardManager().getLayout());
    cl.show(Parent.GetCardManager(), TargetCard);
  } // GEN-LAST:event_SettingsOKButtonActionPerformed
  private void backJButtonActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_backJButtonActionPerformed

    userProcessContainer.remove(this);
    CardLayout layout = (CardLayout) userProcessContainer.getLayout();
    layout.previous(userProcessContainer);
  } // GEN-LAST:event_backJButtonActionPerformed
Beispiel #7
0
 private void nextBtnActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_nextBtnActionPerformed
   // if (firstNameField.getText().isEmpty()) return;
   // if (custIDField.getText().isEmpty()) return;
   java.awt.CardLayout cl = (java.awt.CardLayout) cards.getLayout();
   cl.next(cards);
 } // GEN-LAST:event_nextBtnActionPerformed
Beispiel #8
0
    public void keyPressed(KeyEvent e) {
      if (e.getKeyCode() == KeyEvent.VK_P) {
        if (pauseFlag) { // eğer oyun pause halindeyse
          startTimer();
          pauseFlag = false;
          // pause paneli görünmez yap
          // pp.setVisible(false);

        } else { // oyun oynanırken P ye basılırsa/pause haline geçilirse
          stopTimer();
          pauseFlag = true;

          //        			CardLayout c1 = (CardLayout)(mgf.getCanvas().getLayout());
          //        			c1.show(mgf.getCanvas(), "Pause Panel");
          System.out.println("Paused by game manager");
        }
      }

      if (e.getKeyCode() == KeyEvent.VK_Q) {

        System.out.println("Q pressed");
        // oyunu pause lamak faln gerekeblir
        gm.resetGameLevel();
        gm.resetGamePoint();
        gm.initGame();

        CardLayout c2 = (CardLayout) (mgf.getCanvas().getLayout());
        c2.show(mgf.getCanvas(), "GUI");
      }
    }
 private void logoutManagerActionPerformed(java.awt.event.ActionEvent evt) {
   CardLayout card = (CardLayout) mainPanel.getLayout();
   card.show(mainPanel, "loginCard");
   userField.setText("");
   passField.setText("");
   sectionField.setText("");
 }
 /** Creates the layout of the panel (but the contents are not populated here). */
 private void createLayout() {
   GridBagConstraints gbc = new GridBagConstraints();
   CardLayout cardLayout = new CardLayout();
   mainPanel = new JPanel(cardLayout);
   mainPanel.setOpaque(false);
   noEntryPanel.setMessage(INFO_CTRL_PANEL_NO_SCHEMA_ITEM_SELECTED_LABEL.get());
   mainPanel.add(noEntryPanel, NOTHING_SELECTED);
   StatusGenericPanel[] panelsWithScroll = {
     standardObjectClassPanel,
     configurationObjectClassPanel,
     standardAttributePanel,
     configurationAttributePanel,
     matchingRulePanel,
     attributeSyntaxPanel
   };
   StatusGenericPanel[] panelsWithNoScroll = {customObjectClassPanel, customAttributePanel};
   for (StatusGenericPanel panel : panelsWithScroll) {
     mainPanel.add(Utilities.createBorderLessScrollBar(panel), panel.getTitle().toString());
   }
   for (StatusGenericPanel panel : panelsWithNoScroll) {
     mainPanel.add(panel, panel.getTitle().toString());
   }
   cardLayout.show(mainPanel, NOTHING_SELECTED);
   gbc.gridx = 0;
   gbc.gridy = 0;
   gbc.weightx = 1.0;
   gbc.weighty = 1.0;
   gbc.fill = GridBagConstraints.BOTH;
   add(mainPanel, gbc);
 }
 private void jButton1ActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton1ActionPerformed
   // TODO add your handling code here:
   upcJPanel.remove(this);
   CardLayout card = (CardLayout) upcJPanel.getLayout();
   card.previous(upcJPanel);
 } // GEN-LAST:event_jButton1ActionPerformed
  public void showCard(final String name, final Trait trait) {
    CardLayout layout = (CardLayout) innerPanel.getLayout();
    layout.show(innerPanel, name);
    boolean b = cardMap.get(name) instanceof TraitDetail;
    buttonsPanel.setVisible(b);

    TraitDetail newDetail = null;
    if (b) {
      newDetail = (TraitDetail) cardMap.get(name);
    }
    for (JComponent v : cardMap.values()) {
      if (v instanceof TraitDetail) {
        if (v != newDetail) {
          TraitDetail oldDetail = (TraitDetail) v;
          oldDetail.setActive(false);
        }
      }
    }
    if (newDetail != null) {
      newDetail.setActive(true);
    }

    selectedCard = name;
    selectedLabel.setText(selectedCard);
    if (trait == null) {
      traitNameLabel.setText("-");
    } else {
      if (abcPanel != null) {
        traitNameLabel.setText(
            trait.getName(abcPanel.abc).getName(abcPanel.abc.constants, null, false));
      }
    }
  }
 public void testCardLayout() throws Exception {
   JComponent rootComponent = getInstrumentedRootComponent("TestCardLayout.form", "BindingTest");
   assertTrue(rootComponent.getLayout() instanceof CardLayout);
   CardLayout cardLayout = (CardLayout) rootComponent.getLayout();
   assertEquals(10, cardLayout.getHgap());
   assertEquals(20, cardLayout.getVgap());
 }
 private void backButton4ActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_backButton4ActionPerformed
   // TODO add your handling code here:
   userProcessContainer.remove(this);
   CardLayout layout = (CardLayout) userProcessContainer.getLayout();
   layout.previous(userProcessContainer);
 } // GEN-LAST:event_backButton4ActionPerformed
 public void actionPerformed(ActionEvent e) {
   if (e.getSource() == ctl) {
     this.menu();
   } else if (e.getSource() == exit) {
     exitPerform();
   } else if (e.getSource() == rank) {
     if (count != 0) {
       card.show(mainPanel, "four");
       rankPanel.setMemory(memory, count - 1);
       buttonPanel.removeAll();
       buttonPanel.setBounds(width - 200, height - 80, 190, 50);
       buttonPanel.add(exit);
       check = 4;
       count--;
     }
   } else if (e.getSource() == back) {
     if (secondPanel.clip != null) {
       secondPanel.clip.stop();
       System.out.printf("test");
     }
     check = 0;
     card.previous(mainPanel);
     buttonPanel.removeAll();
     ctl.setText("- Play -");
     buttonPanel.add(ctl);
     buttonPanel.add(rank);
     buttonPanel.add(exit);
     buttonPanel.setOpaque(false);
     buttonPanel.setBounds(width / 2 - 50, height / 2 - 50, 80, 100);
   }
 }
Beispiel #16
0
  @Override
  public void actionPerformed(ActionEvent arg0) {
    ArrayList<Bullet> bs = boat.getBulletsList();

    for (int i = 0; i < bs.size(); i++) {
      Bullet b = (Bullet) bs.get(i);
      if (b.isVisible()) b.move();
      else bs.remove(i);
    }

    for (int i = 0; i < buoys.size(); i++) {
      Buoy b = (Buoy) buoys.get(i);
      if (!(b.isVisible())) {
        gamePoint += b.getPoint();
        buoys.remove(i);
        // System.out.println("Remaining Buoys: " + buoys.size());
      }
    }

    for (int i = 0; i < bonuses.size(); i++) {
      Bonus b = (Bonus) bonuses.get(i);
      if (!(b.isVisible())) {
        gamePoint += b.getPoint();
        bonuses.remove(i);
      }
    }
    // level olayı burada hallediliyor!!
    // en son level kalmadığında highscore' a bak yazdır
    if (nextLevelFlag) {
      System.out.println("next Level a geçtin");
      currentLevel++;
      System.out.println("level: " + currentLevel);
      initGame(); // oyunu restart edecek
      nextLevelFlag = false;
      if (currentLevel
          > LAST_LEVEL) { // tüm levellar bittikten sonra terminate/ana menüye dönüş, tam bu anda
                          // high score yazdır. Ancak oyunu bitirenler highscore table a girmeye hak
                          // kazanır.
        // High scores to table
        try {
          writeHighScoreToFile(computeTotalScore());
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
        currentLevel = 1;
        gamePoint = 0;
        initGame();
        CardLayout c2 = (CardLayout) (mgf.getCanvas().getLayout());
        c2.show(mgf.getCanvas(), "GUI");
        // System.exit(0);
      }
    } else {

    }

    boat.move();
    checkCollisions();
    repaint();
  }
  protected void showErrorPage(final ErrorInfo info) {
    storeState();
    hideProgress();
    myRootComponent = null;

    myErrorMessages.removeAll();

    if (info.myShowStack) {
      info.myMessages.add(
          0, new FixableMessageInfo(true, info.myDisplayMessage, "", "", null, null));

      ByteArrayOutputStream stream = new ByteArrayOutputStream();
      info.myThrowable.printStackTrace(new PrintStream(stream));
      myErrorStack.setText(stream.toString());
      myErrorStackLayout.show(myErrorStackPanel, ERROR_STACK_CARD);
    } else {
      myErrorStack.setText(null);
      myErrorStackLayout.show(myErrorStackPanel, ERROR_NO_STACK_CARD);
    }

    for (FixableMessageInfo message : info.myMessages) {
      addErrorMessage(
          message, message.myErrorIcon ? Messages.getErrorIcon() : Messages.getWarningIcon());
    }

    myErrorPanel.revalidate();
    myLayout.show(this, ERROR_CARD);

    DesignerToolWindowManager.getInstance(getProject()).refresh(true);
    repaint();
  }
 public void actionPerformed(ActionEvent e) {
   CardLayout cards = (CardLayout) content.getLayout();
   cards.show(content, "Score");
   int z = getscore() * 10;
   String j = String.valueOf(z);
   lblNewLabel_1.setText(j);
 }
    public void actionPerformed(ActionEvent e) {
      String UCID = textField.getText();
      String Password = String.valueOf(passwordField.getPassword());
      if (!UCID.isEmpty() && !Password.isEmpty()) {
        Person p = new Person();
        p.UCID = UCID;
        p.Password = Password;
        Client cl = new Client();
        String Send = "start" + "|" + Person.ConvertToString(p);
        System.out.println(Send);
        String Receive = cl.login(Send);
        label.setText(p.UCID);
        System.out.println(Receive);
        String[] msg = Receive.split("\\|");
        if (msg[0].equalsIgnoreCase("confirm")) {
          CardLayout cards = (CardLayout) contentPane.getLayout();
          cards.show(contentPane, "student");

          i = 1;
          String j = String.valueOf(i);
          Question c = new Question();
          Send = "question" + "|" + i;
          System.out.println(Send);
          Receive = cl.login(Send);
          c = Question.ConverToObject(Receive);
          textPane.setText(c.Question);
          answerTF[i - 1] = c.Answer;
        }
      }
    }
 /**
  * switch to visible video or image panel
  *
  * @param showVideo true if video panel, false if image panel
  */
 private void switchPanels(boolean showVideo) {
   CardLayout layout = (CardLayout) this.getLayout();
   if (showVideo) {
     layout.show(this, VIDEO_VIEWER_LAYER);
   } else {
     layout.show(this, IMAGE_VIEWER_LAYER);
   }
 }
  private void manageNetworkJButtonActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_manageNetworkJButtonActionPerformed

    ManageNetworkJPanel manageNetworkJPanel = new ManageNetworkJPanel(userProcessContainer, system);
    userProcessContainer.add("manageNetworkJPanel", manageNetworkJPanel);
    CardLayout layout = (CardLayout) userProcessContainer.getLayout();
    layout.next(userProcessContainer);
  } // GEN-LAST:event_manageNetworkJButtonActionPerformed
 /**
  * Retrieves the currently selected legend in the tree and shows the corresponding dialog in the
  * card layout; shows the empty panel if no legend is selected.
  */
 protected void showDialogForCurrentlySelectedLegend() {
   ISELegendPanel selected = legendTree.getSelectedPanel();
   if (selected != null) {
     cardLayout.show(dialogContainer, selected.getId());
   } else {
     cardLayout.show(dialogContainer, NO_LEGEND_ID);
   }
 }
Beispiel #23
0
 public void actionPerformed(ActionEvent e) {
   if (e.getSource() == unknow) {
     cl.show(this.getContentPane(), "2");
   }
   if (e.getSource() == friend1) {
     cl.show(this.getContentPane(), "1");
   }
 }
 private void viewStatusjButtonActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_viewStatusjButtonActionPerformed
   // TODO add your handling code here:
   ViewStatusJPanel vsjp = new ViewStatusJPanel(userProcessContainer, system, nn);
   userProcessContainer.add("ViewStatusJPanel", vsjp);
   CardLayout layout = (CardLayout) userProcessContainer.getLayout();
   layout.next(userProcessContainer);
 } // GEN-LAST:event_viewStatusjButtonActionPerformed
 private void manageEntAdminBtnActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_manageEntAdminBtnActionPerformed
   // TODO add your handling code here:
   ManageEnterpriseAdminJPanel meajp = new ManageEnterpriseAdminJPanel(upc, system);
   upc.add("ManageEnterpriseAdminJPanel", meajp);
   CardLayout layout = (CardLayout) upc.getLayout();
   layout.next(upc);
 } // GEN-LAST:event_manageEntAdminBtnActionPerformed
 private void addPatientJButtonActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_addPatientJButtonActionPerformed
   // TODO add your handling code here:
   AddPatient ap = new AddPatient(userProcessContainer, enterprise);
   userProcessContainer.add("Add Patient", ap);
   CardLayout layout = (CardLayout) userProcessContainer.getLayout();
   layout.next(userProcessContainer);
 } // GEN-LAST:event_addPatientJButtonActionPerformed
 private void jButton2ActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton2ActionPerformed
   DoctorHomepageAreaJPanel doctorReportMedicationJPanel =
       new DoctorHomepageAreaJPanel(container, ua, o, e, ecoSystem);
   CardLayout cl = (CardLayout) container.getLayout();
   container.add("doctorReportMedicationJPanel", doctorReportMedicationJPanel);
   cl.next(container);
 } // GEN-LAST:event_jButton2ActionPerformed
Beispiel #28
0
 @Override
 public void mouseClicked(MouseEvent e) {
   // TODO Auto-generated method stub
   if (e.getSource() == login.b1) { // double click event
     card.show(getContentPane(), "WR");
   } else if (e.getSource() == login.b2) {
     card.show(getContentPane(), "");
   }
 }
  private void manageOrganizationJButtonActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_manageOrganizationJButtonActionPerformed

    ManageOrganizationJPanel manageOrganizationJPanel =
        new ManageOrganizationJPanel(userProcessContainer, enterprise.getOrganizationDirectory());
    userProcessContainer.add("manageOrganizationJPanel", manageOrganizationJPanel);
    CardLayout layout = (CardLayout) userProcessContainer.getLayout();
    layout.next(userProcessContainer);
  } // GEN-LAST:event_manageOrganizationJButtonActionPerformed
 private void manageAdminJButtonActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_manageAdminJButtonActionPerformed
   // TODO add your handling code here:
   ManageEnterpriseAdminJPanel manageEnterpriseAdminJPanel =
       new ManageEnterpriseAdminJPanel(userProcessContainer, system);
   userProcessContainer.add("manageEnterpriseAdminJPanel", manageEnterpriseAdminJPanel);
   CardLayout layout = (CardLayout) userProcessContainer.getLayout();
   layout.next(userProcessContainer);
 } // GEN-LAST:event_manageAdminJButtonActionPerformed