Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bring development branch up to date with master #9

Merged
merged 25 commits into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9355564
start testing JCEF integration
JohnRDOrazio Oct 9, 2020
d2edbda
local JCEF jars
JohnRDOrazio Oct 9, 2020
a15f56d
remove the reference to the JCEF32 library
JohnRDOrazio Oct 9, 2020
ca475f6
remove double semicolon
JohnRDOrazio Oct 11, 2020
950eddb
JCEF component now working using setLayout
JohnRDOrazio Oct 13, 2020
1cdd939
load custom HTML into JCEF browser component
JohnRDOrazio Oct 14, 2020
249996f
refactor and add new Preferences vars
JohnRDOrazio Oct 16, 2020
41678ab
continue reformatting previewDocument from vb.net to java
JohnRDOrazio Oct 18, 2020
372ceb7
continue refactoring userpref variables to new enums
JohnRDOrazio Oct 18, 2020
af0f91f
continue refactoring userpref variables to new enums
JohnRDOrazio Oct 18, 2020
1461ec7
import JsonReader, JsonObject into LocalizedBibleBooks.java
JohnRDOrazio Oct 18, 2020
43a9641
fix hashmap getter in LocalizedBibleBooks
JohnRDOrazio Oct 18, 2020
387e83a
fnish creating LocalizedBibleBooks, and building previewDoc string
JohnRDOrazio Oct 18, 2020
23934ec
move database logic for options from OptionsFrame to Preferences
JohnRDOrazio Oct 19, 2020
f1d1e4f
fix broken USERPREFS members
JohnRDOrazio Oct 19, 2020
b072da9
fix javascript in JCEF, move browser instance to bottom of frame
JohnRDOrazio Oct 19, 2020
c4892c0
implement executejavascript on lineheight change
JohnRDOrazio Oct 19, 2020
968b510
Update README.md
JohnRDOrazio Oct 20, 2020
f1a123c
start rewriting database classes for better readability
JohnRDOrazio Oct 20, 2020
7b5160f
continue adding DB helper functions (not tested)
JohnRDOrazio Oct 21, 2020
6eb95dc
finish database classes rewrite, fresh install works
JohnRDOrazio Oct 21, 2020
f7bbf8b
make sure METADATA table is fully initialized in all cases!
JohnRDOrazio Oct 22, 2020
3615e89
single quotes for strings in SQL statements...
JohnRDOrazio Oct 22, 2020
be9ca2f
the single derby.jar is enough for the embedded driver
JohnRDOrazio Oct 22, 2020
62c2b1d
Merge pull request #8 from BibleGet-I-O/JCEF
JohnRDOrazio Oct 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/nbproject/private/
/dist/
/build/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Insert Bible quotes into your document using standard notation for Bible Quotes

