net.miginfocom.layout.LC类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中net.miginfocom.layout.LC类的一些代码示例,展示了LC类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LC类的具体详情如下:
包路径:net.miginfocom.layout.LC
类名称:LC

LC介绍

[英]Contains the constraints for an instance of the LC layout manager.
[中]包含LC布局管理器实例的约束。

代码示例

代码示例来源:origin: MovingBlocks/Terasology

public void layoutContainer(Canvas canvas, int[] bounds) {
  for (ComponentWrapper wrapper : children) {
    if (wrapper instanceof MigLayout) {
      MigLayout layout = (MigLayout) wrapper;
      layout.layoutContainer(canvas, bounds);
    } else if (wrapper instanceof MigComponent) {
      MigComponent migComponent = (MigComponent) wrapper;
      migComponent.calculatePreferredSize(canvas, canvas.size());
    }
  }
  checkCache();
  if (grid.layout(bounds, lc.getAlignX(), lc.getAlignY(), debug, true)) {
    grid = null;
    checkCache();
    grid.layout(bounds, lc.getAlignX(), lc.getAlignY(), debug, false);
  }
}

代码示例来源:origin: com.miglayout/miglayout-ideutil

if (lc.isFlowX() == false)
  sb.append(asAPI ? ".flowY()" : ",flowy");
