Skip to content

Commit 727cd8b

Browse files
committed
Version 1.30.3 release
Signed-off-by: Jason Winning <[email protected]>
1 parent 661fd70 commit 727cd8b

File tree

6 files changed

+60
-56
lines changed

6 files changed

+60
-56
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>org.hypernomicon</groupId>
55
<artifactId>hypernomicon</artifactId>
66
<packaging>jar</packaging>
7-
<version>1.30.2</version>
7+
<version>1.30.3</version>
88
<name>Hypernomicon</name>
99
<url>http://hypernomicon.org</url>
1010
<inceptionYear>2012</inceptionYear>

src/main/java/org/hypernomicon/Const.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public final class Const
4141
* Change this and the version in pom.xml to set the application version
4242
* <br>
4343
*/
44-
public static final VersionNumber appVersion = new VersionNumber(1, 30, 2); // 1.30.2
44+
public static final VersionNumber appVersion = new VersionNumber(1, 30, 3); // 1.30.3
4545

4646
/**
4747
* This is the minimum version that the application version (or higher) is able to load

src/main/java/org/hypernomicon/fileManager/FolderHistory.java

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ final class FolderHistory
3434

3535
private final List<FolderHistoryItem> history = new ArrayList<>();
3636
private final Button btnForward, btnBack;
37-
private int ndx = -1;
37+
38+
private int cursorNdx = -1;
3839

3940
//---------------------------------------------------------------------------
4041

@@ -52,7 +53,7 @@ final class FolderHistory
5253
void clear()
5354
{
5455
history.clear();
55-
ndx = -1;
56+
cursorNdx = -1;
5657
updateButtons();
5758
}
5859

@@ -63,33 +64,33 @@ void removeRecord(HDT_Folder folder)
6364
{
6465
if (folder == null) return;
6566

66-
for (int i = 0; i < history.size(); i++)
67+
for (int ndx = 0; ndx < history.size(); ndx++)
6768
{
68-
FolderHistoryItem item = history.get(i);
69+
FolderHistoryItem item = history.get(ndx);
6970

7071
if (item.folder == folder)
7172
{
72-
// Update ndx if it points to or follows the deleted entry
73-
if (i <= ndx)
74-
ndx--;
73+
// Update cursorNdx if it points to or follows the deleted entry
74+
if (ndx <= cursorNdx)
75+
cursorNdx--;
7576

7677
// Remove the matching item
77-
history.remove(i);
78-
i--; // Adjust index to recheck after removal
78+
history.remove(ndx);
79+
ndx--; // Adjust index to recheck after removal
7980
}
80-
else if ((i > 0) && (history.get(i - 1).folder == item.folder))
81+
else if ((ndx > 0) && (history.get(ndx - 1).folder == item.folder))
8182
{
8283
// Remove adjacent duplicates
83-
history.remove(i);
84-
i--; // Adjust index for recheck
84+
history.remove(ndx);
85+
ndx--; // Adjust index for recheck
8586
}
8687
}
8788

88-
// Ensure ndx is valid after all deletions
89-
if (ndx < 0)
90-
ndx = 0; // Default to the first folder if no valid preceding folder exists
91-
else if (ndx >= history.size())
92-
ndx = history.size() - 1; // Default to the last folder if out of bounds
89+
// Ensure cursorNdx is valid after all deletions
90+
if (cursorNdx < 0)
91+
cursorNdx = 0; // Default to the first folder if no valid preceding folder exists
92+
else if (cursorNdx >= history.size())
93+
cursorNdx = history.size() - 1; // Default to the last folder if out of bounds
9394

9495
// Update navigation buttons
9596
updateButtons();
@@ -105,11 +106,11 @@ else if (ndx >= history.size())
105106
*/
106107
void add(FolderHistoryItem newItem)
107108
{
108-
while (history.size() > (ndx + 1))
109-
history.remove(ndx + 1);
109+
while (history.size() > (cursorNdx + 1))
110+
history.remove(cursorNdx + 1);
110111

111112
history.add(newItem);
112-
ndx++;
113+
cursorNdx++;
113114
updateButtons();
114115
}
115116

@@ -118,8 +119,8 @@ void add(FolderHistoryItem newItem)
118119

119120
private void updateButtons()
120121
{
121-
btnBack .setDisable(ndx < 1);
122-
btnForward.setDisable(ndx == (history.size() - 1));
122+
btnBack .setDisable(cursorNdx < 1);
123+
btnForward.setDisable(cursorNdx == (history.size() - 1));
123124
}
124125

125126
//---------------------------------------------------------------------------
@@ -131,9 +132,9 @@ private void updateButtons()
131132
*/
132133
FolderHistoryItem back()
133134
{
134-
ndx--;
135+
cursorNdx--;
135136
updateButtons();
136-
return history.get(ndx);
137+
return history.get(cursorNdx);
137138
}
138139

