use of javax.swing.border.Border in project MassBank-web by MassBank.
the class PackageView method init.
/**
* ���C���v���O����
*/
public void init() {
// �A�v���b�g�R���e�L�X�g�擾
context = getAppletContext();
// �A�v���b�g������ʃT�C�Y�擾
initAppletWidth = getWidth();
initAppletHight = getHeight();
// ���ݒ�t�@�C������A�g�T�C�g��URL���擾
String confPath = getCodeBase().toString();
confPath = confPath.replaceAll("/jsp", "");
GetConfig conf = new GetConfig(confPath);
baseUrl = conf.getServerUrl();
// �c�[���`�b�v�}�l�[�W���[�ݒ�
ToolTipManager ttm = ToolTipManager.sharedInstance();
ttm.setInitialDelay(50);
ttm.setDismissDelay(8000);
setLayout(new BorderLayout());
// ���C���p�l��
JPanel mainPanel = new JPanel();
mainPanel.setLayout(new BorderLayout());
Border border = BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(), new EmptyBorder(0, 5, 0, 5));
mainPanel.setBorder(border);
// PackageView�����y�сA������
pkgView = new PackageViewPanel();
pkgView.initAllRecInfo();
mainPanel.add(new HeaderPane(), BorderLayout.NORTH);
mainPanel.add(pkgView, BorderLayout.CENTER);
mainPanel.add(new FooterPane(), BorderLayout.SOUTH);
add(mainPanel);
// ���[�U�[�t�@�C���Ǎ���
if (getParameter("file") != null) {
loadFile(getParameter("file"));
}
}
use of javax.swing.border.Border in project knime-core by knime.
the class RuleEngine2PortsNodeDialog method initControls.
/**
* Creates and adds most of the controls to the dialog.
*/
private void initControls() {
m_pmml = new JCheckBox("Enable PMML RuleSet generation (fails when result would not be a valid PMML RuleSet)");
m_ruleSelectionMethod = new JComboBox<>(new Vector<>(RuleEngine2PortsSettings.POSSIBLE_RULE_SELECTION_METHODS));
m_hasDefaultScore = new JCheckBox("Default value (when nothing matches): ");
m_defaultScore = Util.createTextFieldWithWatermark(RuleEngine2PortsSettings.DEFAULT_DEFAULT_SCORE, 22, "Default score/value when nothing matches");
m_hasDefaultConfidence = new JCheckBox("Default confidence value (when not specified in the confidence column): ");
m_defaultConfidence = new JSpinner(new SpinnerNumberModel(RuleEngine2PortsSettings.DEFAULT_DEFAULT_CONFIDENCE, 0d, 1d, .1));
@SuppressWarnings("unchecked") DataValueColumnFilter doubleValueFilter = new DataValueColumnFilter(DoubleValue.class);
m_ruleConfidenceColumn = new ColumnSelectionPanel((Border) null, doubleValueFilter, true);
m_hasDefaultWeight = new JCheckBox("Default weight value (when not specified in the weight column): ");
m_defaultWeight = new JSpinner(new SpinnerNumberModel(RuleEngine2PortsSettings.DEFAULT_DEFAULT_WEIGHT, 0d, 1e6, .1));
m_ruleWeightColumn = new ColumnSelectionPanel((Border) null, doubleValueFilter, true);
m_computeConfidence = new JCheckBox("Confidence column name: ");
m_predictionConfidenceColumn = Util.createTextFieldWithWatermark(RuleEngine2PortsSettings.DEFAULT_PREDICTION_CONFIDENCE_COLUMN, 22, "Computed confidence column name");
m_provideStatistics = new JCheckBox("Provide statistics");
@SuppressWarnings("unchecked") DataValueColumnFilter validationColumnFilter = new DataValueColumnFilter(StringValue.class, BooleanValue.class, DoubleValue.class);
m_validationColumn = new ColumnSelectionPanel(null, validationColumnFilter, true);
m_pmmlLabels = new ArrayList<>();
m_pmmlBorders = new ArrayList<>();
m_validateLabel = new JLabel("Validation column");
}
use of javax.swing.border.Border in project knime-core by knime.
the class StringManipulationNodeDialog method createStringManipulationPanel.
/**
* @return the controls for the string manipulation node
* @since 3.3
*/
public Component createStringManipulationPanel() {
m_snippetPanel = new JSnippetPanel(StringManipulatorProvider.getDefault(), createCompletionProvider(), !m_isOnlyVariables);
m_newNameField = new JTextField(10);
String radioButtonName;
String radioButtonToolTip;
radioButtonName = "Append " + WordUtils.capitalize(m_columnOrVariable) + ": ";
radioButtonToolTip = "Appends a new " + m_columnOrVariable + " to the input with a given name.";
m_appendRadio = new JRadioButton(radioButtonName);
m_appendRadio.setToolTipText(radioButtonToolTip);
radioButtonName = "Replace " + WordUtils.capitalize(m_columnOrVariable) + ": ";
if (m_isOnlyVariables) {
radioButtonToolTip = "Replaces the " + m_columnOrVariable + " if the type stays the same.";
} else {
radioButtonToolTip = "Replaces the " + m_columnOrVariable + " and changes the " + m_columnOrVariable + " type accordingly.";
}
m_replaceRadio = new JRadioButton(radioButtonName);
m_replaceRadio.setToolTipText(radioButtonToolTip);
if (m_isOnlyVariables) {
// show all variables
m_replaceVariableCombo = new JComboBox<FlowVariable>(new DefaultComboBoxModel<FlowVariable>());
m_replaceVariableCombo.setRenderer(new FlowVariableListCellRenderer());
} else {
// show all columns
m_replaceColumnCombo = new ColumnSelectionPanel((Border) null, DataValue.class);
m_replaceColumnCombo.setRequired(false);
}
ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(m_appendRadio);
buttonGroup.add(m_replaceRadio);
ActionListener actionListener = new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
if (m_isOnlyVariables) {
m_replaceVariableCombo.setEnabled(m_replaceRadio.isSelected());
} else {
m_replaceColumnCombo.setEnabled(m_replaceRadio.isSelected());
}
m_newNameField.setEnabled(m_appendRadio.isSelected());
}
};
m_appendRadio.addActionListener(actionListener);
m_replaceRadio.addActionListener(actionListener);
m_compileOnCloseChecker = new JCheckBox("Syntax check on close");
m_compileOnCloseChecker.setToolTipText("Checks the syntax of the expression on close.");
m_insertMissingAsNullChecker = new JCheckBox("Insert Missing As Null");
m_insertMissingAsNullChecker.setToolTipText("If unselected, missing values in the input will produce a missing cell result");
return createPanel();
}
use of javax.swing.border.Border in project knime-core by knime.
the class TimeMissingValueHandlingPanel method createContent.
private void createContent(final TimeMissingValueHandlingColSetting setting, final DataColumnSpec... spec) throws InternalError {
final List<String> warningMessages = new ArrayList<String>();
// if we got incompatible types the original type is overwritten by unkown.
ConfigType settingTypeBackup = setting.getType();
JPanel tabPanel = new JPanel(new BorderLayout(0, 5));
final JPanel comboRemovePanel = new JPanel(new BorderLayout(0, 2));
Border border;
final JComponent removePanel;
final String typeName = ConfigType.NUMERICAL.equals(setting.getType()) ? "Numeric Columns" : "Non-numeric Columns";
if (setting.isMetaConfig()) {
border = BorderFactory.createTitledBorder(typeName);
removePanel = new JLabel();
} else {
final List<String> names = new ArrayList<String>(Arrays.asList(setting.getNames()));
for (DataColumnSpec cspec : spec) {
names.remove(cspec.getName());
}
if (!names.isEmpty()) {
throw new NullPointerException("Not equal on init: '" + Arrays.toString(setting.getNames()) + "' vs. '" + Arrays.toString(spec) + "'.");
}
JButton requestRemoveButton = new JButton("Remove");
requestRemoveButton.addActionListener(new ActionListener() {
/**
* {@inheritDoc}
*/
@Override
public void actionPerformed(final ActionEvent e) {
firePropertyChange(REMOVE_ACTION, null, null);
}
});
removePanel = new JPanel();
removePanel.setLayout(new BorderLayout());
removePanel.add(requestRemoveButton, BorderLayout.NORTH);
final List<DataColumnSpec> notExistingColumns = getNotExistingColumns(spec);
final List<DataColumnSpec> incompatibleColumns = getIncompatibleTypedColumns(setting.getType(), spec);
if (!notExistingColumns.isEmpty()) {
warningMessages.add("Some columns no longer exist (red bordered)");
}
if (!incompatibleColumns.isEmpty()) {
warningMessages.add(String.format("Some columns have an incompatible type to %s (yellow borderd)", ConfigType.typeToString(setting.getType())));
}
final Set<DataColumnSpec> invalidColumns = new HashSet<DataColumnSpec>();
invalidColumns.addAll(notExistingColumns);
invalidColumns.addAll(incompatibleColumns);
if (!invalidColumns.isEmpty() && // if all columns are invalid a clean is the same as a remove
!(invalidColumns.size() == spec.length)) {
JButton removeNotExistingColumns = new JButton("Clean");
removeNotExistingColumns.setToolTipText("Removes all invalid columns from the configuration.");
removeNotExistingColumns.addActionListener(new ActionListener() {
/**
* {@inheritDoc}
*/
@Override
public void actionPerformed(final ActionEvent e) {
TimeMissingValueHandlingPanel.this.removeAll();
// recreate the content, based on the new settings with removed invalid columns
createContent(diff(m_setting, invalidColumns), diff(spec, invalidColumns));
firePropertyChange(REMOVED_INVALID_COLUMNS, null, invalidColumns.toArray(new DataColumnSpec[invalidColumns.size()]));
}
});
removePanel.add(removeNotExistingColumns);
}
if (!warningMessages.isEmpty()) {
LOGGER.warn("get warnings during panel validation: " + warningMessages);
border = BorderFactory.createLineBorder(Color.RED, 2);
tabPanel.add(createWarningLabel(warningMessages), BorderLayout.NORTH);
} else {
border = BorderFactory.createLineBorder(Color.BLACK);
}
}
createWestLayout(setting, tabPanel, typeName, spec);
comboRemovePanel.add(m_comboBox, BorderLayout.CENTER);
comboRemovePanel.add(removePanel, BorderLayout.EAST);
fillComboBox(setting);
setting.setType(settingTypeBackup);
m_setting = setting;
setBorder(border != null ? BorderFactory.createTitledBorder(border, typeName) : null);
tabPanel.add(comboRemovePanel, BorderLayout.NORTH);
tabPanel.add(createSpacer(65), BorderLayout.SOUTH);
add(tabPanel);
}
use of javax.swing.border.Border in project knime-core by knime.
the class DBGroupByAggregationPanel method createListComponent.
/**
* Creates the list component that contains the possible columns to choose from (displayed on the left hand).
*
* @return the list component which contains the list of available columns to choose from
*/
private Component createListComponent() {
final Box avMethodsBox = new Box(BoxLayout.X_AXIS);
final Border border = BorderFactory.createTitledBorder(" Available columns ");
avMethodsBox.setBorder(border);
final JScrollPane compMethodsList = new JScrollPane(m_columns);
final Dimension dimension = new Dimension(150, COMPONENT_HEIGHT);
compMethodsList.setMinimumSize(dimension);
compMethodsList.setPreferredSize(dimension);
avMethodsBox.add(compMethodsList);
return avMethodsBox;
}
Aggregations