Skip to content

Commit

Permalink
Version 1.26 release
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Winning <jason.winning@gmail.com>
  • Loading branch information
jasonwinning committed Jun 28, 2023
1 parent 94e92d0 commit eea8ded
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 66 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.hypernomicon</groupId>
<artifactId>hypernomicon</artifactId>
<packaging>jar</packaging>
<version>1.25.1</version>
<version>1.26</version>
<name>Hypernomicon</name>
<url>http://hypernomicon.org</url>
<inceptionYear>2012</inceptionYear>
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/org/hypernomicon/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public final class Const
* Change this and the version in pom.xml to set the application version
* <br>
*/
public static final VersionNumber appVersion = new VersionNumber(1, 25, 1); // 1.25.1
public static final VersionNumber appVersion = new VersionNumber(1, 26); // 1.26

/**
* This is the minimum version that the application version is able to load
Expand Down Expand Up @@ -290,7 +290,8 @@ public final class Const
.put(new VersionNumber(1, 22, 1), new VersionNumber(1, 3))
.put(new VersionNumber(1, 22, 2), new VersionNumber(1, 4))
.put(new VersionNumber(1, 23, 1), new VersionNumber(1, 5))
.put(appVersion, new VersionNumber(1, 6))
.put(new VersionNumber(1, 25, 1), new VersionNumber(1, 6))
.put(appVersion, new VersionNumber(1, 7))
.build();

/**
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/org/hypernomicon/bib/BibManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,7 @@ public BibManager()

dialogStage.focusedProperty().addListener((ob, oldValue, newValue) ->
{
if (ui.windows.getCyclingFocus())
return;

if (Boolean.TRUE.equals(newValue) == false)
if (ui.windows.getCyclingFocus() || (Boolean.TRUE.equals(newValue) == false))
return;

ui.windows.push(dialogStage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
public class HDT_Institution extends HDT_RecordBase
{
public static final int UNIV_SYS_INST_TYPE_ID = 1,
SCHOOL_INST_TYPE_ID = 5,
COLLEGE_SYS_INST_TYPE_ID = 6,
FACULTY_INST_TYPE_ID = 9,
DEPARTMENT_INST_TYPE_ID = 10;
Expand Down Expand Up @@ -67,8 +68,6 @@ public HDT_Institution(RecordState xmlState, HyperDataset<HDT_Institution> datas

public void setCity(String newCity) { updateTagString(tagCity, newCity); }
public String getCity() { return getTagString(tagCity); }
public boolean isDeptOrFaculty() { return (instType.getID() == FACULTY_INST_TYPE_ID) ||
(instType.getID() == DEPARTMENT_INST_TYPE_ID); }

public void setURL(String newURL) { updateTagString(tagWebURL, newURL); }
public String getURL() { return getTagString(tagWebURL); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import org.hypernomicon.dialogs.HyperDlg;
import org.hypernomicon.model.records.SimpleRecordTypes.HDT_WorkType;
import org.hypernomicon.model.records.SimpleRecordTypes.WorkTypeEnum;
import org.hypernomicon.view.wrappers.HyperTable;
import org.hypernomicon.view.wrappers.HyperTableRow;

Expand All @@ -41,7 +42,7 @@ public class ExclWorkTypesDlgCtrlr extends HyperDlg

@FXML private TableView<HyperTableRow> tv;

private HyperTable hyperTable;
private final HyperTable hyperTable;

//---------------------------------------------------------------------------

Expand All @@ -54,7 +55,7 @@ public ExclWorkTypesDlgCtrlr(Set<HDT_WorkType> set, String componentType)
hyperTable.addCheckboxCol();
hyperTable.addLabelCol(hdtWorkType);

hyperTable.buildRows(db.workTypes, (row, workType) ->
hyperTable.buildRows(db.workTypes.stream().filter(workType -> workType.enumVal() != WorkTypeEnum.wtUnenteredSet), (row, workType) ->
{
row.setCheckboxValue(0, set.contains(workType));
row.setCellValue(1, workType, workType.name());
Expand All @@ -72,7 +73,7 @@ public ExclWorkTypesDlgCtrlr(Set<HDT_WorkType> set, String componentType)
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

public Stream<HDT_WorkType> exclTypes()
Stream<HDT_WorkType> exclTypes()
{
return hyperTable.dataRowStream().filter(row -> row.getCheckboxValue(0)).map(HyperTableRow::getRecord);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static class WorkFileNameComponent
*
* @param prefNdx 1-based index used for preference keys
*/
public WorkFileNameComponent(int prefNdx)
private WorkFileNameComponent(int prefNdx)
{
type = WorkFileNameComponentType.forInteger(db.prefs.getInt(PREF_KEY_FN_COMPONENT + prefNdx, 0));
beforeSep = db.prefs.get(PREF_KEY_FN_BEFORE_SEP + prefNdx, "");
Expand Down Expand Up @@ -161,7 +161,7 @@ private void saveToPrefs(int prefNdx)
db.prefs.put(PREF_KEY_FN_AFTER_SEP + prefNdx, afterSep );
db.prefs.put(PREF_KEY_FN_TEST + prefNdx, testStr );

String prefStr = excludedWorkTypes.stream().map(workType -> String.valueOf(workType.getID())).reduce((s1, s2) -> s1 + ";" + s2).orElse("");
String prefStr = excludedWorkTypes.stream().map(workType -> String.valueOf(workType.getID())).reduce((s1, s2) -> s1 + ';' + s2).orElse("");
db.prefs.put(PREF_KEY_FN_EXCL_WORK_TYPES + prefNdx, prefStr);
}

