< prev index next >
modules/graphics/src/main/java/javafx/scene/layout/ConstraintsBase.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2009, 2015, 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
--- 1,7 ----
/*
! * Copyright (c) 2009, 2016, 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
*** 25,35 ****
package javafx.scene.layout;
import java.util.Iterator;
- import javafx.scene.Node;
import javafx.scene.Parent;
import com.sun.javafx.util.WeakReferenceQueue;
/**
--- 25,34 ----
*** 46,73 ****
* This allows an application to constrain a resizable node's size, which normally
* has an unlimited max value, to its preferred size.
*/
public static final double CONSTRAIN_TO_PREF = Double.NEGATIVE_INFINITY;
! WeakReferenceQueue impl_nodes = new WeakReferenceQueue();
ConstraintsBase() {
}
void add(Parent node) {
! impl_nodes.add(node);
}
void remove(Parent node) {
! impl_nodes.remove(node);
}
/**
* Calls requestLayout on layout parent associated with this constraint object.
*/
protected void requestLayout() {
! Iterator<Parent> nodeIter = impl_nodes.iterator();
while (nodeIter.hasNext()) {
nodeIter.next().requestLayout();
}
}
--- 45,72 ----
* This allows an application to constrain a resizable node's size, which normally
* has an unlimited max value, to its preferred size.
*/
public static final double CONSTRAIN_TO_PREF = Double.NEGATIVE_INFINITY;
! private WeakReferenceQueue nodes = new WeakReferenceQueue();
ConstraintsBase() {
}
void add(Parent node) {
! nodes.add(node);
}
void remove(Parent node) {
! nodes.remove(node);
}
/**
* Calls requestLayout on layout parent associated with this constraint object.
*/
protected void requestLayout() {
! Iterator<Parent> nodeIter = nodes.iterator();
while (nodeIter.hasNext()) {
nodeIter.next().requestLayout();
}
}
< prev index next >