Example usage for com.jgoodies.forms.layout Sizes pixel

List of usage examples for com.jgoodies.forms.layout Sizes pixel

Introduction

In this page you can find the example usage for com.jgoodies.forms.layout Sizes pixel.

Prototype

public static ConstantSize pixel(int value) 

Source Link

Document

Creates and returns a ConstantSize for the specified pixel value.

Usage

From source file:com.eviware.soapui.support.components.JEditorStatusBar.java

License:EUPL

public JEditorStatusBar(JEditorStatusBarTarget target) {
    this.target = target;

    caretLabel = new JLabel();
    caretLabel.setPreferredSize(new Dimension(60, 16));

    infoLabel = new JLabel();
    infoLabel.setVisible(false);//  w w w .j a  v  a  2s . c  om

    caretLabel.setBorder(
            BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(0, 1, 0, 0, Color.LIGHT_GRAY),
                    BorderFactory.createMatteBorder(0, 1, 0, 0, Color.WHITE)));

    ButtonBarBuilder builder = new ButtonBarBuilder(this);
    builder.addGriddedGrowing(infoLabel);
    builder.addStrut(Sizes.pixel(2));

    statusPanel = new JPanel(new BorderLayout());
    statusPanel.setPreferredSize(new Dimension(60, 16));

    statusPanel.setBorder(
            BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(0, 1, 0, 0, Color.LIGHT_GRAY),
                    BorderFactory.createMatteBorder(0, 1, 0, 0, Color.WHITE)));

    builder.addFixed(statusPanel);
    builder.addFixed(caretLabel);
    builder.getPanel();
}

From source file:de.dfki.dmas.owls2wsdl.gui.ConfigurationFrame.java

License:Open Source License

