Skip to content

Commit

Permalink
转义console的代码到test中,增加test中resource的资源
Browse files Browse the repository at this point in the history
  • Loading branch information
baoxingjie committed Nov 13, 2017
1 parent 0cf7eff commit 8362c21
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 89 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.ql.util.express.console;

import java.awt.Toolkit;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import java.awt.Dimension;
import javax.swing.*;
import java.awt.*;

public class Console {
boolean packFrame = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,18 @@
package com.ql.util.express.console;

import java.awt.BorderLayout;
import java.awt.Dimension;
import com.ql.util.express.DefaultContext;
import com.ql.util.express.ExpressRunner;
import com.ql.util.express.console.FileTree.PathNode;

import javax.swing.*;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.*;
import java.util.Map;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JToolBar;
import javax.swing.tree.TreePath;

import com.ql.util.express.DefaultContext;
import com.ql.util.express.ExpressRunner;
import com.ql.util.express.console.FileTree.PathNode;

public class ConsoleFrame
extends JFrame {
private static final long serialVersionUID = 1L;
Expand All @@ -42,7 +23,7 @@ public class ConsoleFrame
JMenuItem jMenuFileExit = new JMenuItem();
JToolBar jToolBar = new JToolBar();
JButton jButton1 = new JButton();
ImageIcon image1 = new ImageIcon(com.ql.util.express.console.ConsoleFrame.class.
ImageIcon image1 = new ImageIcon(ConsoleFrame.class.
getResource("run.png"));
JLabel statusBar = new JLabel();
JTabbedPane jTabbedPaneContent = new JTabbedPane();
Expand Down Expand Up @@ -81,7 +62,7 @@ public ConsoleFrame() {
/**
* Component initialization.
*
* @throws java.lang.Exception
* @throws Exception
*/
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
Expand Down Expand Up @@ -115,16 +96,16 @@ private void jbInit() throws Exception {
jButton1.setToolTipText("执行");
jToolBar.add(jButton1);
contentPane.add(statusBar, BorderLayout.SOUTH);
jPanelResult.add(jScrollPaneResult, java.awt.BorderLayout.CENTER);
jPanelResult.add(jLabelResult, java.awt.BorderLayout.NORTH);
jPanelResult.add(jScrollPaneResult, BorderLayout.CENTER);
jPanelResult.add(jLabelResult, BorderLayout.NORTH);
jSplitPaneRun.add(jSplitPaneS_C, JSplitPane.TOP);
jScrollPaneResult.getViewport().add(jTextAreaResult);

jPanelScript.add(jLabelScript, java.awt.BorderLayout.NORTH);
jPanelScript.add(jScrollPaneScript, java.awt.BorderLayout.CENTER);
jPanelScript.add(jLabelScript, BorderLayout.NORTH);
jPanelScript.add(jScrollPaneScript, BorderLayout.CENTER);
jScrollPaneScript.getViewport().add(jTextAreaScript);
jPanelContext.add(jLabelContext, java.awt.BorderLayout.NORTH);
jPanelContext.add(jScrollPaneContext, java.awt.BorderLayout.CENTER);
jPanelContext.add(jLabelContext, BorderLayout.NORTH);
jPanelContext.add(jScrollPaneContext, BorderLayout.CENTER);
jSplitPaneS_C.add(jPanelScript, JSplitPane.LEFT);
jScrollPaneContext.getViewport().add(jTextAreaContext);
jSplitPaneS_C.setDividerSize(2);
Expand All @@ -133,9 +114,9 @@ private void jbInit() throws Exception {
jSplitPaneS_C.setDividerLocation(500);
jSplitPaneRun.add(jPanelResult, JSplitPane.RIGHT);
jTabbedPaneContent.add(jPaneRunner, "\u6267\u884c\u4ee3\u7801");
jPaneRunner.add(jSplitPaneRun, java.awt.BorderLayout.CENTER);
contentPane.add(jTabbedPaneContent, java.awt.BorderLayout.CENTER);
contentPane.add(jToolBar, java.awt.BorderLayout.NORTH);
jPaneRunner.add(jSplitPaneRun, BorderLayout.CENTER);
contentPane.add(jTabbedPaneContent, BorderLayout.CENTER);
contentPane.add(jToolBar, BorderLayout.NORTH);
jSplitPaneRun.setDividerLocation(200);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package com.ql.util.express.console;

import java.awt.BorderLayout;
import java.awt.Dimension;
import com.ql.util.express.DefaultContext;
import com.ql.util.express.ExpressRunner;
import com.ql.util.express.console.FileTree.PathNode;

import javax.swing.*;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
Expand All @@ -10,25 +15,6 @@
import java.io.StringWriter;
import java.util.Map;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JToolBar;
import javax.swing.tree.TreePath;

import com.ql.util.express.DefaultContext;
import com.ql.util.express.ExpressRunner;
import com.ql.util.express.console.FileTree.PathNode;

public class ConsoleFrame2
extends JFrame {
private static final long serialVersionUID = 1L;
Expand All @@ -39,7 +25,7 @@ public class ConsoleFrame2
JMenuItem jMenuFileExit = new JMenuItem();
JToolBar jToolBar = new JToolBar();
JButton jButton1 = new JButton();
ImageIcon image1 = new ImageIcon(com.ql.util.express.console.ConsoleFrame2.class.
ImageIcon image1 = new ImageIcon(ConsoleFrame2.class.
getResource("run.png"));
JLabel statusBar = new JLabel();
JSplitPane jSplitPaneMain = new JSplitPane();
Expand Down Expand Up @@ -86,7 +72,7 @@ public ConsoleFrame2() {
/**
* Component initialization.
*
* @throws java.lang.Exception
* @throws Exception
*/
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
Expand Down Expand Up @@ -125,30 +111,30 @@ private void jbInit() throws Exception {
jButton1.setToolTipText("执行");
jToolBar.add(jButton1);
contentPane.add(statusBar, BorderLayout.SOUTH);
contentPane.add(jSplitPaneMain, java.awt.BorderLayout.CENTER);
contentPane.add(jSplitPaneMain, BorderLayout.CENTER);
jTabbedPaneContent.add(jPaneRunner, "执行代码");
jTabbedPaneContent.add(jPanelHelp, "关键字");
jTabbedPaneContent.add(jPanel3, "帮助");
jPaneRunner.add(jSplitPaneRun, java.awt.BorderLayout.CENTER);
jPaneRunner.add(jSplitPaneRun, BorderLayout.CENTER);
jScrollPaneTree.getViewport().add(this.jTreeFileSelect);
jScrollPaneContext.getViewport().add(jTextAreaContext);
jScrollPaneResult.getViewport().add(jTextAreaResult);
jPanelResult.add(jScrollPaneResult, java.awt.BorderLayout.CENTER);
jPanelResult.add(jLabelResult, java.awt.BorderLayout.NORTH);
jPanelScript.add(jLabelScript, java.awt.BorderLayout.NORTH);
jPanelScript.add(jScrollPaneScript, java.awt.BorderLayout.CENTER);
jPanelResult.add(jScrollPaneResult, BorderLayout.CENTER);
jPanelResult.add(jLabelResult, BorderLayout.NORTH);
jPanelScript.add(jLabelScript, BorderLayout.NORTH);
jPanelScript.add(jScrollPaneScript, BorderLayout.CENTER);
jScrollPaneScript.getViewport().add(jTextAreaScript);
jPanelContext.add(jLabelContext, java.awt.BorderLayout.NORTH);
jPanelContext.add(jScrollPaneContext, java.awt.BorderLayout.CENTER);
jPanelContext.add(jLabelContext, BorderLayout.NORTH);
jPanelContext.add(jScrollPaneContext, BorderLayout.CENTER);
jSplitPaneS_C.setDividerSize(2);
jSplitPaneS_C.setLastDividerLocation(200);
jSplitPaneS_C.add(jPanelContext, JSplitPane.RIGHT);
jSplitPaneS_C.add(jPanelScript, JSplitPane.LEFT);
jSplitPaneS_C.setDividerLocation(500);
jSplitPaneRun.add(jPanelResult, JSplitPane.RIGHT);
jSplitPaneRun.add(jSplitPaneS_C, JSplitPane.TOP);
contentPane.add(jToolBar, java.awt.BorderLayout.NORTH);
contentPane.add(jScrollPaneTree, java.awt.BorderLayout.WEST);
contentPane.add(jToolBar, BorderLayout.NORTH);
contentPane.add(jScrollPaneTree, BorderLayout.WEST);
jScrollPaneTree.getViewport().add(jTreeFileSelect);
jSplitPaneRun.setDividerLocation(200);
jSplitPaneMain.setDividerLocation(400);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
package com.ql.util.express.console;

import java.awt.Component;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JTree;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;

/**
* <p>Description: 系统目录树,动态生成,解决载入慢的问题 </p>
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package com.ql.util.express.console;

import java.io.FileInputStream;
import java.io.InputStream;
import org.w3c.dom.Document;
import org.w3c.dom.Node;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;

import org.w3c.dom.Document;
import org.w3c.dom.Node;
import java.io.FileInputStream;
import java.io.InputStream;

public class ReadExample {
public static void main(String[] args) throws Exception {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8362c21

Please sign in to comment.