Skip to content

Commit

Permalink
fix: fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikRevich committed Jun 1, 2024
1 parent ea2ecf5 commit fa56d16
Show file tree
Hide file tree
Showing 26 changed files with 483 additions and 360 deletions.
24 changes: 18 additions & 6 deletions gui/src/main/java/com/repoachiever/entity/PropertiesEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,21 @@ public class PropertiesEntity {
@Value(value = "${image.download.name}")
private String imageDownloadName;

@Value(value = "${image.topology.name}")
private String imageTopologyName;

@Value(value = "${image.edit.name}")
private String imageEditName;

@Value(value = "${image.open.name}")
private String imageOpenName;

@Value(value = "${image.active.name}")
private String imageActiveName;

@Value(value = "${image.non-active.name}")
private String imageNonActiveName;

@Value(value = "${image.bar.width}")
private Integer imageBarWidth;

Expand All @@ -191,12 +200,21 @@ public class PropertiesEntity {
@Value(value = "${button.download.description}")
private String buttonDownloadDescription;

@Value(value = "${button.topology.description}")
private String buttonTopologyDescription;

@Value(value = "${button.edit.description}")
private String buttonEditDescription;

@Value(value = "${button.open.description}")
private String buttonOpenDescription;

@Value(value = "${label.active.description}")
private String labelActiveDescription;

@Value(value = "${label.non-active.description}")
private String labelNonActiveDescription;

@Value(value = "${label.connection-status-success.description}")
private String labelConnectionStatusSuccessDescription;

Expand Down Expand Up @@ -233,12 +251,6 @@ public class PropertiesEntity {
@Value(value = "${alert.editor-close-reminder.message}")
private String alertEditorCloseReminderMessage;

@Value(value = "${graph.css.location}")
private String graphCssFileLocation;

@Value(value = "${graph.properties.location}")
private String graphPropertiesLocation;

@Value(value = "${config.default.directory}")
private String configDefaultDirectory;

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package com.repoachiever.service.element.image.view.common;

import com.repoachiever.entity.PropertiesEntity;
import com.repoachiever.exception.ApplicationImageFileNotFoundException;
import com.repoachiever.service.element.common.ElementHelper;
import com.repoachiever.service.element.image.collection.ConnectionStatusImageCollection;
import com.repoachiever.service.element.storage.ElementStorage;
import com.repoachiever.service.element.text.common.IElement;
import com.repoachiever.service.element.text.common.IElementActualizable;
import com.repoachiever.service.element.text.common.IElementResizable;
import com.repoachiever.service.state.StateService;
import javafx.application.Platform;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.SplitPane;
import javafx.scene.control.Tooltip;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.Background;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.InputStream;
import java.util.Objects;
import java.util.UUID;

/**
* Represents active image view.
*/
public class ActiveImageView implements IElement<BorderPane> {
private final UUID id = UUID.randomUUID();

public ActiveImageView(PropertiesEntity properties) throws ApplicationImageFileNotFoundException {
Button button = new Button();

button.setDisable(true);

InputStream imageSource =
getClass().getClassLoader().getResourceAsStream(properties.getImageActiveName());
if (Objects.isNull(imageSource)) {
throw new ApplicationImageFileNotFoundException();
}

ImageView imageView = new ImageView(new Image(imageSource));
imageView.setFitHeight(properties.getImageBarHeight());
imageView.setFitWidth(properties.getImageBarWidth());

button.setGraphic(imageView);

button.setAlignment(Pos.CENTER_RIGHT);

SplitPane splitPane = new SplitPane(button);
splitPane.setTooltip(new Tooltip(properties.getLabelActiveDescription()));

splitPane.setBackground(
Background.fill(
Color.rgb(
properties.getCommonSceneHeaderConnectionStatusBackgroundColorR(),
properties.getCommonSceneHeaderConnectionStatusBackgroundColorG(),
properties.getCommonSceneHeaderConnectionStatusBackgroundColorB())));

BorderPane borderPane = new BorderPane();
borderPane.setRight(splitPane);

ElementStorage.setElement(id, borderPane);
}

/**
* @see IElementActualizable
*/
@Override
public BorderPane getContent() {
return ElementStorage.getElement(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/** Represents apply image view. */
@Service
public class ApplyImageView implements IElementResizable, IElement<BorderPane> {
public class ApplyImageView implements IElement<BorderPane> {
private final UUID id = UUID.randomUUID();

public ApplyImageView(
Expand Down Expand Up @@ -64,7 +64,6 @@ public ApplyImageView(
borderPane.setRight(splitPane);

ElementStorage.setElement(id, borderPane);
ElementStorage.setResizable(this);
}

/**
Expand All @@ -74,16 +73,4 @@ public ApplyImageView(
public BorderPane getContent() {
return ElementStorage.getElement(id);
}

/**
* @see IElementResizable
*/
@Override
public void handlePrefWidth() {}

/**
* @see IElementResizable
*/
@Override
public void handlePrefHeight() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

/** Represents cleanall image view. */
@Service
public class CleanAllImageView implements IElementResizable, IElement<BorderPane> {
public class CleanAllImageView implements IElement<BorderPane> {
private final UUID id = UUID.randomUUID();

public CleanAllImageView(
Expand Down Expand Up @@ -66,7 +66,6 @@ public CleanAllImageView(
borderPane.setRight(splitPane);

ElementStorage.setElement(id, borderPane);
ElementStorage.setResizable(this);
}

/**
Expand All @@ -76,16 +75,4 @@ public CleanAllImageView(
public BorderPane getContent() {
return ElementStorage.getElement(id);
}

/**
* @see IElementResizable
*/
@Override
public void handlePrefWidth() {}

/**
* @see IElementResizable
*/
@Override
public void handlePrefHeight() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.UUID;

/** Represents clean image view. */
public class CleanImageView implements IElementResizable, IElement<BorderPane> {
public class CleanImageView implements IElement<BorderPane> {
private final UUID id = UUID.randomUUID();

public CleanImageView(
Expand Down Expand Up @@ -66,7 +66,6 @@ public CleanImageView(
borderPane.setRight(splitPane);

ElementStorage.setElement(id, borderPane);
ElementStorage.setResizable(this);
}

/**
Expand All @@ -76,16 +75,4 @@ public CleanImageView(
public BorderPane getContent() {
return ElementStorage.getElement(id);
}

/**
* @see IElementResizable
*/
@Override
public void handlePrefWidth() {}

/**
* @see IElementResizable
*/
@Override
public void handlePrefHeight() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class ConnectionStatusImageView

public ConnectionStatusImageView(@Autowired PropertiesEntity properties) {
Button button = new Button();

button.setDisable(true);
button.setAlignment(Pos.CENTER_RIGHT);

Expand Down
Loading

0 comments on commit fa56d16

Please sign in to comment.