|
|
@ -18,10 +18,12 @@ import com.fr.design.style.AbstractSelectBox; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class NewColorSelectBox extends AbstractSelectBox<Color> implements UIObserver, GlobalNameObserver { |
|
|
|
public class NewColorSelectBox extends AbstractSelectBox<Color> implements UIObserver, GlobalNameObserver { |
|
|
|
private static final long serialVersionUID = 2782150678943960557L; |
|
|
|
private static final long serialVersionUID = 2782150678943960557L; |
|
|
|
|
|
|
|
|
|
|
|
private Color color; |
|
|
|
private Color color; |
|
|
|
private NewColorSelectPane colorPane = new NewColorSelectPane(); |
|
|
|
private NewColorSelectPane colorPane = new NewColorSelectPane(); |
|
|
|
private UIObserverListener uiObserverListener; |
|
|
|
private UIObserverListener uiObserverListener; |
|
|
|
|
|
|
|
private String newColorSelectBoxName = ""; |
|
|
|
|
|
|
|
private GlobalNameListener globalNameListener = null; |
|
|
|
|
|
|
|
|
|
|
|
public NewColorSelectBox(int preferredWidth) { |
|
|
|
public NewColorSelectBox(int preferredWidth) { |
|
|
|
initBox(preferredWidth); |
|
|
|
initBox(preferredWidth); |
|
|
@ -36,6 +38,9 @@ public class NewColorSelectBox extends AbstractSelectBox<Color> implements UIObs |
|
|
|
if(uiObserverListener == null){ |
|
|
|
if(uiObserverListener == null){ |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (globalNameListener != null && shouldResponseNameListener()){ |
|
|
|
|
|
|
|
globalNameListener.setGlobalName(newColorSelectBoxName); |
|
|
|
|
|
|
|
} |
|
|
|
uiObserverListener.doChange(); |
|
|
|
uiObserverListener.doChange(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -98,16 +103,16 @@ public class NewColorSelectBox extends AbstractSelectBox<Color> implements UIObs |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void registerNameListener(GlobalNameListener listener) { |
|
|
|
public void registerNameListener(GlobalNameListener listener) { |
|
|
|
|
|
|
|
globalNameListener = listener; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean shouldResponseNameListener() { |
|
|
|
public boolean shouldResponseNameListener() { |
|
|
|
return false; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setGlobalName(String name) { |
|
|
|
public void setGlobalName(String name) { |
|
|
|
|
|
|
|
newColorSelectBoxName = name; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |