All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.miginfocom.layout.InCellGapProvider Maven / Gradle / Ivy

Go to download

Forest-of-actors runtime supporting real-time systems and real-time recoding - bringing aspects of Erlang, Smalltalk and Extempore to Java.

There is a newer version: 6.0.0-beta2
Show newest version
package net.miginfocom.layout;

/** An interface to implement if you want to decide the gaps between two types of components within the same cell.
 * 

* E.g.: * *

 * if (adjacentComp == null || adjacentSide == SwingConstants.LEFT || adjacentSide == SwingConstants.TOP)
 *	  return null;
 *
 * boolean isHor = (adjacentSide == SwingConstants.LEFT || adjacentSide == SwingConstants.RIGHT);
 *
 * if (adjacentComp.getComponentType(false) == ComponentWrapper.TYPE_LABEL && comp.getComponentType(false) == ComponentWrapper.TYPE_TEXT_FIELD)
 *    return isHor ? UNRELATED_Y : UNRELATED_Y;
 *
 * return (adjacentSide == SwingConstants.LEFT || adjacentSide == SwingConstants.RIGHT) ? RELATED_X : RELATED_Y;
 * 
are in the same cell. * @param comp The component that the gap is for. Never null. * @param adjacentComp The adjacent component if any. May be null. * @param adjacentSide What side the adjacentComp is on. {@link javax.swing.SwingUtilities#TOP} or * {@link javax.swing.SwingUtilities#LEFT} or {@link javax.swing.SwingUtilities#BOTTOM} or {@link javax.swing.SwingUtilities#RIGHT}. * @param tag The tag string that the component might be tagged with in the component constraints. May be null. * @param isLTR If it is left-to-right. * @return The default gap between two components or null if there should be no gap. */ public abstract BoundSize getDefaultGap(ComponentWrapper comp, ComponentWrapper adjacentComp, int adjacentSide, String tag, boolean isLTR); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy