boolean highlightEnable = highlightCB.isSelected();
Color highlightColor = colorChipPanle.getBackground();
boolean cursorEnable = cursorCB.isSelected();
boolean isStandardCursor = rbStandardCursor.isSelected();
NewInteractionComponentServerState newIC = (NewInteractionComponentServerState) cellServerState
.getComponentServerState(NewInteractionComponentServerState.class);
if(newIC == null && (!highlightEnable) && (!cursorEnable)) {
// if both both are the default, we don't
// need to add the component
} else if(newIC == null) {
// we need to add the component
newIC = new NewInteractionComponentServerState();
newIC.setHighlightEnable(highlightEnable);
newIC.setCursorEnable(cursorEnable);
if(highlightEnable) {
float[] comps = highlightColor.getComponents(null);
newIC.setRed(comps[0]);
newIC.setGreen(comps[1]);
newIC.setBlue(comps[2]);
}
if(cursorEnable) {
newIC.setStandardCursor(isStandardCursor);
String path = "";
if(isStandardCursor) {
List l = (List) cbStandardCursor.getSelectedItem();
String sel_url = (String) l.get(0);
path = sel_url;
} else {
path = uploadCursorFile(cursorFile);
}
newIC.setCursorFilePath(path);
}
addNewInteractionComponent(newIC);
} else {
// update the highlight component
newIC.setHighlightEnable(highlightEnable);
newIC.setCursorEnable(cursorEnable);
if(highlightEnable) {
float[] comps = highlightColor.getComponents(null);
newIC.setRed(comps[0]);
newIC.setGreen(comps[1]);
newIC.setBlue(comps[2]);
}
if(cursorEnable) {
newIC.setStandardCursor(isStandardCursor);
String path = origCursorFilePath;
if(isStandardCursor) {
List l = (List) cbStandardCursor.getSelectedItem();
String sel_url = (String) l.get(0);
path = sel_url;
} else {
if(cursorFile!=null) {
path = uploadCursorFile(cursorFile);
}
}
newIC.setCursorFilePath(path);
}
editor.addToUpdateList(newIC);
}
}