Example usage for java.awt Font DIALOG

List of usage examples for java.awt Font DIALOG

Introduction

In this page you can find the example usage for java.awt Font DIALOG.

Prototype

String DIALOG

To view the source code for java.awt Font DIALOG.

Click Source Link

Document

A String constant for the canonical family name of the logical font "Dialog".

Usage

From source file:Main.java

public static FontMetrics getFontMetrics(Component component) {
    Font font = component.getFont();
    if (font == null) {
        font = Font.getFont(Font.DIALOG);
    }/*  ww w .j a v  a 2  s.  com*/
    return component.getFontMetrics(font);
}

From source file:grafix.graficos.eixos.EixoHorizontalComLabels.java

public EixoHorizontalComLabels(JanelaGraficos janela) {
    super(janela);
    this.acao = janela.getAcao();
    setTickLabelFont(new Font(Font.DIALOG, Font.PLAIN, 9));
    setAutoTickUnitSelection(true);//from   ww w. j av a 2  s.co  m
}

From source file:com.romraider.logger.ecu.ui.handler.dash.SmallDialGaugeStyle.java

protected JFreeChart buildChart() {
    DialPlot plot = new DialPlot();
    plot.setView(0.0, 0.0, 1.0, 1.0);//from ww  w  .  j  ava2 s . c o m
    plot.setDataset(0, current);
    plot.setDataset(1, max);
    plot.setDataset(2, min);
    DialFrame dialFrame = new StandardDialFrame();
    plot.setDialFrame(dialFrame);

    GradientPaint gp = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(),
            new Color(170, 170, 220));
    DialBackground db = new DialBackground(gp);
    db.setGradientPaintTransformer(new StandardGradientPaintTransformer(VERTICAL));
    plot.setBackground(db);

    unitsLabel.setFont(new Font(Font.DIALOG, BOLD, 14));
    unitsLabel.setRadius(0.7);
    unitsLabel.setLabel(loggerData.getSelectedConvertor().getUnits());
    plot.addLayer(unitsLabel);

    DecimalFormat format = new DecimalFormat(loggerData.getSelectedConvertor().getFormat());

    DialValueIndicator dvi = new DialValueIndicator(0);
    dvi.setNumberFormat(format);
    plot.addLayer(dvi);

    EcuDataConvertor convertor = loggerData.getSelectedConvertor();
    GaugeMinMax minMax = convertor.getGaugeMinMax();
    StandardDialScale scale = new StandardDialScale(minMax.min, minMax.max, 225.0, -270.0, minMax.step, 5);
    scale.setTickRadius(0.88);
    scale.setTickLabelOffset(0.15);
    scale.setTickLabelFont(new Font(Font.DIALOG, PLAIN, 12));
    scale.setTickLabelFormatter(format);
    plot.addScale(0, scale);
    plot.addScale(1, scale);
    plot.addScale(2, scale);

    StandardDialRange range = new StandardDialRange(rangeLimit(minMax, 0.75), minMax.max, RED);
    range.setInnerRadius(0.52);
    range.setOuterRadius(0.55);
    plot.addLayer(range);

    StandardDialRange range2 = new StandardDialRange(rangeLimit(minMax, 0.5), rangeLimit(minMax, 0.75), ORANGE);
    range2.setInnerRadius(0.52);
    range2.setOuterRadius(0.55);
    plot.addLayer(range2);

    StandardDialRange range3 = new StandardDialRange(minMax.min, rangeLimit(minMax, 0.5), GREEN);
    range3.setInnerRadius(0.52);
    range3.setOuterRadius(0.55);
    plot.addLayer(range3);

    DialPointer needleCurrent = new DialPointer.Pointer(0);
    plot.addLayer(needleCurrent);

    DialPointer needleMax = new DialPointer.Pin(1);
    needleMax.setRadius(0.84);
    ((DialPointer.Pin) needleMax).setPaint(RED);
    ((DialPointer.Pin) needleMax).setStroke(new BasicStroke(1.5F));
    plot.addLayer(needleMax);

    DialPointer needleMin = new DialPointer.Pin(2);
    needleMin.setRadius(0.84);
    ((DialPointer.Pin) needleMin).setPaint(BLUE);
    ((DialPointer.Pin) needleMin).setStroke(new BasicStroke(1.5F));
    plot.addLayer(needleMin);

    DialCap cap = new DialCap();
    cap.setRadius(0.10);
    plot.setCap(cap);

    JFreeChart chart = new JFreeChart(plot);
    chart.setTitle(loggerData.getName());

    return chart;
}

