Skip to content

Commit

Permalink
Add possiblity to set field max height in imagecapture preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
GenieTim committed Oct 28, 2019
1 parent d2f66b4 commit 89e95b8
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ deploy:
file_glob: true
file: target/DataShot*.jar
skip_cleanup: true
name: "DataShot V$TRAVIS_TAG"
name: "DataShot $TRAVIS_TAG"
prerelease: false
draft: true
on:
Expand Down
45 changes: 23 additions & 22 deletions imagecapture.properties
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
#DataShot 1.9.0-SNAPSHOT Properties
#Sun Oct 27 16:25:43 CET 2019
hibernate.connection.password=
configuration.specificcollection=ETHZ-ENT
picklist.filterlength=3
images.thumbnailheight=120
images.basedirectory=F\:/OneDrive/Bernhard Webstudio/Auftraege/Entomologische Sammlung ETHZ/Beispiele
numbertypes.showall=false
#DataShot 1.9.3-SNAPSHOT Properties
#Mon Oct 28 20:10:53 CET 2019
program.convert=/usr/bin/convert
browse.enabled=false
images.metadatacontainsbarcode=false
images.regexdrawernumber=[0-9]{3}\\Q.\\E[0-9]+
program.mogrify=mogrify
configuration.collection=ETHZ-ENT
images.filenameregex=^ETHZ_ENT[0-9]{2}_[0-9]{4}_[0-9]{2}_[0-9]{2}_[0-9]{6}\\.JPG$
numbertypes.showall=false
program.tesseract=tesseract
images.barcoderescalesize=200brighter,200dimmer,400dimmer,400,600sharpen,600brighter,600dimmer,400sharpenbrighter,600sharpendimmer
hibernate.connection.username=root
hibernate.connection.url=jdbc\:mysql\://localhost\:3306/lepidoptera?serverTimezone\=Europe/Zurich
fileload.lastpath=
images.metadatacontainsbarcode=false
images.thumbnailwidth=80
program.convert=/usr/bin/convert
program.tesseract=tesseract
images.regexdrawernumber=[0-9]{3}\\Q.\\E[0-9]+
images.basedirectoryurimap=
images.basedirectory=F\:/OneDrive/Bernhard Webstudio/Auftraege/Entomologische Sammlung ETHZ/Beispiele
template.default=ETHZ_template2
login.showadvanced=false
hibernate.connection.username=root
details.scroll=none
browse.enabled=false
scanonebarcode.lastpath=Z\:\\2017_05_09R\\ETHZ_ENT01_2017_05_09_027741.JPG
default.preparation=pinned
images.zxingalsotryharder=true
display.collection=ETH Entomological Collection
images.basedirectoryurimap=
editor.fields.maxHeight=50
images.thumbnailwidth=80
images.thumbnailheight=120
configuration.specificcollection=ETHZ-ENT
hibernate.connection.password=
picklist.filterlength=3
convert.parameters=\ -depth 8 -compress None -type Grayscale
program.mogrify=mogrify
hibernate.connection.url=jdbc\:mysql\://localhost\:3306/lepidoptera?serverTimezone\=Europe/Zurich
scanonebarcode.lastpath=Z\:\\2017_05_09R\\ETHZ_ENT01_2017_05_09_027741.JPG
images.filenameregex=^ETHZ_ENT[0-9]{2}_[0-9]{4}_[0-9]{2}_[0-9]{2}_[0-9]{6}\\.JPG$
login.showadvanced=false
images.zxingalsotryharder=true
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,12 @@ public class ImageCaptureProperties extends AbstractTableModel {
* Show the login dialog with the advanced options open by default (desirable for
* developers working with development/test/production databases) if true.
*/
public static final String KEY_LOGIN_SHOW_ADVANCED = "login.showadvanced";
public static final String KEY_LOGIN_SHOW_ADVANCED = "login.showadvanced";

/**
* The maximum height for editor fields
*/
public static final String KEY_MAX_FIELD_HEIGHT = "editor.fields.maxHeight";


private static final Log log = LogFactory.getLog(ImageCaptureProperties.class);
Expand Down Expand Up @@ -266,7 +271,7 @@ public static String getPathBelowBase(File aFilename, String fileSeparator) {
}

if (fileSeparator.equals("\\")) {
if (!base.endsWith("\\")) { base = base + "\\"; }
if (!base.endsWith("\\")) { base = base + "\\\\"; }
// the separator "\" is represented in java as "\\" and in a java regular expression as "\\\\"
base = base.replaceAll("\\\\", "\\\\\\\\");
} else {
Expand Down Expand Up @@ -531,6 +536,9 @@ private void checkDefaults() {
if (!properties.containsKey(KEY_DEFAULT_TEMPLATES)) {
properties.setProperty(KEY_DEFAULT_TEMPLATES, PositionTemplate.TEMPLATE_DEFAULT);
}
if (!properties.containsKey(KEY_MAX_FIELD_HEIGHT)) {
properties.setProperty(KEY_MAX_FIELD_HEIGHT, "100");
}

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1317,10 +1317,8 @@ private JTextField getLastUpdatedByJTextField() {
*/
private JScrollPane getJScrollPaneCollectors() {
if (jScrollPaneCollectors == null) {
jScrollPaneCollectors = new JScrollPane();
jScrollPaneCollectors = this.getBasicWrapperJScrollPane();
jScrollPaneCollectors.setViewportView(getJTableCollectors());
jScrollPaneCollectors.setMaximumSize(new Dimension(1000, 100));
jScrollPaneCollectors.addMouseWheelListener(new MouseWheelScrollListener(jScrollPaneCollectors));
jScrollPaneCollectors.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent e) {
thisPane.setStateToDirty();
Expand Down Expand Up @@ -1400,15 +1398,13 @@ public void actionPerformed(ActionEvent e) {

private JScrollPane getJScrollPaneSpecimenParts() {
if (jScrollPaneSpecimenParts == null) {
jScrollPaneSpecimenParts = new JScrollPane();
jScrollPaneSpecimenParts = this.getBasicWrapperJScrollPane();
jScrollPaneSpecimenParts.setViewportView(getJTableSpecimenParts());
jScrollPaneSpecimenParts.setMaximumSize(new Dimension(1000, 100));
jScrollPaneSpecimenParts.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent e) {
thisPane.setStateToDirty();
}
});
jScrollPaneSpecimenParts.addMouseWheelListener(new MouseWheelScrollListener(jScrollPaneSpecimenParts));
}
return jScrollPaneSpecimenParts;
}
Expand Down Expand Up @@ -1543,15 +1539,13 @@ private JTextField getDateCreatedJTextField() {
*/
private JScrollPane getNumbersJScrollPane() {
if (jScrollPaneNumbers == null) {
jScrollPaneNumbers = new JScrollPane();
jScrollPaneNumbers = this.getBasicWrapperJScrollPane();
jScrollPaneNumbers.setViewportView(getNumberJTable());
jScrollPaneNumbers.setMaximumSize(new Dimension(1000, 100));
jScrollPaneNumbers.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent e) {
thisPane.setStateToDirty();
}
});
jScrollPaneNumbers.addMouseWheelListener(new MouseWheelScrollListener(jScrollPaneNumbers));
}
return jScrollPaneNumbers;
}
Expand Down Expand Up @@ -2671,18 +2665,23 @@ public void keyTyped(java.awt.event.KeyEvent e) {
return jTextFieldCitedInPub;
}

private JScrollPane getBasicWrapperJScrollPane() {
JScrollPane pane = new JScrollPane();
pane.addMouseWheelListener(new MouseWheelScrollListener(pane));
int maxHeight = Integer.parseInt(Singleton.getSingletonInstance().getProperties().getProperties().getProperty(ImageCaptureProperties.KEY_MAX_FIELD_HEIGHT));
pane.setMaximumSize(new Dimension(1000, maxHeight));
return pane;
}

/**
* This method initializes jScrollPane1
*
* @return javax.swing.JScrollPane
*/
private JScrollPane getJScrollPaneNotes() {
if (jScrollPaneNotes == null) {
jScrollPaneNotes = new JScrollPane();
jScrollPaneNotes = this.getBasicWrapperJScrollPane();
jScrollPaneNotes.setViewportView(getJTextAreaNotes());
jScrollPaneNotes.setPreferredSize(new Dimension(0, 50));
jScrollPaneNotes.setMinimumSize(new Dimension(0, 50));
jScrollPaneNotes.addMouseWheelListener(new MouseWheelScrollListener(jScrollPaneNotes));
//jScrollPaneNotes.add(getJTextAreaNotes()); //allie!!!
}
return jScrollPaneNotes;
Expand Down

0 comments on commit 89e95b8

Please sign in to comment.