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")
38 private List<GrxModelItem> currentModels_ =
new ArrayList<GrxModelItem>();
39 private List<GrxCollisionPairItem> currentCollisionPairs_ =
new ArrayList<GrxCollisionPairItem>();
42 super(name, manager, vp, parent);
51 Iterator<GrxModelItem> it = currentModels_.iterator();
53 it.next().addObserver(
this);
55 manager_.registerItemChangeListener(
this,
GrxModelItem.class);
60 Iterator<GrxModelItem> it = currentModels_.iterator();
62 it.next().deleteObserver(
this);
66 it = currentModels_.iterator();
68 it.next().addObserver(
this);
74 GrxModelItem mitem = (GrxModelItem)item;
77 if(!currentModels_.contains(mitem)){
78 currentModels_.add(mitem);
85 if(currentModels_.contains(mitem)){
86 currentModels_.remove(mitem);
95 GrxCollisionPairItem citem = (GrxCollisionPairItem)item;
99 if(!currentCollisionPairs_.contains(citem)){
100 currentCollisionPairs_.add(citem);
106 if(currentCollisionPairs_.contains(citem)){
107 currentCollisionPairs_.remove(citem);
119 if(currentModels_.contains(plugin)){
120 if((String)
arg[0]==
"PropertyChange"){
121 if((String)
arg[1]==
"isRobot")
128 Iterator<GrxModelItem> it = currentModels_.iterator();
129 while(it.hasNext()) {
130 it.next().deleteObserver(
this);
133 manager_.removeItemChangeListener(
this,
GrxModelItem.class);
GrxControllerView(String name, GrxPluginManager manager, GrxBaseViewPart vp, Composite parent)
ControllerPanel controllerPane_
void addObserver(GrxObserver v)
png_infop png_charpp name
item corresponds to a robot model
void deleteObserver(GrxObserver v)
void registerItemChange(GrxBaseItem item, int event)
static final int ADD_ITEM
static final int SELECTED_ITEM
static final int REMOVE_ITEM
void updateRobots(List< GrxModelItem > list)
プラグイン管理クラス GrxUIの核になるクラス。プラグインのロード等の、初期化を実行する。 プラグインとそ...
void update(GrxBasePlugin plugin, Object... arg)
static final int NOTSELECTED_ITEM
void setEnabled(boolean flag)