org.jdesktop.swingx.VerticalLayout Java Examples

The following examples show how to use org.jdesktop.swingx.VerticalLayout. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ShowHelpDialog.java    From arcusplatform with Apache License 2.0 6 votes vote down vote up
@Override
protected Component createContents() {
	boolean added = false;
	JPanel panel = new JPanel(new VerticalLayout());
	for(Map<String, Object> value: help.getSteps()) {
		if(added) {
			panel.add(new JSeparator(JSeparator.HORIZONTAL));
		}
		PairingHelpStep step = new PairingHelpStep(value);
		panel.add(new JLabel(String.format("%d) %s", step.getOrder(), step.getId())));
		panel.add(new JLabel(String.format("Type: %s", step.getAction())));
		if(!StringUtils.isEmpty(step.getLinkUrl())) {
			panel.add(Browser.link(step.getLinkUrl(), step.getLinkText()).getComponent());
		}
		panel.add(new JLabel(step.getMessage()));
		added = true;
	}
	return panel;
}
 
Example #2
Source File: PostCustomizationDialog.java    From arcusplatform with Apache License 2.0 6 votes vote down vote up
@Override
protected Component createContents() {
	JPanel panel = new JPanel(new VerticalLayout());
	panel.add(new HyperLink(Actions.build("Pair Another Device", () -> submit(Action.PAIR_ANOTHER))).getComponent());
	int remainingDevices = ((Collection<?>) input.getPairingSubsystem().get(PairingSubsystem.ATTR_PAIRINGDEVICES)).size();
	if(remainingDevices > 0) {
		panel.add(new HyperLink(Actions.build(String.format("Customize %d Remaining Devices", remainingDevices), () -> submit(Action.CUSTOMIZE_ANOTHER))).getComponent());
	}
	panel.add(new JSeparator(JSeparator.HORIZONTAL));
	
	JButton dismissAll = new JButton(Actions.build("Dismiss All", () -> submit(Action.DISMISS_ALL)));
	JPanel buttons = new JPanel();
	buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
	buttons.add(Box.createGlue());
	buttons.add(dismissAll);
	panel.add(buttons);
	
	return panel;
}
 
Example #3
Source File: PairingInstructionsPage.java    From arcusplatform with Apache License 2.0 6 votes vote down vote up
private Component getInstructions(StartPairingResponse pairingInstructions) {
	JPanel panel = new JPanel(new VerticalLayout());
	for(Map<String, Object> s: input.getPairingInstructions().getSteps()) {
		PairingStep step = new PairingStep(s);
		panel.add(new JLabel(step.getId()));
		if(!StringUtils.isEmpty(step.getTitle())) {
			// FIXME bold
			panel.add(new JLabel(step.getTitle()));
		}
		if(!StringUtils.isEmpty(step.getInfo())) {
			// FIXME italic
			panel.add(new JLabel(step.getInfo()));
		}
		if(!StringUtils.isEmpty(step.getLinkUrl())) {
			panel.add(new HyperLink(StringUtils.isEmpty(step.getLinkText()) ? step.getLinkUrl() : step.getLinkText()).getComponent());
		}
		JTextArea instructions = new JTextArea(StringUtils.join(step.getInstructions(), "\n"));
		instructions.setEditable(false);
		instructions.setLineWrap(true);
		panel.add(instructions);
	}
	return panel;
}
 
Example #4
Source File: StreamConfigurationPanel.java    From JHelper with GNU Lesser General Public License v3.0 6 votes vote down vote up
public StreamConfigurationPanel(
		StreamConfiguration configuration,
		StreamConfiguration.StreamType[] allowedTypes,
		String defaultFileName,
		SizeChangedListener listener
) {
	super(new VerticalLayout());
	type = new ComboBox<>(allowedTypes);
	type.setSelectedItem(configuration.type);
	type.addActionListener(
			e -> {
				fileName.setVisible(((StreamConfiguration.StreamType) type.getSelectedItem()).hasStringParameter);
				if (listener != null) {
					listener.sizeChanged();
				}
			}
	);
	fileName = new JTextField(configuration.type.hasStringParameter ? configuration.fileName : defaultFileName);
	fileName.setVisible(((StreamConfiguration.StreamType) type.getSelectedItem()).hasStringParameter);

	add(type);
	add(fileName);
}
 
Example #5
Source File: AnimGifExport.java    From Pixelitor with GNU General Public License v3.0 6 votes vote down vote up
public ExportPanel(int nrLayers) {
    setBorder(createEmptyBorder(10, 10, 10, 10));
    setLayout(new VerticalLayout(10));

    add(new JLabel(" Animation frames are based on the layers of the image. "));

    var settingsPanel = new JPanel();
    settingsPanel.setLayout(new FlowLayout(LEFT, 10, 10));
    settingsPanel.add(new JLabel("Delay Between Frames (Milliseconds):"));
    delayTF = new JTextField("200", 4);
    settingsPanel.add(delayTF);

    add(settingsPanel);

    if (nrLayers > 2) {
        pingPongCB = new JCheckBox("Ping Pong Animation");
    } else {
        pingPongCB = new JCheckBox("Ping Pong Animation (min 3 layers needed)");
        pingPongCB.setEnabled(false);
    }
    add(pingPongCB);
}
 
Example #6
Source File: CustomizePage.java    From arcusplatform with Apache License 2.0 5 votes vote down vote up
@Override
protected Component createComponent() {
	JPanel panel = new JPanel(new VerticalLayout());
	panel.add(customizations);
	for(Map<String, Object> data: input.getCustomizations().getSteps()) {
		panel.add(new JSeparator(JSeparator.HORIZONTAL));
		PairingCustomizationStep step = new PairingCustomizationStep(data);
		panel.add(new JLabel(String.format("%d) %s", step.getOrder(), step.getId())));
		panel.add(render(step));
	}
	return panel;
}
 
