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


Java ItemEvent.DESELECTED属性代码示例

本文整理汇总了Java中java.awt.event.ItemEvent.DESELECTED属性的典型用法代码示例。如果您正苦于以下问题:Java ItemEvent.DESELECTED属性的具体用法?Java ItemEvent.DESELECTED怎么用?Java ItemEvent.DESELECTED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.event.ItemEvent的用法示例。


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

示例1: fireItemStateChanged

protected void fireItemStateChanged(ItemEvent e) {
    switch (e.getStateChange()) {
        case ItemEvent.SELECTED:

            if (e.getItem() instanceof JSeparator) {
                SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            selectNextItem();
                        }
                    });

            }

            break;
        case ItemEvent.DESELECTED:

            if (!(e.getItem() instanceof JSeparator)) {
                lastSelectedIndex = model.getIndexOf(e.getItem());
            }

            break;
    }

    super.fireItemStateChanged(e);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:JExtendedComboBox.java

示例2: CheckBoxWithText

/**
 * 
 */
public CheckBoxWithText(String title) {
	super();
	setText(title);
	super.addItemListener(new ItemListener() {

		@Override
		public void itemStateChanged(ItemEvent e) {
			// TODO Auto-generated method stub
			if (e.getStateChange() == ItemEvent.SELECTED) {
				textField.setEnabled(true);
			} else if (e.getStateChange() == ItemEvent.DESELECTED) {
				textField.setEnabled(false);
			}
		}
		
	});
}
 
开发者ID:enocholumide,项目名称:Laserscan-to-dxf,代码行数:20,代码来源:CheckBoxWithText.java

示例3: setActivated

/**
 * activates or deactivates the widget in the panel
 * @param activated boolean true to activate and false to deactivate
 */
