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);
}
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);
}
}
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;
}
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);
}
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;
}
Aggregations