當前位置: 首頁>>代碼示例>>Java>>正文


Java Choice.setEnabled方法代碼示例

本文整理匯總了Java中java.awt.Choice.setEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java Choice.setEnabled方法的具體用法?Java Choice.setEnabled怎麽用?Java Choice.setEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.Choice的用法示例。


在下文中一共展示了Choice.setEnabled方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: dialogItemChanged

import java.awt.Choice; //導入方法依賴的package包/類
@Override
public boolean dialogItemChanged(final GenericDialog gd, final java.awt.AWTEvent e) {

	protectRoot = gd.getNextBoolean();
	erodeIsolatedPixels = gd.getNextBoolean();
	pruneChoice = gd.getNextChoiceIndex();
	grayscaleImpChoice = gd.getNextChoiceIndex();
	outIS = gd.getNextBoolean();
	verbose = gd.getNextBoolean();
	tabular = gd.getNextBoolean();

	// Enable/Disable key components of GenericDialog
	if (!IJ.macroRunning()) {
		final Choice cImgChoice = (Choice) gd.getChoices().elementAt(1);
		final Vector<?> checkboxes = gd.getCheckboxes();
		final Checkbox roiOption = (Checkbox) checkboxes.elementAt(0);
		final Checkbox stackOption = (Checkbox) checkboxes.elementAt(2);

		cImgChoice.setEnabled(pruneChoice == AnalyzeSkeleton_.LOWEST_INTENSITY_VOXEL
				|| pruneChoice == AnalyzeSkeleton_.LOWEST_INTENSITY_BRANCH);
		roiOption.setEnabled(validRootRoi);
		stackOption.setEnabled(!tabular);

	}

	return !gd.wasCanceled();

}
 
開發者ID:tferr,項目名稱:hIPNAT,代碼行數:29,代碼來源:Strahler.java

示例2: dialogItemChanged

import java.awt.Choice; //導入方法依賴的package包/類
public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) {
	if (!DialogModifier.allNumbersValid(gd.getNumericFields()))
		return false;
	Vector<?> choices = gd.getChoices();
	Vector<?> checkboxes = gd.getCheckboxes();
	Vector<?> numbers = gd.getNumericFields();
	// link algorithm choice to chunk size field
	Choice choice = (Choice) choices.get(1);
	TextField num = (TextField) numbers.get(5);
	if (choice.getSelectedItem().contentEquals("Multithreaded")) {
		num.setEnabled(true);
	} else {
		num.setEnabled(false);
	}
	// link show stack 3d to volume resampling
	Checkbox box = (Checkbox) checkboxes.get(15);
	TextField numb = (TextField) numbers.get(4);
	if (box.getState()) {
		numb.setEnabled(true);
	} else {
		numb.setEnabled(false);
	}
	// link show surfaces, gradient choice and split value
	Checkbox surfbox = (Checkbox) checkboxes.get(11);
	Choice col = (Choice) choices.get(0);
	TextField split = (TextField) numbers.get(3);
	if (!surfbox.getState()) {
		col.setEnabled(false);
		split.setEnabled(false);
	} else {
		col.setEnabled(true);
		if (col.getSelectedIndex() == 1) {
			split.setEnabled(true);
		} else {
			split.setEnabled(false);
		}
	}
	DialogModifier.registerMacroValues(gd, gd.getComponents());
	return true;
}
 
開發者ID:akmaier,項目名稱:CONRAD,代碼行數:41,代碼來源:ConnectedComponent3D.java

示例3: setEnabledAll

import java.awt.Choice; //導入方法依賴的package包/類
void setEnabledAll(boolean value){
	for(Choice choice: choices){
		choice.setEnabled(value);
	}
	for(JTextField textField: playerTextFields){
		textField.setEnabled(value);
	}
	allChoice.setEnabled(value);
	setAllPlayers.setEnabled(value);
	newGame.setEnabled(value);
}
 
開發者ID:AngelaFabregues,項目名稱:dipGame,代碼行數:12,代碼來源:MainPanel.java

示例4: setRGB

import java.awt.Choice; //導入方法依賴的package包/類
private final void setRGB(final int imagejID, final Choice target)
{
	if (WindowManager.getImage(imagejID).getType() == ImagePlus.COLOR_RGB || WindowManager.getImage(imagejID).getType() == ImagePlus.COLOR_256)
		target.setEnabled(true);
	else		
		target.setEnabled(false);
}
 
開發者ID:fiji,項目名稱:Stitching,代碼行數:8,代碼來源:Stitching_2D.java

示例5: initComponents

