当前位置: 首页>>代码示例>>Java>>正文


Java RowSpec类代码示例

本文整理汇总了Java中com.jgoodies.forms.layout.RowSpec的典型用法代码示例。如果您正苦于以下问题:Java RowSpec类的具体用法?Java RowSpec怎么用?Java RowSpec使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RowSpec类属于com.jgoodies.forms.layout包,在下文中一共展示了RowSpec类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showWindow

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
/**
 * Define the layout for the window
 */
public void showWindow() {
    JFrame frame = new JFrame();

    // set layout of the main window
    frame.getContentPane().setLayout(
            new FormLayout(new ColumnSpec[]{
                    ColumnSpec.decode("right:max(500;pref):grow"),},
                    new RowSpec[]{
                            RowSpec.decode("pref"),
                            RowSpec.decode("default"),
                    }
            )
    );
    frame.getContentPane().add(keyComboBox, "1,1,left,top");
    frame.getContentPane().add(hexMapDisplay, "1,2,left,top");
    frame.getContentPane().setBackground(Color.BLACK);

    frame.pack();
    frame.setLocationByPlatform(true);
    frame.setVisible(true);
}
 
开发者ID:fact-project,项目名称:fact-tools,代码行数:25,代码来源:CameraWindow.java

示例2: createPopularPhrasePanel

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
private JPanel createPopularPhrasePanel(int index) {
   JPanel popularPhrasePanel = new JPanel();
   popularPhrasePanel.setLayout(new FormLayout(
         new ColumnSpec[] { ColumnSpec.decode("default"), FormFactory.RELATED_GAP_COLSPEC,
               ColumnSpec.decode("default:grow"), FormFactory.DEFAULT_COLSPEC, ColumnSpec.decode("default") },
         new RowSpec[] { FormFactory.DEFAULT_ROWSPEC }));

   popularPhrasePanel.add(new JLabel("" + (index + 1)), "1, 1");

   textFields.add(new JTextField(PROPERTIES.getPopularPhrase(index)));
   popularPhrasePanel.add(textFields.get(index), "3, 1");

   JButton playButton = new JButton(Icon.getIcon("/icons/control_play.png"));
   playButton.addActionListener(a -> speeker.speek(Arrays.asList(textFields.get(index).getText())));
   popularPhrasePanel.add(playButton, "5, 1");
   return popularPhrasePanel;
}
 
开发者ID:TypeTalk,项目名称:TypeTalk,代码行数:18,代码来源:PopularPhrasesConfigDialog.java

示例3: initUi

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
private void initUi() {
   this.setLayout(new FormLayout(
         new ColumnSpec[] { ColumnSpec.decode("default"), ColumnSpec.decode("default"),
               ColumnSpec.decode("default:grow"), ColumnSpec.decode("default") },
         new RowSpec[] { FormFactory.DEFAULT_ROWSPEC }));
   lowerBoundLabel = new JLabel(soundEffect.getSubEffects().get(subEffectKey).getLowerBoundName());
   higherBoundLabel = new JLabel(soundEffect.getSubEffects().get(subEffectKey).getHigherBoundName());
   subEffectNameLabel = new JLabel(soundEffect.getSubEffects().get(subEffectKey).getName() + ": ");
   levelSlider = new DoubleSlider(soundEffect.getLevel(subEffectKey), soundEffect.getMinimumValue(subEffectKey),
         soundEffect.getMaximumValue(subEffectKey), soundEffect.getStepSize(subEffectKey));
   levelSlider.addChangeListener(cl -> saveValue());
   add(lowerBoundLabel, "1, 1");
   add(higherBoundLabel, "4, 1");
   if (soundEffect.getSubEffects().size() == 1) {
      add(levelSlider, "2, 1, 2, 1");
   } else {
      add(subEffectNameLabel, "2 ,1");
      add(levelSlider, "3, 1");
   }
}
 
开发者ID:TypeTalk,项目名称:TypeTalk,代码行数:21,代码来源:VoiceConfigurationDialog.java

