Skip to content

Commit

Permalink
更新 jediterm-*
Browse files Browse the repository at this point in the history
  • Loading branch information
G3G4X5X6 committed Jul 13, 2024
1 parent 1f2b447 commit ee0122a
Show file tree
Hide file tree
Showing 17 changed files with 60 additions and 120 deletions.
2 changes: 1 addition & 1 deletion .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ winget install ultimatecube
2. 安装依赖:

```shell
# vnc
mvn install:install-file -Dfile=libs/tightvnc-jviewer.jar -DgroupId=com.g3g4x5x6 -DartifactId=tightvnc-jviewer -Dversion=2.8.3 -Dpackaging=jar
mvn install:install-file -Dfile=libs/jediterm-core-3.20-SNAPSHOT.jar -DgroupId=com.jediterm -DartifactId=jediterm-core -Dversion=3.20-SNAPSHOT -Dpackaging=jar
mvn install:install-file -Dfile=libs/jediterm-ui-3.20-SNAPSHOT.jar -DgroupId=com.jediterm -DartifactId=jediterm-ui -Dversion=3.20-SNAPSHOT -Dpackaging=jar
# jediterm
mvn install:install-file -Dfile=libs/jediterm-core-3.44-SNAPSHOT.jar -DgroupId=com.jediterm -DartifactId=jediterm-core -Dversion=3.44-SNAPSHOT -Dpackaging=jar
mvn install:install-file -Dfile=libs/jediterm-ui-3.44-SNAPSHOT.jar -DgroupId=com.jediterm -DartifactId=jediterm-ui -Dversion=3.44-SNAPSHOT -Dpackaging=jar
```

3. 编译运行:
Expand Down
Binary file removed libs/jediterm-core-3.20-SNAPSHOT-sources.jar
Binary file not shown.
Binary file removed libs/jediterm-core-3.20-SNAPSHOT.jar
Binary file not shown.
Binary file added libs/jediterm-core-3.44-SNAPSHOT-sources.jar
Binary file not shown.
Binary file added libs/jediterm-core-3.44-SNAPSHOT.jar
Binary file not shown.
Binary file removed libs/jediterm-ui-3.20-SNAPSHOT.jar
Binary file not shown.
Binary file added libs/jediterm-ui-3.44-SNAPSHOT-sources.jar
Binary file not shown.
Binary file added libs/jediterm-ui-3.44-SNAPSHOT.jar
Binary file not shown.
20 changes: 18 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@
<qqwry-java-version>0.8.0</qqwry-java-version>

<pty4j-version>0.12.13</pty4j-version>
<jediterm-core-version>3.20-SNAPSHOT</jediterm-core-version>
<jediterm-ui-version>3.20-SNAPSHOT</jediterm-ui-version>
<jediterm-core-version>3.44-SNAPSHOT</jediterm-core-version>
<jediterm-ui-version>3.44-SNAPSHOT</jediterm-ui-version>

<kotlin-stdlib-version>1.9.22</kotlin-stdlib-version>

<annotations-version>RELEASE</annotations-version>

<tightvnc-jviewer-version>2.8.3</tightvnc-jviewer-version>
Expand Down Expand Up @@ -89,6 +92,19 @@
<version>${jediterm-ui-version}</version>
</dependency>


<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin-stdlib-version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib-common -->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-common</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j -->
<dependency>
<groupId>net.lingala.zip4j</groupId>
Expand Down
11 changes: 11 additions & 0 deletions ultimate-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@
<artifactId>jediterm-ui</artifactId>
</dependency>

<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib-common -->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-common</artifactId>
</dependency>

<dependency>
<groupId>com.g3g4x5x6</groupId>
<artifactId>tightvnc-jviewer</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.g3g4x5x6.remote.ssh.DefaultTerminalTypeAheadSettings;
import com.g3g4x5x6.ui.terminal.settings.ColorScheme;
import com.g3g4x5x6.ui.terminal.settings.DefaultColorPaletteImpl;
import com.jediterm.core.Platform;
import com.jediterm.terminal.HyperlinkStyle;
import com.jediterm.terminal.TerminalColor;
import com.jediterm.terminal.TextStyle;
Expand All @@ -15,9 +14,7 @@
import lombok.SneakyThrows;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.awt.*;
import java.awt.event.InputEvent;
import java.util.Collections;
import java.util.Objects;