Expand Down Expand Up @@ -225,7 +225,7 @@ public static List<WorkFileNameComponent> loadFromPrefs()

}, row -> refreshExample());

hyperTable.addChangeOrderMenuItem(true, () -> refreshExample());
hyperTable.addChangeOrderMenuItem(true, this::refreshExample);

lblExample.setOnMouseClicked(event -> refreshExample());

Expand Down Expand Up @@ -386,15 +386,15 @@ private List<WorkFileNameComponent> saveComponentsFromTableToList()
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

private WorkFileNameComponent getComponentFromRow(HyperTableRow row)
private static WorkFileNameComponent getComponentFromRow(HyperTableRow row)
{
return new WorkFileNameComponent(WorkFileNameComponentType.forInteger(row.getID(0)), row.getText(1), row.getText(2), row.getText(3), row.getText(4), row.getText(5));
}

//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

private void setExclWorkTypesCellValue(Stream<HDT_WorkType> workTypes, HyperTableRow row)
private static void setExclWorkTypesCellValue(Stream<HDT_WorkType> workTypes, HyperTableRow row)
{
row.setCellValue(1, workTypes.map(HDT_WorkType::name).reduce((s1, s2) -> s1 + "; " + s2).orElse(""), hdtNone);
}
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/org/hypernomicon/view/tabs/InstTabCtrlr.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import static org.hypernomicon.App.*;
import static org.hypernomicon.model.HyperDB.*;
import static org.hypernomicon.Const.*;
import static org.hypernomicon.model.records.HDT_Institution.*;
import static org.hypernomicon.model.records.RecordType.*;
import static org.hypernomicon.model.relations.RelationSet.RelationType.*;
import static org.hypernomicon.util.UIUtil.*;
Expand Down Expand Up @@ -232,7 +233,7 @@ public InstTabCtrlr(Tab tab) throws IOException
row.setCellValue(3, subInst, subInst.getURL());
});

