Пример #1
0
 @Override
 public double getAvailable(Dimension dimension) {
   for (AreaNode p = getParent(); p != null; p = p.getParent()) {
     if (p instanceof ReferenceArea) return p.getAvailable(dimension);
   }
   return super.getAvailable(dimension);
 }
Пример #2
0
 public LineArea getLine() {
   for (AreaNode p = getParent(); p != null; p = p.getParent()) {
     if (p instanceof LineArea) return (LineArea) p;
     else if (p instanceof ReferenceArea) break;
   }
   return new LineArea();
 }