• R/O
  • SSH

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Commit MetaInfo

Revision4f9589802ab8ecbc9072ec5fb808e3060b52218f (tree)
Zeit2015-08-15 22:35:39
AutorMirrgieRiana
CommiterMirrgieRiana

Log Message

add: build.gradle, src

Ändern Zusammenfassung

Diff

diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/build.gradle
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/build.gradle Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,49 @@
1+apply plugin: 'java'
2+apply plugin: 'eclipse'
3+apply plugin: 'maven'
4+
5+///////////////////////////////////
6+
7+project.group = 'mirrg'
8+project.archivesBaseName = 'mirrg.swing.helium'
9+
10+version = '1.0'
11+
12+dependencies {
13+ compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
14+ testCompile group: 'junit', name: 'junit', version: '4.+'
15+ compile group: 'mirrg', name: 'mirrg-struct-hydrogen', version: '1.0'
16+}
17+
18+///////////////////////////////////
19+
20+sourceCompatibility = 1.8
21+targetCompatibility = 1.8
22+
23+tasks.withType(AbstractCompile)*.options*.encoding = tasks.withType(GroovyCompile)*.groovyOptions*.encoding = 'UTF-8'
24+
25+jar {
26+ manifest {
27+ attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': version
28+ }
29+}
30+
31+repositories {
32+ mavenCentral()
33+ maven {
34+ url 'http://hg.pf.osdn.jp/view/t/ta/tacticsrealize/mirrg.struct.hydrogen/raw-file/tip/maven'
35+ }
36+}
37+
38+test {
39+ systemProperties 'property': 'value'
40+}
41+
42+uploadArchives {
43+ repositories {
44+ mavenDeployer {
45+ pom.artifactId = project.archivesBaseName.replace('.', '-')
46+ repository(url: 'file://localhost/' + file('../../maven').getAbsolutePath())
47+ }
48+ }
49+}
diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/FrameHTML.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/FrameHTML.java Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,300 @@
1+package mirrg.swing.helium;
2+
3+import java.awt.Component;
4+import java.awt.Dimension;
5+import java.awt.event.KeyEvent;
6+import java.awt.event.KeyListener;
7+import java.beans.PropertyChangeListener;
8+import java.io.IOException;
9+import java.net.URL;
10+import java.util.LinkedList;
11+
12+import javax.swing.GroupLayout;
13+import javax.swing.GroupLayout.Alignment;
14+import javax.swing.JButton;
15+import javax.swing.JEditorPane;
16+import javax.swing.JLabel;
17+import javax.swing.JMenuItem;
18+import javax.swing.JPopupMenu;
19+import javax.swing.JScrollPane;
20+import javax.swing.JTextField;
21+import javax.swing.event.HyperlinkEvent.EventType;
22+import javax.swing.text.Document;
23+import javax.swing.text.html.HTMLDocument;
24+
25+import mirrg.struct.hydrogen.Struct1;
26+import mirrg.struct.hydrogen.Tuple;
27+import mirrg.swing.helium.logging.EnumTypeLog;
28+import mirrg.swing.helium.logging.HLog;
29+
30+public class FrameHTML extends FrameMirrg {
31+
32+ /**
33+ * 下に行くほど新しい。
34+ */
35+ private LinkedList<Tuple<URL, Integer>> historyLeft = new LinkedList<>();
36+ /**
37+ * 下に行くほど新しい。
38+ */
39+ private LinkedList<Tuple<URL, Integer>> historyRight = new LinkedList<>();
40+
41+ private JButton button1;
42+ private JButton button2;
43+ private JTextField textField1;
44+ private JEditorPane editorPane1;
45+ private JScrollPane scrollPane1;
46+
47+ public FrameHTML() {
48+ setTitle("HTMLビューワ");
49+
50+ {
51+
52+ button1 = new JButton("戻る");
53+ button1.setToolTipText("右クリック:プルダウンメニューの表示");
54+ button1.addActionListener(e -> {
55+ if (!historyLeft.isEmpty())
56+ travelLeft(1);
57+ });
58+ HSwing.hookPopup(button1, e -> {
59+
60+ if (!historyLeft.isEmpty()) {
61+ JPopupMenu popupMenu = new JPopupMenu();
62+
63+ for (int i = historyLeft.size() - 1; i >= 0; i--) {
64+ Tuple<URL, Integer> entry = historyLeft.get(i);
65+ JMenuItem menuItem = new JMenuItem(entry.getY()
66+ .toString() + ": " + entry.getX().toString());
67+ popupMenu.add(menuItem);
68+
69+ int i2 = i + 1;
70+ menuItem.addActionListener(e2 -> {
71+ travelLeft(i2);
72+ });
73+ }
74+
75+ popupMenu.show((Component) e.getSource(), e.getX(),
76+ e.getY());
77+
78+ return true;
79+ }
80+
81+ return false;
82+ });
83+
84+ button2 = new JButton("進む");
85+ button2.setToolTipText("右クリック:プルダウンメニューの表示");
86+ button2.addActionListener(e -> {
87+ if (!historyRight.isEmpty())
88+ travelRight(1);
89+ });
90+ HSwing.hookPopup(button2, e -> {
91+
92+ if (!historyRight.isEmpty()) {
93+ JPopupMenu popupMenu = new JPopupMenu();
94+
95+ for (int i = 0; i < historyRight.size(); i++) {
96+ Tuple<URL, Integer> entry = historyRight.get(i);
97+ JMenuItem menuItem = new JMenuItem(entry.getY()
98+ .toString() + ": " + entry.getX().toString());
99+ popupMenu.add(menuItem);
100+
101+ int i2 = i + 1;
102+ menuItem.addActionListener(e2 -> {
103+ travelRight(i2);
104+ });
105+ }
106+
107+ popupMenu.show((Component) e.getSource(), e.getX(),
108+ e.getY());
109+
110+ return true;
111+ }
112+
113+ return false;
114+ });
115+
116+ textField1 = new JTextField();
117+ textField1.addActionListener(e -> {
118+ navigate(textField1.getText());
119+ });
120+
121+ JButton button3 = new JButton("移動");
122+ button3.addActionListener(e -> {
123+ navigate(textField1.getText());
124+ });
125+
126+ JButton button4 = new JButton("更新");
127+ button4.addActionListener(e -> {
128+ refresh();
129+ });
130+
131+ editorPane1 = new JEditorPane();
132+ editorPane1.setEditable(false);
133+ editorPane1.addHyperlinkListener(e -> {
134+ if (e.getEventType() == EventType.ACTIVATED) {
135+ navigate(e.getURL());
136+ }
137+ });
138+ editorPane1.addKeyListener(new KeyListener() {
139+
140+ @Override
141+ public void keyTyped(KeyEvent e) {
142+
143+ }
144+
145+ @Override
146+ public void keyReleased(KeyEvent e) {
147+
148+ }
149+
150+ @Override
151+ public void keyPressed(KeyEvent e) {
152+ if (e.getKeyCode() == KeyEvent.VK_F5) {
153+ refresh();
154+ return;
155+ }
156+ if (e.getKeyCode() == KeyEvent.VK_BACK_SPACE) {
157+ if (!historyLeft.isEmpty())
158+ travelLeft(1);
159+ return;
160+ }
161+ }
162+
163+ });
164+
165+ scrollPane1 = new JScrollPane(editorPane1);
166+ scrollPane1.setPreferredSize(new Dimension(800, 800));
167+
168+ {
169+ GroupLayout layout = new GroupLayout(getContentPane());
170+ setLayout(layout);
171+
172+ layout.setAutoCreateGaps(true);
173+ layout.setAutoCreateContainerGaps(false);
174+
175+ GroupBuilder.group(
176+ GroupBuilder.group(button1, button2,
177+ new JLabel("アドレス:"), textField1, button3,
178+ button4).align(Alignment.CENTER), scrollPane1)
179+ .apply(layout);
180+ }
181+ }
182+
183+ historyChanged();
184+
185+ HLog.log(EnumTypeLog.FINE, "HTMLビューワを起動しました");
186+
187+ prepareFrame();
188+ }
189+
190+ private void refresh() {
191+ Tuple<URL, Integer> now = getNow();
192+
193+ ((HTMLDocument) editorPane1.getDocument()).getDocumentProperties()
194+ .remove(Document.StreamDescriptionProperty);
195+
196+ if (now != null)
197+ setPage(now);
198+ }
199+
200+ private Tuple<URL, Integer> getNow() {
201+ URL page = editorPane1.getPage();
202+
203+ return page == null ? null : new Tuple<>(page, scrollPane1
204+ .getVerticalScrollBar().getValue());
205+ }
206+
207+ private void travelLeft(int times) {
208+ Tuple<URL, Integer> now = getNow();
209+
210+ // 履歴操作
211+ for (int i = 0; i < times; i++) {
212+ historyRight.addFirst(now);
213+ now = historyLeft.removeLast();
214+ }
215+
216+ historyChanged();
217+
218+ setPage(now);
219+ }
220+
221+ private void travelRight(int times) {
222+ Tuple<URL, Integer> now = getNow();
223+
224+ // 履歴操作
225+ for (int i = 0; i < times; i++) {
226+ historyLeft.addLast(now);
227+ now = historyRight.removeFirst();
228+ }
229+
230+ historyChanged();
231+
232+ setPage(now);
233+ }
234+
235+ private void setPage(Tuple<URL, Integer> url) {
236+ try {
237+ editorPane1.setPage(url.getX());
238+ } catch (IOException e) {
239+ HLog.processExceptionWarning(e);
240+ return;
241+ }
242+
243+ textField1.setText(url.getX().toString());
244+
245+ // 表示位置調整
246+ Struct1<PropertyChangeListener> listener = new Struct1<>();
247+ listener.x = e -> {
248+ editorPane1.removePropertyChangeListener("page", listener.x);
249+
250+ scrollPane1.getVerticalScrollBar().setValue(url.getY());
251+
252+ };
253+ editorPane1.addPropertyChangeListener("page", listener.x);
254+
255+ // 同じページに遷移した場合にイベントが発生しないので念のために変更しておく
256+ // TODO イベントが残留するが次のイベントで死ぬのでとりあえず良しとする
257+ scrollPane1.getVerticalScrollBar().setValue(url.getY());
258+
259+ }
260+
261+ public void navigate(String url) {
262+ Tuple<URL, Integer> now = getNow();
263+ if (now != null) {
264+ historyLeft.addLast(now);
265+ historyChanged();
266+ }
267+
268+ try {
269+ editorPane1.setPage(url);
270+ } catch (IOException e) {
271+ HLog.processExceptionWarning(e);
272+ return;
273+ }
274+
275+ textField1.setText(url);
276+ }
277+
278+ public void navigate(URL url) {
279+ Tuple<URL, Integer> now = getNow();
280+ if (now != null) {
281+ historyLeft.addLast(now);
282+ historyChanged();
283+ }
284+
285+ try {
286+ editorPane1.setPage(url);
287+ } catch (IOException e) {
288+ HLog.processExceptionWarning(e);
289+ return;
290+ }
291+
292+ textField1.setText(url.toString());
293+ }
294+
295+ private void historyChanged() {
296+ button1.setEnabled(!historyLeft.isEmpty());
297+ button2.setEnabled(!historyRight.isEmpty());
298+ }
299+
300+}
diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/FrameMirrg.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/FrameMirrg.java Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,181 @@
1+package mirrg.swing.helium;
2+
3+import java.awt.GraphicsConfiguration;
4+import java.awt.HeadlessException;
5+import java.awt.event.ComponentEvent;
6+import java.awt.event.ComponentListener;
7+import java.awt.event.WindowEvent;
8+import java.awt.event.WindowListener;
9+import java.util.ArrayList;
10+import java.util.function.Consumer;
11+
12+import javax.swing.JFrame;
13+import javax.swing.WindowConstants;
14+
15+public class FrameMirrg extends JFrame {
16+
17+ public FrameMirrg() throws HeadlessException {
18+ super();
19+ initFrameMirrg();
20+ }
21+
22+ public FrameMirrg(GraphicsConfiguration gc) {
23+ super(gc);
24+ initFrameMirrg();
25+ }
26+
27+ public FrameMirrg(String title) throws HeadlessException {
28+ super(title);
29+ initFrameMirrg();
30+ }
31+
32+ public FrameMirrg(String title, GraphicsConfiguration gc) {
33+ super(title, gc);
34+ initFrameMirrg();
35+ }
36+
37+ // //////////////////////////////////////////////
38+
39+ private ArrayList<Consumer<WindowEvent>> listenersOnInitialized = new ArrayList<>();
40+ private ArrayList<Consumer<ComponentEvent>> listenersOnShown = new ArrayList<>();
41+ private ArrayList<Consumer<ComponentEvent>> listenersOnHidden = new ArrayList<>();
42+ private ArrayList<Consumer<WindowEvent>> listenersOnDisposed = new ArrayList<>();
43+
44+ /**
45+ * 初回open時
46+ */
47+ public void hookInitialized(Consumer<WindowEvent> listener) {
48+ listenersOnInitialized.add(listener);
49+ }
50+
51+ /**
52+ * 初回も含めてウィンドウが開くとき
53+ */
54+ public void hookShown(Consumer<ComponentEvent> listener) {
55+ listenersOnShown.add(listener);
56+ }
57+
58+ /**
59+ * disposeも含めてウィンドウが閉じるとき
60+ */
61+ public void hookHidden(Consumer<ComponentEvent> listener) {
62+ listenersOnHidden.add(listener);
63+ }
64+
65+ /**
66+ * disposeするとき
67+ */
68+ public void hookDisposed(Consumer<WindowEvent> listener) {
69+ listenersOnDisposed.add(listener);
70+ }
71+
72+ // //////////////////////////////////////////////
73+
74+ private boolean visible = false;
75+
76+ private void initFrameMirrg() {
77+ addComponentListener(new ComponentListener() {
78+
79+ @Override
80+ public void componentShown(ComponentEvent e) {
81+ visible = true;
82+
83+ listenersOnShown.forEach(listener -> {
84+ listener.accept(e);
85+ });
86+ }
87+
88+ @Override
89+ public void componentResized(ComponentEvent e) {
90+
91+ }
92+
93+ @Override
94+ public void componentMoved(ComponentEvent e) {
95+
96+ }
97+
98+ @Override
99+ public void componentHidden(ComponentEvent e) {
100+ visible = false;
101+
102+ listenersOnHidden.forEach(listener -> {
103+ listener.accept(e);
104+ });
105+ }
106+
107+ });
108+ addWindowListener(new WindowListener() {
109+
110+ @Override
111+ public void windowOpened(WindowEvent e) {
112+ listenersOnInitialized.forEach(listener -> {
113+ listener.accept(e);
114+ });
115+ }
116+
117+ @Override
118+ public void windowIconified(WindowEvent e) {
119+
120+ }
121+
122+ @Override
123+ public void windowDeiconified(WindowEvent e) {
124+
125+ }
126+
127+ @Override
128+ public void windowDeactivated(WindowEvent e) {
129+
130+ }
131+
132+ @Override
133+ public void windowClosing(WindowEvent e) {
134+
135+ }
136+
137+ @Override
138+ public void windowClosed(WindowEvent e) {
139+ if (visible) {
140+ listenersOnHidden.forEach(listener -> {
141+ listener.accept(e);
142+ });
143+ }
144+ listenersOnDisposed.forEach(listener -> {
145+ listener.accept(e);
146+ });
147+ }
148+
149+ @Override
150+ public void windowActivated(WindowEvent e) {
151+
152+ }
153+
154+ });
155+ }
156+
157+ private volatile boolean isDisposed = false;
158+
159+ /**
160+ * スレッドセーフ
161+ */
162+ public boolean isDisposed() {
163+ return isDisposed;
164+ }
165+
166+ @Override
167+ public void dispose() {
168+ isDisposed = true;
169+ super.dispose();
170+ }
171+
172+ // //////////////////////////////////////////////
173+
174+ public void prepareFrame() {
175+ setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
176+
177+ pack();
178+ setLocationByPlatform(true);
179+ }
180+
181+}
diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/GroupBuilder.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/GroupBuilder.java Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,57 @@
1+package mirrg.swing.helium;
2+
3+import java.awt.Component;
4+
5+import javax.swing.GroupLayout;
6+import javax.swing.GroupLayout.Alignment;
7+import javax.swing.GroupLayout.Group;
8+
9+public class GroupBuilder {
10+
11+ public static GroupBuilder group(Object... objects) {
12+ return new GroupBuilder(objects);
13+ }
14+
15+ private Object[] objects;
16+ private Alignment alignment = null;
17+
18+ public GroupBuilder(Object[] objects) {
19+ this.objects = objects;
20+ }
21+
22+ public Group build(GroupLayout groupLayout) {
23+ return build(groupLayout, true);
24+ }
25+
26+ public Group build(GroupLayout groupLayout, boolean isSequential) {
27+ Group group = isSequential ? groupLayout.createSequentialGroup()
28+ : alignment != null ? groupLayout
29+ .createParallelGroup(alignment) : groupLayout
30+ .createParallelGroup();
31+
32+ for (Object object : objects) {
33+ if (object instanceof GroupBuilder) {
34+ group.addGroup(((GroupBuilder) object).build(groupLayout,
35+ !isSequential));
36+ } else if (object instanceof Component) {
37+ group.addComponent((Component) object);
38+ } else {
39+ throw new RuntimeException("unknown group build entry: "
40+ + object);
41+ }
42+ }
43+
44+ return group;
45+ }
46+
47+ public void apply(GroupLayout layout) {
48+ layout.setHorizontalGroup(build(layout, false));
49+ layout.setVerticalGroup(build(layout));
50+ }
51+
52+ public GroupBuilder align(Alignment alignment) {
53+ this.alignment = alignment;
54+ return this;
55+ }
56+
57+}
diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/HSwing.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/HSwing.java Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,200 @@
1+package mirrg.swing.helium;
2+
3+import java.awt.Component;
4+import java.awt.Font;
5+import java.awt.event.MouseEvent;
6+import java.awt.event.MouseListener;
7+import java.lang.reflect.Field;
8+import java.util.function.Consumer;
9+import java.util.function.Predicate;
10+import java.util.regex.Pattern;
11+
12+import javax.swing.UIManager;
13+import javax.swing.UIManager.LookAndFeelInfo;
14+import javax.swing.UnsupportedLookAndFeelException;
15+import javax.swing.event.DocumentEvent;
16+import javax.swing.event.DocumentListener;
17+import javax.swing.text.JTextComponent;
18+
19+public class HSwing {
20+
21+ public static void setWindowsLookAndFeel() {
22+ try {
23+ UIManager
24+ .setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
25+ } catch (ClassNotFoundException e) {
26+ e.printStackTrace();
27+ } catch (InstantiationException e) {
28+ e.printStackTrace();
29+ } catch (IllegalAccessException e) {
30+ e.printStackTrace();
31+ } catch (UnsupportedLookAndFeelException e) {
32+ e.printStackTrace();
33+ }
34+ }
35+
36+ public static boolean tryAddWebLookAndFeel() {
37+ try {
38+ Class<?> clazz = Class.forName("com.alee.laf.WebLookAndFeel");
39+ if (clazz != null) {
40+
41+ Field[] fields = clazz.getFields();
42+
43+ Pattern pattern = Pattern.compile("global[\\w\\d_]*Font");
44+ Font font = new Font(Font.SANS_SERIF, Font.PLAIN, 12);
45+
46+ for (Field field : fields) {
47+ if (pattern.matcher(field.getName()).matches()) {
48+ if (field.getType().isInstance(font)) {
49+ try {
50+ field.set(null, font);
51+ } catch (IllegalArgumentException e) {
52+ e.printStackTrace();
53+ } catch (IllegalAccessException e) {
54+ e.printStackTrace();
55+ }
56+ }
57+ }
58+ }
59+
60+ UIManager.installLookAndFeel(new LookAndFeelInfo(clazz
61+ .getSimpleName(), clazz.getName()));
62+
63+ }
64+
65+ return true;
66+ } catch (ClassNotFoundException e) {
67+ return false;
68+ }
69+ }
70+
71+ public static void hookRightClick(Component component,
72+ Predicate<MouseEvent> listener) {
73+ component.addMouseListener(new MouseListener() {
74+
75+ @Override
76+ public void mouseReleased(MouseEvent e) {
77+
78+ }
79+
80+ @Override
81+ public void mousePressed(MouseEvent e) {
82+
83+ }
84+
85+ @Override
86+ public void mouseExited(MouseEvent e) {
87+
88+ }
89+
90+ @Override
91+ public void mouseEntered(MouseEvent e) {
92+
93+ }
94+
95+ @Override
96+ public void mouseClicked(MouseEvent e) {
97+ if (e.getButton() == MouseEvent.BUTTON3) {
98+ if (listener.test(e))
99+ e.consume();
100+ }
101+ }
102+
103+ });
104+ }
105+
106+ public static void hookPopup(Component component,
107+ Predicate<MouseEvent> listener) {
108+ component.addMouseListener(new MouseListener() {
109+
110+ @Override
111+ public void mouseReleased(MouseEvent e) {
112+ if (e.isPopupTrigger()) {
113+ if (listener.test(e))
114+ e.consume();
115+ }
116+ }
117+
118+ @Override
119+ public void mousePressed(MouseEvent e) {
120+ if (e.isPopupTrigger()) {
121+ if (listener.test(e))
122+ e.consume();
123+ }
124+ }
125+
126+ @Override
127+ public void mouseExited(MouseEvent e) {
128+
129+ }
130+
131+ @Override
132+ public void mouseEntered(MouseEvent e) {
133+
134+ }
135+
136+ @Override
137+ public void mouseClicked(MouseEvent e) {
138+
139+ }
140+
141+ });
142+ }
143+
144+ public static void hookChange(JTextComponent textComponent,
145+ Consumer<DocumentEvent> listener) {
146+ textComponent.getDocument().addDocumentListener(new DocumentListener() {
147+
148+ @Override
149+ public void insertUpdate(DocumentEvent e) {
150+ listener.accept(e);
151+ }
152+
153+ @Override
154+ public void removeUpdate(DocumentEvent e) {
155+ listener.accept(e);
156+ }
157+
158+ @Override
159+ public void changedUpdate(DocumentEvent e) {
160+ listener.accept(e);
161+ }
162+
163+ });
164+ }
165+
166+ public static void hookDoubleClick(Component component,
167+ Consumer<MouseEvent> listener) {
168+ component.addMouseListener(new MouseListener() {
169+
170+ @Override
171+ public void mouseClicked(MouseEvent e) {
172+ if (e.getClickCount() == 2) {
173+ listener.accept(e);
174+ }
175+ }
176+
177+ @Override
178+ public void mousePressed(MouseEvent e) {
179+
180+ }
181+
182+ @Override
183+ public void mouseReleased(MouseEvent e) {
184+
185+ }
186+
187+ @Override
188+ public void mouseEntered(MouseEvent e) {
189+
190+ }
191+
192+ @Override
193+ public void mouseExited(MouseEvent e) {
194+
195+ }
196+
197+ });
198+ }
199+
200+}
diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/MenuLookAndFeel.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/MenuLookAndFeel.java Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,73 @@
1+package mirrg.swing.helium;
2+
3+import java.awt.Window;
4+import java.util.Hashtable;
5+
6+import javax.swing.ButtonGroup;
7+import javax.swing.ButtonModel;
8+import javax.swing.JMenu;
9+import javax.swing.JRadioButtonMenuItem;
10+import javax.swing.SwingUtilities;
11+import javax.swing.UIManager;
12+import javax.swing.UIManager.LookAndFeelInfo;
13+import javax.swing.UnsupportedLookAndFeelException;
14+
15+import mirrg.swing.helium.logging.HLog;
16+
17+public class MenuLookAndFeel extends JMenu {
18+
19+ private ButtonGroup buttonGroup = new ButtonGroup();
20+ private Hashtable<String, JRadioButtonMenuItem> hashClassNameToRadio = new Hashtable<>();
21+
22+ public MenuLookAndFeel() {
23+ super("LookAndFeel(L)");
24+
25+ setMnemonic('L');
26+
27+ for (LookAndFeelInfo lookAndFeelInfo : UIManager
28+ .getInstalledLookAndFeels()) {
29+ JRadioButtonMenuItem radio = createRadio(lookAndFeelInfo.getName(),
30+ lookAndFeelInfo.getClassName());
31+ add(radio);
32+ hashClassNameToRadio.put(lookAndFeelInfo.getClassName(), radio);
33+ }
34+
35+ addActionListener(e -> {
36+ buttonGroup.setSelected(
37+ hashClassNameToRadio.get(
38+ UIManager.getLookAndFeel().getClass()).getModel(),
39+ true);
40+ });
41+ }
42+
43+ protected JRadioButtonMenuItem createRadio(String name, String className) {
44+ JRadioButtonMenuItem radioButtonMenuItem = new JRadioButtonMenuItem();
45+ radioButtonMenuItem.setText(name);
46+ radioButtonMenuItem.setActionCommand(className);
47+ radioButtonMenuItem.setHideActionText(true);
48+ radioButtonMenuItem.addActionListener(e -> {
49+ ButtonModel m = buttonGroup.getSelection();
50+ try {
51+ setLookAndFeel(m.getActionCommand());
52+ } catch (Exception e1) {
53+ HLog.processException(e1);
54+ }
55+ });
56+ buttonGroup.add(radioButtonMenuItem);
57+ return radioButtonMenuItem;
58+ }
59+
60+ public void setLookAndFeel(String lookAndFeel)
61+ throws ClassNotFoundException, InstantiationException,
62+ IllegalAccessException, UnsupportedLookAndFeelException {
63+ UIManager.setLookAndFeel(lookAndFeel);
64+ updateLookAndFeel();
65+ }
66+
67+ private void updateLookAndFeel() {
68+ for (Window window : Window.getWindows()) {
69+ SwingUtilities.updateComponentTreeUI(window);
70+ }
71+ }
72+
73+}
diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/NamedSlot.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/NamedSlot.java Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,26 @@
1+package mirrg.swing.helium;
2+
3+import java.util.function.Function;
4+import java.util.function.Supplier;
5+
6+public class NamedSlot<T> implements Supplier<T> {
7+
8+ private T t;
9+ private Function<T, String> functionName;
10+
11+ public NamedSlot(T t, Function<T, String> functionName) {
12+ this.t = t;
13+ this.functionName = functionName;
14+ }
15+
16+ @Override
17+ public String toString() {
18+ return functionName.apply(t);
19+ }
20+
21+ @Override
22+ public T get() {
23+ return t;
24+ }
25+
26+}
diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/TitledGroup.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/TitledGroup.java Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,13 @@
1+package mirrg.swing.helium;
2+
3+import javax.swing.BorderFactory;
4+import javax.swing.JComponent;
5+
6+public class TitledGroup extends JComponent {
7+
8+ public TitledGroup(String title) {
9+ if (title != null)
10+ setBorder(BorderFactory.createTitledBorder(title));
11+ }
12+
13+}
diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/logging/EnumTypeLog.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/logging/EnumTypeLog.java Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,5 @@
1+package mirrg.swing.helium.logging;
2+
3+public enum EnumTypeLog {
4+ INFO, FINE, WARNING, ERROR, UNEXPECTED,
5+}
diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/logging/FrameLog.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/logging/FrameLog.java Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,218 @@
1+package mirrg.swing.helium.logging;
2+
3+import java.awt.CardLayout;
4+import java.awt.Color;
5+import java.awt.Dimension;
6+
7+import javax.swing.JCheckBox;
8+import javax.swing.JMenu;
9+import javax.swing.JMenuBar;
10+import javax.swing.JMenuItem;
11+import javax.swing.JScrollBar;
12+import javax.swing.JScrollPane;
13+import javax.swing.JTextPane;
14+import javax.swing.SwingUtilities;
15+import javax.swing.text.BadLocationException;
16+import javax.swing.text.DefaultStyledDocument;
17+import javax.swing.text.Style;
18+import javax.swing.text.StyleConstants;
19+import javax.swing.text.StyleContext;
20+
21+import mirrg.struct.hydrogen.Tuple;
22+import mirrg.swing.helium.FrameMirrg;
23+import mirrg.swing.helium.MenuLookAndFeel;
24+
25+public class FrameLog extends FrameMirrg {
26+
27+ public static void main(String[] args) {
28+ {
29+ HLog.error("Error!");
30+ HLog.warning("Warning!");
31+ new FrameLog(300).setVisible(true);
32+ HLog.fine("Fine!");
33+ HLog.info("Info!");
34+ new FrameLog(300).setVisible(true);
35+ HLog.info().println("Print Info!");
36+ new RuntimeException("Exception!").printStackTrace(HLog.warning());
37+
38+ Thread thread = new Thread(() -> {
39+
40+ while (true) {
41+ HLog.info().println("Info!");
42+ try {
43+ Thread.sleep(1000);
44+ } catch (Exception e) {
45+ break;
46+ }
47+ }
48+
49+ });
50+ thread.setDaemon(true);
51+ thread.start();
52+ }
53+
54+ {
55+ LoggerMirrg logger = new LoggerMirrg();
56+
57+ for (int i = 0; i < 1000; i++) {
58+ logger.info("abc");
59+ }
60+
61+ new FrameLog(logger, 300).setVisible(true);
62+ }
63+
64+ }
65+
66+ private JCheckBox checkBoxAutoScroll;
67+ private JScrollPane scrollPaneMessages;
68+ private DefaultStyledDocument document;
69+
70+ public FrameLog(int loadedMessages) {
71+ this(HLog.logger, loadedMessages);
72+ }
73+
74+ public FrameLog(LoggerMirrg loggerMirrg, int loadedMessages) {
75+ super("ログウィンドウ");
76+
77+ int skipMessages = loggerMirrg.getMessageCount() - loadedMessages;
78+
79+ {
80+ JMenuBar menuBar = new JMenuBar();
81+ setJMenuBar(menuBar);
82+
83+ {
84+ JMenu menu = new JMenu("メニュー(M)");
85+ menuBar.add(menu);
86+
87+ menu.setMnemonic('M');
88+
89+ {
90+ JMenu menu2 = new MenuLookAndFeel();
91+ menu.add(menu2);
92+ }
93+
94+ {
95+ JMenuItem menuItem = new JMenuItem("ログウィンドウのクリア(C)");
96+ menu.add(menuItem);
97+
98+ menuItem.setMnemonic('C');
99+ menuItem.addActionListener(e -> {
100+ try {
101+ document.remove(0, document.getLength());
102+ } catch (BadLocationException e1) {
103+ HLog.processExceptionUnexpected(e1);
104+ }
105+ });
106+ }
107+ }
108+
109+ {
110+ checkBoxAutoScroll = new JCheckBox("オートスクロール(A)", true);
111+ menuBar.add(checkBoxAutoScroll);
112+
113+ checkBoxAutoScroll.setMnemonic('A');
114+ }
115+
116+ }
117+
118+ {
119+ document = new DefaultStyledDocument();
120+ {
121+ Style styleDefault = StyleContext.getDefaultStyleContext()
122+ .getStyle(StyleContext.DEFAULT_STYLE);
123+
124+ Style info = document.addStyle("INFO", styleDefault);
125+ StyleConstants.setForeground(info, Color.BLACK);
126+
127+ Style fine = document.addStyle("FINE", styleDefault);
128+ StyleConstants.setForeground(fine, new Color(0x0088ff));
129+
130+ Style warning = document.addStyle("WARNING", styleDefault);
131+ StyleConstants.setForeground(warning, new Color(0xff8800));
132+
133+ Style error = document.addStyle("ERROR", styleDefault);
134+ StyleConstants.setForeground(error, Color.RED);
135+
136+ Style unexpected = document
137+ .addStyle("UNEXPECTED", styleDefault);
138+ StyleConstants.setForeground(unexpected, new Color(0x8800ff));
139+
140+ }
141+
142+ JTextPane textPane = new JTextPane(document);
143+
144+ textPane.setEditable(false);
145+
146+ scrollPaneMessages = new JScrollPane(textPane);
147+ scrollPaneMessages.setPreferredSize(new Dimension(400, 400));
148+
149+ add(scrollPaneMessages);
150+ }
151+
152+ setLayout(new CardLayout());
153+
154+ hookInitialized(e -> {
155+
156+ int start = Math.max(0, skipMessages);
157+
158+ // 省略されたメッセージ
159+ if (start > 0) {
160+ addMessage(new Tuple<>(EnumTypeLog.INFO, "省略された" + start
161+ + "件のメッセージ"));
162+ }
163+
164+ // 既存のメッセージ
165+ for (int i = start; i < loggerMirrg.getMessageCount(); i++) {
166+ addMessage(loggerMirrg.getMessage(i));
167+ }
168+
169+ // 新しいメッセージ
170+ loggerMirrg.registerListener(message -> {
171+ if (disabled || isDisposed())
172+ return true;
173+ SwingUtilities.invokeLater(() -> {
174+ addMessage(message);
175+ });
176+ return false;
177+ });
178+
179+ });
180+
181+ prepareFrame();
182+ }
183+
184+ private transient boolean disabled = false;
185+
186+ public void disableAcceptMessage() {
187+ disabled = true;
188+ addMessage(new Tuple<>(EnumTypeLog.INFO,
189+ "Log window has been disabled."));
190+ }
191+
192+ private void addMessage(Tuple<EnumTypeLog, String> message) {
193+ try {
194+
195+ // 追加処理
196+ document.insertString(document.getLength(), message.getY() + "\n",
197+ document.getStyle(message.getX().name()));
198+
199+ // オートスクロール
200+ if (checkBoxAutoScroll.isSelected()) {
201+ scrollPaneMessages.validate();
202+ JScrollBar scrollBar = scrollPaneMessages
203+ .getVerticalScrollBar();
204+ try {
205+ scrollBar.setValue(scrollBar.getMaximum()
206+ - scrollBar.getVisibleAmount());
207+ } catch (NullPointerException e) {
208+ // なぜか内部で例外が発生する。
209+ HLog.processExceptionUnexpected(e);
210+ }
211+ }
212+
213+ } catch (BadLocationException e) {
214+ HLog.processExceptionUnexpected(e);
215+ }
216+ }
217+
218+}
diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/logging/HLog.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/logging/HLog.java Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,98 @@
1+package mirrg.swing.helium.logging;
2+
3+import java.io.PrintStream;
4+import java.util.function.Predicate;
5+
6+import mirrg.struct.hydrogen.Tuple;
7+
8+public class HLog {
9+
10+ /**
11+ * このロガーは標準出力にも垂れ流す。
12+ */
13+ public static final LoggerMirrg logger = new LoggerMirrg(true);
14+
15+ public static void processException(Exception exception) {
16+ logger.processException(exception);
17+ }
18+
19+ public static void processExceptionWarning(Exception exception) {
20+ logger.processExceptionWarning(exception);
21+ }
22+
23+ public static void processExceptionUnexpected(Exception exception) {
24+ logger.processExceptionUnexpected(exception);
25+ }
26+
27+ public static void processException(Exception exception, String string,
28+ boolean isFatal) {
29+ logger.processException(exception, string, isFatal);
30+ }
31+
32+ public static void processException(Exception exception, String string,
33+ boolean showFrameLog, EnumTypeLog typeLog) {
34+ logger.processException(exception, string, showFrameLog, typeLog);
35+ }
36+
37+ public static void info(String string) {
38+ logger.info(string);
39+ }
40+
41+ public static void fine(String string) {
42+ logger.fine(string);
43+ }
44+
45+ public static void warning(String string) {
46+ logger.warning(string);
47+ }
48+
49+ public static void error(String string) {
50+ logger.error(string);
51+ }
52+
53+ public static void unexpected(String string) {
54+ logger.unexpected(string);
55+ }
56+
57+ public static void log(EnumTypeLog typeLog, String string) {
58+ logger.log(typeLog, string);
59+ }
60+
61+ public static PrintStream info() {
62+ return logger.info();
63+ }
64+
65+ public static PrintStream fine() {
66+ return logger.fine();
67+ }
68+
69+ public static PrintStream warning() {
70+ return logger.warning();
71+ }
72+
73+ public static PrintStream error() {
74+ return logger.error();
75+ }
76+
77+ public static PrintStream unexpected() {
78+ return logger.unexpected();
79+ }
80+
81+ public static PrintStream log(EnumTypeLog typeLog) {
82+ return logger.log(typeLog);
83+ }
84+
85+ public static int getMessageCount() {
86+ return logger.getMessageCount();
87+ }
88+
89+ public static Tuple<EnumTypeLog, String> getMessage(int index) {
90+ return logger.getMessage(index);
91+ }
92+
93+ public static void registerListener(
94+ Predicate<Tuple<EnumTypeLog, String>> listener) {
95+ logger.registerListener(listener);
96+ }
97+
98+}
diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/logging/LoggerMirrg.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/src/main/java/mirrg/swing/helium/logging/LoggerMirrg.java Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,275 @@
1+package mirrg.swing.helium.logging;
2+
3+import java.io.IOException;
4+import java.io.OutputStream;
5+import java.io.PrintStream;
6+import java.io.UnsupportedEncodingException;
7+import java.nio.charset.Charset;
8+import java.util.ArrayList;
9+import java.util.Iterator;
10+import java.util.function.Consumer;
11+import java.util.function.Predicate;
12+
13+import mirrg.struct.hydrogen.Tuple;
14+
15+public class LoggerMirrg {
16+
17+ /**
18+ * 例外をerrorとして処理する。ログウィンドウが表示される。
19+ *
20+ * @see #processException(Exception, String, boolean, EnumTypeLog)
21+ */
22+ public void processException(Exception exception) {
23+ processException(exception, null, true, EnumTypeLog.ERROR);
24+ }
25+
26+ /**
27+ * 例外を想定外の問題として処理する。ログウィンドウは表示されない。
28+ *
29+ * @see #processException(Exception, String, boolean, EnumTypeLog)
30+ */
31+ public void processExceptionWarning(Exception exception) {
32+ processException(exception, null, false, EnumTypeLog.WARNING);
33+ }
34+
35+ /**
36+ * 例外を想定外の問題として処理する。ログウィンドウが表示される。
37+ *
38+ * @see #processException(Exception, String, boolean, EnumTypeLog)
39+ */
40+ public void processExceptionUnexpected(Exception exception) {
41+ processException(exception, null, true, EnumTypeLog.UNEXPECTED);
42+ }
43+
44+ /**
45+ * @param isFatal
46+ * 実行中のタスクが停止するような致命的な問題であるか。
47+ * trueの場合errorとして、falseの場合warningとして扱う。 また、trueの場合はログウィンドウを表示する。
48+ * @see #processException(Exception, String, boolean, EnumTypeLog)
49+ */
50+ public void processException(Exception exception, String string,
51+ boolean isFatal) {
52+ processException(exception, string, isFatal,
53+ isFatal ? EnumTypeLog.ERROR : EnumTypeLog.WARNING);
54+ }
55+
56+ /**
57+ * @param exception
58+ * nullable。
59+ * @param string
60+ * nullable。 この例外が発生しているときのシステムの状態。
61+ */
62+ public void processException(Exception exception, String string,
63+ boolean showFrameLog, EnumTypeLog typeLog) {
64+ FrameLog frameLog = null;
65+ if (showFrameLog) {
66+ frameLog = new FrameLog(0);
67+ frameLog.setVisible(true);
68+ }
69+ if (string != null)
70+ log(typeLog, string);
71+ if (exception != null)
72+ exception.printStackTrace(log(typeLog));
73+ if (frameLog != null)
74+ frameLog.disableAcceptMessage();
75+ }
76+
77+ // //////////////////////////////////////////////////////
78+
79+ public boolean bridgeStdout;
80+
81+ public LoggerMirrg(boolean bridgeStdout) {
82+ this.bridgeStdout = bridgeStdout;
83+ }
84+
85+ public LoggerMirrg() {
86+ this(false);
87+ }
88+
89+ public void setBridgeStdout(boolean bridgeStdout) {
90+ this.bridgeStdout = bridgeStdout;
91+ }
92+
93+ public boolean isBridgeStdout() {
94+ return bridgeStdout;
95+ }
96+
97+ public void info(String string) {
98+ log(EnumTypeLog.INFO, string);
99+ }
100+
101+ public void fine(String string) {
102+ log(EnumTypeLog.FINE, string);
103+ }
104+
105+ public void warning(String string) {
106+ log(EnumTypeLog.WARNING, string);
107+ }
108+
109+ public void error(String string) {
110+ log(EnumTypeLog.ERROR, string);
111+ }
112+
113+ public void unexpected(String string) {
114+ log(EnumTypeLog.UNEXPECTED, string);
115+ }
116+
117+ public void log(EnumTypeLog typeLog, String string) {
118+ if (bridgeStdout)
119+ System.out.println("[" + typeLog.name() + "] " + string);
120+
121+ Tuple<EnumTypeLog, String> message = new Tuple<>(typeLog, string);
122+
123+ messages.add(message);
124+
125+ Iterator<Predicate<Tuple<EnumTypeLog, String>>> iterator = listeners
126+ .iterator();
127+ while (iterator.hasNext()) {
128+ Predicate<Tuple<EnumTypeLog, String>> next = iterator.next();
129+
130+ if (next.test(message)) {
131+ iterator.remove();
132+ }
133+ }
134+ }
135+
136+ // /////////////////////////////////////////////
137+
138+ private PrintStream outInfo;
139+
140+ public PrintStream info() {
141+ if (outInfo == null) {
142+ outInfo = createPrintStream(this::info);
143+ }
144+ return outInfo;
145+ }
146+
147+ private PrintStream outFine;
148+
149+ public PrintStream fine() {
150+ if (outFine == null) {
151+ outFine = createPrintStream(this::fine);
152+ }
153+ return outFine;
154+ }
155+
156+ private PrintStream outWarning;
157+
158+ public PrintStream warning() {
159+ if (outWarning == null) {
160+ outWarning = createPrintStream(this::warning);
161+ }
162+ return outWarning;
163+ }
164+
165+ private PrintStream outError;
166+
167+ public PrintStream error() {
168+ if (outError == null) {
169+ outError = createPrintStream(this::error);
170+ }
171+ return outError;
172+ }
173+
174+ private PrintStream outUnexpected;
175+
176+ public PrintStream unexpected() {
177+ if (outUnexpected == null) {
178+ outUnexpected = createPrintStream(this::unexpected);
179+ }
180+ return outUnexpected;
181+ }
182+
183+ public PrintStream log(EnumTypeLog typeLog) {
184+ switch (typeLog) {
185+ case INFO:
186+ return info();
187+ case FINE:
188+ return fine();
189+ case WARNING:
190+ return warning();
191+ case ERROR:
192+ return error();
193+ case UNEXPECTED:
194+ return unexpected();
195+ default:
196+ return null;
197+ }
198+ }
199+
200+ private PrintStream createPrintStream(Consumer<String> consumer) {
201+ try {
202+ return new PrintStream(new OutputStreamLogger(consumer), true,
203+ "UTF-8");
204+ } catch (UnsupportedEncodingException e) {
205+ throw new RuntimeException(e);
206+ }
207+ }
208+
209+ // /////////////////////////////////////////////
210+
211+ private ArrayList<Tuple<EnumTypeLog, String>> messages = new ArrayList<>();
212+
213+ public int getMessageCount() {
214+ return messages.size();
215+ }
216+
217+ public Tuple<EnumTypeLog, String> getMessage(int index) {
218+ return messages.get(index);
219+ }
220+
221+ private ArrayList<Predicate<Tuple<EnumTypeLog, String>>> listeners = new ArrayList<>();
222+
223+ /**
224+ * @param listener
225+ * イベントハンドラを削除する場合にtrueを返す。
226+ */
227+ public void registerListener(Predicate<Tuple<EnumTypeLog, String>> listener) {
228+ listeners.add(listener);
229+ }
230+
231+ private static class OutputStreamLogger extends OutputStream {
232+
233+ private static final Charset charset = Charset.forName("UTF-8");
234+
235+ private Consumer<String> consumer;
236+
237+ public OutputStreamLogger(Consumer<String> consumer) {
238+ this.consumer = consumer;
239+ }
240+
241+ private ArrayList<Byte> buffer = new ArrayList<>();
242+ private boolean afterR = false;
243+
244+ @Override
245+ public void write(int b) throws IOException {
246+ if (b == '\r') {
247+ flush2();
248+ } else {
249+ if (b == '\n') {
250+ if (afterR) {
251+
252+ } else {
253+ flush2();
254+ }
255+ } else {
256+ buffer.add(Byte.valueOf((byte) b));
257+ }
258+ }
259+
260+ afterR = b == '\r';
261+ }
262+
263+ private void flush2() {
264+ byte[] bytes = new byte[buffer.size()];
265+ for (int i = 0; i < buffer.size(); i++) {
266+ bytes[i] = buffer.get(i);
267+ }
268+
269+ consumer.accept(new String(bytes, charset));
270+ buffer.clear();
271+ }
272+
273+ }
274+
275+}
diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/src/main/resources/org/gradle/resource.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/src/main/resources/org/gradle/resource.xml Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,1 @@
1+<some-element/>
diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/src/test/java/org/gradle/PersonTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/src/test/java/org/gradle/PersonTest.java Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,6 @@
1+package org.gradle;
2+
3+public class PersonTest
4+{
5+
6+}
diff -r 51da45a547d8 -r 4f9589802ab8 projects/mirrg.swing.helium/src/test/resources/org/gradle/test-resource.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/projects/mirrg.swing.helium/src/test/resources/org/gradle/test-resource.xml Sat Aug 15 22:35:39 2015 +0900
@@ -0,0 +1,1 @@
1+<some-resource/>