if ("true".equalsIgnoreCase(System.getProperty("com.eteks.sweethome3d.no3D"))) {
offscreenCanvas3DSupported = false;
} else {
offscreenCanvas3DSupported = Component3DManager.getInstance().isOffScreenImageSupported();
}
final NullableSpinnerNumberModel userPlanScaleSpinnerModel =
(NullableSpinner.NullableSpinnerNumberModel)this.userPlanScaleSpinner.getModel();
if (homePrint != null) {
this.furniturePrintedCheckBox.setSelected(homePrint.isFurniturePrinted());
this.planPrintedCheckBox.setSelected(homePrint.isPlanPrinted());
this.bestFitPlanScaleRadioButton.setEnabled(homePrint.isPlanPrinted());
this.userPlanScaleRadioButton.setEnabled(homePrint.isPlanPrinted());
if (homePrint.getPlanScale() == null) {
this.bestFitPlanScaleRadioButton.setSelected(true);
} else {
this.userPlanScaleRadioButton.setSelected(true);
}
this.userPlanScaleSpinner.setEnabled(homePrint.isPlanPrinted() && homePrint.getPlanScale() != null);
this.view3DPrintedCheckBox.setSelected(homePrint.isView3DPrinted() && offscreenCanvas3DSupported);
userPlanScaleSpinnerModel.setNullable(homePrint.getPlanScale() == null);
userPlanScaleSpinnerModel.setValue(homePrint.getPlanScale() != null
? new Integer(Math.round(1 / homePrint.getPlanScale()))
: null);
String headerFormat = homePrint.getHeaderFormat();
this.headerFormatTextField.setText(headerFormat != null ? headerFormat : "");
String footerFormat = homePrint.getFooterFormat();
this.footerFormatTextField.setText(footerFormat != null ? footerFormat : "");
} else {
this.furniturePrintedCheckBox.setSelected(true);
this.planPrintedCheckBox.setSelected(true);
this.bestFitPlanScaleRadioButton.setEnabled(true);
this.bestFitPlanScaleRadioButton.setSelected(true);
this.userPlanScaleRadioButton.setEnabled(true);
this.userPlanScaleSpinner.setEnabled(false);
this.view3DPrintedCheckBox.setSelected(offscreenCanvas3DSupported);
userPlanScaleSpinnerModel.setNullable(true);
userPlanScaleSpinnerModel.setValue(null);
this.headerFormatTextField.setText("");
this.footerFormatTextField.setText("");
}
this.view3DPrintedCheckBox.setEnabled(offscreenCanvas3DSupported);
this.view3DPrintedCheckBox.setVisible(!"true".equalsIgnoreCase(System.getProperty("com.eteks.sweethome3d.no3D")));