139140
//---------------------------------------------------------------------------
@@ -145,9 +146,9 @@ FolderHistoryItem back()
145146
*/
146147
FolderHistoryItem forward()
147148
{
148-
ndx++;
149+
cursorNdx++;
149150
updateButtons();
150-
return history.get(ndx);
151+
return history.get(cursorNdx);
151152
}
152153

153154
//---------------------------------------------------------------------------
@@ -159,7 +160,7 @@ FolderHistoryItem forward()
159160
*/
160161
void updateCurrent(FolderHistoryItem newItem)
161162
{
162-
history.set(ndx, newItem);
163+
history.set(cursorNdx, newItem);
163164
}
164165

165166
//---------------------------------------------------------------------------

src/main/java/org/hypernomicon/view/HyperViewSequence.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class HyperViewSequence
5454
//---------------------------------------------------------------------------
5555
//---------------------------------------------------------------------------
5656

57-
private int curNdx = -1;
57+
private int cursorNdx = -1;
5858
private Instant lastArrowKey = Instant.EPOCH;
5959
private final List<HyperView<? extends HDT_Record>> slots = new ArrayList<>();
6060
private final TabPane tabPane;
@@ -104,7 +104,7 @@ public class HyperViewSequence
104104
//---------------------------------------------------------------------------
105105
//---------------------------------------------------------------------------
106106

107-
HyperView<? extends HDT_Record> getViewInCurrentSlot() { return slots.get(curNdx); }
107+
HyperView<? extends HDT_Record> getViewInCurrentSlot() { return slots.get(cursorNdx); }
108108
HyperTab<? extends HDT_Record, ? extends HDT_Record> tabOfViewInCurrentSlot() { return getViewInCurrentSlot().getHyperTab(); }
109109
TabEnum tabEnumOfViewInCurrentSlot() { return getViewInCurrentSlot().getTabEnum(); }
110110
boolean isEmpty() { return slots.isEmpty(); }
@@ -179,8 +179,8 @@ void stepBack()
179179
{
180180
saveViewFromUItoCurrentSlotAndTab();
181181

182-
if (--curNdx < 0)
183-
curNdx = 0;
182+
if (--cursorNdx < 0)
183+
cursorNdx = 0;
184184

185185
showCurrentViewInUI();
186186
}
@@ -219,12 +219,12 @@ void saveViewFromUItoSlotAdvanceCursorAndLoadNewViewToUI(HyperView<? extends HDT
219219
}
220220

221221
// delete any later slots
222-
while (slots.size() > (curNdx + 1))
223-
slots.remove(curNdx + 1);
222+
while (slots.size() > (cursorNdx + 1))
223+
slots.remove(cursorNdx + 1);
224224

225225
// advance the slot cursor (if we were already on a record tab that previously had a record)
226226
if (advance)
227-
goForward(true); // This only changes curNdx
227+
goForward(true); // This only changes cursorNdx
228228

229229
// Save the new view to the current slot
230230
saveViewToCurrentSlot(hyperView);
@@ -247,8 +247,8 @@ private void showCurrentViewInUI()
247247

248248
ui.setSelectorTab(ui.tabOmniSelector);
249249

250-
chbBack .setDisable(curNdx < 1);
251-
chbForward.setDisable(curNdx >= (slots.size() - 1));
250+
chbBack .setDisable(cursorNdx < 1);
251+
chbForward.setDisable(cursorNdx >= (slots.size() - 1));
252252

253253
HDT_Record activeRecord = (curHyperTab.getTabEnum() == treeTabEnum) || (curHyperTab.getTabEnum() == queryTabEnum) ?
254254
curView.getViewRecord()
@@ -294,18 +294,18 @@ void init(TabEnum activeTabEnum)
294294
public void clear()
295295
{
296296
slots.clear();
297-
curNdx = -1;
297+
cursorNdx = -1;
298298
}
299299

300300
//---------------------------------------------------------------------------
301301
//---------------------------------------------------------------------------
302302

303303
private void goForward(boolean okToAddSlotIfNeeded)
304304
{
305-
curNdx++;
305+
cursorNdx++;
306306

307-
if ((okToAddSlotIfNeeded == false) && (curNdx >= slots.size()))
308-
curNdx = slots.size() - 1;
307+
if ((okToAddSlotIfNeeded == false) && (cursorNdx >= slots.size()))
308+
cursorNdx = slots.size() - 1;
309309
}
310310

