本文整理汇总了Java中javax.swing.JComboBox.setToolTipText方法的典型用法代码示例。如果您正苦于以下问题:Java JComboBox.setToolTipText方法的具体用法?Java JComboBox.setToolTipText怎么用?Java JComboBox.setToolTipText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JComboBox
的用法示例。
在下文中一共展示了JComboBox.setToolTipText方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EditableLine
import javax.swing.JComboBox; //导入方法依赖的package包/类
EditableLine(Position pos, EditableBlock eBlock, int selIndex, List<EditableLine> lines) {
position = pos;
linesInBlock = lines;
codeEntries = eBlock.getEntries();
targetCombo = new JComboBox(codeEntries);
setSelectedIndex(selIndex);
targetCombo.getAccessibleContext().setAccessibleName(codeEntries[selIndex].getName());
targetCombo.setToolTipText(codeEntries[selIndex].getToolTipText());
targetCombo.addActionListener(new EditSwitchL());
}
示例2: createComboTransf
import javax.swing.JComboBox; //导入方法依赖的package包/类
private void createComboTransf() {
transfs = new JComboBox();
transfs.setToolTipText(TRANSF_COMBO);
transfs.addItem("Logarithmic");
transfs.addItem("Mix - Max");
transfs.addItem("z-score (Standard Deviation)");
}
示例3: actionPerformed
import javax.swing.JComboBox; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
if (ignoreComboAction)
return; // not invoked by user, ignore
GuardedBlock gBlock = codeData.getGuardedBlock(category, blockIndex);
GuardBlockInfo gInfo = getGuardInfos(category)[blockIndex];
int[] blockBounds = getGuardBlockBounds(category, blockIndex);
int startOffset = blockBounds[0];
int endOffset = blockBounds[1];
int gHead = gBlock.getHeaderLength();
int gFoot = gBlock.getFooterLength();
JTextComponent editor = getEditor(category);
StyledDocument doc = (StyledDocument) editor.getDocument();
changed = true;
JComboBox combo = (JComboBox) e.getSource();
try {
docListener.setActive(false);
if (combo.getSelectedIndex() == 1) { // changing from default to custom
NbDocument.unmarkGuarded(doc, startOffset, endOffset - startOffset);
// keep last '\n' so we don't destroy next editable block's position
doc.remove(startOffset, endOffset - startOffset - 1);
// insert the custom code into the document
String customCode = gBlock.getCustomCode();
int customLength = customCode.length();
if (gInfo.customizedCode != null) { // already was edited before
customCode = customCode.substring(0, gHead)
+ gInfo.customizedCode
+ customCode.substring(customLength - gFoot);
customLength = customCode.length();
}
if (customCode.endsWith("\n")) // NOI18N
customCode = customCode.substring(0, customLength-1);
doc.insertString(startOffset, customCode, null);
gInfo.customized = true;
// make guarded "header" and "footer", select the text in between
NbDocument.markGuarded(doc, startOffset, gHead);
NbDocument.markGuarded(doc, startOffset + customLength - gFoot, gFoot);
editor.setSelectionStart(startOffset + gHead);
editor.setSelectionEnd(startOffset + customLength - gFoot);
editor.requestFocus();
combo.setToolTipText(gBlock.getCustomEntry().getToolTipText());
}
else { // changing from custom to default
// remember the customized code
gInfo.customizedCode = doc.getText(startOffset + gHead,
endOffset - gFoot - gHead - startOffset);
NbDocument.unmarkGuarded(doc, endOffset - gFoot, gFoot);
NbDocument.unmarkGuarded(doc, startOffset, gHead);
// keep last '\n' so we don't destroy next editable block's position
doc.remove(startOffset, endOffset - startOffset - 1);
String defaultCode = gBlock.getDefaultCode();
if (defaultCode.endsWith("\n")) // NOI18N
defaultCode = defaultCode.substring(0, defaultCode.length()-1);
doc.insertString(startOffset, defaultCode, null);
gInfo.customized = false;
// make the whole text guarded, cancel selection
NbDocument.markGuarded(doc, startOffset, defaultCode.length()+1); // including '\n'
if (editor.getSelectionStart() >= startOffset && editor.getSelectionEnd() <= endOffset)
editor.setCaretPosition(startOffset);
combo.setToolTipText(NbBundle.getMessage(CustomCodeData.class, "CTL_GuardCombo_Default_Hint")); // NOI18N
}
// we must create a new Position - current was moved away by inserting new string on it
gInfo.position = NbDocument.createPosition(doc, startOffset, Position.Bias.Forward);
docListener.setActive(true);
}
catch (BadLocationException ex) { // should not happen
ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);
}
}
示例4: HierarchyTopComponent
import javax.swing.JComboBox; //导入方法依赖的package包/类
@NbBundle.Messages({
"TXT_NonActiveContent=<No View Available - Refresh Manually>",
"TXT_InspectHierarchyHistory=<empty>",
"TOOLTIP_RefreshContent=Refresh for entity under cursor",
"TOOLTIP_OpenJDoc=Open Javadoc Window",
"TOOLTIP_ViewHierarchyType=Hierachy View Type",
"TOOLTIP_InspectHierarchyHistory=Inspect Hierarchy History"
})
public HierarchyTopComponent() {
history = HistorySupport.getInstnace(this.getClass());
jdocFinder = SelectJavadocTask.create(this);
jdocTask = RP.create(jdocFinder);
explorerManager = new ExplorerManager();
rootChildren = new RootChildren();
filters = new HierarchyFilters();
explorerManager.setRootContext(Nodes.rootNode(rootChildren, filters));
selectedNodes = new InstanceContent();
lookup = new AbstractLookup(selectedNodes);
explorerManager.addPropertyChangeListener(this);
initComponents();
setName(Bundle.CTL_HierarchyTopComponent());
setToolTipText(Bundle.HINT_HierarchyTopComponent());
viewTypeCombo = new JComboBox(new DefaultComboBoxModel(ViewType.values()));
viewTypeCombo.setMinimumSize(new Dimension(MIN_TYPE_WIDTH,COMBO_HEIGHT));
viewTypeCombo.addActionListener(this);
viewTypeCombo.setToolTipText(Bundle.TOOLTIP_ViewHierarchyType());
historyCombo = new JComboBox(HistorySupport.createModel(history, Bundle.TXT_InspectHierarchyHistory()));
historyCombo.setMinimumSize(new Dimension(MIN_HISTORY_WIDTH,COMBO_HEIGHT));
historyCombo.setRenderer(HistorySupport.createRenderer(history));
historyCombo.addActionListener(this);
historyCombo.setEnabled(false);
historyCombo.getModel().addListDataListener(this);
historyCombo.setToolTipText(Bundle.TOOLTIP_InspectHierarchyHistory());
refreshButton = new JButton(ImageUtilities.loadImageIcon(REFRESH_ICON, true));
refreshButton.addActionListener(this);
refreshButton.setToolTipText(Bundle.TOOLTIP_RefreshContent());
jdocButton = new JButton(ImageUtilities.loadImageIcon(JDOC_ICON, true));
jdocButton.addActionListener(this);
jdocButton.setToolTipText(Bundle.TOOLTIP_OpenJDoc());
final Box upperToolBar = new MainToolBar(
constrainedComponent(viewTypeCombo, GridBagConstraints.HORIZONTAL, 1.0, new Insets(0,0,0,0)),
constrainedComponent(historyCombo, GridBagConstraints.HORIZONTAL, 1.5, new Insets(0,3,0,0)),
constrainedComponent(refreshButton, GridBagConstraints.NONE, 0.0, new Insets(0,3,0,0)),
constrainedComponent(jdocButton, GridBagConstraints.NONE, 0.0, new Insets(0,3,0,3)));
add(decorateAsUpperPanel(upperToolBar), BorderLayout.NORTH);
contentView = new JPanel();
contentView.setLayout(new CardLayout());
JPanel nonActiveContent = Utils.updateBackground(new JPanel());
nonActiveContent.setLayout(new BorderLayout());
nonActiveInfo = new JLabel(Bundle.TXT_NonActiveContent());
nonActiveInfo.setEnabled(false);
nonActiveInfo.setHorizontalAlignment(SwingConstants.CENTER);
nonActiveContent.add(nonActiveInfo, BorderLayout.CENTER);
btw = createBeanTreeView();
contentView.add(nonActiveContent, NON_ACTIVE_CONTENT);
contentView.add(btw, ACTIVE_CONTENT);
add(contentView,BorderLayout.CENTER);
lowerToolBar = new TapPanel();
lowerToolBar.setOrientation(TapPanel.DOWN);
final JComponent lowerButtons = filters.getComponent();
lowerButtons.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 0));
lowerToolBar.add(lowerButtons);
final boolean expanded = NbPreferences.forModule(HierarchyTopComponent.class).
getBoolean(PROP_LOWER_TOOLBAR_EXPANDED, true); //NOI18N
lowerToolBar.setExpanded(expanded);
lowerToolBar.addPropertyChangeListener(this);
add(Utils.updateBackground(lowerToolBar), BorderLayout.SOUTH);
}
示例5: createNewColumn
import javax.swing.JComboBox; //导入方法依赖的package包/类
private void createNewColumn() {
// name
JTextField nameField = new JTextField();
nameField.setToolTipText("The name of the attribute.");
cellEditors.add(NAME_ROW, new DefaultCellEditor(nameField));
// type
JComboBox typeBox = new JComboBox(Attributes.KNOWN_ATTRIBUTE_TYPES);
typeBox.setEditable(true);
typeBox.setToolTipText("The type of the attribute ('attribute' for regular learning attributes or a special attribute name).");
cellEditors.add(TYPE_ROW, new DefaultCellEditor(typeBox));
// value type
List<String> usedTypes = new LinkedList<>();
for (int i = 0; i < Ontology.VALUE_TYPE_NAMES.length; i++) {
if (i != Ontology.ATTRIBUTE_VALUE && i != Ontology.FILE_PATH
&& !Ontology.ATTRIBUTE_VALUE_TYPE.isA(i, Ontology.DATE_TIME)) {
usedTypes.add(Ontology.ATTRIBUTE_VALUE_TYPE.mapIndex(i));
}
}
String[] valueTypes = new String[usedTypes.size()];
int vCounter = 0;
for (String type : usedTypes) {
valueTypes[vCounter++] = type;
}
JComboBox valueTypeBox = new JComboBox(valueTypes);
valueTypeBox.setToolTipText("The value type of the attribute.");
cellEditors.add(VALUE_TYPE_ROW, new DefaultCellEditor(valueTypeBox));
// block type
JComboBox blockTypeBox = new JComboBox(Ontology.ATTRIBUTE_BLOCK_TYPE.getNames());
blockTypeBox.setToolTipText("The block type of this attribute.");
cellEditors.add(BLOCK_TYPE_ROW, new DefaultCellEditor(blockTypeBox));
// separator
JTextField separator = new JTextField();
separator.setToolTipText("Separates meta data from data.");
separator.setEditable(false);
cellEditors.add(SEPARATOR_ROW, new DefaultCellEditor(separator));
for (int i = 0; i < cellRenderers.getSize(); i++) {
cellRenderers.add(i, new EditorCellRenderer(cellEditors.get(i, cellEditors.getSize(i) - 1)));
}
dataColumnVector.add(new Vector<String>());
this.dataChanged = true;
this.metaDataChanged = true;
}
示例6: initGui
import javax.swing.JComboBox; //导入方法依赖的package包/类
public void initGui() {
enabler = new JCheckBox("Enable What-If analysis");
enabler.setToolTipText("Enable or disable What-If analysis");
enablerPanel = new JPanel(new BorderLayout());
enablerPanel.add(enabler, BorderLayout.WEST);
upperPanel = new JPanel(new BorderLayout());
chooserPanel = new JPanel();
tb = new TitledBorder("Parameter selection for the control of repeated executions");
chooserPanel.setBorder(tb);
chooser = new JComboBox(parameters);
chooser.setPreferredSize(DIM_BUTTON_L);
chooser.setToolTipText("Choose the what-if analysis to be performed");
chooserPanel.add(chooser, BorderLayout.NORTH);
JLabel description = new JLabel(PARAMETRIC_ANALYSIS_DESCRIPTION);
JLabel Warning = new JLabel (HTML_START + HTML_FONT_TITLE + "WARNING: "+ HTML_FONT_TIT_END + HTML_FONT_NORM
+ "Enabling What-If analysis will disable all statistical outputs." + HTML_FONT_NOR_END + HTML_END);
JPanel northPanel = new JPanel(new BorderLayout());
northPanel.setBorder(new EmptyBorder(0, 0, 15, 0));
northPanel.add(description, "Center");
northPanel.add(Warning, "South");
northPanel.add(enablerPanel, "East");
upperPanel.add(northPanel, BorderLayout.NORTH);
upperPanel.add(chooserPanel, BorderLayout.SOUTH);
this.setLayout(new BorderLayout());
this.setBorder(new EmptyBorder(20, 20, 20, 20));
chooser.removeAllItems();
ParametricAnalysisChecker pac = new ParametricAnalysisChecker(cd, sd, simd);
if (!pac.canBeEnabled()) {
enabler.setEnabled(false);
parameterOptionPanel = createPanel(null);
simd.setParametricAnalysisModel(null);
simd.setParametricAnalysisEnabled(false);
} else {
enabler.setEnabled(true);
enabler.setSelected(simd.isParametricAnalysisEnabled());
ParametricAnalysisDefinition pad = simd.getParametricAnalysisModel();
parameters = pac.getRunnableParametricAnalysis();
for (String parameter : parameters) {
chooser.addItem(parameter);
}
String temp = parameters[0];
if (pad == null) {
pad = ParametricAnalysisModelFactory.createParametricAnalysisModel(temp, cd, sd, simd);
simd.setParametricAnalysisModel(pad);
} else {
int code = pad.checkCorrectness(true); //check correctness of the PAD and if it is possible corrects it
if (code != 2) {
chooser.setSelectedItem(pad.getType());
} else { //the old type of parametric analysis is no more available
pad = ParametricAnalysisModelFactory.createParametricAnalysisModel(temp, cd, sd, simd);
simd.setParametricAnalysisModel(pad);
}
}
parameterOptionPanel = createPanel(pad);
}
parameterOptionPanel.setBorder(new EmptyBorder(10, 0, 0, 0));
this.add(upperPanel, BorderLayout.NORTH);
this.add(parameterOptionPanel, BorderLayout.CENTER);
this.setEnabled(enabler.isSelected());
}
示例7: initialize
import javax.swing.JComboBox; //导入方法依赖的package包/类
public void initialize() {
JPanel edit = new JPanel(new GridLayout(4, 1, 0, 5));
fromLabel = new JLabel("Initial ß: ");
from = new JSpinner(new SpinnerNumberModel(PMPA.getInitialValue(), 0.000, 1.000, 0.001));
from.setToolTipText("Sets the initial proportion of jobs");
toLabel = new JLabel("Final ß: ");
to = new JSpinner(new SpinnerNumberModel(PMPA.getFinalValue(), 0.000, 1.000, 0.001));
to.setToolTipText("Sets the final proportion of jobs");
stepsLabel = new JLabel("Steps (n. of exec.): ");
int maxSteps = PMPA.searchForAvailableSteps();
if (maxSteps > ParametricAnalysis.MAX_STEP_NUMBER) {
maxSteps = ParametricAnalysis.MAX_STEP_NUMBER;
}
steps = new JSpinner(new SpinnerNumberModel(PMPA.getNumberOfSteps(), 2, maxSteps, 1));
steps.setToolTipText("Sets the number of steps to be performed");
Vector<Object> classes = cd.getClosedClassKeys();
String[] classNames = new String[classes.size()];
for (int i = 0; i < classes.size(); i++) {
classNames[i] = cd.getClassName(classes.get(i));
}
classChooserLabel = new JLabel("Class: ");
classChooser = new JComboBox(classNames);
classChooser.setToolTipText("Sets the class the inserted values will refer to");
classChooser.setSelectedItem(cd.getClassName(PMPA.getReferenceClass()));
edit.add(fromLabel);
edit.add(from);
edit.add(toLabel);
edit.add(to);
edit.add(stepsLabel);
edit.add(steps);
edit.add(classChooserLabel);
edit.add(classChooser);
edit.setPreferredSize(new Dimension(130, 88));
JPanel editLables = new JPanel(new GridLayout(4, 1, 0, 5));
editLables.add(fromLabel);
editLables.add(toLabel);
editLables.add(stepsLabel);
editLables.add(classChooserLabel);
editLables.setPreferredSize(new Dimension(100, 88));
JPanel editPanel = new JPanel();
editPanel.add(editLables);
editPanel.add(edit);
editPanel.setBorder(new EmptyBorder(15, 20, 0, 20));
JPanel cont = new JPanel(new BorderLayout());
cont.add(editPanel, BorderLayout.CENTER);
scroll = new JScrollPane(cont);
title = new TitledBorder("Type of population mix");
scroll.setBorder(title);
description = new JTextArea(DESCRIPTION);
description.setOpaque(false);
description.setEditable(false);
description.setLineWrap(true);
description.setWrapStyleWord(true);
descrPane = new JScrollPane(description);
descriptionTitle = new TitledBorder(new EtchedBorder(), "Description");
descrPane.setBorder(descriptionTitle);
descrPane.setMinimumSize(new Dimension(80, 0));
scroll.setMinimumSize(new Dimension(360, 0));
setLeftComponent(scroll);
setRightComponent(descrPane);
setListeners();
this.setBorder(new EmptyBorder(5, 0, 5, 0));
}
示例8: initGui
import javax.swing.JComboBox; //导入方法依赖的package包/类
public void initGui() {
enabler = new JCheckBox("Enable what-if analysis");
enabler.setToolTipText("Enable or disable what-if analysis");
enablerPanel = new JPanel(new BorderLayout());
enablerPanel.add(enabler, BorderLayout.WEST);
//enablerPanel.setBorder(new EmptyBorder(30,10,10,10));
upperPanel = new JPanel(new BorderLayout());
chooserPanel = new JPanel();
tb = new TitledBorder("Parameter selection for the control of repeated executions");
chooserPanel.setBorder(tb);
chooser = new JComboBox(parameters);
chooser.setPreferredSize(DIM_BUTTON_L);
chooser.setToolTipText("Choose the what-if analysis to be performed");
chooserPanel.add(chooser, BorderLayout.NORTH);
JLabel description = new JLabel(PARAMETRIC_ANALYSIS_DESCRIPTION);
JPanel northPanel = new JPanel(new BorderLayout());
northPanel.setBorder(new EmptyBorder(0, 0, 15, 0));
northPanel.add(description, "Center");
northPanel.add(enablerPanel, "East");
upperPanel.add(northPanel, BorderLayout.NORTH);
upperPanel.add(chooserPanel, BorderLayout.SOUTH);
this.setLayout(new BorderLayout());
this.setBorder(new EmptyBorder(20, 20, 20, 20));
chooser.removeAllItems();
ParametricAnalysisChecker pac = new ParametricAnalysisChecker(cd, sd, simd);
if (!pac.canBeEnabled()) {
enabler.setEnabled(false);
parameterOptionPanel = createPanel(null);
simd.setParametricAnalysisModel(null);
simd.setParametricAnalysisEnabled(false);
} else {
enabler.setEnabled(true);
enabler.setSelected(simd.isParametricAnalysisEnabled());
ParametricAnalysisDefinition pad = simd.getParametricAnalysisModel();
parameters = pac.getRunnableParametricAnalysis();
for (String parameter : parameters) {
chooser.addItem(parameter);
}
String temp = parameters[0];
if (pad == null) {
pad = ParametricAnalysisModelFactory.createParametricAnalysisModel(temp, cd, sd, simd);
simd.setParametricAnalysisModel(pad);
} else {
int code = pad.checkCorrectness(true); //check correctness of the PAD and if it is possible corrects it
if (code != 2) {
chooser.setSelectedItem(pad.getType());
} else { //the old type of parametric analysis is no more avaible
pad = ParametricAnalysisModelFactory.createParametricAnalysisModel(temp, cd, sd, simd);
simd.setParametricAnalysisModel(pad);
}
}
parameterOptionPanel = createPanel(pad);
}
parameterOptionPanel.setBorder(new EmptyBorder(10, 0, 0, 0));
this.add(upperPanel, BorderLayout.NORTH);
this.add(parameterOptionPanel, BorderLayout.CENTER);
this.setEnabled(enabler.isSelected());
}
示例9: initialize
import javax.swing.JComboBox; //导入方法依赖的package包/类
public void initialize() {
JPanel edit = new JPanel(new GridLayout(4, 1, 0, 5));
fromLabel = new JLabel("Initial �: ");
from = new JSpinner(new SpinnerNumberModel(PMPA.getInitialValue(), 0.000, 1.000, 0.001));
from.setToolTipText("Sets the initial proportion of jobs");
toLabel = new JLabel("Final �: ");
to = new JSpinner(new SpinnerNumberModel(PMPA.getFinalValue(), 0.000, 1.000, 0.001));
to.setToolTipText("Sets the final proportion of jobs");
stepsLabel = new JLabel("Steps (n. of exec.): ");
int maxSteps = PMPA.searchForAvaibleSteps();
if (maxSteps > ParametricAnalysis.MAX_STEP_NUMBER) {
maxSteps = ParametricAnalysis.MAX_STEP_NUMBER;
}
steps = new JSpinner(new SpinnerNumberModel(PMPA.getNumberOfSteps(), 2, maxSteps, 1));
steps.setToolTipText("Sets the number of steps to be performed");
Vector classes = cd.getClosedClassKeys();
String[] classNames = new String[classes.size()];
for (int i = 0; i < classes.size(); i++) {
classNames[i] = cd.getClassName(classes.get(i));
}
classChooserLabel = new JLabel("Class: ");
classChooser = new JComboBox(classNames);
classChooser.setToolTipText("Sets the class the inserted values will refer to");
classChooser.setSelectedItem(cd.getClassName(PMPA.getReferenceClass()));
edit.add(fromLabel);
edit.add(from);
edit.add(toLabel);
edit.add(to);
edit.add(stepsLabel);
edit.add(steps);
edit.add(classChooserLabel);
edit.add(classChooser);
edit.setPreferredSize(new Dimension(130, 88));
JPanel editLables = new JPanel(new GridLayout(4, 1, 0, 5));
editLables.add(fromLabel);
editLables.add(toLabel);
editLables.add(stepsLabel);
editLables.add(classChooserLabel);
editLables.setPreferredSize(new Dimension(100, 88));
JPanel editPanel = new JPanel();
editPanel.add(editLables);
editPanel.add(edit);
editPanel.setBorder(new EmptyBorder(15, 20, 0, 20));
JPanel cont = new JPanel(new BorderLayout());
cont.add(editPanel, BorderLayout.CENTER);
scroll = new JScrollPane(cont);
title = new TitledBorder("Type of population mix");
scroll.setBorder(title);
description = new JTextArea(DESCRIPTION);
description.setOpaque(false);
description.setEditable(false);
description.setLineWrap(true);
description.setWrapStyleWord(true);
descrPane = new JScrollPane(description);
descriptionTitle = new TitledBorder(new EtchedBorder(), "Description");
descrPane.setBorder(descriptionTitle);
descrPane.setMinimumSize(new Dimension(80, 0));
scroll.setMinimumSize(new Dimension(360, 0));
setLeftComponent(scroll);
setRightComponent(descrPane);
setListeners();
this.setBorder(new EmptyBorder(5, 0, 5, 0));
}
示例10: initComponents
import javax.swing.JComboBox; //导入方法依赖的package包/类
/**
* Initialize this dialod's components and default dialog property
*/
protected void initComponents() {
// Sets default title, close operation and dimensions
this.setTitle("Editing Distribution...");
int width = 320, height = 600;
// Centers this dialog on the screen
if (recursive) {
this.centerWindowWithOffset(width, height, 50, 50);
} else {
this.centerWindow(width, height);
}
// Creates a main panel and adds margins to it
JPanel mainpanel = new JPanel(new BorderLayout());
mainpanel.setLayout(new BorderLayout());
mainpanel.add(Box.createVerticalStrut(BORDERSIZE), BorderLayout.NORTH);
mainpanel.add(Box.createVerticalStrut(BORDERSIZE), BorderLayout.SOUTH);
mainpanel.add(Box.createHorizontalStrut(BORDERSIZE), BorderLayout.WEST);
mainpanel.add(Box.createHorizontalStrut(BORDERSIZE), BorderLayout.EAST);
this.getContentPane().add(mainpanel, BorderLayout.CENTER);
// Creates a subpanel that holds scrolledpanel and distr_panel and adds it to mainpanel
JPanel subpanel = new JPanel(new BorderLayout());
mainpanel.add(subpanel, BorderLayout.CENTER);
JPanel distr_panel = new JPanel(new BorderLayout());
subpanel.add(distr_panel, BorderLayout.NORTH);
// Creates scrolledpanel that holds param_panel and mean_c_panel
scrolledPanel = new JPanel(new GridLayout(2, 1));
subpanel.add(new JScrollPane(scrolledPanel), BorderLayout.CENTER);
scrolledPanel.add(param_panel);
scrolledPanel.add(mean_c_panel);
mean_c_panel.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, Color.gray));
// Adds bottom_panel to contentpane
JPanel bottom_panel = new JPanel(new FlowLayout());
this.getContentPane().add((bottom_panel), BorderLayout.SOUTH);
// Adds Okay button to bottom_panel
JButton okaybutton = new JButton(okayAction);
bottom_panel.add(okaybutton);
// Adds Cancel button to bottom_panel
JButton cancelbutton = new JButton(cancelAction);
bottom_panel.add(cancelbutton);
// Adds distribution chooser
distr_panel.add(new JLabel("Selected Distribution: "), BorderLayout.WEST);
Set<String> distributionNameSet;
if (recursive) {
distributionNameSet = allowedNestedDistributions.keySet();
} else {
distributionNameSet = distributions.keySet();
}
Object[] distributionNames = distributionNameSet.toArray();
Arrays.sort(distributionNames); // Sorts alphabetically distribution names
choser = new JComboBox(distributionNames);
choser.setToolTipText("Choose distribution type");
// Select correct distribution
if (current != null) {
choser.setSelectedItem(current.getName());
refreshView();
}
choser.addItemListener(change_listener);
distr_panel.add(choser, BorderLayout.CENTER);
// Adds image viewer with a couple of borders
JPanel image_panel = new JPanel(new BorderLayout());
distr_panel.add(image_panel, BorderLayout.SOUTH);
image_panel.add(Box.createVerticalStrut(BORDERSIZE / 2), BorderLayout.NORTH);
image_panel.add(Box.createVerticalStrut(BORDERSIZE / 2), BorderLayout.SOUTH);
image_panel.add(iconpanel, BorderLayout.CENTER);
}