congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Container.getBounds
Code IndexAdd Tabnine to your IDE (free)

How to use
getBounds
method
in
java.awt.Container

Best Java code snippets using java.awt.Container.getBounds (Showing top 20 results out of 387)

origin: JetBrains/ideavim

private void positionPanel() {
 if (parent == null) return;
 Container scroll = SwingUtilities.getAncestorOfClass(JScrollPane.class, parent);
 int height = (int)getPreferredSize().getHeight();
 if (scroll != null) {
  Rectangle bounds = scroll.getBounds();
  bounds.translate(0, scroll.getHeight() - height);
  bounds.height = height;
  Point pos = SwingUtilities.convertPoint(scroll.getParent(), bounds.getLocation(), oldGlass);
  bounds.setLocation(pos);
  setBounds(bounds);
  repaint();
 }
}
origin: JetBrains/ideavim

final int height = (int)getPreferredSize().getHeight();
if (scroll != null) {
 final Rectangle bounds = scroll.getBounds();
 bounds.translate(0, scroll.getHeight() - height);
 bounds.height = height;
origin: JetBrains/ideavim

private void positionPanel() {
 final JComponent contentComponent = myEditor.getContentComponent();
 Container scroll = SwingUtilities.getAncestorOfClass(JScrollPane.class, contentComponent);
 setSize(scroll.getSize());
 myLineHeight = myText.getFontMetrics(myText.getFont()).getHeight();
 int count = countLines(myText.getText());
 int visLines = getSize().height / myLineHeight - 1;
 int lines = Math.min(count, visLines);
 setSize(getSize().width, lines * myLineHeight + myLabel.getPreferredSize().height +
              getBorder().getBorderInsets(this).top * 2);
 int height = getSize().height;
 Rectangle bounds = scroll.getBounds();
 bounds.translate(0, scroll.getHeight() - height);
 bounds.height = height;
 Point pos = SwingUtilities.convertPoint(scroll.getParent(), bounds.getLocation(),
                     SwingUtilities.getRootPane(contentComponent).getGlassPane());
 bounds.setLocation(pos);
 setBounds(bounds);
 myScrollPane.getVerticalScrollBar().setValue(0);
 if (!Options.getInstance().isSet("more")) {
  // FIX
  scrollOffset(100000);
 }
 else {
  scrollOffset(0);
 }
}
origin: brackeen/Scared

  @Override
  public void componentResized(ComponentEvent e) {
    setBounds(contentPane.getBounds());
  }
});
origin: stackoverflow.com

 Container parent = titleLabel.getParent();
parent.scrollRectToVisible(parent.getBounds());
origin: freeplane/freeplane

@Override
public Insets getAutoscrollInsets() {
  final Container parent = getParent();
  if (parent == null) {
    return new Insets(0, 0, 0, 0);
  }
  final Rectangle outer = getBounds();
  final Rectangle inner = parent.getBounds();
  return new Insets(inner.y - outer.y + MapView.margin, inner.x - outer.x + MapView.margin, outer.height
      - inner.height - inner.y + outer.y + MapView.margin, outer.width - inner.width - inner.x + outer.x
      + MapView.margin);
}
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

private int getPopupFitHeight(Rectangle popupRectInScreen, Component invoker) {
  if (invoker != null) {
    Container parent;
    for (parent = invoker.getParent(); parent != null; parent = parent.getParent()) {
      if (parent instanceof JFrame || parent instanceof JDialog || parent instanceof JWindow) {
        return getHeightAdjust(parent.getBounds(), popupRectInScreen);
      } else if (parent instanceof JApplet || parent instanceof JInternalFrame) {
        if (popupFrameRect == null) {
          popupFrameRect = new Rectangle();
        }
        Point p = parent.getLocationOnScreen();
        popupFrameRect.setBounds(p.x, p.y, parent.getBounds().width, parent.getBounds().height);
        return getHeightAdjust(popupFrameRect, popupRectInScreen);
      }
    }
  }
  return 0;
}
origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

