當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。