Expand Down Expand Up @@ -47,7 +44,7 @@ public float getTerminalFontSize() {
}

@Override
public TextStyle getDefaultStyle() {
public @NotNull TextStyle getDefaultStyle() {
return new TextStyle(TerminalColor.rgb(colorScheme.getForegroundColor().getRed(), colorScheme.getForegroundColor().getGreen(), colorScheme.getForegroundColor().getBlue()), TerminalColor.rgb(colorScheme.getBackgroundColor().getRed(), colorScheme.getBackgroundColor().getGreen(), colorScheme.getBackgroundColor().getBlue()));
}

Expand Down Expand Up @@ -139,48 +136,6 @@ public TerminalActionPresentation getOpenUrlActionPresentation() {
return new TerminalActionPresentation("Open as URL", Collections.emptyList());
}

@NotNull
public TerminalActionPresentation getCopyActionPresentation() {
KeyStroke keyStroke = Platform.current() == Platform.Mac ? KeyStroke.getKeyStroke(67, InputEvent.META_DOWN_MASK) : KeyStroke.getKeyStroke(67, InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK);
return new TerminalActionPresentation("Copy", keyStroke);
}

@NotNull
public TerminalActionPresentation getPasteActionPresentation() {
KeyStroke keyStroke = Platform.current() == Platform.Mac ? KeyStroke.getKeyStroke(86, InputEvent.META_DOWN_MASK) : KeyStroke.getKeyStroke(86, InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK);
return new TerminalActionPresentation("Paste", keyStroke);
}

@NotNull
public TerminalActionPresentation getClearBufferActionPresentation() {
return new TerminalActionPresentation("Clear Buffer", Platform.current() == Platform.Mac ? KeyStroke.getKeyStroke(75, InputEvent.META_DOWN_MASK) : KeyStroke.getKeyStroke(76, InputEvent.CTRL_DOWN_MASK));
}

@NotNull
public TerminalActionPresentation getPageUpActionPresentation() {
return new TerminalActionPresentation("Page Up", KeyStroke.getKeyStroke(33, InputEvent.SHIFT_DOWN_MASK));
}

@NotNull
public TerminalActionPresentation getPageDownActionPresentation() {
return new TerminalActionPresentation("Page Down", KeyStroke.getKeyStroke(34, InputEvent.SHIFT_DOWN_MASK));
}

@NotNull
public TerminalActionPresentation getLineUpActionPresentation() {
return new TerminalActionPresentation("Line Up", Platform.current() == Platform.Mac ? KeyStroke.getKeyStroke(38, InputEvent.META_DOWN_MASK) : KeyStroke.getKeyStroke(38, InputEvent.CTRL_DOWN_MASK));
}

@NotNull
public TerminalActionPresentation getLineDownActionPresentation() {
return new TerminalActionPresentation("Line Down", Platform.current() == Platform.Mac ? KeyStroke.getKeyStroke(40, InputEvent.META_DOWN_MASK) : KeyStroke.getKeyStroke(40, InputEvent.CTRL_DOWN_MASK));
}

@NotNull
public TerminalActionPresentation getFindActionPresentation() {
return new TerminalActionPresentation("Find", Platform.current() == Platform.Mac ? KeyStroke.getKeyStroke(70, InputEvent.META_DOWN_MASK) : KeyStroke.getKeyStroke(70, InputEvent.CTRL_DOWN_MASK));
}

@NotNull
public TerminalActionPresentation getSelectAllActionPresentation() {
return new TerminalActionPresentation("Select All", Collections.emptyList());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.g3g4x5x6.remote.serial;

import com.g3g4x5x6.utils.os.OsInfoUtil;
import com.jediterm.terminal.HyperlinkStyle;
import com.jediterm.terminal.TerminalColor;
import com.jediterm.terminal.TextStyle;
import com.jediterm.terminal.emulator.ColorPalette;
import com.jediterm.terminal.emulator.ColorPaletteImpl;
import com.jediterm.terminal.model.TerminalTypeAheadSettings;
import com.jediterm.terminal.ui.TerminalActionPresentation;
import com.jediterm.terminal.ui.UIUtil;
import com.jediterm.terminal.ui.settings.DefaultSettingsProvider;
import org.jetbrains.annotations.NotNull;

Expand All @@ -19,7 +19,7 @@ public class SerialSettingsProvider extends DefaultSettingsProvider {

@NotNull
public TerminalActionPresentation getNewSessionActionPresentation() {
return new TerminalActionPresentation("New Session", UIUtil.isMac ? KeyStroke.getKeyStroke(84, 256) : KeyStroke.getKeyStroke(84, 192));
return new TerminalActionPresentation("New Session", OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(84, 256) : KeyStroke.getKeyStroke(84, 192));
}

@NotNull
Expand All @@ -29,19 +29,19 @@ public TerminalActionPresentation getOpenUrlActionPresentation() {

@NotNull
public TerminalActionPresentation getCopyActionPresentation() {
KeyStroke keyStroke = UIUtil.isMac ? KeyStroke.getKeyStroke(67, 256) : KeyStroke.getKeyStroke(67, 192);
KeyStroke keyStroke = OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(67, 256) : KeyStroke.getKeyStroke(67, 192);
return new TerminalActionPresentation("Copy", keyStroke);
}

@NotNull
public TerminalActionPresentation getPasteActionPresentation() {
KeyStroke keyStroke = UIUtil.isMac ? KeyStroke.getKeyStroke(86, 256) : KeyStroke.getKeyStroke(86, 192);
KeyStroke keyStroke = OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(86, 256) : KeyStroke.getKeyStroke(86, 192);
return new TerminalActionPresentation("Paste", keyStroke);
}

@NotNull
public TerminalActionPresentation getClearBufferActionPresentation() {
return new TerminalActionPresentation("Clear Buffer", UIUtil.isMac ? KeyStroke.getKeyStroke(75, 256) : KeyStroke.getKeyStroke(76, 128));
return new TerminalActionPresentation("Clear Buffer", OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(75, 256) : KeyStroke.getKeyStroke(76, 128));
}

@NotNull
Expand All @@ -56,22 +56,22 @@ public TerminalActionPresentation getPageDownActionPresentation() {

@NotNull
public TerminalActionPresentation getLineUpActionPresentation() {
return new TerminalActionPresentation("Line Up", UIUtil.isMac ? KeyStroke.getKeyStroke(38, 256) : KeyStroke.getKeyStroke(38, 128));
return new TerminalActionPresentation("Line Up", OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(38, 256) : KeyStroke.getKeyStroke(38, 128));
}

@NotNull
public TerminalActionPresentation getLineDownActionPresentation() {
return new TerminalActionPresentation("Line Down", UIUtil.isMac ? KeyStroke.getKeyStroke(40, 256) : KeyStroke.getKeyStroke(40, 128));
return new TerminalActionPresentation("Line Down", OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(40, 256) : KeyStroke.getKeyStroke(40, 128));
}

@NotNull
public TerminalActionPresentation getCloseSessionActionPresentation() {
return new TerminalActionPresentation("Close Session", UIUtil.isMac ? KeyStroke.getKeyStroke(87, 256) : KeyStroke.getKeyStroke(87, 192));
return new TerminalActionPresentation("Close Session", OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(87, 256) : KeyStroke.getKeyStroke(87, 192));
}

@NotNull
public TerminalActionPresentation getFindActionPresentation() {
return new TerminalActionPresentation("Find", UIUtil.isMac ? KeyStroke.getKeyStroke(70, 256) : KeyStroke.getKeyStroke(70, 128));
return new TerminalActionPresentation("Find", OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(70, 256) : KeyStroke.getKeyStroke(70, 128));
}

@NotNull
Expand All @@ -80,14 +80,14 @@ public TerminalActionPresentation getSelectAllActionPresentation() {
}

public ColorPalette getTerminalColorPalette() {
return UIUtil.isWindows ? ColorPaletteImpl.WINDOWS_PALETTE : ColorPaletteImpl.XTERM_PALETTE;
return OsInfoUtil.isWindows() ? ColorPaletteImpl.WINDOWS_PALETTE : ColorPaletteImpl.XTERM_PALETTE;
}

public Font getTerminalFont() {
String fontName;
if (UIUtil.isWindows) {
if (OsInfoUtil.isWindows()) {
fontName = "新宋体";
} else if (UIUtil.isMac) {
} else if (OsInfoUtil.isMacOS()) {
fontName = "Menlo";
} else {
fontName = "Monospaced";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.g3g4x5x6.AppConfig;
import com.g3g4x5x6.ui.terminal.settings.ColorScheme;
import com.g3g4x5x6.ui.terminal.settings.DefaultColorPaletteImpl;
import com.jediterm.core.Platform;
import com.jediterm.terminal.HyperlinkStyle;
import com.jediterm.terminal.TerminalColor;
import com.jediterm.terminal.TextStyle;
Expand Down Expand Up @@ -137,22 +136,6 @@ public TerminalActionPresentation getOpenUrlActionPresentation() {
return new TerminalActionPresentation("Open as URL", Collections.emptyList());
}

@NotNull
public TerminalActionPresentation getCopyActionPresentation() {
KeyStroke keyStroke = Platform.current() == Platform.Mac ? KeyStroke.getKeyStroke(67, InputEvent.META_DOWN_MASK) : KeyStroke.getKeyStroke(67, InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK);
return new TerminalActionPresentation("Copy", keyStroke);
}

@NotNull
public TerminalActionPresentation getPasteActionPresentation() {
KeyStroke keyStroke = Platform.current() == Platform.Mac ? KeyStroke.getKeyStroke(86, InputEvent.META_DOWN_MASK) : KeyStroke.getKeyStroke(86, InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK);
return new TerminalActionPresentation("Paste", keyStroke);
}

@NotNull
public TerminalActionPresentation getClearBufferActionPresentation() {
return new TerminalActionPresentation("Clear Buffer", Platform.current() == Platform.Mac ? KeyStroke.getKeyStroke(75, InputEvent.META_DOWN_MASK) : KeyStroke.getKeyStroke(76, InputEvent.CTRL_DOWN_MASK));
}

@NotNull
public TerminalActionPresentation getPageUpActionPresentation() {
Expand All @@ -164,21 +147,6 @@ public TerminalActionPresentation getPageDownActionPresentation() {
return new TerminalActionPresentation("Page Down", KeyStroke.getKeyStroke(34, InputEvent.SHIFT_DOWN_MASK));
}

@NotNull
public TerminalActionPresentation getLineUpActionPresentation() {
return new TerminalActionPresentation("Line Up", Platform.current() == Platform.Mac ? KeyStroke.getKeyStroke(38, InputEvent.META_DOWN_MASK) : KeyStroke.getKeyStroke(38, InputEvent.CTRL_DOWN_MASK));
}

@NotNull
public TerminalActionPresentation getLineDownActionPresentation() {
return new TerminalActionPresentation("Line Down", Platform.current() == Platform.Mac ? KeyStroke.getKeyStroke(40, InputEvent.META_DOWN_MASK) : KeyStroke.getKeyStroke(40, InputEvent.CTRL_DOWN_MASK));
}

@NotNull
public TerminalActionPresentation getFindActionPresentation() {
return new TerminalActionPresentation("Find", Platform.current() == Platform.Mac ? KeyStroke.getKeyStroke(70, InputEvent.META_DOWN_MASK) : KeyStroke.getKeyStroke(70, InputEvent.CTRL_DOWN_MASK));
}

@NotNull
public TerminalActionPresentation getSelectAllActionPresentation() {
return new TerminalActionPresentation("Select All", Collections.emptyList());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.g3g4x5x6.remote.telnet;

import com.g3g4x5x6.utils.os.OsInfoUtil;
import com.jediterm.terminal.HyperlinkStyle;
import com.jediterm.terminal.TerminalColor;
import com.jediterm.terminal.TextStyle;
import com.jediterm.terminal.emulator.ColorPalette;
import com.jediterm.terminal.emulator.ColorPaletteImpl;
import com.jediterm.terminal.model.TerminalTypeAheadSettings;
import com.jediterm.terminal.ui.TerminalActionPresentation;
import com.jediterm.terminal.ui.UIUtil;
import com.jediterm.terminal.ui.settings.DefaultSettingsProvider;
import org.jetbrains.annotations.NotNull;

Expand All @@ -19,7 +19,7 @@ public class TelnetSettingsProvider extends DefaultSettingsProvider {

@NotNull
public TerminalActionPresentation getNewSessionActionPresentation() {
return new TerminalActionPresentation("New Session", UIUtil.isMac ? KeyStroke.getKeyStroke(84, 256) : KeyStroke.getKeyStroke(84, 192));
return new TerminalActionPresentation("New Session", OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(84, 256) : KeyStroke.getKeyStroke(84, 192));
}

@NotNull
Expand All @@ -29,19 +29,19 @@ public TerminalActionPresentation getOpenUrlActionPresentation() {

@NotNull
public TerminalActionPresentation getCopyActionPresentation() {
KeyStroke keyStroke = UIUtil.isMac ? KeyStroke.getKeyStroke(67, 256) : KeyStroke.getKeyStroke(67, 192);
KeyStroke keyStroke = OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(67, 256) : KeyStroke.getKeyStroke(67, 192);
return new TerminalActionPresentation("Copy", keyStroke);
}

@NotNull
public TerminalActionPresentation getPasteActionPresentation() {
KeyStroke keyStroke = UIUtil.isMac ? KeyStroke.getKeyStroke(86, 256) : KeyStroke.getKeyStroke(86, 192);
KeyStroke keyStroke = OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(86, 256) : KeyStroke.getKeyStroke(86, 192);
return new TerminalActionPresentation("Paste", keyStroke);
}

@NotNull
public TerminalActionPresentation getClearBufferActionPresentation() {
return new TerminalActionPresentation("Clear Buffer", UIUtil.isMac ? KeyStroke.getKeyStroke(75, 256) : KeyStroke.getKeyStroke(76, 128));
return new TerminalActionPresentation("Clear Buffer", OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(75, 256) : KeyStroke.getKeyStroke(76, 128));
}

@NotNull
Expand All @@ -56,22 +56,22 @@ public TerminalActionPresentation getPageDownActionPresentation() {

@NotNull
public TerminalActionPresentation getLineUpActionPresentation() {
return new TerminalActionPresentation("Line Up", UIUtil.isMac ? KeyStroke.getKeyStroke(38, 256) : KeyStroke.getKeyStroke(38, 128));
return new TerminalActionPresentation("Line Up", OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(38, 256) : KeyStroke.getKeyStroke(38, 128));
}

@NotNull
public TerminalActionPresentation getLineDownActionPresentation() {
return new TerminalActionPresentation("Line Down", UIUtil.isMac ? KeyStroke.getKeyStroke(40, 256) : KeyStroke.getKeyStroke(40, 128));
return new TerminalActionPresentation("Line Down", OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(40, 256) : KeyStroke.getKeyStroke(40, 128));
}

@NotNull
public TerminalActionPresentation getCloseSessionActionPresentation() {
return new TerminalActionPresentation("Close Session", UIUtil.isMac ? KeyStroke.getKeyStroke(87, 256) : KeyStroke.getKeyStroke(87, 192));
return new TerminalActionPresentation("Close Session", OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(87, 256) : KeyStroke.getKeyStroke(87, 192));
}

@NotNull
public TerminalActionPresentation getFindActionPresentation() {
return new TerminalActionPresentation("Find", UIUtil.isMac ? KeyStroke.getKeyStroke(70, 256) : KeyStroke.getKeyStroke(70, 128));
return new TerminalActionPresentation("Find", OsInfoUtil.isMacOS() ? KeyStroke.getKeyStroke(70, 256) : KeyStroke.getKeyStroke(70, 128));
}

@NotNull
Expand All @@ -80,14 +80,14 @@ public TerminalActionPresentation getSelectAllActionPresentation() {
}

public ColorPalette getTerminalColorPalette() {
return UIUtil.isWindows ? ColorPaletteImpl.WINDOWS_PALETTE : ColorPaletteImpl.XTERM_PALETTE;
return OsInfoUtil.isWindows() ? ColorPaletteImpl.WINDOWS_PALETTE : ColorPaletteImpl.XTERM_PALETTE;
}

public Font getTerminalFont() {
String fontName;
if (UIUtil.isWindows) {
if (OsInfoUtil.isWindows()) {
fontName = "新宋体";
} else if (UIUtil.isMac) {
} else if (OsInfoUtil.isMacOS()) {
fontName = "Menlo";
} else {
fontName = "Monospaced";
Expand Down
Loading

0 comments on commit ee0122a

Please sign in to comment.