Browse Source

删除无关代码部分

master
VIVIMAN 3 years ago
parent
commit
98ae179e5a
  1. 1
      .gitignore
  2. BIN
      lib/beautyeye_lnf.jar
  3. BIN
      lib/djnativeswing-swt.jar
  4. BIN
      lib/djnativeswing.jar
  5. BIN
      lib/swt-4.3-win32-win32-x86_64.jar
  6. 38
      pom.xml
  7. 3
      run.bat
  8. 2
      src/main/java/META-INF/MANIFEST.MF
  9. 2
      src/main/java/com/insigma/HyToolApplication.java
  10. 369
      src/main/java/com/insigma/demos/DemoModule.java
  11. 1481
      src/main/java/com/insigma/demos/SwingSet2.java
  12. 47
      src/main/java/com/insigma/demos/SwingSet2Applet.java
  13. 187
      src/main/java/com/insigma/demos/TextAreaDemo.java
  14. 155
      src/main/java/com/insigma/demos/TreeDemo.java
  15. 26
      src/main/java/com/insigma/ui/SwingFrame.java

1
.gitignore

@ -35,3 +35,4 @@ build/
### VS Code ### ### VS Code ###
.vscode/ .vscode/
/out/artifacts/java_tool_jar/java_tool.jar /out/artifacts/java_tool_jar/java_tool.jar
/java_tool.jar

BIN
lib/beautyeye_lnf.jar

Binary file not shown.

BIN
lib/djnativeswing-swt.jar

Binary file not shown.

BIN
lib/djnativeswing.jar

Binary file not shown.

BIN
lib/swt-4.3-win32-win32-x86_64.jar

Binary file not shown.

38
pom.xml

@ -70,44 +70,6 @@
<version>${sqlite.jdbc.version}</version> <version>${sqlite.jdbc.version}</version>
</dependency> </dependency>
<!-- beauty 相关的本地JAR -->
<dependency>
<groupId>beautyeye_lnf</groupId>
<artifactId>beautyeye_lnf</artifactId>
<version>3.7</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/beautyeye_lnf.jar</systemPath>
</dependency>
<!-- beauty 相关的本地JAR -->
<!-- djnativeswing 相关的本地JAR -->
<dependency>
<groupId>djnativeswing</groupId>
<artifactId>djnativeswing</artifactId>
<version>4.3</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/djnativeswing.jar</systemPath>
</dependency>
<!-- djnativeswing 相关的本地JAR -->
<!-- djnativeswing-swt 相关的本地JAR -->
<dependency>
<groupId>djnativeswing_swt</groupId>
<artifactId>djnativeswing_swt</artifactId>
<version>4.3</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/djnativeswing-swt.jar</systemPath>
</dependency>
<!-- djnativeswing-swt 相关的本地JAR -->
<!-- org.eclipse.swt.win32.win32.x86_64-4.2 相关的本地JAR -->
<dependency>
<groupId>swt-4.3-win32-win32-x86_64</groupId>
<artifactId>swt-4.3-win32-win32-x86_64</artifactId>
<version>4.3</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/swt-4.3-win32-win32-x86_64.jar</systemPath>
</dependency>
<!-- org.eclipse.swt.win32.win32.x86_64-4.2 相关的本地JAR --> <!-- org.eclipse.swt.win32.win32.x86_64-4.2 相关的本地JAR -->
<!-- jsoup HTML parser library @ https://jsoup.org/ --> <!-- jsoup HTML parser library @ https://jsoup.org/ -->

3
run.bat

@ -1,6 +1,6 @@
call :IsAdmin call :IsAdmin
java -jar app.jar java -jar java_tool.jar
:IsAdmin :IsAdmin
Reg.exe query "HKU\S-1-5-19\Environment" Reg.exe query "HKU\S-1-5-19\Environment"
@ -9,4 +9,3 @@ If Not %ERRORLEVEL% EQU 0 (
Pause & Exit Pause & Exit
) )
Cls Cls
goto:eof

2
src/main/java/META-INF/MANIFEST.MF

@ -1,3 +1,3 @@
Manifest-Version: 1.0 Manifest-Version: 1.0
Main-Class: com.insigma.utils.OsTest Main-Class: com.insigma.HyToolApplication

2
src/main/java/com/insigma/HyToolApplication.java