示例4: initPopularPhrasesButtonPanel

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
private void initPopularPhrasesButtonPanel() {
   popularPhrasesPanel = new JPanel();
   popularPhrasesPanel.setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("default:grow"),
         FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormFactory.RELATED_GAP_COLSPEC,
         ColumnSpec.decode("default:grow"), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"),
         FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormFactory.RELATED_GAP_COLSPEC,
         ColumnSpec.decode("default:grow"), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"),
         FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormFactory.RELATED_GAP_COLSPEC,
         ColumnSpec.decode("default:grow") }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC }));
   popularPhrasesButtons = new ArrayList<>();
   for (int i = 0; i < PROPERTIES.getPopularPhrases().length; i++) {
      JButton popularPhraseButton = new JButton("" + (i + 1));
      popularPhrasesButtons.add(popularPhraseButton);
      popularPhrasesPanel.add(popularPhraseButton, String.format("%d, 1", (1 + i * 2)));
      popularPhraseButton.addActionListener(popularPhrasesListeners.get(i));
   }
   reinitPopularPhrasesButtonsTooltip();
}
 
开发者ID:TypeTalk,项目名称:TypeTalk,代码行数:19,代码来源:ApplicationWindow.java

示例5: build

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
public PreferencePanel build()
{
	JButton btnRestore = new JButton();
	btnRestore.setText ("Restore Defaults");
	btnRestore.addActionListener(result);

	// add button to the bottom-right of the panel
	CellConstraints cc = new CellConstraints();
	builder.appendRow(RowSpec.decode("fill:pref:grow"));
	builder.add (btnRestore,
			cc.xyw(builder.getColumn(), builder.getRow(), 5, "right, bottom"));


	result.panel = builder.getPanel();
	return result;
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:17,代码来源:PreferencesDlg.java

示例6: processDrop

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
@Override
public void processDrop(final GuiEditor editor, final RadComponent[] components, final GridConstraints[] constraintsToAdjust,
                        final ComponentDragObject dragObject) {
  RadAbstractGridLayoutManager gridLayout = myContainer.getGridLayoutManager();
  if (myContainer.getGridRowCount() == 0) {
    gridLayout.insertGridCells(myContainer, 0, true, true, true);
  }
  if (myContainer.getGridColumnCount() == 0) {
    gridLayout.insertGridCells(myContainer, 0, false, true, true);
  }
  dropIntoGrid(myContainer, components, myRow, myColumn, dragObject);

  FormLayout formLayout = (FormLayout) myContainer.getDelegee().getLayout();
  if (myXPart == 0) {
    formLayout.setColumnSpec(1, new ColumnSpec("d"));
  }
  else if (myXPart == 2) {
    gridLayout.insertGridCells(myContainer, 0, false, true, true);
  }
  if (myYPart == 0) {
    formLayout.setRowSpec(1, new RowSpec("d"));
  }
  else if (myYPart == 2) {
    gridLayout.insertGridCells(myContainer, 0, true, true, true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:FormFirstComponentInsertLocation.java

示例7: SelectGridSizeFrame

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
public SelectGridSizeFrame(final Dictionary dictionary, final WordFrequencySorting sorter) {
	this.setTitle("WordBrain Solver");

	this.sorter = sorter;
	this.dictionary = dictionary;

	getContentPane().setLayout(
			new FormLayout(new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), }, new RowSpec[] {
					FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC,
					FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, }));

	final JLabel lblSelectGridSize = new JLabel("Select grid size:");
	getContentPane().add(lblSelectGridSize, "2, 2");

	txtGridSizeField = new JTextField();
	getContentPane().add(txtGridSizeField, "2, 4, fill, default");
	txtGridSizeField.setColumns(10);

	btnSetUpGrid = new JButton("Set Up Grid");
	btnSetUpGrid.addActionListener(this);
	getContentPane().add(btnSetUpGrid, "2, 6");

	this.pack();
}
 
开发者ID:angusmacdonald,项目名称:wordbrain-solver,代码行数:25,代码来源:SelectGridSizeFrame.java

示例8: MovieSetTreeCellRenderer

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
public MovieSetTreeCellRenderer() {
  movieSetPanel.setLayout(
      new FormLayout(new ColumnSpec[] { ColumnSpec.decode("min:grow"), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("center:20px"),
          ColumnSpec.decode("center:20px") }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, }));

  TmmFontHelper.changeFont(movieSetTitle, Font.BOLD);
  movieSetTitle.setHorizontalAlignment(JLabel.LEFT);
  movieSetTitle.setMinimumSize(new Dimension(0, 0));
  movieSetPanel.add(movieSetTitle, "1, 1");

  movieSetPanel.add(movieSetImageLabel, "4, 1, 1, 2");

  TmmFontHelper.changeFont(movieSetInfo, 0.816);
  movieSetInfo.setHorizontalAlignment(JLabel.LEFT);
  movieSetInfo.setMinimumSize(new Dimension(0, 0));
  movieSetPanel.add(movieSetInfo, "1, 2");

  moviePanel.setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("min:grow"), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
      ColumnSpec.decode("center:20px"), ColumnSpec.decode("center:20px") }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC }));
  movieTitle.setMinimumSize(new Dimension(0, 0));
  moviePanel.add(movieTitle, "1, 1");
  moviePanel.add(movieNfoLabel, "3, 1");
  moviePanel.add(movieImageLabel, "4, 1");
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:25,代码来源:MovieSetTreeCellRenderer.java

