当前位置: 首页>>代码示例>>Java>>正文


Java WebComboBox类代码示例

本文整理汇总了Java中com.alee.laf.combobox.WebComboBox的典型用法代码示例。如果您正苦于以下问题:Java WebComboBox类的具体用法?Java WebComboBox怎么用?Java WebComboBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WebComboBox类属于com.alee.laf.combobox包,在下文中一共展示了WebComboBox类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import com.alee.laf.combobox.WebComboBox; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
	MediaStatus status = (MediaStatus) ((WebComboBox) e.getSource()).getSelectedItem();
	switch (status) {
		case PLAN_TO_WATCH:
			episodesWatched.setValue(0);
			episodesWatched.setEnabled(false);
			startDate.setEnabled(false);
			endDate.setEnabled(false);
			disableClearButtons();
			break;
		case WATCHING:
			episodesWatched.setEnabled(true);
			startDate.setEnabled(true);
			endDate.setEnabled(false);
			enableClearButtons(); // TODO disable endDate clear button
			break;
		case DROPPED:
			episodesWatched.setEnabled(true);
			startDate.setEnabled(true);
			endDate.setEnabled(true);
			enableClearButtons();
			break;
		case COMPLETED:
			episodesWatched.setValue(maxEpisodes.getValue());
			episodesWatched.setEnabled(false);
			startDate.setEnabled(true);
			endDate.setEnabled(true);
			enableClearButtons();
			break;
	}
}
 
开发者ID:DiscoElevator,项目名称:MyMediaList,代码行数:33,代码来源:StatusChangeListener.java

示例2: ButtonListener

import com.alee.laf.combobox.WebComboBox; //导入依赖的package包/类
/**
 * The class constructor. Initialise object variables.
 *
 * @param aCanvas The main canvas object.
 * @param pencilToolButton The draw button from the toolbar.
 * @param undoToolButton The undo button from the toolbar.
 * @param redoToolButton The redo button from the toolbar.
 * @param clearToolButton The clear canvas button from the toolbar.
 * @param aComboBox The colour picker from the toolbar.
 * @param lineCombo The line thickness combo box from the toolbar.
 * @param aSquareRadio The square footprint radio button from the toolbar.
 * @param aCircleRadio The circle footprint radio button from the toolbar.
 * @param cursor The cursor of the application.
 * @param drawableLine The Drawable object.
 * @param drawableCircle The Drawable object.
 * @param drawableSquare The Drawable object.
 * @param drawableEllipse The Drawable object.
 * @param drawableTriangle The Drawable object.
 * @param image The image button initialiser.
 */
public ButtonListener(DrawCanvas aCanvas, JButton pencilToolButton,
        JButton undoToolButton, JButton redoToolButton,
        JButton clearToolButton, WebColorChooserField aComboBox,
        WebComboBox lineCombo, JRadioButton aSquareRadio,
        JRadioButton aCircleRadio, Image cursor,
        WebToggleButton drawableLine, WebToggleButton drawableCircle,
        WebToggleButton drawableSquare, WebToggleButton drawableEllipse,
        WebToggleButton drawableTriangle, JButton image) {
    this.aCanvas = aCanvas;
    this.pencilToolButton = pencilToolButton;
    this.undoToolButton = undoToolButton;
    this.redoToolButton = redoToolButton;
    this.clearToolButton = clearToolButton;
    
    this.colorComboBox = aComboBox;
    this.lineComboBox = lineCombo;
    this.radioSquare = aSquareRadio;
    this.radioCircle = aCircleRadio;
    this.cursor = cursor;
    
    this.drawableLine = drawableLine;
    this.drawableCircle = drawableCircle;
    this.drawableSquare = drawableSquare;
    this.drawableEllipse = drawableEllipse;
    this.drawableTriangle = drawableTriangle;
    
    this.imageButton = image;
    this.imageChooser = null;
    this.file = null;
}
 
