/**
* 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);
}
}
}
GroupPanel.java 文件源码
java
阅读 36
收藏 0
点赞 0
评论 0
项目:cuttlefish
作者:
评论列表
文章目录