use of java.awt.FlowLayout in project voltdb by VoltDB.
the class FontDialogSwing method creatFontDialog.
/**
* Create and display FontDialogSwing Dialog.
*
*/
public static void creatFontDialog(DatabaseManagerSwing owner) {
if (isRunning) {
frame.setVisible(true);
} else {
CommonSwing.setSwingLAF(frame, CommonSwing.Native);
fOwner = owner;
frame.setIconImage(CommonSwing.getIcon("Frame"));
isRunning = true;
frame.setSize(600, 100);
CommonSwing.setFramePositon(frame);
ckbitalic = new JCheckBox(new ImageIcon(CommonSwing.getIcon("ItalicFont")));
ckbitalic.putClientProperty("is3DEnabled", Boolean.TRUE);
ckbitalic.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setStyle();
}
});
ckbbold = new JCheckBox(new ImageIcon(CommonSwing.getIcon("BoldFont")));
ckbbold.putClientProperty("is3DEnabled", Boolean.TRUE);
ckbbold.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setStyle();
}
});
fgColorButton = new JButton("Foreground", new ImageIcon(CommonSwing.getIcon("ColorSelection")));
fgColorButton.putClientProperty("is3DEnabled", Boolean.TRUE);
fgColorButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setColor(FOREGROUND);
}
});
bgColorButton = new JButton("Background", new ImageIcon(CommonSwing.getIcon("ColorSelection")));
bgColorButton.putClientProperty("is3DEnabled", Boolean.TRUE);
bgColorButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setColor(BACKGROUND);
}
});
closeButton = new JButton("Close", new ImageIcon(CommonSwing.getIcon("Close")));
closeButton.putClientProperty("is3DEnabled", Boolean.TRUE);
closeButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
frame.setVisible(false);
}
});
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
String[] fontNames = ge.getAvailableFontFamilyNames();
Dimension fontsComboBoxDimension = new Dimension(160, 25);
fontsComboBox = new JComboBox(fontNames);
fontsComboBox.putClientProperty("is3DEnabled", Boolean.TRUE);
fontsComboBox.setMaximumSize(fontsComboBoxDimension);
fontsComboBox.setPreferredSize(fontsComboBoxDimension);
fontsComboBox.setMaximumSize(fontsComboBoxDimension);
fontsComboBox.setEditable(false);
fontsComboBox.setSelectedItem(defaultFont);
fontsComboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setFont();
}
});
// weconsultants@users 20050215 - Added for Compatbilty fix for JDK 1.3
fontSizesComboBox = new JComboBox(fontSizes);
Dimension spinnerDimension = new Dimension(45, 25);
fontSizesComboBox.putClientProperty("is3DEnabled", Boolean.TRUE);
fontSizesComboBox.setMinimumSize(spinnerDimension);
fontSizesComboBox.setPreferredSize(spinnerDimension);
fontSizesComboBox.setMaximumSize(spinnerDimension);
fontSizesComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent evt) {
if (evt.getStateChange() == ItemEvent.SELECTED) {
setFontSize((String) evt.getItem());
}
}
});
// weconsultants@users 20050215 - Commented out for Compatbilty fix for JDK 1.3
// Dimension spinnerDimension = new Dimension(50, 25);
// spinnerFontSizes = new JSpinner();
// spinnerFontSizes.putClientProperty("is3DEnabled", Boolean.TRUE);
// spinnerFontSizes.setMinimumSize(spinnerDimension);
// spinnerFontSizes.setPreferredSize(spinnerDimension);
// spinnerFontSizes.setMaximumSize(spinnerDimension);
// spinnerModelSizes = new SpinnerNumberModel(12, 8, 72, 1);
// spinnerFontSizes.setModel(spinnerModelSizes);
// spinnerFontSizes.addChangeListener(new ChangeListener() {
// public void stateChanged(ChangeEvent e) {
// setFontSize();
// }
// });
Container contentPane = frame.getContentPane();
contentPane.setLayout(new FlowLayout());
contentPane.add(fontsComboBox);
// weconsultants@users 20050215 - Commented out for Compatbilty fix for 1.3
// contentPane.add(spinnerFontSizes);
// weconsultants@users 20050215 - Added for Compatbilty fix for 1.3
contentPane.add(fontSizesComboBox);
contentPane.add(ckbbold);
contentPane.add(ckbitalic);
contentPane.add(fgColorButton);
contentPane.add(bgColorButton);
contentPane.add(closeButton);
frame.pack();
frame.setVisible(false);
}
}
use of java.awt.FlowLayout in project ACS by ACS-Community.
the class ManagerBusyDlg method initialize.
private void initialize(String msg) {
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
msgLbl.setText(msg);
JPanel msgPnl = new JPanel(new FlowLayout(FlowLayout.CENTER));
msgPnl.add(msgLbl);
add(msgPnl, BorderLayout.NORTH);
JProgressBar bar = new JProgressBar();
bar.setPreferredSize(new Dimension(150, 25));
add(bar, BorderLayout.CENTER);
JPanel btnPnl = new JPanel(new FlowLayout(FlowLayout.CENTER));
btnPnl.add(stopBtn);
stopBtn.addActionListener(this);
add(btnPnl, BorderLayout.SOUTH);
setLocation(50, 50);
pack();
setVisible(true);
bar.setIndeterminate(true);
}
use of java.awt.FlowLayout in project ACS by ACS-Community.
the class JDynAct method buildWindow.
/** Build the GUI
*
*/
private void buildWindow() {
Container rootCnt = getContentPane();
rootCnt.setLayout(new BorderLayout());
// The container with labels and combo boxes
Container firstCnt = new Container();
firstCnt.setLayout(new GridLayout(4, 2));
firstCnt.add(new JLabel("Name"));
nameCB = new JComboBox();
nameCB.setEditable(true);
nameCB.addItem("*");
nameCB.addItem("PIPPO");
nameCB.addItem("PLUTO");
firstCnt.add(nameCB);
firstCnt.add(new JLabel("IDL interface"));
idlCB = new JComboBox();
idlCB.addItem("*");
idlCB.addItem("IDL:alma/acsexmplLamp/Lamp:1.0");
idlCB.addItem("IDL:alma/MOUNT_ACS/Mount:1.0");
idlCB.addItem("IDL:alma/demo/HelloDemo:1.0");
idlCB.setEditable(true);
firstCnt.add(idlCB);
firstCnt.add(new JLabel("Implementation"));
implCB = new JComboBox();
implCB.addItem("*");
implCB.addItem("acsexmplLampImpl");
implCB.addItem("acsexmplMountImpl");
implCB.addItem("alma.demo.HelloDemoImpl.HelloDemoHelper");
implCB.addItem("demoImpl.HelloDemo");
implCB.addItem("acsexmplHelloWorldClient");
implCB.setEditable(true);
firstCnt.add(implCB);
firstCnt.add(new JLabel("Container"));
containerCB = new JComboBox();
containerCB.addItem("*");
containerCB.addItem("bilboContainer");
containerCB.addItem("frodoContainer");
containerCB.addItem("aragornContainer");
containerCB.setEditable(true);
firstCnt.add(containerCB);
// The container with the activate button
Container secondCnt = new Container();
secondCnt.setLayout(new FlowLayout());
JButton activateB = new JButton("Activate");
activateB.addActionListener(this);
secondCnt.add(activateB, "Center");
// The container with activated container
MyTableModel tableModel = new MyTableModel();
activatedT = new JTable(tableModel);
activatedT.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
ListSelectionModel rowSM = activatedT.getSelectionModel();
JScrollPane scrollP = new JScrollPane(activatedT);
activatedT.setPreferredScrollableViewportSize(new Dimension(400, 90));
MyCellRendererr cellR = new MyCellRendererr();
TableColumnModel tcm = activatedT.getColumnModel();
TableColumn tc = tcm.getColumn(2);
tc.setCellRenderer(cellR);
MyCellEditor cellE = new MyCellEditor(this);
tc.setCellEditor(cellE);
Container thirdCnt = new Container();
thirdCnt.setLayout(new FlowLayout());
thirdCnt.add(scrollP, "North");
// Add the container to the main container
rootCnt.add(firstCnt, "North");
rootCnt.add(secondCnt, "Center");
rootCnt.add(thirdCnt, "South");
}
use of java.awt.FlowLayout in project ACS by ACS-Community.
the class DateTimeSelector method initGUI.
/**
* Init the GUI
*/
private void initGUI() {
// YearCB is initialized from 2000 to the year next to this on
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
for (int t = 2000; t <= cal.get(Calendar.YEAR) + 1; t++) {
yearCB.addItem(Integer.valueOf(t));
}
// Month
for (int t = 1; t <= 12; t++) {
monthCB.addItem(Integer.valueOf(t));
}
//dayCB.setModel(new DayComboBoxModel());
for (int t = 1; t <= 31; t++) {
dayCB.addItem(Integer.valueOf(t));
}
// hour
for (int t = 0; t < 24; t++) {
hoursCB.addItem(Integer.valueOf(t));
}
// Minutes and seconds
for (int t = 0; t < 60; t++) {
secsCB.addItem(Integer.valueOf(t));
minsCB.addItem(Integer.valueOf(t));
}
// Add the date panel
JPanel datePnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
datePnl.setBorder(BorderFactory.createTitledBorder("Date"));
datePnl.add(new JLabel("Day: "));
datePnl.add(dayCB);
datePnl.add(new JLabel("Month: "));
datePnl.add(monthCB);
datePnl.add(new JLabel("Year: "));
datePnl.add(yearCB);
// Add the time panel
JPanel timePnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
timePnl.setBorder(BorderFactory.createTitledBorder("Time"));
timePnl.add(new JLabel("Hour: "));
timePnl.add(hoursCB);
timePnl.add(new JLabel("Minute: "));
timePnl.add(minsCB);
timePnl.add(new JLabel("Second: "));
timePnl.add(secsCB);
// Add the widgets to the component
setLayout(new BorderLayout());
add(datePnl, BorderLayout.NORTH);
add(timePnl, BorderLayout.SOUTH);
for (JComboBox box : comboBoxes) {
box.setEditable(false);
// Initial selection that will be updated by the next setDate
//
// Do not add the action listener before selecting a item because actionPerformed calls #ratioDayCB
// that needs to get a selected item.
box.setSelectedIndex(0);
box.addActionListener(this);
}
setDate(cal);
}
use of java.awt.FlowLayout in project ACS by ACS-Community.
the class StatsDlg method initialize.
/**
* Setup the GUI
*/
private void initialize() {
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Statistics");
this.setBounds(50, 35, 100, 100);
JPanel mainPnl = new JPanel(new BorderLayout());
JPanel valuesPnl = new JPanel(new GridLayout(10, 1));
// Add the num of logs
JPanel numOfLogsPnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
numOfLogsPnl.add(new JLabel("Total logs: "));
numOfLogsPnl.add(totNumOfLogsLbl);
valuesPnl.add(numOfLogsPnl);
// Visible logs
JPanel visibleLogsPnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
visibleLogsPnl.add(new JLabel("Visible logs: "));
visibleLogsPnl.add(visibleLogsLbl);
valuesPnl.add(visibleLogsPnl);
// Hidden logs
JPanel hiddenLogsPnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
hiddenLogsPnl.add(new JLabel("Hidden logs: "));
hiddenLogsPnl.add(hiddenLogsLbl);
valuesPnl.add(hiddenLogsPnl);
// Add the available memory
JPanel availMemPnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
availMemPnl.add(new JLabel("Memory available: "));
availMemPnl.add(availMemLbl);
valuesPnl.add(availMemPnl);
// Add the used memory
JPanel usedMemPnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
usedMemPnl.add(new JLabel("Used memory: "));
usedMemPnl.add(usedMemLbl);
valuesPnl.add(usedMemPnl);
// Add the number of the files of cache
JPanel usedCacheFiles = new JPanel(new FlowLayout(FlowLayout.LEFT));
usedCacheFiles.add(new JLabel("Number of files of cache: "));
usedCacheFiles.add(numOfCacheFiles);
valuesPnl.add(usedCacheFiles);
// Add the disk space used by the files of the cache
JPanel usedDiskSpace = new JPanel(new FlowLayout(FlowLayout.LEFT));
usedDiskSpace.add(new JLabel("Disk space used by the cache: "));
usedDiskSpace.add(diskSpace);
valuesPnl.add(usedDiskSpace);
// Add the time frame
JPanel timeFramePnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
timeFramePnl.add(new JLabel("Time frame: "));
timeFramePnl.add(timeFrameLbl);
valuesPnl.add(timeFramePnl);
// Add the rate from the NC
JPanel inRatePnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
inRatePnl.add(new JLabel("Rate of logs from NC: "));
inRatePnl.add(inRateLbl);
valuesPnl.add(inRatePnl);
// Add the rate to the listeners
JPanel outRatePnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
outRatePnl.add(new JLabel("Rate of logs sent to table: "));
outRatePnl.add(outRateLbl);
valuesPnl.add(outRatePnl);
mainPnl.add(valuesPnl, BorderLayout.CENTER);
// Add the refresh and the close buttons
JPanel buttonPanel = new JPanel(new FlowLayout());
monitorBtn.addActionListener(this);
buttonPanel.add(monitorBtn);
refreshBtn.addActionListener(this);
buttonPanel.add(refreshBtn);
closeBtn.addActionListener(this);
buttonPanel.add(closeBtn);
mainPnl.add(buttonPanel, BorderLayout.SOUTH);
setContentPane(mainPnl);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
enableMonitoring(false);
}
});
}
Aggregations