本文整理汇总了Java中com.alee.laf.panel.WebPanel.setLayout方法的典型用法代码示例。如果您正苦于以下问题:Java WebPanel.setLayout方法的具体用法?Java WebPanel.setLayout怎么用?Java WebPanel.setLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alee.laf.panel.WebPanel
的用法示例。
在下文中一共展示了WebPanel.setLayout方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
@Override
protected void initialize(WebPanel content) {
initilizeComponents();
content.setLayout(new RiverLayout());
int scrollHeight = 220;
JScrollPane scroll = new JScrollPane(criteria);
scroll.setMaximumSize(new Dimension(0, scrollHeight));
scroll.setMinimumSize(new Dimension(0, scrollHeight));
scroll.setPreferredSize(new Dimension(0, scrollHeight));
scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
content.add("hfill", scroll);
content.add("br center", btnSearch);
content.add("center", btnReset);
content.add("br left", new MLabel(Labels.SYNSETS_COLON, 'j', synsetList));
content.add("br hfill vfill", new JScrollPane(synsetList));
content.add("br left", infoLabel);
}
示例2: initialize
import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
/**
* @param content JPanel from workbench
* @author amusial
*/
@Override
protected void initialize(WebPanel content) {
content.removeAll();
content.setLayout(new RiverLayout());
// Create a panel for visualisation visualisation.
JPanel graph;
try {
graph = getSampleGraphViewer();
content.add(graph, "hfill vfill");
} catch (IOException ex) {
logger().error("IO exception", ex);
}
}
示例3: initialize
import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
@Override
protected void initialize(WebPanel content) {
content.setLayout(new RiverLayout());
dlm = new DefaultListModel();
jl = new WebList(dlm);
jl.setLayoutOrientation(JList.HORIZONTAL_WRAP);
jl.setVisibleRowCount(1);
jl.setCellRenderer(new CustomCellRenderer());
jl.addMouseListener(new LockerMouseAdapter());
jl.addListSelectionListener(this);
content.add(new JScrollPane(jl), "hfill vfill");
}
示例4: initialize
import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
@Override
protected void initialize(WebPanel content) {
content.setLayout(new RiverLayout());
definitionValue = new MTextArea(Labels.VALUE_UNKNOWN);
definitionValue.addCaretListener(this);
definitionValue.setRows(3);
commentValue = new MTextArea(Labels.VALUE_UNKNOWN);
commentValue.addCaretListener(this);
commentValue.setRows(3);
abstractValue = new JCheckBox(Labels.ARTIFICIAL);
abstractValue.setSelected(false);
abstractValue.addActionListener(this);
content.add("vtop", new JLabel(Labels.DEFINITION_COLON));
content.add("tab hfill", new JScrollPane(definitionValue));
content.add("br vtop", new JLabel(Labels.COMMENT_COLON));
content.add("tab hfill", new JScrollPane(commentValue));
content.add("br", abstractValue);
content.add("br center", buttonSave);
// ustawienie akywnosci
commentValue.setEnabled(false);
definitionValue.setEnabled(false);
abstractValue.setEnabled(false);
}
示例5: initialize
import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
@Override
protected void initialize(WebPanel content) {
rootPanel = content;
content.setLayout(new RiverLayout());
// Create and add a panel for visualisation visualization.
content.add(getSatelliteGraphViewer(), "hfill vfill");
}
示例6: initialize
import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
@Override
protected void initialize(WebPanel content) {
content.setLayout(new RiverLayout());
root = new DefaultMutableTreeNode("");
tree = new WebTree(root);
tree.addTreeSelectionListener(this);
tree.setCellRenderer(new ViwnLexicalUnitRelationRenderer());
root_from = new DefaultMutableTreeNode(Labels.FROM);
root_to = new DefaultMutableTreeNode(Labels.TO);
root.add(root_from);
root.add(root_to);
addRelationButton = MButton.buildAddButton(this)
.withEnabled(true)
.withToolTip(Hints.ADD_RELATION_UNITS);
installViewScopeShortCut(addRelationButton, 0, KeyEvent.VK_INSERT);
deleteRelationButton = MButton.buildDeleteButton(this)
.withEnabled(true)
.withToolTip(Hints.REMOVE_RELTAION_UNITS);
installViewScopeShortCut(deleteRelationButton, 0, KeyEvent.VK_DELETE);
content.add("hfill vfill", new JScrollPane(tree));
content.add("br center", addRelationButton);
content.add(deleteRelationButton);
}
示例7: initView
import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
@Override
protected void initView() {
add("",
new MLabel(Labels.RELATION_TYPE_COLON, 't', relationType));
add("tab hfill", relationType);
add("br", new MLabel(Labels.RELATION_SUBTYPE_COLON, 'y',
relationType));
add("tab hfill", relationSubType);
add("br", new MLabel(Labels.RELATION_DESC_COLON, '\0',
description));
add("br hfill", new JScrollPane(description));
jp = new WebPanel();
jp.setLayout(new RiverLayout());
jp.add("br", new MLabel(Labels.SOURCE_SYNSET_COLON, 'r', parentItem));
jp.add("tab hfill", parentItem);
jp.add("br", new MLabel(Labels.TARGET_SYNSET_COLON, 'd', childItem));
jp.add("tab hfill", childItem);
add("br hfill", jp);
add("", buttonSwitch);
add("br", new MLabel(Labels.TESTS_COLON, '\0', testsList));
add("br hfill vfill", new JScrollPane(testsList));
add("br center", buttonChoose);
add("", buttonCancel);
}
示例8: GridEffectDialog
import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
public GridEffectDialog(int cols, int rows, String title, ImageIcon icon)
{
this.dialog = new WebDialog(Spade.main.gui.frame, title);
if(icon != null)
dialog.setIconImage(icon.getImage());
dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
dialog.setAlwaysOnTop(true);
dialog.setAutoRequestFocus(true);
dialog.setShowResizeCorner(false);
panels = new JPanel[rows * cols];
JPanel pane = (JPanel) dialog.getContentPane();
WebPanel panel = new WebPanel();
panel.setLayout(new GridLayout(rows, cols));
for(int i = 0; i < cols * rows; i++)
{
panel.add(panels[i] = new WebPanel());
}
bottom = new WebPanel();
pane.add(panel, BorderLayout.CENTER);
pane.add(bottom, BorderLayout.SOUTH);
}
示例9: initialize
import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
@Override
protected void initialize(WebPanel content) {
// ustawienie layoutu
content.setLayout(new RiverLayout());
criteria = initSenseCriteria();
btnSearch = MButton.buildSearchButton()
.withActionListener(this);
btnReset = MButton.buildClearButton()
.withActionListener(this);
unitsList = new ToolTipList(workbench, listModel, ToolTipGenerator.getGenerator());
unitsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
unitsList.getSelectionModel().addListSelectionListener(this);
infoLabel = new JLabel();
infoLabel.setText(String.format(Labels.VALUE_COUNT_SIMPLE, "0"));
btnNewWithSyns = new MButton(this)
.withIcon(FontAwesome.PLUS_SQUARE)
.withToolTip(Hints.CREATE_NEW_UNIT_AND_SYNSET);
btnNew = new MButton(this)
.withIcon(FontAwesome.PLUS)
.withToolTip(Hints.CREATE_NEW_UNIT);
installViewScopeShortCut(btnNew, 0, KeyEvent.VK_INSERT);
btnDelete = MButton.buildDeleteButton()
.withActionListener(this)
.withEnabled(false)
.withToolTip(Hints.REMOVE_UNIT);
installViewScopeShortCut(btnDelete, 0, KeyEvent.VK_DELETE);
btnAddToSyns = new MButton(this)
.withIcon(FontAwesome.SIGN_IN)
.withToolTip(Hints.ADD_TO_NEW_SYNSET)
.withEnabled(false);
JPanel buttons = new MButtonPanel(btnNewWithSyns, btnNew, btnDelete, btnAddToSyns)
.withHorizontalLayout();
JScrollPane scroll = new JScrollPane(criteria);
scroll.setMaximumSize(DEFAULT_SCROLL_DIMENSION);
scroll.setMinimumSize(DEFAULT_SCROLL_DIMENSION);
scroll.setPreferredSize(DEFAULT_SCROLL_DIMENSION);
scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
content.setLayout(new RiverLayout());
content.add("hfill", scroll);
content.add("br center", btnSearch);
content.add("center", btnReset);
content.add("br left", new MLabel(Labels.LEXICAL_UNITS_COLON, 'j', unitsList));
unitsListScrollPane = new LazyScrollPane(unitsList, LIMIT);
unitsListScrollPane.setScrollListener((offset, limit) -> loadUnits());
final Font listFont = new Font("Courier New", Font.PLAIN, 14);
unitsList.setCellRenderer((list, value, index, isSelected, cellHasFocus) -> {
JLabel label = new JLabel();
label.setFont(listFont);
Sense sense = (Sense) value;
StringBuilder nameBuilder = new StringBuilder();
nameBuilder.append(sense.getWord()).append(" ")
.append(sense.getVariant())
.append("(").append(sense.getDomain().getName()).append(") ") //TODO zamienić id domeny na tekst
.append(sense.getLexicon().getIdentifier());
label.setText(nameBuilder.toString());
return label;
});
content.add("br hfill vfill", unitsListScrollPane);
content.add("br left", infoLabel);
content.add("br center", buttons);
}
示例10: EditItemForm
import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
public EditItemForm() {
super();
originalNameTextField = new WebTextField();
// originalNameTextField.setMinimumWidth(100);
localizedNameTextField = new WebTextField();
// localizedNameTextField.setMinimumWidth(100);
countryComboBox = new WebComboBox(getCountries());
typeComboBox = new WebComboBox(MediaType.values());
statusComboBox = new WebComboBox(MediaStatus.values());
maxEpisodes = new WebSpinner(new SpinnerNumberModel(1, 1, 999, 1));
episodesWatched = new WebSpinner(new SpinnerNumberModel(0, 0, 1, 1));
startDate = new WebDateField();
endDate = new WebDateField();
WebButton startDateClearButton = new WebButton("Clear", new ClearDateActionListener(startDate));
WebButton endDateClearButton = new WebButton("Clear", new ClearDateActionListener(endDate));
statusComboBox.addActionListener(new StatusChangeListener(maxEpisodes, episodesWatched,
startDate, endDate, new WebButton[]{startDateClearButton, endDateClearButton}));
maxEpisodes.addChangeListener(new MaxEpisodesChangeListener(episodesWatched, statusComboBox));
statusComboBox.setSelectedIndex(0); // fires initial notification
setModal(true);
setResizable(false);
setMinimumSize(new Dimension(500, 400));
setLayout(new BorderLayout(5, 5));
WebPanel panel = new WebPanel();
panel.setLayout(createLayout());
panel.setMargin(5, 5, 5, 5);
panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.originalName")), "0,0");
panel.add(originalNameTextField, "1,0,3,0");
panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.localizedName")), "0,1");
panel.add(localizedNameTextField, "1,1,3,1");
panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.country")), "0,2");
panel.add(countryComboBox, "1,2,3,2");
panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.type")), "0,3");
panel.add(typeComboBox, "1,3,3,3");
panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.status")), "0,4");
panel.add(statusComboBox, "1,4,3,4");
panel.add(new WebLabel(AppSettings.getLocalizedString("editForm.fields.progress")), "0,5");
panel.add(episodesWatched, "1,5");
panel.add(new WebLabel("/"), "2,5");
panel.add(maxEpisodes, "3,5");
panel.add(new WebLabel("startDate"), "0,6");
panel.add(startDate, "1,6");
panel.add(startDateClearButton, "3,6");
panel.add(new WebLabel("endDate"), "0,7");
panel.add(endDate, "1,7");
panel.add(endDateClearButton, "3,7");
// panel.setLayout(new FormLayout(false, true));
// panel.setMargin(5, 5, 5, 5);
// panel.add(new WebLabel("nameOrig"), FormLayout.LEFT);
// panel.add(nameOrigTextField, FormLayout.RIGHT);
// panel.add(new WebLabel("country"), FormLayout.LEFT);
// panel.add(countryTextField, FormLayout.RIGHT);
// panel.add(new WebLabel("type"), FormLayout.LEFT);
// panel.add(typeComboBox, FormLayout.RIGHT);
// panel.add(new WebLabel("status"), FormLayout.LEFT);
// panel.add(statusComboBox, FormLayout.RIGHT);
add(panel, BorderLayout.NORTH);
add(createSaveButton(), BorderLayout.SOUTH);
setTitle(AppSettings.getLocalizedString("editForm.title"));
}
示例11: showException
import com.alee.laf.panel.WebPanel; //导入方法依赖的package包/类
public static void showException(String title, Exception e, String msg2)
{
WebDialog dialog = new WebDialog(Spade.main.gui.frame, title);
dialog.setModal(true);
WebTextArea text = new WebTextArea();
text.setEditable(false);
text.setWrapStyleWord(true);
text.setLineWrap(true);
text.setFontName(Font.MONOSPACED);
StringWriter msg = new StringWriter();
e.printStackTrace(new PrintWriter(msg));
text.append(msg.toString());
JPanel panel = (JPanel) dialog.getContentPane();
panel.setLayout(new BorderLayout());
panel.setPreferredSize(new Dimension(800, 400));
WebScrollPane scroll = new WebScrollPane(text);
panel.add(new WebLabel("An Exception Occured: ").setMargin(5), BorderLayout.NORTH);
panel.add(scroll, BorderLayout.CENTER);
WebPanel bottom = new WebPanel();
bottom.setLayout(new BorderLayout());
WebTextArea report =
new WebTextArea("Please copy the above message and report it to " + Spade.REPO_URL
+ " along with details of what you were doing when it happened.");
report.setLineWrap(true);
report.setWrapStyleWord(true);
report.setEditable(false);
report.setMargin(5);
WebTextArea endMsg = new WebTextArea(msg2);
endMsg.setLineWrap(true);
endMsg.setWrapStyleWord(true);
endMsg.setEditable(false);
endMsg.setMargin(5);
bottom.add(report, BorderLayout.NORTH);
bottom.add(endMsg, BorderLayout.CENTER);
panel.add(bottom, BorderLayout.SOUTH);
dialog.pack();
dialog.setResizable(true);
dialog.setVisible(true);
dialog.setLocationRelativeTo(Spade.main.gui.frame);
}