Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
(Issue #5) Font Browser Enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
ribasco committed Jan 8, 2019
1 parent d124de0 commit 94de030
Show file tree
Hide file tree
Showing 11 changed files with 367 additions and 176 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -679,14 +679,6 @@ private void setupStatusBar() {
leftItems.add(connectionDetails);
}

private void disableConnectionTypeOptions(boolean disable) {
pConnType.setDisable(disable);
for (Toggle toggle : connType.getToggles()) {
ToggleButton button = (ToggleButton) toggle;
button.setDisable(disable);
}
}

private void activateProfile(GlcdEmulatorProfile profile) {
glcdScreen.stop();
try {
Expand Down Expand Up @@ -851,6 +843,7 @@ protected void updateItem(Double size, boolean empty) {
/**
* Check if we have a default profile stored in the File System.
*/

private void setupDefaultProfile() {
//Load default profile
int defaultProfileId = appConfig.getDefaultProfileId();
Expand Down Expand Up @@ -1056,7 +1049,7 @@ private void saveAppSettings() {
private JFXDialog getDisplayBrowseDialog() {
try {
GlcdEmulatorProfile profile = getContext().getProfileManager().getActiveProfile();
Parent node = ResourceUtil.loadFxmlResource(Views.DISPLAY_BROWSE, GlcdEmulatorController.this);
Parent node = ResourceUtil.loadFxmlResource(Views.DISPLAY_BROWSE);

MenuItem miCopyConstructor = new MenuItem("Copy constructor");
miCopyConstructor.setOnAction(event -> {
Expand Down Expand Up @@ -1303,11 +1296,11 @@ private void setupConnectionTypeBindings() {
ConnectionType type = (ConnectionType) newValue.getUserData();
switch (type) {
case TCP:
view = ResourceUtil.loadFxmlResource("emulator-settings-tcp", GlcdEmulatorController.this);
view = ResourceUtil.loadFxmlResource("emulator-settings-tcp");
setupConnTypeTcpBindings();
break;
case SERIAL:
view = ResourceUtil.loadFxmlResource("emulator-settings-serial", GlcdEmulatorController.this);
view = ResourceUtil.loadFxmlResource("emulator-settings-serial");
setupConnTypeSerialBindings();
break;
}
Expand Down Expand Up @@ -1343,7 +1336,7 @@ private void setupConnTypeTcpBindings() {

private Parent createFlowControlView() {
try {
return ResourceUtil.loadFxmlResource("emulator-settings-serial-fc", this);
return ResourceUtil.loadFxmlResource(Views.SERIAL_SETTINGS_FC);
} catch (IOException e) {
throw new EmulatorControllerException("Problem loading Flow Control view", e);
}
Expand Down Expand Up @@ -1620,7 +1613,7 @@ public GlcdBusInterface fromString(String string) {
if (busInterface == null) {
busInterface = GlcdUtil.findPreferredBusInterface(profile.getDisplay());
if (busInterface != null)
log.info("Bus interface is null, returning default: {}", busInterface.name());
log.info("Bus interface is null, using preferred: {}", busInterface.name());
else
log.warn("Bus interface not found for display: {}", profile.getDisplay().getName());
}
Expand All @@ -1639,15 +1632,14 @@ public GlcdBusInterface fromString(String string) {
profileBindGroup.registerUnidirectional(drawTestService.displayProperty(), profile.displayProperty());
profileBindGroup.registerUnidirectional(btnDrawAnimTest.textProperty(), textBinding);

//drawTestService.bufferProperty().bind(displayBuffer);
//drawTestService.busInterfaceProperty().bind(busInterfaceBinding);
//drawTestService.displayProperty().bind(profile.displayProperty());
//btnDrawAnimTest.textProperty().bind(textBinding);


//Bidirectional Bindings
profileBindGroup.registerBidirectional(glcdScreen.activePixelColorProperty(), profile.lcdActivePixelColorProperty());
profileBindGroup.registerBidirectional(glcdScreen.inactivePixelColorProperty(), profile.lcdInactivePixelColorProperty());
profile.lcdActivePixelColorProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
profile.setLcdInactivePixelColor(newValue);
}
});
profileBindGroup.registerBidirectional(glcdScreen.backlightColorProperty(), profile.lcdBacklightColorProperty());
profileBindGroup.registerBidirectional(glcdScreen.contrastProperty(), profile.lcdContrastProperty());
profileBindGroup.registerBidirectional(glcdScreen.pixelSizeProperty(), profile.lcdPixelSizeProperty());
Expand Down Expand Up @@ -1825,7 +1817,7 @@ private void openFontBrowserAction(ActionEvent event) {
//TODO: Fix edit bug
private void profileEditAction(ActionEvent event) {
GlcdEmulatorProfile selectedProfile = tvProfiles.getSelectionModel().getSelectedItem();
GlcdEditProfileController controller = Controllers.getEditProfileController();
GlcdEditProfileController controller = Controllers.getController(GlcdEditProfileController.class);
Stage stage = Stages.getEditProfileStage();
controller.setProfile(selectedProfile);
controller.setOwner(stage);
Expand Down
Loading

0 comments on commit 94de030

Please sign in to comment.