User Tools

Site Tools


zalozeni:grafika:correctionersgraphics

CorrectionPaneController

Jedna se o grafiku poskytujici tooly ke korekci. Zpravidla se jedna o korekci teplotniho cidla, ktere bylo zkalibrovano. Je vazano ke konretnimu Instrumentu. CorrectionPaneController musi dedit od InstrumentCorrectionPaneController, ktery poskytuje metodu getCorrectionTabController.

protected GraphicControllerDTO getCorrectionTabController() {
	GraphicControllerDTO gcDTO = AnchorPaneHelper.loadFXPaneByName( CorrectionTabController.class.getResource("CorrectionTab.fxml"));
	return gcDTO;
}

Tato metoda vraci GraphicControllerDTO, ktery obsahuje CorrectionTabController a poskytuje metody, ktere nasleduji. CorrectionTabController predava Correctioner, zobrauje jej do tabulky, ve ktere umoznuje editaci jeho hodnot.

public class CorrectionTabController implements Initializable {
	public void setCorrectioner(Correctioner corr);
	public void setCorrectioner(String corrString);
	public Correctioner getCorrectioner();
	...
}

Konkretni implementace CorrectionPaneControlleru pak vypada nasledovne

public class DokuwikiCorrectionerPaneController extends InstrumentCorrectionPaneController {
 
	@FXML
	private AnchorPane anchorPane;
 
	private DokuwikiInstrumentSettingsService instrumentSS;
	private CorrectionTabController corrController;
 
	public void initialize(URL location, ResourceBundle resources) {
	}
 
	@Override
	public void setInstrument(Instrument instrument) {
		super.setInstrument(instrument);
		instrumentSS = (DokuwikiInstrumentSettingsService) instrument.getSettingsService();
 
		GraphicControllerDTO gcDTO = getCorrectionTabController();
		corrController = (CorrectionTabController) gcDTO.getController();
		corrController.setCorrectioner(instrumentSS.getTempCorrectioner());
		AnchorPaneHelper.insertNodeToContent(gcDTO.getGraphic(), anchorPane);
	}
 
	public void save() {
		instrumentSS.saveTempCorrectioner(corrController.getCorrectioner().toString());
	}
 
}
zalozeni/grafika/correctionersgraphics.txt · Last modified: 2016/07/25 15:12 by jlochman