17 package com.generalrobotix.ui.view;
19 import java.util.ArrayList;
20 import java.util.Iterator;
21 import java.util.List;
23 import org.eclipse.swt.SWT;
24 import org.eclipse.swt.widgets.Composite;
35 @SuppressWarnings(
"serial")
39 private List<GrxModelItem> currentModels_ =
new ArrayList<GrxModelItem>();
40 private List<GrxCollisionPairItem> currentCollisionPairs_ =
new ArrayList<GrxCollisionPairItem>();;
43 super(name, manager, vp, parent);
49 manager_.registerItemChangeListener(
this,
GrxModelItem.class);
54 Iterator<GrxCollisionPairItem> it = currentCollisionPairs_.iterator();
56 it.next().deleteObserver(
this);
61 it = currentCollisionPairs_.iterator();
63 it.next().addObserver(
this);
69 GrxModelItem mitem = (GrxModelItem)item;
72 if(!currentModels_.contains(mitem)){
73 currentModels_.add(mitem);
79 if(currentModels_.contains(mitem)){
80 currentModels_.remove(mitem);
88 GrxCollisionPairItem citem = (GrxCollisionPairItem)item;
92 if(!currentCollisionPairs_.contains(citem)){
93 currentCollisionPairs_.add(citem);
100 if(currentCollisionPairs_.contains(citem)){
101 currentCollisionPairs_.remove(citem);
113 if(currentCollisionPairs_.contains(plugin)){
114 if((String)
arg[0]==
"PropertyChange"){
121 Iterator<GrxCollisionPairItem> it = currentCollisionPairs_.iterator();
122 while(it.hasNext()) {
123 it.next().deleteObserver(
this);
126 manager_.removeItemChangeListener(
this,
GrxModelItem.class);
CollisionPairPanel collisionPane_
void addObserver(GrxObserver v)
png_infop png_charpp name
item corresponds to a robot model
void deleteObserver(GrxObserver v)
static final int ADD_ITEM
void registerItemChange(GrxBaseItem item, int event)
static final int SELECTED_ITEM
void updateCollisionPairs(List< GrxCollisionPairItem > clist, List< GrxModelItem > mlist)
GrxCollisionPairView(String name, GrxPluginManager manager, GrxBaseViewPart vp, Composite parent)
static final int REMOVE_ITEM
プラグイン管理クラス GrxUIの核になるクラス。プラグインのロード等の、初期化を実行する。 プラグインとそ...
void setEnabled(boolean flag)
static final int NOTSELECTED_ITEM
void update(GrxBasePlugin plugin, Object... arg)