use of javax.swing.JRadioButtonMenuItem in project jsql-injection by ron190.
the class ManagerDatabase method initErrorMethods.
public void initErrorMethods(Vendor vendor) {
this.itemRadioStrategyError[0].removeAll();
Integer[] i = { 0 };
if (vendor != Vendor.AUTO && vendor.instance().getXmlModel().getStrategy().getError() != null) {
for (Method methodError : vendor.instance().getXmlModel().getStrategy().getError().getMethod()) {
JMenuItem itemRadioVendor = new JRadioButtonMenuItem(methodError.getName());
itemRadioVendor.setEnabled(false);
this.itemRadioStrategyError[0].add(itemRadioVendor);
this.groupStrategy.add(itemRadioVendor);
final int indexError = i[0];
itemRadioVendor.addActionListener(actionEvent -> {
ManagerDatabase.this.menuStrategy.setText(methodError.getName());
MediatorModel.model().setStrategy(StrategyInjection.ERROR);
((StrategyInjectionError) StrategyInjection.ERROR.instance()).setIndexMethod(indexError);
});
i[0]++;
}
}
}
use of javax.swing.JRadioButtonMenuItem in project energy3d by concord-consortium.
the class MainFrame method createRoofTextureMenuItem.
JRadioButtonMenuItem createRoofTextureMenuItem(final int type, final String imageFile) {
final JRadioButtonMenuItem m = new JRadioButtonMenuItem(new ImageIcon(MainPanel.class.getResource(imageFile)));
m.setText("Texture #" + (type + 1));
m.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(final ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
final ChangeRoofTextureCommand c = new ChangeRoofTextureCommand();
Scene.getInstance().setTextureMode(TextureMode.Full);
Scene.getInstance().setRoofTextureType(type);
Scene.getInstance().setEdited(true);
if (MainPanel.getInstance().getEnergyButton().isSelected()) {
MainPanel.getInstance().getEnergyButton().setSelected(false);
}
SceneManager.getInstance().getUndoManager().addEdit(c);
}
}
});
return m;
}
use of javax.swing.JRadioButtonMenuItem in project energy3d by concord-consortium.
the class MainFrame method getForestMenuItem.
private JRadioButtonMenuItem getForestMenuItem() {
if (forestMenuItem == null) {
forestMenuItem = new JRadioButtonMenuItem("Forest");
forestMenuItem.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(final ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
final ChangeThemeCommand c = new ChangeThemeCommand();
Scene.getInstance().setTheme(Scene.FOREST_THEME);
Scene.getInstance().setEdited(true);
SceneManager.getInstance().getUndoManager().addEdit(c);
}
}
});
themeButtonGroup.add(forestMenuItem);
}
return forestMenuItem;
}
use of javax.swing.JRadioButtonMenuItem in project energy3d by concord-consortium.
the class MainFrame method getBlueSkyMenuItem.
private JRadioButtonMenuItem getBlueSkyMenuItem() {
if (blueSkyMenuItem == null) {
blueSkyMenuItem = new JRadioButtonMenuItem("Blue Sky");
blueSkyMenuItem.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(final ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
final ChangeThemeCommand c = new ChangeThemeCommand();
Scene.getInstance().setTheme(Scene.BLUE_SKY_THEME);
Scene.getInstance().setEdited(true);
SceneManager.getInstance().getUndoManager().addEdit(c);
}
}
});
themeButtonGroup.add(blueSkyMenuItem);
}
return blueSkyMenuItem;
}
use of javax.swing.JRadioButtonMenuItem in project energy3d by concord-consortium.
the class MainFrame method getExactSizeRadioButtonMenuItem.
private JRadioButtonMenuItem getExactSizeRadioButtonMenuItem() {
if (exactSizeRadioButtonMenuItem == null) {
exactSizeRadioButtonMenuItem = new JRadioButtonMenuItem("Exact Size On Paper");
exactSizeRadioButtonMenuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
PrintController.getInstance().setScaleToFit(false);
}
});
printSizeOptionBbuttonGroup.add(exactSizeRadioButtonMenuItem);
}
return exactSizeRadioButtonMenuItem;
}
Aggregations