Example usage for java.awt CardLayout show

List of usage examples for java.awt CardLayout show

Introduction

In this page you can find the example usage for java.awt CardLayout show.

Prototype

public void show(Container parent, String name) 

Source Link

Document

Flips to the component that was added to this layout with the specified name , using addLayoutComponent .

Usage

From source file:org.nekorp.workflow.desktop.view.ServicioView.java

private void presupuestoSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_presupuestoSelectorActionPerformed
    java.awt.CardLayout cardLayout = (java.awt.CardLayout) (datos.getLayout());
    cardLayout.show(datos, "presupuesto");
    servicioMetaData.getServicioActual().getPreferenciasEdicion().setCurrentTab("presupuesto");
}

From source file:org.nekorp.workflow.desktop.view.ServicioView.java

private void inventarioSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inventarioSelectorActionPerformed
    java.awt.CardLayout cardLayout = (java.awt.CardLayout) (datos.getLayout());
    cardLayout.show(datos, "inventario");
    servicioMetaData.getServicioActual().getPreferenciasEdicion().setCurrentTab("inventario");
}

From source file:org.nekorp.workflow.desktop.view.ServicioView.java

private void cobranzaSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cobranzaSelectorActionPerformed
    java.awt.CardLayout cardLayout = (java.awt.CardLayout) (datos.getLayout());
    cardLayout.show(datos, "cobranza");
    servicioMetaData.getServicioActual().getPreferenciasEdicion().setCurrentTab("cobranza");
}

From source file:megacasting.view.StatistiqueForm.java

private void buttonAccueilActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAccueilActionPerformed
    // TODO add your handling code here:
    // On renvoi sur l'accueil
    CardLayout cl = (CardLayout) mainJFrame.mainPanel.getLayout();
    cl.show(mainJFrame.mainPanel, "accueilCard");
}

From source file:org.nekorp.workflow.desktop.view.ServicioView.java

public void bindComponents() {
    //bindings al metatada del servicio
    bindingManager.registerBind(servicioMetaData, "servicioCargado", new ReadOnlyBinding() {
        @Override/*from   w  w  w.j ava  2  s .c om*/
        public void notifyUpdate(Object origen, String property, Object value) {
            boolean cargado = (boolean) value;
            setEditableStatus(cargado);
        }
    });
    this.bindingManager.registerBind(servicioMetaData, "servicioActual", new ReadOnlyBinding() {
        @Override
        public void notifyUpdate(Object origen, String property, Object value) {
            ServicioLoaded servicio = (ServicioLoaded) value;
            if (servicio == null) {
                return;
            }
            java.awt.CardLayout cardLayout = (java.awt.CardLayout) (datos.getLayout());
            cardLayout.show(datos, servicio.getPreferenciasEdicion().getCurrentTab());
            switch (servicio.getPreferenciasEdicion().getCurrentTab()) {
            case "cliente":
                clienteSelector.setSelected(true);
                break;
            case "auto":
                autoSelector.setSelected(true);
                break;
            case "bitacora":
                bitacoraSelector.setSelected(true);
                break;
            case "presupuesto":
                presupuestoSelector.setSelected(true);
                break;
            case "inventario":
                inventarioSelector.setSelected(true);
                break;
            case "cobranza":
                cobranzaSelector.setSelected(true);
                break;
            }
        }
    });
    bindingManager.registerBind(viewServicioModel.getBitacora(), "eventos", (Bindable) this.bitacora);
    //bindings con el metadata del servicio
    bindingManager.registerBind(servicioMetaData, "editado", (Bindable) this.guardarServicio);
    bindingManager.registerBind(servicioMetaData, "servicioCargado", (Bindable) this.ordenServicio);
    //bindingManager.registerBind(servicioMetaData, "tieneUndo", (Bindable)this.deshacer);
    //bindingManager.registerBind(servicioMetaData, "tieneRedo", (Bindable)this.rehacer);
}

From source file:org.p_vcd.ui.VcdDialog.java

private void previousButton() {
    if (currentStep > 1) {
        currentStep--;/*from w  w  w  . j ava  2s.  c  om*/
        CardLayout cl = (CardLayout) contentPanel.getLayout();
        cl.show(contentPanel, "card_step" + currentStep);
    }
}

From source file:org.p_vcd.ui.VcdDialog.java

private void nextButton() {
    if (currentStep < 4) {
        if (validateCurrentStep()) {
            currentStep++;//from  www  .j  a v  a2 s .com
            CardLayout cl = (CardLayout) contentPanel.getLayout();
            cl.show(contentPanel, "card_step" + currentStep);
        }
    } else if (currentStep == 4) {
        if (currentSearch == null || currentSearch.hasEnded()) {
            textConsole.setText("");
            this.sbOutput = new StringBuffer();
            ProcessOptions options = null;
            if (radio_searchByGlobal.isSelected()) {
                options = ProcessOptions.getDefaultGlobalOptions();
            } else if (radio_searchByLocal.isSelected()) {
                options = ProcessOptions.getDefaultLocalOptions();
            }
            List<VideoDatabase> selectedRefDbs = getSelectedRefDbs();
            this.currentSearch = new ProcessVCD(selectedRefDbs, radio_queryFile.isSelected() ? queryFile : null,
                    radio_queryUrl.isSelected() ? queryUrl : null, radio_queryDb.isSelected() ? queryDb : null,
                    options);
            this.currentSearch.asyncRun(this);
        }
    }
}

