コード例 #1
0
    public void layout(IFigure container) {
      boolean consumed = false;
      for (int i = 0; i < listeners.size(); i++)
        consumed |= ((LayoutListener) listeners.get(i)).layout(container);

      if (realLayout != null && !consumed) realLayout.layout(container);
      for (int i = 0; i < listeners.size(); i++)
        ((LayoutListener) listeners.get(i)).postLayout(container);
    }
コード例 #2
0
 public Map<JRElement, Rectangle> layout(JRElement[] elements, Dimension c) {
   Map<JRElement, Rectangle> map = new HashMap<JRElement, Rectangle>();
   int x = 0;
   int y = 0;
   int w = c.width;
   int h = (int) Math.floor((float) c.height / elements.length);
   int rest = c.height - h * elements.length;
   for (JRElement el : elements) {
     JRDesignElement del = (JRDesignElement) el;
     map.put(el, new Rectangle(el.getX(), el.getY(), el.getWidth(), el.getHeight()));
     del.setX(x);
     del.setY(y);
     del.setWidth(w);
     del.setHeight(h + rest);
     // if last grab free pixels
     y += h + rest;
     if (rest > 0) rest = 0;
     LayoutManager.layout(map, el);
   }
   return map;
 }
コード例 #3
0
ファイル: Plot.java プロジェクト: HiroshiFuu/androidplot
 @Override
 public synchronized void layout(final DisplayDimensions dims) {
   displayDims = dims;
   layoutManager.layout(displayDims);
 }
コード例 #4
0
 /**
  * Lays out this Figure using its {@link LayoutManager}.
  *
  * @since 2.0
  */
 protected void layout() {
   if (layoutManager != null) layoutManager.layout(this);
 }