java.awt.CardLayout#show ( )源码实例Demo

下面列出了java.awt.CardLayout#show ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: sldeditor   文件: SymbolizerDetailsPanel.java
/**
 * Show panel for selected tree item.
 *
 * @param parentClass the parent class
 * @param classSelected the class selected
 */
@Override
public void show(Class<?> parentClass, Class<?> classSelected) {
    String key = null;
    if (classSelected != null) {
        key = classSelected.toString();
    } else {
        key = EMPTY_PANEL_KEY;
    }

    PopulateDetailsInterface panel = getPanel(parentClass, key);
    if (panel != null) {
        CardLayout cl = (CardLayout) (detailsPanel.getLayout());
        currentDisplayedPanel = encodePanelKey(key, panel);
        cl.show(detailsPanel, currentDisplayedPanel);

        SelectedSymbol selectedSymbol = SelectedSymbol.getInstance();
        panel.populate(selectedSymbol);
    }
    repaint();
}
 
源代码2 项目: mars-sim   文件: ResearcherPanel.java
/**
 * Sets the scientific study and researcher to display. If either parameter is
 * null, display blank pane.
 * 
 * @param study      the scientific study.
 * @param researcher the researcher.
 */
void setStudyResearcher(ScientificStudy study, Person researcher) {
	this.study = study;
	this.researcher = researcher;

	CardLayout cardLayout = (CardLayout) getLayout();
	if ((study == null) || (researcher == null)) {
		cardLayout.show(this, Msg.getString("ResearcherPanel.blank")); //$NON-NLS-1$
	} else {
		cardLayout.show(this, Msg.getString("ResearcherPanel.researcher")); //$NON-NLS-1$

		if (researcher.equals(study.getPrimaryResearcher())) {
			researcherHeader.setText(Msg.getString("ResearcherPanel.primaryResearcher")); //$NON-NLS-1$
			scienceLabel.setText(study.getScience().getName()); // $NON-NLS-1$
		} else {
			researcherHeader.setText(Msg.getString("ResearcherPanel.collaborativeResearcher")); //$NON-NLS-1$
			ScienceType collabScience = study.getCollaborativeResearchers().get(researcher.getIdentifier());
			scienceLabel.setText(collabScience.getName()); // $NON-NLS-1$
		}

		nameButton.setText(researcher.getName());

		update();
	}
}
 
源代码3 项目: sldeditor   文件: MapRender.java
/**
 * Data source loaded.
 *
 * @param geometryType the geometry type
 * @param isConnectedToDataSourceFlag the is connected to data source flag
 */
@Override
public void dataSourceLoaded(
        GeometryTypeEnum geometryType, boolean isConnectedToDataSourceFlag) {

    this.geometryType = geometryType;
    featureList = DataSourceFactory.getDataSource().getFeatureSource();

    userLayerFeatureListMap = DataSourceFactory.getDataSource().getUserLayerFeatureSource();
    gridCoverage = DataSourceFactory.getDataSource().getGridCoverageReader();

    calculateMapBounds();

    CardLayout cardLayout = (CardLayout) mapPanel.getLayout();

    if ((geometryType == GeometryTypeEnum.UNKNOWN) || !isConnectedToDataSourceFlag) {
        cardLayout.show(mapPanel, NOMAP_PANEL);
    } else {
        cardLayout.show(mapPanel, MAP_PANEL);

        internalRenderStyle();
    }
}
 
源代码4 项目: VanetSim   文件: SimulateControlPanel.java
/**
 * stop simulation
 */
public void stopSimulation(){
	CardLayout cl = (CardLayout)(startStopJPanel_.getLayout());
	cl.show(startStopJPanel_, "start"); //$NON-NLS-1$
	Runnable job = new Runnable() {
		public void run() {
			VanetSimStart.getSimulationMaster().stopThread();
		}
	};
	new Thread(job).start();	
	
	
}
 
源代码5 项目: ghidra   文件: MemoryMergePanel.java
private void create() {
	setLayout(new BorderLayout());

	JPanel boxPanel = new JPanel();
	boxPanel.setLayout(new BoxLayout(boxPanel, BoxLayout.Y_AXIS));

	cardLayout = new CardLayout();
	cardPanel = new JPanel(cardLayout);
	cardPanel.setBorder(BorderFactory.createTitledBorder("Resolve Block Conflict"));
	ChangeListener listener = new ChangeListener() {
		@Override
		public void stateChanged(ChangeEvent e) {
			mergeManager.setApplyEnabled(true);
		}
	};
	commentPanel = new CommentsConflictPanel(listener);
	cardPanel.add(commentPanel, COMMENT_PANEL_ID);

	namePanel = new BlockConflictPanel(listener);
	cardPanel.add(namePanel, CONFLICT_PANEL_ID);

	cardLayout.show(cardPanel, CONFLICT_PANEL_ID);

	countPanel = new ConflictCountPanel();
	boxPanel.add(countPanel);
	boxPanel.add(Box.createVerticalStrut(10));
	boxPanel.add(cardPanel);

	add(boxPanel, BorderLayout.CENTER);
	add(createUseForAllCheckBox(), BorderLayout.SOUTH);
}
 
源代码6 项目: TencentKona-8   文件: FileChooserDemo.java
@SuppressWarnings("LeakingThisInConstructor")
WizardDialog(JFrame frame, boolean modal) {
    super(frame, "Embedded JFileChooser Demo", modal);

    cardLayout = new CardLayout();
    cardPanel = new JPanel(cardLayout);
    getContentPane().add(cardPanel, BorderLayout.CENTER);

    messageLabel = new JLabel("", JLabel.CENTER);
    cardPanel.add(chooser, "fileChooser");
    cardPanel.add(messageLabel, "label");
    cardLayout.show(cardPanel, "fileChooser");
    chooser.addActionListener(this);

    JPanel buttonPanel = new JPanel();
    backButton = new JButton("< Back");
    nextButton = new JButton("Next >");
    closeButton = new JButton("Close");

    buttonPanel.add(backButton);
    buttonPanel.add(nextButton);
    buttonPanel.add(closeButton);

    getContentPane().add(buttonPanel, BorderLayout.SOUTH);

    backButton.setEnabled(false);
    getRootPane().setDefaultButton(nextButton);

    backButton.addActionListener(this);
    nextButton.addActionListener(this);
    closeButton.addActionListener(this);

    pack();
    setLocationRelativeTo(frame);
}
 
源代码7 项目: WorldGrower   文件: InventoryDialog.java
private void setPlayerCharacterPanelOnTop(ActionEvent e) {
	CardLayout cardLayout = (CardLayout) rootInventoryPanel.getLayout();
	cardLayout.show(rootInventoryPanel, "player");
	playercharacterToggleButton.setFont(Fonts.FONT);
	playercharacterToggleButton.setSelected(true);
	targetToggleButton.setFont(Fonts.FONT);
	targetToggleButton.setSelected(false);
}
 
源代码8 项目: openjdk-jdk8u   文件: FileChooserDemo.java
@SuppressWarnings("LeakingThisInConstructor")
WizardDialog(JFrame frame, boolean modal) {
    super(frame, "Embedded JFileChooser Demo", modal);

    cardLayout = new CardLayout();
    cardPanel = new JPanel(cardLayout);
    getContentPane().add(cardPanel, BorderLayout.CENTER);

    messageLabel = new JLabel("", JLabel.CENTER);
    cardPanel.add(chooser, "fileChooser");
    cardPanel.add(messageLabel, "label");
    cardLayout.show(cardPanel, "fileChooser");
    chooser.addActionListener(this);

    JPanel buttonPanel = new JPanel();
    backButton = new JButton("< Back");
    nextButton = new JButton("Next >");
    closeButton = new JButton("Close");

    buttonPanel.add(backButton);
    buttonPanel.add(nextButton);
    buttonPanel.add(closeButton);

    getContentPane().add(buttonPanel, BorderLayout.SOUTH);

    backButton.setEnabled(false);
    getRootPane().setDefaultButton(nextButton);

    backButton.addActionListener(this);
    nextButton.addActionListener(this);
    closeButton.addActionListener(this);

    pack();
    setLocationRelativeTo(frame);
}
 