@ -2,7 +2,6 @@ package com.insigma;
import cn.hutool.db.Session; import cn.hutool.db.Session;
import com.insigma.config.AppCfg; import com.insigma.config.AppCfg;
import com.insigma.demos.SwingSet2;
import com.insigma.ui.SwingFrame; import com.insigma.ui.SwingFrame;
import com.insigma.utils.DbUtil; import com.insigma.utils.DbUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -12,7 +11,6 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.support.EncodedResource; import org.springframework.core.io.support.EncodedResource;
import org.springframework.core.io.support.PropertiesLoaderUtils; import org.springframework.core.io.support.PropertiesLoaderUtils;
import javax.swing.*;
import java.util.Properties; import java.util.Properties;
/** /**

369
src/main/java/com/insigma/demos/DemoModule.java

@ -1,369 +0,0 @@
package com.insigma.demos;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JApplet;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import org.jb2011.lnf.beautyeye.widget.N9ComponentFactory;
/**
* A generic SwingSet2 demo module.
*
* @author Jeff Dinkins
* @version 1.23 11/17/05
*/
public class DemoModule extends JApplet {
/**
* The PREFERRE d_ width.
*/
private int PREFERRED_WIDTH = 680;
/**
* The PREFERRE d_ height.
*/
private int PREFERRED_HEIGHT = 600;
/**
* The lowered border.
*/
Border loweredBorder = new EmptyBorder(15, 10, 5, 10);
/**
* The HGA p2.
*/
public static Dimension HGAP2 = new Dimension(2, 1);
/**
* The VGA p2.
*/
public static Dimension VGAP2 = new Dimension(1, 2);
/**
* The HGA p5.
*/
public static Dimension HGAP5 = new Dimension(5, 1);
/**
* The VGA p5.
*/
public static Dimension VGAP5 = new Dimension(1, 5);
/**
* The HGA p10.
*/
public static Dimension HGAP10 = new Dimension(10, 1);
/**
* The VGA p10.
*/
public static Dimension VGAP10 = new Dimension(1, 10);
/**
* The HGA p15.
*/
public static Dimension HGAP15 = new Dimension(15, 1);
/**
* The VGA p15.
*/
public static Dimension VGAP15 = new Dimension(1, 15);
/**
* The HGA p20.
*/
public static Dimension HGAP20 = new Dimension(20, 1);
/**
* The VGA p20.
*/
public static Dimension VGAP20 = new Dimension(1, 20);
/**
* The HGA p25.
*/
public static Dimension HGAP25 = new Dimension(25, 1);
/**
* The VGA p25.
*/
public static Dimension VGAP25 = new Dimension(1, 25);
/**
* The HGA p30.
*/
public static Dimension HGAP30 = new Dimension(30, 1);
/**
* The VGA p30.
*/
public static Dimension VGAP30 = new Dimension(1, 30);
/**
* The swingset.
*/
private SwingSet2 swingset = null;
/**
* The panel.
*/
private JPanel panel = null;
/**
* The resource name.
*/
private String resourceName = null;
/**
* The icon path.
*/
private String iconPath = null;
/**
* The source code.
*/
private String sourceCode = null;
// Resource bundle for internationalized and accessible text
/**
* The bundle.
*/
private ResourceBundle bundle = null;
/**
* Instantiates a new demo module.
*
* @param swingset the swingset
*/
public DemoModule(SwingSet2 swingset) {
this(swingset, null, null);
}
/**
* Instantiates a new demo module.
*
* @param swingset the swingset
* @param resourceName the resource name
* @param iconPath the icon path
*/
public DemoModule(SwingSet2 swingset, String resourceName, String iconPath) {
UIManager.put("swing.boldMetal", Boolean.FALSE);
panel = new JPanel();
panel.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
panel.setLayout(new BorderLayout());
this.resourceName = resourceName;
this.iconPath = iconPath;
this.swingset = swingset;
}
/**
* Gets the resource name.
*
* @return the resource name
*/
public String getResourceName() {
return resourceName;
}
/**
* Gets the demo panel.
*
* @return the demo panel
*/
public JPanel getDemoPanel() {
return panel;
}
/**
* Gets the swing set2.
*
* @return the swing set2
*/
public SwingSet2 getSwingSet2() {
return swingset;
}
/**
* Gets the string.
*
* @param key the key
* @return the string
*/
public String getString(String key) {
String value = "nada";
if (bundle == null) {
if (getSwingSet2() != null) {
bundle = getSwingSet2().getResourceBundle();
} else {
bundle = ResourceBundle.getBundle("language.swingset");
}
}
try {
value = bundle.getString(key);
} catch (MissingResourceException e) {
System.out.println("java.util.MissingResourceException: Couldn't find value for: " + key);
}
return value;
}
/**
* Gets the mnemonic.
*
* @param key the key
* @return the mnemonic
*/
public char getMnemonic(String key) {
return (getString(key)).charAt(0);
}
/**
* Creates the image icon.
*
* @param filename the filename
* @param description the description
* @return the image icon
*/
public ImageIcon createImageIcon(String filename, String description) {
if (getSwingSet2() != null) {
return getSwingSet2().createImageIcon(filename, description);
} else {
String path = "/static/images/" + filename;
return new ImageIcon(getClass().getResource(path), description);
}
}
/**
* Gets the source code.
*
* @return the source code
*/
public String getSourceCode() {
return sourceCode;
}
/* (non-Javadoc)
* @see java.awt.Component#getName()
*/
@Override
public String getName() {
return getString(getResourceName() + ".name");
}
;
/**
* Gets the icon.
*
* @return the icon
*/
public Icon getIcon() {
return createImageIcon(iconPath, getResourceName() + ".name");
}
;
/**
* Gets the tool tip.
*
* @return the tool tip
*/
public String getToolTip() {
return getString(getResourceName() + ".tooltip");
}
;
/**
* Main impl.
*/
public void mainImpl() {
JFrame frame = new JFrame(getName());
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(getDemoPanel(), BorderLayout.CENTER);
getDemoPanel().setPreferredSize(new Dimension(PREFERRED_WIDTH, PREFERRED_HEIGHT));
frame.pack();
frame.show();
}
/**
* Creates the horizontal panel.
*
* @param threeD the three d
* @return the j panel
*/
public JPanel createHorizontalPanel(boolean threeD) {
JPanel p = N9ComponentFactory.createPanel_style1(null).setDrawBg(threeD);//modified by jb2011
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
p.setAlignmentY(TOP_ALIGNMENT);
p.setAlignmentX(LEFT_ALIGNMENT);
if (threeD) {
p.setBorder(loweredBorder);
}
//因背景是白色N9图,这里设置它不填充默认背景好看一点,要不然灰色背景出来就不好看了
p.setOpaque(false);//add by jb2011 2012-08-24
return p;
}
/**
* Creates the vertical panel.
*
* @param threeD the three d
* @return the j panel
*/
public JPanel createVerticalPanel(boolean threeD) {
JPanel p = N9ComponentFactory.createPanel_style1(null).setDrawBg(threeD);//modified by jb2011
p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
p.setAlignmentY(TOP_ALIGNMENT);
p.setAlignmentX(LEFT_ALIGNMENT);
if (threeD) {
p.setBorder(loweredBorder);
}
return p;
}
/**
* The main method.
*
* @param args the arguments
*/
public static void main(String[] args) {
DemoModule demo = new DemoModule(null);
demo.mainImpl();
}
/* (non-Javadoc)
* @see java.applet.Applet#init()
*/
@Override
public void init() {
getContentPane().setLayout(new BorderLayout());
getContentPane().add(getDemoPanel(), BorderLayout.CENTER);
}
/**
* Update drag enabled.
*
* @param dragEnabled the drag enabled
*/
void updateDragEnabled(boolean dragEnabled) {
}
}

