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

How to use
getMinimumSize
method
in
java.awt.Component

Best Java code snippets using java.awt.Component.getMinimumSize (Showing top 20 results out of 1,206)

origin: stackoverflow.com

Dimension min = comp.getMinimumSize();
dim.width = Math.max(dim.width, min.width);
dim.height += min.height;
origin: magefree/mage

private Dimension getDimension(Component component, int type) {
  switch (type) {
    case PREFERRED:
      return component.getPreferredSize();
    case MINIMUM:
      return component.getMinimumSize();
    default:
      return new Dimension(0, 0);
  }
}
origin: org.netbeans.api/org-openide-awt

public Dimension minimumLayoutSize(Container parent) {
  int width = 0;
  int height = 0;
  if (firstComponent != null) {
    Dimension d = firstComponent.getMinimumSize();
    width = d.width;
    height = d.height;
  }
  if (secondComponent != null) {
    Dimension d = secondComponent.getMinimumSize();
    if (splitType == VERTICAL) {
      int splitterSize = splitter.getMinimumSize().height;
      if (width < d.width) {
        width = d.width;
      }
      height += (splitterSize + d.height);
    } else {
      int splitterSize = splitter.getMinimumSize().width;
      if (height < d.height) {
        height = d.height;
      }
      width += (splitterSize + d.width);
    }
  }
  return new Dimension(width, height);
}
origin: opensourceBIM/BIMserver

/**
 * A debugging utility that prints to stdout the component's
 * minimum, preferred, and maximum sizes.
 */
public static void printSizes(Component c) {
  System.out.println("minimumSize = " + c.getMinimumSize());
  System.out.println("preferredSize = " + c.getPreferredSize());
  System.out.println("maximumSize = " + c.getMaximumSize());
}
origin: opensourceBIM/BIMserver

/**
 * A debugging utility that prints to stdout the component's
 * minimum, preferred, and maximum sizes.
 */
public static void printSizes(Component c) {
  System.out.println("minimumSize = " + c.getMinimumSize());
  System.out.println("preferredSize = " + c.getPreferredSize());
  System.out.println("maximumSize = " + c.getMaximumSize());
}
origin: org.netbeans.api/org-openide-awt

Dimension d = m.getMinimumSize();
dim.height = Math.max(dim.height, d.height);
origin: stackoverflow.com

if (m.isVisible())
  Dimension d = m.getMinimumSize();
  dim.width = Math.max(dim.width, d.width);
origin: crashinvaders/gdx-texture-packer-gui

public Dimension minimumLayoutSize (Container parent) {
  Dimension size = new Dimension();
  for (int i = 0, n = parent.getComponentCount(); i < n; i++) {
    Dimension min = parent.getComponent(i).getMinimumSize();
    size.width = Math.max(size.width, min.width);
    size.height = Math.max(size.height, min.height);
  }
  return size;
}
origin: org.nuiton.jaxx/jaxx-runtime-swing

@Override
public Dimension minimumLayoutSize(Container parent) {
  int width = 0;
  int height = (parent.getComponentCount() - 1) * spacing;
  for (int i = parent.getComponentCount() - 1; i >= 0; i--) {
    Dimension minimumSize = parent.getComponent(i).getMinimumSize();
    width = Math.max(width, minimumSize.width);
    height += minimumSize.height;
  }
  Insets insets = parent.getInsets();
  return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom);
}
origin: org.nuiton.jaxx/jaxx-runtime

@Override
public Dimension minimumLayoutSize(Container parent) {
  int width = 0;
  int height = (parent.getComponentCount() - 1) * spacing;
  for (int i = parent.getComponentCount() - 1; i >= 0; i--) {
    Dimension minimumSize = parent.getComponent(i).getMinimumSize();
    width = Math.max(width, minimumSize.width);
    height += minimumSize.height;
  }
  Insets insets = parent.getInsets();
  return new Dimension(width + insets.left + insets.right, height + insets.top + insets.bottom);
}
origin: jitsi/libjitsi

public Dimension minimumLayoutSize(Container parent)
{
  Component component = getComponent(parent);
  return
    (component != null)
      ? component.getMinimumSize()
      : new Dimension(
          DEFAULT_HEIGHT_OR_WIDTH,
          DEFAULT_HEIGHT_OR_WIDTH);
}
origin: org.apache.uima/uimaj-tools

/**
 * A debugging utility that prints to stdout the component's minimum, preferred, and maximum
 * sizes.
 *
 * @param c the c
 */
