Package java.awt

Examples of java.awt.Rectangle


        page.paintMarginAreas(c, 0, Layer.PAGED_MODE_PRINT);       
        page.paintBorder(c, 0, Layer.PAGED_MODE_PRINT);
       
        Shape working = _outputDevice.getClip();
       
        Rectangle content = page.getPrintClippingBounds(c);
        _outputDevice.clip(content);
       
        int top = -page.getPaintingTop() +
            page.getMarginBorderPadding(c, CalculatedStyle.TOP);
       
View Full Code Here


    final int width = (int) jfreeReport.getPageDefinition().getWidth();

    final String[] columns = {"column0", "column1", "column2", "column3", "type"};
    final String numberFormat = "$#,##0.00";
    jfreeReport.getPageHeader().addElement(messageField("Sample Group Report",//
        true, 14, ElementAlignment.CENTER, new Rectangle(0, 0, width, 16)));
    RelationalGroup group = new RelationalGroup();
    group.setName("group");
    group.addField("type");
    // group.getHeader().setRepeat(true);
    group.getHeader().addElement(label("Column 0", true, ElementAlignment.CENTER, new Rectangle(0, 0, 120, 14)));
    group.getHeader().addElement(label("Column 1", true, ElementAlignment.CENTER, new Rectangle(130, 0, 120, 14)));
    group.getHeader().addElement(label("Column 2", true, ElementAlignment.CENTER, new Rectangle(260, 0, 120, 14)));
    group.getHeader().addElement(label("Column 3", true, ElementAlignment.CENTER, new Rectangle(390, 0, 70, 14)));
    group.getHeader().addElement(HorizontalLineElementFactory.createHorizontalLine(16));
    group.getHeader().setRepeat(false);
    group.getHeader().setPagebreakBeforePrint(true);
    group.getFooter().setPagebreakAfterPrint(true);
    jfreeReport.addGroup(group);
    // report data item elements
    jfreeReport.getReportFooter().setPagebreakBeforePrint(true);
    jfreeReport.getItemBand().addElement(textField(columns[0], false, new Rectangle(0, 0, 120, 14)));
    jfreeReport.getItemBand().addElement(textField(columns[1], false, new Rectangle(130, 0, 120, 14)));
    jfreeReport.getItemBand().addElement(textField(columns[2], false, new Rectangle(260, 0, 120, 14)));
    jfreeReport.getItemBand().addElement(numberField(columns[3], false, numberFormat, new Rectangle(390, 0, 70, 14)));
    // layout is built, so now fill in the report content to be display
    final int length = 60;
    final int breakpos = 20;
    Object[][] data = new Object[length][5];
    int type = 0;
View Full Code Here

                return;

            // Compute the area we're going to paint in terms of the affected
            // columns/rows (firstPaintColumn, firstPaintRow, lastPaintColumn,
            // lastPaintRow), and the clip bounds.
            Rectangle paintBounds = g.getClipBounds();
  
            int firstPaintColumn = convertXToColumn(paintBounds.x);
            int firstPaintRow = convertYToRow(paintBounds.y);
            int lastPaintColumn = convertXToColumn((paintBounds.x+ paintBounds.width) - 1);
            int lastPaintRow = convertYToRow((paintBounds.y + paintBounds.height) - 1);
  
            if (firstPaintRow == -1)
                firstPaintRow = 0;

            if (lastPaintRow == -1)
                lastPaintRow = (dataModel.getSize()-1)/columnsPerRow;
           
            if (firstPaintColumn == -1)
                firstPaintColumn = 0;

            if (lastPaintColumn == -1)
                lastPaintColumn = columnsPerRow-1;
  
            Rectangle itemBounds = getCellBoundsPerColumnRow(list, firstPaintColumn, firstPaintRow);
            if (itemBounds == null)
                return;
  
            int leadIndex = list.getLeadSelectionIndex();
            int startItemBoundX = itemBounds.x;
