Cleaner rendering
Build and Test j3270 / Build JAR & Run Tests (push) Successful in 1m6s

This commit is contained in:
2026-08-21 11:51:37 -04:00
parent d7d2f8bad5
commit c32521fd4b
13 changed files with 516 additions and 334 deletions
@@ -925,7 +925,14 @@ public class TerminalPanel extends JPanel {
int cs = (ea.cs != 0) ? (ea.cs & 0xFF) : (currentFieldEa != null ? (currentFieldEa.cs & 0xFF) : 0);
boolean drawnAsPs = false;
if (cs >= 0x40 && client.getProgramSymbolManager() != null) {
drawnAsPs = client.getProgramSymbolManager().drawSymbol(g2, cs, ea.ec & 0xFF, x, y, cellWidth, cellHeight, fgColor, bgColor);
org.lib3270j.graphics.ProgramSymbolSet.SymbolSlot slot = client.getProgramSymbolManager().getSymbol(cs, ea.ec & 0xFF);
if (slot != null) {
int[] rgb = slot.getRgbPixels(fgColor.getRGB(), bgColor.getRGB());
java.awt.image.BufferedImage img = new java.awt.image.BufferedImage(slot.getWidth(), slot.getHeight(), java.awt.image.BufferedImage.TYPE_INT_ARGB);
img.setRGB(0, 0, slot.getWidth(), slot.getHeight(), rgb, 0, slot.getWidth());
g2.drawImage(img, x, y, cellWidth, cellHeight, null);
drawnAsPs = true;
}
}
if (!drawnAsPs) {
@@ -958,7 +965,12 @@ public class TerminalPanel extends JPanel {
int gridW = cols * cellWidth;
int gridH = rows * cellHeight;
client.getGraphicsPlane().resize(gridW, gridH);
g2.drawImage(client.getGraphicsPlane().getImage(), ox, oy, gridW, gridH, null);
int[] rgb = client.getGraphicsPlane().getRgbBuffer();
if (rgb != null) {
java.awt.image.BufferedImage img = new java.awt.image.BufferedImage(gridW, gridH, java.awt.image.BufferedImage.TYPE_INT_ARGB);
img.setRGB(0, 0, gridW, gridH, rgb, 0, gridW);
g2.drawImage(img, ox, oy, gridW, gridH, null);
}
}
// Draw cursor