Search in sources :

Example 36 with GridBagConstraints

use of java.awt.GridBagConstraints in project ACS by ACS-Community.

the class BeanGrouper method addSamp.

/**
	 * This method adds a new sample (represented as a {@link DataPrinter}) into this class.<br>
	 * This class should be able to hold N samples inside itself. <br>
	 * - First, the {@link BeanLister} widget contained by the {@link DataPrinter} is added to the jPanel<br>
	 * - Second, the {@link DataPrinter} is added to the list of samplers.
	 * @param w The Printer Object that is used to represent a sampling by its own.
	 */
private void addSamp(DataPrinter w) {
    /* There is only one plot per window. The other
		 * sampled properties are shown in the same plot */
    if (samplers.size() == 0) {
        GridBagConstraints c = new GridBagConstraints();
        c.insets = new Insets(5, 5, 5, 5);
        // First row only has the Plot
        c.anchor = GridBagConstraints.CENTER;
        c.gridx = 0;
        c.gridy = 0;
        c.fill = GridBagConstraints.BOTH;
        c.weighty = 1;
        c.weightx = 1;
        c.gridwidth = 12;
        this.add((JPanel) w.getWidget(), c);
    }
    updateLabel();
    //w.getSamplingWidget().repaint();
    samplers.add(w);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets)

Example 37 with GridBagConstraints

use of java.awt.GridBagConstraints in project ACS by ACS-Community.

the class PlotWidget method initialize.

/**
	 * This method initializes this
	 * 
	 */