From source file:StoppUhr.java

private void initGUI() {
    try {// w  w  w  .  j  a  va2s.c o  m
        AnchorLayout thisLayout = new AnchorLayout();
        getContentPane().setLayout(thisLayout);
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        this.setPreferredSize(new java.awt.Dimension(609, 394));
        {
            jPanel3 = new JPanel();
            GridBagLayout jPanel3Layout = new GridBagLayout();
            jPanel3.setLayout(jPanel3Layout);
            getContentPane().add(jPanel3, new AnchorConstraint(668, 811, 978, 19, AnchorConstraint.ANCHOR_REL,
                    AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
            jPanel3.setPreferredSize(new java.awt.Dimension(384, 94));
            {
                jScrollPane1 = new JScrollPane();
                jPanel3.add(jScrollPane1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                        GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                jScrollPane1.setPreferredSize(new java.awt.Dimension(300, 90));
                {
                    jTextArea = new JTextArea();
                    jScrollPane1.setViewportView(jTextArea);
                    jTextArea.setText("");
                }
            }
            {
                jTextFieldStNr = new JTextField();
                jPanel3.add(jTextFieldStNr, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
                        GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                jTextFieldStNr.setText("");
                jTextFieldStNr.setPreferredSize(new java.awt.Dimension(150, 90));
                jTextFieldStNr.setHorizontalAlignment(JTextField.CENTER);
                jTextFieldStNr.setFont(new Font(Font.DIALOG, Font.BOLD, 40));

            }
            jPanel3Layout.rowWeights = new double[] { 0.1 };
            jPanel3Layout.rowHeights = new int[] { 7 };
            jPanel3Layout.columnWeights = new double[] { 0.1, 0.1 };
            jPanel3Layout.columnWidths = new int[] { 7, 7 };
        }
        {
            jPanel2 = new JPanel();
            GridBagLayout jPanel2Layout = new GridBagLayout();
            jPanel2Layout.rowWeights = new double[] { 0.1, 0.1 };
            jPanel2Layout.rowHeights = new int[] { 7, 7 };
            jPanel2Layout.columnWeights = new double[] { 0.1 };
            jPanel2Layout.columnWidths = new int[] { 7 };
            jPanel2.setLayout(jPanel2Layout);
            getContentPane().add(jPanel2, new AnchorConstraint(47, 821, 721, 27, AnchorConstraint.ANCHOR_REL,
                    AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
            jPanel2.setPreferredSize(new java.awt.Dimension(363, 178));
            {
                uhrzeitAusgabe = new JLabel();
                jPanel2.add(uhrzeitAusgabe, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                        GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                uhrzeitAusgabe.setText("00:00:00");
                uhrzeitAusgabe.setFont(new Font(Font.DIALOG, Font.BOLD, uhrFontSize));

            }
            {
                stoppuhrAusgabe = new JLabel();
                jPanel2.add(stoppuhrAusgabe, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
                        GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                stoppuhrAusgabe.setText("00:00:00");
                stoppuhrAusgabe.setFont(new Font(Font.DIALOG, Font.BOLD, uhrFontSize));
            }
        }
        {
            jPanel1 = new JPanel();
            GridBagLayout jPanel1Layout = new GridBagLayout();
            getContentPane().add(jPanel1, new AnchorConstraint(48, 987, 954, 820, AnchorConstraint.ANCHOR_REL,
                    AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL));
            jPanel1Layout.rowWeights = new double[] { 0.1, 0.1, 0.1, 1.0, 0.1 };
            jPanel1Layout.rowHeights = new int[] { 1, 1, 1, 1, 1 };
            jPanel1Layout.columnWeights = new double[] { 0.1 };
            jPanel1Layout.columnWidths = new int[] { 7 };
            jPanel1.setLayout(jPanel1Layout);
            jPanel1.setPreferredSize(new java.awt.Dimension(100, 330));
            {
                startButton = new JButton();
                jPanel1.add(startButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                        GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                startButton.setPreferredSize(new java.awt.Dimension(90, 30));
                startButton.setText("Start");
            }
            {
                resetButton = new JButton();
                jPanel1.add(resetButton, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                        GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                resetButton.setText("Reset");
                resetButton.setPreferredSize(new java.awt.Dimension(90, 30));
            }
            {
                jPanel4 = new JPanel();
                GridBagLayout jPanel4Layout = new GridBagLayout();
                jPanel1.add(jPanel4, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                        GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                jPanel4.setPreferredSize(new java.awt.Dimension(51, 81));
                jPanel4Layout.rowWeights = new double[] { 0.1, 0.1, 0.1 };
                jPanel4Layout.rowHeights = new int[] { 7, 7, 7 };
                jPanel4Layout.columnWeights = new double[] { 0.1 };
                jPanel4Layout.columnWidths = new int[] { 7 };
                jPanel4.setLayout(jPanel4Layout);
                {
                    plusButton = new JButton();
                    jPanel4.add(plusButton, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
                            GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                    plusButton.setText("+");
                    plusButton.setPreferredSize(new java.awt.Dimension(50, 30));
                }
                {
                    minusButton = new JButton();
                    jPanel4.add(minusButton, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
                            GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                    minusButton.setText("-");
                    minusButton.setPreferredSize(new java.awt.Dimension(50, 30));
                }
                {
                    jLabelFontSize = new JLabel();
                    jPanel4.add(jLabelFontSize, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                            GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                    jLabelFontSize.setFont(new Font(Font.DIALOG, Font.PLAIN, 10));
                    jLabelFontSize.setText("Font Size");
                }
            }

        }

        this.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent evt) {
                thisWindowClosing(evt);
            }
        });

        startButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                startButtonListener(evt);
            }
        });

        resetButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                resetButtonListener(evt);
            }
        });

        jTextFieldStNr.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                try {
                    stNrFieldListener(evt);
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        });

        plusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                plusButtonListener(evt);
            }
        });

        minusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                minusButtonListener(evt);
            }
        });

        pack();
        this.setSize(609, 394);
    } catch (Exception e) {
        //add your error handling code here
        e.printStackTrace();
    }
}