开发者ID:Daytron,项目名称:J-Painter,代码行数:51,代码来源:ButtonListener.java

示例3: EditItemForm

import com.alee.laf.combobox.WebComboBox; //导入依赖的package包/类
public EditItemForm() {
		super();
		originalNameTextField = new WebTextField();
//		originalNameTextField.setMinimumWidth(100);
		localizedNameTextField = new WebTextField();
//		localizedNameTextField.setMinimumWidth(100);
		countryComboBox = new WebComboBox(getCountries());
		typeComboBox = new WebComboBox(MediaType.values());
		statusComboBox = new WebComboBox(MediaStatus.values());
		maxEpisodes = new WebSpinner(new SpinnerNumberModel(1, 1, 999, 1));
		episodesWatched = new WebSpinner(new SpinnerNumberModel(0, 0, 1, 1));
		startDate = new WebDateField();
		endDate = new WebDateField();
		WebButton startDateClearButton = new WebButton("Clear", new ClearDateActionListener(startDate));
		WebButton endDateClearButton = new WebButton("Clear", new ClearDateActionListener(endDate));
		statusComboBox.addActionListener(new StatusChangeListener(maxEpisodes, episodesWatched,
				startDate, endDate, new WebButton[]{startDateClearButton, endDateClearButton}));
		maxEpisodes.addChangeListener(new MaxEpisodesChangeListener(episodesWatched, statusComboBox));
		statusComboBox.setSelectedIndex(0); // fires initial notification
		setModal(true);
		setResizable(false);
		setMinimumSize(new Dimension(500, 400));
		setLayout(new BorderLayout(5, 5));
		WebPanel panel = new WebPanel();
		panel.setLayout(createLayout());
		panel.setMargin(5, 5, 5, 5);
		panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.originalName")), "0,0");
		panel.add(originalNameTextField, "1,0,3,0");
		panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.localizedName")), "0,1");
		panel.add(localizedNameTextField, "1,1,3,1");
		panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.country")), "0,2");
		panel.add(countryComboBox, "1,2,3,2");
		panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.type")), "0,3");
		panel.add(typeComboBox, "1,3,3,3");
		panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.status")), "0,4");
		panel.add(statusComboBox, "1,4,3,4");
		panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.progress")), "0,5");
		panel.add(episodesWatched, "1,5");
		panel.add(new WebLabel("/"), "2,5");
		panel.add(maxEpisodes, "3,5");
		panel.add(new WebLabel("startDate"), "0,6");
		panel.add(startDate, "1,6");
		panel.add(startDateClearButton, "3,6");
		panel.add(new WebLabel("endDate"), "0,7");
		panel.add(endDate, "1,7");
		panel.add(endDateClearButton, "3,7");
//		panel.setLayout(new FormLayout(false, true));
//		panel.setMargin(5, 5, 5, 5);
//		panel.add(new WebLabel("nameOrig"), FormLayout.LEFT);
//		panel.add(nameOrigTextField, FormLayout.RIGHT);
//		panel.add(new WebLabel("country"), FormLayout.LEFT);
//		panel.add(countryTextField, FormLayout.RIGHT);
//		panel.add(new WebLabel("type"), FormLayout.LEFT);
//		panel.add(typeComboBox, FormLayout.RIGHT);
//		panel.add(new WebLabel("status"), FormLayout.LEFT);
//		panel.add(statusComboBox, FormLayout.RIGHT);
		add(panel, BorderLayout.NORTH);
		add(createSaveButton(), BorderLayout.SOUTH);
		setTitle(AppSettings.getLocalizedString("editForm.title"));
	}
 
开发者ID:DiscoElevator,项目名称:MyMediaList,代码行数:61,代码来源:EditItemForm.java

示例4: MaxEpisodesChangeListener

