Package java.awt

Examples of java.awt.Insets


  /**
   * Transfer the buffer image to the screen
   */
  protected void paintComponent(Graphics g) {
    Insets insets = getInsets();
    int row = cursorRow - offset;
    int visibleRows = (height - insets.top - insets.bottom) / rowHeight;
    boolean doDrawCursor = drawCursor && row >= 0 && row < visibleRows;

    g.drawImage(bufferImage, 0, 0, width, height, 0, 0, width, height, this);
View Full Code Here


  public Dimension getPreferredSize(JComponent component) {
    /* Relations between width and height are not yet possible in
     * swing, this is a functioning workaround */
    Dimension dimension = new Dimension();
    Dimension current = view.getSize();
    Insets insets = view.getInsets();
    if (view.getModel() != null) {
      if (current.width == 0) {
        int length = (int) Math.sqrt(view.getModel().getSize());

        dimension.width = length * view.getXCellSize() + insets.left + insets.right;
View Full Code Here

      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

    canvas.requestFocus();
    updateBounds();
  }

  public void resize(int x, int y, int width, int height) {
    Insets insets = getInsets();
    setBounds(x, y, width + insets.left + insets.right, height + insets.top + insets.bottom);
  }
View Full Code Here

  /**
   * Paint the buffer
   */
  void paintBuffer(Graphics g) {
    Insets insets = console.getInsets();
    int visibleRows = (console.height - insets.top - insets.bottom) / console.rowHeight;
    int max = rows.size() - console.offset;

    if (visibleRows > max)
      visibleRows = max;
View Full Code Here

  public Dimension getMinimumSize() {
    return new Dimension(0, 0);
  }

  public void paintComponent(Graphics g) {
    Insets insets = getInsets();
   
    int width = getWidth() - insets.left - insets.right;
    int height = getHeight() - insets.top - insets.bottom - 1;

    g.setColor(getBackground());
View Full Code Here

        monthPanel = new MonthPanel(this, calendar);
        ComponentFactory.setBorder(monthPanel);
        getContentPane().setLayout(Layout.getGBL());
        getContentPane().add(monthPanel, Layout.getGBC( 0, 1, 1, 1, 90.0, 90.0
                            ,GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                             new Insets( 5, 5, 5, 5), 0, 0));

        repaint();
        monthPanel.revalidate();
    }
View Full Code Here

        /** main */
        getContentPane().setLayout(Layout.getGBL());

        getContentPane().add(navigationPanel, Layout.getGBC( 0, 0, 1, 1, 1.0, 1.0
               ,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                new Insets( 5, 5, 5, 5), 0, 0));

        getContentPane().add(actionsPanel,    Layout.getGBC( 0, 2, 1, 1, 1.0, 1.0
               ,GridBagConstraints.SOUTHWEST, GridBagConstraints.HORIZONTAL,
                new Insets( 0, 0, 0, 0), 0, 0));
       
        updateScreen(calendar);
       
        pack();
        setSize(new Dimension(350, 300));
View Full Code Here

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.insets = new Insets(0, 0, 0, 10);
    contentPane.add(new JLabel(messages.getString("PageSetupDialog.SheetsAcross")), gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.gridx = 1;
    gbc.gridy = 0;
    contentPane.add(new JLabel(messages.getString("PageSetupDialog.SheetsDown")), gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.weightx = 1;
    gbc.ipadx = 50;
    gbc.insets = new Insets(0, 0, 0, 10);
    contentPane.add(spanHorizontalField, gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.gridx = 1;
View Full Code Here

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.gridx = 3;
    gbc.gridy = 3;
    gbc.insets = new Insets(0, 5, 0, 0);
    contentPane.add(new JLabel(messages.getString("PageSetupDialog.Height")), gbc);

    gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.WEST;
    gbc.gridx = 4;
View Full Code Here

TOP

Related Classes of java.awt.Insets

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.