/** Creates a new instance of ConfigurationFrame */
public ConfigurationFrame(OWLS2WSDLGui frame) {
    this.mainWindowRef = frame;
    this.setTitle("OWLS2WSDL :: Configuration");
    this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    this.setPreferredSize(ConfigurationFrame.PREFERRED_SIZE);

    this.contentPane = new JPanel(new BorderLayout());
    // this.contentPane.setBackground(Color.WHITE);
    this.setContentPane(this.contentPane);
    this.contentPane.setBorder(
            Borders.createEmptyBorder(Sizes.pixel(10), Sizes.pixel(10), Sizes.pixel(10), Sizes.pixel(10)));

    int fieldLen = 28;

    this.applPathField = new JTextField(32);
    this.applPathField.setEditable(false);
    this.applPathField.setBackground(Color.WHITE);
    this.applPathBrowseButton = new JButton("Path...");
    this.applPathBrowseButton.setActionCommand(SET_APPL_PATH);
    this.applPathBrowseButton.addActionListener(this);

    this.logPathField = new JTextField(fieldLen);
    this.logPathField.setEditable(false);

    this.persistentProjectDirectoryField = new JTextField(fieldLen);
    this.persistentDatatypeDirectoryField = new JTextField(fieldLen);
    this.persistentProjectDirectoryField.setEditable(false);
    this.persistentDatatypeDirectoryField.setEditable(false);
    this.persistentDatatypeCheckBox = new JCheckBox("load referenced datatypes only (experimental)");
    this.jconsoleCheckBox = new JCheckBox("activate JConsole at start time");

    // this.xsdExportPathField = new JTextField(fieldLen);
    this.exportDirectoryField = new JTextField(32);
    this.exportDirectoryField.setEditable(false);
    this.exportDirectoryField.setBackground(Color.WHITE);
    this.exportDirectoryBrowseButton = new JButton("Path...");
    this.exportDirectoryBrowseButton.setActionCommand(SET_EXPORT_DIRECTORY);
    this.exportDirectoryBrowseButton.addActionListener(this);

    this.buildRelativePathCheckBox = new JCheckBox("extract in relative paths");
    this.buildRelativePathCheckBox.setSelected(false);
    this.buildRelativePathCheckBox.setEnabled(false);

    // this.applPathField.setFont(new Font("Dialog", Font.PLAIN, 10));
    // System.out.println("FONT_INFO: "+this.applPathField.getFont().toString());

    xsdTypeInheritanceBehaviour = new JComboBox<String>();
    xsdTypeInheritanceBehaviour.addItem(AbstractDatatype.InheritanceByNone);
    xsdTypeInheritanceBehaviour.addItem(AbstractDatatype.InheritanceBySuperClassOnly);
    xsdTypeInheritanceBehaviour.addItem(AbstractDatatype.InheritanceByRDFTypeOnly);
    xsdTypeInheritanceBehaviour.addItem(AbstractDatatype.InheritanceByRDFTypeFirstParentsSecond);
    xsdTypeInheritanceBehaviour.addItem(AbstractDatatype.InheritanceByParentsFirstRDFTypeSecond);

    String[] primitiveSchemaTypes = { "http://www.w3.org/2001/XMLSchema#anyType",
            "http://www.w3.org/2001/XMLSchema#anyURI", "http://www.w3.org/2001/XMLSchema#string",
            "http://www.w3.org/2001/XMLSchema#decimal", "http://www.w3.org/2001/XMLSchema#integer",
            "http://www.w3.org/2001/XMLSchema#float", "http://www.w3.org/2001/XMLSchema#boolean",
            "http://www.w3.org/2001/XMLSchema#date", "http://www.w3.org/2001/XMLSchema#time" };
    projectDefaultXsdTypeField = new JComboBox<String>(primitiveSchemaTypes);

    shortButton = new JRadioButton("use ext. venetian blind (short)");
    shortButton.setBorderPainted(false);
    shortButton.setContentAreaFilled(false);
    shortButton.setSelected(true);/* w  w w  . ja  va  2s  .c o m*/

    hierarchyButton = new JRadioButton("use hierarchy pattern (subclassing)");
    hierarchyButton.setBorderPainted(false);
    hierarchyButton.setContentAreaFilled(false);
    hierarchyButton.setSelected(false);

    xsdSelectionGroup = new ButtonGroup();
    xsdSelectionGroup.add(shortButton);
    xsdSelectionGroup.add(hierarchyButton);

    addMetaTypesCheckBox = new JCheckBox("add meta types to express OWL anonymous language terms");
    addAnnotationCheckBox = new JCheckBox("add XML Schema annotations (general and OWL information)");

    defaultElementDepthField = new JTextField(2);
    defaultElementDepthField.setText("0");

    projectElementDepthField = new JComboBox<String>();
    for (int i = 0; i <= 10; i++) {
        projectElementDepthField.addItem(Integer.toString(i));
    }

    deLangButton = new JRadioButton("de");
    enLangButton = new JRadioButton("en");
    lanSelectionGroup = new ButtonGroup();
    lanSelectionGroup.add(deLangButton);
    lanSelectionGroup.add(enLangButton);

    plasticLfButton = new JRadioButton("PlasticXP");
    plasticLfButton.setActionCommand("CHANGE_LF_TO_PLASTIC");
    plasticLfButton.addActionListener(this);
    plasticLfButton.setSelected(true);
    windowsLfButton = new JRadioButton("Windows");
    windowsLfButton.setActionCommand("CHANGE_LF_TO_WINDOWS");
    windowsLfButton.addActionListener(this);
    motifLfButton = new JRadioButton("Motif");
    motifLfButton.setActionCommand("CHANGE_LF_TO_MOTIF");
    motifLfButton.addActionListener(this);

    lfSelectionGroup = new ButtonGroup();
    lfSelectionGroup.add(plasticLfButton);
    lfSelectionGroup.add(windowsLfButton);
    lfSelectionGroup.add(motifLfButton);

    // EXPORT / WSDL /OWL-S Config-Panel
    this.wsdlNamespaceField = new JTextField(fieldLen);
    this.autoNamespaceBaseSelectButton = new JRadioButton("auto (using parsed service data)");
    this.autoNamespaceBaseSelectButton.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                System.out.println("autoNamespaceBaseSelectButton selected");
                wsdlNamespaceField.setEditable(false);
                wsdlNamespaceField.setEnabled(false);
            }
        }
    });
    this.newNamespaceBaseSelectButton = new JRadioButton("set new tns: <base_path><service>");
    this.newNamespaceBaseSelectButton.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                System.out.println("newNamespaceBaseSelectButton selected");
                wsdlNamespaceField.setEditable(true);
                wsdlNamespaceField.setEnabled(true);
            }
        }
    });
    nsBaseSelectionGroup = new ButtonGroup();
    nsBaseSelectionGroup.add(autoNamespaceBaseSelectButton);
    nsBaseSelectionGroup.add(newNamespaceBaseSelectButton);
    // ---
    // this.axisServicePathField = new JTextField(fieldLen);
    // ---
    this.owlsBaseField = new JTextField(fieldLen);
    this.autoOWLSBaseSelectButton = new JRadioButton("auto (using parsed service data)");
    this.autoOWLSBaseSelectButton.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                owlsBaseField.setEditable(false);
                owlsBaseField.setEnabled(false);
            }
        }
    });
    this.newOWLSBaseSelectButton = new JRadioButton("set new owl-s base: <base_path><OWLS_DOC>");
    this.newOWLSBaseSelectButton.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                owlsBaseField.setEditable(true);
                owlsBaseField.setEnabled(true);
            }
        }
    });
    owlsBaseSelectionGroup = new ButtonGroup();
    owlsBaseSelectionGroup.add(autoOWLSBaseSelectButton);
    owlsBaseSelectionGroup.add(newOWLSBaseSelectButton);
    // ---
    this.wsdldocPathField = new JTextField(fieldLen);
    this.autoWsdldocPathSelectButton = new JRadioButton("auto (use WSDL Builder setting above)");
    this.autoWsdldocPathSelectButton.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                wsdldocPathField.setEditable(false);
                wsdldocPathField.setEnabled(false);
            }
        }
    });
    this.setWsdlDocPathSelectButton = new JRadioButton("set new address path: <base_path><WSDL_DOC>");
    this.setWsdlDocPathSelectButton.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                wsdldocPathField.setEditable(true);
                wsdldocPathField.setEnabled(true);
            }
        }
    });
    this.wsdldocPathSelectionGroup = new ButtonGroup();
    this.wsdldocPathSelectionGroup.add(autoWsdldocPathSelectButton);
    this.wsdldocPathSelectionGroup.add(setWsdlDocPathSelectButton);
    // ======================================================================
    JComponent configPanel = buildConfigSubPanel(false);
    JPanel commandPanel = buildCommandSubPanel();

    this.add(configPanel, BorderLayout.CENTER);
    this.add(commandPanel, BorderLayout.SOUTH);
    this.pack();
    this.locateOnScreen(this);
    this.initContentsFromConfigurationFile();

    // updateFromProjectData...
    this.projectElementDepthField.setEnabled(false);
    this.xsdTypeInheritanceBehaviour.setEnabled(false);
}