1481
src/main/java/com/insigma/demos/SwingSet2.java

File diff suppressed because it is too large

47
src/main/java/com/insigma/demos/SwingSet2Applet.java

@ -1,47 +0,0 @@
/*
* Copyright (C) 2015 Jack Jiang(cngeeker.com) The BeautyEye Project.
* All rights reserved.
* Project URL:https://github.com/JackJiang2011/beautyeye
* Version 3.6
*
* Jack Jiang PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
* SwingSet2Applet.java at 2015-2-1 20:25:39, original version by Jack Jiang.
* You can contact author with jb2011@163.com.
*/
/*
* @(#)SwingSet2Applet.java 1.10 05/11/17
*/
package com.insigma.demos;
import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;
import javax.swing.*;
import java.awt.*;
import java.net.URL;
// TODO: Auto-generated Javadoc
/**
* The Class SwingSet2Applet.
*
* @version 1.10 11/17/05
* @author Jeff Dinkins
*/
public class SwingSet2Applet extends JApplet {
@Override
public void init() {
try {
BeautyEyeLNFHelper.launchBeautyEyeLNF();
} catch (Exception e) {
System.err.println("BeautyEyeLNF运行失败,原因是:"+e.getMessage());
}
getContentPane().setLayout(new BorderLayout());
getContentPane().add(new SwingSet2(this), BorderLayout.CENTER);
}
}

187
src/main/java/com/insigma/demos/TextAreaDemo.java

