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
|
@ -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>
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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) {
|
||||
|
|
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