From source file:com.romraider.logger.ecu.ui.handler.dash.DialGaugeStyle.java

protected JFreeChart buildChart() {
    DialPlot plot = new DialPlot();
    plot.setView(0.0, 0.0, 1.0, 1.0);/*from   w w w  .  j a  v a  2s  .c o m*/
    plot.setDataset(0, current);
    plot.setDataset(1, max);
    plot.setDataset(2, min);
    DialFrame dialFrame = new StandardDialFrame();
    plot.setDialFrame(dialFrame);

    GradientPaint gp = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(),
            new Color(170, 170, 220));
    DialBackground db = new DialBackground(gp);
    db.setGradientPaintTransformer(new StandardGradientPaintTransformer(VERTICAL));
    plot.setBackground(db);

    unitsLabel.setFont(new Font(Font.DIALOG, BOLD, 15));
    unitsLabel.setRadius(0.7);
    unitsLabel.setLabel(loggerData.getSelectedConvertor().getUnits());
    plot.addLayer(unitsLabel);

    DecimalFormat format = new DecimalFormat(loggerData.getSelectedConvertor().getFormat());

    DialValueIndicator dvi = new DialValueIndicator(0);
    dvi.setNumberFormat(format);
    plot.addLayer(dvi);

    EcuDataConvertor convertor = loggerData.getSelectedConvertor();
    GaugeMinMax minMax = convertor.getGaugeMinMax();
    StandardDialScale scale = new StandardDialScale(minMax.min, minMax.max, 225.0, -270.0, minMax.step, 5);
    scale.setTickRadius(0.88);
    scale.setTickLabelOffset(0.15);
    scale.setTickLabelFont(new Font(Font.DIALOG, PLAIN, 12));
    scale.setTickLabelFormatter(format);
    plot.addScale(0, scale);
    plot.addScale(1, scale);
    plot.addScale(2, scale);

    StandardDialRange range = new StandardDialRange(rangeLimit(minMax, 0.75), minMax.max, RED);
    range.setInnerRadius(0.52);
    range.setOuterRadius(0.55);
    plot.addLayer(range);

    StandardDialRange range2 = new StandardDialRange(rangeLimit(minMax, 0.5), rangeLimit(minMax, 0.75), ORANGE);
    range2.setInnerRadius(0.52);
    range2.setOuterRadius(0.55);
    plot.addLayer(range2);

    StandardDialRange range3 = new StandardDialRange(minMax.min, rangeLimit(minMax, 0.5), GREEN);
    range3.setInnerRadius(0.52);
    range3.setOuterRadius(0.55);
    plot.addLayer(range3);

    DialPointer needleCurrent = new DialPointer.Pointer(0);
    plot.addLayer(needleCurrent);

    DialPointer needleMax = new DialPointer.Pin(1);
    needleMax.setRadius(0.84);
    ((DialPointer.Pin) needleMax).setPaint(RED);
    ((DialPointer.Pin) needleMax).setStroke(new BasicStroke(1.5F));
    plot.addLayer(needleMax);

    DialPointer needleMin = new DialPointer.Pin(2);
    needleMin.setRadius(0.84);
    ((DialPointer.Pin) needleMin).setPaint(BLUE);
    ((DialPointer.Pin) needleMin).setStroke(new BasicStroke(1.5F));
    plot.addLayer(needleMin);

    DialCap cap = new DialCap();
    cap.setRadius(0.10);
    plot.setCap(cap);

    JFreeChart chart = new JFreeChart(plot);
    chart.setTitle(loggerData.getName());

    return chart;
}