@ -1,187 +0,0 @@
package com.insigma.demos;
import javax.accessibility.AccessibleContext;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
public class TextAreaDemo extends DemoModule {
/**
* main method allows us to run as a standalone demo.
*
* @param args the arguments
*/
public static void main(String[] args) {
//初始化样式
SwingSet2.initBeautyStyle();
TextAreaDemo demo = new TextAreaDemo(null);
demo.mainImpl();
}
/* (non-Javadoc)
* @see DemoModule#getName()
*/
@Override public String getName() {
return "文本域";
};
/**
* ProgressBarDemo Constructor.
*
* @param swingset the swingset
*/
public TextAreaDemo(SwingSet2 swingset) {
// Set the title for this demo, and an icon used to represent this
// demo inside the SwingSet2 app.
super(swingset, "TextAreaDemo"
, "toolbar/JProgressBar.gif");
createProgressPanel();
}
/** The load action. */
Action loadAction;
/** The stop action. */
Action stopAction;
/** The progress bar. */
JProgressBar progressBar;
/** The progress text area. */
JTextArea progressTextArea;
/* (non-Javadoc)
* @see DemoModule#updateDragEnabled(boolean)
*/
@Override
void updateDragEnabled(boolean dragEnabled) {
progressTextArea.setDragEnabled(dragEnabled);
}
/**
* Creates the progress panel.
*/
public void createProgressPanel() {
getDemoPanel().setLayout(new BorderLayout());
JPanel textWrapper = new JPanel(new BorderLayout());
// textWrapper.setBorder(new SoftBevelBorder(BevelBorder.LOWERED));
textWrapper.setAlignmentX(LEFT_ALIGNMENT);
progressTextArea = new MyTextArea();
progressTextArea.getAccessibleContext().setAccessibleName(getString("ProgressBarDemo.accessible_text_area_name"));
progressTextArea.getAccessibleContext().setAccessibleName(getString("ProgressBarDemo.accessible_text_area_description"));
textWrapper.add(new JScrollPane(progressTextArea), BorderLayout.CENTER);
getDemoPanel().add(textWrapper, BorderLayout.CENTER);
JPanel progressPanel = new JPanel();
getDemoPanel().add(progressPanel, BorderLayout.SOUTH);
JPanel p1 = new JPanel();
p1.add(createLoadButton());
p1.add(createStopButton());
progressPanel.add(p1);
}
/**
* Creates the load button.
*
* @return the j button
*/
public JButton createLoadButton() {
loadAction = new AbstractAction(getString("ProgressBarDemo.start_button")) {
@Override
public void actionPerformed(ActionEvent e) {
progressTextArea.append("开始"+getString("ProgressBarDemo.text"));
}
};
return createButton(loadAction);
}
/**
* Creates the stop button.
*
* @return the j button
*/
public JButton createStopButton() {
stopAction = new AbstractAction("开始解析") {
@Override
public void actionPerformed(ActionEvent e) {
AccessibleContext accessibleContext = progressTextArea.getAccessibleContext();
String tempStr = progressTextArea.getText();
progressTextArea.setText(tempStr); ;
JOptionPane.showMessageDialog(
getDemoPanel(),
getString("OptionPaneDemo.warningtext"),
getString("OptionPaneDemo.warningtitle"),
JOptionPane.WARNING_MESSAGE
);
}
};
return createButton(stopAction);
}
/**
* Creates the button.
*
* @param a the a
* @return the j button
*/
public JButton createButton(Action a) {
JButton b = new JButton();
// setting the following client property informs the button to show
// the action text as it's name. The default is to not show the
// action text.
b.putClientProperty("displayActionText", Boolean.TRUE);
b.setAction(a);
return b;
}
/**
* The Class MyTextArea.
*/
class MyTextArea extends JTextArea {
/**
* Instantiates a new my text area.
*/
public MyTextArea() {
super(null, 0, 0);
// setEditable(false);
setText("");
}
/* (non-Javadoc)
* @see javax.swing.JComponent#getAlignmentX()
*/
@Override
public float getAlignmentX () {
return LEFT_ALIGNMENT;
}
/* (non-Javadoc)
* @see javax.swing.JComponent#getAlignmentY()
*/
@Override
public float getAlignmentY () {
return TOP_ALIGNMENT;
}
}
}

155
src/main/java/com/insigma/demos/TreeDemo.java

