com.bc.ceres.swing.TableLayout.setRowFill()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(11.8k)|赞(0)|评价(0)|浏览(136)

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

TableLayout.setRowFill介绍

暂无

代码示例

代码示例来源:origin: senbox-org/snap-desktop

private void toggleCollapsed(int index) {
  final boolean isCollapsed = !collapsed[index];
  collapsed[index] = isCollapsed;
  int rowIndex = (index * 2) + 2;
  if (isCollapsed) {
    spectraPanelLayout.setRowFill(rowIndex, TableLayout.Fill.HORIZONTAL);
    spectraPanelLayout.setRowWeightY(rowIndex, 0.0);
    bandTablePanels[index].removeAll();
  } else {
    spectraPanelLayout.setRowFill(rowIndex, TableLayout.Fill.BOTH);
    spectraPanelLayout.setRowWeightY(rowIndex, 1.0);
    bandTablePanels[index].add(bandTables[index].getTableHeader(), BorderLayout.NORTH);
    bandTablePanels[index].add(bandTables[index], BorderLayout.CENTER);
  }
  bandTablePanels[index].updateUI();
  spectraPanel.updateUI();
}

代码示例来源:origin: bcdev/beam

public JPanel createDefaultPanel() {
  final JPanel subPanel = new JPanel(new BorderLayout(3, 3));
  subPanel.add(getProductNameComboBox(), BorderLayout.CENTER);
  subPanel.add(getProductFileChooserButton(), BorderLayout.EAST);
  final TableLayout tableLayout = new TableLayout(1);
  tableLayout.setTableAnchor(TableLayout.Anchor.WEST);
  tableLayout.setTableWeightX(1.0);
  tableLayout.setRowFill(0, TableLayout.Fill.HORIZONTAL);
  tableLayout.setRowFill(1, TableLayout.Fill.HORIZONTAL);
  tableLayout.setTablePadding(3, 3);
  JPanel panel = new JPanel(tableLayout);
  panel.setBorder(BorderFactory.createTitledBorder("Source Product"));
  panel.add(getProductNameLabel());
  panel.add(subPanel);
  panel.add(tableLayout.createVerticalSpacer());
  return panel;
}

代码示例来源:origin: senbox-org/s2tbx

private JPanel createUpdateProductSelectorPanel(final SourceProductSelector selector) {
  final JPanel subPanel = new JPanel(new BorderLayout(3, 3));
  subPanel.add(selector.getProductNameComboBox(), BorderLayout.CENTER);
  subPanel.add(selector.getProductFileChooserButton(), BorderLayout.EAST);
  final TableLayout tableLayout = new TableLayout(1);
  tableLayout.setTableAnchor(TableLayout.Anchor.WEST);
  tableLayout.setTableWeightX(1.0);
  tableLayout.setRowFill(0, TableLayout.Fill.HORIZONTAL);
  tableLayout.setRowFill(1, TableLayout.Fill.HORIZONTAL);
  tableLayout.setTablePadding(3, 3);
  JPanel panel = new JPanel(tableLayout);
  panel.add(selector.getProductNameLabel());
  panel.add(subPanel);
  panel.add(tableLayout.createVerticalSpacer());
  return panel;
}

代码示例来源:origin: senbox-org/snap-desktop

public JPanel createDefaultPanel(String borderTitle) {
  final JPanel subPanel = new JPanel(new BorderLayout(3, 3));
  subPanel.add(getProductNameComboBox(), BorderLayout.CENTER);
  subPanel.add(getProductFileChooserButton(), BorderLayout.EAST);
  final TableLayout tableLayout = new TableLayout(1);
  tableLayout.setTableAnchor(TableLayout.Anchor.WEST);
  tableLayout.setTableWeightX(1.0);
  tableLayout.setRowFill(0, TableLayout.Fill.HORIZONTAL);
  tableLayout.setRowFill(1, TableLayout.Fill.HORIZONTAL);
  tableLayout.setTablePadding(3, 3);
  JPanel panel = new JPanel(tableLayout);
  panel.add(getProductNameLabel());
  panel.add(subPanel);
  if (StringUtils.isNotNullAndNotEmpty(borderTitle)) {
    panel.setBorder(BorderFactory.createTitledBorder(borderTitle));
    panel.add(tableLayout.createVerticalSpacer());
  }
  return panel;
}

