Skip to content

Commit

Permalink
gui update
Browse files Browse the repository at this point in the history
  • Loading branch information
dr_nyt committed Aug 1, 2019
1 parent 5008573 commit 338db52
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 73 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
compile.on.save=true
user.properties.file=C:\\Users\\super\\AppData\\Roaming\\NetBeans\\11.1\\build.properties
user.properties.file=C:\\Users\\ASUS\\AppData\\Roaming\\NetBeans\\11.1\\build.properties
4 changes: 3 additions & 1 deletion Novel-Scrape-Java/NovelScraper/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group/>
<group>
<file>file:/D:/Github%20Repos/Translated-Novel-Downloader/Novel-Scrape-Java/NovelScraper/src/sources/WuxiaWorld.java</file>
</group>
</open-files>
</project-private>
59 changes: 49 additions & 10 deletions NovelScraperV2/src/main/java/Display/GUI.form
Original file line number Diff line number Diff line change
Expand Up @@ -310,21 +310,22 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="wuxiaWorldContentPanel" alignment="0" max="32767" attributes="0"/>
<Component id="wuxiaWorldContentPanel" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="wuxiaWorldURLBar" min="-2" pref="650" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="wuxiaWorldSearchURLButton" pref="114" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jButton1" min="-2" pref="75" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Component id="newButton" min="-2" pref="75" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="reloadButton" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand All @@ -337,7 +338,10 @@
<Component id="wuxiaWorldSearchURLButton" pref="40" max="32767" attributes="0"/>
</Group>
<EmptySpace pref="42" max="32767" attributes="0"/>
<Component id="jButton1" min="-2" pref="35" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="newButton" alignment="3" min="-2" pref="35" max="-2" attributes="0"/>
<Component id="reloadButton" alignment="3" min="-2" pref="35" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="wuxiaWorldContentPanel" min="-2" max="-2" attributes="0"/>
</Group>
Expand Down Expand Up @@ -410,7 +414,7 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="wuxiaWorldSearchURLButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jButton1">
<Component class="javax.swing.JButton" name="newButton">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="57" green="27" red="2" type="rgb"/>
Expand All @@ -425,6 +429,19 @@
<Property name="borderPainted" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="reloadButton">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/rsc/Reload-2s-30px.gif"/>
</Property>
<Property name="borderPainted" type="boolean" value="false"/>
<Property name="contentAreaFilled" type="boolean" value="false"/>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="reloadButtonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="novelPanel">
Expand All @@ -437,17 +454,19 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="novelCoverHolder" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="590" max="32767" attributes="0"/>
</Group>
<Component id="jPanel1" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="novelCoverHolder" min="-2" pref="230" max="-2" attributes="0"/>
<EmptySpace min="0" pref="366" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="jPanel1" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand All @@ -460,6 +479,26 @@
</Property>
</Properties>
</Component>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="57" green="27" red="2" type="rgb"/>
</Property>
</Properties>

<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="360" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="libraryPanel">
Expand Down
75 changes: 61 additions & 14 deletions NovelScraperV2/src/main/java/Display/GUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.awt.event.MouseListener;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
Expand All @@ -38,7 +39,8 @@ public GUI() {
initComponents();

this.currentPage = "home";
loadPage(this.currentPage);
loadPage(this.currentPage);
this.reloadButton.setEnabled(false);
}

