Package java.awt

Examples of java.awt.Rectangle


    final MasterReport report = new MasterReport();
    final StaticDataFactory staticDataFactory = new StaticDataFactory();
    report.setDataFactory(staticDataFactory);
    report.setQuery("org.pentaho.reporting.engine.classic.testcases.base.functionality.demohandler.SubReportProcessingCrashTestHandler#createMainTableModel()");

    final Element textElement = TextFieldElementFactory.createStringElement("reportField1", new Rectangle(0, 0, 100, 20), Color.BLACK, ElementAlignment.LEFT, ElementAlignment.TOP, new FontDefinition("Arial", 12), "-", "c1");
    report.getItemBand().addElement(textElement);

    final SubReport subReport = new SubReport();
    subReport.addInputParameter("c1", "c1");

    subReport.setQuery("org.pentaho.reporting.engine.classic.testcases.base.functionality.demohandler.SubReportProcessingCrashTestHandler#createSubReportTableModel(c1)");
    final Element subReportTextElement = TextFieldElementFactory.createStringElement("subreportField1", new Rectangle(20, 0, 100, 20), Color.RED, ElementAlignment.LEFT, ElementAlignment.TOP, new FontDefinition("Arial", 12), "-", "t1");
    subReport.getItemBand().addElement(subReportTextElement);
    report.getItemBand().addSubReport(subReport);

    final Element textElementT1 = TextFieldElementFactory.createStringElement("reportFieldT1", new Rectangle(0, 20, 100, 20), Color.BLACK, ElementAlignment.LEFT, ElementAlignment.TOP, new FontDefinition("Arial", 12), "-", "t2");
    report.getItemBand().addElement(textElementT1);

    final ParameterMapping[] parameterMappings = subReport.getExportMappings();

    for (int i = 0; i < parameterMappings.length; i++)
View Full Code Here


      x1 = view.getInsets().left;
      x2 = view.getSize().width - view.getInsets().right;
    }
    x2 += view.getXCellSize();
    y2 += view.getYCellSize();
    return new Rectangle(x1, y1, x2, y2);
  }
View Full Code Here

    if (component != view || view.getModel() == null)
      return;
    Graphics2D g2 = (Graphics2D) g;

    ListModel model = view.getModel();
    Rectangle paintBounds = g.getClipBounds();
    Insets insets = view.getInsets();
    Dimension size = view.getSize();
    int modelSize = model.getSize();
    int xcell = view.getXCellSize(), ycell = view.getYCellSize(), counter = 0;
    metrics = g.getFontMetrics(view.getFont());
View Full Code Here

    {
      // ignore ... will fail if this is not a JDK 1.4 ..
    }

    final Dimension s = Toolkit.getDefaultToolkit().getScreenSize();
    return new Rectangle(0, 0, s.width, s.height);
  }
View Full Code Here

  public static void positionFrameOnScreen(final Window frame,
                                           final double horizontalPercent,
                                           final double verticalPercent)
  {

    final Rectangle s = frame.getGraphicsConfiguration().getBounds();
    final Dimension f = frame.getSize();

    final int spaceOnX = Math.max(s.width - f.width, 0);
    final int spaceOnY = Math.max(s.height - f.height, 0);
    final int x = (int) (horizontalPercent * spaceOnX) + s.x;
    final int y = (int) (verticalPercent * spaceOnY) + s.y;
    frame.setBounds(x, y, f.width, f.height);
    frame.setBounds(s.intersection(frame.getBounds()));
  }
View Full Code Here

    final int dialogPointX = Math.max (0, parentPointX - (int) (horizontalPercent * d.width));
    final int dialogPointY = Math.max (0, parentPointY - (int) (verticalPercent * d.height));

    // make sure the dialog fits completely on the screen...
    final Rectangle s = parent.getGraphicsConfiguration().getBounds();
    final Rectangle r = new Rectangle(dialogPointX, dialogPointY, d.width, d.height);
    final Rectangle intersectedDialogBounds = r.intersection(s);
    if (intersectedDialogBounds.width < d.width)
    {
      r.x = s.width - d.width;
      r.width = d.width;
    }
    if (intersectedDialogBounds.height < d.height)
    {
      r.y = s.height - d.height;
      r.height = d.height;
    }
    final Rectangle finalIntersection = r.intersection(s);
    dialog.setBounds(finalIntersection);
  }
View Full Code Here

  /**
   * @see Graphics#fillRect(int, int, int, int)
   */
  public void drawRect(final int x, final int y, final int width, final int height)
  {
    draw(new Rectangle(x, y, width, height));
  }
View Full Code Here

  /**
   * @see Graphics#fillRect(int, int, int, int)
   */
  public void fillRect(final int x, final int y, final int width, final int height)
  {
    fill(new Rectangle(x, y, width, height));
  }
View Full Code Here

        setListeningForChanges(listenForChanges);
    }

    @Override
    public int getFirstVisibleIndex() {
        Rectangle viewRect = getVisibleRect();
        return rowAtPoint(new Point(0, viewRect.y));
    }
View Full Code Here

        return rowAtPoint(new Point(0, viewRect.y));
    }

    @Override
    public int getLastVisibleIndex() {
        Rectangle viewRect = getVisibleRect();
        return rowAtPoint(new Point(0, viewRect.y + viewRect.height - 1));
    }
View Full Code Here

TOP

Related Classes of java.awt.Rectangle

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.