代码示例来源:origin: senbox-org/snap-desktop

private JPanel createUpdateProductSelectorPanel(final SourceProductSelector selector) {
  final JPanel subPanel = new JPanel(new BorderLayout(3, 3));
  subPanel.add(selector.getProductNameComboBox(), BorderLayout.CENTER);
  subPanel.add(selector.getProductFileChooserButton(), BorderLayout.EAST);
  final TableLayout tableLayout = new TableLayout(1);
  tableLayout.setTableAnchor(TableLayout.Anchor.WEST);
  tableLayout.setTableWeightX(1.0);
  tableLayout.setRowFill(0, TableLayout.Fill.HORIZONTAL);
  tableLayout.setRowFill(1, TableLayout.Fill.HORIZONTAL);
  tableLayout.setTablePadding(3, 3);
  JPanel panel = new JPanel(tableLayout);
  panel.add(selector.getProductNameLabel());
  panel.add(subPanel);
  panel.add(tableLayout.createVerticalSpacer());
  return panel;
}

代码示例来源:origin: bcdev/beam

private JPanel createUpdateProductSelectorPanel(final SourceProductSelector selector) {
  final JPanel subPanel = new JPanel(new BorderLayout(3, 3));
  subPanel.add(selector.getProductNameComboBox(), BorderLayout.CENTER);
  subPanel.add(selector.getProductFileChooserButton(), BorderLayout.EAST);
  final TableLayout tableLayout = new TableLayout(1);
  tableLayout.setTableAnchor(TableLayout.Anchor.WEST);
  tableLayout.setTableWeightX(1.0);
  tableLayout.setRowFill(0, TableLayout.Fill.HORIZONTAL);
  tableLayout.setRowFill(1, TableLayout.Fill.HORIZONTAL);
  tableLayout.setTablePadding(3, 3);
  JPanel panel = new JPanel(tableLayout);
  panel.add(selector.getProductNameLabel());
  panel.add(subPanel);
  panel.add(tableLayout.createVerticalSpacer());
  return panel;
}

代码示例来源:origin: bcdev/beam

private static TableLayout createLayout() {
    final TableLayout tableLayout = new TableLayout(1);
    tableLayout.setRowPadding(0, new Insets(4, 4, 4, 0));
    tableLayout.setColumnWeightX(0, 1.0);
    tableLayout.setRowWeightY(1, 1.0);
    tableLayout.setTableFill(TableLayout.Fill.HORIZONTAL);
    tableLayout.setRowFill(1, TableLayout.Fill.BOTH);
    return tableLayout;
  }
}

代码示例来源:origin: bcdev/beam

private JPanel createVariablePanel(String title, VariableSelectionPane variablePane) {
  final TableLayout layout = new TableLayout(1);
  layout.setTableAnchor(TableLayout.Anchor.NORTHWEST);
  layout.setTableFill(TableLayout.Fill.HORIZONTAL);
  layout.setTableWeightX(1.0);
  layout.setRowWeightY(0, 0.0);
  layout.setRowWeightY(1, 1.0);
  layout.setRowFill(1, TableLayout.Fill.BOTH);
  final JPanel panel = new JPanel(layout);
  panel.add(new TitledSeparator(title));
  variablePane.setPreferredSize(new Dimension(150, 80));
  panel.add(variablePane);
  return panel;
}

代码示例来源:origin: bcdev/beam

private JPanel createProductsPanel() {
  final TableLayout layout = new TableLayout(1);
  layout.setTableAnchor(TableLayout.Anchor.NORTHWEST);
  layout.setTableFill(TableLayout.Fill.HORIZONTAL);
  layout.setTableWeightX(1.0);
  layout.setRowWeightY(0, 0.0);
  layout.setRowWeightY(1, 1.0);
  layout.setRowFill(1, TableLayout.Fill.BOTH);
  final JPanel panel = new JPanel(layout);
  panel.add(new TitledSeparator("Product Sources"));
  locationsPane = new ProductLocationsPane();
  locationsPane.setPreferredSize(new Dimension(150, 80));
  panel.add(locationsPane);
  return panel;
}

