setNoRefresh(oldNoRefrsh);
}
}
public void refreshShadingUI() {
ShadingInfo shadingInfo = getCurrFlame() != null ? getCurrFlame().getShadingInfo() : null;
boolean pseudo3DEnabled;
boolean blurEnabled;
boolean distanceColorEnabled;
if (shadingInfo != null) {
data.shadingCmb.setSelectedItem(shadingInfo.getShading());
pseudo3DEnabled = shadingInfo.getShading().equals(Shading.PSEUDO3D);
blurEnabled = shadingInfo.getShading().equals(Shading.BLUR);
distanceColorEnabled = shadingInfo.getShading().equals(Shading.DISTANCE_COLOR);
}
else {
data.shadingCmb.setSelectedIndex(0);
pseudo3DEnabled = false;
blurEnabled = false;
distanceColorEnabled = false;
}
if (pseudo3DEnabled) {
data.shadingAmbientREd.setText(Tools.doubleToString(shadingInfo.getAmbient()));
data.shadingAmbientSlider.setValue(Tools.FTOI(shadingInfo.getAmbient() * TinaController.SLIDER_SCALE_AMBIENT));
data.shadingDiffuseREd.setText(Tools.doubleToString(shadingInfo.getDiffuse()));
data.shadingDiffuseSlider.setValue(Tools.FTOI(shadingInfo.getDiffuse() * TinaController.SLIDER_SCALE_AMBIENT));
data.shadingPhongREd.setText(Tools.doubleToString(shadingInfo.getPhong()));
data.shadingPhongSlider.setValue(Tools.FTOI(shadingInfo.getPhong() * TinaController.SLIDER_SCALE_AMBIENT));
data.shadingPhongSizeREd.setText(Tools.doubleToString(shadingInfo.getPhongSize()));
data.shadingPhongSizeSlider.setValue(Tools.FTOI(shadingInfo.getPhongSize() * TinaController.SLIDER_SCALE_PHONGSIZE));
int cIdx = data.shadingLightCmb.getSelectedIndex();
data.shadingLightXREd.setText(Tools.doubleToString(shadingInfo.getLightPosX()[cIdx]));
data.shadingLightXSlider.setValue(Tools.FTOI(shadingInfo.getLightPosX()[cIdx] * TinaController.SLIDER_SCALE_LIGHTPOS));
data.shadingLightYREd.setText(Tools.doubleToString(shadingInfo.getLightPosY()[cIdx]));
data.shadingLightYSlider.setValue(Tools.FTOI(shadingInfo.getLightPosY()[cIdx] * TinaController.SLIDER_SCALE_LIGHTPOS));
data.shadingLightZREd.setText(Tools.doubleToString(shadingInfo.getLightPosZ()[cIdx]));
data.shadingLightZSlider.setValue(Tools.FTOI(shadingInfo.getLightPosZ()[cIdx] * TinaController.SLIDER_SCALE_LIGHTPOS));
data.shadingLightRedREd.setText(String.valueOf(shadingInfo.getLightRed()[cIdx]));
data.shadingLightRedSlider.setValue(shadingInfo.getLightRed()[cIdx]);
data.shadingLightGreenREd.setText(String.valueOf(shadingInfo.getLightGreen()[cIdx]));
data.shadingLightGreenSlider.setValue(shadingInfo.getLightGreen()[cIdx]);
data.shadingLightBlueREd.setText(String.valueOf(shadingInfo.getLightBlue()[cIdx]));
data.shadingLightBlueSlider.setValue(shadingInfo.getLightBlue()[cIdx]);
}
else {
data.shadingAmbientREd.setText("");
data.shadingAmbientSlider.setValue(0);
data.shadingDiffuseREd.setText("");
data.shadingDiffuseSlider.setValue(0);
data.shadingPhongREd.setText("");
data.shadingPhongSlider.setValue(0);
data.shadingPhongSizeREd.setText("");
data.shadingPhongSizeSlider.setValue(0);
data.shadingLightXREd.setText("");
data.shadingLightXSlider.setValue(0);
data.shadingLightYREd.setText("");
data.shadingLightYSlider.setValue(0);
data.shadingLightZREd.setText("");
data.shadingLightZSlider.setValue(0);
data.shadingLightRedREd.setText("");
data.shadingLightRedSlider.setValue(0);
data.shadingLightGreenREd.setText("");
data.shadingLightGreenSlider.setValue(0);
data.shadingLightBlueREd.setText("");
data.shadingLightBlueSlider.setValue(0);
}
if (blurEnabled) {
data.shadingBlurRadiusREd.setText(Tools.doubleToString(shadingInfo.getBlurRadius()));
data.shadingBlurRadiusSlider.setValue(shadingInfo.getBlurRadius());
data.shadingBlurFadeREd.setText(Tools.doubleToString(shadingInfo.getBlurFade()));
data.shadingBlurFadeSlider.setValue(Tools.FTOI(shadingInfo.getBlurFade() * TinaController.SLIDER_SCALE_AMBIENT));
data.shadingBlurFallOffREd.setText(Tools.doubleToString(shadingInfo.getBlurFallOff()));
data.shadingBlurFallOffSlider.setValue(Tools.FTOI(shadingInfo.getBlurFallOff() * TinaController.SLIDER_SCALE_BLUR_FALLOFF));
}
else {
data.shadingBlurRadiusREd.setText("");
data.shadingBlurRadiusSlider.setValue(0);
data.shadingBlurFadeREd.setText("");
data.shadingBlurFadeSlider.setValue(0);
data.shadingBlurFallOffREd.setText("");
data.shadingBlurFallOffSlider.setValue(0);
}
if (distanceColorEnabled) {
data.shadingDistanceColorRadiusREd.setText(Tools.doubleToString(shadingInfo.getDistanceColorRadius()));
data.shadingDistanceColorRadiusSlider.setValue(Tools.FTOI(shadingInfo.getDistanceColorRadius() * TinaController.SLIDER_SCALE_AMBIENT));
data.shadingDistanceColorExponentREd.setText(Tools.doubleToString(shadingInfo.getDistanceColorExponent()));
data.shadingDistanceColorExponentSlider.setValue(Tools.FTOI(shadingInfo.getDistanceColorExponent() * TinaController.SLIDER_SCALE_AMBIENT));
data.shadingDistanceColorScaleREd.setText(Tools.doubleToString(shadingInfo.getDistanceColorScale()));
data.shadingDistanceColorScaleSlider.setValue(Tools.FTOI(shadingInfo.getDistanceColorScale() * TinaController.SLIDER_SCALE_AMBIENT));
data.shadingDistanceColorOffsetXREd.setText(Tools.doubleToString(shadingInfo.getDistanceColorOffsetX()));
data.shadingDistanceColorOffsetXSlider.setValue(Tools.FTOI(shadingInfo.getDistanceColorOffsetX() * TinaController.SLIDER_SCALE_AMBIENT));
data.shadingDistanceColorOffsetYREd.setText(Tools.doubleToString(shadingInfo.getDistanceColorOffsetY()));
data.shadingDistanceColorOffsetYSlider.setValue(Tools.FTOI(shadingInfo.getDistanceColorOffsetY() * TinaController.SLIDER_SCALE_AMBIENT));
data.shadingDistanceColorOffsetZREd.setText(Tools.doubleToString(shadingInfo.getDistanceColorOffsetZ()));
data.shadingDistanceColorOffsetZSlider.setValue(Tools.FTOI(shadingInfo.getDistanceColorOffsetZ() * TinaController.SLIDER_SCALE_AMBIENT));
data.shadingDistanceColorStyleREd.setText(String.valueOf(shadingInfo.getDistanceColorStyle()));
data.shadingDistanceColorStyleSlider.setValue(shadingInfo.getDistanceColorStyle());
data.shadingDistanceColorCoordinateREd.setText(String.valueOf(shadingInfo.getDistanceColorCoordinate()));
data.shadingDistanceColorCoordinateSlider.setValue(shadingInfo.getDistanceColorCoordinate());
data.shadingDistanceColorShiftREd.setText(Tools.doubleToString(shadingInfo.getDistanceColorShift()));
data.shadingDistanceColorShiftSlider.setValue(Tools.FTOI(shadingInfo.getDistanceColorShift() * TinaController.SLIDER_SCALE_AMBIENT));
}
else {
data.shadingDistanceColorRadiusREd.setText("");
data.shadingDistanceColorRadiusSlider.setValue(0);
data.shadingDistanceColorExponentREd.setText("");