Skip to content

Commit 611c20d

Browse files
hansonrhansonr
authored andcommitted
JTextPane, JEditPane preliminary support - test/Test_Editor.java
support for StyledDocument with bold/italic/super/sub.
1 parent 771449d commit 611c20d

34 files changed

+2261
-1855
lines changed
3.08 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181224175726
1+
20181228210211
3.08 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181224175726
1+
20181228210211
3.08 KB
Binary file not shown.

sources/net.sf.j2s.java.core/src/java/awt/Color.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ public class Color implements Paint /*, java.io.Serializable*/ {
108108
*/
109109
public final static Color black = new Color(0, 0, 0);
110110

111+
/**
112+
* SwingJS The color almost black; signifies none for styles
113+
*/
114+
public final static Color none = new Color(0, 0, 1); // SwingJS
115+
111116
/**
112117
* The color black. In the default sRGB space.
113118
* @since 1.4

sources/net.sf.j2s.java.core/src/java/awt/Component.java

Lines changed: 1356 additions & 1675 deletions
Large diffs are not rendered by default.

sources/net.sf.j2s.java.core/src/javax/swing/JEditorPane.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,6 +2213,7 @@ public ViewFactory getViewFactory() {
22132213
*/
22142214
@Override
22152215
public View create(Element elem) {
2216+
// SwingJS "i18n" not implemented
22162217
// Document doc = elem.getDocument();
22172218
// Object i18nFlag
22182219
// = doc.getProperty("i18n"/*AbstractDocument.I18NProperty*/);

sources/net.sf.j2s.java.core/src/javax/swing/JTextArea.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@
3838
import javax.swing.text.Document;
3939
import javax.swing.text.Element;
4040
import javax.swing.text.JTextComponent;
41+
import javax.swing.text.PlainDocument;
4142

42-
import swingjs.JSPlainDocument;
43-
import swingjs.JSToolkit;
4443
import swingjs.api.JSMinimalAbstractDocument;
4544

4645
/**
@@ -242,8 +241,8 @@ public String getUIClassID() {
242241
*/
243242
protected Document createDefaultModel() {
244243
// SwingJS
245-
return JSToolkit.getPlainDocument(this);
246-
// return new PlainDocument();
244+
// return JSToolkit.getPlainDocument(this);
245+
return new PlainDocument();
247246
}
248247

249248
/**
@@ -263,8 +262,7 @@ public void setTabSize(int size) {
263262
Document doc = getDocument();
264263
if (doc != null) {
265264
int old = getTabSize();
266-
// SwingJS -- temporarily using JSPlainDocument here
267-
doc.putProperty(JSPlainDocument.tabSizeAttribute, new Integer(size));
265+
doc.putProperty(PlainDocument.tabSizeAttribute, new Integer(size));
268266
firePropertyChange("tabSize", old, size);
269267
}
270268
}
@@ -279,8 +277,7 @@ public int getTabSize() {
279277
int size = 8;
280278
Document doc = getDocument();
281279
if (doc != null) {
282-
// SwingJS -- temporarily using JSPlainDocument here
283-
Integer i = (Integer) doc.getProperty(JSPlainDocument.tabSizeAttribute);
280+
Integer i = (Integer) doc.getProperty(PlainDocument.tabSizeAttribute);
284281
if (i != null) {
285282
size = i.intValue();
286283
}

sources/net.sf.j2s.java.core/src/javax/swing/JTextField.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ public void setHorizontalAlignment(int alignment) {
373373
*/
374374
protected Document createDefaultModel() {
375375
// SwingJS
376-
return JSToolkit.getPlainDocument(this);
376+
return JSToolkit.getPlainDocument();
377377
// return new PlainDocument();
378378
}
379379

0 commit comments

Comments
 (0)