mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
updates for java app ... delicious ...
This commit is contained in:
parent
8c28d94a4e
commit
c94ae50063
6 changed files with 31 additions and 6 deletions
BIN
tutorials/java/dist/phpdbg-ui.jar
vendored
BIN
tutorials/java/dist/phpdbg-ui.jar
vendored
Binary file not shown.
|
@ -1,4 +1,3 @@
|
||||||
application.args=127.0.0.1 4000
|
|
||||||
compile.on.save=true
|
compile.on.save=true
|
||||||
do.depend=false
|
do.depend=false
|
||||||
do.jar=true
|
do.jar=true
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="defaultCloseOperation" type="int" value="2"/>
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
<Property name="title" type="java.lang.String" value="phpdbg jui"/>
|
<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">
|
<Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.ComponentChooserEditor">
|
||||||
<Value id="TOOLKIT_MODAL"/>
|
<ComponentRef name="default"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
<SyntheticProperties>
|
<SyntheticProperties>
|
||||||
|
|
|
@ -7,6 +7,7 @@ import static java.awt.event.KeyEvent.VK_UP;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextField;
|
import javax.swing.JTextField;
|
||||||
|
@ -68,7 +69,6 @@ public class JConsole extends javax.swing.JDialog {
|
||||||
|
|
||||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
setTitle("phpdbg jui");
|
setTitle("phpdbg jui");
|
||||||
setModalityType(java.awt.Dialog.ModalityType.TOOLKIT_MODAL);
|
|
||||||
|
|
||||||
host.setText("127.0.0.1");
|
host.setText("127.0.0.1");
|
||||||
host.setToolTipText("Set the hostname, or IPv4 address of the machine running the phpdbg remote console server");
|
host.setToolTipText("Set the hostname, or IPv4 address of the machine running the phpdbg remote console server");
|
||||||
|
|
|
@ -13,6 +13,10 @@ package phpdbg.ui;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.text.*;
|
import javax.swing.text.*;
|
||||||
import java.awt.Color;
|
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 {
|
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_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_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 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 Color colorCurrent = cReset;
|
||||||
private String remaining = "";
|
private String remaining = "";
|
||||||
|
|
||||||
public JTerminalPane() {
|
public JTerminalPane() {
|
||||||
super();
|
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) {
|
public void append(Color c, String s) {
|
||||||
StyleContext sc = StyleContext.getDefaultStyleContext();
|
StyleContext sc = StyleContext.getDefaultStyleContext();
|
||||||
AttributeSet aset = sc.addAttribute(
|
AttributeSet aset = sc.addAttribute(
|
||||||
SimpleAttributeSet.EMPTY, StyleConstants.Foreground, c);
|
SimpleAttributeSet.EMPTY, StyleConstants.Foreground, c);
|
||||||
setCaretPosition(getDocument().getLength());
|
|
||||||
setCharacterAttributes(aset, false);
|
setCharacterAttributes(aset, false);
|
||||||
replaceSelection(s);
|
replaceSelection(s);
|
||||||
|
setCaretPosition(
|
||||||
|
(getDocument().getLength() > 0) ? (getDocument().getLength() - 1) : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void appendANSI(String s) {
|
public void appendANSI(String s) {
|
||||||
|
|
BIN
tutorials/java/src/phpdbg/ui/logo-small.png
Normal file
BIN
tutorials/java/src/phpdbg/ui/logo-small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
Loading…
Add table
Add a link
Reference in a new issue