import com.alee.laf.combobox.WebComboBox; //导入依赖的package包/类
public MaxEpisodesChangeListener(WebSpinner episodesWatched, WebComboBox statusComboBox) {
	this.episodesWatched = episodesWatched;
	this.statusComboBox = statusComboBox;
}
 
开发者ID:DiscoElevator,项目名称:MyMediaList,代码行数:5,代码来源:MaxEpisodesChangeListener.java

示例5: NetworkPanel

import com.alee.laf.combobox.WebComboBox; //导入依赖的package包/类
NetworkPanel() {
    GroupPanel groupPanel = new GroupPanel(View.GAP_DEFAULT, false);
    groupPanel.setMargin(View.MARGIN_BIG);

    groupPanel.add(new WebLabel(Tr.tr("Network Settings")).setBoldFont());
    groupPanel.add(new WebSeparator(true, true));

    mConnectStartupBox = createCheckBox(Tr.tr("Connect on startup"),
            "",
            mConf.getBoolean(Config.MAIN_CONNECT_STARTUP));
    groupPanel.add(mConnectStartupBox);

    mConnectRetryBox = createCheckBox(Tr.tr("Retry on connection failure"),
            Tr.tr("Try automatic (re-)connect after connection failure"),
            mConf.getBoolean(Config.NET_RETRY_CONNECT));
    groupPanel.add(new GroupPanel(mConnectRetryBox, new WebSeparator()));

    mRequestAvatars = createCheckBox(Tr.tr("Download profile pictures"),
            Tr.tr("Download the profile pictures of your contacts"),
            mConf.getBoolean(Config.NET_REQUEST_AVATARS));
    groupPanel.add(new GroupPanel(mRequestAvatars, new WebSeparator()));

    mImgResizeMap = new LinkedHashMap<>();
    mImgResizeMap.put(-1, Tr.tr("Original"));
    mImgResizeMap.put(300 * 1000, Tr.tr("Small (0.3MP)"));
    mImgResizeMap.put(500 * 1000, Tr.tr("Medium (0.5MP)"));
    mImgResizeMap.put(800 * 1000, Tr.tr("Large (0.8MP)"));

    mMaxImgSizeBox = new WebComboBox(new ArrayList<>(mImgResizeMap.values()).toArray());
    int maxImgIndex = new ArrayList<>(mImgResizeMap.keySet()).indexOf(
            mConf.getInt(Config.NET_MAX_IMG_SIZE));
    if (maxImgIndex >= 0)
        mMaxImgSizeBox.setSelectedIndex(maxImgIndex);
    TooltipManager.addTooltip(mMaxImgSizeBox, Tr.tr("Reduce size of images before sending"));

    groupPanel.add(new GroupPanel(View.GAP_DEFAULT,
            new WebLabel(Tr.tr("Resize image attachments:")),
            mMaxImgSizeBox,
            new WebSeparator()));

    this.add(groupPanel);
}
 
开发者ID:kontalk,项目名称:desktopclient-java,代码行数:43,代码来源:ConfigurationDialog.java

示例6: ViewPanel

