Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MenuBar: removed supply and placed unigrid plus logo in the menubar. … #49

Merged
merged 1 commit into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions nbactions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,46 @@
</goals>
<properties>
<exec.vmArgs></exec.vmArgs>
<exec.args>-classpath %classpath ${packageClassName} -d -classpath %classpath ${packageClassName} ${exec.vmArgs} -classpath %classpath ${exec.mainClass}</exec.args>
<exec.appArgs>-d</exec.appArgs>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.appArgs>-d -classpath %classpath ${packageClassName} ${exec.vmArgs} -classpath %classpath ${exec.mainClass}</exec.appArgs>
<exec.mainClass>${packageClassName}</exec.mainClass>
<exec.executable>java</exec.executable>
<janus.daemon.location>/home/evan/work/daemons/unigridd</janus.daemon.location>
</properties>
</action>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.vmArgs>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</exec.vmArgs>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.appArgs>-d -classpath %classpath ${packageClassName} ${exec.vmArgs} -classpath %classpath ${exec.mainClass}</exec.appArgs>
<exec.mainClass>${packageClassName}</exec.mainClass>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
</goals>
<properties>
<exec.vmArgs></exec.vmArgs>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.mainClass>${packageClassName}</exec.mainClass>
<exec.executable>java</exec.executable>
<exec.appArgs>-d -classpath %classpath ${packageClassName} ${exec.vmArgs} -classpath %classpath ${exec.mainClass}</exec.appArgs>
</properties>
</action>
</actions>
36 changes: 19 additions & 17 deletions src/main/java/org/unigrid/janus/Janus.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,25 @@ public void start(Stage stage, Application.Parameters parameters) throws Excepti

startSplashScreen();

ready.addListener(new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> ov, Boolean t, Boolean t1) {
Platform.runLater(new Runnable() {
public void run() {
rpc.stopPolling();

rpc.pollForInfo(10 * 1000);
startMainWindow();
preloader.stopSpinner();
preloader.hide();
}
});

ready.addListener(
new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> ov, Boolean t,
Boolean t1
) {
Platform.runLater(new Runnable() {
public void run() {
rpc.stopPolling();

rpc.pollForInfo(30 * 1000);
startMainWindow();
preloader.stopSpinner();
preloader.hide();
}
});
}
}

});
);

}

Expand Down Expand Up @@ -177,7 +179,7 @@ protected Void call() throws Exception {
/*if (!checkForStatus && progress == "none") {

}*/
} while (!status.equals("inactive") || (status.equals("inactive") && startupStatus != null)); //&& !progress.equals("none")))
} while (!status.equals("inactive") || (status.equals("inactive") && startupStatus != null));
ready.setValue(Boolean.TRUE);

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ of the License (see COPYING and COPYING.addendum).
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
import lombok.Getter;
Expand Down Expand Up @@ -61,14 +60,14 @@ public void initialize(URL url, ResourceBundle rb) {
}

public void propertyChange(PropertyChangeEvent event) {
if (event.getPropertyName().equals(wallet.MONEYSUPPLY_PROPERTY)) {
/*if (event.getPropertyName().equals(wallet.MONEYSUPPLY_PROPERTY)) {
String sValue = String.format("%.8f", (double) event.getNewValue());
debug.log(String.format("Money supply: %s", sValue));
Label supply = (Label) window.lookup("txtSupply");
if (supply != null) {
supply.setText(sValue);
}
}
}*/
if (event.getPropertyName().equals(wallet.PROCESSING_PROPERTY)) {
if (wallet.getProcessingStatus()) {
String status = String.format("processing status %s",
Expand Down Expand Up @@ -110,7 +109,6 @@ private void onMinimize(MouseEvent event) {
}

public void startSpinner() {

spinner.setVisible(true);
rt = new RotateTransition(Duration.millis(50000), spinner);
rt.setByAngle(20000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ private void onShown(WindowEvent event) {
debug.log("Shown event executing.");
window.getTransactionsController().onShown();
window.getAddressController().onShown();
// testing
//window.getWindowBarController().startSpinner();
} catch (Exception e) {
debug.log(String.format("ERROR: (onShown) %s", e.getMessage()));
}
Expand Down
23 changes: 18 additions & 5 deletions src/main/resources/org/unigrid/janus/view/component/windowBar.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,38 @@

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.text.Font?>
<?import org.kordamp.ikonli.javafx.FontIcon?>
<?import org.unigrid.janus.view.component.WindowBarButton?>

<HBox alignment="TOP_RIGHT" maxHeight="-Infinity" minWidth="-Infinity" prefHeight="20.0" style="-fx-background-color: linear-gradient(from 25px 25px to 100px 100px, #e72, #ff9500);" stylesheets="@../main.css" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.unigrid.janus.controller.component.WindowBarController">
<HBox alignment="TOP_RIGHT" maxHeight="-Infinity" minWidth="-Infinity" prefHeight="20.0" style="-fx-background-color: linear-gradient(from 25px 25px to 100px 100px, #e72, #ff9500);" stylesheets="@../main.css" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.unigrid.janus.controller.component.WindowBarController">
<children>
<HBox fx:id="handle" onMouseEntered="#onDecorateMove" HBox.hgrow="ALWAYS">
<HBox fx:id="handle" alignment="CENTER_LEFT" onMouseEntered="#onDecorateMove" HBox.hgrow="ALWAYS">
<children>
<Label fx:id="txtSupply" text="DECENTRALIZE" textFill="WHITE">
<ImageView fitHeight="20.0" fitWidth="20.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../images/unigrid-round_77x77.png" />
</image>
</ImageView>
<Label text="UNIGRID" textFill="WHITE">
<font>
<Font name="System Bold" size="14.0" />
</font>
<HBox.margin>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
</HBox.margin>
</Label>
</children></HBox>
<FontIcon fx:id="spinner" iconColor="WHITE" iconLiteral="fas-spinner" iconSize="20" styleClass="spinner">
</children>
<opaqueInsets>
<Insets />
</opaqueInsets>
<padding>
<Insets left="10.0" />
</padding></HBox>
<FontIcon fx:id="spinner" iconColor="WHITE" iconLiteral="fas-spinner" iconSize="20" styleClass="spinner" visible="false">
<HBox.margin>
<Insets top="8.0" />
</HBox.margin>
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/org/unigrid/janus/view/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
body{
margin: 0;
background: var(--s-loader-wrapper-bg-color, rgb(21,22,43));
heigth: 100vh;
height: 100vh;
width: 100%;
display: flex;
align-items: center;
Expand All @@ -196,7 +196,7 @@ body{

.spinner-loader{
width: var(--s-loader-width);
heigth: var(--s-loader-heigth);
height: var(--s-loader-heigth);

border: 5px solid var(--s-loader-color-trans);
border-left-color: var(--s-loader-colot-full);
Expand All @@ -217,4 +217,4 @@ body{
to{
transform: rotate(360deg);
}
}
}