Package ch.sahits.game.graphic.display

Examples of ch.sahits.game.graphic.display.ISahitsComponent


    }
        int nComps = parent.getComponentCount();
        Dimension d = null;
        int maxWidth=0;
        for (int i = 0; i < nComps; i++) {
          ISahitsComponent c = parent.get(i);
            if ( computeColumnIndex(i)==column) {
              d = c.getPreferredSize();
              if (d.width>maxWidth){
                maxWidth=d.width;
              }
            }
        }
View Full Code Here


    }
        int nComps = parent.getComponentCount();
        Dimension d = null;
        int maxHeigth=0;
        for (int i = 0; i < nComps; i++) {
          ISahitsComponent c = parent.get(i);
            if (computeRowIndex(i)==row) {
              d = c.getPreferredSize();
              if (d.height>maxHeigth){
                maxHeigth=d.height;
              }
            }
        }
View Full Code Here

        int globalXPadding = computeXPadding(w, totalWidth, new MaximalGridLayoutConstraints(position));
        globalXPadding += bounds.x;
       int globalYPadding = computeYPadding(h, totalHeight, new MaximalGridLayoutConstraints(position));
       globalYPadding += bounds.y;
       for (int i = 0 ; i < nComps ; i++) {
            ISahitsComponent c = parent.get(i);
            final int columnIndex = computeColumnIndex(i);
            final int rowIndex = computeRowIndex(i);
            int xColumn = (int) Math.rint(getColumnStart(columnIndex,parent)*widthScale);
            xColumn += (columnIndex-1)*gap;
            int yRow = (int) Math.rint(getRowStart(rowIndex,parent)*heightScale);
            yRow += (rowIndex-1)*gap;
            final int columnWidth = (int) Math.rint(computeWidth(columnIndex, parent)*widthScale);
            final int rowHeight = (int) Math.rint(computeHeight(rowIndex, parent)*heightScale);
            Dimension d = c.getPreferredSize();
            d.width = Math.min(d.width,columnWidth);
            d.height = Math.min(d.height,rowHeight);
           final int xPadding = computeXPadding(columnWidth,d.width,getConstraints(c));
            final int yPadding = computeYPadding(rowHeight,d.height,getConstraints(c));
             // increase x and y, if appropriate
            final int x = insets.left+xColumn+xPadding+globalXPadding;
            final int y = insets.top+yRow+yPadding+globalYPadding;
            // Set the ISahitsComponent's size and position.
            c.setBounds(x, y, d.width, d.height);
        }

    resetSizeCache();
  }
View Full Code Here

TOP

Related Classes of ch.sahits.game.graphic.display.ISahitsComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.