Skip to content

Commit

Permalink
08-08-18_11-11 = refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
harp077 committed Aug 8, 2018
1 parent fb71b35 commit 38c9ccd
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 74 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 0 additions & 28 deletions src/main/java/SJCE/XChessFrame.form
Original file line number Diff line number Diff line change
Expand Up @@ -486,17 +486,6 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem5ActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="mDonate">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/SJCE/img/16x16/donate-coins_add.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Donate"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="mDonateActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem1">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
Expand Down Expand Up @@ -864,23 +853,6 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="bDonate">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/SJCE/img/24x24/coins-add-icon.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Donate"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bDonateActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="9"/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="bAbout">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
Expand Down
45 changes: 5 additions & 40 deletions src/main/java/SJCE/XChessFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import SJCE.Cfg.AppCfgPref;
import SJCE.Cfg.BoardThemeSelect;
import SJCE.more.Actions;
import SJCE.more.Donate;
//import SJCE.more.Donate;
import SJCE.more.Log.LogShow;
import SJCE.more.Mixer.MixerFrame;
import SJCE.more.Run_Thread;
Expand Down Expand Up @@ -42,6 +42,7 @@
import javax.swing.JTextArea;

public class XChessFrame extends JFrame implements IChessContext, IMainFrameConst {

public static ChessClock chessClock;
public static MoveListUI moveListUI;
public static BoardUI boardUI;
Expand All @@ -65,7 +66,7 @@ public class XChessFrame extends JFrame implements IChessContext, IMainFrameCons
public ImageIcon welcomeIcon = new ImageIcon(getClass().getResource("/SJCE/img/sjce-130x87.png"));
//public static JLabel ceLabel=new JLabel();
public ImageIcon FrameIcon = new ImageIcon(getClass().getResource("/SJCE/img/SubFrameIcon.png"));
public static final String sjceTitle="SJCE = Strong Java Chess Engines, maven build 07.08.18";
public static final String sjceTitle="SJCE = Strong Java Chess Engines, build 08.08.18";
public static LogShow logFrame;

public XChessFrame() {
Expand Down Expand Up @@ -384,7 +385,6 @@ private void initComponents() {
bBoardTheme = new javax.swing.JButton();
bLinks = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
bDonate = new javax.swing.JButton();
bAbout = new javax.swing.JButton();
bExit = new javax.swing.JButton();
jToolBar3 = new javax.swing.JToolBar();
Expand Down Expand Up @@ -448,7 +448,6 @@ private void initComponents() {
mInfo = new javax.swing.JMenu();
jMenuItem4 = new javax.swing.JMenuItem();
jMenuItem5 = new javax.swing.JMenuItem();
mDonate = new javax.swing.JMenuItem();
jMenuItem1 = new javax.swing.JMenuItem();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
Expand Down Expand Up @@ -627,18 +626,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
});
jToolBar1.add(jButton2);

bDonate.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SJCE/img/24x24/coins-add-icon.png"))); // NOI18N
bDonate.setToolTipText("Donate");
bDonate.setFocusable(false);
bDonate.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
bDonate.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
bDonate.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bDonateActionPerformed(evt);
}
});
jToolBar1.add(bDonate);

bAbout.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SJCE/img/24x24/info-book-green.png"))); // NOI18N
bAbout.setToolTipText("About");
bAbout.setFocusable(false);
Expand Down Expand Up @@ -1151,15 +1138,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
});
mInfo.add(jMenuItem5);

mDonate.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SJCE/img/16x16/donate-coins_add.png"))); // NOI18N
mDonate.setText("Donate");
mDonate.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
mDonateActionPerformed(evt);
}
});
mInfo.add(mDonate);

jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SJCE/img/16x16/help-green-16.png"))); // NOI18N
jMenuItem1.setText("About");
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
Expand Down Expand Up @@ -1258,7 +1236,7 @@ private void mTime30ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST
}//GEN-LAST:event_mTime30ActionPerformed

private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
aktion.About();
aktion.about(this);
}//GEN-LAST:event_jMenuItem1ActionPerformed

private void mUseClockActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mUseClockActionPerformed
Expand All @@ -1275,11 +1253,6 @@ private void mSelectCEwhiteActionPerformed(java.awt.event.ActionEvent evt) {//GE
this.changeCE("white");
}//GEN-LAST:event_mSelectCEwhiteActionPerformed

private void mDonateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mDonateActionPerformed
Donate dd=new Donate(frame,true);
dd.setVisible(true);
}//GEN-LAST:event_mDonateActionPerformed