private void initialize() {
    if (position == 0) {
        LayoutFactory lfct = LayoutFactory.getInstance();
        lfct.setShowTraceNameMenu(false);
        lfct.setShowPhysicalUnitsMenu(false);
        chart = new ZoomableChart();
        // Changing X Axis for time presentation
        IAxis xAxis = new AxisLinear();
        IAxis yAxis = new AxisLinear();
        chart.setAxisXBottom((AAxis) xAxis, 0);
        chart.setAxisYLeft((AAxis) yAxis, 0);
        chart.setGridColor(Color.BLACK);
        xAxis.setFormatter((IAxisLabelFormatter) new LabelFormatterDate(new SimpleDateFormat("H:mm:ss")));
        xAxis.getAxisTitle().setTitle("Time [seconds]");
        yAxis.getAxisTitle().setTitle("Property Value");
        traces = new ArrayList<Trace2DLtd>();
        chart.setSize(800, 600);
        // add the chart to the panel
        this.setLayout(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.anchor = GridBagConstraints.CENTER;
        gbc.ipadx = 10;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.weightx = 1;
        gbc.weighty = 1;
        ChartPanel cp = new ChartPanel(chart);
        this.add(cp, gbc);
        // create new trace for the data.
        //now are seconds no minutes
        Trace2DLtd tempTrace = new Trace2DLtd(timewindow * (int) frequency);
        tempTrace.setColor(colors[currentColor]);
        currentColor++;
        if (currentColor >= colors.length) {
            currentColor = 0;
        }
        //trace.setPhysicalUnits("Ticks", "Voltage");
        chart.addTrace(tempTrace);
        traces.add(tempTrace);
    }
}
Also used : LabelFormatterDate(info.monitorenter.gui.chart.labelformatters.LabelFormatterDate) Trace2DLtd(info.monitorenter.gui.chart.traces.Trace2DLtd) GridBagConstraints(java.awt.GridBagConstraints) ZoomableChart(info.monitorenter.gui.chart.ZoomableChart) ChartPanel(info.monitorenter.gui.chart.views.ChartPanel) GridBagLayout(java.awt.GridBagLayout) LayoutFactory(info.monitorenter.gui.chart.controls.LayoutFactory) AxisLinear(info.monitorenter.gui.chart.axis.AxisLinear) SimpleDateFormat(java.text.SimpleDateFormat) IAxis(info.monitorenter.gui.chart.IAxis)

Example 38 with GridBagConstraints

use of java.awt.GridBagConstraints in project ACS by ACS-Community.

the class FilterParameterPanel method newConstraints.

/**
	 * Insert the method's description here. Creation date: (2/7/02 10:45:18 AM)
	 * 
	 * @param y
	 *            int
	 * @param insetsTop
	 *            int
	 * @param insetsBottom
	 *            int
	 */
protected GridBagConstraints newConstraints(int y, int insetsTop, int insetsLeft, int insetsBottom, int insetsRight) {
    GridBagConstraints g = new GridBagConstraints();
    g.gridx = 0;
    g.gridy = y;
    g.insets = new Insets(insetsTop, insetsLeft, insetsBottom, insetsRight);
    g.fill = GridBagConstraints.HORIZONTAL;
    g.weightx = 1.0;
    g.weighty = 0.0;
    return g;
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets)

Example 39 with GridBagConstraints

use of java.awt.GridBagConstraints in project ACS by ACS-Community.

the class StatusLine method initialize.

/**
	 * Init the status line
	 */
private void initialize() {
    BoxLayout layout = new BoxLayout(this, BoxLayout.LINE_AXIS);
    setLayout(layout);
    // Add the panel with the widgets at the left side
    JPanel widgetsPnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
    widgetsPnl.setBorder(BorderFactory.createLoweredBevelBorder());
    // Build the text fields	
    for (int t = 0; t < counters.length; t++) {
        counters[t] = new CounterWidget(AlarmGUIType.values()[t], tableModel.getAlarmCounter(AlarmGUIType.values()[t]), tableModel);
        // Add the widget
        widgetsPnl.add(counters[t].getComponent());
    }
    add(widgetsPnl);
    JPanel statusMsgPnl = new JPanel();
    statusMsgPnl.setBorder(BorderFactory.createLoweredBevelBorder());
    statusMsgPnl.add(statusMessageLbl);
    add(statusMsgPnl);
    // filtered status display (copied from jlog :: LoggingClient#getStatusLinePnl())
    GridBagConstraints constraintsTableFlt = new GridBagConstraints();
    constraintsTableFlt.gridx = 3;
    constraintsTableFlt.gridy = 0;
    constraintsTableFlt.insets = new Insets(1, 1, 1, 1);
    tableFiltersLbl = new JLabel();
    tableFiltersLbl.setVisible(true);
    tableFiltersLbl.setBorder(BorderFactory.createLoweredBevelBorder());
    Font fntTableFlt = tableFiltersLbl.getFont();
    Font newFontTableFlt = fntTableFlt.deriveFont(fntTableFlt.getSize() - 2);
    tableFiltersLbl.setFont(newFontTableFlt);
    add(tableFiltersLbl, constraintsTableFlt);
    // set initial text
    setTableFilterLbl(null);
    // Add the label with the connection status to the right
    JPanel connectionPnl = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    connectionPnl.setBorder(BorderFactory.createLoweredBevelBorder());
    connectionWidget = new ConnectionWidget(alarmPanel);
    connectionPnl.add(connectionWidget);
    add(connectionPnl);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) FlowLayout(java.awt.FlowLayout) Insets(java.awt.Insets) BoxLayout(javax.swing.BoxLayout) JLabel(javax.swing.JLabel) Font(java.awt.Font)

Example 40 with GridBagConstraints

use of java.awt.GridBagConstraints in project ACS by ACS-Community.

the class ErrorTreeCellRenderer method getMembersEditPanel.

/**
	 * This method initializes jPanel5	
	 * 	
	 * @return javax.swing.JPanel	
	 */
private JPanel getMembersEditPanel() {
    if (membersEditPanel == null) {
        GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
        gridBagConstraints3.insets = new java.awt.Insets(0, 4, 0, 3);
        gridBagConstraints3.gridy = 1;
        gridBagConstraints3.gridx = 0;
        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
        gridBagConstraints2.insets = new java.awt.Insets(0, 4, 0, 3);
        gridBagConstraints2.gridy = 0;
        gridBagConstraints2.gridx = 0;
        membersEditPanel = new JPanel();
        membersEditPanel.setLayout(new GridBagLayout());
        membersEditPanel.setVisible(false);
        membersEditPanel.add(getAddMemmberButton(), gridBagConstraints2);
        membersEditPanel.add(getRemoveMemberButton(), gridBagConstraints3);
    }
    return membersEditPanel;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout)

Aggregations

GridBagConstraints (java.awt.GridBagConstraints)1628 GridBagLayout (java.awt.GridBagLayout)1200 Insets (java.awt.Insets)1044 JPanel (javax.swing.JPanel)960 JLabel (javax.swing.JLabel)833 JButton (javax.swing.JButton)350 ActionEvent (java.awt.event.ActionEvent)303 ActionListener (java.awt.event.ActionListener)284 Dimension (java.awt.Dimension)266 JScrollPane (javax.swing.JScrollPane)252 JTextField (javax.swing.JTextField)250 BorderLayout (java.awt.BorderLayout)214 JCheckBox (javax.swing.JCheckBox)200 JComboBox (javax.swing.JComboBox)101 Color (java.awt.Color)98 FlowLayout (java.awt.FlowLayout)93 TitledBorder (javax.swing.border.TitledBorder)91 Font (java.awt.Font)85 BoxLayout (javax.swing.BoxLayout)82 EmptyBorder (javax.swing.border.EmptyBorder)72