From 066c01940d47087266013c357a6bdcebe6bcdf01 Mon Sep 17 00:00:00 2001 From: hizumiaoba <56146205+hizumiaoba@users.noreply.github.com> Date: Mon, 18 Apr 2022 07:29:59 +0900 Subject: [PATCH] update doc --- src/com/ranfa/main/DelesteRandomSelector.java | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/com/ranfa/main/DelesteRandomSelector.java b/src/com/ranfa/main/DelesteRandomSelector.java index c5b721f..4c8b687 100644 --- a/src/com/ranfa/main/DelesteRandomSelector.java +++ b/src/com/ranfa/main/DelesteRandomSelector.java @@ -1,3 +1,18 @@ +/* + * Copyright 2022 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.ranfa.main; import java.awt.BorderLayout; @@ -63,9 +78,23 @@ import com.ranfa.lib.database.Song; import com.ranfa.lib.handler.CrashHandler; import com.ranfa.lib.songinfo.FetchFromAPI; +/** + * メイン処理クラス。 + *

+ * メインスレッドでは基本的に何もしない。 + * + * @author hizum + * + * @since 0.0.1 + */ @Version(major = 4, minor = 0, patch = 3, suffix = Suffix.BETA) public class DelesteRandomSelector extends JFrame { + /** + * ランダムに選択された楽曲を格納するためのList。 + *

+ * 選ばれた楽曲を使用する処理は基本的に全てここから取得する。 + */ private static ArrayList selectedSongsList = new ArrayList<>(); private JPanel contentPane; @@ -137,6 +166,11 @@ public class DelesteRandomSelector extends JFrame { private JLabel labelMemberToolTip; private JButton btnMoreInfoTool; + /** + * アップデート処理用の{@link BiConsumer}。 + *

+ * 実際は{@link CompletableFuture}によって使用される。 + */ BiConsumer, ArrayList> updateConsumer = (list1, list2) -> { this.logger.info("Checking database updates..."); if(list1.size() > list2.size()) { @@ -149,6 +183,16 @@ public class DelesteRandomSelector extends JFrame { this.logger.info("database is up-to-date."); } }; + + /** + * ライブラリ関連の処理完了後に{@link JButton}を有効化するための{@link Runnable}。 + *

+ *

+ * を行う + */ Runnable setEnabled = () -> { try { Thread.sleep(3 * 1000L); -- 2.11.0