Example #7
Source File: SettingConfigurable.java    From AndroidStringsOneTabTranslation with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public JComponent createComponent() {
    if (settingPanel == null) {
        settingPanel = new JPanel(new VerticalLayout(18));

        // header UI
        Container container = new Container();
        container.setLayout(new BorderLayout());

        currentEngine = TranslationEngineType.fromName(
                PropertiesComponent.getInstance().getValue(StorageDataKey.SettingLanguageEngine));
        TranslationEngineType[] items = TranslationEngineType.getLanguageEngineArray();
        languageEngineBox = new ComboBox(items);
        languageEngineBox.setEnabled(true);
        languageEngineBox.setSelectedItem(currentEngine);
        languageEngineBox.addActionListener(this);

        container.add(new JLabel("Language engine: "), BorderLayout.WEST);
        container.add(languageEngineBox, BorderLayout.CENTER);

        settingPanel.add(container);

        initContentContainer();
        initAndAddFilterContainer();
    }
    return settingPanel;
}
 
Example #8
Source File: DevicesAdapter.java    From WIFIADB with Apache License 2.0 5 votes vote down vote up
public DeviceHolder(){
    mLabelLayout = new JPanel(new VerticalLayout());
    mDeviceLabel = new JLabel();
    mIdLabel = new JLabel();

    mItemRoot.setPreferredSize(new Dimension(-1,36));
    mLabelLayout.add(mDeviceLabel);
    mLabelLayout.add(mIdLabel);
    mContentLayout.add(mLabelLayout);

    mActionIconLabel.setCursor(Utils.getHandCursor());
}
 
Example #9
Source File: ConfigurationDialog.java    From JHelper with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ConfigurationDialog(@NotNull Project project, Configurator.State configuration) {
	super(project);
	setTitle("JHelper configuration for " + project.getName());

	author = new JTextField(configuration.getAuthor());

	tasksDirectory = new FileSelector(
			project,
			configuration.getTasksDirectory(),
			RelativeFileChooserDescriptor.directoryChooser(project.getBaseDir())
	);
	outputFile = new FileSelector(
			project,
			configuration.getOutputFile(),
			RelativeFileChooserDescriptor.fileChooser(project.getBaseDir())
	);
	runFile = new FileSelector(
			project,
			configuration.getRunFile(),
			RelativeFileChooserDescriptor.fileChooser(project.getBaseDir())
	);

	codeEliminationOn = new JCheckBox("Eliminate code?", configuration.isCodeEliminationOn());
	codeReformattingOn = new JCheckBox("Reformat code?", configuration.isCodeReformattingOn());

	JPanel panel = new JPanel(new VerticalLayout());
	panel.add(LabeledComponent.create(author, "Author"));
	panel.add(LabeledComponent.create(tasksDirectory, "Tasks directory"));
	panel.add(LabeledComponent.create(outputFile, "Output file"));
	panel.add(LabeledComponent.create(runFile, "Run File"));
	panel.add(codeEliminationOn);
	panel.add(codeReformattingOn);

	component = panel;

	init();
}
 
Example #10
Source File: TaskSettingsComponent.java    From JHelper with GNU Lesser General Public License v3.0 5 votes vote down vote up
public TaskSettingsComponent(Project project, boolean canChangeName, StreamConfigurationPanel.SizeChangedListener listener) {
	super(new VerticalLayout());
	this.project = project;
	this.listener = listener;
	this.canChangeName = canChangeName;

	setTaskData(TaskData.emptyTaskData(project));
}
 
Example #11
Source File: ResetPasswordWizard.java    From arcusplatform with Apache License 2.0 4 votes vote down vote up
protected JPanel createContents() {
   ButtonGroup group = new ButtonGroup();
   group.add(email);
   group.add(phone);
   submit.addActionListener((e) -> this.submit());

   JPanel panel = new JPanel();
   panel.setLayout(new GridBagLayout());

   GridBagConstraints labels = new GridBagConstraints();
   labels.gridy = 0;
   labels.fill = GridBagConstraints.NONE;
   labels.anchor = GridBagConstraints.EAST;

   GridBagConstraints fields = new GridBagConstraints();
   fields.gridy = 0;
   fields.fill = GridBagConstraints.HORIZONTAL;
   fields.weightx = 1;
   
   panel.add(new JLabel("Username:"), labels.clone());
   panel.add(username, fields.clone());
   labels.gridy++;
   fields.gridy++;

   GridBagConstraints buttons = new GridBagConstraints();
   buttons.gridy = labels.gridy + 1;
   buttons.weightx = 1.0;
   buttons.fill = GridBagConstraints.HORIZONTAL;
   buttons.anchor = GridBagConstraints.NORTHEAST;
   buttons.gridwidth = 2;

   JPanel selectorPanel = new JPanel();
   selectorPanel.setLayout(new VerticalLayout());
   selectorPanel.setBorder(BorderFactory.createTitledBorder("Notify me by:"));
   selectorPanel.add(email);
   selectorPanel.add(phone);
   panel.add(selectorPanel, buttons.clone());
   buttons.gridy++;


   buttons.weighty = 1.0;
   buttons.fill = GridBagConstraints.NONE;
   
   JPanel buttonPanel = new JPanel();
   buttonPanel.setLayout(new HorizontalLayout());

   buttonPanel.add(submit);
   panel.add(buttonPanel, buttons.clone());

   return panel;
}
 
Example #12
Source File: ListPanel.java    From WIFIADB with Apache License 2.0 4 votes vote down vote up
public ListPanel() {
    super(new VerticalLayout(5));
}