From d7c88e8450f6ccc9283bf704cb0cef88759f8f97 Mon Sep 17 00:00:00 2001 From: realsonic Date: Tue, 16 Oct 2018 11:43:35 +0300 Subject: [PATCH] =?UTF-8?q?Revert=20"=D0=9F=D1=80=D0=BE=D0=B1=D0=B0=20html?= =?UTF-8?q?=20-=20=D0=B6=D0=B8=D1=80=D0=BD=D1=8B=D0=B5=20=D0=BD=D0=B0?= =?UTF-8?q?=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BB=D0=BE=D0=BA=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D0=B9=20=D0=B8=20=D1=8D=D1=85=D0=BE=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B=20=D0=BA=D1=83=D1=80=D1=81=D0=B8?= =?UTF-8?q?=D0=B2=D0=BE=D0=BC"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 73ba9d0 --- libs/standard/verbs.xml | 2 +- src/ifml2/players/guiplayer/GUIPlayer.form | 9 +++------ src/ifml2/players/guiplayer/GUIPlayer.java | 12 +++++------- src/ifml2/vm/VirtualMachine.java | 8 ++++---- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/libs/standard/verbs.xml b/libs/standard/verbs.xml index f4ab7558..0bfe76a2 100644 --- a/libs/standard/verbs.xml +++ b/libs/standard/verbs.xml @@ -909,7 +909,7 @@ - + diff --git a/src/ifml2/players/guiplayer/GUIPlayer.form b/src/ifml2/players/guiplayer/GUIPlayer.form index a0575abc..9a656bc3 100644 --- a/src/ifml2/players/guiplayer/GUIPlayer.form +++ b/src/ifml2/players/guiplayer/GUIPlayer.form @@ -39,22 +39,19 @@ - - - - - - + + + diff --git a/src/ifml2/players/guiplayer/GUIPlayer.java b/src/ifml2/players/guiplayer/GUIPlayer.java index b9d41b42..cc1f4559 100644 --- a/src/ifml2/players/guiplayer/GUIPlayer.java +++ b/src/ifml2/players/guiplayer/GUIPlayer.java @@ -14,12 +14,11 @@ import javax.swing.filechooser.FileView; import javax.swing.plaf.FontUIResource; import javax.swing.text.BadLocationException; -import javax.swing.text.html.HTMLDocument; +import javax.swing.text.StyledDocument; import javax.xml.bind.ValidationEvent; import java.awt.*; import java.awt.event.*; import java.io.File; -import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.text.MessageFormat; @@ -597,7 +596,7 @@ private void echoCommand(String command) } // echo command - outputPlainText("> " + command + "\n"); + outputPlainText("> " + command + "\n"); // scroll to inputted command final Point viewPosition = new Point(startLocation.x, startLocation.y); @@ -620,11 +619,10 @@ private void echoCommand(String command) @Override public void outputPlainText(String text) { - HTMLDocument document = (HTMLDocument) logTextPane.getStyledDocument(); + StyledDocument document = logTextPane.getStyledDocument(); try { - String translatedText = text.replace("\n", "
"); - document.insertAfterEnd(document.getCharacterElement(document.getLength()), translatedText); - } catch (BadLocationException | IOException e) { + document.insertString(document.getLength(), text, null); + } catch (BadLocationException e) { LOG.error("Error while inserting string to JTextPane", e); throw new RuntimeException(e); } diff --git a/src/ifml2/vm/VirtualMachine.java b/src/ifml2/vm/VirtualMachine.java index 9db01d5a..2c342983 100644 --- a/src/ifml2/vm/VirtualMachine.java +++ b/src/ifml2/vm/VirtualMachine.java @@ -90,7 +90,7 @@ public Value callProcedureWithParameters(@NotNull Procedure procedure, List parameters) throws IFML2Exception + void runProcedure(@NotNull Procedure procedure, List parameters) throws IFML2Exception { try { @@ -145,7 +145,7 @@ public void showLocation(@Nullable Location location) throws IFML2Exception else { // not inherited! do as usual... - outTextLn("" + location.getName() + ""); + outTextLn(location.getName()); outTextLn(location.getDescription()); if (location.getItems().size() > 0) { @@ -184,7 +184,7 @@ else if (iterator.hasNext()) // there is an another word after that return result; } - Value resolveSymbol(String symbol) throws IFML2VMException + public Value resolveSymbol(String symbol) throws IFML2VMException { String loweredSymbol = symbol.toLowerCase(); @@ -226,7 +226,7 @@ public void outText(String text) engine.outText(text); } - Variable searchGlobalVariable(String name) + public Variable searchGlobalVariable(String name) { return engine.searchGlobalVariable(name); }