Search in sources :

Example 1 with LiveTitlePane

use of org.jivesoftware.fastpath.internal.LiveTitlePane in project Spark by igniterealtime.

the class RoomInformation method showAllInformation.

public void showAllInformation(Map<String, List<String>> map) {
    if (map == null) {
        map = new HashMap<>();
    }
    LiveTitlePane titlePanel = new LiveTitlePane(FpRes.getString("title.request.information"), FastpathRes.getImageIcon(FastpathRes.FASTPATH_IMAGE_24x24));
    final RequestUtils utils = new RequestUtils(map);
    setLayout(new GridBagLayout());
    setBackground(Color.white);
    // add(titlePanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
    Iterator<String> iter = map.keySet().iterator();
    int row = 1;
    while (iter.hasNext()) {
        String key = iter.next();
        String value = utils.getValue(key);
        JLabel nameLabel = new JLabel(key);
        nameLabel.setFont(new Font("Dialog", Font.BOLD, 12));
        WrappedLabel valueLabel = new WrappedLabel();
        valueLabel.setBackground(Color.white);
        valueLabel.setText(value);
        add(nameLabel, new GridBagConstraints(0, row, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
        add(valueLabel, new GridBagConstraints(1, row, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
        row++;
    }
    add(new JLabel(""), new GridBagConstraints(1, row, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0));
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) WrappedLabel(org.jivesoftware.spark.component.WrappedLabel) LiveTitlePane(org.jivesoftware.fastpath.internal.LiveTitlePane) RequestUtils(org.jivesoftware.fastpath.workspace.util.RequestUtils) Font(java.awt.Font)

Example 2 with LiveTitlePane

use of org.jivesoftware.fastpath.internal.LiveTitlePane in project Spark by igniterealtime.

the class RoomInformation method showAllInformation.

public void showAllInformation(Map map) {
    if (map == null) {
        map = new HashMap();
    }
    LiveTitlePane titlePanel = new LiveTitlePane(FpRes.getString("title.request.information"), FastpathRes.getImageIcon(FastpathRes.FASTPATH_IMAGE_24x24));
    final RequestUtils utils = new RequestUtils(map);
    setLayout(new GridBagLayout());
    setBackground(Color.white);
    // add(titlePanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
    Iterator<String> iter = map.keySet().iterator();
    int row = 1;
    while (iter.hasNext()) {
        String key = iter.next();
        String value = utils.getValue(key);
        JLabel nameLabel = new JLabel(key);
        nameLabel.setFont(new Font("Dialog", Font.BOLD, 12));
        WrappedLabel valueLabel = new WrappedLabel();
        valueLabel.setBackground(Color.white);
        valueLabel.setText(value);
        add(nameLabel, new GridBagConstraints(0, row, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
        add(valueLabel, new GridBagConstraints(1, row, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
        row++;
    }
    add(new JLabel(""), new GridBagConstraints(1, row, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0));
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) HashMap(java.util.HashMap) JLabel(javax.swing.JLabel) WrappedLabel(org.jivesoftware.spark.component.WrappedLabel) LiveTitlePane(org.jivesoftware.fastpath.internal.LiveTitlePane) RequestUtils(org.jivesoftware.fastpath.workspace.util.RequestUtils) Font(java.awt.Font)

Aggregations

Font (java.awt.Font)2 GridBagConstraints (java.awt.GridBagConstraints)2 GridBagLayout (java.awt.GridBagLayout)2 Insets (java.awt.Insets)2 JLabel (javax.swing.JLabel)2 LiveTitlePane (org.jivesoftware.fastpath.internal.LiveTitlePane)2 RequestUtils (org.jivesoftware.fastpath.workspace.util.RequestUtils)2 WrappedLabel (org.jivesoftware.spark.component.WrappedLabel)2 HashMap (java.util.HashMap)1