public void setActivated(boolean activated) {
	if(widget!=null && widget.isClickable()){
		widget.setActive(activated);
		if(activated){
			labelPanel.setBackground(highlightColor);
			jLabel.setForeground(Color.GRAY);
		}else{
			labelPanel.setBackground(Color.GRAY);
			jLabel.setForeground(highlightColor);
		}
		if(widget!=null){
			widget.onActiveChanged();
		}
		//notify the listeners over the widet the state change event
		for(ItemListener listener: listeners){
			ItemEvent e = new ItemEvent(this,0,widget, isActivated() ? ItemEvent.SELECTED : ItemEvent.DESELECTED);
			listener.itemStateChanged(e);
		}
	}
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:24,代码来源:GroupPanel.java

示例4: sourceFolderItemStateChanged

private void sourceFolderItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_sourceFolderItemStateChanged
    if (ignoreEvent) {
        return;
    }
    if (evt.getStateChange() == ItemEvent.DESELECTED) {
        int index = findIndex(evt.getItem());
        // if index == -1 then item was removed and will not be saved
        if (index != -1) {
            saveClasspath(index);
        }
    } else {
        loadClasspath();
    }
    updateButtons();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:ClasspathPanel.java

示例5: sourceFolderItemStateChanged

private void sourceFolderItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_sourceFolderItemStateChanged
    if (ignoreEvent) {
        return;
    }
    if (evt.getStateChange() == ItemEvent.DESELECTED) {
        int index = findIndex(evt.getItem());
        // if index == -1 then item was removed and will not be saved
        if (index != -1) {
            saveOutput(index);
        }
    } else {
        loadOutput();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:OutputPanel.java

示例6: itemStateChanged

@Override
public void itemStateChanged(ItemEvent evt) {
    if(evt.getStateChange() == ItemEvent.SELECTED) {
        RepositoryConnection rc = (RepositoryConnection) evt.getItem();
        if (rc != null) {
            currentPanel.refresh(rc);
            updateVisibility();  
            editedRC = new RepositoryConnection(rc);
        }
    } else if(evt.getStateChange() == ItemEvent.DESELECTED) {
        updateVisibility();  
    }       
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:Repository.java

示例7: itemStateChanged

@Override
public void itemStateChanged(ItemEvent e) {
    switch(e.getStateChange()) {
        case ItemEvent.SELECTED:
            filterMask &= ~itemMask;
            break;
        case ItemEvent.DESELECTED:
            filterMask |= itemMask;
            break;
        default:
            return;
    }
    treePanel.setFilterMask(filterMask);
    NbPreferences.forModule(StatisticsPanel.class).putInt(KEY_FILTER_MASK, filterMask);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:StatisticsPanel.java

示例8: itemStateChanged

@Override
public void itemStateChanged( ItemEvent e ) {
    if( e.getStateChange() == ItemEvent.DESELECTED || !listen )
        return;
    updateData();
    fireChanged();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:SyntaxColoringPanel.java

示例9: itemStateChanged

@Override
public void itemStateChanged( ItemEvent e ) {
    if( e.getStateChange() == ItemEvent.DESELECTED )
        return;
    if (!listen) return;
    updateData ();
    fireChanged();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:AnnotationsPanel.java

示例10: itemStateChanged

@Override
public void itemStateChanged(ItemEvent arg0) {
	if (arg0.getItemSelectable() instanceof JCheckBox) {
		JCheckBox box = (JCheckBox) arg0.getItemSelectable();

		if (arg0.getStateChange() == ItemEvent.SELECTED) {
			if (box.getText().contains("React")) {
				this.controller.setReactAsBot(true);

			} else if (box.getText().contains("GeniusMatti")) {
				this.controller.setTrollMatti(true);

			} else if (box.getText().contains("Swaul")) {
				this.controller.setTrollPaul(true);

			} else if (box.getText().contains("Log")) {
				this.controller.setLogToFile(true);

			}
		} else if (arg0.getStateChange() == ItemEvent.DESELECTED) {
			if (box.getText().contains("React")) {
				this.controller.setReactAsBot(false);

			} else if (box.getText().contains("GeniusMatti")) {
				this.controller.setTrollMatti(false);

			} else if (box.getText().contains("Swaul")) {
				this.controller.setTrollPaul(false);

			} else if (box.getText().contains("Log")) {
				this.controller.setLogToFile(false);

			}
		}

	}

}
 
开发者ID:Ativelox,项目名称:TwitchBot,代码行数:38,代码来源:CheckListener.java

示例11: itemStateChanged

@Override
public void itemStateChanged(ItemEvent e) {
    if (e.getStateChange() == ItemEvent.DESELECTED) {
        return;
    }

    if (e.getSource() == mComboBoxStreams) {
        selectedStreamChanged();
    } else if (e.getSource() == mComboBoxVideoModes) {
        selectedVideoModeChanged();
    }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:12,代码来源:SimpleDepthCameraViewerApplication.java

示例12: handleAction

public void handleAction(final boolean state) {
    final CheckboxMenuItem target = (CheckboxMenuItem)getTarget();
    SunToolkit.executeOnEventHandlerThread(target, new Runnable() {
        public void run() {
            target.setState(state);
        }
    });
    ItemEvent event = new ItemEvent(target, ItemEvent.ITEM_STATE_CHANGED, target.getLabel(), state ? ItemEvent.SELECTED : ItemEvent.DESELECTED);
    SunToolkit.postEvent(SunToolkit.targetToAppContext(getTarget()), event);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:CCheckboxMenuItem.java

示例13: itemStateChanged

@Override
public void itemStateChanged(ItemEvent e) {
    if (e.getStateChange() == ItemEvent.DESELECTED) {
        versionSelectComboBox.setEnabled(false);
        localPdeLibraryBrowser.setEnabled(true);
        return;
    }

    if (e.getStateChange() == ItemEvent.SELECTED) {
        populateComboBox();
    }
}
 
开发者ID:mistodev,项目名称:processing-idea,代码行数:12,代码来源:CustomVersionSelectorListener.java

示例14: itemStateChanged

@Override
public void itemStateChanged(ItemEvent e) {
    if (e.getStateChange() == ItemEvent.DESELECTED) {
        localPdeLibraryBrowser.setEnabled(false);
    }

    if (e.getStateChange() == ItemEvent.SELECTED) {
        localPdeLibraryBrowser.setEnabled(true);
    }
}
 
开发者ID:mistodev,项目名称:processing-idea,代码行数:10,代码来源:ConfigureProcessingProject.java

示例15: ingress_RadioButtonItemStateChanged

private void ingress_RadioButtonItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_ingress_RadioButtonItemStateChanged
   if(evt.getStateChange() == ItemEvent.SELECTED){
       domain_LayeredPane.setVisible(true);
   }else if(evt.getStateChange() == ItemEvent.DESELECTED){
       domain_LayeredPane.setVisible(false);
   }
}
 
开发者ID:jeddict,项目名称:hipee,代码行数:7,代码来源:KubernetesPanel.java


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