private int getPopupFitHeight(Rectangle popupRectInScreen, Component invoker) {
  if (invoker != null) {
    Container parent;
    for (parent = invoker.getParent(); parent != null; parent = parent.getParent()) {
      if (parent instanceof JFrame || parent instanceof JDialog || parent instanceof JWindow) {
        return getHeightAdjust(parent.getBounds(), popupRectInScreen);
      } else if (parent instanceof JApplet || parent instanceof JInternalFrame) {
        if (popupFrameRect == null) {
          popupFrameRect = new Rectangle();
        }
        Point p = parent.getLocationOnScreen();
        popupFrameRect.setBounds(p.x, p.y, parent.getBounds().width, parent.getBounds().height);
        return getHeightAdjust(popupFrameRect, popupRectInScreen);
      }
    }
  }
  return 0;
}
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

private int getPopupFitWidth(Rectangle popupRectInScreen, Component invoker) {
  if (invoker != null) {
    Container parent;
    for (parent = invoker.getParent(); parent != null; parent = parent.getParent()) {
      if (parent instanceof JFrame || parent instanceof JDialog || parent instanceof JWindow) {
        return getWidthAdjust(parent.getBounds(), popupRectInScreen);
      } else if (parent instanceof JApplet || parent instanceof JInternalFrame) {
        if (popupFrameRect == null) {
          popupFrameRect = new Rectangle();
        }
        Point p = parent.getLocationOnScreen();
        popupFrameRect.setBounds(p.x, p.y, parent.getBounds().width, parent.getBounds().height);
        return getWidthAdjust(popupFrameRect, popupRectInScreen);
      }
    }
  }
  return 0;
}
origin: antlr/antlrworks

public Insets getAutoscrollInsets() {
  Rectangle outer = getBounds();
  Rectangle inner = getParent().getBounds();
  return new Insets(inner.y-outer.y+margin, inner.x-outer.x+margin,
      outer.height-inner.height+margin,
      outer.width-inner.width+margin);
}
origin: antlr/antlrworks

public Insets getAutoscrollInsets() {
  Rectangle outer = getBounds();
  Rectangle inner = getParent().getBounds();
  return new Insets(inner.y-outer.y+AUTOSCROLL_MARGIN, inner.x-outer.x+AUTOSCROLL_MARGIN,
      outer.height-inner.height+AUTOSCROLL_MARGIN,
      outer.width-inner.width+AUTOSCROLL_MARGIN);
}
origin: uk.org.mygrid.taverna.scufl.scufl-ui-components/iteration-strategy-editor

public Insets getAutoscrollInsets() {
  Rectangle raOuter = getBounds();
  Rectangle raInner = getParent().getBounds();
  return new Insets(raInner.y - raOuter.y + AUTOSCROLL_MARGIN, raInner.x - raOuter.x + AUTOSCROLL_MARGIN,
      raOuter.height - raInner.height - raInner.y + raOuter.y + AUTOSCROLL_MARGIN, raOuter.width
          - raInner.width - raInner.x + raOuter.x + AUTOSCROLL_MARGIN);
}
origin: info.aduna.clustermap/aduna-clustermap-core

public void layoutContainer(Container parent) {
  Rectangle b = parent.getBounds();
  b.x = 0;
  b.y = 0;
  scrollPane.setBounds(b);
  toolTipPanel.setBounds(b);
}
origin: org.netbeans.modules/org-netbeans-modules-dlight-core-ui

 public void layoutContainer(Container parent) {
  Rectangle b = parent.getBounds();
  int inset = 8;
  int vOffset = 20;
  int hOffset = 0;
  int btnWSize = 80;

  if (parent.getComponentCount() > 1) {
   JButton btn = (JButton) parent.getComponent(BTN_IDX);
   int btnHSize = (int) btn.getPreferredSize().getHeight();
   btn.setBounds(b.width - inset - btnWSize, vOffset, btnWSize, btnHSize);
   hOffset = inset + btnWSize;
  }

  JComboBox combo = (JComboBox) parent.getComponent(COMBO_IDX);
  int comboHSize = (int) combo.getPreferredSize().getHeight() + 1;
  combo.setBounds(inset, vOffset, b.width - 2 * inset - hOffset, comboHSize);

 }
}
origin: joel-costigliola/assertj-swing