代码示例来源:origin: senbox-org/snap-desktop

tableLayout.setTableAnchor(TableLayout.Anchor.NORTHWEST);
tableLayout.setCellAnchor(0, 1, TableLayout.Anchor.NORTHEAST); // edit expression button
tableLayout.setRowFill(0, TableLayout.Fill.VERTICAL);
tableLayout.setCellFill(1, 0, TableLayout.Fill.BOTH); // expression text area
tableLayout.setCellWeightY(1, 0, 1.0);

代码示例来源:origin: bcdev/beam

tableLayout.setTableAnchor(TableLayout.Anchor.NORTHWEST);
tableLayout.setCellAnchor(0, 1, TableLayout.Anchor.NORTHEAST); // edit expression button
tableLayout.setRowFill(0, TableLayout.Fill.VERTICAL);
tableLayout.setCellFill(1, 0, TableLayout.Fill.BOTH); // expression text area
tableLayout.setCellWeightY(1, 0, 1.0);

代码示例来源:origin: senbox-org/snap-desktop

private JPanel createMosaicBoundsPanel() {
  final TableLayout layout = new TableLayout(1);
  layout.setTableAnchor(TableLayout.Anchor.WEST);
  layout.setTableFill(TableLayout.Fill.BOTH);
  layout.setTableWeightX(1.0);
  layout.setTableWeightY(0.0);
  layout.setRowWeightY(1, 1.0);
  layout.setRowAnchor(2, TableLayout.Anchor.EAST);
  layout.setRowFill(2, TableLayout.Fill.NONE);
  layout.setTablePadding(3, 3);
  final JPanel panel = new JPanel(layout);
  panel.setBorder(BorderFactory.createTitledBorder("Mosaic Bounds"));
  final WorldMapPaneDataModel worldMapModel = mosaicModel.getWorldMapModel();
  setMapBoundary(worldMapModel);
  final JPanel worldMapPanel = new RegionSelectableWorldMapPane(worldMapModel, bindingCtx).createUI();
  bindingCtx.addPropertyChangeListener(new MapBoundsChangeListener());
  worldMapPanel.setMinimumSize(new Dimension(250, 125));
  worldMapPanel.setBorder(BorderFactory.createEtchedBorder());
  final JCheckBox showSourceProductsCheckBox = new JCheckBox("Display source products");
  bindingCtx.bind(MosaicFormModel.PROPERTY_SHOW_SOURCE_PRODUCTS, showSourceProductsCheckBox);
  boundsInputPanel = new BoundsInputPanel(bindingCtx, MosaicFormModel.PROPERTY_UPDATE_MODE);
  panel.add(boundsInputPanel.createBoundsInputPanel(true));
  panel.add(worldMapPanel);
  panel.add(showSourceProductsCheckBox);
  return panel;
}

代码示例来源:origin: bcdev/beam

private JPanel createMosaicBoundsPanel() {
  final TableLayout layout = new TableLayout(1);
  layout.setTableAnchor(TableLayout.Anchor.WEST);
  layout.setTableFill(TableLayout.Fill.BOTH);
  layout.setTableWeightX(1.0);
  layout.setTableWeightY(0.0);
  layout.setRowWeightY(1, 1.0);
  layout.setRowAnchor(2, TableLayout.Anchor.EAST);
  layout.setRowFill(2, TableLayout.Fill.NONE);
  layout.setTablePadding(3, 3);
  final JPanel panel = new JPanel(layout);
  panel.setBorder(BorderFactory.createTitledBorder("Mosaic Bounds"));
  final WorldMapPaneDataModel worldMapModel = mosaicModel.getWorldMapModel();
  setMapBoundary(worldMapModel);
  final JPanel worldMapPanel = new RegionSelectableWorldMapPane(worldMapModel, bindingCtx).createUI();
  bindingCtx.addPropertyChangeListener(new MapBoundsChangeListener());
  worldMapPanel.setMinimumSize(new Dimension(250, 125));
  worldMapPanel.setBorder(BorderFactory.createEtchedBorder());
  final JCheckBox showSourceProductsCheckBox = new JCheckBox("Display source products");
  bindingCtx.bind(MosaicFormModel.PROPERTY_SHOW_SOURCE_PRODUCTS, showSourceProductsCheckBox);
  boundsInputPanel = new BoundsInputPanel(bindingCtx, MosaicFormModel.PROPERTY_UPDATE_MODE);
  panel.add(boundsInputPanel.createBoundsInputPanel(true));
  panel.add(worldMapPanel);
  panel.add(showSourceProductsCheckBox);
  return panel;
}

