@Override public void onClick() { JPanel p = new JPanel(new GridBagLayout()); GridBagHelper gbh = new GridBagHelper(p); RangeParam amount = new RangeParam("Amount (pixels)", 1, 10, 100); EnumParam<SelectionModifyType> type = new EnumParam<>("Type", SelectionModifyType.class); gbh.addLabelWithControl("Amount", amount.createGUI()); gbh.addLabelWithControl("Type", type.createGUI()); OKCancelDialog d = new OKCancelDialog( p, PixelitorWindow.getInstance(), "Modify Selection", "Change!", "Close") { @Override protected void dialogAccepted() { Selection selection = getActiveComp().get().getSelection().get(); SelectionModifyType selectionModifyType = (SelectionModifyType) type.getSelectedItem(); selection.modify(selectionModifyType, amount.getValue()); } }; d.setVisible(true); }
private static void addNewLayer(String name) { AddNewLayerAction.INSTANCE.actionPerformed( new ActionEvent(PixelitorWindow.getInstance(), 0, name)); ImageComponents.getActiveLayer().get().setName(name, AddToHistory.YES); }
public void execute(ChangeReason changeReason) { // only filters without a GUI call this Utils.executeFilterWithBusyCursor(this, changeReason, PixelitorWindow.getInstance()); }