311311
//---------------------------------------------------------------------------
@@ -317,12 +317,12 @@ private void goForward(boolean okToAddSlotIfNeeded)
317317
*/
318318
private void saveViewToCurrentSlot(HyperView<? extends HDT_Record> view)
319319
{
320-
if (curNdx == -1) curNdx = 0;
320+
if (cursorNdx == -1) cursorNdx = 0;
321321

322-
if (curNdx == slots.size())
322+
if (cursorNdx == slots.size())
323323
slots.add(view);
324324
else
325-
slots.set(curNdx, view);
325+
slots.set(cursorNdx, view);
326326

327327
// This next part prevents duplicate adjacent entries
328328

@@ -337,7 +337,7 @@ private void saveViewToCurrentSlot(HyperView<? extends HDT_Record> view)
337337
if ((lastView != null) && (view.getTabEnum() == lastView.getTabEnum()) && (view.getViewRecord() == lastView.getViewRecord()))
338338
{
339339
it.remove();
340-
if (ndx <= curNdx) curNdx--;
340+
if (ndx <= cursorNdx) cursorNdx--;
341341
view = null;
342342
}
343343

@@ -360,12 +360,12 @@ private void rebuildNavMenu(List<MenuItem> menu, boolean isForward)
360360

361361
if (isForward)
362362
{
363-
for (int ndx = curNdx + 1; ndx < slots.size(); ndx++)
363+
for (int ndx = cursorNdx + 1; ndx < slots.size(); ndx++)
364364
if (addMenuItem(menu, ndx)) return;
365365
}
366366
else
367367
{
368-
for (int ndx = curNdx - 1; ndx >= 0; ndx--)
368+
for (int ndx = cursorNdx - 1; ndx >= 0; ndx--)
369369
if (addMenuItem(menu, ndx)) return;
370370
}
371371
}
@@ -409,7 +409,7 @@ private boolean addMenuItem(List<MenuItem> menu, int ndx)
409409
if (ui.cantSaveRecord()) return;
410410

411411
saveViewFromUItoCurrentSlotAndTab();
412-
curNdx = ndx;
412+
cursorNdx = ndx;
413413
showCurrentViewInUI();
414414
});
415415

@@ -422,14 +422,14 @@ private boolean addMenuItem(List<MenuItem> menu, int ndx)
422422

423423
void removeRecord(HDT_Record record)
424424
{
425-
// Do not change the following code to use ArrayList.removeIf. The line that checks whether curNdx should be decremented will not work
425+
// Do not change the following code to use ArrayList.removeIf. The line that checks whether cursorNdx should be decremented will not work
426426
// because the ArrayList does not actually get modified until all of the removeIf checks are completed.
427427

428428
Iterators.removeIf(slots.iterator(), view ->
429429
{
430430
if (view.getViewRecord() != record) return false;
431431

432-
if (curNdx >= slots.indexOf(view)) curNdx--;
432+
if (cursorNdx >= slots.indexOf(view)) cursorNdx--;
433433
return true;
434434
});
435435
}
@@ -442,7 +442,7 @@ RecordType lastActiveRecordType()
442442
if (slots.isEmpty())
443443
return hdtNone;
444444

445-
for (int ndx = curNdx; ndx >= 0; ndx--)
445+
for (int ndx = cursorNdx; ndx >= 0; ndx--)
446446
{
447447
RecordType recordType = slots.get(ndx).getTabRecordType();
448448
if (recordType != hdtNone)

src/main/java/org/hypernomicon/view/tabs/NoteTabCtrlr.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import java.util.HashSet;
3030
import java.util.Set;
3131

32+
import org.apache.commons.io.FilenameUtils;
33+
3234
import org.hypernomicon.model.records.*;
3335
import org.hypernomicon.dialogs.RenameDlgCtrlr;
3436
import org.hypernomicon.model.items.HyperPath;
@@ -388,9 +390,10 @@ private String createFolderToolTip()
388390

389391
HDT_Folder parentFolder = HyperPath.getFolderFromFilePath(getParentForNewFolder(), true);
390392

391-
if (folderName.isBlank()) return "Assign new folder in parent folder: " + parentFolder.filePath().toString();
392-
393-
return "Assign new folder: " + parentFolder.filePath().resolve(folderName);
393+
return folderName.isBlank() ?
394+
"Assign new folder in parent folder: " + parentFolder.filePath().toString()
395+
:
396+
"Assign new folder: " + FilenameUtils.separatorsToUnix(db.getRootPath().relativize(parentFolder.filePath().resolve(folderName)).toString());
394397
}
395398

396399
//---------------------------------------------------------------------------

src/main/java/org/hypernomicon/view/tabs/PersonTabCtrlr.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public class PersonTabCtrlr extends HyperTab<HDT_Person, HDT_RecordWithMainText>
125125
@FXML public TextField tfFirst, tfLast;
126126

127127
private final List<InvestigationView> invViews = new ArrayList<>();
128-
public final HyperTable htPersonInst, htWorks, htArguments;
128+
private final HyperTable htPersonInst, htWorks, htArguments;
129129
private final HyperCB hcbRank, hcbStatus, hcbSubfield;
130130
private final MainTextWrapper mainText;
131131

0 commit comments

Comments
 (0)