This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
allprojects {
|
allprojects {
|
||||||
group = 'org.j3270'
|
group = 'haus.nightmare.j3270'
|
||||||
version = '0.1.0'
|
version = '0.1.0'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
+1
-1
@@ -77,7 +77,7 @@ fi
|
|||||||
|
|
||||||
# 4. Package executable JAR
|
# 4. Package executable JAR
|
||||||
echo "Packaging j3270.jar..."
|
echo "Packaging j3270.jar..."
|
||||||
printf "Manifest-Version: 1.0\nMain-Class: org.pubvm.j3270.J3270App\nImplementation-Title: j3270\nImplementation-Version: 0.1.0\nCreated-By: j3270 build_all.sh\n\n" > "$BUILD_DIR/MANIFEST.MF"
|
printf "Manifest-Version: 1.0\nMain-Class: haus.nightmare.j3270.J3270App\nImplementation-Title: j3270\nImplementation-Version: 0.1.0\nCreated-By: j3270 build_all.sh\n\n" > "$BUILD_DIR/MANIFEST.MF"
|
||||||
|
|
||||||
"$JAR_BIN" cvfm "$BUILD_DIR/j3270.jar" "$BUILD_DIR/MANIFEST.MF" \
|
"$JAR_BIN" cvfm "$BUILD_DIR/j3270.jar" "$BUILD_DIR/MANIFEST.MF" \
|
||||||
-C "$BUILD_DIR/lib3270j" . \
|
-C "$BUILD_DIR/lib3270j" . \
|
||||||
|
|||||||
+2
-2
@@ -7,12 +7,12 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
application {
|
application {
|
||||||
mainClass = 'org.pubvm.j3270.J3270App'
|
mainClass = 'haus.nightmare.j3270.J3270App'
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'Main-Class': 'org.pubvm.j3270.J3270App',
|
attributes 'Main-Class': 'haus.nightmare.j3270.J3270App',
|
||||||
'Implementation-Title': 'j3270',
|
'Implementation-Title': 'j3270',
|
||||||
'Implementation-Version': archiveVersion
|
'Implementation-Version': archiveVersion
|
||||||
}
|
}
|
||||||
|
|||||||
+37
-37
@@ -1,13 +1,13 @@
|
|||||||
package org.pubvm.j3270;
|
package haus.nightmare.j3270;
|
||||||
|
|
||||||
import org.lib3270j.*;
|
import haus.nightmare.lib3270j.*;
|
||||||
import org.lib3270j.listener.ConnectionListener;
|
import haus.nightmare.lib3270j.listener.ConnectionListener;
|
||||||
import org.lib3270j.listener.ScreenUpdateListener;
|
import haus.nightmare.lib3270j.listener.ScreenUpdateListener;
|
||||||
import org.pubvm.j3270.ui.ConnectDialog;
|
import haus.nightmare.j3270.ui.ConnectDialog;
|
||||||
import org.pubvm.j3270.ui.StatusBar;
|
import haus.nightmare.j3270.ui.StatusBar;
|
||||||
import org.pubvm.j3270.ui.TerminalPanel;
|
import haus.nightmare.j3270.ui.TerminalPanel;
|
||||||
import org.pubvm.j3270.ft.FileTransfer;
|
import haus.nightmare.j3270.ft.FileTransfer;
|
||||||
import org.pubvm.j3270.ft.FileTransferDialog;
|
import haus.nightmare.j3270.ft.FileTransferDialog;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
@@ -236,12 +236,12 @@ public class J3270App extends JFrame implements ConnectionListener, ScreenUpdate
|
|||||||
|
|
||||||
private void showConnectDialog() {
|
private void showConnectDialog() {
|
||||||
ConnectDialog dialog = new ConnectDialog(this);
|
ConnectDialog dialog = new ConnectDialog(this);
|
||||||
String initialHost = lastHost != null && !lastHost.isEmpty() ? lastHost : org.pubvm.j3270.config.Settings.getAutoConnectHost();
|
String initialHost = lastHost != null && !lastHost.isEmpty() ? lastHost : haus.nightmare.j3270.config.Settings.getAutoConnectHost();
|
||||||
int initialPort = lastPort > 0 ? lastPort : org.pubvm.j3270.config.Settings.getAutoConnectPort();
|
int initialPort = lastPort > 0 ? lastPort : haus.nightmare.j3270.config.Settings.getAutoConnectPort();
|
||||||
dialog.setInitialHost(initialHost);
|
dialog.setInitialHost(initialHost);
|
||||||
dialog.setInitialPort(initialPort);
|
dialog.setInitialPort(initialPort);
|
||||||
dialog.setInitialTls(org.pubvm.j3270.config.Settings.getAutoConnectTls());
|
dialog.setInitialTls(haus.nightmare.j3270.config.Settings.getAutoConnectTls());
|
||||||
dialog.setInitialVerifyCert(org.pubvm.j3270.config.Settings.getAutoConnectVerifyCert());
|
dialog.setInitialVerifyCert(haus.nightmare.j3270.config.Settings.getAutoConnectVerifyCert());
|
||||||
dialog.setVisible(true);
|
dialog.setVisible(true);
|
||||||
|
|
||||||
if (dialog.isConfirmed()) {
|
if (dialog.isConfirmed()) {
|
||||||
@@ -253,7 +253,7 @@ public class J3270App extends JFrame implements ConnectionListener, ScreenUpdate
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showSettingsDialog() {
|
private void showSettingsDialog() {
|
||||||
org.pubvm.j3270.ui.SettingsDialog dialog = new org.pubvm.j3270.ui.SettingsDialog(this);
|
haus.nightmare.j3270.ui.SettingsDialog dialog = new haus.nightmare.j3270.ui.SettingsDialog(this);
|
||||||
dialog.setVisible(true);
|
dialog.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,10 +266,10 @@ public class J3270App extends JFrame implements ConnectionListener, ScreenUpdate
|
|||||||
lastPort = config.getPort();
|
lastPort = config.getPort();
|
||||||
|
|
||||||
// Save for auto-connect
|
// Save for auto-connect
|
||||||
org.pubvm.j3270.config.Settings.setAutoConnectHost(config.getHost());
|
haus.nightmare.j3270.config.Settings.setAutoConnectHost(config.getHost());
|
||||||
org.pubvm.j3270.config.Settings.setAutoConnectPort(config.getPort());
|
haus.nightmare.j3270.config.Settings.setAutoConnectPort(config.getPort());
|
||||||
org.pubvm.j3270.config.Settings.setAutoConnectTls(config.isUseTls());
|
haus.nightmare.j3270.config.Settings.setAutoConnectTls(config.isUseTls());
|
||||||
org.pubvm.j3270.config.Settings.setAutoConnectVerifyCert(config.isTlsVerifyCert());
|
haus.nightmare.j3270.config.Settings.setAutoConnectVerifyCert(config.isTlsVerifyCert());
|
||||||
|
|
||||||
// Disconnect existing connection
|
// Disconnect existing connection
|
||||||
disconnect();
|
disconnect();
|
||||||
@@ -277,7 +277,7 @@ public class J3270App extends JFrame implements ConnectionListener, ScreenUpdate
|
|||||||
// Wire interactive certificate verifier if none configured
|
// Wire interactive certificate verifier if none configured
|
||||||
if (config.getCertificateVerifier() == null) {
|
if (config.getCertificateVerifier() == null) {
|
||||||
config.setCertificateVerifier((chain, authType, exception) ->
|
config.setCertificateVerifier((chain, authType, exception) ->
|
||||||
org.pubvm.j3270.ui.UntrustedCertificateDialog.showPrompt(this, config.getHost(), config.getPort(), chain, exception)
|
haus.nightmare.j3270.ui.UntrustedCertificateDialog.showPrompt(this, config.getHost(), config.getPort(), chain, exception)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -455,7 +455,7 @@ public class J3270App extends JFrame implements ConnectionListener, ScreenUpdate
|
|||||||
boolean cliTls = false;
|
boolean cliTls = false;
|
||||||
boolean cliNoVerifyCert = false;
|
boolean cliNoVerifyCert = false;
|
||||||
Boolean cliTn3270e = null;
|
Boolean cliTn3270e = null;
|
||||||
org.lib3270j.graphics.GraphicsMode cliGraphicsMode = null;
|
haus.nightmare.lib3270j.graphics.GraphicsMode cliGraphicsMode = null;
|
||||||
String configFile = null;
|
String configFile = null;
|
||||||
java.util.List<String> remainingArgs = new java.util.ArrayList<>();
|
java.util.List<String> remainingArgs = new java.util.ArrayList<>();
|
||||||
for (int i = 0; i < args.length; i++) {
|
for (int i = 0; i < args.length; i++) {
|
||||||
@@ -470,11 +470,11 @@ public class J3270App extends JFrame implements ConnectionListener, ScreenUpdate
|
|||||||
} else if ("--tn3270e".equals(args[i])) {
|
} else if ("--tn3270e".equals(args[i])) {
|
||||||
cliTn3270e = true;
|
cliTn3270e = true;
|
||||||
} else if (args[i].startsWith("--graphics=")) {
|
} else if (args[i].startsWith("--graphics=")) {
|
||||||
cliGraphicsMode = org.lib3270j.graphics.GraphicsMode.fromString(args[i].substring(11));
|
cliGraphicsMode = haus.nightmare.lib3270j.graphics.GraphicsMode.fromString(args[i].substring(11));
|
||||||
} else if (("--graphics".equals(args[i]) || "-g".equals(args[i])) && i + 1 < args.length && !args[i + 1].startsWith("-")) {
|
} else if (("--graphics".equals(args[i]) || "-g".equals(args[i])) && i + 1 < args.length && !args[i + 1].startsWith("-")) {
|
||||||
cliGraphicsMode = org.lib3270j.graphics.GraphicsMode.fromString(args[++i]);
|
cliGraphicsMode = haus.nightmare.lib3270j.graphics.GraphicsMode.fromString(args[++i]);
|
||||||
} else if ("--no-graphics".equals(args[i])) {
|
} else if ("--no-graphics".equals(args[i])) {
|
||||||
cliGraphicsMode = org.lib3270j.graphics.GraphicsMode.NONE;
|
cliGraphicsMode = haus.nightmare.lib3270j.graphics.GraphicsMode.NONE;
|
||||||
} else if (("-c".equals(args[i]) || "--config".equals(args[i])) && i + 1 < args.length) {
|
} else if (("-c".equals(args[i]) || "--config".equals(args[i])) && i + 1 < args.length) {
|
||||||
configFile = args[++i];
|
configFile = args[++i];
|
||||||
} else {
|
} else {
|
||||||
@@ -492,7 +492,7 @@ public class J3270App extends JFrame implements ConnectionListener, ScreenUpdate
|
|||||||
|
|
||||||
java.util.logging.Filter appFilter = record -> {
|
java.util.logging.Filter appFilter = record -> {
|
||||||
String name = record.getLoggerName();
|
String name = record.getLoggerName();
|
||||||
return name != null && (name.startsWith("org.lib3270j") || name.startsWith("org.pubvm.j3270"));
|
return name != null && (name.startsWith("haus.nightmare.lib3270j") || name.startsWith("haus.nightmare.j3270"));
|
||||||
};
|
};
|
||||||
|
|
||||||
ConsoleHandler consoleHandler = new ConsoleHandler();
|
ConsoleHandler consoleHandler = new ConsoleHandler();
|
||||||
@@ -501,9 +501,9 @@ public class J3270App extends JFrame implements ConnectionListener, ScreenUpdate
|
|||||||
consoleHandler.setFilter(appFilter);
|
consoleHandler.setFilter(appFilter);
|
||||||
globalRoot.addHandler(consoleHandler);
|
globalRoot.addHandler(consoleHandler);
|
||||||
|
|
||||||
Logger.getLogger("org.pubvm").setLevel(logLevel);
|
Logger.getLogger("haus.nightmare").setLevel(logLevel);
|
||||||
Logger.getLogger("org.pubvm.j3270").setLevel(logLevel);
|
Logger.getLogger("haus.nightmare.j3270").setLevel(logLevel);
|
||||||
Logger.getLogger("org.lib3270j").setLevel(logLevel);
|
Logger.getLogger("haus.nightmare.lib3270j").setLevel(logLevel);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
java.util.logging.FileHandler fileHandler = new java.util.logging.FileHandler("j3270.log", 10 * 1024 * 1024, 1, false) {
|
java.util.logging.FileHandler fileHandler = new java.util.logging.FileHandler("j3270.log", 10 * 1024 * 1024, 1, false) {
|
||||||
@@ -525,7 +525,7 @@ public class J3270App extends JFrame implements ConnectionListener, ScreenUpdate
|
|||||||
// Load INI config file if specified
|
// Load INI config file if specified
|
||||||
if (configFile != null) {
|
if (configFile != null) {
|
||||||
try {
|
try {
|
||||||
org.pubvm.j3270.config.Settings.loadFromIniFile(configFile);
|
haus.nightmare.j3270.config.Settings.loadFromIniFile(configFile);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println("Failed to load config file: " + configFile);
|
System.err.println("Failed to load config file: " + configFile);
|
||||||
System.err.println(e.getMessage());
|
System.err.println(e.getMessage());
|
||||||
@@ -547,7 +547,7 @@ public class J3270App extends JFrame implements ConnectionListener, ScreenUpdate
|
|||||||
final boolean finalTls = cliTls;
|
final boolean finalTls = cliTls;
|
||||||
final boolean finalNoVerify = cliNoVerifyCert;
|
final boolean finalNoVerify = cliNoVerifyCert;
|
||||||
final Boolean finalTn3270e = cliTn3270e;
|
final Boolean finalTn3270e = cliTn3270e;
|
||||||
final org.lib3270j.graphics.GraphicsMode finalGraphicsMode = cliGraphicsMode;
|
final haus.nightmare.lib3270j.graphics.GraphicsMode finalGraphicsMode = cliGraphicsMode;
|
||||||
|
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(() -> {
|
||||||
J3270App app = new J3270App();
|
J3270App app = new J3270App();
|
||||||
@@ -584,22 +584,22 @@ public class J3270App extends JFrame implements ConnectionListener, ScreenUpdate
|
|||||||
if (finalGraphicsMode != null) {
|
if (finalGraphicsMode != null) {
|
||||||
config.setGraphicsMode(finalGraphicsMode);
|
config.setGraphicsMode(finalGraphicsMode);
|
||||||
} else {
|
} else {
|
||||||
config.setGraphicsMode(org.pubvm.j3270.config.Settings.getGraphicsMode());
|
config.setGraphicsMode(haus.nightmare.j3270.config.Settings.getGraphicsMode());
|
||||||
}
|
}
|
||||||
app.connect(config);
|
app.connect(config);
|
||||||
} else {
|
} else {
|
||||||
org.pubvm.j3270.config.Settings.StartupBehavior behavior = org.pubvm.j3270.config.Settings
|
haus.nightmare.j3270.config.Settings.StartupBehavior behavior = haus.nightmare.j3270.config.Settings
|
||||||
.getStartupBehavior();
|
.getStartupBehavior();
|
||||||
switch (behavior) {
|
switch (behavior) {
|
||||||
case SHOW_CONNECT:
|
case SHOW_CONNECT:
|
||||||
SwingUtilities.invokeLater(app::showConnectDialog);
|
SwingUtilities.invokeLater(app::showConnectDialog);
|
||||||
break;
|
break;
|
||||||
case AUTO_CONNECT:
|
case AUTO_CONNECT:
|
||||||
String host = org.pubvm.j3270.config.Settings.getAutoConnectHost();
|
String host = haus.nightmare.j3270.config.Settings.getAutoConnectHost();
|
||||||
int port = org.pubvm.j3270.config.Settings.getAutoConnectPort();
|
int port = haus.nightmare.j3270.config.Settings.getAutoConnectPort();
|
||||||
boolean tls = org.pubvm.j3270.config.Settings.getAutoConnectTls();
|
boolean tls = haus.nightmare.j3270.config.Settings.getAutoConnectTls();
|
||||||
boolean verify = org.pubvm.j3270.config.Settings.getAutoConnectVerifyCert();
|
boolean verify = haus.nightmare.j3270.config.Settings.getAutoConnectVerifyCert();
|
||||||
boolean tn3270e = org.pubvm.j3270.config.Settings.getAutoConnectTn3270e();
|
boolean tn3270e = haus.nightmare.j3270.config.Settings.getAutoConnectTn3270e();
|
||||||
if (host != null && !host.isEmpty()) {
|
if (host != null && !host.isEmpty()) {
|
||||||
ConnectionConfig config = new ConnectionConfig(host, port, TerminalModel.IBM_3279_4, tls);
|
ConnectionConfig config = new ConnectionConfig(host, port, TerminalModel.IBM_3279_4, tls);
|
||||||
config.setTlsVerifyCert(verify);
|
config.setTlsVerifyCert(verify);
|
||||||
@@ -607,7 +607,7 @@ public class J3270App extends JFrame implements ConnectionListener, ScreenUpdate
|
|||||||
if (finalGraphicsMode != null) {
|
if (finalGraphicsMode != null) {
|
||||||
config.setGraphicsMode(finalGraphicsMode);
|
config.setGraphicsMode(finalGraphicsMode);
|
||||||
} else {
|
} else {
|
||||||
config.setGraphicsMode(org.pubvm.j3270.config.Settings.getGraphicsMode());
|
config.setGraphicsMode(haus.nightmare.j3270.config.Settings.getGraphicsMode());
|
||||||
}
|
}
|
||||||
app.connect(config);
|
app.connect(config);
|
||||||
} else {
|
} else {
|
||||||
+7
-7
@@ -1,4 +1,4 @@
|
|||||||
package org.pubvm.j3270.config;
|
package haus.nightmare.j3270.config;
|
||||||
|
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
@@ -86,13 +86,13 @@ public class Settings {
|
|||||||
prefs.putBoolean("autoConnectTn3270e", tn3270e);
|
prefs.putBoolean("autoConnectTn3270e", tn3270e);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static org.lib3270j.graphics.GraphicsMode getGraphicsMode() {
|
public static haus.nightmare.lib3270j.graphics.GraphicsMode getGraphicsMode() {
|
||||||
String modeStr = prefs.get("graphicsMode", org.lib3270j.graphics.GraphicsMode.BOTH.name());
|
String modeStr = prefs.get("graphicsMode", haus.nightmare.lib3270j.graphics.GraphicsMode.BOTH.name());
|
||||||
return org.lib3270j.graphics.GraphicsMode.fromString(modeStr);
|
return haus.nightmare.lib3270j.graphics.GraphicsMode.fromString(modeStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setGraphicsMode(org.lib3270j.graphics.GraphicsMode mode) {
|
public static void setGraphicsMode(haus.nightmare.lib3270j.graphics.GraphicsMode mode) {
|
||||||
prefs.put("graphicsMode", (mode != null ? mode : org.lib3270j.graphics.GraphicsMode.BOTH).name());
|
prefs.put("graphicsMode", (mode != null ? mode : haus.nightmare.lib3270j.graphics.GraphicsMode.BOTH).name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Color getColorOverride(int index, Color defaultColor) {
|
public static Color getColorOverride(int index, Color defaultColor) {
|
||||||
@@ -280,7 +280,7 @@ public class Settings {
|
|||||||
|
|
||||||
case "graphics":
|
case "graphics":
|
||||||
if ("graphicsMode".equalsIgnoreCase(key) || "mode".equalsIgnoreCase(key)) {
|
if ("graphicsMode".equalsIgnoreCase(key) || "mode".equalsIgnoreCase(key)) {
|
||||||
setGraphicsMode(org.lib3270j.graphics.GraphicsMode.fromString(value));
|
setGraphicsMode(haus.nightmare.lib3270j.graphics.GraphicsMode.fromString(value));
|
||||||
} else {
|
} else {
|
||||||
log.warning("Unknown graphics key: " + key);
|
log.warning("Unknown graphics key: " + key);
|
||||||
}
|
}
|
||||||
+6
-6
@@ -1,10 +1,10 @@
|
|||||||
package org.pubvm.j3270.ft;
|
package haus.nightmare.j3270.ft;
|
||||||
|
|
||||||
import org.lib3270j.Telnet3270Client;
|
import haus.nightmare.lib3270j.Telnet3270Client;
|
||||||
import org.lib3270j.ft.FTConfig;
|
import haus.nightmare.lib3270j.ft.FTConfig;
|
||||||
import org.lib3270j.ft.FTConstants.FTState;
|
import haus.nightmare.lib3270j.ft.FTConstants.FTState;
|
||||||
import org.lib3270j.ft.FTCut;
|
import haus.nightmare.lib3270j.ft.FTCut;
|
||||||
import org.lib3270j.ft.FTDft;
|
import haus.nightmare.lib3270j.ft.FTDft;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package org.pubvm.j3270.ft;
|
package haus.nightmare.j3270.ft;
|
||||||
|
|
||||||
import org.lib3270j.ft.FTConfig;
|
import haus.nightmare.lib3270j.ft.FTConfig;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
+8
-8
@@ -1,7 +1,7 @@
|
|||||||
package org.pubvm.j3270.ui;
|
package haus.nightmare.j3270.ui;
|
||||||
|
|
||||||
import org.lib3270j.ConnectionConfig;
|
import haus.nightmare.lib3270j.ConnectionConfig;
|
||||||
import org.lib3270j.TerminalModel;
|
import haus.nightmare.lib3270j.TerminalModel;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
@@ -14,7 +14,7 @@ public class ConnectDialog extends JDialog {
|
|||||||
private JTextField hostField;
|
private JTextField hostField;
|
||||||
private JTextField portField;
|
private JTextField portField;
|
||||||
private JComboBox<TerminalModel> modelCombo;
|
private JComboBox<TerminalModel> modelCombo;
|
||||||
private JComboBox<org.lib3270j.graphics.GraphicsMode> graphicsCombo;
|
private JComboBox<haus.nightmare.lib3270j.graphics.GraphicsMode> graphicsCombo;
|
||||||
private JTextField luField;
|
private JTextField luField;
|
||||||
private JCheckBox tlsCheckBox;
|
private JCheckBox tlsCheckBox;
|
||||||
private JCheckBox verifyCertCheckBox;
|
private JCheckBox verifyCertCheckBox;
|
||||||
@@ -107,8 +107,8 @@ public class ConnectDialog extends JDialog {
|
|||||||
mainPanel.add(graphicsLabel, gbc);
|
mainPanel.add(graphicsLabel, gbc);
|
||||||
gbc.gridx = 1;
|
gbc.gridx = 1;
|
||||||
gbc.weightx = 1.0;
|
gbc.weightx = 1.0;
|
||||||
graphicsCombo = new JComboBox<>(org.lib3270j.graphics.GraphicsMode.values());
|
graphicsCombo = new JComboBox<>(haus.nightmare.lib3270j.graphics.GraphicsMode.values());
|
||||||
graphicsCombo.setSelectedItem(org.pubvm.j3270.config.Settings.getGraphicsMode());
|
graphicsCombo.setSelectedItem(haus.nightmare.j3270.config.Settings.getGraphicsMode());
|
||||||
graphicsCombo.setBackground(new Color(45, 45, 45));
|
graphicsCombo.setBackground(new Color(45, 45, 45));
|
||||||
graphicsCombo.setForeground(fg);
|
graphicsCombo.setForeground(fg);
|
||||||
graphicsCombo.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 13));
|
graphicsCombo.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 13));
|
||||||
@@ -154,7 +154,7 @@ public class ConnectDialog extends JDialog {
|
|||||||
tn3270eCheckBox.setBackground(new Color(30, 30, 30));
|
tn3270eCheckBox.setBackground(new Color(30, 30, 30));
|
||||||
tn3270eCheckBox.setForeground(fg);
|
tn3270eCheckBox.setForeground(fg);
|
||||||
tn3270eCheckBox.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 13));
|
tn3270eCheckBox.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 13));
|
||||||
tn3270eCheckBox.setSelected(org.pubvm.j3270.config.Settings.getAutoConnectTn3270e());
|
tn3270eCheckBox.setSelected(haus.nightmare.j3270.config.Settings.getAutoConnectTn3270e());
|
||||||
tn3270eCheckBox.setFocusPainted(false);
|
tn3270eCheckBox.setFocusPainted(false);
|
||||||
mainPanel.add(tn3270eCheckBox, gbc);
|
mainPanel.add(tn3270eCheckBox, gbc);
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ public class ConnectDialog extends JDialog {
|
|||||||
if (!lu.isEmpty()) {
|
if (!lu.isEmpty()) {
|
||||||
result.setLuName(lu);
|
result.setLuName(lu);
|
||||||
}
|
}
|
||||||
result.setGraphicsMode((org.lib3270j.graphics.GraphicsMode) graphicsCombo.getSelectedItem());
|
result.setGraphicsMode((haus.nightmare.lib3270j.graphics.GraphicsMode) graphicsCombo.getSelectedItem());
|
||||||
result.setUseTls(tlsCheckBox.isSelected());
|
result.setUseTls(tlsCheckBox.isSelected());
|
||||||
result.setTlsVerifyCert(verifyCertCheckBox.isSelected());
|
result.setTlsVerifyCert(verifyCertCheckBox.isSelected());
|
||||||
result.setTn3270eEnabled(tn3270eCheckBox.isSelected());
|
result.setTn3270eEnabled(tn3270eCheckBox.isSelected());
|
||||||
+14
-14
@@ -1,9 +1,9 @@
|
|||||||
package org.pubvm.j3270.ui;
|
package haus.nightmare.j3270.ui;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import org.pubvm.j3270.J3270App;
|
import haus.nightmare.j3270.J3270App;
|
||||||
import org.pubvm.j3270.config.Settings;
|
import haus.nightmare.j3270.config.Settings;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
@@ -31,7 +31,7 @@ public class SettingsDialog extends JDialog {
|
|||||||
// Appearance tab
|
// Appearance tab
|
||||||
private JComboBox<String> fontBox;
|
private JComboBox<String> fontBox;
|
||||||
private JSpinner fontSizeSpinner;
|
private JSpinner fontSizeSpinner;
|
||||||
private JComboBox<org.lib3270j.graphics.GraphicsMode> graphicsModeBox;
|
private JComboBox<haus.nightmare.lib3270j.graphics.GraphicsMode> graphicsModeBox;
|
||||||
|
|
||||||
// Behavior tab
|
// Behavior tab
|
||||||
private JComboBox<Settings.StartupBehavior> startupBehaviorBox;
|
private JComboBox<Settings.StartupBehavior> startupBehaviorBox;
|
||||||
@@ -272,7 +272,7 @@ public class SettingsDialog extends JDialog {
|
|||||||
JLabel graphicsLabel = new JLabel("Graphics Mode:");
|
JLabel graphicsLabel = new JLabel("Graphics Mode:");
|
||||||
panel.add(graphicsLabel, gbc);
|
panel.add(graphicsLabel, gbc);
|
||||||
|
|
||||||
graphicsModeBox = new JComboBox<>(org.lib3270j.graphics.GraphicsMode.values());
|
graphicsModeBox = new JComboBox<>(haus.nightmare.lib3270j.graphics.GraphicsMode.values());
|
||||||
graphicsModeBox.setSelectedItem(Settings.getGraphicsMode());
|
graphicsModeBox.setSelectedItem(Settings.getGraphicsMode());
|
||||||
gbc.gridx = 1;
|
gbc.gridx = 1;
|
||||||
gbc.fill = GridBagConstraints.HORIZONTAL;
|
gbc.fill = GridBagConstraints.HORIZONTAL;
|
||||||
@@ -370,7 +370,7 @@ public class SettingsDialog extends JDialog {
|
|||||||
hostPanel.setBorder(BorderFactory.createTitledBorder("Host Colors"));
|
hostPanel.setBorder(BorderFactory.createTitledBorder("Host Colors"));
|
||||||
|
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
Color init = org.pubvm.j3270.config.Settings.getColorOverride(i, TerminalPanel.DEFAULT_HOST_COLORS[i]);
|
Color init = haus.nightmare.j3270.config.Settings.getColorOverride(i, TerminalPanel.DEFAULT_HOST_COLORS[i]);
|
||||||
tempHostColors[i] = init;
|
tempHostColors[i] = init;
|
||||||
JPanel cb = new JPanel();
|
JPanel cb = new JPanel();
|
||||||
cb.setName("colorSwatch");
|
cb.setName("colorSwatch");
|
||||||
@@ -402,7 +402,7 @@ public class SettingsDialog extends JDialog {
|
|||||||
|
|
||||||
for (int i = 0; i < monoKeys.length; i++) {
|
for (int i = 0; i < monoKeys.length; i++) {
|
||||||
String mk = monoKeys[i];
|
String mk = monoKeys[i];
|
||||||
Color init = org.pubvm.j3270.config.Settings.getMonoColorOverride(mk, monoDefs[i]);
|
Color init = haus.nightmare.j3270.config.Settings.getMonoColorOverride(mk, monoDefs[i]);
|
||||||
tempMonoColors.put(mk, init);
|
tempMonoColors.put(mk, init);
|
||||||
|
|
||||||
JPanel p = new JPanel(new BorderLayout());
|
JPanel p = new JPanel(new BorderLayout());
|
||||||
@@ -466,7 +466,7 @@ public class SettingsDialog extends JDialog {
|
|||||||
for(String act : actions) {
|
for(String act : actions) {
|
||||||
String def = act;
|
String def = act;
|
||||||
if(def.equals("PAGE_UP")) def = "PAGE_UP"; // fallback example
|
if(def.equals("PAGE_UP")) def = "PAGE_UP"; // fallback example
|
||||||
String current = org.pubvm.j3270.config.Settings.getKeyBinding(act, def);
|
String current = haus.nightmare.j3270.config.Settings.getKeyBinding(act, def);
|
||||||
tempKeyBindings.put(act, current);
|
tempKeyBindings.put(act, current);
|
||||||
keymapModel.addRow(new Object[]{act, current});
|
keymapModel.addRow(new Object[]{act, current});
|
||||||
}
|
}
|
||||||
@@ -478,13 +478,13 @@ public class SettingsDialog extends JDialog {
|
|||||||
defaultBinding = "shift F" + (i - 12);
|
defaultBinding = "shift F" + (i - 12);
|
||||||
}
|
}
|
||||||
String pf = "PF"+i;
|
String pf = "PF"+i;
|
||||||
String cur = org.pubvm.j3270.config.Settings.getKeyBinding(pf, defaultBinding);
|
String cur = haus.nightmare.j3270.config.Settings.getKeyBinding(pf, defaultBinding);
|
||||||
tempKeyBindings.put(pf, cur);
|
tempKeyBindings.put(pf, cur);
|
||||||
keymapModel.addRow(new Object[]{pf, cur});
|
keymapModel.addRow(new Object[]{pf, cur});
|
||||||
}
|
}
|
||||||
for(int i=1;i<=3;i++){
|
for(int i=1;i<=3;i++){
|
||||||
String pa = "PA"+i;
|
String pa = "PA"+i;
|
||||||
String curPa = org.pubvm.j3270.config.Settings.getKeyBinding(pa, "alt "+i);
|
String curPa = haus.nightmare.j3270.config.Settings.getKeyBinding(pa, "alt "+i);
|
||||||
tempKeyBindings.put(pa, curPa);
|
tempKeyBindings.put(pa, curPa);
|
||||||
keymapModel.addRow(new Object[]{pa, curPa});
|
keymapModel.addRow(new Object[]{pa, curPa});
|
||||||
}
|
}
|
||||||
@@ -626,7 +626,7 @@ public class SettingsDialog extends JDialog {
|
|||||||
}
|
}
|
||||||
Settings.setFontSize((Integer) fontSizeSpinner.getValue());
|
Settings.setFontSize((Integer) fontSizeSpinner.getValue());
|
||||||
if (graphicsModeBox.getSelectedItem() != null) {
|
if (graphicsModeBox.getSelectedItem() != null) {
|
||||||
Settings.setGraphicsMode((org.lib3270j.graphics.GraphicsMode) graphicsModeBox.getSelectedItem());
|
Settings.setGraphicsMode((haus.nightmare.lib3270j.graphics.GraphicsMode) graphicsModeBox.getSelectedItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply Behavior
|
// Apply Behavior
|
||||||
@@ -648,15 +648,15 @@ public class SettingsDialog extends JDialog {
|
|||||||
// Propagate visual changes to the app
|
// Propagate visual changes to the app
|
||||||
// Save Colors
|
// Save Colors
|
||||||
for (int i=0; i<16; i++) {
|
for (int i=0; i<16; i++) {
|
||||||
org.pubvm.j3270.config.Settings.setColorOverride(i, tempHostColors[i]);
|
haus.nightmare.j3270.config.Settings.setColorOverride(i, tempHostColors[i]);
|
||||||
}
|
}
|
||||||
for (Map.Entry<String, Color> entry : tempMonoColors.entrySet()) {
|
for (Map.Entry<String, Color> entry : tempMonoColors.entrySet()) {
|
||||||
org.pubvm.j3270.config.Settings.setMonoColorOverride(entry.getKey(), entry.getValue());
|
haus.nightmare.j3270.config.Settings.setMonoColorOverride(entry.getKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save Keybindings
|
// Save Keybindings
|
||||||
for (Map.Entry<String, String> entry : tempKeyBindings.entrySet()) {
|
for (Map.Entry<String, String> entry : tempKeyBindings.entrySet()) {
|
||||||
org.pubvm.j3270.config.Settings.setKeyBinding(entry.getKey(), entry.getValue());
|
haus.nightmare.j3270.config.Settings.setKeyBinding(entry.getKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
parentApp.getTerminalPanel().reloadSettings();
|
parentApp.getTerminalPanel().reloadSettings();
|
||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
package org.pubvm.j3270.ui;
|
package haus.nightmare.j3270.ui;
|
||||||
|
|
||||||
import org.lib3270j.ConnectionState;
|
import haus.nightmare.lib3270j.ConnectionState;
|
||||||
import org.lib3270j.Telnet3270Client;
|
import haus.nightmare.lib3270j.Telnet3270Client;
|
||||||
import org.lib3270j.screen.ScreenBuffer;
|
import haus.nightmare.lib3270j.screen.ScreenBuffer;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
+33
-33
@@ -1,16 +1,16 @@
|
|||||||
package org.pubvm.j3270.ui;
|
package haus.nightmare.j3270.ui;
|
||||||
|
|
||||||
import org.lib3270j.Telnet3270Client;
|
import haus.nightmare.lib3270j.Telnet3270Client;
|
||||||
import org.lib3270j.graphics.GocaConstants;
|
import haus.nightmare.lib3270j.graphics.GocaConstants;
|
||||||
import org.lib3270j.screen.ExtendedAttribute;
|
import haus.nightmare.lib3270j.screen.ExtendedAttribute;
|
||||||
import org.lib3270j.screen.ScreenBuffer;
|
import haus.nightmare.lib3270j.screen.ScreenBuffer;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.datatransfer.*;
|
import java.awt.datatransfer.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
|
|
||||||
import static org.lib3270j.protocol.DS3270Constants.*;
|
import static haus.nightmare.lib3270j.protocol.DS3270Constants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom JPanel that renders the 3270 screen buffer.
|
* Custom JPanel that renders the 3270 screen buffer.
|
||||||
@@ -135,7 +135,7 @@ public class TerminalPanel extends JPanel {
|
|||||||
setupFont();
|
setupFont();
|
||||||
setupCursorBlink();
|
setupCursorBlink();
|
||||||
|
|
||||||
blockSelectMode = org.pubvm.j3270.config.Settings.getBlockSelectMode();
|
blockSelectMode = haus.nightmare.j3270.config.Settings.getBlockSelectMode();
|
||||||
|
|
||||||
// Handle mouse clicks to position cursor, selection, and grab focus
|
// Handle mouse clicks to position cursor, selection, and grab focus
|
||||||
MouseAdapter mouseHandler = new MouseAdapter() {
|
MouseAdapter mouseHandler = new MouseAdapter() {
|
||||||
@@ -266,7 +266,7 @@ public class TerminalPanel extends JPanel {
|
|||||||
));
|
));
|
||||||
|
|
||||||
client.getInputProcessor().sendGraphicMouseAid(
|
client.getInputProcessor().sendGraphicMouseAid(
|
||||||
org.lib3270j.protocol.DS3270Constants.AID_ENTER,
|
haus.nightmare.lib3270j.protocol.DS3270Constants.AID_ENTER,
|
||||||
button,
|
button,
|
||||||
e.isShiftDown(),
|
e.isShiftDown(),
|
||||||
e.isControlDown()
|
e.isControlDown()
|
||||||
@@ -438,7 +438,7 @@ public class TerminalPanel extends JPanel {
|
|||||||
JCheckBoxMenuItem blockModeItem = new JCheckBoxMenuItem("Block Select Mode", blockSelectMode);
|
JCheckBoxMenuItem blockModeItem = new JCheckBoxMenuItem("Block Select Mode", blockSelectMode);
|
||||||
blockModeItem.addActionListener(ev -> {
|
blockModeItem.addActionListener(ev -> {
|
||||||
blockSelectMode = blockModeItem.isSelected();
|
blockSelectMode = blockModeItem.isSelected();
|
||||||
org.pubvm.j3270.config.Settings.setBlockSelectMode(blockSelectMode);
|
haus.nightmare.j3270.config.Settings.setBlockSelectMode(blockSelectMode);
|
||||||
});
|
});
|
||||||
popup.add(blockModeItem);
|
popup.add(blockModeItem);
|
||||||
|
|
||||||
@@ -516,7 +516,7 @@ public class TerminalPanel extends JPanel {
|
|||||||
|
|
||||||
if (bestSize != currentFontSize) {
|
if (bestSize != currentFontSize) {
|
||||||
currentFontSize = bestSize;
|
currentFontSize = bestSize;
|
||||||
org.pubvm.j3270.config.Settings.setFontSize(bestSize);
|
haus.nightmare.j3270.config.Settings.setFontSize(bestSize);
|
||||||
terminalFont = new Font(terminalFont.getFamily(), Font.PLAIN, bestSize);
|
terminalFont = new Font(terminalFont.getFamily(), Font.PLAIN, bestSize);
|
||||||
updateCellSize();
|
updateCellSize();
|
||||||
}
|
}
|
||||||
@@ -573,7 +573,7 @@ public class TerminalPanel extends JPanel {
|
|||||||
"PAGE_UP", "PAGE_DOWN", "HOME", "END", "ENTER",
|
"PAGE_UP", "PAGE_DOWN", "HOME", "END", "ENTER",
|
||||||
"ESCAPE", "INSERT", "DELETE", "BACK_SPACE" };
|
"ESCAPE", "INSERT", "DELETE", "BACK_SPACE" };
|
||||||
for (String key : navKeys) {
|
for (String key : navKeys) {
|
||||||
String binding = org.pubvm.j3270.config.Settings.getKeyBinding(key, key);
|
String binding = haus.nightmare.j3270.config.Settings.getKeyBinding(key, key);
|
||||||
bindKeyToMap(im, key, binding);
|
bindKeyToMap(im, key, binding);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -586,7 +586,7 @@ public class TerminalPanel extends JPanel {
|
|||||||
} else {
|
} else {
|
||||||
defaultBinding = "shift F" + (i - 12);
|
defaultBinding = "shift F" + (i - 12);
|
||||||
}
|
}
|
||||||
String binding = org.pubvm.j3270.config.Settings.getKeyBinding("PF" + i, defaultBinding);
|
String binding = haus.nightmare.j3270.config.Settings.getKeyBinding("PF" + i, defaultBinding);
|
||||||
bindKeyToMap(im, "PF" + i, binding);
|
bindKeyToMap(im, "PF" + i, binding);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -594,20 +594,20 @@ public class TerminalPanel extends JPanel {
|
|||||||
String pa1Def = "alt 1";
|
String pa1Def = "alt 1";
|
||||||
String pa2Def = "alt 2";
|
String pa2Def = "alt 2";
|
||||||
String pa3Def = "alt 3";
|
String pa3Def = "alt 3";
|
||||||
bindKeyToMap(im, "PA1", org.pubvm.j3270.config.Settings.getKeyBinding("PA1", pa1Def));
|
bindKeyToMap(im, "PA1", haus.nightmare.j3270.config.Settings.getKeyBinding("PA1", pa1Def));
|
||||||
bindKeyToMap(im, "PA2", org.pubvm.j3270.config.Settings.getKeyBinding("PA2", pa2Def));
|
bindKeyToMap(im, "PA2", haus.nightmare.j3270.config.Settings.getKeyBinding("PA2", pa2Def));
|
||||||
bindKeyToMap(im, "PA3", org.pubvm.j3270.config.Settings.getKeyBinding("PA3", pa3Def));
|
bindKeyToMap(im, "PA3", haus.nightmare.j3270.config.Settings.getKeyBinding("PA3", pa3Def));
|
||||||
|
|
||||||
// Clear
|
// Clear
|
||||||
bindKeyToMap(im, "CLEAR", org.pubvm.j3270.config.Settings.getKeyBinding("CLEAR", "alt C"));
|
bindKeyToMap(im, "CLEAR", haus.nightmare.j3270.config.Settings.getKeyBinding("CLEAR", "alt C"));
|
||||||
|
|
||||||
// Extended 3270 functions
|
// Extended 3270 functions
|
||||||
bindKeyToMap(im, "ERASE_INPUT", org.pubvm.j3270.config.Settings.getKeyBinding("ERASE_INPUT", "alt E"));
|
bindKeyToMap(im, "ERASE_INPUT", haus.nightmare.j3270.config.Settings.getKeyBinding("ERASE_INPUT", "alt E"));
|
||||||
bindKeyToMap(im, "NEWLINE", org.pubvm.j3270.config.Settings.getKeyBinding("NEWLINE", "shift ENTER"));
|
bindKeyToMap(im, "NEWLINE", haus.nightmare.j3270.config.Settings.getKeyBinding("NEWLINE", "shift ENTER"));
|
||||||
bindKeyToMap(im, "DUP", org.pubvm.j3270.config.Settings.getKeyBinding("DUP", "alt D"));
|
bindKeyToMap(im, "DUP", haus.nightmare.j3270.config.Settings.getKeyBinding("DUP", "alt D"));
|
||||||
bindKeyToMap(im, "FIELD_MARK", org.pubvm.j3270.config.Settings.getKeyBinding("FIELD_MARK", "alt M"));
|
bindKeyToMap(im, "FIELD_MARK", haus.nightmare.j3270.config.Settings.getKeyBinding("FIELD_MARK", "alt M"));
|
||||||
bindKeyToMap(im, "ATTN", org.pubvm.j3270.config.Settings.getKeyBinding("ATTN", "alt A"));
|
bindKeyToMap(im, "ATTN", haus.nightmare.j3270.config.Settings.getKeyBinding("ATTN", "alt A"));
|
||||||
bindKeyToMap(im, "SYSREQ", org.pubvm.j3270.config.Settings.getKeyBinding("SYSREQ", "alt S"));
|
bindKeyToMap(im, "SYSREQ", haus.nightmare.j3270.config.Settings.getKeyBinding("SYSREQ", "alt S"));
|
||||||
|
|
||||||
// Copy/Paste bindings — Cmd+C / Cmd+V (macOS) or Ctrl+C / Ctrl+V (others)
|
// Copy/Paste bindings — Cmd+C / Cmd+V (macOS) or Ctrl+C / Ctrl+V (others)
|
||||||
int shortcutMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx();
|
int shortcutMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx();
|
||||||
@@ -841,8 +841,8 @@ public class TerminalPanel extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setupFont() {
|
private void setupFont() {
|
||||||
currentFontSize = org.pubvm.j3270.config.Settings.getFontSize();
|
currentFontSize = haus.nightmare.j3270.config.Settings.getFontSize();
|
||||||
String fontFamily = org.pubvm.j3270.config.Settings.getFontFamily();
|
String fontFamily = haus.nightmare.j3270.config.Settings.getFontFamily();
|
||||||
|
|
||||||
terminalFont = new Font(fontFamily, Font.PLAIN, currentFontSize);
|
terminalFont = new Font(fontFamily, Font.PLAIN, currentFontSize);
|
||||||
if (terminalFont.getFamily().equals("Dialog") && !fontFamily.equals("Dialog")) {
|
if (terminalFont.getFamily().equals("Dialog") && !fontFamily.equals("Dialog")) {
|
||||||
@@ -854,13 +854,13 @@ public class TerminalPanel extends JPanel {
|
|||||||
|
|
||||||
private void setupColors() {
|
private void setupColors() {
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
hostColors[i] = org.pubvm.j3270.config.Settings.getColorOverride(i, DEFAULT_HOST_COLORS[i]);
|
hostColors[i] = haus.nightmare.j3270.config.Settings.getColorOverride(i, DEFAULT_HOST_COLORS[i]);
|
||||||
}
|
}
|
||||||
monoNormal = org.pubvm.j3270.config.Settings.getMonoColorOverride("NORMAL", DEFAULT_MONO_NORMAL);
|
monoNormal = haus.nightmare.j3270.config.Settings.getMonoColorOverride("NORMAL", DEFAULT_MONO_NORMAL);
|
||||||
monoIntensify = org.pubvm.j3270.config.Settings.getMonoColorOverride("INTENSIFY", DEFAULT_MONO_INTENSIFY);
|
monoIntensify = haus.nightmare.j3270.config.Settings.getMonoColorOverride("INTENSIFY", DEFAULT_MONO_INTENSIFY);
|
||||||
monoProtected = org.pubvm.j3270.config.Settings.getMonoColorOverride("PROTECTED", DEFAULT_MONO_PROTECTED);
|
monoProtected = haus.nightmare.j3270.config.Settings.getMonoColorOverride("PROTECTED", DEFAULT_MONO_PROTECTED);
|
||||||
monoProtectedHigh = org.pubvm.j3270.config.Settings.getMonoColorOverride("PROTECTED_HIGH", DEFAULT_MONO_PROTECTED_HIGH);
|
monoProtectedHigh = haus.nightmare.j3270.config.Settings.getMonoColorOverride("PROTECTED_HIGH", DEFAULT_MONO_PROTECTED_HIGH);
|
||||||
bgColor = org.pubvm.j3270.config.Settings.getMonoColorOverride("BACKGROUND", DEFAULT_BG_COLOR);
|
bgColor = haus.nightmare.j3270.config.Settings.getMonoColorOverride("BACKGROUND", DEFAULT_BG_COLOR);
|
||||||
setBackground(bgColor);
|
setBackground(bgColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -868,14 +868,14 @@ public class TerminalPanel extends JPanel {
|
|||||||
setupColors();
|
setupColors();
|
||||||
setupKeyBindings();
|
setupKeyBindings();
|
||||||
setupFont();
|
setupFont();
|
||||||
blockSelectMode = org.pubvm.j3270.config.Settings.getBlockSelectMode();
|
blockSelectMode = haus.nightmare.j3270.config.Settings.getBlockSelectMode();
|
||||||
revalidate();
|
revalidate();
|
||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFontSize(int size) {
|
public void setFontSize(int size) {
|
||||||
currentFontSize = size;
|
currentFontSize = size;
|
||||||
org.pubvm.j3270.config.Settings.setFontSize(size);
|
haus.nightmare.j3270.config.Settings.setFontSize(size);
|
||||||
terminalFont = terminalFont.deriveFont((float) size);
|
terminalFont = terminalFont.deriveFont((float) size);
|
||||||
updateCellSize();
|
updateCellSize();
|
||||||
resizeGuard = true;
|
resizeGuard = true;
|
||||||
@@ -1120,7 +1120,7 @@ public class TerminalPanel extends JPanel {
|
|||||||
int cs = (ea.cs != 0) ? (ea.cs & 0xFF) : (currentFieldEa != null ? (currentFieldEa.cs & 0xFF) : 0);
|
int cs = (ea.cs != 0) ? (ea.cs & 0xFF) : (currentFieldEa != null ? (currentFieldEa.cs & 0xFF) : 0);
|
||||||
boolean drawnAsPs = false;
|
boolean drawnAsPs = false;
|
||||||
if (cs >= 0x40 && client.getProgramSymbolManager() != null) {
|
if (cs >= 0x40 && client.getProgramSymbolManager() != null) {
|
||||||
org.lib3270j.graphics.ProgramSymbolSet.SymbolSlot slot = client.getProgramSymbolManager().getSymbol(cs, ea.ec & 0xFF);
|
haus.nightmare.lib3270j.graphics.ProgramSymbolSet.SymbolSlot slot = client.getProgramSymbolManager().getSymbol(cs, ea.ec & 0xFF);
|
||||||
if (slot != null) {
|
if (slot != null) {
|
||||||
int symBg = (!bgColor.equals(this.bgColor) || reverse) ? bgColor.getRGB() : 0;
|
int symBg = (!bgColor.equals(this.bgColor) || reverse) ? bgColor.getRGB() : 0;
|
||||||
java.awt.image.BufferedImage img = slot.getScaledImage(cellWidth, cellHeight, fgColor.getRGB(), symBg);
|
java.awt.image.BufferedImage img = slot.getScaledImage(cellWidth, cellHeight, fgColor.getRGB(), symBg);
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.pubvm.j3270.ui;
|
package haus.nightmare.j3270.ui;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
+8
-8
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j;
|
package haus.nightmare.lib3270j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration for a 3270 terminal connection.
|
* Configuration for a 3270 terminal connection.
|
||||||
@@ -12,13 +12,13 @@ public class ConnectionConfig {
|
|||||||
private boolean extendedDataStream = true;
|
private boolean extendedDataStream = true;
|
||||||
private boolean useTls = false;
|
private boolean useTls = false;
|
||||||
private boolean tlsVerifyCert = true;
|
private boolean tlsVerifyCert = true;
|
||||||
private org.lib3270j.tls.TlsCertificateVerifier certificateVerifier = null;
|
private haus.nightmare.lib3270j.tls.TlsCertificateVerifier certificateVerifier = null;
|
||||||
private String sslProtocol = "TLS";
|
private String sslProtocol = "TLS";
|
||||||
private int connectTimeoutMs = 15000;
|
private int connectTimeoutMs = 15000;
|
||||||
private int nopIntervalSeconds = 0;
|
private int nopIntervalSeconds = 0;
|
||||||
private String terminalName = null; // override terminal type string
|
private String terminalName = null; // override terminal type string
|
||||||
private boolean tn3270eEnabled = true;
|
private boolean tn3270eEnabled = true;
|
||||||
private org.lib3270j.graphics.GraphicsMode graphicsMode = org.lib3270j.graphics.GraphicsMode.BOTH;
|
private haus.nightmare.lib3270j.graphics.GraphicsMode graphicsMode = haus.nightmare.lib3270j.graphics.GraphicsMode.BOTH;
|
||||||
|
|
||||||
public ConnectionConfig() {}
|
public ConnectionConfig() {}
|
||||||
|
|
||||||
@@ -70,8 +70,8 @@ public class ConnectionConfig {
|
|||||||
public boolean isTn3270eEnabled() { return tn3270eEnabled; }
|
public boolean isTn3270eEnabled() { return tn3270eEnabled; }
|
||||||
public void setTn3270eEnabled(boolean enabled) { this.tn3270eEnabled = enabled; }
|
public void setTn3270eEnabled(boolean enabled) { this.tn3270eEnabled = enabled; }
|
||||||
|
|
||||||
public org.lib3270j.tls.TlsCertificateVerifier getCertificateVerifier() { return certificateVerifier; }
|
public haus.nightmare.lib3270j.tls.TlsCertificateVerifier getCertificateVerifier() { return certificateVerifier; }
|
||||||
public void setCertificateVerifier(org.lib3270j.tls.TlsCertificateVerifier verifier) { this.certificateVerifier = verifier; }
|
public void setCertificateVerifier(haus.nightmare.lib3270j.tls.TlsCertificateVerifier verifier) { this.certificateVerifier = verifier; }
|
||||||
|
|
||||||
public String getSslProtocol() { return sslProtocol; }
|
public String getSslProtocol() { return sslProtocol; }
|
||||||
public void setSslProtocol(String protocol) { this.sslProtocol = protocol; }
|
public void setSslProtocol(String protocol) { this.sslProtocol = protocol; }
|
||||||
@@ -82,9 +82,9 @@ public class ConnectionConfig {
|
|||||||
public int getNopIntervalSeconds() { return nopIntervalSeconds; }
|
public int getNopIntervalSeconds() { return nopIntervalSeconds; }
|
||||||
public void setNopIntervalSeconds(int s) { this.nopIntervalSeconds = s; }
|
public void setNopIntervalSeconds(int s) { this.nopIntervalSeconds = s; }
|
||||||
|
|
||||||
public org.lib3270j.graphics.GraphicsMode getGraphicsMode() { return graphicsMode; }
|
public haus.nightmare.lib3270j.graphics.GraphicsMode getGraphicsMode() { return graphicsMode; }
|
||||||
public void setGraphicsMode(org.lib3270j.graphics.GraphicsMode mode) {
|
public void setGraphicsMode(haus.nightmare.lib3270j.graphics.GraphicsMode mode) {
|
||||||
this.graphicsMode = (mode != null) ? mode : org.lib3270j.graphics.GraphicsMode.NONE;
|
this.graphicsMode = (mode != null) ? mode : haus.nightmare.lib3270j.graphics.GraphicsMode.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTerminalName() { return terminalName; }
|
public String getTerminalName() { return terminalName; }
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j;
|
package haus.nightmare.lib3270j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connection state machine states.
|
* Connection state machine states.
|
||||||
+5
-5
@@ -1,8 +1,8 @@
|
|||||||
package org.lib3270j;
|
package haus.nightmare.lib3270j;
|
||||||
|
|
||||||
import org.lib3270j.screen.ScreenBuffer;
|
import haus.nightmare.lib3270j.screen.ScreenBuffer;
|
||||||
import org.lib3270j.screen.ExtendedAttribute;
|
import haus.nightmare.lib3270j.screen.ExtendedAttribute;
|
||||||
import org.lib3270j.listener.*;
|
import haus.nightmare.lib3270j.listener.*;
|
||||||
|
|
||||||
import java.util.logging.*;
|
import java.util.logging.*;
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ public class DiagnosticClient {
|
|||||||
static Telnet3270Client client;
|
static Telnet3270Client client;
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
Logger rootLogger = Logger.getLogger("org.lib3270j");
|
Logger rootLogger = Logger.getLogger("haus.nightmare.lib3270j");
|
||||||
rootLogger.setLevel(Level.ALL);
|
rootLogger.setLevel(Level.ALL);
|
||||||
Handler handler = new ConsoleHandler();
|
Handler handler = new ConsoleHandler();
|
||||||
handler.setLevel(Level.ALL);
|
handler.setLevel(Level.ALL);
|
||||||
+15
-15
@@ -1,13 +1,13 @@
|
|||||||
package org.lib3270j;
|
package haus.nightmare.lib3270j;
|
||||||
|
|
||||||
import org.lib3270j.charset.EbcdicTranslator;
|
import haus.nightmare.lib3270j.charset.EbcdicTranslator;
|
||||||
import org.lib3270j.datastream.DataStreamProcessor;
|
import haus.nightmare.lib3270j.datastream.DataStreamProcessor;
|
||||||
import org.lib3270j.input.InputProcessor;
|
import haus.nightmare.lib3270j.input.InputProcessor;
|
||||||
import org.lib3270j.listener.ConnectionListener;
|
import haus.nightmare.lib3270j.listener.ConnectionListener;
|
||||||
import org.lib3270j.listener.ScreenUpdateListener;
|
import haus.nightmare.lib3270j.listener.ScreenUpdateListener;
|
||||||
import org.lib3270j.screen.ScreenBuffer;
|
import haus.nightmare.lib3270j.screen.ScreenBuffer;
|
||||||
import org.lib3270j.telnet.TelnetConnection;
|
import haus.nightmare.lib3270j.telnet.TelnetConnection;
|
||||||
import org.lib3270j.telnet.TelnetFSM;
|
import haus.nightmare.lib3270j.telnet.TelnetFSM;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
@@ -126,7 +126,7 @@ public class Telnet3270Client {
|
|||||||
public ConnectionConfig getConfig() { return config; }
|
public ConnectionConfig getConfig() { return config; }
|
||||||
|
|
||||||
/** Set a custom or interactive TLS certificate verifier callback. */
|
/** Set a custom or interactive TLS certificate verifier callback. */
|
||||||
public void setTlsCertificateVerifier(org.lib3270j.tls.TlsCertificateVerifier verifier) {
|
public void setTlsCertificateVerifier(haus.nightmare.lib3270j.tls.TlsCertificateVerifier verifier) {
|
||||||
config.setCertificateVerifier(verifier);
|
config.setCertificateVerifier(verifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ public class Telnet3270Client {
|
|||||||
|
|
||||||
/** Send Enter key. */
|
/** Send Enter key. */
|
||||||
public void sendEnter() {
|
public void sendEnter() {
|
||||||
inputProcessor.sendAid(org.lib3270j.protocol.DS3270Constants.AID_ENTER);
|
inputProcessor.sendAid(haus.nightmare.lib3270j.protocol.DS3270Constants.AID_ENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Send a PF key (1-24). */
|
/** Send a PF key (1-24). */
|
||||||
@@ -192,7 +192,7 @@ public class Telnet3270Client {
|
|||||||
|
|
||||||
/** Send Clear key. */
|
/** Send Clear key. */
|
||||||
public void sendClear() {
|
public void sendClear() {
|
||||||
inputProcessor.sendAid(org.lib3270j.protocol.DS3270Constants.AID_CLEAR);
|
inputProcessor.sendAid(haus.nightmare.lib3270j.protocol.DS3270Constants.AID_CLEAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Move cursor up. */
|
/** Move cursor up. */
|
||||||
@@ -224,15 +224,15 @@ public class Telnet3270Client {
|
|||||||
/** Reset (unlock keyboard). */
|
/** Reset (unlock keyboard). */
|
||||||
public void reset() { inputProcessor.reset(); }
|
public void reset() { inputProcessor.reset(); }
|
||||||
|
|
||||||
public org.lib3270j.graphics.ProgramSymbolManager getProgramSymbolManager() {
|
public haus.nightmare.lib3270j.graphics.ProgramSymbolManager getProgramSymbolManager() {
|
||||||
return dsProcessor.getProgramSymbolManager();
|
return dsProcessor.getProgramSymbolManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
public org.lib3270j.graphics.GraphicsPlane getGraphicsPlane() {
|
public haus.nightmare.lib3270j.graphics.GraphicsPlane getGraphicsPlane() {
|
||||||
return dsProcessor.getGraphicsPlane();
|
return dsProcessor.getGraphicsPlane();
|
||||||
}
|
}
|
||||||
|
|
||||||
public org.lib3270j.graphics.GocaDecoder getGocaDecoder() {
|
public haus.nightmare.lib3270j.graphics.GocaDecoder getGocaDecoder() {
|
||||||
return dsProcessor.getGocaDecoder();
|
return dsProcessor.getGocaDecoder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package org.lib3270j;
|
package haus.nightmare.lib3270j;
|
||||||
|
|
||||||
import static org.lib3270j.protocol.DS3270Constants.*;
|
import static haus.nightmare.lib3270j.protocol.DS3270Constants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Terminal model definitions for IBM 3278 and 3279 terminals.
|
* Terminal model definitions for IBM 3278 and 3279 terminals.
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.charset;
|
package haus.nightmare.lib3270j.charset;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EBCDIC ↔ Unicode translator.
|
* EBCDIC ↔ Unicode translator.
|
||||||
+29
-29
@@ -1,10 +1,10 @@
|
|||||||
package org.lib3270j.datastream;
|
package haus.nightmare.lib3270j.datastream;
|
||||||
|
|
||||||
import org.lib3270j.screen.ScreenBuffer;
|
import haus.nightmare.lib3270j.screen.ScreenBuffer;
|
||||||
import org.lib3270j.screen.ExtendedAttribute;
|
import haus.nightmare.lib3270j.screen.ExtendedAttribute;
|
||||||
import org.lib3270j.charset.EbcdicTranslator;
|
import haus.nightmare.lib3270j.charset.EbcdicTranslator;
|
||||||
import org.lib3270j.listener.ScreenUpdateListener;
|
import haus.nightmare.lib3270j.listener.ScreenUpdateListener;
|
||||||
import static org.lib3270j.protocol.DS3270Constants.*;
|
import static haus.nightmare.lib3270j.protocol.DS3270Constants.*;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -34,15 +34,15 @@ public class DataStreamProcessor {
|
|||||||
private OutputSender outputSender;
|
private OutputSender outputSender;
|
||||||
|
|
||||||
// File Transfer DFT handler
|
// File Transfer DFT handler
|
||||||
private org.lib3270j.ft.FTDft ftDft;
|
private haus.nightmare.lib3270j.ft.FTDft ftDft;
|
||||||
|
|
||||||
// Input processor reference to manage keyboard locking state
|
// Input processor reference to manage keyboard locking state
|
||||||
private org.lib3270j.input.InputProcessor inputProcessor;
|
private haus.nightmare.lib3270j.input.InputProcessor inputProcessor;
|
||||||
|
|
||||||
// Graphics & Programmed Symbols
|
// Graphics & Programmed Symbols
|
||||||
private final org.lib3270j.graphics.ProgramSymbolManager programSymbolManager = new org.lib3270j.graphics.ProgramSymbolManager();
|
private final haus.nightmare.lib3270j.graphics.ProgramSymbolManager programSymbolManager = new haus.nightmare.lib3270j.graphics.ProgramSymbolManager();
|
||||||
private final org.lib3270j.graphics.GraphicsPlane graphicsPlane = new org.lib3270j.graphics.GraphicsPlane(800, 600);
|
private final haus.nightmare.lib3270j.graphics.GraphicsPlane graphicsPlane = new haus.nightmare.lib3270j.graphics.GraphicsPlane(800, 600);
|
||||||
private final org.lib3270j.graphics.GocaDecoder gocaDecoder = new org.lib3270j.graphics.GocaDecoder(graphicsPlane);
|
private final haus.nightmare.lib3270j.graphics.GocaDecoder gocaDecoder = new haus.nightmare.lib3270j.graphics.GocaDecoder(graphicsPlane);
|
||||||
private final java.io.ByteArrayOutputStream gocaAccumulator = new java.io.ByteArrayOutputStream();
|
private final java.io.ByteArrayOutputStream gocaAccumulator = new java.io.ByteArrayOutputStream();
|
||||||
private int currentGocaSubtype = 0;
|
private int currentGocaSubtype = 0;
|
||||||
|
|
||||||
@@ -65,15 +65,15 @@ public class DataStreamProcessor {
|
|||||||
return qrBuilder;
|
return qrBuilder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public org.lib3270j.graphics.ProgramSymbolManager getProgramSymbolManager() {
|
public haus.nightmare.lib3270j.graphics.ProgramSymbolManager getProgramSymbolManager() {
|
||||||
return programSymbolManager;
|
return programSymbolManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public org.lib3270j.graphics.GraphicsPlane getGraphicsPlane() {
|
public haus.nightmare.lib3270j.graphics.GraphicsPlane getGraphicsPlane() {
|
||||||
return graphicsPlane;
|
return graphicsPlane;
|
||||||
}
|
}
|
||||||
|
|
||||||
public org.lib3270j.graphics.GocaDecoder getGocaDecoder() {
|
public haus.nightmare.lib3270j.graphics.GocaDecoder getGocaDecoder() {
|
||||||
return gocaDecoder;
|
return gocaDecoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,15 +81,15 @@ public class DataStreamProcessor {
|
|||||||
this.outputSender = sender;
|
this.outputSender = sender;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFTDft(org.lib3270j.ft.FTDft ftDft) {
|
public void setFTDft(haus.nightmare.lib3270j.ft.FTDft ftDft) {
|
||||||
this.ftDft = ftDft;
|
this.ftDft = ftDft;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInputProcessor(org.lib3270j.input.InputProcessor inputProcessor) {
|
public void setInputProcessor(haus.nightmare.lib3270j.input.InputProcessor inputProcessor) {
|
||||||
this.inputProcessor = inputProcessor;
|
this.inputProcessor = inputProcessor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public org.lib3270j.input.InputProcessor getInputProcessor() {
|
public haus.nightmare.lib3270j.input.InputProcessor getInputProcessor() {
|
||||||
return inputProcessor;
|
return inputProcessor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@ public class DataStreamProcessor {
|
|||||||
ExtendedAttribute ea = screen.getCell(addr);
|
ExtendedAttribute ea = screen.getCell(addr);
|
||||||
byte fa = screen.getFieldAttributeAt(addr);
|
byte fa = screen.getFieldAttributeAt(addr);
|
||||||
|
|
||||||
if ((fa & org.lib3270j.protocol.DS3270Constants.FA_MASK) == org.lib3270j.protocol.DS3270Constants.FA_INT_ZERO_NSEL) {
|
if ((fa & haus.nightmare.lib3270j.protocol.DS3270Constants.FA_MASK) == haus.nightmare.lib3270j.protocol.DS3270Constants.FA_INT_ZERO_NSEL) {
|
||||||
if (ea.ucs4 > 0x20 && ea.ucs4 != 0xFF) {
|
if (ea.ucs4 > 0x20 && ea.ucs4 != 0xFF) {
|
||||||
line.append('*');
|
line.append('*');
|
||||||
hasContent = true;
|
hasContent = true;
|
||||||
@@ -813,27 +813,27 @@ public class DataStreamProcessor {
|
|||||||
log.fine("SF_TRANSFER_DATA received but ftDft is null");
|
log.fine("SF_TRANSFER_DATA received but ftDft is null");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case org.lib3270j.graphics.GocaConstants.SF_LOADPS_DIRECT: // 0x06: Load Programmed Symbols direct
|
case haus.nightmare.lib3270j.graphics.GocaConstants.SF_LOADPS_DIRECT: // 0x06: Load Programmed Symbols direct
|
||||||
if (fieldLen > 3) {
|
if (fieldLen > 3) {
|
||||||
byte[] psData = new byte[fieldLen - 3];
|
byte[] psData = new byte[fieldLen - 3];
|
||||||
System.arraycopy(data, pos + 3, psData, 0, psData.length);
|
System.arraycopy(data, pos + 3, psData, 0, psData.length);
|
||||||
programSymbolManager.loadps(psData);
|
programSymbolManager.loadps(psData);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case org.lib3270j.graphics.GocaConstants.SF_LOADPS: { // 0x0F: 2-byte Structured Field prefix
|
case haus.nightmare.lib3270j.graphics.GocaConstants.SF_LOADPS: { // 0x0F: 2-byte Structured Field prefix
|
||||||
if (fieldLen >= 4) {
|
if (fieldLen >= 4) {
|
||||||
int sfSubId = data[pos + 3] & 0xFF;
|
int sfSubId = data[pos + 3] & 0xFF;
|
||||||
switch (sfSubId) {
|
switch (sfSubId) {
|
||||||
case org.lib3270j.graphics.GocaConstants.SF_LOADPS_SUB: // 0x06: Load Programmed Symbols
|
case haus.nightmare.lib3270j.graphics.GocaConstants.SF_LOADPS_SUB: // 0x06: Load Programmed Symbols
|
||||||
if (fieldLen > 4) {
|
if (fieldLen > 4) {
|
||||||
byte[] psData = new byte[fieldLen - 4];
|
byte[] psData = new byte[fieldLen - 4];
|
||||||
System.arraycopy(data, pos + 4, psData, 0, psData.length);
|
System.arraycopy(data, pos + 4, psData, 0, psData.length);
|
||||||
programSymbolManager.loadps(psData);
|
programSymbolManager.loadps(psData);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case org.lib3270j.graphics.GocaConstants.SF_OBJCNTL_SUB: // 0x11: Object Control (Procedure orders)
|
case haus.nightmare.lib3270j.graphics.GocaConstants.SF_OBJCNTL_SUB: // 0x11: Object Control (Procedure orders)
|
||||||
case org.lib3270j.graphics.GocaConstants.SF_OBJPICT_SUB: // 0x10: Object Picture (Picture segments)
|
case haus.nightmare.lib3270j.graphics.GocaConstants.SF_OBJPICT_SUB: // 0x10: Object Picture (Picture segments)
|
||||||
case org.lib3270j.graphics.GocaConstants.SF_OBJDATA_SUB: { // 0x0F: Object Data (GOCA draw orders)
|
case haus.nightmare.lib3270j.graphics.GocaConstants.SF_OBJDATA_SUB: { // 0x0F: Object Data (GOCA draw orders)
|
||||||
int flags = (fieldLen >= 6) ? (data[pos + 5] & 0xC0) : 0xC0;
|
int flags = (fieldLen >= 6) ? (data[pos + 5] & 0xC0) : 0xC0;
|
||||||
int orderOffset = (fieldLen >= 7) ? (pos + 7) : (pos + 4);
|
int orderOffset = (fieldLen >= 7) ? (pos + 7) : (pos + 4);
|
||||||
int orderLen = Math.max(0, fieldLen - (orderOffset - pos));
|
int orderLen = Math.max(0, fieldLen - (orderOffset - pos));
|
||||||
@@ -856,7 +856,7 @@ public class DataStreamProcessor {
|
|||||||
}
|
}
|
||||||
byte[] fullStream = gocaAccumulator.toByteArray();
|
byte[] fullStream = gocaAccumulator.toByteArray();
|
||||||
gocaAccumulator.reset();
|
gocaAccumulator.reset();
|
||||||
if (currentGocaSubtype == org.lib3270j.graphics.GocaConstants.SF_OBJCNTL_SUB) {
|
if (currentGocaSubtype == haus.nightmare.lib3270j.graphics.GocaConstants.SF_OBJCNTL_SUB) {
|
||||||
gocaDecoder.processProcedureOrders(fullStream, 0, fullStream.length);
|
gocaDecoder.processProcedureOrders(fullStream, 0, fullStream.length);
|
||||||
} else {
|
} else {
|
||||||
gocaDecoder.decodeStream(fullStream, 0, fullStream.length);
|
gocaDecoder.decodeStream(fullStream, 0, fullStream.length);
|
||||||
@@ -864,7 +864,7 @@ public class DataStreamProcessor {
|
|||||||
notifyScreenUpdated();
|
notifyScreenUpdated();
|
||||||
} else { // SPAN_ONLY (0xC0)
|
} else { // SPAN_ONLY (0xC0)
|
||||||
gocaAccumulator.reset();
|
gocaAccumulator.reset();
|
||||||
if (sfSubId == org.lib3270j.graphics.GocaConstants.SF_OBJCNTL_SUB) {
|
if (sfSubId == haus.nightmare.lib3270j.graphics.GocaConstants.SF_OBJCNTL_SUB) {
|
||||||
gocaDecoder.processProcedureOrders(data, orderOffset, orderLen);
|
gocaDecoder.processProcedureOrders(data, orderOffset, orderLen);
|
||||||
} else {
|
} else {
|
||||||
gocaDecoder.decodeStream(data, orderOffset, orderLen);
|
gocaDecoder.decodeStream(data, orderOffset, orderLen);
|
||||||
@@ -880,15 +880,15 @@ public class DataStreamProcessor {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case org.lib3270j.graphics.GocaConstants.SF_OBJCNTL: // 0x24: Object Control (Procedure orders)
|
case haus.nightmare.lib3270j.graphics.GocaConstants.SF_OBJCNTL: // 0x24: Object Control (Procedure orders)
|
||||||
if (fieldLen > 3) {
|
if (fieldLen > 3) {
|
||||||
graphicsPlane.setScreenDimensions(screen.getCols(), screen.getRows());
|
graphicsPlane.setScreenDimensions(screen.getCols(), screen.getRows());
|
||||||
gocaDecoder.processProcedureOrders(data, pos + 3, fieldLen - 3);
|
gocaDecoder.processProcedureOrders(data, pos + 3, fieldLen - 3);
|
||||||
notifyScreenUpdated();
|
notifyScreenUpdated();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case org.lib3270j.graphics.GocaConstants.SF_OBJDATA: // 0x85: Graphics Object Data / GOCA
|
case haus.nightmare.lib3270j.graphics.GocaConstants.SF_OBJDATA: // 0x85: Graphics Object Data / GOCA
|
||||||
case org.lib3270j.graphics.GocaConstants.SF_3270_G: // 0x20: 3270 Graphics
|
case haus.nightmare.lib3270j.graphics.GocaConstants.SF_3270_G: // 0x20: 3270 Graphics
|
||||||
if (fieldLen > 3) {
|
if (fieldLen > 3) {
|
||||||
graphicsPlane.setScreenDimensions(screen.getCols(), screen.getRows());
|
graphicsPlane.setScreenDimensions(screen.getCols(), screen.getRows());
|
||||||
gocaDecoder.decodeStream(data, pos + 3, fieldLen - 3);
|
gocaDecoder.decodeStream(data, pos + 3, fieldLen - 3);
|
||||||
+5
-5
@@ -1,11 +1,11 @@
|
|||||||
package org.lib3270j.datastream;
|
package haus.nightmare.lib3270j.datastream;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.lib3270j.graphics.GraphicsMode;
|
import haus.nightmare.lib3270j.graphics.GraphicsMode;
|
||||||
import org.lib3270j.screen.ScreenBuffer;
|
import haus.nightmare.lib3270j.screen.ScreenBuffer;
|
||||||
import static org.lib3270j.protocol.DS3270Constants.*;
|
import static haus.nightmare.lib3270j.protocol.DS3270Constants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds Query Reply structured fields in response to host Read Partition queries.
|
* Builds Query Reply structured fields in response to host Read Partition queries.
|
||||||
@@ -493,7 +493,7 @@ public class QueryReplyBuilder {
|
|||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
out.write(0x00);
|
out.write(0x00);
|
||||||
out.write(i);
|
out.write(i);
|
||||||
int argb = org.lib3270j.graphics.GocaConstants.GOCA_COLORS[i];
|
int argb = haus.nightmare.lib3270j.graphics.GocaConstants.GOCA_COLORS[i];
|
||||||
int r = (argb >> 16) & 0xFF;
|
int r = (argb >> 16) & 0xFF;
|
||||||
int g = (argb >> 8) & 0xFF;
|
int g = (argb >> 8) & 0xFF;
|
||||||
int b = argb & 0xFF;
|
int b = argb & 0xFF;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.ft;
|
package haus.nightmare.lib3270j.ft;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration for an IND$FILE file transfer session.
|
* Configuration for an IND$FILE file transfer session.
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.ft;
|
package haus.nightmare.lib3270j.ft;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constants for IND$FILE file transfer protocol.
|
* Constants for IND$FILE file transfer protocol.
|
||||||
@@ -183,7 +183,7 @@ public final class FTConstants {
|
|||||||
* Decode a CUT-mode base-64 encoded integer from EBCDIC.
|
* Decode a CUT-mode base-64 encoded integer from EBCDIC.
|
||||||
* Converts a table6-encoded EBCDIC character to its 6-bit value.
|
* Converts a table6-encoded EBCDIC character to its 6-bit value.
|
||||||
*/
|
*/
|
||||||
public static int from6(int ebcdicByte, org.lib3270j.charset.EbcdicTranslator translator) {
|
public static int from6(int ebcdicByte, haus.nightmare.lib3270j.charset.EbcdicTranslator translator) {
|
||||||
char ascii = translator.ebcdicToUnicode(ebcdicByte & 0xFF);
|
char ascii = translator.ebcdicToUnicode(ebcdicByte & 0xFF);
|
||||||
int idx = TABLE6.indexOf(ascii);
|
int idx = TABLE6.indexOf(ascii);
|
||||||
return idx >= 0 ? idx : 0;
|
return idx >= 0 ? idx : 0;
|
||||||
@@ -199,7 +199,7 @@ public final class FTConstants {
|
|||||||
/**
|
/**
|
||||||
* Encode a 6-bit value into a table6-encoded EBCDIC character.
|
* Encode a 6-bit value into a table6-encoded EBCDIC character.
|
||||||
*/
|
*/
|
||||||
public static int to6(int value, org.lib3270j.charset.EbcdicTranslator translator) {
|
public static int to6(int value, haus.nightmare.lib3270j.charset.EbcdicTranslator translator) {
|
||||||
char ascii = TABLE6.charAt(value & 0x3F);
|
char ascii = TABLE6.charAt(value & 0x3F);
|
||||||
int ebc = translator.unicodeToEbcdic(ascii);
|
int ebc = translator.unicodeToEbcdic(ascii);
|
||||||
return ebc >= 0 ? ebc : ASC2FT[ascii & 0xFF];
|
return ebc >= 0 ? ebc : ASC2FT[ascii & 0xFF];
|
||||||
+6
-6
@@ -1,10 +1,10 @@
|
|||||||
package org.lib3270j.ft;
|
package haus.nightmare.lib3270j.ft;
|
||||||
|
|
||||||
import org.lib3270j.screen.ScreenBuffer;
|
import haus.nightmare.lib3270j.screen.ScreenBuffer;
|
||||||
import org.lib3270j.input.InputProcessor;
|
import haus.nightmare.lib3270j.input.InputProcessor;
|
||||||
import org.lib3270j.charset.EbcdicTranslator;
|
import haus.nightmare.lib3270j.charset.EbcdicTranslator;
|
||||||
import static org.lib3270j.ft.FTConstants.*;
|
import static haus.nightmare.lib3270j.ft.FTConstants.*;
|
||||||
import static org.lib3270j.protocol.DS3270Constants.*;
|
import static haus.nightmare.lib3270j.protocol.DS3270Constants.*;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
package org.lib3270j.ft;
|
package haus.nightmare.lib3270j.ft;
|
||||||
|
|
||||||
import org.lib3270j.input.InputProcessor;
|
import haus.nightmare.lib3270j.input.InputProcessor;
|
||||||
import org.lib3270j.charset.EbcdicTranslator;
|
import haus.nightmare.lib3270j.charset.EbcdicTranslator;
|
||||||
import static org.lib3270j.ft.FTConstants.*;
|
import static haus.nightmare.lib3270j.ft.FTConstants.*;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.graphics;
|
package haus.nightmare.lib3270j.graphics;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constants for IBM 3179G / 3270-PC GOCA (Graphics Object Content Architecture)
|
* Constants for IBM 3179G / 3270-PC GOCA (Graphics Object Content Architecture)
|
||||||
+2
-2
@@ -1,10 +1,10 @@
|
|||||||
package org.lib3270j.graphics;
|
package haus.nightmare.lib3270j.graphics;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.lib3270j.charset.EbcdicTranslator;
|
import haus.nightmare.lib3270j.charset.EbcdicTranslator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interprets GOCA (Graphics Object Content Architecture) drawing orders
|
* Interprets GOCA (Graphics Object Content Architecture) drawing orders
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.graphics;
|
package haus.nightmare.lib3270j.graphics;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the 56-byte IBM 3179G / 3270G Graphic Input Structured Field.
|
* Builds the 56-byte IBM 3179G / 3270G Graphic Input Structured Field.
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.graphics;
|
package haus.nightmare.lib3270j.graphics;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Graphics modes supported by j3270 / lib3270j.
|
* Graphics modes supported by j3270 / lib3270j.
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.graphics;
|
package haus.nightmare.lib3270j.graphics;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.graphics;
|
package haus.nightmare.lib3270j.graphics;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.graphics;
|
package haus.nightmare.lib3270j.graphics;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a set of up to 191 custom bitmapped symbols (LCID 0x40 - 0xFE).
|
* Represents a set of up to 191 custom bitmapped symbols (LCID 0x40 - 0xFE).
|
||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Decompiled with CFR 0.152.
|
* Decompiled with CFR 0.152.
|
||||||
*/
|
*/
|
||||||
package org.lib3270j.graphics;
|
package haus.nightmare.lib3270j.graphics;
|
||||||
|
|
||||||
import org.lib3270j.graphics.GocaConstants;
|
import haus.nightmare.lib3270j.graphics.GocaConstants;
|
||||||
|
|
||||||
|
|
||||||
public final class VectorSymbolData {
|
public final class VectorSymbolData {
|
||||||
+23
-23
@@ -1,11 +1,11 @@
|
|||||||
package org.lib3270j.input;
|
package haus.nightmare.lib3270j.input;
|
||||||
|
|
||||||
import org.lib3270j.screen.ScreenBuffer;
|
import haus.nightmare.lib3270j.screen.ScreenBuffer;
|
||||||
import org.lib3270j.screen.ExtendedAttribute;
|
import haus.nightmare.lib3270j.screen.ExtendedAttribute;
|
||||||
import org.lib3270j.charset.EbcdicTranslator;
|
import haus.nightmare.lib3270j.charset.EbcdicTranslator;
|
||||||
import org.lib3270j.telnet.TelnetFSM;
|
import haus.nightmare.lib3270j.telnet.TelnetFSM;
|
||||||
import org.lib3270j.protocol.TelnetConstants;
|
import haus.nightmare.lib3270j.protocol.TelnetConstants;
|
||||||
import static org.lib3270j.protocol.DS3270Constants.*;
|
import static haus.nightmare.lib3270j.protocol.DS3270Constants.*;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
@@ -31,18 +31,18 @@ public class InputProcessor {
|
|||||||
this.fsm = fsm;
|
this.fsm = fsm;
|
||||||
}
|
}
|
||||||
|
|
||||||
private org.lib3270j.graphics.GraphicsPlane graphicsPlane;
|
private haus.nightmare.lib3270j.graphics.GraphicsPlane graphicsPlane;
|
||||||
private org.lib3270j.graphics.GocaDecoder gocaDecoder;
|
private haus.nightmare.lib3270j.graphics.GocaDecoder gocaDecoder;
|
||||||
|
|
||||||
public void setGraphicsPlane(org.lib3270j.graphics.GraphicsPlane gp) {
|
public void setGraphicsPlane(haus.nightmare.lib3270j.graphics.GraphicsPlane gp) {
|
||||||
this.graphicsPlane = gp;
|
this.graphicsPlane = gp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGocaDecoder(org.lib3270j.graphics.GocaDecoder gd) {
|
public void setGocaDecoder(haus.nightmare.lib3270j.graphics.GocaDecoder gd) {
|
||||||
this.gocaDecoder = gd;
|
this.gocaDecoder = gd;
|
||||||
}
|
}
|
||||||
|
|
||||||
public org.lib3270j.graphics.GocaDecoder getGocaDecoder() {
|
public haus.nightmare.lib3270j.graphics.GocaDecoder getGocaDecoder() {
|
||||||
return gocaDecoder;
|
return gocaDecoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ public class InputProcessor {
|
|||||||
int gy = gocaDecoder.getGraphicCursorY();
|
int gy = gocaDecoder.getGraphicCursorY();
|
||||||
int pickedSeg = gocaDecoder.findPickedSegment(gx, gy);
|
int pickedSeg = gocaDecoder.findPickedSegment(gx, gy);
|
||||||
int pickTag = gocaDecoder.getSegmentTag(pickedSeg);
|
int pickTag = gocaDecoder.getSegmentTag(pickedSeg);
|
||||||
byte[] sf = org.lib3270j.graphics.GraphicInputBuilder.buildGraphicInput(
|
byte[] sf = haus.nightmare.lib3270j.graphics.GraphicInputBuilder.buildGraphicInput(
|
||||||
gx, gy, aidCode, true, isShift, isCtrl, pickedSeg, pickTag
|
gx, gy, aidCode, true, isShift, isCtrl, pickedSeg, pickTag
|
||||||
);
|
);
|
||||||
System.err.println(String.format(
|
System.err.println(String.format(
|
||||||
@@ -367,8 +367,8 @@ public class InputProcessor {
|
|||||||
ExtendedAttribute faCell = screen.getCell(faPos);
|
ExtendedAttribute faCell = screen.getCell(faPos);
|
||||||
int fa = faCell.fa & 0xFF;
|
int fa = faCell.fa & 0xFF;
|
||||||
System.out.println("LP: addr=" + address + " faPos=" + faPos + " fa=0x" + String.format("%02X", fa)
|
System.out.println("LP: addr=" + address + " faPos=" + faPos + " fa=0x" + String.format("%02X", fa)
|
||||||
+ " selectable=" + org.lib3270j.protocol.DS3270Constants.faIsSelectable(fa));
|
+ " selectable=" + haus.nightmare.lib3270j.protocol.DS3270Constants.faIsSelectable(fa));
|
||||||
if (!org.lib3270j.protocol.DS3270Constants.faIsSelectable(fa)) {
|
if (!haus.nightmare.lib3270j.protocol.DS3270Constants.faIsSelectable(fa)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,28 +380,28 @@ public class InputProcessor {
|
|||||||
screen.setCursorAddress(designatorPos);
|
screen.setCursorAddress(designatorPos);
|
||||||
|
|
||||||
if (ebcdic == 0x00 || ebcdic == 0x40 || ascii == ' ' || ascii == 0 || (ebcdic != 0x50 && ascii != '&' && ebcdic != 0x6F && ascii != '?' && ebcdic != 0x6E && ascii != '>')) {
|
if (ebcdic == 0x00 || ebcdic == 0x40 || ascii == ' ' || ascii == 0 || (ebcdic != 0x50 && ascii != '&' && ebcdic != 0x6F && ascii != '?' && ebcdic != 0x6E && ascii != '>')) {
|
||||||
faCell.fa |= org.lib3270j.protocol.DS3270Constants.FA_MODIFY;
|
faCell.fa |= haus.nightmare.lib3270j.protocol.DS3270Constants.FA_MODIFY;
|
||||||
sendAid(org.lib3270j.protocol.DS3270Constants.AID_SELECT);
|
sendAid(haus.nightmare.lib3270j.protocol.DS3270Constants.AID_SELECT);
|
||||||
return true;
|
return true;
|
||||||
} else if (ebcdic == 0x50 || ascii == '&') {
|
} else if (ebcdic == 0x50 || ascii == '&') {
|
||||||
faCell.fa |= org.lib3270j.protocol.DS3270Constants.FA_MODIFY;
|
faCell.fa |= haus.nightmare.lib3270j.protocol.DS3270Constants.FA_MODIFY;
|
||||||
sendAid(org.lib3270j.protocol.DS3270Constants.AID_ENTER);
|
sendAid(haus.nightmare.lib3270j.protocol.DS3270Constants.AID_ENTER);
|
||||||
return true;
|
return true;
|
||||||
} else if (ebcdic == 0x6F || ascii == '?') {
|
} else if (ebcdic == 0x6F || ascii == '?') {
|
||||||
desCell.ec = (byte) 0x6E;
|
desCell.ec = (byte) 0x6E;
|
||||||
desCell.ucs4 = '>';
|
desCell.ucs4 = '>';
|
||||||
faCell.fa |= org.lib3270j.protocol.DS3270Constants.FA_MODIFY;
|
faCell.fa |= haus.nightmare.lib3270j.protocol.DS3270Constants.FA_MODIFY;
|
||||||
screen.updateDisplaySnapshot();
|
screen.updateDisplaySnapshot();
|
||||||
return true;
|
return true;
|
||||||
} else if (ebcdic == 0x6E || ascii == '>') {
|
} else if (ebcdic == 0x6E || ascii == '>') {
|
||||||
desCell.ec = (byte) 0x6F;
|
desCell.ec = (byte) 0x6F;
|
||||||
desCell.ucs4 = '?';
|
desCell.ucs4 = '?';
|
||||||
faCell.fa &= ~org.lib3270j.protocol.DS3270Constants.FA_MODIFY;
|
faCell.fa &= ~haus.nightmare.lib3270j.protocol.DS3270Constants.FA_MODIFY;
|
||||||
screen.updateDisplaySnapshot();
|
screen.updateDisplaySnapshot();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
faCell.fa |= org.lib3270j.protocol.DS3270Constants.FA_MODIFY;
|
faCell.fa |= haus.nightmare.lib3270j.protocol.DS3270Constants.FA_MODIFY;
|
||||||
sendAid(org.lib3270j.protocol.DS3270Constants.AID_SELECT);
|
sendAid(haus.nightmare.lib3270j.protocol.DS3270Constants.AID_SELECT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package org.lib3270j.listener;
|
package haus.nightmare.lib3270j.listener;
|
||||||
|
|
||||||
import org.lib3270j.ConnectionState;
|
import haus.nightmare.lib3270j.ConnectionState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listener for connection state changes and errors.
|
* Listener for connection state changes and errors.
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.listener;
|
package haus.nightmare.lib3270j.listener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listener for screen buffer changes.
|
* Listener for screen buffer changes.
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.protocol;
|
package haus.nightmare.lib3270j.protocol;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 3270 Data Stream protocol constants.
|
* 3270 Data Stream protocol constants.
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.protocol;
|
package haus.nightmare.lib3270j.protocol;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TN3270E protocol constants per RFC 2355.
|
* TN3270E protocol constants per RFC 2355.
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.protocol;
|
package haus.nightmare.lib3270j.protocol;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Telnet protocol constants from RFC 854 and extensions.
|
* Telnet protocol constants from RFC 854 and extensions.
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.screen;
|
package haus.nightmare.lib3270j.screen;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extended attribute structure for a single screen buffer position.
|
* Extended attribute structure for a single screen buffer position.
|
||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
package org.lib3270j.screen;
|
package haus.nightmare.lib3270j.screen;
|
||||||
|
|
||||||
import org.lib3270j.TerminalModel;
|
import haus.nightmare.lib3270j.TerminalModel;
|
||||||
import org.lib3270j.charset.EbcdicTranslator;
|
import haus.nightmare.lib3270j.charset.EbcdicTranslator;
|
||||||
import static org.lib3270j.protocol.DS3270Constants.*;
|
import static haus.nightmare.lib3270j.protocol.DS3270Constants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The 3270 screen buffer.
|
* The 3270 screen buffer.
|
||||||
+6
-6
@@ -1,15 +1,15 @@
|
|||||||
package org.lib3270j.telnet;
|
package haus.nightmare.lib3270j.telnet;
|
||||||
|
|
||||||
import org.lib3270j.ConnectionState;
|
import haus.nightmare.lib3270j.ConnectionState;
|
||||||
import org.lib3270j.ConnectionConfig;
|
import haus.nightmare.lib3270j.ConnectionConfig;
|
||||||
import org.lib3270j.Telnet3270Client;
|
import haus.nightmare.lib3270j.Telnet3270Client;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import static org.lib3270j.protocol.TelnetConstants.*;
|
import static haus.nightmare.lib3270j.protocol.TelnetConstants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages the raw TCP socket connection to a TN3270 host.
|
* Manages the raw TCP socket connection to a TN3270 host.
|
||||||
@@ -47,7 +47,7 @@ public class TelnetConnection {
|
|||||||
log.info("Connecting with TLS to " + config.getHost() + ":" + config.getPort() +
|
log.info("Connecting with TLS to " + config.getHost() + ":" + config.getPort() +
|
||||||
" (verifyCert=" + config.isTlsVerifyCert() + ")");
|
" (verifyCert=" + config.isTlsVerifyCert() + ")");
|
||||||
try {
|
try {
|
||||||
javax.net.ssl.SSLContext sslContext = org.lib3270j.tls.TlsTrustManager.createSSLContext(config);
|
javax.net.ssl.SSLContext sslContext = haus.nightmare.lib3270j.tls.TlsTrustManager.createSSLContext(config);
|
||||||
javax.net.ssl.SSLSocketFactory ssf = sslContext.getSocketFactory();
|
javax.net.ssl.SSLSocketFactory ssf = sslContext.getSocketFactory();
|
||||||
javax.net.ssl.SSLSocket sslSocket = (javax.net.ssl.SSLSocket) ssf.createSocket();
|
javax.net.ssl.SSLSocket sslSocket = (javax.net.ssl.SSLSocket) ssf.createSocket();
|
||||||
sslSocket.setKeepAlive(true);
|
sslSocket.setKeepAlive(true);
|
||||||
+8
-8
@@ -1,10 +1,10 @@
|
|||||||
package org.lib3270j.telnet;
|
package haus.nightmare.lib3270j.telnet;
|
||||||
|
|
||||||
import org.lib3270j.*;
|
import haus.nightmare.lib3270j.*;
|
||||||
import org.lib3270j.datastream.DataStreamProcessor;
|
import haus.nightmare.lib3270j.datastream.DataStreamProcessor;
|
||||||
import org.lib3270j.protocol.*;
|
import haus.nightmare.lib3270j.protocol.*;
|
||||||
import org.lib3270j.screen.ScreenBuffer;
|
import haus.nightmare.lib3270j.screen.ScreenBuffer;
|
||||||
import org.lib3270j.listener.*;
|
import haus.nightmare.lib3270j.listener.*;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -14,8 +14,8 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import static org.lib3270j.protocol.TelnetConstants.*;
|
import static haus.nightmare.lib3270j.protocol.TelnetConstants.*;
|
||||||
import static org.lib3270j.protocol.TN3270EConstants.*;
|
import static haus.nightmare.lib3270j.protocol.TN3270EConstants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Telnet finite state machine.
|
* Telnet finite state machine.
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.tls;
|
package haus.nightmare.lib3270j.tls;
|
||||||
|
|
||||||
import java.security.cert.CertificateException;
|
import java.security.cert.CertificateException;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package org.lib3270j.tls;
|
package haus.nightmare.lib3270j.tls;
|
||||||
|
|
||||||
import org.lib3270j.ConnectionConfig;
|
import haus.nightmare.lib3270j.ConnectionConfig;
|
||||||
|
|
||||||
import javax.net.ssl.*;
|
import javax.net.ssl.*;
|
||||||
import java.security.KeyStore;
|
import java.security.KeyStore;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.charset;
|
package haus.nightmare.lib3270j.charset;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
+7
-7
@@ -1,12 +1,12 @@
|
|||||||
package org.lib3270j.datastream;
|
package haus.nightmare.lib3270j.datastream;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.lib3270j.TerminalModel;
|
import haus.nightmare.lib3270j.TerminalModel;
|
||||||
import org.lib3270j.charset.EbcdicTranslator;
|
import haus.nightmare.lib3270j.charset.EbcdicTranslator;
|
||||||
import org.lib3270j.screen.ScreenBuffer;
|
import haus.nightmare.lib3270j.screen.ScreenBuffer;
|
||||||
import org.lib3270j.screen.ExtendedAttribute;
|
import haus.nightmare.lib3270j.screen.ExtendedAttribute;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static org.lib3270j.protocol.DS3270Constants.*;
|
import static haus.nightmare.lib3270j.protocol.DS3270Constants.*;
|
||||||
|
|
||||||
public class DataStreamProcessorTest {
|
public class DataStreamProcessorTest {
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ public class DataStreamProcessorTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testReadBufferPropagatesLastAid() {
|
public void testReadBufferPropagatesLastAid() {
|
||||||
org.lib3270j.input.InputProcessor input = new org.lib3270j.input.InputProcessor(screen, translator, null);
|
haus.nightmare.lib3270j.input.InputProcessor input = new haus.nightmare.lib3270j.input.InputProcessor(screen, translator, null);
|
||||||
processor.setInputProcessor(input);
|
processor.setInputProcessor(input);
|
||||||
input.setLastAid(AID_ENTER);
|
input.setLastAid(AID_ENTER);
|
||||||
|
|
||||||
+6
-6
@@ -1,12 +1,12 @@
|
|||||||
package org.lib3270j.datastream;
|
package haus.nightmare.lib3270j.datastream;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.lib3270j.TerminalModel;
|
import haus.nightmare.lib3270j.TerminalModel;
|
||||||
import org.lib3270j.charset.EbcdicTranslator;
|
import haus.nightmare.lib3270j.charset.EbcdicTranslator;
|
||||||
import org.lib3270j.graphics.GraphicsMode;
|
import haus.nightmare.lib3270j.graphics.GraphicsMode;
|
||||||
import org.lib3270j.screen.ScreenBuffer;
|
import haus.nightmare.lib3270j.screen.ScreenBuffer;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static org.lib3270j.protocol.DS3270Constants.*;
|
import static haus.nightmare.lib3270j.protocol.DS3270Constants.*;
|
||||||
|
|
||||||
public class QueryReplyBuilderTest {
|
public class QueryReplyBuilderTest {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.ft;
|
package haus.nightmare.lib3270j.ft;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
+8
-8
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.graphics;
|
package haus.nightmare.lib3270j.graphics;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -274,10 +274,10 @@ public class GocaDecoderTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDirectObjectControlSf24() {
|
public void testDirectObjectControlSf24() {
|
||||||
org.lib3270j.screen.ScreenBuffer sb = new org.lib3270j.screen.ScreenBuffer(
|
haus.nightmare.lib3270j.screen.ScreenBuffer sb = new haus.nightmare.lib3270j.screen.ScreenBuffer(
|
||||||
org.lib3270j.TerminalModel.IBM_3279_4, new org.lib3270j.charset.EbcdicTranslator());
|
haus.nightmare.lib3270j.TerminalModel.IBM_3279_4, new haus.nightmare.lib3270j.charset.EbcdicTranslator());
|
||||||
org.lib3270j.datastream.DataStreamProcessor dsp = new org.lib3270j.datastream.DataStreamProcessor(
|
haus.nightmare.lib3270j.datastream.DataStreamProcessor dsp = new haus.nightmare.lib3270j.datastream.DataStreamProcessor(
|
||||||
sb, new org.lib3270j.charset.EbcdicTranslator());
|
sb, new haus.nightmare.lib3270j.charset.EbcdicTranslator());
|
||||||
|
|
||||||
// First draw something on graphics plane
|
// First draw something on graphics plane
|
||||||
dsp.getGraphicsPlane().setPixel(10, 10, 0xFFFFFFFF);
|
dsp.getGraphicsPlane().setPixel(10, 10, 0xFFFFFFFF);
|
||||||
@@ -285,10 +285,10 @@ public class GocaDecoderTest {
|
|||||||
|
|
||||||
// Send WSF with SF_OBJCNTL (0x24) containing P_ERASE (0x0A)
|
// Send WSF with SF_OBJCNTL (0x24) containing P_ERASE (0x0A)
|
||||||
byte[] wsf = new byte[] {
|
byte[] wsf = new byte[] {
|
||||||
(byte) org.lib3270j.protocol.DS3270Constants.CMD_WSF,
|
(byte) haus.nightmare.lib3270j.protocol.DS3270Constants.CMD_WSF,
|
||||||
0x00, 0x04, // Field length = 4
|
0x00, 0x04, // Field length = 4
|
||||||
(byte) org.lib3270j.graphics.GocaConstants.SF_OBJCNTL, // 0x24
|
(byte) haus.nightmare.lib3270j.graphics.GocaConstants.SF_OBJCNTL, // 0x24
|
||||||
(byte) org.lib3270j.graphics.GocaConstants.P_ERASE // 0x0A
|
(byte) haus.nightmare.lib3270j.graphics.GocaConstants.P_ERASE // 0x0A
|
||||||
};
|
};
|
||||||
dsp.processRecord(wsf, 0, wsf.length, false);
|
dsp.processRecord(wsf, 0, wsf.length, false);
|
||||||
|
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
package org.lib3270j.graphics;
|
package haus.nightmare.lib3270j.graphics;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.lib3270j.ConnectionConfig;
|
import haus.nightmare.lib3270j.ConnectionConfig;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
public class GraphicsModeTest {
|
public class GraphicsModeTest {
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.lib3270j.graphics;
|
package haus.nightmare.lib3270j.graphics;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
+8
-8
@@ -1,13 +1,13 @@
|
|||||||
package org.lib3270j.input;
|
package haus.nightmare.lib3270j.input;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.lib3270j.TerminalModel;
|
import haus.nightmare.lib3270j.TerminalModel;
|
||||||
import org.lib3270j.charset.EbcdicTranslator;
|
import haus.nightmare.lib3270j.charset.EbcdicTranslator;
|
||||||
import org.lib3270j.datastream.DataStreamProcessor;
|
import haus.nightmare.lib3270j.datastream.DataStreamProcessor;
|
||||||
import org.lib3270j.screen.ScreenBuffer;
|
import haus.nightmare.lib3270j.screen.ScreenBuffer;
|
||||||
import org.lib3270j.telnet.TelnetFSM;
|
import haus.nightmare.lib3270j.telnet.TelnetFSM;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static org.lib3270j.protocol.DS3270Constants.*;
|
import static haus.nightmare.lib3270j.protocol.DS3270Constants.*;
|
||||||
|
|
||||||
public class InputProcessorTest {
|
public class InputProcessorTest {
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ public class InputProcessorTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGraphicInputBuilderStructure() {
|
public void testGraphicInputBuilderStructure() {
|
||||||
byte[] sf = org.lib3270j.graphics.GraphicInputBuilder.buildGraphicInput(100, -50, AID_ENTER, false, false, false);
|
byte[] sf = haus.nightmare.lib3270j.graphics.GraphicInputBuilder.buildGraphicInput(100, -50, AID_ENTER, false, false, false);
|
||||||
assertEquals(56, sf.length);
|
assertEquals(56, sf.length);
|
||||||
assertEquals(0x00, sf[0]);
|
assertEquals(0x00, sf[0]);
|
||||||
assertEquals(0x34, sf[1]); // Length = 52
|
assertEquals(0x34, sf[1]); // Length = 52
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
package org.lib3270j.protocol;
|
package haus.nightmare.lib3270j.protocol;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static org.lib3270j.protocol.DS3270Constants.*;
|
import static haus.nightmare.lib3270j.protocol.DS3270Constants.*;
|
||||||
|
|
||||||
public class DS3270ConstantsTest {
|
public class DS3270ConstantsTest {
|
||||||
|
|
||||||
+4
-4
@@ -1,10 +1,10 @@
|
|||||||
package org.lib3270j.screen;
|
package haus.nightmare.lib3270j.screen;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.lib3270j.TerminalModel;
|
import haus.nightmare.lib3270j.TerminalModel;
|
||||||
import org.lib3270j.charset.EbcdicTranslator;
|
import haus.nightmare.lib3270j.charset.EbcdicTranslator;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static org.lib3270j.protocol.DS3270Constants.*;
|
import static haus.nightmare.lib3270j.protocol.DS3270Constants.*;
|
||||||
|
|
||||||
public class ScreenBufferTest {
|
public class ScreenBufferTest {
|
||||||
|
|
||||||
+8
-8
@@ -1,14 +1,14 @@
|
|||||||
package org.lib3270j.telnet;
|
package haus.nightmare.lib3270j.telnet;
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.lib3270j.ConnectionConfig;
|
import haus.nightmare.lib3270j.ConnectionConfig;
|
||||||
import org.lib3270j.ConnectionState;
|
import haus.nightmare.lib3270j.ConnectionState;
|
||||||
import org.lib3270j.TerminalModel;
|
import haus.nightmare.lib3270j.TerminalModel;
|
||||||
import org.lib3270j.charset.EbcdicTranslator;
|
import haus.nightmare.lib3270j.charset.EbcdicTranslator;
|
||||||
import org.lib3270j.datastream.DataStreamProcessor;
|
import haus.nightmare.lib3270j.datastream.DataStreamProcessor;
|
||||||
import org.lib3270j.protocol.TelnetConstants;
|
import haus.nightmare.lib3270j.protocol.TelnetConstants;
|
||||||
import org.lib3270j.screen.ScreenBuffer;
|
import haus.nightmare.lib3270j.screen.ScreenBuffer;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
package org.lib3270j.tls;
|
package haus.nightmare.lib3270j.tls;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.lib3270j.ConnectionConfig;
|
import haus.nightmare.lib3270j.ConnectionConfig;
|
||||||
import org.lib3270j.TerminalModel;
|
import haus.nightmare.lib3270j.TerminalModel;
|
||||||
|
|
||||||
import javax.net.ssl.SSLContext;
|
import javax.net.ssl.SSLContext;
|
||||||
import java.security.cert.CertificateException;
|
import java.security.cert.CertificateException;
|
||||||
Reference in New Issue
Block a user