-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1381 from DraqueT/1377-help-manual-fix
1377 help manual fix
- Loading branch information
Showing
8 changed files
with
244 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/main/java/org/darisadesigns/polyglotlina/Screens/ScrWebView.form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<Form version="1.8" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> | ||
<Properties> | ||
<Property name="defaultCloseOperation" type="int" value="2"/> | ||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> | ||
<Dimension value="[20, 20]"/> | ||
</Property> | ||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> | ||
<Dimension value="[500, 400]"/> | ||
</Property> | ||
</Properties> | ||
<SyntheticProperties> | ||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/> | ||
<SyntheticProperty name="generateCenter" type="boolean" value="false"/> | ||
</SyntheticProperties> | ||
<AuxValues> | ||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> | ||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> | ||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> | ||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> | ||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> | ||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> | ||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> | ||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> | ||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> | ||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/> | ||
</AuxValues> | ||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> | ||
<SubComponents> | ||
<Container class="javax.swing.JPanel" name="jPanel1"> | ||
<Constraints> | ||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> | ||
<BorderConstraints direction="First"/> | ||
</Constraint> | ||
</Constraints> | ||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/> | ||
<SubComponents> | ||
<Component class="javax.swing.JButton" name="backButton"> | ||
<Properties> | ||
<Property name="text" type="java.lang.String" value="\ud83e\udc2c" containsInvalidXMLChars="true"/> | ||
</Properties> | ||
</Component> | ||
<Component class="javax.swing.JButton" name="forwardButton"> | ||
<Properties> | ||
<Property name="text" type="java.lang.String" value="\ud83e\udc2e" containsInvalidXMLChars="true"/> | ||
</Properties> | ||
</Component> | ||
</SubComponents> | ||
</Container> | ||
</SubComponents> | ||
</Form> |
150 changes: 150 additions & 0 deletions
150
src/main/java/org/darisadesigns/polyglotlina/Screens/ScrWebView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
/* | ||
* Copyright (c) 2024, Draque Thompson, draquemail@gmail.com | ||
* All rights reserved. | ||
* | ||
* Licensed under: MIT License | ||
* See LICENSE.TXT included with this code to read the full license agreement. | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
package org.darisadesigns.polyglotlina.Screens; | ||
|
||
import java.awt.BorderLayout; | ||
import java.awt.Component; | ||
import java.awt.event.ActionEvent; | ||
import java.io.File; | ||
import javafx.application.Platform; | ||
import javafx.embed.swing.JFXPanel; | ||
import javafx.scene.Scene; | ||
import javafx.scene.web.WebEngine; | ||
import javafx.scene.web.WebView; | ||
import javax.swing.JComponent; | ||
import org.darisadesigns.polyglotlina.Desktop.CustomControls.PFrame; | ||
import org.darisadesigns.polyglotlina.DictCore; | ||
|
||
/** | ||
* | ||
* @author kelly | ||
*/ | ||
public class ScrWebView extends PFrame { | ||
private final JFXPanel jfxPanel; | ||
private String url; | ||
private WebView webView; | ||
|
||
/** | ||
* Creates new form ScrWebView | ||
*/ | ||
public ScrWebView(DictCore _core, String pathToLoad, String title) { | ||
super(_core); | ||
url = pathToLoad; | ||
jfxPanel = new JFXPanel(); | ||
initComponents(); | ||
setTitle(title); | ||
|
||
Platform.runLater(()->{ | ||
webView = new WebView(); | ||
WebEngine engine = webView.getEngine(); | ||
engine.load(url); | ||
Scene scene = new Scene(webView); | ||
|
||
jfxPanel.setScene(scene); | ||
}); | ||
|
||
add(BorderLayout.CENTER, jfxPanel); | ||
|
||
backButton.addActionListener((ActionEvent e)->{ | ||
goBack(); | ||
}); | ||
forwardButton.addActionListener((ActionEvent e)->{ | ||
goForward(); | ||
}); | ||
} | ||
|
||
public ScrWebView(DictCore _core, File fileToLoad, String title) { | ||
this(_core, "file://" + fileToLoad.getAbsolutePath(), title); | ||
} | ||
|
||
/** | ||
* This method is called from within the constructor to initialize the form. | ||
* WARNING: Do NOT modify this code. The content of this method is always | ||
* regenerated by the Form Editor. | ||
*/ | ||
@SuppressWarnings("unchecked") | ||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents | ||
private void initComponents() { | ||
|
||
jPanel1 = new javax.swing.JPanel(); | ||
backButton = new javax.swing.JButton(); | ||
forwardButton = new javax.swing.JButton(); | ||
|
||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); | ||
setMinimumSize(new java.awt.Dimension(20, 20)); | ||
setPreferredSize(new java.awt.Dimension(500, 400)); | ||
|
||
jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.LINE_AXIS)); | ||
|
||
backButton.setText("🠬"); | ||
jPanel1.add(backButton); | ||
|
||
forwardButton.setText("🠮"); | ||
jPanel1.add(forwardButton); | ||
|
||
getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START); | ||
|
||
pack(); | ||
}// </editor-fold>//GEN-END:initComponents | ||
|
||
@Override | ||
public void updateAllValues(DictCore _core) { | ||
if (core != _core) { | ||
core = _core; | ||
} | ||
} | ||
|
||
@Override | ||
public boolean canClose() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void saveAllValues() { | ||
} | ||
|
||
@Override | ||
public void addBindingToComponent(JComponent c) { | ||
} | ||
|
||
@Override | ||
public Component getWindow() { | ||
return this.getRootPane(); | ||
} | ||
|
||
public void goBack() { | ||
Platform.runLater(()->{ | ||
webView.getEngine().executeScript("history.back()"); | ||
}); | ||
} | ||
|
||
public void goForward() { | ||
Platform.runLater(()->{ | ||
webView.getEngine().executeScript("history.forward()"); | ||
}); | ||
} | ||
|
||
|
||
// Variables declaration - do not modify//GEN-BEGIN:variables | ||
private javax.swing.JButton backButton; | ||
private javax.swing.JButton forwardButton; | ||
private javax.swing.JPanel jPanel1; | ||
// End of variables declaration//GEN-END:variables | ||
} |