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

How to use
getTreeLock
method
in
java.awt.Container

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

origin: runelite/runelite

@Override
public Dimension minimumLayoutSize(Container parent)
{
  synchronized (parent.getTreeLock())
  {
    return calculateSize(parent, Component::getMinimumSize);
  }
}
origin: runelite/runelite

@Override
public Dimension preferredLayoutSize(Container parent)
{
  synchronized (parent.getTreeLock())
  {
    return calculateSize(parent, Component::getPreferredSize);
  }
}
origin: kiegroup/optaplanner

@Override
public void layoutContainer(Container parent) {
  update();
  synchronized (parent.getTreeLock()) {
    for (ComponentSpan span : spanMap.values()) {
      int x1 = span.topLeftCell.column.boundX;
      int collisionIndexStart = (span.collisionIndex == FILL_COLLISIONS_FLAG)
          ? 0 : span.collisionIndex;
      int y1 = span.topLeftCell.row.boundY + (collisionIndexStart * span.topLeftCell.row.baseHeight);
      int x2 = span.bottomRightCell.column.boundX + span.bottomRightCell.column.baseWidth;
      int collisionIndexEnd = (span.collisionIndex == FILL_COLLISIONS_FLAG)
          ? span.bottomRightCell.row.collisionCount : span.collisionIndex + 1;
      int y2 = span.bottomRightCell.row.boundY + (collisionIndexEnd * span.bottomRightCell.row.baseHeight);
      span.component.setBounds(x1, y1, x2 - x1, y2 - y1);
    }
  }
}
origin: runelite/runelite

@Override
public void layoutContainer(Container parent)
  synchronized (parent.getTreeLock())
origin: org.netbeans.api/org-openide-awt

private int getMaximumWidth(Container target) {
  int maxWidth = 0;
  synchronized (target.getTreeLock()) {
    int nmembers = target.getComponentCount();
    for (int i = 0; i < nmembers; i++) {
      Component m = target.getComponent(i);
      if (m.isVisible()) {
        Dimension d = m.getPreferredSize();
        maxWidth = Math.max(d.width, maxWidth);
      }
    }
  }
  return maxWidth;
}
origin: pengwei1024/AndroidSourceViewer

@Override
public Dimension preferredLayoutSize(Container target) {
  synchronized (target.getTreeLock()) {
    Dimension dim = new Dimension(0, 0);
    int count = target.getComponentCount();
    for (int i = 0; i < count; i++) {
      Component m = target.getComponent(i);
      Dimension d = m.getPreferredSize();
      dim.width = Math.max(dim.width, d.width);
      dim.height += d.height + padding;
    }
    Insets insets = target.getInsets();
    dim.width += insets.left + insets.right + padding * 2;
    dim.height += insets.top + insets.bottom + padding * 2;
    return dim;
  }
}
origin: magefree/mage

/**
 * Determines the minimum size of the container argument using this column layout. <p> The minimum width of a grid
 * layout is the largest minimum width of each column in the container, plus the horizontal padding times the number
 * of columns minus one, plus the left and right insets of the target container. <p> The minimum height of a column
 * layout is the largest minimum height of each row in the container, plus the vertical padding times the number of
 * rows minus one, plus the top and bottom insets of the target container.
 *
 * @param parent the container in which to do the layout
 * @return the minimum dimensions needed to lay out the subcomponents of the specified container
 * @see java.awt.RelativeLayout#preferredLayoutSize
 * @see java.awt.Container#doLayout
 */
@Override
public Dimension minimumLayoutSize(Container parent) {
  synchronized (parent.getTreeLock()) {
    return getLayoutSize(parent, MINIMUM);
  }
}
origin: magefree/mage

/**
 * Determines the preferred size of the container argument using this column layout. <p> The preferred width of a
 * column layout is the largest preferred width of each column in the container, plus the horizontal padding times
 * the number of columns minus one, plus the left and right insets of the target container. <p> The preferred height
 * of a column layout is the largest preferred height of each row in the container, plus the vertical padding times
 * the number of rows minus one, plus the top and bottom insets of the target container.
 *
 * @param parent the container in which to do the layout
 * @return the preferred dimensions to lay out the subcomponents of the specified container
 * @see java.awt.RelativeLayout#minimumLayoutSize
 * @see java.awt.Container#getPreferredSize()
 */
