當前位置: 首頁>>代碼示例>>Java>>正文


Java ColumnSpec類代碼示例

本文整理匯總了Java中com.jgoodies.forms.layout.ColumnSpec的典型用法代碼示例。如果您正苦於以下問題:Java ColumnSpec類的具體用法?Java ColumnSpec怎麽用?Java ColumnSpec使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ColumnSpec類屬於com.jgoodies.forms.layout包,在下文中一共展示了ColumnSpec類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: showWindow

import com.jgoodies.forms.layout.ColumnSpec; //導入依賴的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.ColumnSpec; //導入依賴的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.ColumnSpec; //導入依賴的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.ColumnSpec; //導入依賴的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: processDrop

import com.jgoodies.forms.layout.ColumnSpec; //導入依賴的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

示例6: testMoveMultipleColumnsRight

import com.jgoodies.forms.layout.ColumnSpec; //導入依賴的package包/類
public void testMoveMultipleColumnsRight() {
  myManager.insertGridCells(myContainer, 0, false, false, true);
  myManager.insertGridCells(myContainer, 0, false, false, true);
  final ConstantSize colSize1 = new ConstantSize(17, ConstantSize.MM);
  final ConstantSize colSize2 = new ConstantSize(19, ConstantSize.MM);
  myLayout.setColumnSpec(1, new ColumnSpec(colSize1));
  myLayout.setColumnSpec(3, new ColumnSpec(colSize2));
  RadComponent c1 = newComponent(0, 0, 1, 1);
  myContainer.addComponent(c1);
  RadComponent c2 = newComponent(0, 2, 1, 1);
  myContainer.addComponent(c2);
  myManager.processCellsMoved(myContainer, false, new int[] { 0, 2 }, 5);
  assertEquals(colSize1, myLayout.getColumnSpec(3).getSize());
  assertEquals(colSize2, myLayout.getColumnSpec(5).getSize());
  assertEquals(3, myLayout.getConstraints(c1.getDelegee()).gridX);
  assertEquals(5, myLayout.getConstraints(c2.getDelegee()).gridX);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:RadFormLayoutManagerTest.java

示例7: SelectGridSizeFrame

import com.jgoodies.forms.layout.ColumnSpec; //導入依賴的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.ColumnSpec; //導入依賴的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.ColumnSpec; //導入依賴的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.ColumnSpec; //導入依賴的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.ColumnSpec; //導入依賴的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: createControl

import com.jgoodies.forms.layout.ColumnSpec; //導入依賴的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

示例13: cellInternal

import com.jgoodies.forms.layout.ColumnSpec; //導入依賴的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

示例14: createTitledDialogContentPane

import com.jgoodies.forms.layout.ColumnSpec; //導入依賴的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

示例15: createDialogContentPane

import com.jgoodies.forms.layout.ColumnSpec; //導入依賴的package包/類
@Override
protected JComponent createDialogContentPane() {
	JPanel panel = new JPanel(new FormLayout(new ColumnSpec[] { new ColumnSpec(ColumnSpec.LEFT, Sizes.DEFAULT,
			ColumnSpec.DEFAULT_GROW) }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
			FormFactory.DEFAULT_ROWSPEC }));
	CommandManager commandManager = Application.instance().getActiveWindow().getCommandManager();
	List<Object> members = new ArrayList<Object>();
	for (int i = 0; i < commandIds.length; i++) {
		members.add(commandManager.getCommand(commandIds[i]));
	}

	CellConstraints cc = new CellConstraints();

	CommandGroupFactoryBean commandGroupFactory = new CommandGroupFactoryBean("toolbar", members.toArray());
	panel.add(commandGroupFactory.getCommandGroup().createToolBar(), cc.xy(1, 1));

	JTextField toolbarTextField = new JTextField(20);
	toolbarTextField.setText("input");
	members.add(toolbarTextField);
	commandGroupFactory = new CommandGroupFactoryBean("toolbar2", members.toArray());
	panel.add(commandGroupFactory.getCommandGroup().createToolBar(), cc.xy(1, 3));

	return panel;
}
 
開發者ID:shevek,項目名稱:spring-rich-client,代碼行數:25,代碼來源:ToolbarSample.java


注:本文中的com.jgoodies.forms.layout.ColumnSpec類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。