画饼
This commit is contained in:
parent
f5d1edc9e0
commit
946adbb3eb
124
.idea/uiDesigner.xml
Normal file
124
.idea/uiDesigner.xml
Normal file
@ -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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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>
|
35
src/main/java/com/ilummc/tlib/ExampleMain.java
Normal file
35
src/main/java/com/ilummc/tlib/ExampleMain.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package com.ilummc.tlib;
|
||||||
|
|
||||||
|
import com.ilummc.tlib.annotations.Config;
|
||||||
|
import com.ilummc.tlib.annotations.ConfigNode;
|
||||||
|
import com.ilummc.tlib.bean.BooleanProperty;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
@Config(name = "cfg.yml", charset = "GBK")
|
||||||
|
public class ExampleMain extends JavaPlugin {
|
||||||
|
|
||||||
|
@ConfigNode("enableUpdate")
|
||||||
|
private BooleanProperty update = new BooleanProperty(true);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
update.addListener(((oldVal, newVal) -> {
|
||||||
|
Bukkit.getLogger().info("配置项 enableUpdate 的值由 " + oldVal + " 变为了 " + newVal);
|
||||||
|
if (newVal)
|
||||||
|
Updater.start();
|
||||||
|
else
|
||||||
|
Updater.stop();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class Updater {
|
||||||
|
public static void start() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void stop() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
19
src/main/java/com/ilummc/tlib/annotations/Config.java
Normal file
19
src/main/java/com/ilummc/tlib/annotations/Config.java
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package com.ilummc.tlib.annotations;
|
||||||
|
|
||||||
|
public @interface Config {
|
||||||
|
|
||||||
|
String name() default "config.yml";
|
||||||
|
|
||||||
|
boolean fromJar() default true;
|
||||||
|
|
||||||
|
boolean saveOnExit() default false;
|
||||||
|
|
||||||
|
boolean readOnly() default true;
|
||||||
|
|
||||||
|
boolean fixUnicode() default true;
|
||||||
|
|
||||||
|
String charset() default "UTF-8";
|
||||||
|
|
||||||
|
boolean listenChanges() default false;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
package com.ilummc.tlib.annotations;
|
||||||
|
|
||||||
|
public @interface ConfigNode {
|
||||||
|
|
||||||
|
String value();
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.ilummc.tlib.annotations;
|
||||||
|
|
||||||
|
public @interface Dependencies {
|
||||||
|
|
||||||
|
String[] value();
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
package com.ilummc.tlib.annotations;
|
||||||
|
|
||||||
|
public @interface PluginInstance {
|
||||||
|
|
||||||
|
String value();
|
||||||
|
}
|
11
src/main/java/com/ilummc/tlib/annotations/db/Database.java
Normal file
11
src/main/java/com/ilummc/tlib/annotations/db/Database.java
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package com.ilummc.tlib.annotations.db;
|
||||||
|
|
||||||
|
public @interface Database {
|
||||||
|
|
||||||
|
boolean sharedPool() default true;
|
||||||
|
|
||||||
|
int poolSize() default 8;
|
||||||
|
|
||||||
|
Class<?> configClass();
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
package com.ilummc.tlib.annotations.db;
|
||||||
|
|
||||||
|
public @interface DatabasePassword {
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
package com.ilummc.tlib.annotations.db;
|
||||||
|
|
||||||
|
public @interface DatabaseType {
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
package com.ilummc.tlib.annotations.db;
|
||||||
|
|
||||||
|
public @interface DatabaseUrl {
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
package com.ilummc.tlib.annotations.db;
|
||||||
|
|
||||||
|
public @interface DatabaseUser {
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.ilummc.tlib.annotations.db;
|
||||||
|
|
||||||
|
public @interface SQLTable {
|
||||||
|
|
||||||
|
String value();
|
||||||
|
|
||||||
|
}
|
17
src/main/java/com/ilummc/tlib/bean/BooleanProperty.java
Normal file
17
src/main/java/com/ilummc/tlib/bean/BooleanProperty.java
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package com.ilummc.tlib.bean;
|
||||||
|
|
||||||
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
|
public class BooleanProperty {
|
||||||
|
|
||||||
|
private boolean property;
|
||||||
|
|
||||||
|
public BooleanProperty(boolean property) {
|
||||||
|
this.property = property;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addListener(BiConsumer<Boolean, Boolean> consumer) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
4
src/main/java/com/ilummc/tlib/bean/Property.java
Normal file
4
src/main/java/com/ilummc/tlib/bean/Property.java
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
package com.ilummc.tlib.bean;
|
||||||
|
|
||||||
|
public class Property {
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user