源代码9 项目: pumpernickel   文件: QOptionPane.java
private JComponent createDebugPanel() {
	BufferedImage img = (BufferedImage) getClientProperty("debug.ghost.image");

	if (img == null)
		return this;

	final CardLayout cardLayout = new CardLayout();
	final JPanel panel = new JPanel(cardLayout);

	JPanel imagePanel = new JPanel();
	imagePanel.setUI(new PanelImageUI(img));

	JPanel paneWrapper = new JPanel(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.NONE;
	c.gridx = 0;
	c.gridy = 0;
	c.weightx = 1;
	c.weighty = 1;
	paneWrapper.add(this, c);

	panel.add(paneWrapper, "real");
	panel.add(imagePanel, "debug");

	Timer timer = new Timer(2000, new ActionListener() {
		public void actionPerformed(ActionEvent e) {
			String mode = (System.currentTimeMillis() % 4000) > 2000 ? "real"
					: "debug";
			cardLayout.show(panel, mode);
		}
	});
	timer.start();

	return panel;
}
 
源代码10 项目: jdk8u_jdk   文件: FileChooserDemo.java
@SuppressWarnings("LeakingThisInConstructor")
WizardDialog(JFrame frame, boolean modal) {
    super(frame, "Embedded JFileChooser Demo", modal);

    cardLayout = new CardLayout();
    cardPanel = new JPanel(cardLayout);
    getContentPane().add(cardPanel, BorderLayout.CENTER);

    messageLabel = new JLabel("", JLabel.CENTER);
    cardPanel.add(chooser, "fileChooser");
    cardPanel.add(messageLabel, "label");
    cardLayout.show(cardPanel, "fileChooser");
    chooser.addActionListener(this);

    JPanel buttonPanel = new JPanel();
    backButton = new JButton("< Back");
    nextButton = new JButton("Next >");
    closeButton = new JButton("Close");

    buttonPanel.add(backButton);
    buttonPanel.add(nextButton);
    buttonPanel.add(closeButton);

    getContentPane().add(buttonPanel, BorderLayout.SOUTH);

    backButton.setEnabled(false);
    getRootPane().setDefaultButton(nextButton);

    backButton.addActionListener(this);
    nextButton.addActionListener(this);
    closeButton.addActionListener(this);

    pack();
    setLocationRelativeTo(frame);
}
 
源代码11 项目: nordpos   文件: JPanelConfigHardware.java
private void jcboMachinePLUDeviceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcboMachinePLUDeviceActionPerformed
    CardLayout cl = (CardLayout) (m_jPLUParams.getLayout());
    if (jcboMachinePLUDevice.getSelectedItem().equals("extended")) {
        cl.show(m_jPLUParams, "extended");
    } else {
        cl.show(m_jPLUParams, "empty");
    }
}
 
源代码12 项目: pcgen   文件: DescriptionInfoTab.java
public void install()
{
	selectionModel.addListSelectionListener(this);
	currentPage.restoreModels();
	CardLayout pages = (CardLayout) pagePanel.getLayout();
	pages.show(pagePanel, currentPage.id);
}
 
源代码13 项目: VanetSim   文件: SimulateControlPanel.java
/**
 * starts simulation
 */
public void startSimulation(){
	if(VanetSimStart.getMainControlPanel().getEditPanel().getEditMode() == true) ErrorLog.log(Messages.getString("SimulateControlPanel.simulationNotPossibleInEditMode"), 6, this.getName(), "startSim", null); //$NON-NLS-1$ //$NON-NLS-2$
	else {
		CardLayout cl = (CardLayout)(startStopJPanel_.getLayout());
		cl.show(startStopJPanel_, "pause"); //$NON-NLS-1$
		VanetSimStart.getSimulationMaster().startThread();
	}		
}
 