示例9: MediaFilesPanel

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
public MediaFilesPanel(EventList<MediaFile> mediaFiles) {
  this.mediaFileEventList = mediaFiles;
  setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("default:grow"), }, new RowSpec[] { RowSpec.decode("default:grow"), }));

  mediaFileTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(mediaFileEventList), new MediaTableFormat());
  tableFiles = new ZebraJTable(mediaFileTableModel);
  tableFiles.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

  LinkListener linkListener = new LinkListener();
  tableFiles.addMouseListener(linkListener);
  tableFiles.addMouseMotionListener(linkListener);

  scrollPaneFiles = ZebraJTable.createStripedJScrollPane(tableFiles);
  add(scrollPaneFiles, "1, 1, fill, fill");

  scrollPaneFiles.setViewportView(tableFiles);

  // align the runtime to the right
  DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer();
  rightRenderer.setHorizontalAlignment(SwingConstants.RIGHT);
  tableFiles.getColumnModel().getColumn(6).setCellRenderer(rightRenderer);
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:23,代码来源:MediaFilesPanel.java

示例10: initComponents

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
private void initComponents() {
  setLayout(new FormLayout(
      new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("50dlu"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
          FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("50dlu"),
          FormSpecs.RELATED_GAP_COLSPEC, },
      new RowSpec[] { FormSpecs.LINE_GAP_ROWSPEC, RowSpec.decode("50dlu"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("50dlu"),
          RowSpec.decode("default:grow"), FormSpecs.PARAGRAPH_GAP_ROWSPEC, }));

  final JTextPane tpGreetingHeader = new JTextPane();
  tpGreetingHeader.setEditable(false);
  tpGreetingHeader.setOpaque(false);
  tpGreetingHeader.setEditorKit(new HTMLEditorKit());
  tpGreetingHeader.setText(BUNDLE.getString("wizard.greeting.header")); //$NON-NLS-1$
  add(tpGreetingHeader, "2, 2, 7, 1, center, bottom");

  JLabel lblLogo = new JLabel("");
  lblLogo.setIcon(new Logo(96));
  add(lblLogo, "4, 5, default, top");

  JTextPane tpGreetingText = new JTextPane();
  tpGreetingText.setEditable(false);
  tpGreetingText.setText(BUNDLE.getString("wizard.greeting.text")); //$NON-NLS-1$
  tpGreetingText.setOpaque(false);
  add(tpGreetingText, "6, 5, fill, fill");
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:26,代码来源:EntrancePanel.java

示例11: MessageSummaryDialog

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
public MessageSummaryDialog(List<String> messages) {
  super(BUNDLE.getString("summarywindow.title"), "messageSummary"); //$NON-NLS-1$
  setBounds(5, 5, 1000, 590);

  messageList.addAll(messages);
  getContentPane().setLayout(
      new FormLayout(new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("684px:grow"), FormFactory.RELATED_GAP_COLSPEC, },
          new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("fill:265px:grow"), FormFactory.RELATED_GAP_ROWSPEC, }));

  JScrollPane scrollPane = new JScrollPane();
  getContentPane().add(scrollPane, "2, 2, fill, fill");

  listMessages = new JList();
  scrollPane.setViewportView(listMessages);
  initDataBindings();
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:17,代码来源:MessageSummaryDialog.java

示例12: correctNumberOfRows

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
private void correctNumberOfRows(int requiredNrOfRows, RowSpec rowSpec)
{
    int rowCount = layout.getRowCount();
    // if not initialized, set on first row
    if (row == -1 && requiredNrOfRows == -1)
    {
        requiredNrOfRows = 1;
        row = 1;
    }

    if (requiredNrOfRows > rowCount)
    {
        for (int i = rowCount; i < requiredNrOfRows; i = i + DEFAULT_ROW_INCREMENT)
        {
            if (i != 0)
                layout.appendRow(FormFactory.LINE_GAP_ROWSPEC);
            layout.appendRow(rowSpec);
        }
    }
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:21,代码来源:FormLayoutFormBuilder.java

示例13: createControl

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
protected JComponent createControl()
{
    JComponent widgetComponent = getWidget().getComponent();
    JPanel viewPanel = new JPanel(new BorderLayout());
    viewPanel.add(widgetComponent, BorderLayout.CENTER);
    Widget widget = getWidget();
    List<? extends AbstractCommand> widgetCommands = widget.getCommands();
    if (widgetCommands != null)
    {
        JComponent widgetButtonBar = CommandGroup.createCommandGroup(widgetCommands).createButtonBar(ColumnSpec.decode("fill:pref:nogrow"), RowSpec.decode("fill:default:nogrow"), null);
        JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        buttonPanel.add(widgetButtonBar);
        buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
        viewPanel.add(buttonPanel, BorderLayout.SOUTH);
    }
    return viewPanel;
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:18,代码来源:WidgetView.java

示例14: cellInternal

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
private Cell cellInternal(JComponent component, String attributes) {
    nextCol();
    Map attributeMap = getAttributes(attributes);
    RowSpec rowSpec = getRowSpec(getAttribute(ROWSPEC, attributeMap, ""));
    if (rowSpec != null) {
        setRowSpec(currentRow, rowSpec);
    }
    ColumnSpec columnSpec = getColumnSpec(getAttribute(COLSPEC, attributeMap, ""));
    if (columnSpec != null) {
        setColumnSpec(currentCol, columnSpec);
    }
    addRowGroup(getAttribute(ROWGROUPID, attributeMap, null));
    addColGroup(getAttribute(COLGROUPID, attributeMap, null));

    Cell cc = createCell(component, attributeMap);
    currentCol = cc.endCol < cc.startCol ? cc.startCol : cc.endCol;
    markContained(cc);
    return cc;
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:20,代码来源:TableLayoutBuilder.java

示例15: createTitledDialogContentPane

import com.jgoodies.forms.layout.RowSpec; //导入依赖的package包/类
@Override
protected JComponent createTitledDialogContentPane() {
	messageArea = new JTextArea();
	messageArea.setEditable(false);
	Reporter reporter = getReporter();
	Assert.notNull(reporter);
	reporter.setMessageArea(messageArea);

	JPanel panel = new JPanel(new FormLayout(new ColumnSpec[] {
			new ColumnSpec(ColumnSpec.FILL, Sizes.PREFERRED, FormSpec.DEFAULT_GROW),
			FormFactory.UNRELATED_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW) },
			new RowSpec[] { new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), }));
	CellConstraints cc = new CellConstraints();
	panel.add(reporter.getControl(), cc.xy(1, 1));
	AbstractCommand[] reporterCommands = reporter.getReporterCommands();
	AbstractCommand[] commandStack = new AbstractCommand[reporterCommands.length + 1];
	System.arraycopy(reporterCommands, 0, commandStack, 0, reporterCommands.length);
	commandStack[reporterCommands.length] = getClearTextAreaCommand();
	CommandGroup commandGroup = CommandGroup.createCommandGroup(commandStack);
	panel.add(commandGroup.createButtonStack(), cc.xy(3, 1));
	JScrollPane scrollPane = new JScrollPane(messageArea,
			ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, panel, scrollPane);
	scrollPane.setPreferredSize(new Dimension(200, 100));
	return splitPane;
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:27,代码来源:AbstractReporterTitledApplicationDialog.java


注:本文中的com.jgoodies.forms.layout.RowSpec类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。