public static void printSizes(Component c) {
 System.out.println("minimumSize = " + c.getMinimumSize());
 System.out.println("preferredSize = " + c.getPreferredSize());
 System.out.println("maximumSize = " + c.getMaximumSize());
}
origin: xyz.cofe/docking-frames-core

  @Override
  public Dimension getMinimumSize(){
    Dimension base = new Dimension( 0, 0 );
    for( int i = 0, n = getComponentCount(); i < n; i++ ) {
      Dimension next = getComponent( i ).getMinimumSize();
      base.width = Math.max( base.width, next.width );
      base.height = Math.max( base.height, next.height );
    }
    return base;
  }
};
origin: net.anwiba.commons/anwiba-commons-swing-core

private int componentWidth(final OverlayConstraints constraints, final Container target, final Component component) {
 return Math.min( //
   Math.max(Double.isNaN(constraints.getWidthFactor()) //
     ? component.getWidth()
     : (int) (target.getWidth() * constraints.getWidthFactor()), component.getMinimumSize() == null //
     ? 0
     : component.getMinimumSize().width),
   component.getMaximumSize() == null //
     ? Integer.MAX_VALUE
     : component.getMaximumSize().width);
}
origin: com.metsci.glimpse/glimpse-docking

@Override
public Dimension minimumLayoutSize( Container container )
{
  Dimension sizeA = ( isVisible( childA ) ? childA.getMinimumSize( ) : null );
  Dimension sizeB = ( isVisible( childB ) ? childB.getMinimumSize( ) : null );
  return getTotalSize( sizeA, sizeB );
}
origin: JetBrains/jediterm

@Override
public Dimension minimumLayoutSize(Container container) {
 Component component = getComponent(container);
 return getSize(container, component != null ? component.getMinimumSize() : new Dimension());
}
origin: JetBrains/jediterm

@Override
@SuppressWarnings({"ConstantConditions"})
public Dimension getMinimumSize() {
 return getComponent() != null ? getComponent().getMinimumSize() : super.getPreferredSize();
}
origin: jrtom/jung

private void heightConstrain(Component component) {
 Dimension d =
   new Dimension(component.getMaximumSize().width, component.getMinimumSize().height);
 component.setMaximumSize(d);
}
origin: net.anwiba.commons/anwiba-commons-swing-core

private int componentHeight(final OverlayConstraints constraints, final Container target, final Component component) {
 return Math.min( //
   Math.max(Double.isNaN(constraints.getHeightFactor()) //
     ? component.getHeight()
     : (int) (target.getHeight() * constraints.getHeightFactor()), component.getMinimumSize() == null //
     ? 0
     : component.getMinimumSize().height),
   component.getMaximumSize() == null //
     ? Integer.MAX_VALUE
     : component.getMaximumSize().height);
}
origin: freeplane/freeplane

public Dimension minimumLayoutSize(Container parent) {
  final JSplitPane splitPane = (JSplitPane) parent;
  if(isDividerRequired(splitPane))
    return lm.minimumLayoutSize(parent);
  return splitPane.getLeftComponent().getMinimumSize();  		
}
java.awtComponentgetMinimumSize

Javadoc

Gets the mininimum size of this component.

Popular methods of Component

  • getParent
    Gets the parent of this component.
  • getPreferredSize
    Gets the preferred size of this component.
  • getHeight
    Returns the current height of this component. This method is preferable to writingcomponent.getBound
  • getWidth
    Returns the current width of this component. This method is preferable to writingcomponent.getBounds
  • isVisible
    Determines whether this component should be visible when its parent is visible. Components are initi
  • setBounds
    Moves and resizes this component to conform to the new bounding rectangle r. This component's new po
  • getName
    Gets the name of the component.
  • getSize
    Stores the width/height of this component into "return value" rv and return rv. If rv is null a newD
  • setEnabled
    Enables or disables this component, depending on the value of the parameter b. An enabled component
  • setBackground
    Sets the background color of this component. The background color affects each component differently
  • setVisible
    Shows or hides this component depending on the value of parameterb.
  • getBackground
    Gets the background color of this component.
  • setVisible,
  • getBackground,
  • addMouseListener,
  • getBounds,
  • setForeground,
  • repaint,
  • setCursor,
  • setSize,
  • requestFocus

Popular in Java

  • Running tasks concurrently on multiple threads
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • getExternalFilesDir (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Best IntelliJ plugins
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