Skip to content

Commit

Permalink
version 0.9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioGabrielAndrade committed Aug 4, 2017
2 parents 5227dec + e8ccee3 commit ae951bd
Show file tree
Hide file tree
Showing 38 changed files with 452 additions and 161 deletions.
Binary file modified docs/images/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/increased-size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/increased-space.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/new-collection-dialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/search-result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The "Create Collection" dialog will show. You have to inform a collection name,
the directory that contains the images, and select at least one Feature to index
the collection. Click the "Create" button to start the collection creation routine:

![Create Collection Dialog](images/create-collection-dialog.png)
![Create Collection Dialog](images/new-collection-dialog.png)

The creation process happens in two steps: first a LIRE/Lucene index is created,
and then the image's thumbnails are generated. A dialog will show, informing the
Expand Down Expand Up @@ -107,3 +107,15 @@ to visually compare the results of two features:
![Two Features](images/two-results-small.png)


<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-104070723-1', 'auto');
ga('send', 'pageview');

</script>


8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>br.com.antoniogabriel</groupId>
<groupId>net.lirelab</groupId>
<artifactId>lirelab</artifactId>
<version>0.9.4</version>
<version>0.9.5</version>

<name>LIRE-Lab</name>
<description>Desktop Image Retrieval tool based on the LIRE library</description>
<url>https://github.com/AntonioGabrielAndrade/LIRE-Lab</url>
<description>Desktop Image Retrieval tool based on the LIRE Java library</description>
<url>lirelab.net</url>
<inceptionYear>2017</inceptionYear>

<properties>
Expand Down
46 changes: 13 additions & 33 deletions src/main/java/net/lirelab/app/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,20 @@

package net.lirelab.app;

import net.lirelab.util.DependencyInjection;
import javafx.application.Application;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import net.lirelab.util.FxUtils;
import net.lirelab.util.DependencyInjection;

import javax.inject.Inject;

import static net.lirelab.util.FxUtils.runOnFxThreadAndWait;

