Package java.awt

Examples of java.awt.Insets


        JButton resetButton = new JButton(getIconSource().getIcon("resetButton")) {

            @Override
            public Insets getInsets() {
                return new Insets(0, 0, 0, 0);
            }
        };
        resetButton.setToolTipText(getMessage("resetButton.label"));
        resetButton.addActionListener(new ActionListener() {
View Full Code Here


   */
  private void layoutComponents() {
    int labelAlignment = OperatingSystem.isMacOSX()
        ? GridBagConstraints.LINE_END
        : GridBagConstraints.LINE_START;
    Insets labelInsets = new Insets(0, 0, 5, 5);
    Insets componentInsets = new Insets(0, 0, 5, 0);
    if (this.defaultCreatorLabel != null) {
      add(this.defaultCreatorLabel, new GridBagConstraints(
          0, 100, 1, 1, 0, 0, labelAlignment,
          GridBagConstraints.NONE, labelInsets, 0, 0));
      add(this.defaultCreatorTextField, new GridBagConstraints(
          1, 100, 2, 1, 0, 0, GridBagConstraints.LINE_START,
          GridBagConstraints.HORIZONTAL, componentInsets, 0, 0));
    }
    if (this.offlineFurnitureLibraryLabel != null) {
      add(this.offlineFurnitureLibraryLabel, new GridBagConstraints(
          0, 101, 1, 1, 0, 0, labelAlignment,
          GridBagConstraints.NONE, labelInsets, 0, 0));
      add(this.offlineFurnitureLibraryCheckBox, new GridBagConstraints(
          1, 101, 2, 1, 0, 0, GridBagConstraints.LINE_START,
          GridBagConstraints.NONE, componentInsets, 0, 0));
    }
    if (this.furnitureResourcesLocalDirectoryLabel != null) {
      add(this.furnitureResourcesLocalDirectoryLabel, new GridBagConstraints(
          0, 102, 1, 1, 0, 0, labelAlignment,
          GridBagConstraints.NONE, labelInsets, 0, 0));
      add(this.furnitureResourcesLocalDirectoryTextField, new GridBagConstraints(
          1, 102, 2, 1, 0, 0, GridBagConstraints.LINE_START,
          GridBagConstraints.HORIZONTAL, componentInsets, 0, 0));
    }
    if (this.furnitureResourcesRemoteUrlBaseLabel != null) {
      add(this.furnitureResourcesRemoteUrlBaseLabel, new GridBagConstraints(
          0, 103, 1, 1, 0, 0, labelAlignment,
          GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0));
      add(this.furnitureResourcesRemoteUrlBaseTextField, new GridBagConstraints(
          1, 103, 2, 1, 0, 0, GridBagConstraints.LINE_START,
          GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
    }
  }
View Full Code Here

                              FurnitureLibraryUserPreferences preferences,
                              ThreadedTaskController controller) {
    super(taskMessage, preferences, controller);
    this.preferences = preferences;
    this.iconPreviewComponent = new ModelPreviewComponent();
    Insets insets = this.iconPreviewComponent.getInsets();
    this.iconPreviewComponent.setPreferredSize(
        new Dimension(128 + insets.left + insets.right, 128  + insets.top + insets.bottom));
    // Change layout
    GridBagLayout layout = new GridBagLayout();
    setLayout(layout);
    layout.setConstraints(getComponent(0), new GridBagConstraints(1, 0, 1, 1, 0, 1,
        GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 10, 0), 0, 0));
    layout.setConstraints(getComponent(1), new GridBagConstraints(1, 1, 1, 1, 0, 1,
        GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
    add(this.iconPreviewComponent, new GridBagConstraints(0, 0, 1, 2, 1, 1,
        GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 10), 0, 0));
  }
View Full Code Here

        super(str);
    }

    @Override
    public Insets getInsets() {
        return new Insets(2, 2, 2, 2);
    }
View Full Code Here

     
      // now add components into panel
      gbc.gridy = 0;
      gbc.gridx = GridBagConstraints.RELATIVE;
      gbc.anchor = GridBagConstraints.NORTHWEST;
      gbc.insets = new Insets(5, 0, 5, 0);
      gbc.fill = GridBagConstraints.NONE;
      addGb(new JLabel(Strings.get("labelCircuits") + " "));
      gbc.fill = GridBagConstraints.HORIZONTAL;
      addGb(new JScrollPane(list));
      gbc.fill = GridBagConstraints.NONE;
View Full Code Here

    gc.fill = GridBagConstraints.BOTH;
   
    JPanel selectorPanel = selector.createPanel();
    gb.setConstraints(selectorPanel, gc); add(selectorPanel);
    gb.setConstraints(prettyView, gc); add(prettyView);
      Insets oldInsets = gc.insets;
      gc.insets = new Insets(10, 10, 0, 10);
      JScrollPane fieldPane = new JScrollPane(field,
          ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
          ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    gb.setConstraints(fieldPane, gc); add(fieldPane);
      gc.insets = oldInsets;
View Full Code Here

    public void removeLayoutComponent(Component comp) { }

    public Dimension preferredLayoutSize(Container parent) {
      if (fraction <= 0.0) return comp1.getPreferredSize();
      if (fraction >= 1.0) return comp0.getPreferredSize();
      Insets in = parent.getInsets();
      Dimension d0 = comp0.getPreferredSize();
      Dimension d1 = comp1.getPreferredSize();
      return new Dimension(in.left + Math.max(d0.width, d1.width) + in.right,
          in.top + d0.height + d1.height + in.bottom);
    }
View Full Code Here

    }

    public Dimension minimumLayoutSize(Container parent) {
      if (fraction <= 0.0) return comp1.getMinimumSize();
      if (fraction >= 1.0) return comp0.getMinimumSize();
      Insets in = parent.getInsets();
      Dimension d0 = comp0.getMinimumSize();
      Dimension d1 = comp1.getMinimumSize();
      return new Dimension(in.left + Math.max(d0.width, d1.width) + in.right,
          in.top + d0.height + d1.height + in.bottom);
    }
View Full Code Here

      return new Dimension(in.left + Math.max(d0.width, d1.width) + in.right,
          in.top + d0.height + d1.height + in.bottom);
    }

    public void layoutContainer(Container parent) {
      Insets in = parent.getInsets();
      int maxWidth = parent.getWidth() - (in.left + in.right);
      int maxHeight = parent.getHeight() - (in.top + in.bottom);
      int split;
      if (fraction <= 0.0) {
        split = 0;
View Full Code Here

      return getY() + e.getY() - HorizontalSplitPane.this.getInsets().top;
    }
 
    @Override
    void setDragValue(int value) {
      Insets in = HorizontalSplitPane.this.getInsets();
      setFraction((double) value / (HorizontalSplitPane.this.getHeight() - in.bottom - in.top));
      revalidate();
    }
View Full Code Here

TOP

Related Classes of java.awt.Insets

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.