@RunsInCurrentThread
static @Nonnull Pair<Point, Container> pointAndParentForScrolling(final @Nonnull JTextField textField) {
 Point origin = new Point(textField.getX(), textField.getY());
 Container parent = textField.getParent();
 while (parent != null && !(parent instanceof JComponent) && !(parent instanceof CellRendererPane)) {
  origin = addRectangleToPoint(checkNotNull(parent.getBounds()), origin);
  parent = parent.getParent();
 }
 return Pair.of(origin, parent);
}
origin: net.sourceforge.mydoggy/mydoggy-plaf

public Dimension preferredLayoutSize(Container parent) {
  Dimension size = preferredNodeSize(getModel(), parent.getBounds());
  return sizeWithInsets(parent, size);
}
origin: jpcsp/jpcsp

@Override
public Rectangle getCaptureRectangle() {
  Insets insets = getInsets();
  Rectangle canvasBounds = Modules.sceDisplayModule.getCanvas().getBounds();
  Rectangle contentBounds = getContentPane().getBounds();
  return new Rectangle(getX() + insets.left + contentBounds.x + canvasBounds.x, getY() + insets.top + contentBounds.y + canvasBounds.y, canvasBounds.width, canvasBounds.height);
}
origin: mucommander/mucommander

  @Override
  public void repaint() {
    Container parent = getParent();
    if (parent != null) {
      Rectangle parentBounds = parent.getBounds();
      int parentWidth = parentBounds.width;

      if (lastParentWidth != parentWidth) {
        lastParentWidth = parentWidth;

        int itemsPerRow = parentWidth / itemWidth;
        setFixedCellWidth(itemWidth + ((parentWidth - itemWidth * itemsPerRow)/ itemsPerRow));
        setVisibleRowCount(getComponentCount() / itemsPerRow);
      }
    }
    
    super.repaint();
  }
}
origin: com.github.insubstantial/flamingo

@Override
public void layoutContainer(Container parent) {
  currLM.layoutContainer(parent);
  JRibbonFrame ribbonFrame = JRibbonFrame.this;
  if (ribbonFrame.getRootPane().getWindowDecorationStyle() != JRootPane.NONE)
    keyTipLayer
        .setBounds(ribbonFrame.getRootPane().getBounds());
  else
    keyTipLayer.setBounds(ribbonFrame.getRootPane()
        .getContentPane().getBounds());
}
origin: net.sourceforge.mydoggy/mydoggy-plaf

  public void propertyChange(PropertyChangeEvent evt) {
    if (toolWindow.getType() == ToolWindowType.FLOATING_LIVE) {
      if ((Boolean) evt.getNewValue()) {
        oldBounds = sheet.getBounds();
        Rectangle bounds = descriptor.getManager().getMainContainer().getBounds();
        bounds = SwingUtilities.convertRectangle(descriptor.getManager().getMainContainer(),
            bounds,
            descriptor.getManager().getRootPane().getLayeredPane());
        sheet.setBounds(bounds);
      } else {
        sheet.setBounds(oldBounds);
      }
      SwingUtil.repaint(sheet);
    }
  }
});
java.awtContainergetBounds

Popular methods of Container

  • add
    Adds the specified component to this container. This is a convenience method for #addImpl. This meth
  • setLayout
    Sets the layout manager for this container.
  • getComponents
    Gets all the components in this container.
  • getComponent
    Gets the nth component in this container.
  • getParent
  • getComponentCount
    Gets the number of components in this panel.
  • remove
    Removes the specified component from this container.
  • getWidth
  • getInsets
    Determines the insets of this container, which indicate the size of the container's border. A Frame
  • getSize
  • getHeight
  • repaint
  • getHeight,
  • repaint,
  • setBackground,
  • getLayout,
  • validate,
  • getTreeLock,
  • removeAll,
  • getPreferredSize,
  • getBackground

Popular in Java

  • Updating database using SQL prepared statement
  • startActivity (Activity)
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Table (org.hibernate.mapping)
    A relational table
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now