-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee8633c
commit 425b5f4
Showing
162 changed files
with
30,597 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src/main/java"/> | ||
<classpathentry kind="src" path="src/main/resources"/> | ||
<classpathentry kind="src" output="testbin" path="src/shims/java"> | ||
<attributes> | ||
<attribute name="test" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" output="testbin" path="src/test/java"> | ||
<attributes> | ||
<attribute name="test" value="true"/> | ||
<attribute name="optional" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" output="testbin" path="src/test/resources"> | ||
<attributes> | ||
<attribute name="test" value="true"/> | ||
<attribute name="optional" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" path="/controls"> | ||
<attributes> | ||
<attribute name="module" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" path="/graphics"> | ||
<attributes> | ||
<attribute name="module" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry combineaccessrules="false" kind="src" path="/base"> | ||
<attributes> | ||
<attribute name="module" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry combineaccessrules="false" kind="src" path="/swing"> | ||
<attributes> | ||
<attribute name="module" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"> | ||
<attributes> | ||
<attribute name="test" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> | ||
<attributes> | ||
<attribute name="module" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>incubator.controls</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
2 changes: 2 additions & 0 deletions
2
modules/javafx.incubator.controls/.settings/org.eclipse.core.resources.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding/<project>=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Incubator | ||
|
||
This project incubates | ||
[RichTextArea](src/main/java/javafx/incubator/scene/control/rich/RichTextArea.java) | ||
and | ||
[CodeArea](src/main/java/javafx/incubator/scene/control/rich/code/CodeArea.java) | ||
controls. | ||
|
||
|
||
## Demo Projects | ||
|
||
Please refer to this [README](/tests/manual/RichTextAreaDemo/README.md). |
66 changes: 66 additions & 0 deletions
66
....incubator.controls/src/main/java/com/sun/javafx/incubator/scene/control/input/HList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. Oracle designates this | ||
* particular file as subject to the "Classpath" exception as provided | ||
* by Oracle in the LICENSE file that accompanied this code. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
* or visit www.oracle.com if you need additional information or have any | ||
* questions. | ||
*/ | ||
package com.sun.javafx.incubator.scene.control.input; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Iterator; | ||
import javafx.event.EventHandler; | ||
|
||
/** | ||
* List of event handlers, which can be added to its head or tail. | ||
* the order of handlers in the list is guaranteed to be: | ||
* (first added to the head), (second added to the head), ..., (second added to the tail), (first added to the tail). | ||
*/ | ||
public class HList implements Iterable<EventHandler<?>> { | ||
private final ArrayList<EventHandler<?>> handlers = new ArrayList<>(4); | ||
private int insertIndex; | ||
|
||
public HList() { | ||
} | ||
|
||
public static HList from(Object x) { | ||
if (x instanceof HList h) { | ||
return h; | ||
} | ||
return new HList(); | ||
} | ||
|
||
public void add(EventHandler<?> h, boolean tail) { | ||
if (insertIndex == handlers.size()) { | ||
handlers.add(h); | ||
} else { | ||
handlers.add(insertIndex, h); | ||
} | ||
|
||
if (!tail) { | ||
insertIndex++; | ||
} | ||
} | ||
|
||
@Override | ||
public Iterator<EventHandler<?>> iterator() { | ||
return handlers.iterator(); | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
...trols/src/main/java/com/sun/javafx/incubator/scene/control/rich/CachingStyleResolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. Oracle designates this | ||
* particular file as subject to the "Classpath" exception as provided | ||
* by Oracle in the LICENSE file that accompanied this code. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
* or visit www.oracle.com if you need additional information or have any | ||
* questions. | ||
*/ | ||
|
||
package com.sun.javafx.incubator.scene.control.rich; | ||
|
||
import java.util.HashMap; | ||
import javafx.incubator.scene.control.rich.StyleResolver; | ||
import javafx.incubator.scene.control.rich.model.StyleAttrs; | ||
import javafx.scene.Node; | ||
import javafx.scene.image.WritableImage; | ||
|
||
/** | ||
* Caching StyleResolver caches conversion results to avoid re-querying for the same information. | ||
*/ | ||
public class CachingStyleResolver implements StyleResolver { | ||
private final StyleResolver resolver; | ||
private final HashMap<CssStyles, StyleAttrs> cache = new HashMap<>(); | ||
|
||
public CachingStyleResolver(StyleResolver r) { | ||
this.resolver = r; | ||
} | ||
|
||
@Override | ||
public StyleAttrs resolveStyles(StyleAttrs attrs) { | ||
CssStyles css = attrs.get(CssStyles.CSS); | ||
if (css != null) { | ||
// no conversion is needed | ||
return attrs; | ||
} | ||
|
||
StyleAttrs a = cache.get(css); | ||
if (a == null) { | ||
a = resolver.resolveStyles(attrs); | ||
cache.put(css, a); | ||
} | ||
return a; | ||
} | ||
|
||
@Override | ||
public WritableImage snapshot(Node node) { | ||
return resolver.snapshot(node); | ||
} | ||
} |
Oops, something went wrong.