View Full Code Here

    public int locationToNearestIndex(DcList list, Point p) {
        // Determine the nearest index == center of index that would
        // be the most logical position to insert an item
        int index = locationToIndex(list, p);
        if (index != -1) {
            Rectangle cell = getCellBounds(list, index, index);
            if(cell.getX()+cell.getWidth()/2<p.getX())
                index++;
        } else {
            //It is possible, that we are on some white space on the
            //right of the List check this by calculating the row
            int row = convertYToRow(p.y);
View Full Code Here

        int x = minX;
        int y = minY;
        int w = (maxX + getItemWidth(maxIndex)) - minX;
        int h = (maxY + getItemHeight(maxIndex)) - minY;
        return new Rectangle(x, y, w, h);
    }
View Full Code Here

        return ((DcListUI) ui).locationToNearestIndex(this, location);
    }
   
    public void setMaxVisibleColumnsPerRow() {
        Rectangle r = getVisibleRect();
        DcListUI ui = (DcListUI)getUI();
        int newMaxColPerRow = ui.getMaxColumnsPerRow(r.width);
        if(newMaxColPerRow != columnsPerRow)
            setColumnsPerRow(newMaxColPerRow);
    }   
View Full Code Here

            setColumnsPerRow(newMaxColPerRow);
    }   
   
    @Override
    public int getLastVisibleIndex() {
        Rectangle r = getVisibleRect();
        Point visibleLR = new Point(0, (r.y + r.height) - 1);
        int index = locationToNearestIndex(visibleLR);
        return index;
    }
View Full Code Here

        int index = locationToNearestIndex(visibleLR);
        return index;
    }
   
    public int getFirstIndexOnLastVisibleRow() {
        Rectangle r = getVisibleRect();
        Point visibleLR = new Point(0, (r.y + r.height) - 1);
        return locationToNearestIndex(visibleLR);
    }   
View Full Code Here

                int width  = (visibleColumnCount * fixedCellWidth)+ dx;
                int height = (visibleRowCount * fixedCellHeight) + dy;
               
                return new Dimension(width, height);
            } else if (getModel().getSize() > 0) {
                Rectangle r = getCellBounds(0, 0);
                int width  = (visibleColumnCount * r.width) + dx;
                int height = (visibleRowCount * r.height) + dy;
               
                return new Dimension(width, height);
            } else {
View Full Code Here

        int column = firstIndex % columnsPerRow;

        if (orientation == SwingConstants.HORIZONTAL) {

            if (direction > 0) {
                Rectangle r = getCellBounds(firstIndex, firstIndex);
                increment = (r == null) ? 0 : r.width - (visibleRect.x - r.x);
            } else {
                Rectangle r = getCellBounds(firstIndex, firstIndex);

                if ((r.x == visibleRect.x) && (column == 0)) {
                    increment = 0;
                } else if (r.x == visibleRect.x) {
                   Rectangle prevR = getCellBounds(firstIndex - 1, firstIndex - 1);
                   increment = (prevR == null) ? 0 : prevR.width;
                } else {
                    increment = visibleRect.x - r.x;
                }
            }
        } else {
            if (direction > 0) {
                Rectangle r = getCellBounds(firstIndex, firstIndex);
                increment = (r == null) ? 0 : r.height - (visibleRect.y - r.y);
            } else {
                Rectangle r = getCellBounds(firstIndex, firstIndex);
                if ((r.y == visibleRect.y) && (row == 0))  {
                    increment = 0;
                } else if (r.y == visibleRect.y) {
                    Rectangle prevR = getCellBounds(firstIndex - 1, firstIndex - 1);
                    increment = (prevR== null) ? 0 : prevR.height;
                } else {
                    increment = visibleRect.y - r.y;
                }
            }
View Full Code Here

TOP

Related Classes of java.awt.Rectangle

Copyright © 2015 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.