From source file:de.dfki.dmas.owls2wsdl.gui.ExportWSDLFrame.java

License:Open Source License

/** Creates a new instance of ExportWSDLFrame */
public ExportWSDLFrame() {
    System.out.println("[C] ExportWSDLFrame");

    urlField = new JTextField(10);
    urlField.setEditable(false);/*from   www  .j  a  v a  2 s.c  o m*/

    if (OWLS2WSDLSettings.getInstance().containsKey("EXPORT_PATH")) {
        this.exportDirectory = new File(OWLS2WSDLSettings.getInstance().getProperty("EXPORT_PATH"));
        this.urlField.setText(this.exportDirectory.getAbsolutePath()); // getCanonicalPath());
    }

    this.setTitle("OWLS2WSDL :: Export WSDL and OWL-S");
    this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    this.setPreferredSize(PREFERRED_SIZE);

    this.contentPane = new JPanel(new BorderLayout());
    this.setContentPane(this.contentPane);
    this.contentPane.setBorder(
            Borders.createEmptyBorder(Sizes.pixel(10), Sizes.pixel(10), Sizes.pixel(10), Sizes.pixel(10)));

    translatableServiceList = new JList<AbstractService>(new ServiceListModel());
    translatableServiceList.setVisibleRowCount(7);
    translatableServiceList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    nonTranslatableServiceList = new JList<AbstractService>(new ServiceListModel());
    nonTranslatableServiceList.setVisibleRowCount(7);
    nonTranslatableServiceList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    // buildRelativePathCheckBox = new JCheckBox("use relative paths");
    generateWSDLCheckBox = new JCheckBox("WSDL");
    generateWSDLCheckBox.setActionCommand(CHECK_STARTBUTTON);
    generateWSDLCheckBox.addActionListener(this);
    generateOWLSCheckBox = new JCheckBox("reconstruct OWL-S from internal metamodel");
    generateOWLSCheckBox.setActionCommand(CHECK_STARTBUTTON);
    generateOWLSCheckBox.addActionListener(this);

    translatableCount = "0";
    nontranslatableCount = "0";

    exportLog = new JTextArea("", 6, 20);

    exportPanel = buildExportSubPanel(false);
    JPanel commandPanel = buildCommandSubPanel();

    this.add(exportPanel, BorderLayout.CENTER);
    this.add(commandPanel, BorderLayout.SOUTH);
    this.pack();
    this.locateOnScreen(this);

    this.exportThread = new WSDLOWLSExport(this);
}

