Swing ui package split by feature
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.session.ServerLink;
|
||||
import eu.lixko.ts3j.client.ui.DesktopEntry;
|
||||
import eu.lixko.ts3j.client.ui.DisplayScale;
|
||||
import eu.lixko.ts3j.client.ui.IconTheme;
|
||||
import eu.lixko.ts3j.client.ui.icons.IconTheme;
|
||||
import eu.lixko.ts3j.client.ui.InstanceChannel;
|
||||
import eu.lixko.ts3j.client.ui.LookAndFeelManager;
|
||||
import eu.lixko.ts3j.client.ui.MainFrame;
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.lixko.ts3j.client.ui;
|
||||
|
||||
import eu.lixko.ts3j.client.Main;
|
||||
import eu.lixko.ts3j.client.session.ServerLink;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
@@ -2,11 +2,12 @@ package eu.lixko.ts3j.client.ui;
|
||||
|
||||
import eu.lixko.ts3j.client.chat.ChatKey;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.notify.desktop.DesktopNotifications;
|
||||
import eu.lixko.ts3j.client.notify.desktop.DesktopNotifications.Notice;
|
||||
import eu.lixko.ts3j.client.notify.desktop.DesktopNotifications;
|
||||
import eu.lixko.ts3j.client.notify.desktop.FreedesktopNotifications;
|
||||
import eu.lixko.ts3j.client.text.BBCode;
|
||||
import eu.lixko.ts3j.client.text.ChatHtml;
|
||||
import eu.lixko.ts3j.client.ui.server.ServerTab;
|
||||
import eu.lixko.ts3j.client.ui.tray.AwtTray;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
@@ -28,7 +29,7 @@ import java.util.concurrent.Executors;
|
||||
* <p>Called on the event thread. Talking to the desktop may block, so that happens on a
|
||||
* thread of its own, which also keeps the notifications in order.
|
||||
*/
|
||||
final class DesktopNotifier {
|
||||
public final class DesktopNotifier {
|
||||
|
||||
private static final int MAX_LINES = 5;
|
||||
|
||||
@@ -61,7 +62,7 @@ final class DesktopNotifier {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
void poke(ServerTab tab, String from, String message) {
|
||||
public void poke(ServerTab tab, String from, String message) {
|
||||
if (!wanted()) return;
|
||||
String body = BBCode.toPlain(message);
|
||||
Notice notice = new Notice(from + " poked you", body, () -> open(tab, null), null);
|
||||
@@ -73,7 +74,7 @@ final class DesktopNotifier {
|
||||
});
|
||||
}
|
||||
|
||||
void privateMessage(ServerTab tab, int clientId, String from, String message) {
|
||||
public void privateMessage(ServerTab tab, int clientId, String from, String message) {
|
||||
if (!wanted()) return;
|
||||
String text = ChatHtml.plainMessage(message);
|
||||
Conversation key = new Conversation(tab, clientId);
|
||||
|
||||
@@ -3,6 +3,9 @@ package eu.lixko.ts3j.client.ui;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.net.HostButton;
|
||||
import eu.lixko.ts3j.client.net.PictureDownloads;
|
||||
import eu.lixko.ts3j.client.ui.chat.Links;
|
||||
import eu.lixko.ts3j.client.ui.icons.IconTheme;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.formdev.flatlaf.FlatDarkLaf;
|
||||
import com.formdev.flatlaf.FlatLaf;
|
||||
import com.formdev.flatlaf.FlatLightLaf;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.ui.icons.IconTheme;
|
||||
|
||||
import java.awt.Window;
|
||||
|
||||
|
||||
@@ -10,6 +10,12 @@ import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.net.ChannelNode;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.session.Sessions;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.manage.AwayMessagesDialog;
|
||||
import eu.lixko.ts3j.client.ui.manage.BookmarksDialog;
|
||||
import eu.lixko.ts3j.client.ui.manage.IdentitiesDialog;
|
||||
import eu.lixko.ts3j.client.ui.server.RecordingActions;
|
||||
import eu.lixko.ts3j.client.ui.server.ServerTab;
|
||||
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JCheckBoxMenuItem;
|
||||
@@ -31,7 +37,7 @@ import java.util.function.Consumer;
|
||||
* for hotkeys, which reach the selected server or every connected one. Commands that
|
||||
* change our own state repaint the window's chrome afterwards.
|
||||
*/
|
||||
final class MainCommands {
|
||||
public final class MainCommands {
|
||||
|
||||
private final MainFrame frame;
|
||||
private final Settings settings;
|
||||
@@ -68,7 +74,7 @@ final class MainCommands {
|
||||
* Which connections a command reaches: only the server on screen, or every connected
|
||||
* one. Either way only connected servers.
|
||||
*/
|
||||
List<ServerSession> targets(boolean currentOnly) {
|
||||
public List<ServerSession> targets(boolean currentOnly) {
|
||||
List<ServerSession> out = new ArrayList<>();
|
||||
if (currentOnly) {
|
||||
ServerSession current = current();
|
||||
@@ -93,7 +99,7 @@ final class MainCommands {
|
||||
}
|
||||
|
||||
/** Connects to the bookmark with this label; no label means the first one. */
|
||||
void connectBookmark(String label, boolean newTab) {
|
||||
public void connectBookmark(String label, boolean newTab) {
|
||||
for (Bookmark b : bookmarks.all()) {
|
||||
if (label == null || label.isBlank() || label.equalsIgnoreCase(b.label)) {
|
||||
connect(b, newTab);
|
||||
@@ -102,12 +108,12 @@ final class MainCommands {
|
||||
}
|
||||
}
|
||||
|
||||
void disconnect() {
|
||||
public void disconnect() {
|
||||
ServerSession current = current();
|
||||
if (current != null) current.disconnect();
|
||||
}
|
||||
|
||||
void disconnectAll() {
|
||||
public void disconnectAll() {
|
||||
for (ServerTab tab : frame.allTabs()) tab.session().disconnect();
|
||||
}
|
||||
|
||||
@@ -155,7 +161,7 @@ final class MainCommands {
|
||||
// ---- microphone and speakers ----
|
||||
|
||||
/** Moves the microphone to the server on screen. */
|
||||
void activate() {
|
||||
public void activate() {
|
||||
ServerSession current = current();
|
||||
if (current != null && current.isConnected()) sessions.giveMicrophoneTo(current);
|
||||
frame.refreshChrome();
|
||||
@@ -166,11 +172,11 @@ final class MainCommands {
|
||||
if (current != null) setMicMuted(currentConnected(), !current.isMicMuted());
|
||||
}
|
||||
|
||||
void setMicMuted(List<ServerSession> targets, boolean muted) {
|
||||
public void setMicMuted(List<ServerSession> targets, boolean muted) {
|
||||
forEach(targets, s -> s.setMicMuted(muted));
|
||||
}
|
||||
|
||||
void setMicLocalMuted(List<ServerSession> targets, boolean muted) {
|
||||
public void setMicLocalMuted(List<ServerSession> targets, boolean muted) {
|
||||
forEach(targets, s -> s.setMicLocalMuted(muted));
|
||||
}
|
||||
|
||||
@@ -179,18 +185,18 @@ final class MainCommands {
|
||||
if (current != null) setDeafened(currentConnected(), !current.isDeafened());
|
||||
}
|
||||
|
||||
void setDeafened(List<ServerSession> targets, boolean deaf) {
|
||||
public void setDeafened(List<ServerSession> targets, boolean deaf) {
|
||||
forEach(targets, s -> s.setDeafened(deaf));
|
||||
}
|
||||
|
||||
// ---- away ----
|
||||
|
||||
/** The plain toggle carries no message; "Set away status…" is where messages are chosen. */
|
||||
void setAway(boolean away) {
|
||||
public void setAway(boolean away) {
|
||||
setAway(currentConnected(), away, "");
|
||||
}
|
||||
|
||||
void setAway(List<ServerSession> targets, boolean away, String message) {
|
||||
public void setAway(List<ServerSession> targets, boolean away, String message) {
|
||||
forEach(targets, s -> s.setAway(away, message == null ? "" : message));
|
||||
}
|
||||
|
||||
@@ -250,29 +256,29 @@ final class MainCommands {
|
||||
|
||||
// ---- ourselves ----
|
||||
|
||||
void setCommander(boolean commander) {
|
||||
public void setCommander(boolean commander) {
|
||||
setCommander(currentConnected(), commander);
|
||||
}
|
||||
|
||||
void setCommander(List<ServerSession> targets, boolean commander) {
|
||||
public void setCommander(List<ServerSession> targets, boolean commander) {
|
||||
forEach(targets, s -> s.setCommander(commander));
|
||||
}
|
||||
|
||||
/** Asks for a new nickname, used on every server. */
|
||||
void changeNickname() {
|
||||
public void changeNickname() {
|
||||
String nickname = JOptionPane.showInputDialog(frame, "New nickname:", settings.nickname.get());
|
||||
if (nickname != null) changeNickname(nickname);
|
||||
}
|
||||
|
||||
/** Uses this nickname on every server; a blank one is ignored. */
|
||||
void changeNickname(String nickname) {
|
||||
public void changeNickname(String nickname) {
|
||||
if (nickname == null || nickname.isBlank()) return;
|
||||
settings.nickname.set(nickname.trim());
|
||||
settings.save();
|
||||
sessions.setNickname(settings.nickname.get());
|
||||
}
|
||||
|
||||
void joinChannel(List<ServerSession> targets, String path) {
|
||||
public void joinChannel(List<ServerSession> targets, String path) {
|
||||
for (ServerSession s : targets) s.joinChannelPath(path);
|
||||
}
|
||||
|
||||
@@ -310,7 +316,7 @@ final class MainCommands {
|
||||
}
|
||||
|
||||
/** Requests talk power without a reason, or withdraws pending requests. */
|
||||
void toggleTalkRequest(List<ServerSession> targets) {
|
||||
public void toggleTalkRequest(List<ServerSession> targets) {
|
||||
boolean requested = targets.stream().anyMatch(ServerSession::isTalkRequested);
|
||||
for (ServerSession s : targets) {
|
||||
if (requested) s.cancelTalkRequest();
|
||||
@@ -318,28 +324,28 @@ final class MainCommands {
|
||||
}
|
||||
}
|
||||
|
||||
void grantNextTalkPower(List<ServerSession> targets, boolean revokeOthers) {
|
||||
public void grantNextTalkPower(List<ServerSession> targets, boolean revokeOthers) {
|
||||
for (ServerSession s : targets) s.grantNextTalkPower(revokeOthers);
|
||||
}
|
||||
|
||||
// ---- recording ----
|
||||
|
||||
/** Asks where to save, then records the server on screen. */
|
||||
void startRecording(boolean multitrack) {
|
||||
public void startRecording(boolean multitrack) {
|
||||
ServerSession current = current();
|
||||
if (current != null) recordings.choose(current, multitrack);
|
||||
}
|
||||
|
||||
/** Records into the folder last used, without asking. */
|
||||
void startRecording(List<ServerSession> targets, boolean multitrack) {
|
||||
public void startRecording(List<ServerSession> targets, boolean multitrack) {
|
||||
for (ServerSession s : targets) recordings.startNow(s, multitrack);
|
||||
}
|
||||
|
||||
void stopRecording() {
|
||||
public void stopRecording() {
|
||||
stopRecording(currentConnected());
|
||||
}
|
||||
|
||||
void stopRecording(List<ServerSession> targets) {
|
||||
public void stopRecording(List<ServerSession> targets) {
|
||||
for (ServerSession s : targets) s.stopRecording();
|
||||
}
|
||||
|
||||
@@ -369,7 +375,7 @@ final class MainCommands {
|
||||
onTab(ServerTab::usePrivilegeKey);
|
||||
}
|
||||
|
||||
void browseCurrentChannel() {
|
||||
public void browseCurrentChannel() {
|
||||
ServerTab tab = frame.selectedTab();
|
||||
if (tab == null || !tab.session().isConnected()) return;
|
||||
ChannelNode channel = tab.session().currentChannel();
|
||||
|
||||
@@ -1,28 +1,39 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.audio.VoiceOutput;
|
||||
import eu.lixko.ts3j.client.audio.AudioBackend;
|
||||
import eu.lixko.ts3j.client.audio.VoiceOutput;
|
||||
import eu.lixko.ts3j.client.audio.desktop.DesktopAudioBackend;
|
||||
import eu.lixko.ts3j.client.config.AppDirs;
|
||||
import eu.lixko.ts3j.client.config.AwayMessages;
|
||||
import eu.lixko.ts3j.client.config.Bookmark;
|
||||
import eu.lixko.ts3j.client.config.Bookmarks;
|
||||
import eu.lixko.ts3j.client.session.ServerLink;
|
||||
import eu.lixko.ts3j.client.config.IdentityStore;
|
||||
import eu.lixko.ts3j.client.config.Setting;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.contacts.ContactStore;
|
||||
import eu.lixko.ts3j.client.myts.ChatAttachments;
|
||||
import eu.lixko.ts3j.client.myts.MyTeamSpeakLogin;
|
||||
import eu.lixko.ts3j.client.teamspeak.TeamSpeakImporter;
|
||||
import eu.lixko.ts3j.client.contacts.ContactStore;
|
||||
import eu.lixko.ts3j.client.net.HostButton;
|
||||
import eu.lixko.ts3j.client.net.PictureDownloads;
|
||||
import eu.lixko.ts3j.client.session.SelfState;
|
||||
import eu.lixko.ts3j.client.session.ServerLink;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.session.Sessions;
|
||||
import eu.lixko.ts3j.client.sound.SoundNotifier;
|
||||
import eu.lixko.ts3j.client.sound.SoundPlayer;
|
||||
import eu.lixko.ts3j.client.teamspeak.TeamSpeakImporter;
|
||||
import eu.lixko.ts3j.client.ui.chat.Links;
|
||||
import eu.lixko.ts3j.client.ui.chat.TextZoom;
|
||||
import eu.lixko.ts3j.client.ui.hotkey.HotkeyActions;
|
||||
import eu.lixko.ts3j.client.ui.hotkey.HotkeyService;
|
||||
import eu.lixko.ts3j.client.ui.icons.IconTheme;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.manage.ConnectDialog;
|
||||
import eu.lixko.ts3j.client.ui.manage.ContactsDialog;
|
||||
import eu.lixko.ts3j.client.ui.options.MyTeamSpeakPanel;
|
||||
import eu.lixko.ts3j.client.ui.options.SettingsDialog;
|
||||
import eu.lixko.ts3j.client.ui.server.ServerTab;
|
||||
import eu.lixko.ts3j.client.ui.tray.TrayBackend;
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
@@ -288,7 +299,7 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
|
||||
// ---- callbacks from ServerTab ----
|
||||
|
||||
/** A tab's title, status or connection state changed. */
|
||||
void tabUpdated(ServerTab tab) {
|
||||
public void tabUpdated(ServerTab tab) {
|
||||
if (!tabs.contains(tab)) return;
|
||||
refreshTabs();
|
||||
if (tab == selected) {
|
||||
@@ -299,12 +310,12 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
|
||||
}
|
||||
|
||||
/** The server on {@code tab} may have changed its host button. */
|
||||
void refreshHostButton(ServerTab tab) {
|
||||
public void refreshHostButton(ServerTab tab) {
|
||||
if (tab == selected) toolbar.showHostButton(hostButtonOf(tab));
|
||||
}
|
||||
|
||||
/** Bookmarks leading to the server on {@code tab} take on its icon. */
|
||||
void serverIconChanged(ServerTab tab, long iconId) {
|
||||
public void serverIconChanged(ServerTab tab, long iconId) {
|
||||
if (!bookmarks.rememberServerIcon(tab.session().address(), tab.session().port(), iconId)) return;
|
||||
bookmarks.save();
|
||||
bookmarksChanged();
|
||||
@@ -321,24 +332,24 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
|
||||
repaint();
|
||||
}
|
||||
|
||||
MainCommands commands() {
|
||||
public MainCommands commands() {
|
||||
return commands;
|
||||
}
|
||||
|
||||
/** The local client on {@code tab} started or stopped talking, muted itself, … */
|
||||
void selfStateChanged(ServerTab tab) {
|
||||
public void selfStateChanged(ServerTab tab) {
|
||||
if (!tabs.contains(tab)) return;
|
||||
updateTray();
|
||||
if (giantPtt != null) giantPtt.refresh();
|
||||
}
|
||||
|
||||
void tabConnected(ServerTab tab) {
|
||||
public void tabConnected(ServerTab tab) {
|
||||
if (!tabs.contains(tab)) return;
|
||||
sessions.connected(tab.session());
|
||||
tabUpdated(tab);
|
||||
}
|
||||
|
||||
void tabDisconnected(ServerTab tab) {
|
||||
public void tabDisconnected(ServerTab tab) {
|
||||
if (!tabs.contains(tab)) return;
|
||||
sessions.disconnected(tab.session());
|
||||
notifier.forget(tab);
|
||||
@@ -346,15 +357,15 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
|
||||
}
|
||||
|
||||
/** Tells the user of a poke or a private message while the client is in the background. */
|
||||
TextZoom chatZoom() {
|
||||
public TextZoom chatZoom() {
|
||||
return chatZoom;
|
||||
}
|
||||
|
||||
TextZoom infoZoom() {
|
||||
public TextZoom infoZoom() {
|
||||
return infoZoom;
|
||||
}
|
||||
|
||||
DesktopNotifier notifier() {
|
||||
public DesktopNotifier notifier() {
|
||||
return notifier;
|
||||
}
|
||||
|
||||
@@ -375,7 +386,7 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
|
||||
}
|
||||
|
||||
/** Opens the microphone while a push-to-talk hotkey is held. */
|
||||
void setPushToTalk(boolean talking) {
|
||||
public void setPushToTalk(boolean talking) {
|
||||
sessions.setPushToTalk(talking);
|
||||
}
|
||||
|
||||
@@ -398,36 +409,36 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
|
||||
}
|
||||
|
||||
/** Selects the tab with this 1-based number, as the "Select Server Tab" action names it. */
|
||||
void selectTabNumber(int number) {
|
||||
public void selectTabNumber(int number) {
|
||||
if (number >= 1 && number <= tabs.size()) selectTab(tabs.get(number - 1));
|
||||
}
|
||||
|
||||
void stepTab(int delta) {
|
||||
public void stepTab(int delta) {
|
||||
if (tabs.isEmpty()) return;
|
||||
int index = Math.max(0, tabs.indexOf(selected));
|
||||
selectTab(tabs.get(Math.floorMod(index + delta, tabs.size())));
|
||||
}
|
||||
|
||||
void setSoundsMuted(boolean muted) {
|
||||
public void setSoundsMuted(boolean muted) {
|
||||
sounds.setMuted(muted);
|
||||
}
|
||||
|
||||
boolean areSoundsMuted() {
|
||||
public boolean areSoundsMuted() {
|
||||
return sounds.isMuted();
|
||||
}
|
||||
|
||||
void adjustMasterVolume(double delta) {
|
||||
public void adjustMasterVolume(double delta) {
|
||||
settings.outputVolume.set(Math.max(0, Math.min(2.0, settings.outputVolume.get() + delta)));
|
||||
settings.save();
|
||||
updateStatusLabel();
|
||||
}
|
||||
|
||||
void reloadSkin() {
|
||||
public void reloadSkin() {
|
||||
IconTheme.get().reload(settings);
|
||||
}
|
||||
|
||||
/** Brings the window back from the tray, the taskbar or behind other windows. */
|
||||
void bringToFront() {
|
||||
public void bringToFront() {
|
||||
TrayController current = tray;
|
||||
if (current != null) {
|
||||
// The tray can ask the window manager in a way it honours for a window without focus.
|
||||
@@ -440,7 +451,7 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
|
||||
requestFocus();
|
||||
}
|
||||
|
||||
void sendToBack() {
|
||||
public void sendToBack() {
|
||||
setExtendedState(getExtendedState() | JFrame.ICONIFIED);
|
||||
}
|
||||
|
||||
@@ -594,7 +605,7 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
Settings settings() {
|
||||
public Settings settings() {
|
||||
return settings;
|
||||
}
|
||||
|
||||
@@ -606,7 +617,7 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
|
||||
*
|
||||
* @param uniqueId the contact to select, or {@code null} to keep the current selection
|
||||
*/
|
||||
void showContacts(String uniqueId) {
|
||||
public void showContacts(String uniqueId) {
|
||||
if (contactsDialog == null || !contactsDialog.isDisplayable()) {
|
||||
contactsDialog = new ContactsDialog(this, contacts, settings);
|
||||
}
|
||||
@@ -647,16 +658,16 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
|
||||
}
|
||||
}
|
||||
|
||||
ChatAttachments attachments() {
|
||||
public ChatAttachments attachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
MyTeamSpeakLogin myTeamSpeakLogin() {
|
||||
public MyTeamSpeakLogin myTeamSpeakLogin() {
|
||||
return myTeamSpeak;
|
||||
}
|
||||
|
||||
/** Whether files can be shared in chat: that needs a myTeamSpeak account. */
|
||||
boolean canShareFiles() {
|
||||
public boolean canShareFiles() {
|
||||
return myTeamSpeak.isSignedIn();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import eu.lixko.ts3j.client.config.Bookmark;
|
||||
import eu.lixko.ts3j.client.config.Bookmarks;
|
||||
import eu.lixko.ts3j.client.net.Permissions;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.ui.icons.GroupIcons;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JCheckBoxMenuItem;
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.net.HostButton;
|
||||
import eu.lixko.ts3j.client.net.PictureDownloads;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.widget.DropDownToggleButton;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.JButton;
|
||||
|
||||
@@ -2,6 +2,8 @@ package eu.lixko.ts3j.client.ui;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.server.ServerTab;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JButton;
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.lixko.ts3j.client.ui;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
|
||||
@@ -28,10 +28,10 @@ import java.util.List;
|
||||
* press, so every component that should start a drag — the tab strip itself
|
||||
* and each custom tab label — must be {@link #attach}ed individually.
|
||||
*/
|
||||
final class TabDragReorder {
|
||||
public final class TabDragReorder {
|
||||
|
||||
/** Moves the tab at {@code from} to sit where {@code to} currently is. */
|
||||
interface Reorder {
|
||||
public interface Reorder {
|
||||
void moveTab(int from, int to);
|
||||
}
|
||||
|
||||
@@ -59,12 +59,12 @@ final class TabDragReorder {
|
||||
private int grabDx;
|
||||
private Timer timer;
|
||||
|
||||
TabDragReorder(JTabbedPane tabbed, Reorder reorder) {
|
||||
public TabDragReorder(JTabbedPane tabbed, Reorder reorder) {
|
||||
this.tabbed = tabbed;
|
||||
this.reorder = reorder;
|
||||
}
|
||||
|
||||
void attach(JComponent source) {
|
||||
public void attach(JComponent source) {
|
||||
MouseAdapter listener = new MouseAdapter() {
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
|
||||
import eu.lixko.ts3j.client.session.SelfState;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.tray.AwtTray;
|
||||
import eu.lixko.ts3j.client.ui.tray.TrayBackend;
|
||||
import eu.lixko.ts3j.client.ui.tray.X11Tray;
|
||||
|
||||
+8
-4
@@ -1,9 +1,13 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.net.RequestException;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
import eu.lixko.ts3j.client.ui.widget.Edt;
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.Box;
|
||||
@@ -39,7 +43,7 @@ import java.util.function.Supplier;
|
||||
*
|
||||
* <p>One per server tab; the tab closes it when the connection goes away.
|
||||
*/
|
||||
abstract class AbstractServerListDialog extends JDialog {
|
||||
public abstract class AbstractServerListDialog extends JDialog {
|
||||
|
||||
static final DateTimeFormatter DATE = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@@ -112,12 +116,12 @@ abstract class AbstractServerListDialog extends JDialog {
|
||||
return name + " - " + serverName;
|
||||
}
|
||||
|
||||
void serverNameChanged() {
|
||||
public void serverNameChanged() {
|
||||
String serverName = session.model().getServerName();
|
||||
setTitle(serverName == null || serverName.isBlank() ? name : title(serverName));
|
||||
}
|
||||
|
||||
void connectionLost() {
|
||||
public void connectionLost() {
|
||||
dispose();
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -6,6 +6,7 @@ import eu.lixko.ts3j.client.config.BanReasonPresets;
|
||||
import eu.lixko.ts3j.client.net.ban.BanEntry;
|
||||
import eu.lixko.ts3j.client.net.ban.BanPattern;
|
||||
import eu.lixko.ts3j.client.net.ban.BanRule;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
+7
-6
@@ -1,8 +1,9 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.net.ban.BanRule;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
@@ -17,7 +18,7 @@ import java.awt.Frame;
|
||||
* Asks for a ban's reason and duration, like the official client's ban dialog:
|
||||
* either a number of seconds, minutes, hours or days, or permanent.
|
||||
*/
|
||||
final class BanDialog extends JDialog {
|
||||
public final class BanDialog extends JDialog {
|
||||
|
||||
private final JTextField reasonField = ReasonDialog.reasonField(BanRule.REASON_LIMIT);
|
||||
private final BanDurationPicker duration;
|
||||
@@ -27,7 +28,7 @@ final class BanDialog extends JDialog {
|
||||
/**
|
||||
* @param maxSeconds the longest ban the server lets us hand out, or 0 for no limit
|
||||
*/
|
||||
BanDialog(Frame owner, String nickname, long maxSeconds) {
|
||||
public BanDialog(Frame owner, String nickname, long maxSeconds) {
|
||||
super(owner, "Ban Client", true);
|
||||
duration = new BanDurationPicker(maxSeconds);
|
||||
|
||||
@@ -71,16 +72,16 @@ final class BanDialog extends JDialog {
|
||||
return panel;
|
||||
}
|
||||
|
||||
boolean isConfirmed() {
|
||||
public boolean isConfirmed() {
|
||||
return confirmed;
|
||||
}
|
||||
|
||||
String getReason() {
|
||||
public String getReason() {
|
||||
return reasonField.getText().trim();
|
||||
}
|
||||
|
||||
/** The ban's length in seconds, or 0 for a permanent ban. */
|
||||
long getSeconds() {
|
||||
public long getSeconds() {
|
||||
return duration.getSeconds();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.net.ban.BanUnit;
|
||||
+6
-4
@@ -1,12 +1,14 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.config.BanReasonPresets;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.net.Permissions;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.net.ban.BanEntry;
|
||||
import eu.lixko.ts3j.client.net.ban.BanRule;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
@@ -48,7 +50,7 @@ import java.util.stream.Collectors;
|
||||
* Which columns show is chosen from the header's context menu and remembered.
|
||||
*
|
||||
*/
|
||||
final class BanListDialog extends AbstractServerListDialog {
|
||||
public final class BanListDialog extends AbstractServerListDialog {
|
||||
|
||||
/** The table's columns, in the official order; the split-out target columns start hidden. */
|
||||
private enum Column {
|
||||
@@ -92,7 +94,7 @@ final class BanListDialog extends AbstractServerListDialog {
|
||||
private final JCheckBox onlyOwn = new JCheckBox("Show only own bans");
|
||||
private final JCheckBox highlightOwn = new JCheckBox("Highlight own bans");
|
||||
|
||||
BanListDialog(Frame owner, ServerSession session, Settings settings, BanReasonPresets presets) {
|
||||
public BanListDialog(Frame owner, ServerSession session, Settings settings, BanReasonPresets presets) {
|
||||
super(owner, session, "Ban List");
|
||||
this.owner = owner;
|
||||
this.settings = settings;
|
||||
+4
-3
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -6,6 +6,7 @@ import eu.lixko.ts3j.client.net.ClientEntry;
|
||||
import eu.lixko.ts3j.client.net.Complaint;
|
||||
import eu.lixko.ts3j.client.net.ServerModel;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
@@ -45,7 +46,7 @@ import java.util.function.Consumer;
|
||||
* collapsible row per client complained about, with each complaint's date, author and
|
||||
* reason beneath it.
|
||||
*/
|
||||
final class ComplaintsDialog extends AbstractServerListDialog {
|
||||
public final class ComplaintsDialog extends AbstractServerListDialog {
|
||||
|
||||
private enum Column {
|
||||
TARGET("Target Nickname", 200),
|
||||
@@ -93,7 +94,7 @@ final class ComplaintsDialog extends AbstractServerListDialog {
|
||||
private final Set<Integer> expanded = new HashSet<>();
|
||||
|
||||
/** @param banClient opens the ban dialog for an online client */
|
||||
ComplaintsDialog(Frame owner, ServerSession session, Consumer<ClientEntry> banClient) {
|
||||
public ComplaintsDialog(Frame owner, ServerSession session, Consumer<ClientEntry> banClient) {
|
||||
super(owner, session, "Complaints List");
|
||||
this.banClient = banClient;
|
||||
bindKeys();
|
||||
+7
-4
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import com.formdev.flatlaf.FlatClientProperties;
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
@@ -10,6 +10,9 @@ import eu.lixko.ts3j.client.net.DatabaseClient;
|
||||
import eu.lixko.ts3j.client.net.OfflineMessage;
|
||||
import eu.lixko.ts3j.client.net.OfflineMessageAdmin;
|
||||
import eu.lixko.ts3j.client.text.BBCode;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
import eu.lixko.ts3j.client.ui.widget.Edt;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.Box;
|
||||
@@ -65,7 +68,7 @@ import java.util.regex.Pattern;
|
||||
* only searches the server's database, a unique id is looked up directly, which needs no
|
||||
* permission; a nickname needs {@code b_virtualserver_client_dbsearch}.
|
||||
*/
|
||||
final class OfflineMessageComposeDialog extends JDialog {
|
||||
public final class OfflineMessageComposeDialog extends JDialog {
|
||||
|
||||
private static final Pattern UNIQUE_ID = Pattern.compile("[A-Za-z0-9+/]{27}=");
|
||||
/** The client property naming the recipient a chip stands for. */
|
||||
@@ -86,12 +89,12 @@ final class OfflineMessageComposeDialog extends JDialog {
|
||||
private final JButton sendButton = new JButton("Send");
|
||||
private boolean sending;
|
||||
|
||||
static OfflineMessageComposeDialog compose(Window owner, OfflineMessageAdmin messages, ContactStore contacts) {
|
||||
public static OfflineMessageComposeDialog compose(Window owner, OfflineMessageAdmin messages, ContactStore contacts) {
|
||||
return new OfflineMessageComposeDialog(owner, "New Offline Message", messages, contacts);
|
||||
}
|
||||
|
||||
/** A reply to {@code message}, quoting {@code body}. */
|
||||
static OfflineMessageComposeDialog reply(Window owner, OfflineMessageAdmin messages, ContactStore contacts,
|
||||
public static OfflineMessageComposeDialog reply(Window owner, OfflineMessageAdmin messages, ContactStore contacts,
|
||||
OfflineMessage message, String body) {
|
||||
OfflineMessageComposeDialog d = new OfflineMessageComposeDialog(owner, "Reply Offline Message", messages, contacts);
|
||||
d.addRecipient(new DatabaseClient(message.senderUid(), 0, message.senderName()));
|
||||
+9
-5
@@ -1,10 +1,14 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.net.OfflineMessage;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.text.BBCode;
|
||||
import eu.lixko.ts3j.client.ui.chat.HtmlStyles;
|
||||
import eu.lixko.ts3j.client.ui.chat.Links;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.widget.Edt;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
@@ -50,10 +54,10 @@ import java.util.Set;
|
||||
* window: the messages above, the selected one's subject and text below. Viewing a message
|
||||
* marks it read.
|
||||
*/
|
||||
final class OfflineMessagesDialog extends AbstractServerListDialog {
|
||||
public final class OfflineMessagesDialog extends AbstractServerListDialog {
|
||||
|
||||
/** Where Compose and Reply lead: the tab opens the compose window. */
|
||||
interface Composer {
|
||||
public interface Composer {
|
||||
void compose();
|
||||
|
||||
void reply(OfflineMessage message, String body);
|
||||
@@ -109,7 +113,7 @@ final class OfflineMessagesDialog extends AbstractServerListDialog {
|
||||
/** Set while a right-click selects its row, which leaves the reader alone. */
|
||||
private boolean selectingForPopup;
|
||||
|
||||
OfflineMessagesDialog(Frame owner, ServerSession session, Composer composer) {
|
||||
public OfflineMessagesDialog(Frame owner, ServerSession session, Composer composer) {
|
||||
super(owner, session, "Offline Messages");
|
||||
this.composer = composer;
|
||||
|
||||
@@ -245,7 +249,7 @@ final class OfflineMessagesDialog extends AbstractServerListDialog {
|
||||
|
||||
/** Reads the inbox again, keeping the selection where the messages are still there. */
|
||||
@Override
|
||||
void reload() {
|
||||
public void reload() {
|
||||
load(session.offlineMessages()::list, messages -> {
|
||||
setMessages(messages);
|
||||
if (messages.isEmpty()) showStatus("No messages");
|
||||
+6
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -6,6 +6,11 @@ import eu.lixko.ts3j.client.net.ChannelNode;
|
||||
import eu.lixko.ts3j.client.net.Group;
|
||||
import eu.lixko.ts3j.client.net.ServerModel;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.ui.icons.GroupIcons;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
import eu.lixko.ts3j.client.ui.widget.Edt;
|
||||
import eu.lixko.ts3j.client.ui.widget.FormPanel;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.ButtonGroup;
|
||||
+5
-3
@@ -1,10 +1,12 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.net.Group;
|
||||
import eu.lixko.ts3j.client.net.PrivilegeKey;
|
||||
import eu.lixko.ts3j.client.net.ServerModel;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.ui.icons.GroupIcons;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
@@ -31,7 +33,7 @@ import java.util.stream.Collectors;
|
||||
* The server's privilege keys, as the official client's Permissions > Privilege Keys
|
||||
* window: Create and Remove above the list, Reload below it.
|
||||
*/
|
||||
final class PrivilegeKeysDialog extends AbstractServerListDialog {
|
||||
public final class PrivilegeKeysDialog extends AbstractServerListDialog {
|
||||
|
||||
private enum Column {
|
||||
KEY("Privilege Key", 320),
|
||||
@@ -57,7 +59,7 @@ final class PrivilegeKeysDialog extends AbstractServerListDialog {
|
||||
private final JButton createButton = new JButton("Create", Icons.of("ADD"));
|
||||
private final JButton removeButton = new JButton("Remove", Icons.of("DELETE"));
|
||||
|
||||
PrivilegeKeysDialog(Frame owner, ServerSession session, GroupIcons groupIcons) {
|
||||
public PrivilegeKeysDialog(Frame owner, ServerSession session, GroupIcons groupIcons) {
|
||||
super(owner, session, "Privilege Keys");
|
||||
this.groupIcons = groupIcons;
|
||||
bindKeys();
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
|
||||
@@ -20,13 +20,13 @@ import java.awt.Dimension;
|
||||
* Asks for the reason text that goes with a moderation action. The server caps
|
||||
* such messages, so the field refuses anything longer.
|
||||
*/
|
||||
final class ReasonDialog {
|
||||
public final class ReasonDialog {
|
||||
|
||||
private ReasonDialog() {
|
||||
}
|
||||
|
||||
/** @return the reason (possibly empty), or {@code null} when the dialog was cancelled */
|
||||
static String prompt(Component owner, String title, String message, int maxLength) {
|
||||
public static String prompt(Component owner, String title, String message, int maxLength) {
|
||||
JTextField field = reasonField(maxLength);
|
||||
focusWhenShown(field);
|
||||
|
||||
@@ -49,7 +49,7 @@ final class ReasonDialog {
|
||||
}
|
||||
|
||||
/** A left-aligned label with a little air below it, for use in a box layout. */
|
||||
static JLabel label(String text) {
|
||||
public static JLabel label(String text) {
|
||||
JLabel label = new JLabel(text);
|
||||
label.setAlignmentX(Component.LEFT_ALIGNMENT);
|
||||
label.setBorder(new ScaledEmptyBorder(0, 0, 4, 0));
|
||||
+8
-4
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -6,6 +6,10 @@ import eu.lixko.ts3j.client.net.ClientEntry;
|
||||
import eu.lixko.ts3j.client.net.Group;
|
||||
import eu.lixko.ts3j.client.net.GroupChoice;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.ui.MainFrame;
|
||||
import eu.lixko.ts3j.client.ui.icons.GroupIcons;
|
||||
import eu.lixko.ts3j.client.ui.server.ServerTreePanel;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.GrayFilter;
|
||||
@@ -27,7 +31,7 @@ import java.util.Map;
|
||||
* the local client has no power to (un)assign are shown too, so the client's full
|
||||
* membership is visible, but greyed out and disabled.
|
||||
*/
|
||||
final class ServerGroupsDialog extends JDialog {
|
||||
public final class ServerGroupsDialog extends JDialog {
|
||||
|
||||
private final ServerSession session;
|
||||
private final GroupIcons groupIcons;
|
||||
@@ -39,7 +43,7 @@ final class ServerGroupsDialog extends JDialog {
|
||||
/** Cached grayscale icons, keyed by the source icon's identity. */
|
||||
private final Map<ImageIcon, ImageIcon> grayscale = new HashMap<>();
|
||||
|
||||
ServerGroupsDialog(MainFrame owner, ServerSession session, GroupIcons groupIcons,
|
||||
public ServerGroupsDialog(MainFrame owner, ServerSession session, GroupIcons groupIcons,
|
||||
ClientEntry client, ServerTreePanel.Actions actions) {
|
||||
super(owner, "Server Groups", true);
|
||||
this.session = session;
|
||||
@@ -74,7 +78,7 @@ final class ServerGroupsDialog extends JDialog {
|
||||
}
|
||||
|
||||
/** Rebuilds the list from the current model state; closes the dialog if the client left. */
|
||||
void refresh() {
|
||||
public void refresh() {
|
||||
ClientEntry client = session.model().getClient(clientId);
|
||||
if (client == null) {
|
||||
dispose();
|
||||
+7
-5
@@ -1,15 +1,17 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.config.ServerLogSettings;
|
||||
import eu.lixko.ts3j.client.config.ServerLogSettings.Highlight;
|
||||
import eu.lixko.ts3j.client.config.ServerLogSettings;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.net.ServerLogEntry;
|
||||
import eu.lixko.ts3j.client.net.ServerLogEntry.Level;
|
||||
import eu.lixko.ts3j.client.net.ServerLogEntry;
|
||||
import eu.lixko.ts3j.client.net.ServerLogPage;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.text.TextQuery;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.chat.ChatSearch;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
@@ -47,7 +49,7 @@ import java.util.Map;
|
||||
* by keyword. Find (with "show only matches") stands in for TS3's separate search and
|
||||
* include-filter fields.
|
||||
*/
|
||||
final class ServerLogDialog extends AbstractServerListDialog {
|
||||
public final class ServerLogDialog extends AbstractServerListDialog {
|
||||
|
||||
private static final int LEVEL_WIDTH = "Critical".length();
|
||||
|
||||
@@ -83,7 +85,7 @@ final class ServerLogDialog extends AbstractServerListDialog {
|
||||
private long olderFrom;
|
||||
private TextQuery onlyMatching;
|
||||
|
||||
ServerLogDialog(Frame owner, ServerSession session, Settings settings) {
|
||||
public ServerLogDialog(Frame owner, ServerSession session, Settings settings) {
|
||||
super(owner, session, "Server Log");
|
||||
this.settings = settings;
|
||||
this.view = settings.serverLog;
|
||||
+3
-1
@@ -1,4 +1,6 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import eu.lixko.ts3j.client.ui.manage.AbstractListEditorDialog;
|
||||
|
||||
import java.awt.Window;
|
||||
import java.util.List;
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.admin;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.config.ServerLogSettings.Highlight;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.manage.AbstractListEditorDialog;
|
||||
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.Icon;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.channel;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.channel;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
+7
-4
@@ -1,10 +1,13 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.channel;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.net.ChannelNode;
|
||||
import eu.lixko.ts3j.client.net.ChannelSettings;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.ui.icons.GroupIcons;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
import eu.lixko.ts3j.client.ui.widget.Edt;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
@@ -49,7 +52,7 @@ import java.util.concurrent.CompletableFuture;
|
||||
* caller chose and sends a {@code channelcreate} carrying whatever deviates from a plain
|
||||
* new channel, for the same reason.
|
||||
*/
|
||||
final class ChannelDialog extends JDialog {
|
||||
public final class ChannelDialog extends JDialog {
|
||||
|
||||
/** A tab that maps a part of the channel's settings onto its controls. */
|
||||
interface Tab {
|
||||
@@ -107,7 +110,7 @@ final class ChannelDialog extends JDialog {
|
||||
private boolean passwordEdited;
|
||||
|
||||
/** The editor for an existing channel. */
|
||||
static ChannelDialog toEdit(Window owner, ServerSession session, GroupIcons groupIcons,
|
||||
public static ChannelDialog toEdit(Window owner, ServerSession session, GroupIcons groupIcons,
|
||||
ChannelNode channel) {
|
||||
return new ChannelDialog(owner, session, groupIcons, "Edit Channel: " + channel.name,
|
||||
channel, channel.parentId, null);
|
||||
@@ -119,7 +122,7 @@ final class ChannelDialog extends JDialog {
|
||||
* @param parentId the channel it goes below, 0 being the top level
|
||||
* @param defaults what the dialog opens with, e.g. the channel type its caller prefers
|
||||
*/
|
||||
static ChannelDialog toCreate(Window owner, ServerSession session, GroupIcons groupIcons,
|
||||
public static ChannelDialog toCreate(Window owner, ServerSession session, GroupIcons groupIcons,
|
||||
String title, int parentId, ChannelSettings defaults) {
|
||||
return new ChannelDialog(owner, session, groupIcons, title, null, parentId, defaults);
|
||||
}
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.channel;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.Box;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.channel;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
+3
-1
@@ -1,8 +1,10 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.channel;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.text.BBCode;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.JButton;
|
||||
+7
-2
@@ -1,9 +1,14 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.channel;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.net.IconRepository;
|
||||
import eu.lixko.ts3j.client.net.ChannelAdmin;
|
||||
import eu.lixko.ts3j.client.net.IconRepository;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.icons.GroupIcons;
|
||||
import eu.lixko.ts3j.client.ui.icons.IconTheme;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
import eu.lixko.ts3j.client.ui.widget.Edt;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.DefaultListModel;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.channel;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.chat;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.TransferHandler;
|
||||
+6
-6
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.chat;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.net.avatar.Avatar;
|
||||
@@ -16,16 +16,16 @@ import java.util.Iterator;
|
||||
* the repository's on-disk copy, drawn at the interface scale and fitted to a box while
|
||||
* keeping its aspect ratio.
|
||||
*/
|
||||
final class AvatarHtml {
|
||||
public final class AvatarHtml {
|
||||
|
||||
/** The largest box an avatar is drawn in, as in the official client's info frame. */
|
||||
static final int MAX_SIZE = 200;
|
||||
public static final int MAX_SIZE = 200;
|
||||
|
||||
private AvatarHtml() {
|
||||
}
|
||||
|
||||
/** @return the tag, or an empty string if the avatar cannot be shown */
|
||||
static String imgTag(Avatar avatar, int maxSize) {
|
||||
public static String imgTag(Avatar avatar, int maxSize) {
|
||||
if (avatar == null || avatar.file() == null) return "";
|
||||
Dimension natural = dimensions(avatar.data());
|
||||
Dimension size = fit(natural == null ? null : UIScale.scale(natural), maxSize);
|
||||
@@ -34,7 +34,7 @@ final class AvatarHtml {
|
||||
}
|
||||
|
||||
/** Reads only the image header, which is cheap even for a large animation. */
|
||||
static Dimension dimensions(byte[] data) {
|
||||
public static Dimension dimensions(byte[] data) {
|
||||
try (ImageInputStream in = ImageIO.createImageInputStream(new ByteArrayInputStream(data))) {
|
||||
Iterator<ImageReader> readers = ImageIO.getImageReaders(in);
|
||||
if (!readers.hasNext()) return null;
|
||||
@@ -51,7 +51,7 @@ final class AvatarHtml {
|
||||
}
|
||||
|
||||
/** Scales {@code size} down (never up) to fit a square box of {@code max}. */
|
||||
static Dimension fit(Dimension size, int max) {
|
||||
public static Dimension fit(Dimension size, int max) {
|
||||
if (size == null || size.width <= 0 || size.height <= 0) return null;
|
||||
if (size.width <= max && size.height <= max) return size;
|
||||
double scale = Math.min((double) max / size.width, (double) max / size.height);
|
||||
+4
-3
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.chat;
|
||||
|
||||
import eu.lixko.ts3j.client.chat.ChatKey;
|
||||
import eu.lixko.ts3j.client.myts.ChatAttachment;
|
||||
@@ -6,6 +6,7 @@ import eu.lixko.ts3j.client.myts.ChatAttachments;
|
||||
import eu.lixko.ts3j.client.myts.MyTsException;
|
||||
import eu.lixko.ts3j.client.net.PictureDownloads;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.ui.MainFrame;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.JFileChooser;
|
||||
@@ -24,7 +25,7 @@ import java.util.List;
|
||||
* Shares files in one server's chats through myTeamSpeak, and shows and saves the files
|
||||
* shared there. Failures land in the chat as system lines.
|
||||
*/
|
||||
final class ChatAttachmentActions implements ChatPanel.AttachmentHandler {
|
||||
public final class ChatAttachmentActions implements ChatPanel.AttachmentHandler {
|
||||
|
||||
private static final String SIGN_IN = "Sign in to myTeamSpeak to share files";
|
||||
private static final String PASTED_NAME = "image.png";
|
||||
@@ -37,7 +38,7 @@ final class ChatAttachmentActions implements ChatPanel.AttachmentHandler {
|
||||
private final ChatPanel chat;
|
||||
private final PictureDownloads pictures;
|
||||
|
||||
ChatAttachmentActions(MainFrame host, ServerSession session, ChatPanel chat, PictureDownloads pictures) {
|
||||
public ChatAttachmentActions(MainFrame host, ServerSession session, ChatPanel chat, PictureDownloads pictures) {
|
||||
this.host = host;
|
||||
this.session = session;
|
||||
this.chat = chat;
|
||||
+4
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.chat;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -11,6 +11,9 @@ import eu.lixko.ts3j.client.text.ChatHtml;
|
||||
import eu.lixko.ts3j.client.text.HtmlText;
|
||||
import eu.lixko.ts3j.client.text.TextQuery;
|
||||
import eu.lixko.ts3j.client.text.TsLink;
|
||||
import eu.lixko.ts3j.client.ui.TabDragReorder;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.BorderFactory;
|
||||
+9
-7
@@ -1,6 +1,8 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.chat;
|
||||
|
||||
import eu.lixko.ts3j.client.text.TextQuery;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.widget.FindBar;
|
||||
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JToggleButton;
|
||||
@@ -25,10 +27,10 @@ import java.util.regex.Matcher;
|
||||
* query's matches and steps through them, newest first. Optionally shows only the
|
||||
* messages that match.
|
||||
*/
|
||||
final class ChatSearch implements FindBar.Listener {
|
||||
public final class ChatSearch implements FindBar.Listener {
|
||||
|
||||
/** The conversation being searched: whichever chat tab is selected. */
|
||||
interface Host {
|
||||
public interface Host {
|
||||
/** The selected tab's log, or {@code null} when there is none. */
|
||||
JEditorPane selectedLog();
|
||||
|
||||
@@ -76,16 +78,16 @@ final class ChatSearch implements FindBar.Listener {
|
||||
queueRehighlight();
|
||||
};
|
||||
|
||||
ChatSearch(Host host) {
|
||||
public ChatSearch(Host host) {
|
||||
this(host, "Show only matching messages");
|
||||
}
|
||||
|
||||
ChatSearch(Host host, String filterTooltip) {
|
||||
public ChatSearch(Host host, String filterTooltip) {
|
||||
this.host = host;
|
||||
onlyMatching = bar.addFilterToggle(filterTooltip);
|
||||
}
|
||||
|
||||
FindBar bar() {
|
||||
public FindBar bar() {
|
||||
return bar;
|
||||
}
|
||||
|
||||
@@ -93,7 +95,7 @@ final class ChatSearch implements FindBar.Listener {
|
||||
return bar.isOpen();
|
||||
}
|
||||
|
||||
void open() {
|
||||
public void open() {
|
||||
retarget();
|
||||
bar.open();
|
||||
}
|
||||
+7
-6
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.chat;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
@@ -6,6 +6,7 @@ import eu.lixko.ts3j.client.myts.ChatAttachment;
|
||||
import eu.lixko.ts3j.client.net.PictureDownloads;
|
||||
import eu.lixko.ts3j.client.text.BBCode;
|
||||
import eu.lixko.ts3j.client.text.ChatHtml;
|
||||
import eu.lixko.ts3j.client.ui.icons.IconFiles;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.imageio.ImageReader;
|
||||
@@ -26,7 +27,7 @@ import java.util.regex.Pattern;
|
||||
* narrowed to fit, with a loading icon while one comes. With pictures turned off, or when one
|
||||
* cannot be had, it is a link to the picture behind a picture icon instead.
|
||||
*/
|
||||
final class DescriptionPictures {
|
||||
public final class DescriptionPictures {
|
||||
|
||||
/** A picture, and the links it may sit in. */
|
||||
private static final Pattern TAG = Pattern.compile(
|
||||
@@ -37,22 +38,22 @@ final class DescriptionPictures {
|
||||
private final Settings settings;
|
||||
private final Map<File, Dimension> sizes = new ConcurrentHashMap<>();
|
||||
|
||||
DescriptionPictures(PictureDownloads downloads, Settings settings) {
|
||||
public DescriptionPictures(PictureDownloads downloads, Settings settings) {
|
||||
this.downloads = downloads;
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
static boolean hasPictures(String html) {
|
||||
public static boolean hasPictures(String html) {
|
||||
return html.contains("<img src=\"");
|
||||
}
|
||||
|
||||
/** @param maxWidth the widest a picture may be drawn */
|
||||
String html(String html, int maxWidth) {
|
||||
public String html(String html, int maxWidth) {
|
||||
return html(html, maxWidth, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
/** @param maxHeight the tallest a picture may be drawn */
|
||||
String html(String html, int maxWidth, int maxHeight) {
|
||||
public String html(String html, int maxWidth, int maxHeight) {
|
||||
StringBuilder out = new StringBuilder();
|
||||
Matcher m = TAG.matcher(html);
|
||||
String anchor = null;
|
||||
+6
-5
@@ -1,8 +1,9 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.chat;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.text.BBCode;
|
||||
import eu.lixko.ts3j.client.text.ChatHtml;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JViewport;
|
||||
@@ -32,7 +33,7 @@ import java.awt.Shape;
|
||||
* a look-and-feel change re-installs the editor kit and parses the pane's content again
|
||||
* instead of only recolouring what is written afterwards.
|
||||
*/
|
||||
final class HtmlStyles {
|
||||
public final class HtmlStyles {
|
||||
|
||||
private static final String BODY_STYLE = "HtmlStyles.bodyStyle";
|
||||
|
||||
@@ -44,7 +45,7 @@ final class HtmlStyles {
|
||||
* is added by the theme
|
||||
* @return a read-only HTML pane whose stylesheet follows the current theme
|
||||
*/
|
||||
static JEditorPane pane(String bodyStyle) {
|
||||
public static JEditorPane pane(String bodyStyle) {
|
||||
JEditorPane pane = new JEditorPane() {
|
||||
@Override
|
||||
public void updateUI() {
|
||||
@@ -63,7 +64,7 @@ final class HtmlStyles {
|
||||
* only reaches as far as it goes, and the empty space below it would otherwise show
|
||||
* the window's colour instead of the log's.
|
||||
*/
|
||||
static void fillViewport(JEditorPane pane) {
|
||||
public static void fillViewport(JEditorPane pane) {
|
||||
if (pane.getParent() instanceof JViewport viewport) {
|
||||
viewport.setBackground(pane.getBackground());
|
||||
}
|
||||
@@ -120,7 +121,7 @@ final class HtmlStyles {
|
||||
}
|
||||
|
||||
/** A CSS length of {@code px} at the interface scale. */
|
||||
static String px(int px) {
|
||||
public static String px(int px) {
|
||||
return UIScale.scale(px) + "px";
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.chat;
|
||||
|
||||
import eu.lixko.ts3j.client.session.ServerLink;
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.function.Consumer;
|
||||
* Opens http(s) links from chat messages and descriptions in the system browser, and
|
||||
* {@code ts3server://} links in the client itself.
|
||||
*/
|
||||
final class Links {
|
||||
public final class Links {
|
||||
|
||||
private static volatile Consumer<ServerLink> serverLinks;
|
||||
|
||||
@@ -20,11 +20,11 @@ final class Links {
|
||||
}
|
||||
|
||||
/** Where {@code ts3server://} links go. */
|
||||
static void setServerLinkHandler(Consumer<ServerLink> handler) {
|
||||
public static void setServerLinkHandler(Consumer<ServerLink> handler) {
|
||||
serverLinks = handler;
|
||||
}
|
||||
|
||||
static void open(String href, Component parent) {
|
||||
public static void open(String href, Component parent) {
|
||||
ServerLink link = ServerLink.parse(href);
|
||||
Consumer<ServerLink> handler = serverLinks;
|
||||
if (link != null && handler != null) {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.chat;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.chat;
|
||||
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JViewport;
|
||||
@@ -19,7 +19,7 @@ import java.util.function.DoubleConsumer;
|
||||
* A zoom level for the text and pictures of {@link HtmlStyles} panes, changed with
|
||||
* Ctrl+mouse wheel over any of them and applied to all of them, in a browser's steps.
|
||||
*/
|
||||
final class TextZoom {
|
||||
public final class TextZoom {
|
||||
|
||||
private static final double[] LEVELS = {0.5, 0.67, 0.75, 0.8, 0.9, 1, 1.1, 1.25, 1.5, 1.75, 2, 2.5, 3};
|
||||
|
||||
@@ -28,7 +28,7 @@ final class TextZoom {
|
||||
private double factor;
|
||||
|
||||
/** @param onChange told the new factor after every change, e.g. to save it */
|
||||
TextZoom(double factor, DoubleConsumer onChange) {
|
||||
public TextZoom(double factor, DoubleConsumer onChange) {
|
||||
this.factor = nearestLevel(factor);
|
||||
this.onChange = onChange;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ final class TextZoom {
|
||||
}
|
||||
|
||||
/** Zooms {@code pane} with this zoom, and lets Ctrl+wheel over it change it. */
|
||||
void attach(JEditorPane pane) {
|
||||
public void attach(JEditorPane pane) {
|
||||
if (pane.getClientProperty(TextZoom.class) == this) return;
|
||||
pane.putClientProperty(TextZoom.class, this);
|
||||
panes.add(pane);
|
||||
+5
-3
@@ -1,8 +1,10 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.hotkey;
|
||||
|
||||
import eu.lixko.ts3j.client.hotkey.Hotkey;
|
||||
import eu.lixko.ts3j.client.hotkey.HotkeyEngine;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.ui.MainCommands;
|
||||
import eu.lixko.ts3j.client.ui.MainFrame;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
import java.util.List;
|
||||
@@ -15,7 +17,7 @@ import java.util.function.Predicate;
|
||||
* event dispatch thread first. Which connections an action reaches is the binding's
|
||||
* "on active server" flag: set, only the selected tab; clear, every connected one.
|
||||
*/
|
||||
final class HotkeyActions implements HotkeyEngine.Handler {
|
||||
public final class HotkeyActions implements HotkeyEngine.Handler {
|
||||
|
||||
/** How much one press of the master-volume hotkeys moves the slider. */
|
||||
private static final double VOLUME_STEP = 0.05;
|
||||
@@ -25,7 +27,7 @@ final class HotkeyActions implements HotkeyEngine.Handler {
|
||||
/** Latched push-to-talk, driven by the "Toggle Push-to-Talk" action. */
|
||||
private boolean pttLatched;
|
||||
|
||||
HotkeyActions(MainFrame frame, MainCommands commands) {
|
||||
public HotkeyActions(MainFrame frame, MainCommands commands) {
|
||||
this.frame = frame;
|
||||
this.commands = commands;
|
||||
}
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.hotkey;
|
||||
|
||||
import eu.lixko.ts3j.client.hotkey.HotkeyAction;
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
* packs and channels the hotkey tree hangs under an action as its leaves, so a binding
|
||||
* reads as "Sounds / Activate Soundpack / Default Sound Pack (Male)".
|
||||
*/
|
||||
interface HotkeyArguments {
|
||||
public interface HotkeyArguments {
|
||||
|
||||
/** @return the choices for this action, or an empty list when it is free-form */
|
||||
List<String> choices(HotkeyAction action);
|
||||
+6
-5
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.hotkey;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -6,6 +6,7 @@ import eu.lixko.ts3j.client.hotkey.Hotkey;
|
||||
import eu.lixko.ts3j.client.hotkey.HotkeyAction;
|
||||
import eu.lixko.ts3j.client.hotkey.HotkeyCombo;
|
||||
import eu.lixko.ts3j.client.hotkey.HotkeyEngine;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
@@ -42,7 +43,7 @@ import java.util.List;
|
||||
* concrete bookmark, sound pack or channel — press the key combination to bind, and
|
||||
* choose the edge it triggers on and whether it applies to the active server only.
|
||||
*/
|
||||
final class HotkeyDialog extends JDialog {
|
||||
public final class HotkeyDialog extends JDialog {
|
||||
|
||||
/**
|
||||
* A tree node: a category or group heading ({@code action == null}), an action, or
|
||||
@@ -90,7 +91,7 @@ final class HotkeyDialog extends JDialog {
|
||||
private boolean recording;
|
||||
private boolean confirmed;
|
||||
|
||||
HotkeyDialog(Window owner, HotkeyService service, Hotkey existing) {
|
||||
public HotkeyDialog(Window owner, HotkeyService service, Hotkey existing) {
|
||||
// Any window may open this: the options dialog's hotkey tab as much as a frame.
|
||||
super(owner, existing == null ? "Add hotkey" : "Edit hotkey", ModalityType.APPLICATION_MODAL);
|
||||
this.service = service;
|
||||
@@ -353,11 +354,11 @@ final class HotkeyDialog extends JDialog {
|
||||
dispose();
|
||||
}
|
||||
|
||||
boolean isConfirmed() {
|
||||
public boolean isConfirmed() {
|
||||
return confirmed;
|
||||
}
|
||||
|
||||
Hotkey result() {
|
||||
public Hotkey result() {
|
||||
return hotkey;
|
||||
}
|
||||
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.hotkey;
|
||||
|
||||
import eu.lixko.ts3j.client.hotkey.GlobalInputHook;
|
||||
import eu.lixko.ts3j.client.hotkey.Hotkey;
|
||||
@@ -17,7 +17,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
* the platform input hook they are fed from. Everything the dialogs need — recording a
|
||||
* combination, naming keys, telling the user why hotkeys are dead — goes through here.
|
||||
*/
|
||||
final class HotkeyService {
|
||||
public final class HotkeyService {
|
||||
|
||||
private final Hotkeys hotkeys = Hotkeys.load();
|
||||
private final HotkeyEngine engine;
|
||||
@@ -25,7 +25,7 @@ final class HotkeyService {
|
||||
private final HotkeyArguments arguments;
|
||||
private final List<Runnable> keyPressListeners = new CopyOnWriteArrayList<>();
|
||||
|
||||
HotkeyService(HotkeyEngine.Handler handler, HotkeyArguments arguments) {
|
||||
public HotkeyService(HotkeyEngine.Handler handler, HotkeyArguments arguments) {
|
||||
this.arguments = arguments;
|
||||
engine = new HotkeyEngine(hotkeys, handler);
|
||||
hook = DesktopInputHooks.start((key, pressed) -> {
|
||||
@@ -40,11 +40,11 @@ final class HotkeyService {
|
||||
* Runs {@code l} on the input hook's thread for every key going down anywhere on the
|
||||
* system, which is what typing attenuation listens for. Keep it cheap.
|
||||
*/
|
||||
void addKeyPressListener(Runnable l) {
|
||||
public void addKeyPressListener(Runnable l) {
|
||||
keyPressListeners.add(l);
|
||||
}
|
||||
|
||||
void removeKeyPressListener(Runnable l) {
|
||||
public void removeKeyPressListener(Runnable l) {
|
||||
keyPressListeners.remove(l);
|
||||
}
|
||||
|
||||
@@ -58,18 +58,18 @@ final class HotkeyService {
|
||||
}
|
||||
}
|
||||
|
||||
List<Hotkey> all() {
|
||||
public List<Hotkey> all() {
|
||||
return hotkeys.all();
|
||||
}
|
||||
|
||||
void replaceAll(List<Hotkey> updated) {
|
||||
public void replaceAll(List<Hotkey> updated) {
|
||||
engine.releaseAll();
|
||||
hotkeys.replaceAll(updated);
|
||||
hotkeys.save();
|
||||
}
|
||||
|
||||
/** The binding for an action with no argument, or {@code null} when unbound. */
|
||||
Hotkey find(HotkeyAction action) {
|
||||
public Hotkey find(HotkeyAction action) {
|
||||
for (Hotkey h : hotkeys.all()) {
|
||||
if (h.action == action) return h;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ final class HotkeyService {
|
||||
: "Global hotkeys are unavailable (" + hook.unavailableReason() + ").";
|
||||
}
|
||||
|
||||
String display(HotkeyCombo combo) {
|
||||
public String display(HotkeyCombo combo) {
|
||||
return combo == null ? "No hotkey assigned" : combo.display(this::keyName);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ final class HotkeyService {
|
||||
engine.stopRecording();
|
||||
}
|
||||
|
||||
void dispose() {
|
||||
public void dispose() {
|
||||
engine.releaseAll();
|
||||
hook.close();
|
||||
}
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.hotkey;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -25,7 +25,7 @@ import java.util.List;
|
||||
* and remove them. Edits happen on a working copy and only reach the running engine
|
||||
* when the dialog is applied.
|
||||
*/
|
||||
final class HotkeysPanel extends JPanel {
|
||||
public final class HotkeysPanel extends JPanel {
|
||||
|
||||
private static final String[] COLUMNS = {"Action", "Hotkey", "Trigger", "Active server", "On"};
|
||||
|
||||
@@ -34,7 +34,7 @@ final class HotkeysPanel extends JPanel {
|
||||
private final Model model = new Model();
|
||||
private final JTable table = new JTable(model);
|
||||
|
||||
HotkeysPanel(HotkeyService service) {
|
||||
public HotkeysPanel(HotkeyService service) {
|
||||
super(new BorderLayout(UIScale.scale(6), UIScale.scale(6)));
|
||||
this.service = service;
|
||||
setBorder(new ScaledEmptyBorder(8, 8, 8, 8));
|
||||
@@ -104,12 +104,12 @@ final class HotkeysPanel extends JPanel {
|
||||
}
|
||||
|
||||
/** Commits the edited list to the engine and to disk. */
|
||||
void apply() {
|
||||
public void apply() {
|
||||
service.replaceAll(working);
|
||||
}
|
||||
|
||||
/** Picks the stored bindings up again after something else changed them. */
|
||||
void reload() {
|
||||
public void reload() {
|
||||
working.clear();
|
||||
for (Hotkey h : service.all()) working.add(h.copy());
|
||||
model.fireTableDataChanged();
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.icons;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.gfx.CountryFlags;
|
||||
@@ -10,7 +10,7 @@ import java.util.Optional;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/** TeamSpeak's country flags as Swing icons, at their own 16×11 scaled with the interface. */
|
||||
final class CountryFlagIcons {
|
||||
public final class CountryFlagIcons {
|
||||
|
||||
private static final int WIDTH = 16;
|
||||
private static final int HEIGHT = 11;
|
||||
@@ -20,7 +20,7 @@ final class CountryFlagIcons {
|
||||
}
|
||||
|
||||
/** @return the flag, or {@code null} for an unknown or empty code */
|
||||
static ImageIcon of(String code) {
|
||||
public static ImageIcon of(String code) {
|
||||
if (code == null || code.isEmpty()) return null;
|
||||
return ICONS.computeIfAbsent(code, CountryFlagIcons::load).orElse(null);
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.icons;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.net.Group;
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.icons;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.ImageIcon;
|
||||
@@ -14,7 +14,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
* Icons of the active pack, and country flags, as PNG files, for HTML views, which only
|
||||
* show pictures by URL. A pack change gives the theme new icons, and so new files.
|
||||
*/
|
||||
final class IconFiles {
|
||||
public final class IconFiles {
|
||||
|
||||
private static final Map<String, File> FILES = new ConcurrentHashMap<>();
|
||||
private static File dir;
|
||||
@@ -23,7 +23,7 @@ final class IconFiles {
|
||||
}
|
||||
|
||||
/** @return the icon's file, or {@code null} if no pack has it or it could not be written */
|
||||
static File of(String key, int size) {
|
||||
public static File of(String key, int size) {
|
||||
ImageIcon icon = IconTheme.icon(key, size);
|
||||
if (icon == null) return null;
|
||||
String name = key + '_' + size + '_' + Integer.toHexString(System.identityHashCode(icon)) + ".png";
|
||||
@@ -32,7 +32,7 @@ final class IconFiles {
|
||||
}
|
||||
|
||||
/** @return the country's flag as drawn in the tree, or {@code null} for none */
|
||||
static File flag(String code) {
|
||||
public static File flag(String code) {
|
||||
ImageIcon icon = CountryFlagIcons.of(code);
|
||||
if (icon == null) return null;
|
||||
File file = FILES.computeIfAbsent("flag_" + code + '_' + icon.getIconWidth() + ".png", n -> write(icon, n));
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.icons;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import com.github.weisj.jsvg.SVGDocument;
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.icons;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.gfx.IconKeys;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import java.awt.BasicStroke;
|
||||
+6
-3
@@ -1,7 +1,10 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.manage;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.admin.ReasonDialog;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
@@ -29,7 +32,7 @@ import java.util.List;
|
||||
* A small modal editor for a list of text-keyed items: Add, Remove, optionally Move up and
|
||||
* down, and OK/Cancel. Edits a copy and writes it back only on OK.
|
||||
*/
|
||||
abstract class AbstractListEditorDialog<T> extends JDialog {
|
||||
public abstract class AbstractListEditorDialog<T> extends JDialog {
|
||||
|
||||
protected final DefaultListModel<T> model = new DefaultListModel<>();
|
||||
protected final JList<T> list = new JList<>(model);
|
||||
@@ -42,7 +45,7 @@ abstract class AbstractListEditorDialog<T> extends JDialog {
|
||||
* @param itemPrompt what Add and a double-click ask for
|
||||
* @param movable whether the order matters, offering Move up and down
|
||||
*/
|
||||
AbstractListEditorDialog(Window owner, String title, String intro, String itemPrompt, List<T> items, boolean movable) {
|
||||
public AbstractListEditorDialog(Window owner, String title, String intro, String itemPrompt, List<T> items, boolean movable) {
|
||||
super(owner, title, ModalityType.APPLICATION_MODAL);
|
||||
this.itemPrompt = itemPrompt;
|
||||
items.forEach(model::addElement);
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.manage;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.config.AwayMessages;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
+4
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.manage;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -10,6 +10,9 @@ import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.session.Sessions;
|
||||
import eu.lixko.ts3j.client.teamspeak.TeamSpeakImporter;
|
||||
import eu.lixko.ts3j.client.teamspeak.TeamSpeakSettingsDb;
|
||||
import eu.lixko.ts3j.client.ui.icons.GroupIcons;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
+2
-1
@@ -1,9 +1,10 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.manage;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.config.IdentityStore;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JDialog;
|
||||
+5
-3
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.manage;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -6,6 +6,8 @@ import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.contacts.ContactDefaults;
|
||||
import eu.lixko.ts3j.client.contacts.ContactType;
|
||||
import eu.lixko.ts3j.client.contacts.NicknameDisplay;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.ButtonGroup;
|
||||
@@ -34,7 +36,7 @@ import java.util.function.Function;
|
||||
* when added as a friend, blocked or neutral — the ignore/hide flags and how its
|
||||
* nickname is displayed — in a grid with one column per contact type.
|
||||
*/
|
||||
final class ContactDefaultsDialog extends JDialog {
|
||||
public final class ContactDefaultsDialog extends JDialog {
|
||||
|
||||
private static final ContactType[] COLUMNS = {ContactType.FRIEND, ContactType.BLOCKED, ContactType.NEUTRAL};
|
||||
|
||||
@@ -42,7 +44,7 @@ final class ContactDefaultsDialog extends JDialog {
|
||||
private final Map<ContactType, Map<String, JCheckBox>> flags = new EnumMap<>(ContactType.class);
|
||||
private final Map<ContactType, Map<NicknameDisplay, JRadioButton>> displays = new EnumMap<>(ContactType.class);
|
||||
|
||||
ContactDefaultsDialog(Dialog owner, Settings settings) {
|
||||
public ContactDefaultsDialog(Dialog owner, Settings settings) {
|
||||
super(owner, "Contact Manager Default Settings", true);
|
||||
this.settings = settings;
|
||||
for (ContactType t : COLUMNS) {
|
||||
+7
-4
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.manage;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -9,6 +9,9 @@ import eu.lixko.ts3j.client.contacts.ContactType;
|
||||
import eu.lixko.ts3j.client.contacts.NicknameDisplay;
|
||||
import eu.lixko.ts3j.client.teamspeak.TeamSpeakSettingsDb;
|
||||
import eu.lixko.ts3j.client.text.TsLink;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.Box;
|
||||
@@ -69,7 +72,7 @@ import java.util.regex.Pattern;
|
||||
* <p>Clients can be dragged in from the server tree — the drag carries the
|
||||
* client's TS3 link, which names its unique id.
|
||||
*/
|
||||
final class ContactsDialog extends JDialog {
|
||||
public final class ContactsDialog extends JDialog {
|
||||
|
||||
private static final DateTimeFormatter SEEN = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
|
||||
private static final DateTimeFormatter SEEN_DAY = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
@@ -108,7 +111,7 @@ final class ContactsDialog extends JDialog {
|
||||
/** Set while the fields are being filled from a contact, so that does not count as an edit. */
|
||||
private boolean filling;
|
||||
|
||||
ContactsDialog(Frame owner, ContactStore contacts, Settings settings) {
|
||||
public ContactsDialog(Frame owner, ContactStore contacts, Settings settings) {
|
||||
super(owner, "Contacts", false);
|
||||
this.contacts = contacts;
|
||||
this.settings = settings;
|
||||
@@ -234,7 +237,7 @@ final class ContactsDialog extends JDialog {
|
||||
}
|
||||
|
||||
/** Selects the contact a client's unique id (or a contact key) is filed under, if it is on the list. */
|
||||
void select(String uniqueId) {
|
||||
public void select(String uniqueId) {
|
||||
Contact wanted = contacts.find(uniqueId);
|
||||
if (wanted == null) return;
|
||||
java.util.Enumeration<?> nodes = root.depthFirstEnumeration();
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.manage;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -8,6 +8,7 @@ import eu.lixko.ts3j.client.config.IdentityStore;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.teamspeak.TeamSpeakImporter;
|
||||
import eu.lixko.ts3j.client.teamspeak.TeamSpeakSettingsDb;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.manage;
|
||||
|
||||
import eu.lixko.ts3j.client.config.IdentityEntry;
|
||||
import eu.lixko.ts3j.client.config.IdentityStore;
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.ui.widget.FormPanel;
|
||||
|
||||
import javax.swing.JCheckBox;
|
||||
import java.awt.GridBagConstraints;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import eu.lixko.ts3j.client.audio.AudioDevice;
|
||||
|
||||
+4
-1
@@ -1,9 +1,12 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import eu.lixko.ts3j.client.audio.AudioBackend;
|
||||
import eu.lixko.ts3j.client.audio.AudioDevice;
|
||||
import eu.lixko.ts3j.client.audio.VoiceInput;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.ui.hotkey.HotkeyService;
|
||||
import eu.lixko.ts3j.client.ui.hotkey.HotkeysPanel;
|
||||
import eu.lixko.ts3j.client.ui.widget.FormPanel;
|
||||
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.config.AppDirs;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.ui.widget.FormPanel;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.config.ClientVersion;
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.ui.manage.ContactDefaultsDialog;
|
||||
import eu.lixko.ts3j.client.ui.widget.FormPanel;
|
||||
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.JButton;
|
||||
+6
-1
@@ -1,9 +1,14 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.gfx.IconPack;
|
||||
import eu.lixko.ts3j.client.ui.DisplayScale;
|
||||
import eu.lixko.ts3j.client.ui.LookAndFeelManager;
|
||||
import eu.lixko.ts3j.client.ui.icons.IconTheme;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.widget.FormPanel;
|
||||
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.DefaultListModel;
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.Color;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import eu.lixko.ts3j.client.audio.AudioBackend;
|
||||
import eu.lixko.ts3j.client.audio.AudioPlayback;
|
||||
+4
-3
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -9,6 +9,7 @@ import eu.lixko.ts3j.client.myts.MyTeamSpeakLogin;
|
||||
import eu.lixko.ts3j.client.myts.MyTsException;
|
||||
import eu.lixko.ts3j.client.teamspeak.SyncItem;
|
||||
import eu.lixko.ts3j.client.teamspeak.TeamSpeakImporter;
|
||||
import eu.lixko.ts3j.client.ui.widget.FormPanel;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
@@ -39,7 +40,7 @@ import java.util.stream.Stream;
|
||||
* account synchronises and import it. Everything here takes effect at once rather
|
||||
* than on OK, as signing in is not a setting to be cancelled.
|
||||
*/
|
||||
final class MyTeamSpeakPanel extends JPanel {
|
||||
public final class MyTeamSpeakPanel extends JPanel {
|
||||
|
||||
private static final String SIGNED_OUT = "out";
|
||||
private static final String SIGNED_IN = "in";
|
||||
@@ -70,7 +71,7 @@ final class MyTeamSpeakPanel extends JPanel {
|
||||
private List<SyncItem> accountItems = List.of();
|
||||
private boolean fetched;
|
||||
|
||||
MyTeamSpeakPanel(MyTeamSpeakLogin login, TeamSpeakImporter importer, Runnable onImported,
|
||||
public MyTeamSpeakPanel(MyTeamSpeakLogin login, TeamSpeakImporter importer, Runnable onImported,
|
||||
Runnable onSignInChanged) {
|
||||
this.login = login;
|
||||
this.importer = importer;
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import eu.lixko.ts3j.client.audio.VoiceInput;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.ui.widget.FormPanel;
|
||||
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JLabel;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
+3
-1
@@ -1,4 +1,6 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import eu.lixko.ts3j.client.ui.icons.IconTheme;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JComponent;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import eu.lixko.ts3j.client.audio.AudioDevice;
|
||||
import eu.lixko.ts3j.client.audio.AudioIo;
|
||||
@@ -6,6 +6,7 @@ import eu.lixko.ts3j.client.audio.VoiceOutput;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.sound.SoundEvent;
|
||||
import eu.lixko.ts3j.client.sound.SoundNotifier;
|
||||
import eu.lixko.ts3j.client.ui.widget.FormPanel;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComboBox;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.config.ClientRowColors;
|
||||
+5
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -8,6 +8,10 @@ import eu.lixko.ts3j.client.audio.VoiceInput;
|
||||
import eu.lixko.ts3j.client.audio.VoiceOutput;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.sound.SoundNotifier;
|
||||
import eu.lixko.ts3j.client.ui.hotkey.HotkeyService;
|
||||
import eu.lixko.ts3j.client.ui.hotkey.HotkeysPanel;
|
||||
import eu.lixko.ts3j.client.ui.icons.IconTheme;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComponent;
|
||||
+6
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.options;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -8,6 +8,11 @@ import eu.lixko.ts3j.client.audio.VoiceInput;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.hotkey.Hotkey;
|
||||
import eu.lixko.ts3j.client.hotkey.HotkeyAction;
|
||||
import eu.lixko.ts3j.client.ui.hotkey.HotkeyDialog;
|
||||
import eu.lixko.ts3j.client.ui.hotkey.HotkeyService;
|
||||
import eu.lixko.ts3j.client.ui.hotkey.HotkeysPanel;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.widget.FormPanel;
|
||||
|
||||
import javax.swing.ButtonGroup;
|
||||
import javax.swing.JButton;
|
||||
+6
-5
@@ -1,8 +1,9 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import eu.lixko.ts3j.client.net.ClientEntry;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.net.avatar.Avatar;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.ui.widget.Edt;
|
||||
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JOptionPane;
|
||||
@@ -14,7 +15,7 @@ import java.nio.file.Files;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/** Sets, takes and deletes our avatar on one server, reporting failures in a dialog. */
|
||||
final class AvatarActions {
|
||||
public final class AvatarActions {
|
||||
|
||||
/** Where the last avatar was picked from, for every server alike. */
|
||||
private static File lastDirectory;
|
||||
@@ -28,7 +29,7 @@ final class AvatarActions {
|
||||
}
|
||||
|
||||
/** Asks for an image and uploads it as our avatar. */
|
||||
void choose() {
|
||||
public void choose() {
|
||||
if (!session.isConnected()) return;
|
||||
JFileChooser chooser = new JFileChooser(lastDirectory);
|
||||
chooser.setDialogTitle("Select your avatar");
|
||||
@@ -55,7 +56,7 @@ final class AvatarActions {
|
||||
Edt.onFailure(upload, failure -> show("Error uploading avatar: " + failure.getMessage()));
|
||||
}
|
||||
|
||||
void delete() {
|
||||
public void delete() {
|
||||
if (!session.isConnected()) return;
|
||||
Edt.onFailure(session.avatarAdmin().remove(), failure -> show("Error deleting avatar: " + failure.getMessage()));
|
||||
}
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import eu.lixko.ts3j.client.net.ChannelNode;
|
||||
import eu.lixko.ts3j.client.net.ChannelSettings;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JPopupMenu;
|
||||
+3
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import eu.lixko.ts3j.client.contacts.ContactType;
|
||||
import eu.lixko.ts3j.client.net.ChannelNode;
|
||||
@@ -6,6 +6,8 @@ import eu.lixko.ts3j.client.net.ClientEntry;
|
||||
import eu.lixko.ts3j.client.net.Group;
|
||||
import eu.lixko.ts3j.client.net.GroupChoice;
|
||||
import eu.lixko.ts3j.client.net.ServerModel;
|
||||
import eu.lixko.ts3j.client.ui.icons.GroupIcons;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.swing.JCheckBoxMenuItem;
|
||||
import javax.swing.JMenu;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import eu.lixko.ts3j.client.net.ClientEntry;
|
||||
|
||||
+5
-1
@@ -1,9 +1,13 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.net.ClientContacts;
|
||||
import eu.lixko.ts3j.client.net.ClientEntry;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.chat.HtmlStyles;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
import eu.lixko.ts3j.client.ui.widget.FormPanel;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JDialog;
|
||||
+7
-3
@@ -1,14 +1,18 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.net.ClientEntry;
|
||||
import eu.lixko.ts3j.client.net.ConnectionStats;
|
||||
import eu.lixko.ts3j.client.net.ConnectionStatsFormat;
|
||||
import eu.lixko.ts3j.client.net.ConnectionStatsFormat.Row;
|
||||
import eu.lixko.ts3j.client.net.ConnectionStatsFormat.TrafficRow;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.net.ConnectionStatsFormat;
|
||||
import eu.lixko.ts3j.client.net.avatar.Avatar;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.chat.AvatarHtml;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.widget.Dialogs;
|
||||
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
+6
-2
@@ -1,12 +1,16 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.net.ChannelNode;
|
||||
import eu.lixko.ts3j.client.net.Spacers;
|
||||
import eu.lixko.ts3j.client.net.ClientEntry;
|
||||
import eu.lixko.ts3j.client.net.ClientStatus;
|
||||
import eu.lixko.ts3j.client.net.ServerModel;
|
||||
import eu.lixko.ts3j.client.net.Spacers;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.icons.CountryFlagIcons;
|
||||
import eu.lixko.ts3j.client.ui.icons.GroupIcons;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JTree;
|
||||
+4
-2
@@ -1,12 +1,14 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.net.ChannelNode;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.net.filetransfer.FileTransfer;
|
||||
import eu.lixko.ts3j.client.net.filetransfer.RemoteFile;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.text.ByteSize;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.Box;
|
||||
+9
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -13,6 +13,14 @@ import eu.lixko.ts3j.client.net.PictureDownloads;
|
||||
import eu.lixko.ts3j.client.net.ServerModel;
|
||||
import eu.lixko.ts3j.client.net.avatar.Avatar;
|
||||
import eu.lixko.ts3j.client.text.BBCode;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.chat.AvatarHtml;
|
||||
import eu.lixko.ts3j.client.ui.chat.DescriptionPictures;
|
||||
import eu.lixko.ts3j.client.ui.chat.HtmlStyles;
|
||||
import eu.lixko.ts3j.client.ui.chat.Links;
|
||||
import eu.lixko.ts3j.client.ui.chat.TextZoom;
|
||||
import eu.lixko.ts3j.client.ui.icons.IconFiles;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JEditorPane;
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.net.ClientEntry;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
|
||||
import javax.swing.DefaultCellEditor;
|
||||
import javax.swing.JLabel;
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.recording.VoiceRecorder;
|
||||
@@ -13,18 +13,18 @@ import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
/** Starts recordings, into a file the user picks or, from a hotkey, the folder last used. */
|
||||
final class RecordingActions {
|
||||
public final class RecordingActions {
|
||||
|
||||
private final Component owner;
|
||||
private final Settings settings;
|
||||
|
||||
RecordingActions(Component owner, Settings settings) {
|
||||
public RecordingActions(Component owner, Settings settings) {
|
||||
this.owner = owner;
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
/** Asks where to save, then starts recording. */
|
||||
void choose(ServerSession session, boolean multitrack) {
|
||||
public void choose(ServerSession session, boolean multitrack) {
|
||||
if (!session.isConnected() || session.isRecording()) return;
|
||||
Path dir = settings.recordingFolder();
|
||||
if (!Files.isDirectory(dir)) dir = Paths.get(System.getProperty("user.home", "."));
|
||||
@@ -40,7 +40,7 @@ final class RecordingActions {
|
||||
session.startRecording(mode(multitrack), file.toPath());
|
||||
}
|
||||
|
||||
void startNow(ServerSession session, boolean multitrack) {
|
||||
public void startNow(ServerSession session, boolean multitrack) {
|
||||
if (!session.isConnected() || session.isRecording()) return;
|
||||
session.startRecording(mode(multitrack), session.recordingFile(settings.recordingFolder()));
|
||||
}
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import eu.lixko.ts3j.client.net.ChannelSettings;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JPopupMenu;
|
||||
+29
-15
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import eu.lixko.ts3j.client.audio.AudioBackend;
|
||||
import eu.lixko.ts3j.client.config.BanReasonPresets;
|
||||
@@ -13,6 +13,20 @@ import eu.lixko.ts3j.client.net.avatar.Avatar;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.sound.SoundNotifier;
|
||||
import eu.lixko.ts3j.client.text.TsLink;
|
||||
import eu.lixko.ts3j.client.ui.MainFrame;
|
||||
import eu.lixko.ts3j.client.ui.admin.AbstractServerListDialog;
|
||||
import eu.lixko.ts3j.client.ui.admin.BanListDialog;
|
||||
import eu.lixko.ts3j.client.ui.admin.ComplaintsDialog;
|
||||
import eu.lixko.ts3j.client.ui.admin.OfflineMessageComposeDialog;
|
||||
import eu.lixko.ts3j.client.ui.admin.OfflineMessagesDialog;
|
||||
import eu.lixko.ts3j.client.ui.admin.PrivilegeKeysDialog;
|
||||
import eu.lixko.ts3j.client.ui.admin.ServerLogDialog;
|
||||
import eu.lixko.ts3j.client.ui.chat.ChatAttachmentActions;
|
||||
import eu.lixko.ts3j.client.ui.chat.ChatPanel;
|
||||
import eu.lixko.ts3j.client.ui.icons.GroupIcons;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.widget.Edt;
|
||||
import eu.lixko.ts3j.client.ui.widget.SplitRatio;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JOptionPane;
|
||||
@@ -32,7 +46,7 @@ import java.util.function.Supplier;
|
||||
* ServerTab owns the panels, tree context-menu actions and selection live in
|
||||
* {@link ServerTabTreeActions}, and session callbacks in {@link ServerTabConnectionEvents}.
|
||||
*/
|
||||
final class ServerTab {
|
||||
public final class ServerTab {
|
||||
|
||||
private final MainFrame host;
|
||||
private final Settings settings;
|
||||
@@ -56,7 +70,7 @@ final class ServerTab {
|
||||
/** The unread count last reported, to tell new mail from messages being read. */
|
||||
private int unreadMessages;
|
||||
|
||||
ServerTab(MainFrame host, Settings settings, IdentityStore identities, AudioBackend audio,
|
||||
public ServerTab(MainFrame host, Settings settings, IdentityStore identities, AudioBackend audio,
|
||||
SoundNotifier sounds, ContactStore contacts, PictureDownloads pictures) {
|
||||
this.host = host;
|
||||
this.settings = settings;
|
||||
@@ -163,36 +177,36 @@ final class ServerTab {
|
||||
|
||||
// ---- accessors ----
|
||||
|
||||
JComponent component() {
|
||||
public JComponent component() {
|
||||
return component;
|
||||
}
|
||||
|
||||
ServerSession session() {
|
||||
public ServerSession session() {
|
||||
return session;
|
||||
}
|
||||
|
||||
ChatPanel chat() {
|
||||
public ChatPanel chat() {
|
||||
return chatPanel;
|
||||
}
|
||||
|
||||
/** Opens the server's ban list, or brings the already open one forward. */
|
||||
void showBanList(BanReasonPresets presets) {
|
||||
public void showBanList(BanReasonPresets presets) {
|
||||
showListWindow(BanListDialog.class, () -> new BanListDialog(host, session, settings, presets));
|
||||
}
|
||||
|
||||
void showComplaints() {
|
||||
public void showComplaints() {
|
||||
showListWindow(ComplaintsDialog.class, () -> new ComplaintsDialog(host, session, treeActions::banClient));
|
||||
}
|
||||
|
||||
void showServerLog() {
|
||||
public void showServerLog() {
|
||||
showListWindow(ServerLogDialog.class, () -> new ServerLogDialog(host, session, settings));
|
||||
}
|
||||
|
||||
void showPrivilegeKeys() {
|
||||
public void showPrivilegeKeys() {
|
||||
showListWindow(PrivilegeKeysDialog.class, () -> new PrivilegeKeysDialog(host, session, groupIcons));
|
||||
}
|
||||
|
||||
void showOfflineMessages() {
|
||||
public void showOfflineMessages() {
|
||||
showListWindow(OfflineMessagesDialog.class, () -> new OfflineMessagesDialog(host, session,
|
||||
new OfflineMessagesDialog.Composer() {
|
||||
@Override
|
||||
@@ -243,7 +257,7 @@ final class ServerTab {
|
||||
}
|
||||
|
||||
/** Asks for a privilege key and redeems it on this server. */
|
||||
void usePrivilegeKey() {
|
||||
public void usePrivilegeKey() {
|
||||
if (!session.isConnected()) return;
|
||||
String key = (String) JOptionPane.showInputDialog(host, "Privilege Key:", "Use Privilege Key",
|
||||
JOptionPane.PLAIN_MESSAGE, Icons.of("TOKEN_USE"), null, null);
|
||||
@@ -265,7 +279,7 @@ final class ServerTab {
|
||||
}
|
||||
|
||||
/** The contact list changed: names, colours and per-client playback follow. */
|
||||
void contactsChanged() {
|
||||
public void contactsChanged() {
|
||||
session.contacts().applyAll();
|
||||
treePanel.refreshRowSizes();
|
||||
treeActions.renderInfo();
|
||||
@@ -273,14 +287,14 @@ final class ServerTab {
|
||||
|
||||
// ---- dialogs ----
|
||||
|
||||
AvatarActions avatar() {
|
||||
public AvatarActions avatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
// ---- chat ----
|
||||
|
||||
/** Opens the file repository browser for a channel, as the "Browse Files" hotkey/menu action does. */
|
||||
void browseFiles(ChannelNode channel) {
|
||||
public void browseFiles(ChannelNode channel) {
|
||||
treeActions.browseFiles(channel);
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import eu.lixko.ts3j.client.chat.ChatKey;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.ui.MainFrame;
|
||||
import eu.lixko.ts3j.client.ui.chat.ChatPanel;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.SwingUtilities;
|
||||
+12
-3
@@ -1,16 +1,25 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import eu.lixko.ts3j.client.audio.VoiceOutput;
|
||||
import eu.lixko.ts3j.client.contacts.ContactType;
|
||||
import eu.lixko.ts3j.client.net.ClientAdmin;
|
||||
import eu.lixko.ts3j.client.net.ChannelNode;
|
||||
import eu.lixko.ts3j.client.net.Spacers;
|
||||
import eu.lixko.ts3j.client.net.ChannelSettings;
|
||||
import eu.lixko.ts3j.client.net.ClientAdmin;
|
||||
import eu.lixko.ts3j.client.net.ClientEntry;
|
||||
import eu.lixko.ts3j.client.net.ComplaintAdmin;
|
||||
import eu.lixko.ts3j.client.net.Group;
|
||||
import eu.lixko.ts3j.client.net.Spacers;
|
||||
import eu.lixko.ts3j.client.session.ServerSession;
|
||||
import eu.lixko.ts3j.client.text.TsLink;
|
||||
import eu.lixko.ts3j.client.ui.MainFrame;
|
||||
import eu.lixko.ts3j.client.ui.admin.BanDialog;
|
||||
import eu.lixko.ts3j.client.ui.admin.ReasonDialog;
|
||||
import eu.lixko.ts3j.client.ui.admin.ServerGroupsDialog;
|
||||
import eu.lixko.ts3j.client.ui.channel.ChannelDialog;
|
||||
import eu.lixko.ts3j.client.ui.chat.ChatPanel;
|
||||
import eu.lixko.ts3j.client.ui.icons.GroupIcons;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
import eu.lixko.ts3j.client.ui.widget.Edt;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
import java.awt.Component;
|
||||
+4
-2
@@ -1,12 +1,14 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.contacts.Contact;
|
||||
import eu.lixko.ts3j.client.contacts.ContactStore;
|
||||
import eu.lixko.ts3j.client.net.ChannelNode;
|
||||
import eu.lixko.ts3j.client.net.Spacers;
|
||||
import eu.lixko.ts3j.client.net.ClientEntry;
|
||||
import eu.lixko.ts3j.client.net.ClientStatus;
|
||||
import eu.lixko.ts3j.client.net.Spacers;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.icons.Icons;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JTree;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import eu.lixko.ts3j.client.net.ChannelNode;
|
||||
import eu.lixko.ts3j.client.net.Spacers;
|
||||
+4
-2
@@ -1,15 +1,17 @@
|
||||
package eu.lixko.ts3j.client.ui;
|
||||
package eu.lixko.ts3j.client.ui.server;
|
||||
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import eu.lixko.ts3j.client.config.Settings;
|
||||
import eu.lixko.ts3j.client.contacts.ContactStore;
|
||||
import eu.lixko.ts3j.client.contacts.ContactType;
|
||||
import eu.lixko.ts3j.client.net.ChannelNode;
|
||||
import eu.lixko.ts3j.client.net.Spacers;
|
||||
import eu.lixko.ts3j.client.net.ChannelSettings;
|
||||
import eu.lixko.ts3j.client.net.ClientEntry;
|
||||
import eu.lixko.ts3j.client.net.Group;
|
||||
import eu.lixko.ts3j.client.net.ServerModel;
|
||||
import eu.lixko.ts3j.client.net.Spacers;
|
||||
import eu.lixko.ts3j.client.ui.Theme;
|
||||
import eu.lixko.ts3j.client.ui.icons.GroupIcons;
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.DropMode;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user