Skip to content

Commit

Permalink
Add time fields for items and locations.
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Dec 7, 2024
1 parent 22e50ed commit 2d640ab
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public final class CAGItemDetailsView
@FXML private TabPane mainItemDetails;
@FXML private TextField idField;
@FXML private TextField nameField;
@FXML private TextField timeCreatedField;
@FXML private TextField timeUpdatedField;
@FXML private ImageView thumbnail;
@FXML private ProgressBar thumbnailLoading;
@FXML private ListView<CAAttachment> attachments;
Expand Down Expand Up @@ -262,6 +264,8 @@ private void itemSelectionChanged(
this.mainItemDetails.setDisable(true);
this.idField.setText("");
this.nameField.setText("");
this.timeUpdatedField.setText("");
this.timeCreatedField.setText("");
this.clearThumbnail();
return;
}
Expand All @@ -271,6 +275,8 @@ private void itemSelectionChanged(
this.metaAdd.setDisable(false);
this.idField.setText(newValue.id().toString());
this.nameField.setText(newValue.name());
this.timeCreatedField.setText(newValue.timeCreated().toString());
this.timeUpdatedField.setText(newValue.timeUpdated().toString());
this.clearThumbnail();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public final class CAGLocationDetailsView
@FXML private TextField idField;
@FXML private TextField nameField;
@FXML private ImageView thumbnail;
@FXML private TextField timeCreatedField;
@FXML private TextField timeUpdatedField;
@FXML private ProgressBar thumbnailLoading;
@FXML private TableView<CAMetadataType> meta;
@FXML private TableColumn<CAMetadataType, RDottedName> colPkg;
Expand Down Expand Up @@ -188,6 +190,8 @@ private void locationSelectionChanged(
this.mainItemDetails.setDisable(true);
this.idField.setText("");
this.nameField.setText("");
this.timeUpdatedField.setText("");
this.timeCreatedField.setText("");
this.clearThumbnail();
return;
}
Expand All @@ -196,6 +200,8 @@ private void locationSelectionChanged(
this.mainItemDetails.setDisable(false);
this.idField.setText(newValue.id().toString());
this.nameField.setText(newValue.name().value());
this.timeCreatedField.setText(newValue.timeCreated().toString());
this.timeUpdatedField.setText(newValue.timeUpdated().toString());
this.clearThumbnail();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.Objects;
import java.util.Optional;
import java.util.TreeMap;
import java.util.TreeSet;

import static java.time.ZoneOffset.UTC;

/**
* A location tree controller.
*/
Expand All @@ -58,7 +61,9 @@ public final class CAGLocationTreeController
new CALocationSummary(
ROOT_LOCATION,
Optional.empty(),
CALocationPath.singleton("Everywhere")
CALocationPath.singleton("Everywhere"),
OffsetDateTime.now(UTC),
OffsetDateTime.now(UTC)
);

private final ObservableList<CALocationSummary> locationsView;
Expand Down Expand Up @@ -195,6 +200,8 @@ public void locationCreate(
CALocationID.random(),
Optional.empty(),
CALocationPath.singleton(name),
OffsetDateTime.now(UTC),
OffsetDateTime.now(UTC),
new TreeMap<>(),
new TreeMap<>(),
new TreeSet<>()
Expand All @@ -221,6 +228,8 @@ public void locationReparent(
source.id(),
Optional.of(newParent),
source.path(),
OffsetDateTime.now(UTC),
OffsetDateTime.now(UTC),
source.metadata(),
source.attachments(),
source.types()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

cardant.timeUpdated=Time Updated
cardant.timeCreated=Time Created
cardant.add=Add
cardant.assign=Assign
cardant.attachmentRemove.confirm=Are you sure you want to remove the given attachment? This operation cannot be undone.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.Rectangle?>

<TabPane fx:id="mainItemDetails" prefHeight="480.0" prefWidth="640.0" tabClosingPolicy="UNAVAILABLE" xmlns="http://javafx.com/javafx/21.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.io7m.cardant_gui.ui.internal.CAGItemDetailsView">
<TabPane fx:id="mainItemDetails" prefHeight="480.0" prefWidth="640.0" tabClosingPolicy="UNAVAILABLE" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.io7m.cardant_gui.ui.internal.CAGItemDetailsView">
<tabs>
<Tab text="%cardant.attributes">
<content>
Expand All @@ -34,22 +34,23 @@
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="128.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="8.0" />
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="64.0" />
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="128.0" />
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="8.0" />
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="ALWAYS" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="128.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="32.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="32.0" vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="32.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="32.0" minHeight="10.0" prefHeight="32.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="0.0" minHeight="0.0" prefHeight="0.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="%cardant.id" GridPane.columnIndex="2" />
<TextField fx:id="idField" editable="false" maxHeight="1.7976931348623157E308" styleClass="dataField" GridPane.columnIndex="4" GridPane.columnSpan="2147483647" />
<Label text="%cardant.name" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<TextField fx:id="nameField" editable="false" maxHeight="1.7976931348623157E308" styleClass="dataField" GridPane.columnIndex="4" GridPane.rowIndex="1" />
<Label text="%cardant.id" GridPane.columnIndex="1" />
<TextField fx:id="idField" editable="false" maxHeight="1.7976931348623157E308" styleClass="dataField" GridPane.columnIndex="3" GridPane.columnSpan="2147483647" />
<Label text="%cardant.name" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="nameField" editable="false" maxHeight="1.7976931348623157E308" styleClass="dataField" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<StackPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="128.0" prefWidth="128.0" GridPane.rowSpan="2147483647" GridPane.valignment="TOP">
<children>
<ImageView fx:id="thumbnail" fitHeight="128.0" fitWidth="128.0" pickOnBounds="true" preserveRatio="true">
Expand All @@ -61,7 +62,11 @@
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#ffffff00" height="128.0" stroke="#0000007f" strokeType="INSIDE" width="128.0" />
</children>
</StackPane>
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#onItemNameSetSelected" text="%cardant.itemDetails.nameSet" GridPane.columnIndex="5" GridPane.rowIndex="1" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#onItemNameSetSelected" text="%cardant.itemDetails.nameSet" GridPane.columnIndex="4" GridPane.rowIndex="1" />
<Label layoutX="170.0" layoutY="50.0" text="%cardant.timeCreated" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label layoutX="170.0" layoutY="82.0" text="%cardant.timeUpdated" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<TextField fx:id="timeCreatedField" editable="false" layoutX="282.0" layoutY="10.0" maxHeight="1.7976931348623157E308" styleClass="dataField" GridPane.columnIndex="3" GridPane.columnSpan="2147483647" GridPane.rowIndex="2" />
<TextField fx:id="timeUpdatedField" editable="false" layoutX="282.0" layoutY="74.0" maxHeight="1.7976931348623157E308" styleClass="dataField" GridPane.columnIndex="3" GridPane.columnSpan="2147483647" GridPane.rowIndex="3" />
</children>
</GridPane>
</children>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.Rectangle?>

<TabPane fx:id="mainItemDetails" prefHeight="480.0" prefWidth="640.0" tabClosingPolicy="UNAVAILABLE" xmlns="http://javafx.com/javafx/21.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.io7m.cardant_gui.ui.internal.CAGLocationDetailsView">
<TabPane fx:id="mainItemDetails" prefHeight="480.0" prefWidth="640.0" tabClosingPolicy="UNAVAILABLE" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.io7m.cardant_gui.ui.internal.CAGLocationDetailsView">
<tabs>
<Tab text="%cardant.attributes">
<content>
Expand All @@ -35,22 +35,23 @@
<GridPane AnchorPane.bottomAnchor="8.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="8.0" AnchorPane.topAnchor="8.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="128.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="8.0" />
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="64.0" />
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="128.0" />
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="8.0" />
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="ALWAYS" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="128.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="32.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="32.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="32.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="-Infinity" minHeight="-Infinity" prefHeight="32.0" vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="%cardant.id" GridPane.columnIndex="2" />
<TextField fx:id="idField" editable="false" maxHeight="1.7976931348623157E308" styleClass="dataField" GridPane.columnIndex="4" GridPane.columnSpan="2147483647" />
<Label text="%cardant.name" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<TextField fx:id="nameField" editable="false" maxHeight="1.7976931348623157E308" styleClass="dataField" GridPane.columnIndex="4" GridPane.rowIndex="1" />
<Label text="%cardant.id" GridPane.columnIndex="1" />
<TextField fx:id="idField" editable="false" maxHeight="1.7976931348623157E308" styleClass="dataField" GridPane.columnIndex="3" GridPane.columnSpan="2147483647" />
<Label text="%cardant.name" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField fx:id="nameField" editable="false" maxHeight="1.7976931348623157E308" styleClass="dataField" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<StackPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="128.0" prefWidth="128.0" GridPane.rowSpan="2147483647" GridPane.valignment="TOP">
<children>
<ImageView fx:id="thumbnail" fitHeight="128.0" fitWidth="128.0" pickOnBounds="true" preserveRatio="true">
Expand All @@ -62,7 +63,11 @@
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#ffffff00" height="128.0" stroke="#0000007f" strokeType="INSIDE" width="128.0" />
</children>
</StackPane>
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#onItemNameSetSelected" text="%cardant.locationDetails.nameSet" GridPane.columnIndex="5" GridPane.rowIndex="1" />
<Button maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#onItemNameSetSelected" text="%cardant.locationDetails.nameSet" GridPane.columnIndex="4" GridPane.rowIndex="1" />
<Label layoutX="226.0" layoutY="50.0" text="%cardant.timeCreated" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label layoutX="175.0" layoutY="82.0" text="%cardant.timeUpdated" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<TextField fx:id="timeCreatedField" editable="false" layoutX="274.0" layoutY="10.0" maxHeight="1.7976931348623157E308" styleClass="dataField" GridPane.columnIndex="3" GridPane.columnSpan="2147483647" GridPane.rowIndex="2" />
<TextField fx:id="timeUpdatedField" editable="false" layoutX="274.0" layoutY="74.0" maxHeight="1.7976931348623157E308" styleClass="dataField" GridPane.columnIndex="3" GridPane.columnSpan="2147483647" GridPane.rowIndex="3" />
</children>
</GridPane>
</children>
Expand Down

0 comments on commit 2d640ab

Please sign in to comment.