From source file:org.p_vcd.ui.VcdDialog.java

private void drawDetectionResult() {
    panelResults.removeAll();//www. j  a v  a2 s  .c om
    if (this.resultDetections == null || this.resultDetections.size() == 0) {
        JLabel ll1 = new JLabel("Search did not produce any result!");
        ll1.setFont(new Font("Tahoma", Font.PLAIN, 14));
        JLabel ll2 = new JLabel("Press the 'Previous' button and try with other parameters.");
        ll2.setFont(new Font("Tahoma", Font.PLAIN, 14));
        panelResults.add(ll1, "cell 0 0 3 1");
        panelResults.add(ll2, "cell 0 1 3 1");
    } else {
        JLabel lblQ = new JLabel("Query Video");
        lblQ.setFont(new Font("Tahoma", Font.BOLD, 13));
        JLabel lblR = new JLabel("Original Video");
        lblR.setFont(new Font("Tahoma", Font.BOLD, 13));
        panelResults.add(lblQ, "cell 1 0");
        panelResults.add(lblR, "cell 2 0");
        for (int i = 0; i < this.resultDetections.size(); ++i) {
            VideoCopy vc = this.resultDetections.get(i);
            final int rowPos = i + 1;
            JButton butt = new JButton("<html><body style='width:100%;text-align:center'>Watch Video Copy<br>("
                    + vc.getLengthTxt() + " length)");
            // butt.setHorizontalAlignment(SwingConstants.CENTER);
            butt.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    launchCopy("" + rowPos);
                }
            });
            JLabel timQ = new JLabel("<html><body style='width:100%;text-align:center'>"
                    + vc.getVideoQ().getFilename() + "<br><i>" + vc.getFromQtxt() + " - " + vc.getToQtxt());
            JLabel timR = new JLabel("<html><body style='width:100%;text-align:center'>"
                    + vc.getVideoR().getFilename() + "<br><i>" + vc.getFromRtxt() + " - " + vc.getToRtxt());
            panelResults.add(butt, "cell 0 " + rowPos);
            panelResults.add(timQ, "cell 1 " + rowPos);
            panelResults.add(timR, "cell 2 " + rowPos);
        }
    }
    panelResults.validate();
    currentStep = 5;
    CardLayout cl = (CardLayout) contentPanel.getLayout();
    cl.show(contentPanel, "card_step" + currentStep);
}

From source file:be.ugent.maf.cellmissy.gui.controller.analysis.singlecell.SingleCellAnalysisController.java

/**
 * Initialize main view.// w  ww.j  a  v a 2s  . co  m
 */
private void initAnalysisPanel() {
    // make a new panel
    analysisPanel = new AnalysisPanel();
    //create a ButtonGroup for the radioButtons used for analysis
    ButtonGroup radioButtonGroup = new ButtonGroup();
    radioButtonGroup.add(analysisPanel.getCellTracksRadioButton());
    radioButtonGroup.add(analysisPanel.getCellSpeedRadioButton());
    radioButtonGroup.add(analysisPanel.getStatisticsRadioButton());

    /**
     * Add action listeners
     */
    // plot the cell tracks
    analysisPanel.getCellTracksRadioButton().addActionListener((ActionEvent e) -> {
        // get the layout from the bottom panel and show the appropriate one
        CardLayout layout = (CardLayout) analysisPanel.getBottomPanel().getLayout();
        layout.show(analysisPanel.getBottomPanel(), analysisPanel.getCellTracksPanel().getName());
        plotCellTracks();
    });

    // 
    analysisPanel.getCellSpeedRadioButton().addActionListener((ActionEvent e) -> {
        // get the layout from the bottom panel and show the appropriate one
        CardLayout layout = (CardLayout) analysisPanel.getBottomPanel().getLayout();
        layout.show(analysisPanel.getBottomPanel(), analysisPanel.getCellSpeedsPanel().getName());
        // take care of data and plots here
        plotData();
    });

    // go to the statistics
    analysisPanel.getStatisticsRadioButton().addActionListener((ActionEvent e) -> {
        // get the layout from the bottom panel and show the appropriate one
        CardLayout layout = (CardLayout) analysisPanel.getBottomPanel().getLayout();
        layout.show(analysisPanel.getBottomPanel(), analysisPanel.getStatisticsParentPanel().getName());
        singleCellStatisticsController.updateConditionList();
    });

    analysisPanel.getCellTracksRadioButton().setSelected(true);
    AlignedTableRenderer alignedTableRenderer = new AlignedTableRenderer(SwingConstants.LEFT);
    for (int i = 0; i < analysisPanel.getDataTable().getColumnModel().getColumnCount(); i++) {
        analysisPanel.getDataTable().getColumnModel().getColumn(i).setCellRenderer(alignedTableRenderer);
    }
    analysisPanel.getDataTable().getTableHeader()
            .setDefaultRenderer(new TableHeaderRenderer(SwingConstants.LEFT));

    // add view to parent panel
    singleCellMainController.getSingleCellAnalysisPanel().getAnalysisParentPanel().add(analysisPanel,
            gridBagConstraints);
}

From source file:de.cismet.cids.custom.objecteditors.utils.VermessungUmleitungPanel.java

/**
 * DOCUMENT ME!//  w  w  w . ja  va  2s . c o m
 */
private void showError() {
    editor.handleNoDocumentFound();
    final CardLayout cl = (CardLayout) pnlControls.getLayout();
    cl.show(pnlControls, "card4");
}