public class App extends Application {

private static Image lirelab_16;
private static Image lirelab_24;
private static Image lirelab_32;
private static Image lirelab_48;
private static Image lirelab_64;
private static Image lirelab_72;
private static Image lirelab_96;
private static Image lirelab_128;

@Inject private AppFXML appFXML;
Expand All @@ -47,55 +44,38 @@ public static void main(String[] args) {

@Override
public void init() {
initAppIcons();
createStageIcons();
DependencyInjection.init(this);
showSplashScreen();
setupAndShowSplashScreen();
}

@Override
public void start(Stage stage) {
setIconsTo(stage);
showApplication(stage);
stage.setMaximized(true);
appFXML.loadIn(stage);
}

private void initAppIcons() {
FxUtils.runOnFxThreadAndWait(() -> {
private void createStageIcons() {
runOnFxThreadAndWait(() -> {
lirelab_16 = new Image(App.class.getClassLoader().getResourceAsStream("app_icons/lirelab_16.png"));
lirelab_24 = new Image(App.class.getClassLoader().getResourceAsStream("app_icons/lirelab_24.png"));
lirelab_32 = new Image(App.class.getClassLoader().getResourceAsStream("app_icons/lirelab_32.png"));
lirelab_48 = new Image(App.class.getClassLoader().getResourceAsStream("app_icons/lirelab_48.png"));
lirelab_64 = new Image(App.class.getClassLoader().getResourceAsStream("app_icons/lirelab_64.png"));
lirelab_72 = new Image(App.class.getClassLoader().getResourceAsStream("app_icons/lirelab_72.png"));
lirelab_96 = new Image(App.class.getClassLoader().getResourceAsStream("app_icons/lirelab_96.png"));
lirelab_128 = new Image(App.class.getClassLoader().getResourceAsStream("app_icons/lirelab_128.png"));
});
}

private void showSplashScreen() {
FxUtils.runOnFxThreadAndWait(() -> {
private void setupAndShowSplashScreen() {
runOnFxThreadAndWait(() -> {
Stage splashStage = new Stage();
setIconsTo(splashStage);
splash.loadIn(splashStage);
});
}

private void showApplication(Stage stage) {
FxUtils.runOnFxThreadAndWait(() -> {
stage.setMaximized(true);
appFXML.loadIn(stage);
});
}

private void setIconsTo(Stage stage) {
FxUtils.runOnFxThreadAndWait(() -> {
stage.getIcons().addAll(lirelab_16,
lirelab_24,
lirelab_32,
lirelab_48,
lirelab_64,
lirelab_72,
lirelab_96,
lirelab_128);
runOnFxThreadAndWait(() -> {
stage.getIcons().addAll(lirelab_16, lirelab_32, lirelab_48, lirelab_128);
});
}
}
21 changes: 20 additions & 1 deletion src/main/java/net/lirelab/collection/Collection.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@
import java.util.List;

@XmlRootElement
@XmlType(propOrder = {"name", "imagesDirectory", "features"})
@XmlType(propOrder = {"name", "description", "imagesDirectory", "features"})
@XmlAccessorType(XmlAccessType.FIELD)
public class Collection {

@XmlElement
private String name = "";

@XmlElement
private String description = "";

@XmlElement
private String imagesDirectory = "";

Expand All @@ -57,6 +60,14 @@ public String getName() {
return name;
}

public void setDescription(String description) {
this.description = description;
}

public String getDescription() {
return description;
}

public void setFeatures(List<Feature> features) {
this.features = features;
}
Expand All @@ -65,6 +76,14 @@ public List<Feature> getFeatures() {
return features;
}

public Feature getFeature(int index) {
return features.get(index);
}

public int totalFeatures() {
return features.size();
}

public void setImagesDirectory(String imagesDirectory) {
this.imagesDirectory = imagesDirectory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public class CreateCollectionController implements Initializable {

@FXML private DialogHeader dialogHeader;
@FXML private TextField nameField;
@FXML private TextField descriptionField;
@FXML private TextField imagesDirectoryField;
@FXML private CheckBox scanSubdirectoriesCheckbox;
@FXML private Spinner<Integer> thumbnailHeight;
Expand Down Expand Up @@ -117,6 +118,7 @@ private void close(ActionEvent event) {
@FXML
private void createCollection(ActionEvent event) {
CreateCollectionInfo createInfo = new CreateCollectionInfo(collectionName(),
collectionDescription(),
imagesDirectory(),
collectionFeatures(),
scanSubdirectories(),
Expand Down Expand Up @@ -227,4 +229,8 @@ private List<Feature> collectionFeatures() {
private String collectionName() {
return nameField.getText();
}

private String collectionDescription() {
return descriptionField.getText();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

public class CreateCollectionInfo {
private final String collectionName;
private final String collectionDescription;
private final String imagesDirectory;
private final List<Feature> features;
private final boolean scanSubdirectories;
Expand All @@ -33,6 +34,7 @@ public class CreateCollectionInfo {
private final int numberOfThreads;

public CreateCollectionInfo(String collectionName,
String collectionDescription,
String imagesDirectory,
List<Feature> features,
boolean scanSubdirectories,
Expand All @@ -41,6 +43,7 @@ public CreateCollectionInfo(String collectionName,
int numberOfThreads) {

this.collectionName = collectionName;
this.collectionDescription = collectionDescription;
this.imagesDirectory = imagesDirectory;
this.features = features;
this.scanSubdirectories = scanSubdirectories;
Expand All @@ -53,6 +56,10 @@ public String getCollectionName() {
return collectionName;
}

public String getCollectionDescription() {
return collectionDescription;
}

public String getImagesDirectory() {
return imagesDirectory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ public CreateCollectionRunner getCreateRunner(CreateCollectionInfo createInfo) {

CollectionXMLDAO xmlDAO = new CollectionXMLDAO(new File(collectionPath));
XMLCreator xmlCreator = new XMLCreator(createInfo.getCollectionName(),
createInfo.getImagesDirectory(),
createInfo.getFeatures(),
xmlDAO);
createInfo.getCollectionDescription(),
createInfo.getImagesDirectory(),
createInfo.getFeatures(),
xmlDAO);

return new CreateCollectionRunner(indexCreator, thumbnailsCreator, xmlCreator);
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/net/lirelab/collection/XMLCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,20 @@
public class XMLCreator {

private final String collectionName;
private final String collectionDescription;
private final String imagesDir;
private final List<Feature> features;
private CollectionXMLDAO xmlDAO;
private XMLCreatorCallback callback = new DumbXMLCreatorCallback();

public XMLCreator(String collectionName,
String collectionDescription,
String imagesDir,
List<Feature> features,
CollectionXMLDAO xmlDAO) {

this.collectionName = collectionName;
this.collectionDescription = collectionDescription;
this.imagesDir = imagesDir;
this.features = features;
this.xmlDAO = xmlDAO;
Expand All @@ -48,6 +51,7 @@ public void create() throws JAXBException {

Collection collection = new Collection();
collection.setName(collectionName);
collection.setDescription(collectionDescription);
collection.setFeatures(features);
collection.setImagesDirectory(imagesDir);

Expand Down
36 changes: 29 additions & 7 deletions src/main/java/net/lirelab/collection/create-collection.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,35 @@
<Insets top="20" bottom="30" left="20" right="20"/>
</padding>

<HBox spacing="5"
alignment="BASELINE_CENTER"
GridPane.rowIndex="0"
GridPane.columnIndex="0">
<Label text="Collection name:"/>
<TextField id="collection-name" fx:id="nameField" HBox.hgrow="ALWAYS"/>
</HBox>
<GridPane GridPane.rowIndex="0"
GridPane.columnIndex="0"
hgap="10"
vgap="10">

<columnConstraints>
<ColumnConstraints halignment="RIGHT"/>
<ColumnConstraints hgrow="ALWAYS"/>
</columnConstraints>

<Label text="Name:"
GridPane.rowIndex="0"
GridPane.columnIndex="0"/>

<TextField id="collection-name"
fx:id="nameField"
GridPane.rowIndex="0"
GridPane.columnIndex="1"/>

<Label text="Description:"
GridPane.rowIndex="1"
GridPane.columnIndex="0"/>

<TextField id="description" fx:id="descriptionField"
GridPane.rowIndex="1"
GridPane.columnIndex="1"/>

</GridPane>


<TitledPane text="Images"
collapsible="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,35 @@

package net.lirelab.custom.collection_detail;

import net.lirelab.app.Command;
import net.lirelab.app.CommandTriggerFactory;
import net.lirelab.app.LireLabException;
import net.lirelab.collection.Collection;
import net.lirelab.custom.paginated_collection_grid.PaginatedCollectionGrid;
import net.lirelab.lire.Feature;
import javafx.collections.FXCollections;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.Button;
import javafx.scene.control.ListView;
import javafx.scene.control.TextField;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import net.lirelab.app.Command;
import net.lirelab.app.CommandTriggerFactory;
import net.lirelab.app.HomeController;
import net.lirelab.app.LireLabException;
import net.lirelab.collection.Collection;
import net.lirelab.custom.paginated_collection_grid.PaginatedCollectionGrid;
import net.lirelab.lire.Feature;

import java.io.IOException;
import java.util.List;

import static javafx.collections.FXCollections.observableArrayList;

public class CollectionDetail extends BorderPane {

private static final String COLLECTION_DETAIL_FXML = "collection-detail.fxml";

@FXML private BorderPane center;
@FXML private TextField nameField;
@FXML private TextField totalField;
@FXML private TextField descriptionField;
@FXML private ListView<Feature> featuresField;
@FXML private HBox topLine;
@FXML private StackPane topLine;

private CommandTriggerFactory<Collection> commandTriggerFactory = new CommandTriggerFactory<>();

Expand Down Expand Up @@ -92,6 +91,7 @@ private void show(Collection collection) {
private void showInfoOnTop(Collection collection) {
nameField.setText(collection.getName());
totalField.setText(collection.totalImages() + "");
descriptionField.setText(collection.getDescription());

featuresField.setItems(FXCollections.observableArrayList(collection.getFeatures()));

Expand Down
Loading

0 comments on commit ae951bd

Please sign in to comment.