/**
Expand All @@ -65,9 +67,11 @@ private void initComponents() {
wuxiaWorldLoadingGif = new javax.swing.JLabel();
wuxiaWorldURLBar = new javax.swing.JTextField();
wuxiaWorldSearchURLButton = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
newButton = new javax.swing.JButton();
reloadButton = new javax.swing.JButton();
novelPanel = new javax.swing.JPanel();
novelCoverHolder = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
libraryPanel = new javax.swing.JPanel();
sourcesPanel = new javax.swing.JPanel();
sourcesWuxiaWorldButton = new javax.swing.JButton();
Expand Down Expand Up @@ -254,11 +258,21 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});

jButton1.setBackground(new java.awt.Color(2, 39, 87));
jButton1.setFont(new java.awt.Font("Agency FB", 1, 14)); // NOI18N
jButton1.setForeground(new java.awt.Color(255, 255, 255));
jButton1.setText("NEW");
jButton1.setBorderPainted(false);
newButton.setBackground(new java.awt.Color(2, 39, 87));
newButton.setFont(new java.awt.Font("Agency FB", 1, 14)); // NOI18N
newButton.setForeground(new java.awt.Color(255, 255, 255));
newButton.setText("NEW");
newButton.setBorderPainted(false);

reloadButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/rsc/Reload-2s-30px.gif"))); // NOI18N
reloadButton.setBorderPainted(false);
reloadButton.setContentAreaFilled(false);
reloadButton.setOpaque(false);
reloadButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
reloadButtonActionPerformed(evt);
}
});

javax.swing.GroupLayout wuxiaWorldPanelLayout = new javax.swing.GroupLayout(wuxiaWorldPanel);
wuxiaWorldPanel.setLayout(wuxiaWorldPanelLayout);
Expand All @@ -271,11 +285,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(wuxiaWorldPanelLayout.createSequentialGroup()
.addComponent(wuxiaWorldURLBar, javax.swing.GroupLayout.PREFERRED_SIZE, 650, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(wuxiaWorldSearchURLButton, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE))
.addComponent(wuxiaWorldSearchURLButton, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE)
.addContainerGap())
.addGroup(wuxiaWorldPanelLayout.createSequentialGroup()
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
.addComponent(newButton, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(reloadButton))))
);
wuxiaWorldPanelLayout.setVerticalGroup(
wuxiaWorldPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
Expand All @@ -285,7 +300,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(wuxiaWorldURLBar)
.addComponent(wuxiaWorldSearchURLButton, javax.swing.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42, Short.MAX_VALUE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(wuxiaWorldPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(newButton, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(reloadButton, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, 0)
.addComponent(wuxiaWorldContentPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
Expand All @@ -294,19 +311,34 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {

novelCoverHolder.setIcon(new javax.swing.ImageIcon(getClass().getResource("/rsc/eclipse-loading-200px.gif"))); // NOI18N

jPanel1.setBackground(new java.awt.Color(2, 39, 87));

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 360, Short.MAX_VALUE)
);

javax.swing.GroupLayout novelPanelLayout = new javax.swing.GroupLayout(novelPanel);
novelPanel.setLayout(novelPanelLayout);
novelPanelLayout.setHorizontalGroup(
novelPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(novelPanelLayout.createSequentialGroup()
.addComponent(novelCoverHolder)
.addGap(0, 590, Short.MAX_VALUE))
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
novelPanelLayout.setVerticalGroup(
novelPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(novelPanelLayout.createSequentialGroup()
.addComponent(novelCoverHolder, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 366, Short.MAX_VALUE))
.addGap(0, 0, 0)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);

libraryPanel.setBackground(new java.awt.Color(255, 255, 255));
Expand Down Expand Up @@ -527,13 +559,21 @@ private void mainSettingsButtonActionPerformed(java.awt.event.ActionEvent evt) {

private void sourcesWuxiaWorldButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sourcesWuxiaWorldButtonActionPerformed
this.handler.setWuxiaWorldLoader();
this.handler.getWuxiaWorldNewContent();
this.loadPage("wuxiaworld");
}//GEN-LAST:event_sourcesWuxiaWorldButtonActionPerformed

private void wuxiaWorldSearchURLButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_wuxiaWorldSearchURLButtonActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_wuxiaWorldSearchURLButtonActionPerformed

private void reloadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reloadButtonActionPerformed
this.reloadButton.setEnabled(false);
this.reloadButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/rsc/Reload-2s-30px.gif")));
this.wuxiaWorldContentPanel.removeAll();
this.handler.getWuxiaWorldNewContent();
}//GEN-LAST:event_reloadButtonActionPerformed

/**
* @param args the command line arguments
*/
Expand Down Expand Up @@ -696,10 +736,15 @@ public JLabel getWuxiaWorldLoadingGif()
{
return this.wuxiaWorldLoadingGif;
}

public JButton getReloadButton()
{
return this.reloadButton;
}

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel homePanel;
private javax.swing.JButton jButton1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel libraryPanel;
private javax.swing.JLayeredPane mainContentPanel;
private javax.swing.JButton mainHomeButton;
Expand All @@ -709,8 +754,10 @@ public JLabel getWuxiaWorldLoadingGif()
private javax.swing.JButton mainSourcesButton;
private javax.swing.JLabel mainTitle;
private javax.swing.JPanel mainTitlePanel;
private javax.swing.JButton newButton;
private javax.swing.JLabel novelCoverHolder;
private javax.swing.JPanel novelPanel;
private javax.swing.JButton reloadButton;
private javax.swing.JPanel settingsPanel;
private javax.swing.JPanel sourcesPanel;
private javax.swing.JButton sourcesWuxiaWorldButton;
Expand Down
17 changes: 17 additions & 0 deletions NovelScraperV2/src/main/java/NovelScraperV2/Handler.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,23 @@ public void run() {
thread.start();
}

public void getWuxiaWorldNewContent()
{
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
wuxiaWorldLoader.loadNewContent();
} catch (Exception ex) {
System.out.println(ex.toString());
Logger.getLogger(Handler.class.getName()).log(Level.SEVERE, null, ex);
}
}
});

thread.start();
}

public GUI getGUI()
{
return this.gui;
Expand Down
Loading

0 comments on commit 338db52

Please sign in to comment.