diff options
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java index a0104ade..34b38395 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java @@ -1,5 +1,6 @@ package org.openslx.dozmod.gui.wizard.layout; +import java.awt.FlowLayout; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JEditorPane; @@ -8,9 +9,9 @@ import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JButton; import javax.swing.text.StyledEditorKit; +import javax.swing.text.html.HTMLEditorKit; import java.awt.Dimension; -import java.awt.GridLayout; import org.openslx.bwlp.thrift.iface.OperatingSystem; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.control.ComboBox; @@ -35,6 +36,12 @@ public abstract class ImageMetaDataPageLayout extends WizardPage { protected final JButton btnBold; protected final JButton btnItalic; protected final JButton btnUnderline; + protected final JButton btnWysiwyg; + + protected final JComboBox cbTxtSize; + protected final JComboBox cbTxtColor; + protected final HTMLEditorKit kit; + /** * wizard page for entering image data at creating or editing an image @@ -45,7 +52,7 @@ public abstract class ImageMetaDataPageLayout extends WizardPage { super(wizard, "Metadaten"); setDescription("Geben Sie bitte einen aussagekräftigen Namen für die neue VM ein."); - GridManager grid = new GridManager(this, 2, false); + GridManager grid = new GridManager(this, 3, false); QLabel osCaption = new QLabel("Betriebssystem"); cboOperatingSystem = new ComboBox<>(Comparators.operatingSystem, new ComboBoxRenderer<OperatingSystem>() { @@ -58,7 +65,8 @@ public abstract class ImageMetaDataPageLayout extends WizardPage { }); cboOperatingSystem.setEditable(false); grid.add(osCaption); - grid.add(cboOperatingSystem); + grid.add(cboOperatingSystem, 2); + grid.nextRow(); sCommandCaption = new QLabel("Startbefehl"); startCommand = new JTextArea(1, 50); @@ -70,47 +78,65 @@ public abstract class ImageMetaDataPageLayout extends WizardPage { startCommandPane.setMinimumSize(startCommand.getMinimumSize()); grid.add(sCommandCaption); grid.add(startCommandPane).fill(true, false).expand(true, false); + grid.add(new JPanel()); grid.nextRow(); // buttons for text editing JPanel editingPanel = new JPanel(); - editingPanel.setLayout(new GridLayout(1, 3)); + editingPanel.setLayout(new FlowLayout(FlowLayout.LEADING)); JPanel emptyPanel = new JPanel(); grid.add(emptyPanel); btnBold = new JButton(new StyledEditorKit.BoldAction()); - btnBold.setIcon(Gui.getScaledIconResource("/img/bold.png", "B", 24, this)); + btnBold.setIcon(Gui.getScaledIconResource("/img/bold.png", "B", 15, this)); btnBold.setText(""); btnItalic = new JButton(new StyledEditorKit.ItalicAction()); - btnItalic.setIcon(Gui.getScaledIconResource("/img/italic.png", "B", 24, this)); + btnItalic.setIcon(Gui.getScaledIconResource("/img/italic.png", "B", 15, this)); btnItalic.setText(""); btnUnderline = new JButton(new StyledEditorKit.UnderlineAction()); - btnUnderline.setIcon(Gui.getScaledIconResource("/img/underline.png", "B", 24, this)); + btnUnderline.setIcon(Gui.getScaledIconResource("/img/underline.png", "B", 15, this)); btnUnderline.setText(""); editingPanel.add(btnBold); editingPanel.add(btnItalic); editingPanel.add(btnUnderline); - grid.add(editingPanel); + String[] textsizes = {"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29"}; + cbTxtSize = new JComboBox<>(textsizes); + cbTxtSize.setPreferredSize(new Dimension(65,25)); + editingPanel.add(cbTxtSize); + + Object[] colors = {"Black", "Blue", "Red", "Yellow", "Green"}; + cbTxtColor = new JComboBox<>(colors); + cbTxtColor.setPreferredSize(new Dimension(95,25)); + editingPanel.add(cbTxtColor); + + grid.add(editingPanel); + emptyPanel.setLayout(new FlowLayout()); + btnWysiwyg = new JButton("HTML"); + btnWysiwyg.setPreferredSize(new Dimension(100,25)); + emptyPanel.add(btnWysiwyg); + grid.add(emptyPanel); grid.nextRow(); // description QLabel descriptionCaption = new QLabel("Beschreibung"); txtDescription = new JEditorPane(); + kit = new HTMLEditorKit(); + txtDescription.setEditorKit(kit); txtDescription.setContentType("text/html"); JScrollPane descPane = new JScrollPane(txtDescription, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); grid.add(descriptionCaption); - grid.add(descPane).fill(true, true).expand(true, true); + grid.add(descPane, 2).fill(true, true).expand(true, true); grid.nextRow(); chkLicenseRestricted = new JCheckBox("VM enthält lizenzpflichtige Software"); chkLicenseRestricted.setSelected(true); - grid.add(chkLicenseRestricted, 2); + grid.add(chkLicenseRestricted, 3); grid.nextRow(); // -- end permissions group -- chkIsTemplate = new JCheckBox("Vorlage erstellen"); - grid.add(chkIsTemplate, 2); + grid.add(chkIsTemplate, 3); grid.nextRow(); grid.finish(true); |