源代码14 项目: mars-sim   文件: CreateMissionWizard.java
/** Go to previous wizard panel. */
public void buttonClickedPrev() {
	getCurrentWizardPanel().clearInfo();
	displayPanelIndex--;
	CardLayout layout = (CardLayout) infoPane.getLayout();
	layout.show(infoPane, getCurrentWizardPanel().getPanelName());
	nextButton.setEnabled(true);
	if (displayPanelIndex == 0) prevButton.setEnabled(false);
}
 
源代码15 项目: nordpos   文件: JPanelConfigHardware.java
private void jcboMachineDisplayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcboMachineDisplayActionPerformed
    CardLayout cl = (CardLayout) (m_jDisplayParams.getLayout());
    if (jcboMachineDisplay.getSelectedItem().equals("extended")) {
        cl.show(m_jDisplayParams, "extended");
    } else {
        cl.show(m_jDisplayParams, "empty");
    }
}
 
源代码16 项目: nordpos   文件: JPrincipalApp.java
private void showView(String sView) {
    CardLayout cl = (CardLayout) (m_jPanelContainer.getLayout());
    cl.show(m_jPanelContainer, sView);
}
 
源代码17 项目: nordpos   文件: JTicketsBagLocationMap.java
private void showView(String view) {
    CardLayout cl = (CardLayout) (getLayout());
    cl.show(this, view);
}
 
源代码18 项目: netbeans   文件: MavenRunOptions.java
private void loadOptions(ActionEvent e) {
    ActionToGoalMapping mapp = handle.getActionMappings((ModelHandle2.Configuration) cbConfiguration.getSelectedItem());
    List<NetbeansActionMapping> lst = mapp.getActions();
    run = null;
    debug = null;
    for (NetbeansActionMapping m : lst) {
        if (ActionProvider.COMMAND_RUN.equals(m.getActionName())) {
            run = m;
        }
        if (ActionProvider.COMMAND_DEBUG.equals(m.getActionName())) {
            debug = m;
        }
    }
    if (run == null) {
        run = ModelHandle2.getDefaultMapping(ActionProvider.COMMAND_RUN, project);
    }
    if (debug == null) {
        debug = ModelHandle2.getDefaultMapping(ActionProvider.COMMAND_DEBUG, project);
    }
    /*
    if (run == null) {
        // disable
        Queue<JComponent> comps = new ArrayDeque<>();
        comps.add(nestedOptions);
        while (!comps.isEmpty()) {
            JComponent c = comps.poll();
            c.setEnabled(false);
            if (c.getComponentCount() > 0) {
                Component[] children = c.getComponents();
                for (Component cc : children) {
                    if (cc instanceof JComponent) {
                        comps.offer((JComponent)cc);
                    }
                }
            }
        }
    } else {
        nestedOptions.readOptions(run.getProperties());
    }
    */
    CardLayout cl = (CardLayout)detailPanel.getLayout();
    if (run == null) {
        cl.show(detailPanel, "disabled");
    } else {
        nestedOptions.readOptions(run.getProperties());
        cl.show(detailPanel, "jshell");
    }
}
 
源代码19 项目: jpexs-decompiler   文件: PreviewPanel.java
private void showCardRight(String card) {
    CardLayout cl = (CardLayout) (displayWithPreview.getLayout());
    cl.show(displayWithPreview, card);
}
 
源代码20 项目: chipster   文件: ToolPanel.java
/**
 * Activate a certain card in the operation panel.
 * 
 * Currently you can choose between categorized operations and
 * a list of filtered operations.
 */
private void showOperationCard(String card) {
    CardLayout cl = (CardLayout)(operationCardPanel.getLayout());
    cl.show(operationCardPanel, card);
}