From source file:org.siberia.ui.swing.dialog.ValidationDialog.java

License:Open Source License

/** build the validation panel according to the size of the content panel **/
private void buildValidationPanel() {
    FormLayout layout = new FormLayout("", "15dlu");

    int maxButton = Math.max(this.valid.getPreferredSize().width, this.annule.getPreferredSize().width);

    int sizeColumn = (int) (this.getContentPanel().getPreferredSize().width - 2 * maxButton) / 3;

    ColumnSpec colSpace = new ColumnSpec(Sizes.pixel(sizeColumn));
    ColumnSpec colButton = new ColumnSpec(Sizes.pixel(maxButton));
    layout.appendColumn(colSpace);/*from   ww  w . j  a v a2s  . c om*/
    layout.appendColumn(colButton);
    layout.appendColumn(colSpace);
    layout.appendColumn(colButton);
    layout.appendColumn(colSpace);

    this.validAnnul.setLayout(layout);

    CellConstraints cc = new CellConstraints();
    this.validAnnul.add(this.valid, cc.xy(2, 1, cc.FILL, cc.FILL));
    this.validAnnul.add(this.annule, cc.xy(4, 1, cc.FILL, cc.FILL));
    this.getPanel().add(this.validAnnul, cc.xy(1, 2));
}

From source file:org.springframework.richclient.util.GuiStandardUtils.java

License:Apache License

public static Border createEvenlySpacedBorder(int spacePx) {
    return createEvenlySpacedBorder(Sizes.pixel(spacePx));
}

From source file:org.springframework.richclient.util.GuiStandardUtils.java

License:Apache License

public static Border createLeftAndRightBorder(int spacePx) {
    return createLeftAndRightBorder(Sizes.pixel(spacePx));
}

From source file:org.springframework.richclient.util.GuiStandardUtils.java

License:Apache License

public static Border createTopAndBottomBorder(int spacePx) {
    return createTopAndBottomBorder(Sizes.pixel(spacePx));
}