boolean fillX = lc.isFillX();
boolean fillY = lc.isFillY();
if (fillX || fillY) {
  if (fillX == fillY) {
Boolean leftToRight = lc.getLeftToRight();
if (leftToRight != null) {
  if (asAPI) {
if (!lc.getPackWidth().isUnset() || !lc.getPackHeight().isUnset()) {
  if (asAPI) {
    String w = getBS(lc.getPackWidth());
    String h = getBS(lc.getPackHeight());
    sb.append(".pack(");
    if (w.equals("pref") && h.equals("pref")) {
    String size = getBS(lc.getPackWidth()) + " " + getBS(lc.getPackHeight());
    if (size.equals("pref pref") == false)
      sb.append(' ').append(size);
if (lc.getPackWidthAlign() != 0.5f || lc.getPackHeightAlign() != 1f) {
  if (asAPI) {
    sb.append(".packAlign(").append(floatToString(lc.getPackWidthAlign(), asAPI)).append(", ").append(floatToString(lc.getPackHeightAlign(), asAPI)).append(')');
  } else {
    sb.append(",packalign ").append(floatToString(lc.getPackWidthAlign(), asAPI)).append(' ').append(floatToString(lc.getPackHeightAlign(), asAPI));

代码示例来源:origin: com.miglayout/miglayout-core

LC lc = new LC();
if (s.isEmpty())
  return lc;
  if (len == 3 || len == 11) {   // Optimization
    if (part.equals("ltr") || part.equals("rtl") || part.equals("lefttoright") || part.equals("righttoleft")) {
      lc.setLeftToRight(part.charAt(0) == 'l' ? Boolean.TRUE : Boolean.FALSE);
      lc.setTopToBottom(part.charAt(0) == 't');
      if (ix > -1) {
        String num = part.substring(ix).trim();
        lc.setWrapAfter(num.length() != 0 ? Integer.parseInt(num) : 0);
        continue;
      if (isHor && (part.startsWith("w ") || part.startsWith("width "))) {
        String sz = part.substring(part.charAt(1) == ' ' ? 2 : 6).trim();
        lc.setWidth(parseBoundSize(sz, false, true));
        continue;
        lc.setHeight(parseBoundSize(uvStr, false, false));
        continue;
        String sz = part.substring(5).trim();
        if (part.startsWith("wmin ")) {
          lc.minWidth(sz);
          continue;
        } else if (part.startsWith("wmax ")) {
          lc.maxWidth(sz);

代码示例来源:origin: stackoverflow.com

public static void main(String[] args) {
  JPanel panel1 = new JPanel(new MigLayout(new LC().fill()));
  panel1.add(new JTextField("text1"), "span, growx");
  panel1.add(new JTextField("another text field"), "span, growx");
  panel1.add(new JTextField("text3"), "span, growx");

  JPanel panel2 = new JPanel(new MigLayout());
  JTextArea textArea = new JTextArea();
  textArea.setColumns(15);
  textArea.setRows(7);
  JScrollPane jsp = new JScrollPane(textArea);
  panel2.add(jsp, "span, grow");

  JFrame frame = new JFrame();
  frame.setLayout(new GridLayout(1, 2));
  frame.add(panel1);
  frame.add(panel2);

  frame.pack();
  frame.setLocationRelativeTo(null);
  frame.setVisible(true);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}

代码示例来源:origin: joel-costigliola/assertj-examples

public SimpleFrame() {
  setMiglayout(new LC().wrapAfter(1), new AC().align("center"), new AC());

  JButton okButton = new JButton("OK");
  okButton.setName("ok");

  add(okButton);

  pack();
 }
}

代码示例来源:origin: com.miglayout/miglayout-swing

BoundSize wBounds = lc.getPackWidth();
BoundSize hBounds = lc.getPackHeight();
  int x = Math.round(p.x - ((targW - packable.getWidth()) * (1 - lc.getPackWidthAlign())));
  int y = Math.round(p.y - ((targH - packable.getHeight()) * (1 - lc.getPackHeightAlign())));

代码示例来源:origin: stackoverflow.com

LC layoutConstraints = new LC();
layoutConstraints.setFillX(true);
layoutConstraints.setDebugMillis(500);
super.setLayout(new MigLayout(layoutConstraints);

代码示例来源:origin: org.metawidget.modules/metawidget-all

LC layoutConstraints = new LC().insets( "0" );
  layoutConstraints.debug( 500 );

代码示例来源:origin: otros-systems/otroslogviewer

dialog.setModal(true);
dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
final JPanel contentPanel = new JPanel(new MigLayout(new LC().fill().width("100%")));
final JLabel label = new JLabel("Enter session name:");
final JXTextField textField = new JXTextField("session name");

代码示例来源:origin: stackoverflow.com

LC layoutConstraints = new LC();
layoutConstraints.setFillX(true);
super.setLayout(new MigLayout(layoutConstraints);

代码示例来源:origin: com.miglayout/miglayout-javafx

if (layoutConstraints.isNoCache())
  _grid = null;
lGrid.layout(lBounds, getLayoutConstraints().getAlignX(), getLayoutConstraints().getAlignY(), debug);

代码示例来源:origin: stackoverflow.com

LC lc_Y = (new LC()).fill().flowY();
lc_Y.setWrapAfter(ITEMS_PER_COLUMN);
JPanel panel = new JPanel(new MigLayout(lc_Y));

代码示例来源:origin: eugener/oxbow

final JPanel p = new JPanel(new MigLayout(new LC().flowY().noGrid()));
p.setOpaque(false);
for (final CommandLink link : choices)

代码示例来源:origin: Slowpoke101/FTBLaunch

cPnl = new JPanel();
rPnl = new JPanel();
lPnl.setLayout(new MigLayout(new LC().fillY()));
lPnl.add(enabledModsLbl, GuiConstants.WRAP);
lPnl.add(enabledModsScl, "pushy, " + GuiConstants.GROW + GuiConstants.SEP + GuiConstants.WRAP);
cPnl.add(enableMod, GuiConstants.WRAP);
cPnl.add(disableMod);
rPnl.setLayout(new MigLayout(new LC().fillY()));
rPnl.add(disabledModsLbl, GuiConstants.WRAP);
rPnl.add(disabledModsScl, "pushy, " + GuiConstants.GROW + GuiConstants.SEP + GuiConstants.WRAP);
rPnl.add(addMod, GuiConstants.FILL_SINGLE_LINE);
formPnl.setLayout(new MigLayout(new LC().fillY()));
formPnl.add(lPnl, "push, grow, " + GuiConstants.SPLIT_3);
formPnl.add(cPnl, "push, grow, center");

代码示例来源:origin: otros-systems/otroslogviewer

);
panel = new JPanel(new MigLayout(new LC().fill()));
model = new SpinnerNumberModel(12, 8, 30, 1);

代码示例来源:origin: com.miglayout/miglayout-swing

@Override
public float getLayoutAlignmentX(Container parent)
{
  return lc != null && lc.getAlignX() != null ? lc.getAlignX().getPixels(1, checkParent(parent), null) : 0;
}

代码示例来源:origin: com.miglayout/miglayout-swing

@Override
public float getLayoutAlignmentY(Container parent)
{
  return lc != null && lc.getAlignY() != null ? lc.getAlignY().getPixels(1, checkParent(parent), null) : 0;
}

代码示例来源:origin: com.miglayout/miglayout-swt

/** Returns the debug millis. Combines the value from {@link net.miginfocom.layout.LC#getDebugMillis()} and {@link net.miginfocom.layout.LayoutUtil#getGlobalDebugMillis()}
 * @return The combined value.
 */
private int getDebugMillis()
{
  int globalDebugMillis = LayoutUtil.getGlobalDebugMillis();
  return globalDebugMillis > 0 ? globalDebugMillis : lc.getDebugMillis();
}

代码示例来源:origin: stackoverflow.com

JButton closeButton = new JButton("Close");
JButton mainMenuButton = new JButton("Menu");
JLabel labelTitle = new JLabel("Application");

JPanel panel = new JPanel();
panel.setLayout(new MigLayout(new LC().fillX()));
panel.add(labelTitle, new CC().alignX("center").spanX());

JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new MigLayout(new LC().fillX()));
buttonPanel.add(closeButton, new CC().alignX("right").split());
buttonPanel.add(mainMenuButton, new CC().alignX("right"));
buttonPanel.setOpaque(false);

JXLayer<JPanel> mainPanel = new JXLayer<JPanel>();
mainPanel.setView(panel);
mainPanel.setGlassPane(buttonPanel);

JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setContentPane(mainPanel);
frame.setSize(400, 600);
frame.setVisible(true);

代码示例来源:origin: joel-costigliola/assertj-examples

public TableFrame() {
 setMiglayout(new LC().wrapAfter(1), new AC(), new AC());
 final JTable table = newTable("records", data(), columns());
 add(table);
 pack();
}

相关文章