Inserisci citazioni della Bibbia nel tuo documento usando la notazione biblica standard. Questa estensione utilizza il servizio web di BibleGet (https://query.bibleget.io) per reperire le citazioni. L'utente può scegliere la versione biblica dalla quale trarre la citazione, in base alle versioni disponibili sul server. Nuove versioni in varie lingue vengono aggiunte in continuazione. Puoi contribuire a tradurre l'interfaccia in altre lingue qui: https://poeditor.com/join/project/5bkVxO5qsq

Introduzca citas de la Biblia en su documento utilizando la notación bíblica estándar. Esta extensión utiliza el servicio web BibleGet (https://query.bibleget.io) para obtener cotizaciones. El usuario puede elegir la versión bíblica de la cual extraer la citación, de acuerdo a las versiones disponibles en el servidor. Nuevas versiones en varios idiomas se agregan constantemente. Puedes ayudar con la traduccion de la interfaz aqui: https://poeditor.com/join/project/5bkVxO5qsq
Introduzca citas de la Biblia en su documento utilizando la notación bíblica estándar. Esta extensión utiliza el servicio web BibleGet (https://query.bibleget.io) para obtener citas bíblicas. El usuario puede elegir la versión bíblica de la cual extraer la cita, de acuerdo a las versiones disponibles en el servidor. Nuevas versiones en varios idiomas se agregan constantemente. Puedes ayudar con la traduccion de la interfaz aqui: https://poeditor.com/join/project/5bkVxO5qsq

Entrez citations bibliques dans votre document en utilisant la notation biblique standard. Cette extension utilise le service Web BibleGet (https://query.bibleget.io) pour obtenir les citations. L'utilisateur peut choisir la version biblique dont tirer la citation, selon les versions disponibles sur le serveur. Nouvelles versions en différentes langues sont ajoutés en permanence. Pouvez aider avec la traduction de l'interface dans autres langues ici: https://poeditor.com/join/project/5bkVxO5qsq

Expand Down
Binary file added libraries/derby.jar
Binary file not shown.
Binary file added libraries/gluegen-rt-natives-windows-i586.jar
Binary file not shown.
Binary file added libraries/gluegen-rt.jar
Binary file not shown.
Binary file added libraries/jcef-tests.jar
Binary file not shown.
Binary file added libraries/jcef.jar
Binary file not shown.
Binary file added libraries/jogl-all-natives-windows-i586.jar
Binary file not shown.
Binary file added libraries/jogl-all.jar
Binary file not shown.
17 changes: 15 additions & 2 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ debug.test.modulepath=\
${run.test.modulepath}
file.reference.commons-lang3-3.11.jar=libraries/commons-lang3-3.11.jar
file.reference.commons-text-1.9.jar=libraries/commons-text-1.9.jar
file.reference.derby.jar=libraries\\derby.jar
file.reference.glazedlists-1.11.0.jar=libraries/glazedlists-1.11.0.jar
file.reference.gluegen-rt-natives-windows-i586.jar=libraries\\gluegen-rt-natives-windows-i586.jar
file.reference.gluegen-rt.jar=libraries\\gluegen-rt.jar
file.reference.javax.json-1.1.4.jar=libraries/javax.json-1.1.4.jar
file.reference.jcef-tests.jar=libraries\\jcef-tests.jar
file.reference.jcef.jar=libraries\\jcef.jar
file.reference.jogl-all-natives-windows-i586.jar=libraries\\jogl-all-natives-windows-i586.jar
file.reference.jogl-all.jar=libraries\\jogl-all.jar
javac.modulepath=
javac.processormodulepath=
javac.test.modulepath=\
Expand Down Expand Up @@ -71,8 +78,14 @@ javac.classpath=\
${libs.OpenOffice 4.1.7.classpath}:\
${file.reference.commons-lang3-3.11.jar}:\
${file.reference.commons-text-1.9.jar}:\
${libs.JAVADB_DRIVER_LABEL.classpath}:\
${file.reference.javax.json-1.1.4.jar}
${file.reference.javax.json-1.1.4.jar}:\
${file.reference.gluegen-rt-natives-windows-i586.jar}:\
${file.reference.gluegen-rt.jar}:\
${file.reference.jcef-tests.jar}:\
${file.reference.jcef.jar}:\
${file.reference.jogl-all-natives-windows-i586.jar}:\
${file.reference.jogl-all.jar}:\
${file.reference.derby.jar}
javadoc.noindex=false
manifest.custom.codebase=
annotation.processing.enabled.in.editor=false
Expand Down
251 changes: 251 additions & 0 deletions src/io/bibleget/BGET.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
/*
* Copyright 2020 John R. D'Orazio <priest@johnromanodorazio.com>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.bibleget;

import java.util.HashMap;

/**
*
* @author John R. D'Orazio <priest@johnromanodorazio.com>
*/
public class BGET {

public enum ALIGN {
LEFT(1),
CENTER(2),
RIGHT(3),
JUSTIFY(4);

private int value;
private static final HashMap<Integer,ALIGN> map = new HashMap<>();

private ALIGN(int value) {
this.value = value;
}

static {
for (ALIGN align : ALIGN.values()) {
map.put(align.value, align);
}
}

public static ALIGN valueOf(int align) {
return (ALIGN) map.get(align);
}

public int getValue() {
return value;
}

public String getCSSValue(){
return CSSRULE.ALIGN[value-1];
}
}

public enum VALIGN {
SUPERSCRIPT(1),
SUBSCRIPT(2),
NORMAL(3);

private int value;
private static final HashMap<Integer,VALIGN> map = new HashMap<>();

private VALIGN(int value) {
this.value = value;
}

static {
for (VALIGN valign : VALIGN.values()) {
map.put(valign.value, valign);
}
}

public static VALIGN valueOf(int valign) {
return (VALIGN) map.get(valign);
}

public int getValue() {
return value;
}
}

public enum WRAP {
NONE(1),
PARENTHESES(2),
BRACKETS(3);

private int value;
private static final HashMap<Integer,WRAP> map = new HashMap<>();

private WRAP(int value) {
this.value = value;
}

static {
for (WRAP wrap : WRAP.values()) {
map.put(wrap.value, wrap);
}
}

public static WRAP valueOf(int wrap) {
return (WRAP) map.get(wrap);
}

public int getValue() {
return value;
}
}

public enum POS {
TOP(1),
BOTTOM(2),
BOTTOMINLINE(3);

private int value;
private static final HashMap<Integer,POS> map = new HashMap<>();

private POS(int value) {
this.value = value;
}

static {
for (POS pos : POS.values()) {
map.put(pos.value, pos);
}
}

public static POS valueOf(int pos) {
return (POS) map.get(pos);
}

public int getValue() {
return value;
}
}

public enum FORMAT {
USERLANG(1),
BIBLELANG(2),
USERLANGABBREV(3),
BIBLELANGABBREV(4);

private int value;
private static final HashMap<Integer,FORMAT> map = new HashMap<>();

private FORMAT(int value) {
this.value = value;
}

static {
for (FORMAT format : FORMAT.values()) {
map.put(format.value, format);
}
}

public static FORMAT valueOf(int format) {
return (FORMAT) map.get(format);
}

public int getValue() {
return value;
}
}

public enum VISIBILITY {
SHOW(1),
HIDE(2);

private int value;
private static final HashMap<Integer,VISIBILITY> map = new HashMap<>();

private VISIBILITY(int value) {
this.value = value;
}

static {
for (VISIBILITY visibility : VISIBILITY.values()) {
map.put(visibility.value, visibility);
}
}

public static VISIBILITY valueOf(int visibility) {
return (VISIBILITY) map.get(visibility);
}

public int getValue() {
return value;
}
}

public enum PARAGRAPHTYPE {
BIBLEVERSION(1),
BOOKCHAPTER(2),
VERSES(3),
VERSENUMBER(4),
VERSETEXT(5);

private int value;
private static final HashMap<Integer,PARAGRAPHTYPE> map = new HashMap<>();

private PARAGRAPHTYPE(int value) {
this.value = value;
}

static {
for (PARAGRAPHTYPE paragraphtype : PARAGRAPHTYPE.values()) {
map.put(paragraphtype.value, paragraphtype);
}
}

public static PARAGRAPHTYPE valueOf(int paragraphtype) {
return (PARAGRAPHTYPE) map.get(paragraphtype);
}

public int getValue() {
return value;
}
}

public enum TABLE {
CREATED(1),
INITIALIZED(2),
DELETED(3),
UPDATED(4),
ERROR(5);

private int value;
private static final HashMap<Integer,TABLE> map = new HashMap<>();

private TABLE(int value) {
this.value = value;
}

static {
for (TABLE table : TABLE.values()) {
map.put(table.value, table);
}
}

public static TABLE valueOf(int table){
return (TABLE) map.get(table);
}

public int getValue(){
return value;
}
}

}
12 changes: 9 additions & 3 deletions src/io/bibleget/BibleGetAbout.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class BibleGetAbout extends javax.swing.JFrame {
/**
* Creates new form BibleGetAbout
*/
private BibleGetAbout() throws ClassNotFoundException, UnsupportedEncodingException, SQLException {
private BibleGetAbout() throws ClassNotFoundException, UnsupportedEncodingException, SQLException, Exception {
//jTextPane does not initialize correctly, it causes a Null Exception Pointer
//Following line keeps this from crashing the program
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
Expand Down Expand Up @@ -95,14 +95,14 @@ private BibleGetAbout() throws ClassNotFoundException, UnsupportedEncodingExcept
initComponents();
}

public static BibleGetAbout getInstance() throws ClassNotFoundException, UnsupportedEncodingException, SQLException{
public static BibleGetAbout getInstance() throws ClassNotFoundException, UnsupportedEncodingException, SQLException, Exception{
if(instance == null){
instance = new BibleGetAbout();
}
return instance;
}

private void prepareDynamicInformation() throws ClassNotFoundException, SQLException {
private void prepareDynamicInformation() throws ClassNotFoundException, SQLException, Exception {
bibleGetDB = BibleGetDB.getInstance();
jList1 = new VersionsSelect();
jList1.setFont(new java.awt.Font("Tahoma",0,14));
Expand Down Expand Up @@ -266,6 +266,8 @@ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS
prepareDynamicInformation();
} catch (ClassNotFoundException | SQLException ex) {
Logger.getLogger(BibleGetAbout.class.getName()).log(Level.SEVERE, null, ex);
} catch (Exception ex) {
Logger.getLogger(BibleGetAbout.class.getName()).log(Level.SEVERE, null, ex);
}
jLabel2.setText(MessageFormat.format(__("The BibleGet database currently supports {0} versions of the Bible in {1} different languages:"),versionCount,versionLangs));
jLabel2.revalidate();
Expand All @@ -279,6 +281,8 @@ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS
bbGetFrameInstance.updateDynamicInformation();
} catch (ClassNotFoundException | SQLException ex) {
Logger.getLogger(BibleGetAbout.class.getName()).log(Level.SEVERE, null, ex);
} catch (Exception ex) {
Logger.getLogger(BibleGetAbout.class.getName()).log(Level.SEVERE, null, ex);
}

}
Expand Down Expand Up @@ -359,6 +363,8 @@ public static void main(String args[]) {
new BibleGetAbout().setVisible(true);
} catch (ClassNotFoundException | UnsupportedEncodingException | SQLException ex) {
Logger.getLogger(BibleGetAbout.class.getName()).log(Level.SEVERE, null, ex);
} catch (Exception ex) {
Logger.getLogger(BibleGetAbout.class.getName()).log(Level.SEVERE, null, ex);
}
});
}
Expand Down