Skip to content

Commit

Permalink
Merge pull request #8 from BibleGet-I-O/JCEF
Browse files Browse the repository at this point in the history
Jcef
  • Loading branch information
JohnRDOrazio committed Oct 22, 2020
2 parents 968b510 + be9ca2f commit 62c2b1d
Show file tree
Hide file tree
Showing 27 changed files with 2,051 additions and 817 deletions.
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/
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
Loading

0 comments on commit 62c2b1d

Please sign in to comment.