if (curInst.isDeptOrFaculty() && curInst.parentInst.isNotNull())
if (((curInst.instType.getID() == FACULTY_INST_TYPE_ID) || (curInst.instType.getID() == DEPARTMENT_INST_TYPE_ID)) && curInst.parentInst.isNotNull())
{
curInst.parentInst.get().subInstitutions.forEach(sibInst ->
{
Expand Down Expand Up @@ -288,13 +289,7 @@ private void addPersonsFromInst(HDT_Institution nearestChildInst, HDT_Institutio
:
subInst -> addPersonsFromInst(nearestChildInst, subInst, peopleMap));

inst.persons.forEach(person ->
{
if (peopleMap.containsKey(person) == false)
peopleMap.put(person, new HashSet<>());

peopleMap.get(person).add(nearestChildInst);
});
inst.persons.forEach(person -> peopleMap.computeIfAbsent(person, _person -> new HashSet<>()).add(nearestChildInst));
}

//---------------------------------------------------------------------------
Expand All @@ -303,7 +298,12 @@ private void addPersonsFromInst(HDT_Institution nearestChildInst, HDT_Institutio
public static final Predicate<Integer> parentPopFilter = id ->
{
HDT_Institution inst = db.institutions.getByID(id);
if (inst.isDeptOrFaculty() == false) return true;
int typeID = inst.instType.getID();

if ((typeID != FACULTY_INST_TYPE_ID ) &&
(typeID != DEPARTMENT_INST_TYPE_ID) &&
(typeID != SCHOOL_INST_TYPE_ID ))
return true;

return inst.parentInst.isNull() || (inst.subInstitutions.size() > 0);
};
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/hypernomicon/view/wrappers/ButtonCell.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,13 @@ private void setAction(ButtonAction newAction)

Label label = new Label(text);
label.prefWidthProperty().bind(widthProperty().subtract(btn.widthProperty()).subtract(6.0));
AnchorPane.setLeftAnchor(label, 0.0);

AnchorPane.setLeftAnchor(label, 0.0);
AnchorPane.setRightAnchor(btn, 0.0);

ap.getChildren().add(btn);
ap.getChildren().add(label);

setToolTip(this, text);
}
else
Expand Down
49 changes: 18 additions & 31 deletions src/main/resources/org/hypernomicon/dialogs/WelcomeDlg.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -24,48 +24,35 @@
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>

<AnchorPane id="SpecialUI" maxHeight="314.0" minHeight="314.0" minWidth="778.0" prefHeight="314.0"
styleClass="anchor-pane" stylesheets="@welcome.css" xmlns="http://javafx.com/javafx/17"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.hypernomicon.dialogs.WelcomeDlgCtrlr">
<BorderPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
AnchorPane.topAnchor="0.0">
<AnchorPane id="SpecialUI" maxHeight="314.0" minHeight="314.0" minWidth="778.0" prefHeight="314.0" styleClass="anchor-pane" stylesheets="@welcome.css" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.hypernomicon.dialogs.WelcomeDlgCtrlr">
<BorderPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<center>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
prefHeight="314.0" prefWidth="778.0" styleClass="anchor-pane">
<ImageView fitHeight="112.0" fitWidth="94.0" layoutX="37.0" layoutY="33.0" pickOnBounds="true"
preserveRatio="true">
<Image url="@../resources/images/logobig.png"/>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="314.0" prefWidth="798.0" styleClass="anchor-pane">
<ImageView fitHeight="112.0" fitWidth="94.0" layoutX="37.0" layoutY="33.0" pickOnBounds="true" preserveRatio="true">
<Image url="@../resources/images/logobig.png" />
</ImageView>
<Button fx:id="btnNew" layoutX="144.0" layoutY="33.0" mnemonicParsing="false" prefHeight="33.0"
prefWidth="162.0" text="Start a new database" wrapText="true"/>
<Button fx:id="btnClose" layoutX="144.0" layoutY="111.0" mnemonicParsing="false" onAction="#btnCancelClick"
prefHeight="33.0" prefWidth="162.0" text="Close this Window"/>
<TitledPane animated="false" collapsible="false" layoutX="340.0" layoutY="33.0" prefHeight="112.0"
prefWidth="398.0" text="Open recent">
<Button fx:id="btnNew" layoutX="144.0" layoutY="33.0" mnemonicParsing="false" prefHeight="33.0" prefWidth="182.0" text="Start a new database" wrapText="true" />
<Button fx:id="btnClose" layoutX="144.0" layoutY="111.0" mnemonicParsing="false" onAction="#btnCancelClick" prefHeight="33.0" prefWidth="182.0" text="Close this Window" />
<TitledPane animated="false" collapsible="false" layoutX="360.0" layoutY="33.0" prefHeight="112.0" prefWidth="398.0" text="Open recent">
<AnchorPane fx:id="apRecent" minHeight="0.0" minWidth="0.0" prefHeight="85.0" prefWidth="267.0">
<Hyperlink fx:id="linkMore" layoutX="6.0" layoutY="63.0" text="More..."/>
<Hyperlink fx:id="linkMore" layoutX="6.0" layoutY="63.0" text="More..." />
</AnchorPane>
</TitledPane>
<TitledPane animated="false" collapsible="false" layoutX="37.0" layoutY="172.0" prefHeight="112.0"
prefWidth="269.0" text="Training Videos">
<TitledPane animated="false" collapsible="false" layoutX="37.0" layoutY="172.0" prefHeight="112.0" prefWidth="289.0" text="Training Videos">
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="0.0" prefWidth="29.0">
<Hyperlink fx:id="linkIntroVideo" layoutX="6.0" layoutY="3.0" text="Introductory Tutorial"/>
<Hyperlink fx:id="linkFileMgmtVideo" layoutX="6.0" layoutY="22.0"
text="Managing PDFs, Other Files, and Folders"/>
<Hyperlink fx:id="linkRefMgmtVideo" layoutX="6.0" layoutY="41.0"
text="Integration with Zotero and Mendeley"/>
<Hyperlink fx:id="linkIntroVideo" layoutX="6.0" layoutY="3.0" text="Introductory Tutorial" />
<Hyperlink fx:id="linkFileMgmtVideo" layoutX="6.0" layoutY="22.0" text="Managing PDFs, Other Files, and Folders" />
<Hyperlink fx:id="linkRefMgmtVideo" layoutX="6.0" layoutY="41.0" text="Integration with Zotero and Mendeley" />
</AnchorPane>
</TitledPane>
<TitledPane animated="false" collapsible="false" layoutX="340.0" layoutY="172.0" prefHeight="112.0"
prefWidth="399.0" text="Links">
<TitledPane animated="false" collapsible="false" layoutX="360.0" layoutY="172.0" prefHeight="112.0" prefWidth="399.0" text="Links">
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<Hyperlink fx:id="linkForums" layoutX="6.0" layoutY="3.0" text="Discussion Forums"/>
<Hyperlink fx:id="linkWiki" layoutX="6.0" layoutY="26.0" text="Wiki"/>
<Hyperlink fx:id="linkNews" layoutX="6.0" layoutY="49.0" text="News"/>
<Hyperlink fx:id="linkForums" layoutX="6.0" layoutY="3.0" text="Discussion Forums" />
<Hyperlink fx:id="linkWiki" layoutX="6.0" layoutY="26.0" text="Wiki" />
<Hyperlink fx:id="linkNews" layoutX="6.0" layoutY="49.0" text="News" />
</AnchorPane>
</TitledPane>
<Button fx:id="btnOpen" layoutX="144.0" layoutY="72.0" mnemonicParsing="false" prefHeight="33.0"
prefWidth="162.0" text="Open existing database"/>
<Button fx:id="btnOpen" layoutX="144.0" layoutY="72.0" mnemonicParsing="false" prefHeight="33.0" prefWidth="182.0" text="Open existing database" />
</AnchorPane>
</center>
</BorderPane>
Expand Down
Binary file modified src/main/resources/org/hypernomicon/resources/blank_db.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<children>
<TableView fx:id="tv" layoutX="161.0" layoutY="81.0" prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columns>
<TableColumn maxWidth="130.0" minWidth="130.0" prefWidth="130.0" text="Excluded" />
<TableColumn prefWidth="468.0" text="Work Type" />
<TableColumn maxWidth="130.0" minWidth="130.0" prefWidth="130.0" sortable="false" text="Excluded" />
<TableColumn prefWidth="468.0" sortable="false" text="Work Type" />
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
<children>
<TableView fx:id="tv" editable="true" layoutX="119.0" layoutY="-2.0" prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columns>
<TableColumn prefWidth="169.0" text="Component" />
<TableColumn prefWidth="151.0" text="Exclude work types" />
<TableColumn prefWidth="151.0" text="Before-component&#10;separator" />
<TableColumn prefWidth="151.0" text="Within-component&#10;separator" />
<TableColumn prefWidth="151.0" style="-fx-text-alignment: center;" text="After-component&#10;separator" />
<TableColumn prefWidth="244.0" text="Test value (separate by semicolons)" />
<TableColumn prefWidth="169.0" sortable="false" text="Component" />
<TableColumn prefWidth="151.0" sortable="false" text="Exclude work types" />
<TableColumn prefWidth="151.0" sortable="false" text="Before-component&#10;separator" />
<TableColumn prefWidth="151.0" sortable="false" text="Within-component&#10;separator" />
<TableColumn prefWidth="151.0" sortable="false" style="-fx-text-alignment: center;" text="After-component&#10;separator" />
<TableColumn prefWidth="244.0" sortable="false" text="Test value (separate by semicolons)" />
</columns>
</TableView>
</children>
Expand Down

0 comments on commit eea8ded

Please sign in to comment.