import com.alee.laf.combobox.WebComboBox; //导入依赖的package包/类
ViewPanel() {
    GroupPanel groupPanel = new GroupPanel(View.GAP_DEFAULT, false);
    groupPanel.setMargin(View.MARGIN_BIG);

    groupPanel.add(new WebLabel(Tr.tr("View Settings")).setBoldFont());
    groupPanel.add(new WebSeparator(true, true));

    String bgPath = mConf.getString(Config.VIEW_CHAT_BG);
    mBGBox = createCheckBox(Tr.tr("Custom background:")+" ",
            "",
            !bgPath.isEmpty());
    mBGBox.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            mBGChooser.setEnabled(e.getStateChange() == ItemEvent.SELECTED);
            mBGChooser.getChooseButton().setEnabled(e.getStateChange() == ItemEvent.SELECTED);
        }
    });
    TooltipManager.addTooltip(mBGBox, Tr.tr("Background image for all chats"));
    mBGChooser = Utils.createImageChooser(bgPath);
    mBGChooser.setEnabled(mBGBox.isSelected());
    groupPanel.add(new GroupPanel(GroupingType.fillLast, mBGBox, mBGChooser));

    mMessageFontSizeMap = new LinkedHashMap<>();
    mMessageFontSizeMap.put(Tr.tr("Small"), 1);
    mMessageFontSizeMap.put(Tr.tr("Normal"), -1);
    mMessageFontSizeMap.put(Tr.tr("Large"), 2);
    mMessageFontSizeMap.put(Tr.tr("Huge"), 3);

    mMessageFontSizeBox = new WebComboBox(new ArrayList<>(mMessageFontSizeMap.keySet()).toArray());
    int fontSizeIndex = new ArrayList<>(mMessageFontSizeMap.values()).indexOf(
            mConf.getInt(Config.VIEW_MESSAGE_FONT_SIZE));
    if (fontSizeIndex >= 0)
        mMessageFontSizeBox.setSelectedIndex(fontSizeIndex);
    TooltipManager.addTooltip(mMessageFontSizeBox, Tr.tr("Font size for message text and date"));

    groupPanel.add(new GroupPanel(View.GAP_DEFAULT,
            new WebLabel(Tr.tr("Font size for chat messages:")),
            mMessageFontSizeBox,
            new WebSeparator()));

    this.add(groupPanel);
}
 
开发者ID:kontalk,项目名称:desktopclient-java,代码行数:44,代码来源:ConfigurationDialog.java

示例7: initGeneralView

import com.alee.laf.combobox.WebComboBox; //导入依赖的package包/类
private void initGeneralView() {
	setIconImage(ImageLoader.getInstance().getApplicationIcon().getImage());
	setTitle(WINDOWS_TITLE);
	setMinimumSize(new Dimension(600, 330));
	setSize(new Dimension(636, 530));
	setLocationRelativeTo(null);	
	imageLoader = ImageLoader.getInstance();
	getContentPane().setLayout(null);
	tabbedPane = new JTabbedPane(JTabbedPane.TOP);
	tabbedPane.setBackground(Color.WHITE);
	tabbedPane.setBounds(10, 103, 607, 336);
	getContentPane().add(tabbedPane);

	saveButton = new JButton(SAVE);
	saveButton.setBounds(165, 450, 115, 32);
	getContentPane().add(saveButton);

	cancelButton = new JButton(CANCEL);
	cancelButton.setBounds(476, 450, 115, 32);
	getContentPane().add(cancelButton);

	_panel = new JPanel();
	_panel.setBounds(10, 13, 608, 75);
	getContentPane().add(_panel);
	_panel.setOpaque(false);
	_panel.setBorder(new CompoundBorder(null, new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Configuration", TitledBorder.LEADING, TitledBorder.TOP, null, null)));
	_panel.setBackground(Color.WHITE);
	_panel.setLayout(null);

	configuration = new WebComboBox();
	configuration.setOpaque(false);
	configuration.setEditable(true);
	configuration.setBackground(Color.WHITE);
	configuration.setBounds(10, 30, 404, 34);
	configuration.addActionListener(this); 
	_panel.add(configuration);

	restoreDefaults = new JButton("Restore Defaults");
	restoreDefaults.addActionListener(this);
	restoreDefaults.setBounds(292, 450, 172, 32);
	restoreDefaults.addActionListener(this); 
	getContentPane().add(restoreDefaults);

	cancelButton.addActionListener(this);
	saveButton.addActionListener(this);
	setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
	addWindowListener(new WindowAdapter() {
		public void windowClosing(WindowEvent e) {
			// System.exit(0);
			presenter.closeWindow();
		}
	});
	
	
}
 
开发者ID:DiegoArranzGarcia,项目名称:JavaTracer,代码行数:56,代码来源:SettingsView.java


注:本文中的com.alee.laf.combobox.WebComboBox类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。