ButtonGroup bg = new ButtonGroup();
bg.add(rbfull);
bg.add(rbpie);
bg.add(rbchord);
bg.add(rbopen);
GridBagPanel typePanel = new GridBagPanel();
typePanel.addOnCurrentRow(ltype);
typePanel.addOnCurrentRow(rbfull);
typePanel.addOnCurrentRow(rbpie);
typePanel.addOnCurrentRow(rbchord);
typePanel.addOnCurrentRow(rbopen);
typePanel.carriageReturn();
// start angle
GridBagPanel startAnglePanel = new GridBagPanel(resources.getString("StartAngle"));
lunitstart = new JLabel(resources.getString("Unit:"));
rbdegstart = new JRadioButton(resources.getString("Degree"), true);
rbradstart = new JRadioButton(resources.getString("Radian"), false);
bg = new ButtonGroup();
bg.add(rbdegstart);
bg.add(rbradstart);
rbfixedstart = new JRadioButton(resources.getString("FixedValue:"));
nfstart = new NumberField(0.0);
dstreestart = FilteredSourceTree.getFromPool("PropertiesPanel0");
dstreestart.getSourceTree().addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
updateWarnings();
}
});
rbsourcestart = new ActionRadioButton(resources.getString("UseDataSource")) {
public void stateChanged(ChangeEvent e) {
nfstart.setEnabled(!isSelected());
dstreestart.setEnabled(isSelected());
updateWarnings();
}
};
bg = new ButtonGroup();
bg.add(rbfixedstart);
bg.add(rbsourcestart);
// end angle
GridBagPanel endAnglePanel = new GridBagPanel(resources.getString("EndAngle"));
lunitend = new JLabel(resources.getString("Unit:"));
rbdegend = new JRadioButton(resources.getString("Degree"), true);
rbradend = new JRadioButton(resources.getString("Radian"), false);
bg = new ButtonGroup();
bg.add(rbdegend);
bg.add(rbradend);
rbfixedend = new JRadioButton(resources.getString("FixedValue:"));
nfend = new NumberField(0.0);
dstreeend = FilteredSourceTree.getFromPool("PropertiesPanel1");
dstreeend.getSourceTree().addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
updateWarnings();
}
});
rbsourceend = new ActionRadioButton(resources.getString("UseDataSource")) {
public void stateChanged(ChangeEvent e) {
nfend.setEnabled(!isSelected());
dstreeend.setEnabled(isSelected());
updateWarnings();
}
};
bg = new ButtonGroup();
bg.add(rbfixedend);
bg.add(rbsourceend);
rbsourcestart.apply();
rbsourceend.apply();
rbfull.apply();
// Create panel
GridBagPanel unitPanel = new GridBagPanel();
unitPanel.addOnCurrentRow(lunitstart);
unitPanel.addOnCurrentRow(rbdegstart);
unitPanel.addOnCurrentRow(rbradstart);
unitPanel.carriageReturn();
startAnglePanel.addOnCurrentRow(unitPanel, 1, false, false, true);
startAnglePanel.addOnCurrentRow(rbfixedstart);
startAnglePanel.addOnCurrentRow(nfstart, 2, true, false, true);
startAnglePanel.addOnCurrentRow(rbsourcestart, 3);
startAnglePanel.carriageReturn();
startAnglePanel.addOnCurrentRow(dstreestart, 3, true, true, true);
GridBagPanel eunitPanel = new GridBagPanel();
eunitPanel.addOnCurrentRow(lunitend);
eunitPanel.addOnCurrentRow(rbdegend);
eunitPanel.addOnCurrentRow(rbradend);
eunitPanel.carriageReturn();
endAnglePanel.addOnCurrentRow(eunitPanel, 1, false, false, true);
endAnglePanel.addOnCurrentRow(rbfixedend);
endAnglePanel.addOnCurrentRow(nfend, 2, true, false, true);
endAnglePanel.addOnCurrentRow(rbsourceend, 3);
endAnglePanel.carriageReturn();
endAnglePanel.addOnCurrentRow(dstreeend, 3, true, true, true);
GridBagPanel ellipsePanel = new GridBagPanel(resources.getString("Ellipse"));
ellipsePanel.addOnCurrentRow(typePanel, 1, false, false, true);
ellipsePanel.addOnCurrentRow(startAnglePanel, 4, true, true, false);
ellipsePanel.addOnCurrentRow(endAnglePanel, 4, true, true, true);
return ellipsePanel;
}