graph.forHasStatement(element, gl.getVisible(), element, new AsyncProcedureAdapter<Boolean>() {
@Override
public void execute(AsyncReadGraph graph, Boolean result) {
- synchronized (visible) {
- visible.add(l);
+ if (result) {
+ synchronized (visible) {
+ visible.add(l);
+ }
}
if (DEBUG_LAYERS)
System.out.println(" Visible on layer '" + gl.getName() + "'");
graph.forHasStatement(element, gl.getFocusable(), element, new AsyncProcedureAdapter<Boolean>() {
@Override
public void execute(AsyncReadGraph graph, Boolean result) {
- synchronized (focusable) {
- focusable.add(l);
+ if (result) {
+ synchronized (focusable) {
+ focusable.add(l);
+ }
}
if (DEBUG_LAYERS)
System.out.println(" Focusable on layer '" + gl.getName() + "'");