import java.awt.Choice; //導入方法依賴的package包/類
private void initComponents() {
	
	setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
	setBounds(100, 100, 439, 337);
	contentPane = new JPanel();
	contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
	setContentPane(contentPane);
	contentPane.setLayout(null);
	
	txtUsuario = new JTextField();
	txtUsuario.setFont(new Font("Tahoma", Font.BOLD, 11));
	txtUsuario.setEditable(false);
	txtUsuario.setBounds(16, 36, 314, 23);
	contentPane.add(txtUsuario);
	txtUsuario.setColumns(10);
	
	JLabel lblUsuario = new JLabel("Usuario");
	lblUsuario.setBounds(16, 21, 61, 14);
	contentPane.add(lblUsuario);
	
	txtCodigo = new JTextField();
	txtCodigo.setFont(new Font("Tahoma", Font.BOLD, 11));
	txtCodigo.setEditable(false);
	txtCodigo.setBounds(16, 146, 314, 23);
	contentPane.add(txtCodigo);
	txtCodigo.setColumns(10);
	
	lblCodigo = new JLabel("Codigo ");
	lblCodigo.setBounds(16, 128, 126, 14);
	contentPane.add(lblCodigo);	
	
	lblfecha_prestDePrestamo = new JLabel("Fecha de pr\u00E9stamo");
	lblfecha_prestDePrestamo.setBounds(16, 193, 148, 14);
	contentPane.add(lblfecha_prestDePrestamo);
	
	btnBuscarCodigo = new JButton("...");
	btnBuscarCodigo.setBounds(346, 146, 61, 23);
	contentPane.add(btnBuscarCodigo);
	btnBuscarCodigo.setEnabled(false);
	btnBuscarCodigo.addActionListener(this);
	
	btnBuscarUsuario = new JButton("...");
	btnBuscarUsuario.setBounds(346, 35, 61, 23);
	contentPane.add(btnBuscarUsuario);
	btnBuscarUsuario.addActionListener(this);
	
	tipo = new Choice();
	tipo.setBounds(16, 91, 115, 20);
	tipo.add("Seleccione");
	tipo.add("Libro");
	tipo.add("Revista");
	tipo.add("CDROM");
	tipo.add("Articulo");
	tipo.setEnabled(false);
	tipo.addItemListener(this);
	contentPane.add(tipo);
	
	lblTipo = new JLabel("Tipo");
	lblTipo.setBounds(16, 71, 46, 14);
	contentPane.add(lblTipo);
	
	addWindowListener(this);
	setVisible(true);
	setLocationRelativeTo(null);
}
 
開發者ID:JuandeLS3,項目名稱:Library-app,代碼行數:66,代碼來源:NuevoPrestamo.java

示例6: getGUI

import java.awt.Choice; //導入方法依賴的package包/類
/**
 * Gets the GUI control for the NetMapReader, creates it if it
 * doesn't exist.
 */
public Component getGUI() {
    if (serverPanel != null) {
        return serverPanel;
    }

    serverAddrField = new JTextField(server);
    serverPortField = new JTextField(port);

    /*
     * Make the NETMAP Server address entry field
     */
    JPanel serverAddrPanel = new JPanel(new GridLayout(0, 2));
    serverAddrPanel.add(new JLabel("Name or IP Addr: "));
    serverAddrPanel.add(serverAddrField);
    /*
     * Make the NETMAP Server port entry field
     */
    JPanel serverPortPanel = new JPanel(new GridLayout(0, 2));
    serverPortPanel.add(new JLabel("Port: "));
    serverPortPanel.add(serverPortField);

    /*
     */
    JPanel statusPanel = PaletteHelper.createHorizontalPanel("Server Connection");
    connectedStatus = new JLabel(STATUS_IDLE);
    JButton resetButton = new JButton("Reset");
    resetButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            reset();
        }
    });

    statusPanel.add(connectedStatus);
    statusPanel.add(resetButton);

    /*
     * Make the toplevel input panel
     */
    //      JPanel netmapPanel = new JPanel(new GridLayout(0, 1));
    JPanel netmapPanel = PaletteHelper.createVerticalPanel("Server Settings");

    netmapPanel.add(serverAddrPanel);
    netmapPanel.add(serverPortPanel);

    /*
     * Make the "Load View" panel
     */
    viewChoice = new Choice();
    viewList = new ChoiceList();
    viewChoice.setEnabled(false);

    controlButton = new JButton(GetViewsCmd);
    controlButton.setActionCommand(GetViewsCmd);
    controlButton.addActionListener(this);

    //      JPanel viewPanel = new JPanel(new GridLayout(0, 1));
    JPanel viewPanel = PaletteHelper.createVerticalPanel(null);

    viewPanel.add(new JLabel("Available Views"));
    viewPanel.add(viewChoice);
    viewPanel.add(controlButton);

    serverPanel = new JPanel();
    Box box = Box.createVerticalBox();
    box.add(netmapPanel);
    box.add(statusPanel);
    box.add(viewPanel);
    serverPanel.add(box);

    return serverPanel;
}
 
開發者ID:d2fn,項目名稱:passage,代碼行數:76,代碼來源:NetMapConnector.java

示例7: setRGB

import java.awt.Choice; //導入方法依賴的package包/類
private final void setRGB(int imagejID, final Choice target)
{
	if (WindowManager.getImage(imagejID).getType() == ImagePlus.COLOR_RGB || WindowManager.getImage(imagejID).getType() == ImagePlus.COLOR_256) target.setEnabled(true);
	else target.setEnabled(false);
}
 
開發者ID:fiji,項目名稱:Stitching,代碼行數:6,代碼來源:Stitching_3D.java


注:本文中的java.awt.Choice.setEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。