private void mBoardThemeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mBoardThemeActionPerformed
this.changeBoardTheme();
}//GEN-LAST:event_mBoardThemeActionPerformed
Expand Down Expand Up @@ -1316,18 +1289,12 @@ private void mSendBlackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI
aktion.sendEngineCmd("black");
}//GEN-LAST:event_mSendBlackActionPerformed

private void bDonateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bDonateActionPerformed
Donate dd=new Donate(frame,true);
dd.setVisible(true);
//aktion.inputForm();
}//GEN-LAST:event_bDonateActionPerformed

private void bLinksActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bLinksActionPerformed
aktion.LinksX();
}//GEN-LAST:event_bLinksActionPerformed

private void bAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bAboutActionPerformed
aktion.About();
aktion.about(this);
}//GEN-LAST:event_bAboutActionPerformed

private void bNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bNewActionPerformed
Expand Down Expand Up @@ -1512,7 +1479,6 @@ public void run() {
public static javax.swing.JButton bAbout;
public static javax.swing.JButton bBoardTheme;
private javax.swing.JButton bChangeSkin;
public static javax.swing.JButton bDonate;
private javax.swing.JButton bExit;
private javax.swing.JButton bKillAll;
private javax.swing.JButton bLinks;
Expand Down Expand Up @@ -1558,7 +1524,6 @@ public void run() {
public static javax.swing.JRadioButtonMenuItem mDepth7;
public static javax.swing.JRadioButtonMenuItem mDepth8;
public static javax.swing.JRadioButtonMenuItem mDepth9;
private javax.swing.JMenuItem mDonate;
private javax.swing.JMenu mEngineConfig;
private javax.swing.JMenu mEngineDepth;
private javax.swing.JMenu mEngineMode;
Expand Down
23 changes: 20 additions & 3 deletions src/main/java/SJCE/more/Actions.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import java.awt.Color;
import static SJCE.XChessFrame.comboWPlayerCE;
import static SJCE.XChessFrame.logFrame;
import static SJCE.XChessFrame.sjceTitle;
import SJCE.more.Log.FileWorker;
import SJCE.xgui.JList.MoveListUI;
import SJCE.xgui.Move;
Expand All @@ -52,6 +53,7 @@
import java.util.prefs.Preferences;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.swing.JFrame;

public class Actions {

Expand Down Expand Up @@ -222,11 +224,26 @@ public static void InstallLF() {
//MyInstLF("org.pushingpixels.substance.api.skin.SubstanceEmeraldDuskLookAndFeel");
//MyInstLF("org.pushingpixels.substance.api.skin.SubstanceChallengerDeepLookAndFeel");
}

public void About() {

public void about(JFrame frame) {
ImageIcon icon = new ImageIcon(getClass().getResource("/SJCE/img/sjce-130x87.png"));
JOptionPane.showMessageDialog(frame,
"SJCE - free portable cross-platform graphical chess game.\n"+
"Support many best free java xboard/uci chess ehgines.\n"+
"It is possible to play Human-vs-Human, Human-vs-Engine,\n"+
"Engine-vs-Engine, both White and Black.\n"+
"Tested on Windows/Linux. Need jre1.8.\n"+
"Roman Koldaev, Saratov city, Russia \n"+
"Home = http://sjce.sf.net or \n"+
"https://github.com/harp077/sjce ,\n"+
"Mail = harp07@mail.ru",
sjceTitle, JOptionPane.INFORMATION_MESSAGE, icon);
}

/*public void About() {
About dd = new About(frame, true);
dd.setVisible(true);
}
}*/

public void LinksX() {
CElinksX celx = new CElinksX(frame, true);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/SJCE/more/Mail_Url.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public static void goURL (String suri) {
{ try {
d.browse(new URI(suri));
} catch (IOException ex) {
Logger.getLogger(Donate.class.getName()).log(Level.SEVERE, null, ex);
Logger.getLogger(Mail_Url.class.getName()).log(Level.SEVERE, null, ex);
} catch (URISyntaxException ex) {
Logger.getLogger(Donate.class.getName()).log(Level.SEVERE, null, ex);
Logger.getLogger(Mail_Url.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
Expand All @@ -35,7 +35,7 @@ public static void goMAIL (String adres) {
d.mail(new URI(adres));
//d.mail(uri);
} catch (IOException ex) {
Logger.getLogger(Donate.class.getName()).log(Level.SEVERE, null, ex);
Logger.getLogger(Mail_Url.class.getName()).log(Level.SEVERE, null, ex);
} catch (URISyntaxException ex) {
Logger.getLogger(Mail_Url.class.getName()).log(Level.SEVERE, null, ex);
}
Expand Down

0 comments on commit 38c9ccd

Please sign in to comment.