parent
5ab5f87183
commit
2db46e3c90
@ -0,0 +1 @@
|
||||
FileType.java
|
@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AndroidLintAppCompatMethod" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,5 @@
|
||||
package assembly;
|
||||
|
||||
public class Branch {
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package assembly;
|
||||
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
public class Trigger {
|
||||
int Mouse;
|
||||
MouseEvent mouse;
|
||||
public void mouseClicked(MouseEvent arg0){
|
||||
if(arg0.getButton() == MouseEvent.BUTTON1){
|
||||
Mouse = 1;
|
||||
} else if (arg0.getButton() == MouseEvent.BUTTON2) {
|
||||
Mouse = 2;
|
||||
} else if (arg0.getButton() == MouseEvent.BUTTON3) {
|
||||
Mouse = 3;
|
||||
}
|
||||
}
|
||||
public int getMouse(){
|
||||
mouseClicked(mouse);
|
||||
return Mouse;
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package compound;
|
||||
|
||||
public class Backgroud {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package compound;
|
||||
|
||||
public class Bgm {
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package compound;
|
||||
|
||||
import assembly.Trigger;
|
||||
|
||||
public class Character {
|
||||
int NowPattern = 0;
|
||||
int Pattern[] = new int[100];
|
||||
static int i = 0;
|
||||
Character(int Character_Group[]){
|
||||
Pattern = Character_Group;
|
||||
}
|
||||
public void Show(){
|
||||
//将改代号的图片输出
|
||||
}
|
||||
public void nextPattern(){
|
||||
Trigger trigger = new Trigger();
|
||||
if(trigger.getMouse() == 1) {
|
||||
NowPattern = Pattern[i];
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package compound;
|
||||
|
||||
import assembly.Trigger;
|
||||
|
||||
public class Text {
|
||||
int i = 0;
|
||||
String TextBox[] = new String[100];
|
||||
Text(){
|
||||
//将资源中的文本分段输入TextBox中
|
||||
}
|
||||
public void nextText(){
|
||||
Trigger trigger = new Trigger();
|
||||
if(trigger.getMouse() == 1) {
|
||||
//输出下一句textbox到文本
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package joggle;
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileNameExtensionFilter;
|
||||
import java.awt.Desktop;
|
||||
import java.io.*;
|
||||
|
||||
public class joggle {
|
||||
public static class JFileChooserDemo{
|
||||
public static void fileFilter(JFileChooser fd, String flag){
|
||||
if(flag == "maindow"){
|
||||
fd.setApproveButtonText("确定");
|
||||
fd.setFileFilter(new FileNameExtensionFilter("DRC(*.drc)", "drc"));
|
||||
fd.setAcceptAllFileFilterUsed(false);
|
||||
}
|
||||
else if(flag == "resource"){
|
||||
fd.setApproveButtonText("确定");
|
||||
fd.setFileFilter(new FileNameExtensionFilter("image(*.jpg,*.jpeg,*.png)", "drc"));
|
||||
fd.setAcceptAllFileFilterUsed(false);
|
||||
}
|
||||
else if(flag == "look"){
|
||||
fd.setApproveButtonText("确定");
|
||||
fd.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
|
||||
fd.setAcceptAllFileFilterUsed(false);
|
||||
}
|
||||
}
|
||||
public static boolean open_resource(){
|
||||
JFileChooser fd = new JFileChooser();
|
||||
//fd.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
|
||||
fileFilter(fd, "mindow");
|
||||
int val = fd.showOpenDialog(null);
|
||||
if(val == fd.APPROVE_OPTION){
|
||||
fd.getSelectedFile();
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void copyFile(String oldPath, String newPath) {
|
||||
try {
|
||||
int bytesum = 0;
|
||||
int byteread = 0;
|
||||
File oldfile = new File(oldPath);
|
||||
if (oldfile.exists()) { // 文件存在时
|
||||
InputStream inStream = new FileInputStream(oldPath); // 读入原文件
|
||||
FileOutputStream fs = new FileOutputStream(newPath);
|
||||
byte[] buffer = new byte[1444];
|
||||
int length;
|
||||
while ((byteread = inStream.read(buffer)) != -1) {
|
||||
bytesum += byteread; // 字节数 文件大小
|
||||
System.out.println(bytesum);
|
||||
fs.write(buffer, 0, byteread);
|
||||
}
|
||||
inStream.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("复制单个文件操作出错");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,149 @@
|
||||
package menu;
|
||||
|
||||
import javax.swing.*;
|
||||
import joggle.joggle;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
import java.awt.datatransfer.Transferable;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
public class CreateWindow {
|
||||
private static JFrame page = new JFrame("创作窗口");
|
||||
private static JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));
|
||||
private static JPanel resource_panel = new JPanel();
|
||||
//创作资源面板
|
||||
private static JPanel main_panel = new JPanel();
|
||||
//主播放面板
|
||||
private static JPanel assembly_panel = new JPanel();
|
||||
//组件面板
|
||||
private static JPanel edit_panel = new JPanel();
|
||||
//编辑面板
|
||||
public static void setPage(){
|
||||
page.setSize(1500,1000);
|
||||
page.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||
page.setResizable(false);
|
||||
page.setLocationRelativeTo(null);
|
||||
page.setVisible(true);
|
||||
resource_panel.setPreferredSize(new Dimension(450,500));
|
||||
resource_panel.setBorder(BorderFactory.createTitledBorder("创作资源"));
|
||||
main_panel.setPreferredSize(new Dimension(1000,500));
|
||||
main_panel.setBorder(BorderFactory.createTitledBorder("播放窗口"));
|
||||
assembly_panel.setPreferredSize(new Dimension(450,450));
|
||||
assembly_panel.setBorder(BorderFactory.createTitledBorder("组件"));
|
||||
edit_panel.setPreferredSize(new Dimension(1000,450));
|
||||
edit_panel.setBorder(BorderFactory.createTitledBorder("操作栏"));
|
||||
page.add(panel);
|
||||
panel.add(resource_panel);
|
||||
panel.add(main_panel);
|
||||
panel.add(assembly_panel);
|
||||
panel.add(edit_panel);
|
||||
}
|
||||
public static class Set_resource_panel{
|
||||
Set_resource_panel(){
|
||||
|
||||
}
|
||||
public static void choose_file(){
|
||||
JFrame frame = new JFrame("File Drag and Drop");
|
||||
JLabel label = new JLabel("Drag and drop a file here.");
|
||||
|
||||
label.setTransferHandler(new TransferHandler() {
|
||||
@Override
|
||||
public boolean canImport(TransferSupport support) {
|
||||
// 检查是否支持拖放文件
|
||||
return support.isDataFlavorSupported(DataFlavor.javaFileListFlavor);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public boolean importData(TransferSupport support) {
|
||||
// 处理拖放操作
|
||||
if (!canImport(support)) {
|
||||
return false;
|
||||
}
|
||||
Transferable transferable = support.getTransferable();
|
||||
try {
|
||||
List<File> files = (List<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor);
|
||||
for (File file : files) {
|
||||
System.out.println(file.getAbsolutePath());
|
||||
// 在此处处理文件
|
||||
// ...
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
label.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
JComponent c = (JComponent) e.getSource();
|
||||
TransferHandler handler = c.getTransferHandler();
|
||||
handler.exportAsDrag(c, e, TransferHandler.COPY);
|
||||
}
|
||||
});
|
||||
|
||||
frame.getContentPane().add(label);
|
||||
frame.setSize(400, 300);
|
||||
frame.setLocationRelativeTo(null);
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
frame.setVisible(true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public static void remove_file(){
|
||||
|
||||
}
|
||||
public static class Set_main_panel{
|
||||
public static void play(){
|
||||
|
||||
}
|
||||
public static void suspend(){
|
||||
|
||||
}
|
||||
}
|
||||
public static class Set_assembly_panel{
|
||||
public static void choose_assembly(){
|
||||
|
||||
}
|
||||
}
|
||||
public static class Set_edit_panel{
|
||||
Set_edit_panel(){
|
||||
|
||||
}
|
||||
public static void set_track(){
|
||||
|
||||
}
|
||||
public static void delete_track(){
|
||||
|
||||
}
|
||||
public static void shield_track(){
|
||||
|
||||
}
|
||||
public static void open_sound(){
|
||||
|
||||
}
|
||||
public static void close_sound(){
|
||||
|
||||
}
|
||||
public static void open_frame(){
|
||||
|
||||
}
|
||||
public static void close_frame(){
|
||||
|
||||
}
|
||||
public static void track_magnetic_attraction(){
|
||||
|
||||
}
|
||||
public static void delete_trackResource(){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package menu;
|
||||
import sun.misc.BASE64Encoder;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
|
||||
public class FileType {
|
||||
public static String change_sound_io(File media){
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
try{
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
byte[] bytes = byteArrayOutputStream.toByteArray();
|
||||
FileInputStream in = new FileInputStream(media);
|
||||
in.read(bytes);
|
||||
in.close();
|
||||
return encoder.encodeBuffer(bytes).trim();
|
||||
}catch(IOException e1){
|
||||
e1.printStackTrace();
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
public static void input_File(String str) {
|
||||
File file = new File(MainWindow.ReturnFile + MainWindow.Filename);
|
||||
try {
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(file, true);
|
||||
try {
|
||||
fileOutputStream.write(str.getBytes(StandardCharsets.UTF_8));
|
||||
} catch (IOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
} catch (FileNotFoundException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,126 @@
|
||||
package menu;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import joggle.joggle;
|
||||
import java.io.*;
|
||||
|
||||
|
||||
//主窗口
|
||||
public class MainWindow extends menu {
|
||||
private static JFrame page = new JFrame("主菜单");
|
||||
private static JFrame create_page = new JFrame("创建");
|
||||
private static JTextField fileName = new JTextField();
|
||||
private static Container c = page.getContentPane();
|
||||
private static Container c1 = create_page.getContentPane();
|
||||
private static int flag = 0;
|
||||
protected static String ReturnFile;
|
||||
protected static String Filename;
|
||||
//创建主窗口
|
||||
public static void main(String[] args) {
|
||||
page.setSize(1500,1000);
|
||||
page.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||
page.setResizable(false);
|
||||
page.setLocationRelativeTo(null);
|
||||
page.setVisible(true);
|
||||
c.setLayout(null);
|
||||
new_create();
|
||||
open();
|
||||
}
|
||||
public static void setCreate_page(){
|
||||
create_page.setSize(800,600);
|
||||
create_page.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||
create_page.setResizable(false);
|
||||
create_page.setLocationRelativeTo(null);
|
||||
create_page.setVisible(true);
|
||||
c1.setLayout(null);
|
||||
if(flag == 0){
|
||||
setFileName();
|
||||
create();
|
||||
cancel();
|
||||
}
|
||||
}
|
||||
//创建新的创作
|
||||
public static void new_create() {
|
||||
JButton b = new JButton("创建");
|
||||
b.setBounds(625,300,250,50);
|
||||
c.add(b);
|
||||
b.setDefaultCapable(true);
|
||||
b.setVisible(true);
|
||||
//鼠标触发事件
|
||||
b.addActionListener(new AbstractAction() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
setCreate_page();
|
||||
}
|
||||
});
|
||||
}
|
||||
//打开
|
||||
public static void open(){
|
||||
JButton b = new JButton("打开");
|
||||
b.setBounds(625,400,250,50);
|
||||
c.add(b);
|
||||
b.setDefaultCapable(true);
|
||||
b.setVisible(true);
|
||||
//鼠标触发事件
|
||||
b.addActionListener(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
joggle.JFileChooserDemo.open_resource();
|
||||
}
|
||||
});
|
||||
}
|
||||
//创建文件
|
||||
public static void create(){
|
||||
JButton b = new JButton("创建");
|
||||
b.setBounds(260,300,250,50);
|
||||
c1.add(b);
|
||||
b.setDefaultCapable(true);
|
||||
b.setVisible(true);
|
||||
b.addActionListener(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JFileChooser fd = new JFileChooser();
|
||||
joggle.JFileChooserDemo.fileFilter(fd,"look");
|
||||
int val = fd.showOpenDialog(null);
|
||||
if(val == fd.APPROVE_OPTION){
|
||||
File file = fd.getSelectedFile();
|
||||
file.getPath();
|
||||
//获取预览地址
|
||||
ReturnFile = file.getPath();
|
||||
try {
|
||||
File newfile = new File(file, fileName.getText() + ".drc");
|
||||
Filename = fileName.getText()+".drc";
|
||||
newfile.createNewFile();
|
||||
//创建文件,格式为自创drc格式
|
||||
}catch (IOException e1){
|
||||
e1.printStackTrace();
|
||||
}
|
||||
CreateWindow.setPage();
|
||||
page.setVisible(false);
|
||||
create_page.setVisible(false);
|
||||
//打开创作窗口
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
public static void setFileName(){
|
||||
fileName.setBounds(260,200,250,50);
|
||||
c1.add(fileName);
|
||||
fileName.setVisible(true);
|
||||
}
|
||||
public static void cancel(){
|
||||
JButton b = new JButton("取消");
|
||||
b.setBounds(260,400,250,50);
|
||||
c1.add(b);
|
||||
b.setDefaultCapable(true);
|
||||
b.setVisible(true);
|
||||
b.addActionListener(new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
create_page.setVisible(false);
|
||||
flag++;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -1,13 +1,22 @@
|
||||
package menu;
|
||||
import javax.swing.*;
|
||||
|
||||
public class menu {
|
||||
//公用菜单抽象类
|
||||
abstract public class menu {
|
||||
//主界面窗口
|
||||
public static void main(String[] args){
|
||||
JFrame page = new JFrame("主菜单");
|
||||
page.setSize(800,450);
|
||||
page.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||
page.setResizable(false);
|
||||
page.setLocationRelativeTo(null);
|
||||
page.setVisible(true);
|
||||
|
||||
}
|
||||
//问题反馈
|
||||
public void feedback(){
|
||||
|
||||
}
|
||||
//帮助
|
||||
public void help(){
|
||||
|
||||
}
|
||||
//设置
|
||||
public void settings(){
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue