//////////////////////////////////Constructor///////////////////////////////////
public OptionsWindow(TrustGrapher trustGrapher) {
this.trustGrapher = trustGrapher;
initComponents();
PropertyManager config = trustGrapher.getPropertyManager();
if (config.containsKey(DELAY)) { //Load current delay from properties
if (config.getProperty(DELAY).equals("" + EventPlayer.DEFAULT_DELAY)) { //If the current delay is the default delay
defaultDelayButton.doClick();
delayField.setText("");
} else { //Otherwise, the delay is custom
customDelayButton.doClick();
delayField.setText(config.getProperty(DELAY));
}
}
if (config.containsKey(SCRUB_MODE)) { //Load current playbackSlider mode from properties
if (Boolean.parseBoolean(config.getProperty(SCRUB_MODE))) { //If the mode is set to scrub
scrubButton.doClick();
} else { //Othwerise, it must be set to drag & drop
dragDropButton.doClick();
}
}