@Override
public Dimension preferredLayoutSize(Container parent) {
  synchronized (parent.getTreeLock()) {
    return getLayoutSize(parent, PREFERRED);
  }
}
origin: magefree/mage

/**
 * Lays out the specified container using this layout. <p> This method reshapes the components in the specified
 * target container in order to satisfy the constraints of the
 * <code>RelativeLayout</code> object. <p> The grid layout manager determines the size of individual components by
 * dividing the free space in the container into equal-sized portions according to the number of rows and columns in
 * the layout. The container's free space equals the container's size minus any insets and any specified horizontal
 * or vertical gap. All components in a grid layout are given the same size.
 *
 * @param parent the container in which to do the layout
 * @see java.awt.Container
 * @see java.awt.Container#doLayout
 */
@Override
public void layoutContainer(Container parent) {
  synchronized (parent.getTreeLock()) {
    if (axis == X_AXIS) {
      layoutContainerHorizontally(parent);
    } else {
      layoutContainerVertically(parent);
    }
  }
}
origin: org.netbeans.api/org-openide-awt

synchronized (target.getTreeLock()) {
  switch (getAlignment()) {
  case LEFT:
origin: org.netbeans.api/org-openide-awt

synchronized (target.getTreeLock()) {
  Dimension dim = new Dimension(0, 0);
  int nmembers = target.getComponentCount();
origin: org.netbeans.api/org-openide-awt

int maxWidth = getMaximumWidth(target);
synchronized (target.getTreeLock()) {
  Dimension dim = new Dimension(0, 0);
  int nmembers = target.getComponentCount();
origin: org.netbeans.api/org-openide-awt

int maxWidth = getMaximumWidth(target);
synchronized (target.getTreeLock()) {
  Insets insets = target.getInsets();
  int maxwidth = target.getSize().width - (insets.left + insets.right + (getHgap() * 2));
origin: JetBrains/jediterm

private static void fixComponentZOrder(Component component, int index) {
 if (component != null) {
  Container parent = component.getParent();
  synchronized (parent.getTreeLock()) {
   if (index < 0) index += parent.getComponentCount();
   parent.setComponentZOrder(component, index);
  }
 }
}
origin: com.miglayout/miglayout-swing

@Override
public Dimension minimumLayoutSize(Container parent)
{
  synchronized(parent.getTreeLock()) {
    return getSizeImpl(parent, LayoutUtil.MIN);
  }
}
origin: com.miglayout/miglayout-swing

@Override
public void addLayoutComponent(Component comp, Object constraints)
{
  synchronized(comp.getParent().getTreeLock()) {
    setComponentConstraintsImpl(comp, constraints, true);
  }
}
origin: io.ultreia.java4all.jaxx/jaxx-widgets-extra

/**
 * Method minimumLayoutSize
 *
 * @param parent
 * @return the minimum dimension of the layout
 */
@Override
public Dimension minimumLayoutSize(Container parent) {
  synchronized (parent.getTreeLock()) {
    return getMinWidthHeight(parent);
  }
}
origin: com.miglayout/miglayout-swing

@Override
public void removeLayoutComponent(Component comp)
{
  synchronized(comp.getParent().getTreeLock()) {
    scrConstrMap.remove(comp);
    ccMap.remove(new SwingComponentWrapper(comp));
    grid = null; // To clear references
  }
}
origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Creates lock object used in close and openCloneableTopComponent. */
private Object getLock() {
  if (container == null) {
    container = new java.awt.Container();
  }
  return container.getTreeLock();
}
origin: com.eas.platypus/platypus-js-forms

/**
 * Вычисление предпочитаемого размера.
 *
 * @param aTarget
 * @return
 */
private Dimension calcPreferredSize(Container aTarget) {
  synchronized (aTarget.getTreeLock()) {
    return aTarget.getSize();
  }
}

java.awtContainergetTreeLock

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,
  • removeAll,
  • getPreferredSize,
  • getBackground,
  • getBounds

Popular in Java

  • Updating database using SQL prepared statement
  • getSharedPreferences (Context)
  • setRequestProperty (URLConnection)
  • getContentResolver (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Permission (java.security)
    Legacy security code; do not use.
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Option (scala)
  • Github Copilot 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