@ -1,155 +0,0 @@
package com.insigma.demos;/*
* Copyright (C) 2015 Jack Jiang(cngeeker.com) The BeautyEye Project.
* All rights reserved.
* Project URL:https://github.com/JackJiang2011/beautyeye
* Version 3.6
*
* Jack Jiang PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
* TreeDemo.java at 2015-2-1 20:25:39, original version by Jack Jiang.
* You can contact author with jb2011@163.com.
*/
/*
* @(#)TreeDemo.java 1.13 05/11/17
*/
import java.awt.BorderLayout;
import java.awt.Insets;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import javax.swing.JComponent;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
// TODO: Auto-generated Javadoc
/**
* JTree Demo.
*
* @author Jeff Dinkins
* @version 1.13 11/17/05
*/
public class TreeDemo extends DemoModule {
/**
* The tree.
*/
JTree tree;
/**
* main method allows us to run as a standalone demo.
*
* @param args the arguments
*/
public static void main(String[] args) {
SwingSet2.initBeautyStyle();
TreeDemo demo = new TreeDemo(null);
demo.mainImpl();
}
/* (non-Javadoc)
* @see DemoModule#getName()
*/
@Override
public String getName() {
return "树";
}
;
/**
* TreeDemo Constructor.
*
* @param swingset the swingset
*/
public TreeDemo(SwingSet2 swingset) {
// Set the title for this demo, and an icon used to represent this
// demo inside the SwingSet2 app.
super(swingset, "TreeDemo", "toolbar/JTree.gif");
getDemoPanel().add(createTree(), BorderLayout.CENTER);
}
/**
* Creates the tree.
*
* @return the j component
*/
public JComponent createTree() {
DefaultMutableTreeNode top = new DefaultMutableTreeNode(getString("TreeDemo.music"));
DefaultMutableTreeNode catagory = null;
DefaultMutableTreeNode artist = null;
DefaultMutableTreeNode record = null;
// open tree data
URL url = getClass().getResource("/tree.txt");
try {
// convert url to buffered string
InputStream is = url.openStream();
InputStreamReader isr = new InputStreamReader(is, "UTF-8");
BufferedReader reader = new BufferedReader(isr);
// read one line at a time, put into tree
String line = reader.readLine();
while (line != null) {
// System.out.println("reading in: ->" + line + "<-");
char linetype = line.charAt(0);
switch (linetype) {
case 'C':
catagory = new DefaultMutableTreeNode(line.substring(2));
top.add(catagory);
break;
case 'A':
if (catagory != null) {
catagory.add(artist = new DefaultMutableTreeNode(line.substring(2)));
}
break;
case 'R':
if (artist != null) {
artist.add(record = new DefaultMutableTreeNode(line.substring(2)));
}
break;
case 'S':
if (record != null) {
record.add(new DefaultMutableTreeNode(line.substring(2)));
}
break;
default:
break;
}
line = reader.readLine();
}
} catch (IOException e) {
}
tree = new JTree(top) {
@Override
public Insets getInsets() {
return new Insets(5, 5, 5, 5);
}
};
// tree.setBackground(new Color(250,250,250));
tree.setEditable(true);
return new JScrollPane(tree);
// return tree;
}
/* (non-Javadoc)
* @see DemoModule#updateDragEnabled(boolean)
*/
@Override
void updateDragEnabled(boolean dragEnabled) {
tree.setDragEnabled(dragEnabled);
}
}

26
src/main/java/com/insigma/ui/SwingFrame.java

@ -431,8 +431,8 @@ public class SwingFrame extends JFrame implements ActionListener {
progressBar.addChangeListener(new ChangeListener() { progressBar.addChangeListener(new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
System.out.println("当前进度值: " + progressBar.getValue() + "; " + // System.out.println("当前进度值: " + progressBar.getValue() + "; " +
"进度百分比: " + progressBar.getPercentComplete()); // "进度百分比: " + progressBar.getPercentComplete());
} }
}); });
// 添加到内容面板 // 添加到内容面板
@ -580,17 +580,17 @@ public class SwingFrame extends JFrame implements ActionListener {
startRestorePanel.add(textField); startRestorePanel.add(textField);
new Timer(500, new ActionListener() { // new Timer(500, new ActionListener() {
@Override // @Override
public void actionPerformed(ActionEvent e) { // public void actionPerformed(ActionEvent e) {
currentProgress++; // currentProgress++;
if (currentProgress > MAX_PROGRESS) { // if (currentProgress > MAX_PROGRESS) {
currentProgress = MIN_PROGRESS; // currentProgress = MIN_PROGRESS;
} // }
progressBar.setValue(currentProgress); // progressBar.setValue(currentProgress);
progressBar.setForeground(Color.BLUE); // progressBar.setForeground(Color.BLUE);
} // }
}).start(); // }).start();
} }
@Override @Override

Loading…
Cancel
Save