From source file:org.biojava.bio.view.MotifAnalyzer.java

private JPanel getInputTab() {
    inputTab = new JPanel(new GridLayout(1, 1)); //////////////////
    {/* ww w.ja  v  a 2  s.co  m*/
        JPanel generalPar = new JPanel();
        inputTab.add(generalPar);
        GroupLayout inputTabLayout = new GroupLayout((JComponent) generalPar);
        generalPar.setLayout(inputTabLayout);
        generalPar.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.black),
                "General Parameters", 0, 0, new Font(Font.DIALOG, Font.BOLD, 16), Color.black));
        generalPar.setPreferredSize(new java.awt.Dimension(787, 291));
        inputTabLayout.setHorizontalGroup(inputTabLayout.createSequentialGroup().addContainerGap(12, 12)
                .addGroup(inputTabLayout.createParallelGroup()
                        .addGroup(GroupLayout.Alignment.LEADING,
                                inputTabLayout.createSequentialGroup()
                                        .addComponent(getCheckReverse(), GroupLayout.PREFERRED_SIZE, 198,
                                                GroupLayout.PREFERRED_SIZE)
                                        .addGap(250))
                        .addGroup(GroupLayout.Alignment.LEADING,
                                inputTabLayout.createSequentialGroup()
                                        .addComponent(getMultipleDataSets(), GroupLayout.PREFERRED_SIZE, 193,
                                                GroupLayout.PREFERRED_SIZE)
                                        .addGap(255))
                        .addGroup(inputTabLayout.createSequentialGroup()
                                .addGroup(inputTabLayout.createParallelGroup()
                                        .addComponent(getJLabel1(), GroupLayout.Alignment.LEADING,
                                                GroupLayout.PREFERRED_SIZE, 187, GroupLayout.PREFERRED_SIZE)
                                        .addGroup(GroupLayout.Alignment.LEADING,
                                                inputTabLayout.createSequentialGroup()
                                                        .addComponent(getJLabel8(), GroupLayout.PREFERRED_SIZE,
                                                                113, GroupLayout.PREFERRED_SIZE)
                                                        .addGap(74))
                                        .addGroup(GroupLayout.Alignment.LEADING,
                                                inputTabLayout.createSequentialGroup()
                                                        .addComponent(getJLabel7(), GroupLayout.PREFERRED_SIZE,
                                                                80, GroupLayout.PREFERRED_SIZE)
                                                        .addGap(107))
                                        .addGroup(GroupLayout.Alignment.LEADING,
                                                inputTabLayout.createSequentialGroup()
                                                        .addComponent(getJLabel2(), GroupLayout.PREFERRED_SIZE,
                                                                128, GroupLayout.PREFERRED_SIZE)
                                                        .addGap(59))
                                        .addGroup(GroupLayout.Alignment.LEADING,
                                                inputTabLayout.createSequentialGroup()
                                                        .addComponent(getJLabel3(), GroupLayout.PREFERRED_SIZE,
                                                                148, GroupLayout.PREFERRED_SIZE)
                                                        .addGap(39))
                                        .addGroup(GroupLayout.Alignment.LEADING,
                                                inputTabLayout.createSequentialGroup()
                                                        .addComponent(getJLabel4(), GroupLayout.PREFERRED_SIZE,
                                                                137, GroupLayout.PREFERRED_SIZE)
                                                        .addGap(50))
                                        .addGroup(GroupLayout.Alignment.LEADING,
                                                inputTabLayout.createSequentialGroup()
                                                        .addComponent(getJLabel6(), GroupLayout.PREFERRED_SIZE,
                                                                126, GroupLayout.PREFERRED_SIZE)
                                                        .addGap(61))
                                        .addGroup(GroupLayout.Alignment.LEADING,
                                                inputTabLayout.createSequentialGroup()
                                                        .addComponent(getJLabel5(), GroupLayout.PREFERRED_SIZE,
                                                                108, GroupLayout.PREFERRED_SIZE)
                                                        .addGap(79))
                                        .addGroup(GroupLayout.Alignment.LEADING,
                                                inputTabLayout.createSequentialGroup()
                                                        .addComponent(getJLabel9(), GroupLayout.PREFERRED_SIZE,
                                                                155, GroupLayout.PREFERRED_SIZE)
                                                        .addGap(32)))
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(inputTabLayout.createParallelGroup().addGroup(
                                        GroupLayout.Alignment.LEADING,
                                        inputTabLayout.createSequentialGroup()
                                                .addComponent(getMinPoints(), GroupLayout.PREFERRED_SIZE, 122,
                                                        GroupLayout.PREFERRED_SIZE)
                                                .addGap(134))
                                        .addGroup(GroupLayout.Alignment.LEADING,
                                                inputTabLayout.createSequentialGroup()
                                                        .addComponent(getClusteringEpsilon(),
                                                                GroupLayout.PREFERRED_SIZE, 122,
                                                                GroupLayout.PREFERRED_SIZE)
                                                        .addGap(134))
                                        .addGroup(GroupLayout.Alignment.LEADING, inputTabLayout
                                                .createSequentialGroup()
                                                .addComponent(getNumOfMotifs(), GroupLayout.PREFERRED_SIZE, 69,
                                                        GroupLayout.PREFERRED_SIZE)
                                                .addGap(187))
                                        .addGroup(GroupLayout.Alignment.LEADING, inputTabLayout
                                                .createSequentialGroup()
                                                .addComponent(getNumOfTrials(), GroupLayout.PREFERRED_SIZE, 69,
                                                        GroupLayout.PREFERRED_SIZE)
                                                .addGap(187))
                                        .addGroup(GroupLayout.Alignment.LEADING, inputTabLayout
                                                .createSequentialGroup()
                                                .addComponent(getMotifWidth(), GroupLayout.PREFERRED_SIZE, 69,
                                                        GroupLayout.PREFERRED_SIZE)
                                                .addGap(187))
                                        .addGroup(GroupLayout.Alignment.LEADING,
                                                inputTabLayout.createSequentialGroup()
                                                        .addComponent(getDatasetTypeComboBox(),
                                                                GroupLayout.PREFERRED_SIZE, 145,
                                                                GroupLayout.PREFERRED_SIZE)
                                                        .addGap(111))
                                        .addGroup(GroupLayout.Alignment.LEADING, inputTabLayout
                                                .createSequentialGroup()
                                                .addComponent(getDatasetComboBox(), GroupLayout.PREFERRED_SIZE,
                                                        145, GroupLayout.PREFERRED_SIZE)
                                                .addGap(111))
                                        .addComponent(getSpeciesType(), GroupLayout.Alignment.LEADING,
                                                GroupLayout.PREFERRED_SIZE, 256, GroupLayout.PREFERRED_SIZE)
                                        .addGroup(GroupLayout.Alignment.LEADING, inputTabLayout
                                                .createSequentialGroup()
                                                .addComponent(getNumOfClusters(), GroupLayout.PREFERRED_SIZE,
                                                        122, GroupLayout.PREFERRED_SIZE)
                                                .addGap(134)))))
                .addContainerGap(317, 317));
        inputTabLayout.setVerticalGroup(inputTabLayout.createSequentialGroup().addContainerGap()
                .addGroup(inputTabLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(getNumOfMotifs(), GroupLayout.Alignment.BASELINE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE)
                        .addComponent(getJLabel1(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                20, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(inputTabLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(getSpeciesType(), GroupLayout.Alignment.BASELINE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE)
                        .addComponent(getJLabel2(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                17, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(inputTabLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(getNumOfTrials(), GroupLayout.Alignment.BASELINE,
                                GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
                        .addComponent(getJLabel3(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(inputTabLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(getMotifWidth(), GroupLayout.Alignment.BASELINE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE)
                        .addComponent(getJLabel4(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                16, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(inputTabLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(getDatasetTypeComboBox(), GroupLayout.Alignment.BASELINE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE)
                        .addComponent(getJLabel6(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(inputTabLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(getDatasetComboBox(), GroupLayout.Alignment.BASELINE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE)
                        .addComponent(getJLabel5(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
                .addGap(20)
                .addComponent(getMultipleDataSets(), GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)
                .addGap(19)
                .addComponent(getCheckReverse(), GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE)
                .addGap(16)
                .addGroup(inputTabLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(getClusteringEpsilon(), GroupLayout.Alignment.BASELINE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE)
                        .addComponent(getJLabel7(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(inputTabLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(getMinPoints(), GroupLayout.Alignment.BASELINE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE)
                        .addComponent(getJLabel8(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(inputTabLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(getNumOfClusters(), GroupLayout.Alignment.BASELINE,
                                GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
                        .addComponent(getJLabel9(), GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE,
                                GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
                .addContainerGap(65, 65));
    }

    return inputTab;
}

From source file:net.pms.newgui.LooksFrame.java

/**
 * Constructs a <code>DemoFrame</code>, configures the UI,
 * and builds the content./* ww  w  .j  ava 2s . c o m*/
 */
public LooksFrame(AutoUpdater autoUpdater, @Nonnull PmsConfiguration configuration,
        @Nonnull WindowPropertiesConfiguration windowConfiguration) {
    super(windowConfiguration.getGraphicsConfiguration());
    if (configuration == null) {
        throw new IllegalArgumentException("configuration can't be null");
    }
    setResizable(true);
    windowProperties = new WindowProperties(this, STANDARD_SIZE, MINIMUM_SIZE, windowConfiguration);
    this.autoUpdater = autoUpdater;
    this.configuration = configuration;
    assert this.configuration != null;
    setMinimumSize(MINIMUM_SIZE);
    Options.setDefaultIconSize(new Dimension(18, 18));
    Options.setUseNarrowButtons(true);

    // Set view level, can be omitted if ViewLevel is implemented in configuration
    // by setting the view level as variable initialization
    if (configuration.isHideAdvancedOptions()) {
        viewLevel = ViewLevel.NORMAL;
    } else {
        viewLevel = ViewLevel.ADVANCED;
    }

    // Global options
    Options.setTabIconsEnabled(true);
    UIManager.put(Options.POPUP_DROP_SHADOW_ENABLED_KEY, null);

    // Swing Settings
    initializeLookAndFeel();

    // wait till the look and feel has been initialized before (possibly) displaying the update notification dialog
    if (autoUpdater != null) {
        autoUpdater.addObserver(this);
        autoUpdater.pollServer();
    }

    // Shared Fonts
    final Integer twelve = Integer.valueOf(12);
    final Integer fontPlain = Integer.valueOf(Font.PLAIN);
    final Integer fontBold = Integer.valueOf(Font.BOLD);

    LazyValue dialogPlain12 = new LazyValue() {
        @Override
        public Object createValue(UIDefaults t) {
            return new FontUIResource(Font.DIALOG, fontPlain, twelve);
        }
    };

    LazyValue sansSerifPlain12 = new LazyValue() {
        @Override
        public Object createValue(UIDefaults t) {
            return new FontUIResource(Font.SANS_SERIF, fontPlain, twelve);
        }
    };

    LazyValue monospacedPlain12 = new LazyValue() {
        @Override
        public Object createValue(UIDefaults t) {
            return new FontUIResource(Font.MONOSPACED, fontPlain, twelve);
        }
    };

    LazyValue dialogBold12 = new LazyValue() {
        @Override
        public Object createValue(UIDefaults t) {
            return new FontUIResource(Font.DIALOG, fontBold, twelve);
        }
    };

    Object MenuFont = dialogPlain12;
    Object FixedControlFont = monospacedPlain12;
    Object ControlFont = dialogPlain12;
    Object MessageFont = dialogPlain12;
    Object WindowFont = dialogBold12;
    Object ToolTipFont = sansSerifPlain12;
    Object IconFont = ControlFont;

    // Override our fonts with a unicode font for languages with special characters
    final String language = configuration.getLanguageTag();
    if (language != null && (language.equals("ja") || language.startsWith("zh") || language.equals("ko"))) {
        // http://propedit.sourceforge.jp/propertieseditor.jnlp
        MenuFont = sansSerifPlain12;
        FixedControlFont = sansSerifPlain12;
        ControlFont = sansSerifPlain12;
        MessageFont = sansSerifPlain12;
        WindowFont = sansSerifPlain12;
        IconFont = sansSerifPlain12;
    }

    UIManager.put("Button.font", ControlFont);
    UIManager.put("CheckBox.font", ControlFont);
    UIManager.put("CheckBoxMenuItem.font", MenuFont);
    UIManager.put("ComboBox.font", ControlFont);
    UIManager.put("EditorPane.font", ControlFont);
    UIManager.put("FileChooser.listFont", IconFont);
    UIManager.put("FormattedTextField.font", ControlFont);
    UIManager.put("InternalFrame.titleFont", WindowFont);
    UIManager.put("Label.font", ControlFont);
    UIManager.put("List.font", ControlFont);
    UIManager.put("PopupMenu.font", MenuFont);
    UIManager.put("Menu.font", MenuFont);
    UIManager.put("MenuBar.font", MenuFont);
    UIManager.put("MenuItem.font", MenuFont);
    UIManager.put("MenuItem.acceleratorFont", MenuFont);
    UIManager.put("RadioButton.font", ControlFont);
    UIManager.put("RadioButtonMenuItem.font", MenuFont);
    UIManager.put("OptionPane.font", MessageFont);
    UIManager.put("OptionPane.messageFont", MessageFont);
    UIManager.put("OptionPane.buttonFont", MessageFont);
    UIManager.put("Panel.font", ControlFont);
    UIManager.put("PasswordField.font", ControlFont);
    UIManager.put("ProgressBar.font", ControlFont);
    UIManager.put("ScrollPane.font", ControlFont);
    UIManager.put("Slider.font", ControlFont);
    UIManager.put("Spinner.font", ControlFont);
    UIManager.put("TabbedPane.font", ControlFont);
    UIManager.put("Table.font", ControlFont);
    UIManager.put("TableHeader.font", ControlFont);
    UIManager.put("TextArea.font", FixedControlFont);
    UIManager.put("TextField.font", ControlFont);
    UIManager.put("TextPane.font", ControlFont);
    UIManager.put("TitledBorder.font", ControlFont);
    UIManager.put("ToggleButton.font", ControlFont);
    UIManager.put("ToolBar.font", MenuFont);
    UIManager.put("ToolTip.font", ToolTipFont);
    UIManager.put("Tree.font", ControlFont);
    UIManager.put("Viewport.font", ControlFont);

    setTitle("Test");
    setIconImage(readImageIcon("icon-32.png").getImage());

    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

    JComponent jp = buildContent();
    String showScrollbars = System.getProperty("scrollbars", "").toLowerCase();

    /**
     * Handle scrollbars:
     *
     * 1) forced scrollbars (-Dscrollbars=true): always display them
     * 2) optional scrollbars (-Dscrollbars=optional): display them as needed
     * 3) otherwise (default): don't display them
     */
    switch (showScrollbars) {
    case "true":
        setContentPane(new JScrollPane(jp, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS));
        break;
    case "optional":
        setContentPane(new JScrollPane(jp, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED));
        break;
    default:
        setContentPane(jp);
        break;
    }

    String projectName = PropertiesUtil.getProjectProperties().get("project.name");
    String projectVersion = PropertiesUtil.getProjectProperties().get("project.version");
    String title = projectName + " " + projectVersion;

    // If the version contains a "-" (e.g. "1.50.1-SNAPSHOT" or "1.50.1-beta1"), add a warning message
    if (projectVersion.indexOf('-') > -1) {
        title = title + " - " + Messages.getString("LooksFrame.26");
    }

    if (PMS.getTraceMode() == 2) {
        // Forced trace mode
        title = title + "  [" + Messages.getString("TracesTab.10").toUpperCase() + "]";
    }

    setTitle(title);
    setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);

    // Display tooltips immediately and for a long time
    ToolTipManager.sharedInstance().setInitialDelay(400);
    ToolTipManager.sharedInstance().setDismissDelay(60000);
    ToolTipManager.sharedInstance().setReshowDelay(400);

    if (!configuration.isMinimized() && System.getProperty(START_SERVICE) == null) {
        setVisible(true);
    }
    BasicSystemUtils.INSTANCE.addSystemTray(this);
}

From source file:StoppUhr.java

private void plusButtonListener(ActionEvent evt) {
    uhrFontSize = uhrFontSize + 10;// w ww.j av  a2  s.c  om
    stoppuhrAusgabe.setFont(new Font(Font.DIALOG, Font.BOLD, uhrFontSize));
    uhrzeitAusgabe.setFont(new Font(Font.DIALOG, Font.BOLD, uhrFontSize));
    jTextFieldStNr.requestFocus();
}

From source file:StoppUhr.java

private void minusButtonListener(ActionEvent evt) {
    uhrFontSize = uhrFontSize - 10;//w ww .j av  a  2s  .  c o  m
    stoppuhrAusgabe.setFont(new Font(Font.DIALOG, Font.BOLD, uhrFontSize));
    uhrzeitAusgabe.setFont(new Font(Font.DIALOG, Font.BOLD, uhrFontSize));
    jTextFieldStNr.requestFocus();
}

From source file:org.obiba.onyx.jade.instrument.gehealthcare.CardiosoftInstrumentRunner.java

/**
 * Create an information dialog that tells the user to wait while the data is being processed.
 *///from  w w w.j  a  v a2s  . c om
private void showProcessingDialog() {

    JPanel messagePanel = new JPanel();
    messagePanel.setAlignmentX(Component.CENTER_ALIGNMENT);
    messagePanel.setLayout(new BoxLayout(messagePanel, BoxLayout.Y_AXIS));

    JLabel message = new JLabel(ecgResourceBundle.getString("Message.ProcessingEcgMeasurement"));
    message.setFont(new Font(Font.DIALOG, Font.PLAIN, 20));
    messagePanel.add(message);

    JLabel subMessage = new JLabel(ecgResourceBundle.getString("Message.ProcessingEcgMeasurementInstructions"));
    subMessage.setFont(new Font(Font.DIALOG, Font.PLAIN, 14));
    subMessage.setForeground(Color.RED);
    messagePanel.add(subMessage);

    JFrame window = new JFrame();
    window.add(messagePanel);
    window.pack();

    // Make sure dialog stays on top of all other application windows.
    window.setAlwaysOnTop(true);
    window.setLocationByPlatform(true);

    // Center dialog horizontally at the bottom of the screen.
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    window.setLocation((screenSize.width - window.getWidth()) / 2, screenSize.height - window.getHeight() - 70);

    window.setEnabled(false);
    window.setVisible(true);

}