use of org.jowidgets.api.widgets.blueprint.ITextLabelBluePrint in project jo-client-platform by jo-source.
the class CsvExportParameterContentProvider method createContent.
@Override
public void createContent(final IInputContentContainer container) {
final ITextLabelBluePrint textLabelBp = BPF.textLabel().alignRight();
container.setLayout(new MigLayoutDescriptor("[][grow, 250::]", "[][]"));
container.add(textLabelBp.setText(Messages.getString("CsvExportParameterContentProvider.header")), "alignx r");
final IComboBoxSelectionBluePrint<Boolean> headerCmbBp = BPF.comboBoxSelectionBoolean().setAutoCompletion(false);
headerCmb = container.add(headerCmbBp, "growx ,w 0:: , wrap");
container.add(textLabelBp.setText(Messages.getString("CsvExportParameterContentProvider.properties")), "alignx r, growx");
final IComboBoxSelectionBluePrint<Boolean> propertiesCmbBp = BPF.comboBoxSelection(createExportAttributesConverter());
propertiesCmbBp.setElements(Boolean.TRUE, Boolean.FALSE).setValue(Boolean.FALSE).setAutoCompletion(false);
propertiesCmb = container.add(propertiesCmbBp, "growx, w 0::, wrap");
container.add(textLabelBp.setText(Messages.getString("CsvExportParameterContentProvider.Export")), "alignx r");
final IComboBoxSelectionBluePrint<ICsvExportParameter.ExportType> exportTypeCmbBp = BPF.comboBoxSelection(createExportTypesConverter());
exportTypeCmbBp.setAutoCompletion(false).setElements(ICsvExportParameter.ExportType.values());
exportTypeCmb = container.add(exportTypeCmbBp, "growx, w 0::, wrap");
container.add(textLabelBp.setText(Messages.getString("CsvExportParameterContentProvider.separator")), "alignx r");
final IComboBoxSelectionBluePrint<String> separatorCmbBp = BPF.comboBoxSelection(";", ",", "|");
separatorCmbBp.setAutoCompletion(false);
separatorCmb = container.add(separatorCmbBp, "growx, w 0::, wrap");
container.add(textLabelBp.setText(Messages.getString("CsvExportParameterContentProvider.mask")), "align r");
final IComboBoxSelectionBluePrint<String> maskCmbBp = BPF.comboBoxSelection("*", String.valueOf('"'));
maskCmbBp.setAutoCompletion(false);
maskCmb = container.add(maskCmbBp, "growx, w 0::, wrap");
container.add(textLabelBp.setText(Messages.getString("CsvExportParameterContentProvider.encoding")), "alignx r");
final IComboBoxSelectionBluePrint<String> encodingCmbBp = BPF.comboBoxSelection("UTF-8", "Cp1250", "ISO8859_1");
encodingCmbBp.setAutoCompletion(false);
encodingCmb = container.add(encodingCmbBp, "growx, w 0::");
}
use of org.jowidgets.api.widgets.blueprint.ITextLabelBluePrint in project jo-client-platform by jo-source.
the class GraphSettingsDialog method createSliderComponent.
private void createSliderComponent(final IScrollComposite content, final double defaultValue, final int forceNumber, final GraphLayout layout) {
int max = 0;
int min = 0;
String description = null;
switch(layout) {
case RADIAL_TREE_LAYOUT:
max = RADIAL_RADIUS_MAX;
min = RADIAL_RADIUS_MIN;
description = RADIAL_RADIUS_DISTANCES[forceNumber];
break;
case NODE_TREE_LINK_LAYOUT:
max = NODE_LINK_DISTANCE_MAX;
min = NODE_LINK_DISTANCE_MIN;
description = NODE_LINK_DISTANCES[forceNumber];
break;
default:
break;
}
final ITextLabelBluePrint labelBp = BPF.textLabel().alignRight();
content.add(labelBp.setText(description), "sg lg");
final ISliderBluePrint sliderBp = BPF.slider();
final ISlider slider;
final int defaultVal = (int) defaultValue;
final int step = (max - min) / 100;
sliderBp.setMaximum(max).setMinimum(min).setTickSpacing((max - min) / 20);
slider = content.add(sliderBp, "growx, w 0::");
slider.setValue(defaultVal);
final IInputField<Integer> inputField;
inputField = content.add(BPF.inputFieldIntegerNumber(), "growx, w 0::, wrap");
inputField.setValue((int) (slider.getValue()));
DEFAULT_SLIDER_SETTINGS.put(slider, defaultVal);
inputField.addInputListener(new ParameterListener(slider, inputField, null, forceNumber, step, min, false, Listener.INPUTFIELD, layout));
slider.addInputListener(new ParameterListener(slider, inputField, null, forceNumber, step, min, false, Listener.SLIDER, layout));
}
use of org.jowidgets.api.widgets.blueprint.ITextLabelBluePrint in project jo-client-platform by jo-source.
the class GraphSettingsDialog method createSliderComponent.
private void createSliderComponent(final IScrollComposite content, final Force force, final int param, final String description) {
final String forceParameter = force.getParameterName(param);
final double value = MODIFIED_VALUES.containsKey(forceParameter + "_DEFAULT") ? MODIFIED_VALUES.get(forceParameter + "_DEFAULT") : force.getParameter(param);
final double min = MODIFIED_VALUES.containsKey(forceParameter + "_MIN") ? MODIFIED_VALUES.get(forceParameter + "_MIN") : force.getMinValue(param);
final double max = MODIFIED_VALUES.containsKey(forceParameter + "_MAX") ? MODIFIED_VALUES.get(forceParameter + "_MAX") : force.getMaxValue(param);
final boolean displayPercent;
final double step = (max - min) / 100;
final ITextLabelBluePrint labelBp = BPF.textLabel().alignRight();
content.add(labelBp.setText(description), "sg lg");
final ISliderBluePrint sliderBp = BPF.slider();
final ISlider slider;
final int defaultValue;
final IInputField<Integer> inputField;
if (Arrays.asList(DISPLAY_PERCENT_PARAMETER).contains(forceParameter)) {
sliderBp.setMaximum(100).setMinimum(0).setTickSpacing(5);
slider = content.add(sliderBp, "growx, w 0::");
defaultValue = (int) (100 / max * value);
slider.setValue(defaultValue);
inputField = content.add(BPF.inputFieldIntegerNumber(), "growx, w 0::, split2");
content.add(BPF.label().setText("%"), "wrap");
inputField.setValue((int) (slider.getValue()));
displayPercent = true;
useForce(displayPercent, param, force, min, slider, step);
} else {
sliderBp.setMaximum((int) max).setMinimum((int) min).setTickSpacing((int) (max - min) / 20);
slider = content.add(sliderBp, "growx, w 0::");
defaultValue = (int) value;
slider.setValue(defaultValue);
inputField = content.add(BPF.inputFieldIntegerNumber(), "growx, w 0::, wrap");
inputField.setValue((int) value);
displayPercent = false;
useForce(displayPercent, param, force, min, slider, step);
}
DEFAULT_SLIDER_SETTINGS.put(slider, defaultValue);
inputField.addInputListener(new ParameterListener(slider, inputField, force, param, step, min, displayPercent, Listener.INPUTFIELD, GraphLayout.FORCE_DIRECTED_LAYOUT));
slider.addInputListener(new ParameterListener(slider, inputField, force, param, step, min, displayPercent, Listener.SLIDER, GraphLayout.FORCE_DIRECTED_LAYOUT));
}
use of org.jowidgets.api.widgets.blueprint.ITextLabelBluePrint in project jo-client-platform by jo-source.
the class BeanFormLayouterImpl method layout.
@Override
public void layout(final IContainer parent, final IBeanFormControlFactory controlFactory) {
final IBeanFormInfo beanFormInfo = controlFactory.getBeanFormInfo();
final IContainer container;
if (controlFactory.getScrollbarsAllowed() && beanFormInfo != null) {
parent.setLayout(MigLayoutFactory.growingInnerCellLayout());
container = parent.add(BPF.scrollComposite(), MigLayoutFactory.GROWING_CELL_CONSTRAINTS);
} else {
container = parent;
}
final String colConstraints = insets.getLeft() + "[grow, 0::]" + insets.getRight();
final String rowConstraints;
if (beanFormInfo != null) {
rowConstraints = insets.getTop() + "[][grow, 0::]" + insets.getBottom();
} else {
rowConstraints = insets.getTop() + "[grow, 0::]" + insets.getBottom();
}
container.setLayout(new MigLayoutDescriptor(colConstraints, rowConstraints));
if (beanFormInfo != null) {
final IExpandCompositeBluePrint expandCompositeBp = expandCompositeBp();
expandCompositeBp.setExpanded(beanFormInfo.isExpanded());
expandCompositeBp.setText(beanFormInfo.getHeader().get());
expandCompositeBp.setIcon(beanFormInfo.getHeaderIcon());
final IExpandComposite expandComposite = container.add(expandCompositeBp, "growx, w 0::, wrap");
final String cc = contentInsets.getLeft() + "[grow, 0::]" + contentInsets.getRight();
final String rc = contentInsets.getTop() + "[]" + contentInsets.getBottom();
expandComposite.setLayout(new MigLayoutDescriptor(cc, rc));
final ITextLabelBluePrint labelBp = BPF.textLabel(beanFormInfo.getText().get());
labelBp.setForegroundColor(contentTextColor).setMarkup(contentTextMarkup);
expandComposite.add(labelBp, "growx, w 0::");
expandComposite.addExpandListener(new IExpandListener() {
@Override
public void expandedChanged(final boolean expanded) {
getRootContainer(parent).layout();
}
});
}
final boolean contentScrollbar = beanFormInfo == null && controlFactory.getScrollbarsAllowed();
final IContainer contentContainer = createAndAddContentContainer(container, controlFactory, contentScrollbar);
contentLayouter.layout(contentContainer, controlFactory);
}
Aggregations