diff options
author | krakjoe <joe.watkins@live.co.uk> | 2013-11-29 22:03:08 +0000 |
---|---|---|
committer | krakjoe <joe.watkins@live.co.uk> | 2013-11-29 22:03:08 +0000 |
commit | c94ae50063d7edeb972011c7c9713a57266e19c9 (patch) | |
tree | fb6377f35417083476328edf7c393207a3fff83b /tutorials/java/src/phpdbg | |
parent | 8c28d94a4e7f80bf2f3ae6abcee8e540bbf08bb3 (diff) | |
download | php-git-c94ae50063d7edeb972011c7c9713a57266e19c9.tar.gz |
updates for java app ... delicious ...
Diffstat (limited to 'tutorials/java/src/phpdbg')
-rw-r--r-- | tutorials/java/src/phpdbg/ui/JConsole.form | 4 | ||||
-rw-r--r-- | tutorials/java/src/phpdbg/ui/JConsole.java | 2 | ||||
-rw-r--r-- | tutorials/java/src/phpdbg/ui/JTerminalPane.java | 30 | ||||
-rw-r--r-- | tutorials/java/src/phpdbg/ui/logo-small.png | bin | 0 -> 4964 bytes |
4 files changed, 31 insertions, 5 deletions
diff --git a/tutorials/java/src/phpdbg/ui/JConsole.form b/tutorials/java/src/phpdbg/ui/JConsole.form index 7b3d9164fd..fb2e622f5b 100644 --- a/tutorials/java/src/phpdbg/ui/JConsole.form +++ b/tutorials/java/src/phpdbg/ui/JConsole.form @@ -22,8 +22,8 @@ <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> <Property name="title" type="java.lang.String" value="phpdbg jui"/> - <Property name="modalityType" type="java.awt.Dialog$ModalityType" editor="org.netbeans.modules.form.editors.EnumEditor"> - <Value id="TOOLKIT_MODAL"/> + <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.ComponentChooserEditor"> + <ComponentRef name="default"/> </Property> </Properties> <SyntheticProperties> diff --git a/tutorials/java/src/phpdbg/ui/JConsole.java b/tutorials/java/src/phpdbg/ui/JConsole.java index 74f4040ce1..60001d385c 100644 --- a/tutorials/java/src/phpdbg/ui/JConsole.java +++ b/tutorials/java/src/phpdbg/ui/JConsole.java @@ -7,6 +7,7 @@ import static java.awt.event.KeyEvent.VK_UP; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; +import javax.imageio.ImageIO; import javax.swing.JOptionPane; import javax.swing.JScrollPane; import javax.swing.JTextField; @@ -68,7 +69,6 @@ public class JConsole extends javax.swing.JDialog { setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("phpdbg jui"); - setModalityType(java.awt.Dialog.ModalityType.TOOLKIT_MODAL); host.setText("127.0.0.1"); host.setToolTipText("Set the hostname, or IPv4 address of the machine running the phpdbg remote console server"); diff --git a/tutorials/java/src/phpdbg/ui/JTerminalPane.java b/tutorials/java/src/phpdbg/ui/JTerminalPane.java index 8462a6e4bf..c616d2a8b8 100644 --- a/tutorials/java/src/phpdbg/ui/JTerminalPane.java +++ b/tutorials/java/src/phpdbg/ui/JTerminalPane.java @@ -13,6 +13,10 @@ package phpdbg.ui; import javax.swing.*; import javax.swing.text.*; import java.awt.Color; +import java.awt.Graphics; +import java.awt.Image; +import java.io.IOException; +import javax.imageio.ImageIO; public class JTerminalPane extends JTextPane { @@ -32,22 +36,44 @@ public class JTerminalPane extends JTextPane { private static final Color B_Yellow = Color.getHSBColor( 0.167f, 1.000f, 1.000f ); private static final Color B_Cyan = Color.getHSBColor( 0.500f, 1.000f, 1.000f ); private static final Color B_White = Color.getHSBColor( 0.000f, 0.000f, 1.000f ); - private static final Color cReset = Color.getHSBColor( 0.000f, 0.000f, 0.000f ); + private static final Color cReset = Color.getHSBColor( 0.000f, 0.000f, 1.000f ); private Color colorCurrent = cReset; private String remaining = ""; public JTerminalPane() { super(); + setOpaque(false); + setBackground(new Color(0, 0, 0, 0)); + } + + @Override public void paintComponent(Graphics g) { + g.setColor(Color.BLACK); + g.fillRect(0, 0, getWidth(), getHeight()); + + try { + Image image = ImageIO.read( + JTerminalPane.class.getResource("logo-small.png")); + + g.drawImage( + image, + getWidth() - image.getWidth(this) - 10, + getHeight() - image.getHeight(this) - 10, + image.getWidth(this), image.getHeight(this), this); + + } catch (IOException | NullPointerException | IllegalArgumentException ex) {} + + super.paintComponent(g); } public void append(Color c, String s) { StyleContext sc = StyleContext.getDefaultStyleContext(); AttributeSet aset = sc.addAttribute( SimpleAttributeSet.EMPTY, StyleConstants.Foreground, c); - setCaretPosition(getDocument().getLength()); setCharacterAttributes(aset, false); replaceSelection(s); + setCaretPosition( + (getDocument().getLength() > 0) ? (getDocument().getLength() - 1) : 0); } public void appendANSI(String s) { diff --git a/tutorials/java/src/phpdbg/ui/logo-small.png b/tutorials/java/src/phpdbg/ui/logo-small.png Binary files differnew file mode 100644 index 0000000000..1792379f77 --- /dev/null +++ b/tutorials/java/src/phpdbg/ui/logo-small.png |