Package java.awt

Examples of java.awt.Dimension


    addTab(EXPRESSION_TAB, expressionPanel);
    addTab(MINIMIZED_TAB, minimizedPanel);
   
    Container contents = getContentPane();
    JPanel vertStrut = new JPanel(null);
    vertStrut.setPreferredSize(new Dimension(0, 300));
    JPanel horzStrut = new JPanel(null);
    horzStrut.setPreferredSize(new Dimension(450, 0));
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(buildCircuit);
    contents.add(vertStrut, BorderLayout.WEST);
    contents.add(horzStrut, BorderLayout.NORTH);
    contents.add(tabbedPane, BorderLayout.CENTER);
View Full Code Here


      pane.setVerticalScrollBar(((TableTab) comp).getVerticalScrollBar());
    }
    pane.addComponentListener(new ComponentListener() {
      public void componentResized(ComponentEvent event) {
        int width = pane.getViewport().getWidth();
        comp.setSize(new Dimension(width, comp.getHeight()));
      }

      public void componentMoved(ComponentEvent arg0) { }
      public void componentShown(ComponentEvent arg0) { }
      public void componentHidden(ComponentEvent arg0) { }
View Full Code Here

    contents.setLayout(new BorderLayout());
    contents.add(tablePane, BorderLayout.CENTER);
    contents.add(buttonPanel, BorderLayout.PAGE_END);
    this.pack();
   
    Dimension pref = contents.getPreferredSize();
    if (pref.width > 750 || pref.height > 550) {
      if (pref.width > 750) pref.width = 750;
      if (pref.height > 550) pref.height = 550;
      this.setSize(pref);
    }
View Full Code Here

      super.setBounds(x, y, width, height);
      setPreferredColumnWidths(new double[] { 0.45, 0.25, 0.1, 0.1, 0.1 });
    }
   
    protected void setPreferredColumnWidths(double[] percentages) {
      Dimension tableDim = getPreferredSize();
     
      double total = 0;
      for (int i = 0; i < getColumnModel().getColumnCount(); i++) {
        total += percentages[i];
      }
View Full Code Here

    return tool.getDescription();
  }
 
  public Dimension getDimension(Object orientation) {
    if (icon == null) {
      return new Dimension(16, 16);
    } else {
      return new Dimension(icon.getIconWidth() + 8, icon.getIconHeight() + 8);
    }
  }
View Full Code Here

        mDialog.getContentPane().add(panel, BorderLayout.NORTH);
        mDialog.getContentPane().add(new JScrollPane(mList), BorderLayout.CENTER);
        mDialog.getContentPane().add(southPanel, BorderLayout.SOUTH);

        layoutWindow("programListWindow", mDialog, new Dimension(500, 500));

        mDialog.setVisible(true);

        mBox.getItemListeners()[0].itemStateChanged(null);
      } else {
View Full Code Here

    mCache = new Component[rowCount][3];
  }


  private void updateHeight(JTable table, int row) {
    Dimension gaps = table.getIntercellSpacing();
    int height = 0;
    if (mCache[row][0] != null) {
        height = mCache[row][0].getPreferredSize().height;
    }
View Full Code Here

 
  @Override
  public void paintComponent(Graphics g) {
    super.paintComponent(g);
   
    Dimension sz = getSize();
    int top = Math.max(0, (sz.height - tableHeight) / 2);
    int left = Math.max(0, (sz.width - tableWidth) / 2);
    Model model = getModel();
    if (model == null) return;
    Selection sel = model.getSelection();
View Full Code Here

  private void computePreferredSize() {
    Model model = getModel();
    Selection sel = model.getSelection();
    int columns = sel.size();
    if (columns == 0) {
      setPreferredSize(new Dimension(0, 0));
      return;
    }
   
    Graphics g = getGraphics();
    if (g == null) {
      cellHeight = 16;
      cellWidth = 24;
    } else {
      FontMetrics fm = g.getFontMetrics(HEAD_FONT);
      cellHeight = fm.getHeight();
      cellWidth = 24;
      for (int i = 0; i < columns; i++) {
        String header = sel.get(i).toShortString();
        cellWidth = Math.max(cellWidth, fm.stringWidth(header));
      }
    }
   
    tableWidth = (cellWidth + COLUMN_SEP) * columns - COLUMN_SEP;
    tableHeight = cellHeight * (1 + rowCount) + HEADER_SEP;
    setPreferredSize(new Dimension(tableWidth, tableHeight));
    revalidate();
    repaint();
  }
View Full Code Here

    AbstractAction action = new AbstractAction() {
      public void actionPerformed(ActionEvent evt) {
        if(getPluginManager().getFilterManager() != null) {
          MainPrintDialog mainDialog = new MainPrintDialog(getParentFrame());

          layoutWindow("mainDlg", mainDialog, new Dimension(300,150));

          mainDialog.setVisible(true);

          int result = mainDialog.getResult();
View Full Code Here

TOP

Related Classes of java.awt.Dimension

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.