代码示例来源:origin: senbox-org/s2tbx

layout.setRowWeightY(1, 1.0);
layout.setRowAnchor(2, TableLayout.Anchor.WEST);
layout.setRowFill(2, TableLayout.Fill.NONE);
layout.setTablePadding(3, 3);
final JPanel panel = new JPanel(layout);

代码示例来源:origin: bcdev/beam

tableLayout.setTableAnchor(TableLayout.Anchor.NORTHWEST);
tableLayout.setTableFill(TableLayout.Fill.HORIZONTAL);
tableLayout.setRowFill(1, TableLayout.Fill.BOTH);
tableLayout.setCellFill(0, 0, TableLayout.Fill.BOTH);
tableLayout.setCellColspan(1, 0, 2);

代码示例来源:origin: senbox-org/snap-desktop

tableLayout.setTableAnchor(TableLayout.Anchor.NORTHWEST);
tableLayout.setTableFill(TableLayout.Fill.HORIZONTAL);
tableLayout.setRowFill(1, TableLayout.Fill.BOTH);
tableLayout.setCellFill(0, 0, TableLayout.Fill.BOTH);
tableLayout.setCellColspan(1, 0, 2);

代码示例来源:origin: bcdev/beam

private TableLayout createLayout() {
  final TableLayout layout = new TableLayout(4);
  layout.setTableAnchor(TableLayout.Anchor.NORTHWEST);
  layout.setTablePadding(new Insets(4, 4, 4, 4));
  layout.setColumnFill(0, TableLayout.Fill.BOTH);
  layout.setColumnFill(1, TableLayout.Fill.VERTICAL);
  layout.setColumnFill(2, TableLayout.Fill.BOTH);
  layout.setColumnFill(3, TableLayout.Fill.BOTH);
  layout.setRowFill(0, TableLayout.Fill.NONE);
  layout.setRowAnchor(0, TableLayout.Anchor.SOUTHWEST);
  layout.setRowWeightY(1, 100.0);
  layout.setColumnWeightX(0, 100.0);
  layout.setColumnWeightX(2, 100.0);
  layout.setColumnWeightX(3, 100.0);
  layout.setCellFill(0, 0, TableLayout.Fill.NONE);
  layout.setCellFill(0, 1, TableLayout.Fill.NONE);
  layout.setCellFill(0, 2, TableLayout.Fill.NONE);
  layout.setCellFill(0, 3, TableLayout.Fill.NONE);
  return layout;
}

代码示例来源:origin: senbox-org/s2tbx

public void populate(List<JComponent[]> componentsList) {
  TableLayout layout = (TableLayout)getLayout();
  int rowIndex = 0;
  for (JComponent[] components : componentsList) {
    if (components.length == 2) {
      layout.setCellWeightX(rowIndex, 0, 0.0);
      add(components[1], cell(rowIndex, 0));
      layout.setCellWeightX(rowIndex, 1, 1.0);
      if(components[0] instanceof JScrollPane) {
        layout.setRowWeightY(rowIndex, 1.0);
        layout.setRowFill(rowIndex, TableLayout.Fill.BOTH);
      }
      add(components[0], cell(rowIndex, 1));
    } else {
      layout.setCellColspan(rowIndex, 0, 2);
      layout.setCellWeightX(rowIndex, 0, 1.0);
      add(components[0], cell(rowIndex, 0));
    }
    rowIndex++;
  }
  layout.setCellColspan(rowIndex, 0, 2);
  layout.setCellWeightX(rowIndex, 0, 1.0);
  layout.setCellWeightY(rowIndex, 0, 0.5);
}

代码示例来源:origin: senbox-org/s2tbx

if(components[0] instanceof JScrollPane) {
  layout.setRowWeightY(rowIndex, 1.0);
  layout.setRowFill(rowIndex, TableLayout.Fill.BOTH);

相关文章