	public MagicCardDetailPanel() {

		obs = new Observable();
		gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[] { 52, 382, 76, 0, 57, 32, 51, 0, 77, 0 };
		gridBagLayout.rowHeights = new int[] { 0, 0, 0, 44, 0, 65, 25, 21, 0, 0, 0, 0 };
		gridBagLayout.columnWeights = new double[] { 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4 };
		gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0E-4 };
		setLayout(gridBagLayout);

		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("NAME") + " :"), UITools.createGridBagConstraints(null, null, 0, 0));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_COST") + " :"), UITools.createGridBagConstraints(null, null, 2, 0));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_TYPES")+ " :"), UITools.createGridBagConstraints(null, null, 0, 1));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_MANA") + " :"),  UITools.createGridBagConstraints(null, null, 2, 1));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_LOYALTY")+ " :"), UITools.createGridBagConstraints(null, null, 0, 2));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_LAYOUT") + " :"), UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 0, 3));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_TEXT") + " :"),UITools.createGridBagConstraints(null, null, 0, 4,null,2));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_FLAVOR") + " :"), UITools.createGridBagConstraints(null, null, 0, 6));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_ARTIST") + " :"), UITools.createGridBagConstraints(null, null, 0, 7));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_LEGALITIES") + " :"), UITools.createGridBagConstraints(null, null, 0, 8));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_WATERMARK") + " :"), UITools.createGridBagConstraints(null, null, 2, 7));

		nameJTextField = new JTextField();
		add(nameJTextField, UITools.createGridBagConstraints(null,GridBagConstraints.HORIZONTAL,1,0));

		cmcJTextField = new JTextField();
		add(cmcJTextField, UITools.createGridBagConstraints(null,GridBagConstraints.HORIZONTAL,4,0));

		lblLogoSet = new JLabel("");
		add(lblLogoSet, UITools.createGridBagConstraints(null, null, 5, 0,2,2));

		lblThumbnail = new JLabel("");
		add(lblThumbnail, UITools.createGridBagConstraints(null, GridBagConstraints.HORIZONTAL, 7, 1,2,9));

		fullTypeJTextField = new JTextField();
		add(fullTypeJTextField, UITools.createGridBagConstraints(null, GridBagConstraints.HORIZONTAL, 1, 1));

		manaPanel = new ManaPanel();
		add(manaPanel, UITools.createGridBagConstraints(null, GridBagConstraints.HORIZONTAL, 4, 1));

		lblnumberInSet = new JLabel("/");
		add(lblnumberInSet, UITools.createGridBagConstraints(null, null, 5, 2,2,null));

		txtLayoutField = new JTextField(10);
		add(txtLayoutField, UITools.createGridBagConstraints(null, GridBagConstraints.HORIZONTAL, 1, 3));

		chckbxReserved = new JCheckBox("(R)");
		add(chckbxReserved, UITools.createGridBagConstraints(null, null, 2, 3));

		rarityJTextField = new JTextField(10);
		add(rarityJTextField, UITools.createGridBagConstraints(null, GridBagConstraints.HORIZONTAL, 3, 3,3,null));

		txtArtist = new JTextField(10);
		add(txtArtist, UITools.createGridBagConstraints(null, GridBagConstraints.HORIZONTAL, 1, 7));

		txtWatermark = new JTextField(10);
		add(txtWatermark, UITools.createGridBagConstraints(null, GridBagConstraints.HORIZONTAL, 4, 7,3,null));

		btnAlert = new JButton(MTGConstants.ICON_ALERT);
		btnAlert.setEnabled(false);
		btnAlert.addActionListener(ae -> {
			MagicCardAlert alert = new MagicCardAlert();
			alert.setCard(magicCard);
			String price = JOptionPane.showInputDialog(null,
					MTGControler.getInstance().getLangService().getCapitalize("SELECT_MAXIMUM_PRICE"),
					MTGControler.getInstance().getLangService().getCapitalize("ADD_ALERT_FOR", magicCard),
					JOptionPane.QUESTION_MESSAGE);
			alert.setPrice(Double.parseDouble(price));

			try {
				MTGControler.getInstance().getEnabled(MTGDao.class).saveAlert(alert);
			} catch (Exception e) {
				logger.error(e);
				MTGControler.getInstance().notify(e);
			}
		});
		add(btnAlert, UITools.createGridBagConstraints(null, null, 8, 0));

		panelDetailCreature = new JPanel();
		loyaltyJTextField = new JTextField(5);

		powerJTextField = new JTextField(2);
		toughnessJTextField = new JTextField(2);
		FlowLayout flowLayout = (FlowLayout) panelDetailCreature.getLayout();
		flowLayout.setAlignment(FlowLayout.LEFT);
		panelDetailCreature.add(loyaltyJTextField);
		panelDetailCreature.add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_POWER") + " :"));
		panelDetailCreature.add(powerJTextField);
		panelDetailCreature.add(new JLabel("/"));
		panelDetailCreature.add(toughnessJTextField);
		add(panelDetailCreature,UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 1, 2,3,null));

		lstFormats = new JList<>(new DefaultListModel<>());
		lstFormats.setCellRenderer((JList<? extends MagicFormat> list, MagicFormat obj, int arg2,boolean arg3, boolean arg4)->{
					JLabel l = new JLabel(obj.getFormat());

					if(obj.getFormatLegality()!=null)
					{

						switch (obj.getFormatLegality()) {
							case BANNED: l.setIcon(MTGConstants.ICON_SMALL_DELETE);break;
							case LEGAL:l.setIcon(MTGConstants.ICON_SMALL_CHECK);break;
							case NOT_LEGAL:l.setIcon(MTGConstants.ICON_SMALL_DELETE);break;
							case RESTRICTED:l.setIcon(MTGConstants.ICON_SMALL_EQUALS);break;
							default: break;
						}

						l.setToolTipText(obj.getFormat() + ":" + obj.getFormatLegality().name());
					}
					else //TODO remove when Islegal will be removed
					{

						if(obj.isLegal())
							l.setIcon(MTGConstants.ICON_SMALL_CHECK);
						else
							l.setIcon(MTGConstants.ICON_SMALL_DELETE);
					}

				return l;
		});
		add(new JScrollPane(lstFormats), UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 1, 8,2,2));

		txtTextPane = new MagicTextPane();
		txtTextPane.setBorder(new LineBorder(Color.GRAY));
		txtTextPane.setBackground(Color.WHITE);
		add(txtTextPane, UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 1, 4,6,2));

		txtFlavorArea = new JTextPane();
		txtFlavorArea.setFont(txtFlavorArea.getFont().deriveFont(Font.ITALIC));
		add(txtFlavorArea, UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 1, 6,6,null));

		listModelCollection = new DefaultListModel<>();
		listCollection = new JList<>(listModelCollection);
		listCollection.setCellRenderer((JList<? extends MagicCollection> list, MagicCollection obj, int arg2,boolean arg3, boolean arg4)->new JLabel(obj.getName(),MTGConstants.ICON_COLLECTION,SwingConstants.LEFT));

		add(new JScrollPane(listCollection), UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 4, 8,3,2));

		panelSwitchLangage = new JPanel();
		FlowLayout flowLayout1 = (FlowLayout) panelSwitchLangage.getLayout();
		flowLayout1.setAlignment(FlowLayout.LEFT);

		add(panelSwitchLangage, UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 0, 10,9,null));

		if (magicCard != null) {
			mBindingGroup = initDataBindings();
		}

		setEditable(false);

	}

	public MagicCardDetailPanel() {

		obs = new Observable();
		gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[] { 52, 382, 76, 0, 57, 32, 51, 0, 77, 0 };
		gridBagLayout.rowHeights = new int[] { 0, 0, 0, 44, 0, 65, 25, 21, 0, 0, 0, 0 };
		gridBagLayout.columnWeights = new double[] { 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4 };
		gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0E-4 };
		setLayout(gridBagLayout);

		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("NAME") + " :"), UITools.createGridBagConstraints(null, null, 0, 0));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_COST") + " :"), UITools.createGridBagConstraints(null, null, 2, 0));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_TYPES")+ " :"), UITools.createGridBagConstraints(null, null, 0, 1));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_MANA") + " :"),  UITools.createGridBagConstraints(null, null, 2, 1));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_LOYALTY")+ " :"), UITools.createGridBagConstraints(null, null, 0, 2));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_LAYOUT") + " :"), UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 0, 3));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_TEXT") + " :"),UITools.createGridBagConstraints(null, null, 0, 4,null,2));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_FLAVOR") + " :"), UITools.createGridBagConstraints(null, null, 0, 6));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_ARTIST") + " :"), UITools.createGridBagConstraints(null, null, 0, 7));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_LEGALITIES") + " :"), UITools.createGridBagConstraints(null, null, 0, 8));
		add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_WATERMARK") + " :"), UITools.createGridBagConstraints(null, null, 2, 7));

		nameJTextField = new JTextField();
		add(nameJTextField, UITools.createGridBagConstraints(null,GridBagConstraints.HORIZONTAL,1,0));

		cmcJTextField = new JTextField();
		add(cmcJTextField, UITools.createGridBagConstraints(null,GridBagConstraints.HORIZONTAL,4,0));

		lblLogoSet = new JLabel("");
		add(lblLogoSet, UITools.createGridBagConstraints(null, null, 5, 0,2,2));

		lblThumbnail = new JLabel("");
		add(lblThumbnail, UITools.createGridBagConstraints(null, GridBagConstraints.HORIZONTAL, 7, 1,2,9));

		fullTypeJTextField = new JTextField();
		add(fullTypeJTextField, UITools.createGridBagConstraints(null, GridBagConstraints.HORIZONTAL, 1, 1));

		manaPanel = new ManaPanel();
		add(manaPanel, UITools.createGridBagConstraints(null, GridBagConstraints.HORIZONTAL, 4, 1));

		lblnumberInSet = new JLabel("/");
		add(lblnumberInSet, UITools.createGridBagConstraints(null, null, 5, 2,2,null));

		txtLayoutField = new JTextField(10);
		add(txtLayoutField, UITools.createGridBagConstraints(null, GridBagConstraints.HORIZONTAL, 1, 3));

		chckbxReserved = new JCheckBox("(R)");
		add(chckbxReserved, UITools.createGridBagConstraints(null, null, 2, 3));

		rarityJTextField = new JTextField(10);
		add(rarityJTextField, UITools.createGridBagConstraints(null, GridBagConstraints.HORIZONTAL, 3, 3,3,null));

		txtArtist = new JTextField(10);
		add(txtArtist, UITools.createGridBagConstraints(null, GridBagConstraints.HORIZONTAL, 1, 7));

		txtWatermark = new JTextField(10);
		add(txtWatermark, UITools.createGridBagConstraints(null, GridBagConstraints.HORIZONTAL, 4, 7,3,null));

		btnAlert = new JButton(MTGConstants.ICON_ALERT);
		btnAlert.setEnabled(false);
		btnAlert.addActionListener(ae -> {
			MagicCardAlert alert = new MagicCardAlert();
			alert.setCard(magicCard);
			String price = JOptionPane.showInputDialog(null,
					MTGControler.getInstance().getLangService().getCapitalize("SELECT_MAXIMUM_PRICE"),
					MTGControler.getInstance().getLangService().getCapitalize("ADD_ALERT_FOR", magicCard),
					JOptionPane.QUESTION_MESSAGE);
			alert.setPrice(Double.parseDouble(price));

			try {
				MTGControler.getInstance().getEnabled(MTGDao.class).saveAlert(alert);
			} catch (Exception e) {
				logger.error(e);
				MTGControler.getInstance().notify(e);
			}
		});
		add(btnAlert, UITools.createGridBagConstraints(null, null, 8, 0));

		panelDetailCreature = new JPanel();
		loyaltyJTextField = new JTextField(5);

		powerJTextField = new JTextField(2);
		toughnessJTextField = new JTextField(2);
		FlowLayout flowLayout = (FlowLayout) panelDetailCreature.getLayout();
		flowLayout.setAlignment(FlowLayout.LEFT);
		panelDetailCreature.add(loyaltyJTextField);
		panelDetailCreature.add(new JLabel(MTGControler.getInstance().getLangService().getCapitalize("CARD_POWER") + " :"));
		panelDetailCreature.add(powerJTextField);
		panelDetailCreature.add(new JLabel("/"));
		panelDetailCreature.add(toughnessJTextField);
		add(panelDetailCreature,UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 1, 2,3,null));

		lstFormats = new JList<>(new DefaultListModel<MagicFormat>());
		lstFormats.setCellRenderer((JList<? extends MagicFormat> list, MagicFormat obj, int arg2,boolean arg3, boolean arg4)->{
					JLabel l = new JLabel(obj.getFormat());

					if(obj.getFormatLegality()!=null)
					{

						switch (obj.getFormatLegality()) {
							case BANNED: l.setIcon(MTGConstants.ICON_SMALL_DELETE);break;
							case LEGAL:l.setIcon(MTGConstants.ICON_SMALL_CHECK);break;
							case NOT_LEGAL:l.setIcon(MTGConstants.ICON_SMALL_DELETE);break;
							case RESTRICTED:l.setIcon(MTGConstants.ICON_SMALL_EQUALS);break;
							default: break;
						}

						l.setToolTipText(obj.getFormat() + ":" + obj.getFormatLegality().name());
					}
					else //TODO remove when Islegal will be removed
					{

						if(obj.isLegal())
							l.setIcon(MTGConstants.ICON_SMALL_CHECK);
						else
							l.setIcon(MTGConstants.ICON_SMALL_DELETE);
					}

				return l;
		});
		add(new JScrollPane(lstFormats), UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 1, 8,2,2));

		txtTextPane = new MagicTextPane();
		txtTextPane.setBorder(new LineBorder(Color.GRAY));
		txtTextPane.setBackground(Color.WHITE);
		add(txtTextPane, UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 1, 4,6,2));

		txtFlavorArea = new JTextPane();
		txtFlavorArea.setFont(txtFlavorArea.getFont().deriveFont(Font.ITALIC));
		add(txtFlavorArea, UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 1, 6,6,null));

		listModelCollection = new DefaultListModel<>();
		listCollection = new JList<>(listModelCollection);
		listCollection.setCellRenderer((JList<? extends MagicCollection> list, MagicCollection obj, int arg2,boolean arg3, boolean arg4)->new JLabel(obj.getName(),MTGConstants.ICON_COLLECTION,SwingConstants.LEFT));

		add(new JScrollPane(listCollection), UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 4, 8,3,2));

		panelSwitchLangage = new JPanel();
		FlowLayout flowLayout1 = (FlowLayout) panelSwitchLangage.getLayout();
		flowLayout1.setAlignment(FlowLayout.LEFT);

		add(panelSwitchLangage, UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 0, 10,9,null));

		if (magicCard != null) {
			mBindingGroup = initDataBindings();
		}

		setEditable(false);

	}

Replace Generic With Diamond JList<> with JList<> in method public MagicCardDetailPanel() from class org.magic.gui.components.MagicCardDetailPanel


	public MagicCardNameEditor() {
		super(new JComboBox<>());
		model = (DefaultComboBoxModel<String>) ((JComboBox<String>) getComponent()).getModel();
	}

	public MagicCardNameEditor() {
		super(new JComboBox<String>());
		model = (DefaultComboBoxModel<String>) ((JComboBox<String>) getComponent()).getModel();
	}

Replace Generic With Diamond JComboBox<String> with JComboBox<> in method public MagicCardNameEditor() from class org.magic.gui.editor.MagicCardNameEditor


	public MagicEditionsComboBoxCellEditor() {
		super(new JComboBox<>());
		model = (DefaultComboBoxModel<MagicEdition>) ((JComboBox<MagicEdition>) getComponent()).getModel();
	}

	public MagicEditionsComboBoxCellEditor() {
		super(new JComboBox<MagicEdition>());
		model = (DefaultComboBoxModel<MagicEdition>) ((JComboBox<MagicEdition>) getComponent()).getModel();
	}

Replace Generic With Diamond JComboBox<MagicEdition> with JComboBox<> in method public MagicEditionsComboBoxCellEditor() from class org.magic.gui.editor.MagicEditionsComboBoxCellEditor


	@Override
	public void loadURL(String url) {
		logger.debug("loading " + url);

		ThreadManager.getInstance().executeThread(()->{
				try {
					browse.setText(URLTools.extractHtml(url).html());
					browse.setCaretPosition(0);
				}
				catch(Exception e)
				{
					browse.setText("Error " + e);
				}

		}, "loading " + url);

	}

	@Override
	public void loadURL(String url) {
		logger.debug("loading " + url);

		ThreadManager.getInstance().executeThread(new Runnable() {

			@Override
			public void run() {
				try {
					browse.setText(URLTools.extractHtml(url).html());
					browse.setCaretPosition(1);
				}
				catch(Exception e)
				{
					browse.setText("Error " + e);
				}

			}
		}, "loading " + url);

	}

Replace Anonymous With Lambda org.magic.gui.components.browser.JEditorPaneBrowser.loadURL.executeThread.new Runnable with () -> {trybrowse.setText(URLTools.extractHtml(url).html()); in method public loadURL(url String) : void from class org.magic.gui.components.browser.JEditorPaneBrowser


	public void save() {
		try (FileOutputStream fos = new FileOutputStream(confFile)){
			props.store(fos, "");
		} catch (Exception e) {
			logger.error("error writing file " + confFile, e);
		}
	}

	public void save() {
		try {
			FileOutputStream fos = new FileOutputStream(confFile);
			props.store(fos, "");
			fos.close();
		} catch (Exception e) {
			logger.error("error writing file " + confFile, e);
		}
	}

Try With Resources try(FileOutputStream fos=new FileOutputStream(confFile)) in method public save() : void from class org.magic.api.interfaces.abstracts.AbstractMTGPlugin


	public MagicCard getValueAt(int pos) {
		return new ArrayList<>(mapDeck.keySet()).get(pos);
	}

	public MagicCard getValueAt(int pos) {
		return new ArrayList<MagicCard>(mapDeck.keySet()).get(pos);
	}

Replace Generic With Diamond ArrayList<MagicCard> with ArrayList<> in method public getValueAt(pos int) : MagicCard from class org.magic.api.beans.MagicDeck


	public MagicCard getSideValueAt(int pos) {
		return new ArrayList<>(mapSideBoard.keySet()).get(pos);
	}

	public MagicCard getSideValueAt(int pos) {
		return new ArrayList<MagicCard>(mapSideBoard.keySet()).get(pos);
	}

Replace Generic With Diamond ArrayList<MagicCard> with ArrayList<> in method public getSideValueAt(pos int) : MagicCard from class org.magic.api.beans.MagicDeck


	public void setMagicCard(MagicCard mc) {
		try {
			this.magicCard = (MagicCard) BeanUtils.cloneBean(mc);
		} catch (Exception e1) {
			logger.error("error setting " + mc, e1);
		}

		SwingWorker<Image, Image> sw = new SwingWorker<>()
		{
			Image temp = null;
			@Override
			protected Image doInBackground() throws Exception {
				try {
					if (mc.getLayout().equalsIgnoreCase(MagicCard.LAYOUT.TOKEN.toString())|| mc.getLayout().equalsIgnoreCase(MagicCard.LAYOUT.EMBLEM.toString())) {
						temp = MTGControler.getInstance().getEnabled(MTGTokensProvider.class).getPictures(mc);
					} else {
						temp = MTGControler.getInstance().getEnabled(MTGPictureProvider.class).getPicture(mc, null);
					}
					publish(temp);
				} catch (Exception e) {
					temp = MTGControler.getInstance().getEnabled(MTGPictureProvider.class).getBackPicture();
				}

				return temp;
			}

			@Override
			protected void done() {
				try {
					fullResPics=get();
					image = new ImageIcon(fullResPics.getScaledInstance(getWidth(), getHeight(), Image.SCALE_FAST));
					revalidate();
					repaint();
				} catch (Exception e) {
					logger.error(e);
				}
			}

		};

		ThreadManager.getInstance().runInEdt(sw,"Init DisplayableCard:"+mc);

	}

	public void setMagicCard(MagicCard mc) {
		try {
			this.magicCard = (MagicCard) BeanUtils.cloneBean(mc);
		} catch (Exception e1) {
			logger.error("error setting " + mc, e1);
		}

		SwingWorker<Image, Image> sw = new SwingWorker<Image, Image>()
		{
			Image temp = null;
			@Override
			protected Image doInBackground() throws Exception {
				try {
					if (mc.getLayout().equalsIgnoreCase(MagicCard.LAYOUT.TOKEN.toString())|| mc.getLayout().equalsIgnoreCase(MagicCard.LAYOUT.EMBLEM.toString())) {
						temp = MTGControler.getInstance().getEnabled(MTGTokensProvider.class).getPictures(mc);
					} else {
						temp = MTGControler.getInstance().getEnabled(MTGPictureProvider.class).getPicture(mc, null);
					}
					publish(temp);
				} catch (Exception e) {
					temp = MTGControler.getInstance().getEnabled(MTGPictureProvider.class).getBackPicture();
				}

				return temp;
			}

			@Override
			protected void done() {
				try {
					fullResPics=get();
					image = new ImageIcon(fullResPics.getScaledInstance(getWidth(), getHeight(), Image.SCALE_FAST));
					revalidate();
					repaint();
				} catch (Exception e) {
					logger.error(e);
				}
			}

		};

		ThreadManager.getInstance().runInEdt(sw,"Init DisplayableCard:"+mc);

	}

Replace Generic With Diamond SwingWorker<Image,Image> with SwingWorker<> in method public setMagicCard(mc MagicCard) : void from class org.magic.game.gui.components.DisplayableCard


	public void initThumbnails(final List<MagicCard> cards, final boolean activateCards, final boolean rightClick) {

		if (sw != null && !sw.isDone())
			sw.cancel(true);

		c.weightx = 1;
		c.weighty = 1;
		c.gridx = 0;
		c.gridy = 0;
		c.insets = new Insets(2, 2, 2, 2);
		c.anchor = GridBagConstraints.NORTHWEST;

		this.removeAll();
		index = 0;

		sw = new SwingWorker<>()
		{

			@Override
			protected void process(List<MagicCard> cards) {
				for(MagicCard mc : cards) {
						DisplayableCard lab = new DisplayableCard(mc, getCardsDimension(), activateCards, rightClick);
						lab.setTappable(activateCards);
						addComponent(lab);
						revalidate();
				}
			}

			@Override
			protected Void doInBackground() throws Exception {
				publish(cards.toArray(new MagicCard[cards.size()]));
				return null;
			}

			@Override
			protected void done() {
				revalidate();
				repaint();
			}
		};

		ThreadManager.getInstance().runInEdt(sw,"Init Thumbnail");
	}

	public void initThumbnails(final List<MagicCard> cards, final boolean activateCards, final boolean rightClick) {

		if (sw != null && !sw.isDone())
			sw.cancel(true);

		c.weightx = 1;
		c.weighty = 1;
		c.gridx = 0;
		c.gridy = 0;
		c.insets = new Insets(2, 2, 2, 2);
		c.anchor = GridBagConstraints.NORTHWEST;

		this.removeAll();
		index = 0;

		sw = new SwingWorker<Void, MagicCard>()
		{

			@Override
			protected void process(List<MagicCard> cards) {
				for(MagicCard mc : cards) {
						DisplayableCard lab = new DisplayableCard(mc, getCardsDimension(), activateCards, rightClick);
						lab.setTappable(activateCards);
						addComponent(lab);
						revalidate();
				}
			}

			@Override
			protected Void doInBackground() throws Exception {
				publish(cards.toArray(new MagicCard[cards.size()]));
				return null;
			}

			@Override
			protected void done() {
				revalidate();
				repaint();
			}
		};

		ThreadManager.getInstance().runInEdt(sw,"Init Thumbnail");
	}

Replace Generic With Diamond SwingWorker<Void,MagicCard> with SwingWorker<> in method public initThumbnails(cards List<MagicCard>, activateCards boolean, rightClick boolean) : void from class org.magic.game.gui.components.HandPanel


	private void initActions() {

		table.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent evt) {
				resultListModel.removeAllElements();

				int viewRow = table.getSelectedRow();
				if (viewRow > -1) {
					int modelRow = table.convertRowIndexToModel(viewRow);
					MagicCardAlert selected = (MagicCardAlert) table.getModel().getValueAt(modelRow, 0);
					updateInfo(selected);
					table.setRowSelectionInterval(viewRow, viewRow);
					for (MagicPrice mp : selected.getOffers())
						resultListModel.addElement(mp);
				}
			}
		});

		list.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				try {

					if (e.getClickCount() == 2 && (list.getSelectedValue() != null)) {
						Desktop.getDesktop().browse(new URI(list.getSelectedValue().getUrl()));
					}
				} catch (Exception e1) {
					MTGControler.getInstance().notify(e1);
				}

			}
		});

		btnRefresh.addActionListener(e -> model.fireTableDataChanged());

		btnSuggestPrice.addActionListener(ae->{

			if(table.getSelectedRows().length<=0)
				return;

			lblLoading.start(table.getSelectedRows().length);
			SwingWorker<Void, MagicCardAlert> sw = new SwingWorker<>()
					{
						@Override
						protected void done() {
							lblLoading.end();
							model.fireTableDataChanged();
						}

						@Override
						protected void process(List<MagicCardAlert> chunks) {
							lblLoading.progressSmooth(chunks.size());
						}

						@Override
						protected Void doInBackground(){
							List<MagicCardAlert> alerts = extract(table.getSelectedRows());
							for (MagicCardAlert alert : alerts)
							{
								List<MagicPrice> prices=new ArrayList<>();
								MTGControler.getInstance().listEnabled(MTGPricesProvider.class).forEach(p->{
									try {
										prices.addAll(p.getPrice(alert.getCard().getCurrentSet(), alert.getCard()));
									} catch (IOException e1) {
										logger.error("error adding price for" + alert.getCard() + " with " + p,e1);
									}

								});

								Collections.sort(prices,new MagicPricesComparator());
								if(!prices.isEmpty())
								{
									alert.setPrice(prices.get(0).getValue());
									try {
										MTGControler.getInstance().getEnabled(MTGDao.class).updateAlert(alert);
									} catch (SQLException e) {
										logger.error("error updating " + alert,e);
									}
								}
								publish(alert);
							}
							return null;
						}

					};

					ThreadManager.getInstance().runInEdt(sw,"suggest prices");
		});

		btnDelete.addActionListener(event -> {
			int res = JOptionPane.showConfirmDialog(null,MTGControler.getInstance().getLangService().getCapitalize("CONFIRM_DELETE",table.getSelectedRows().length + " item(s)"),
					MTGControler.getInstance().getLangService().getCapitalize("DELETE") + " ?",JOptionPane.YES_NO_OPTION);

			if (res == JOptionPane.YES_OPTION)
			{
				int[] selected = table.getSelectedRows();
				lblLoading.start(selected.length);

				SwingWorker<List<MagicCardAlert>, MagicCardAlert> sw = new SwingWorker<>()
				{

					@Override
					protected List<MagicCardAlert> doInBackground() throws Exception {
						List<MagicCardAlert> alerts = extract(selected);
						for (MagicCardAlert alert : alerts)
						{
							MTGControler.getInstance().getEnabled(MTGDao.class).deleteAlert(alert);
							publish(alert);
						}
						return alerts;
					}

					@Override
					protected void done() {
						try {
							get();
						}
						catch(Exception e)
						{
							MTGControler.getInstance().notify(e);
						}

						model.fireTableDataChanged();
						lblLoading.end();
					}

					@Override
					protected void process(List<MagicCardAlert> chunks) {
						lblLoading.progress(chunks.size());
					}
				};

				ThreadManager.getInstance().runInEdt(sw, "delete alerts");

			}
		});

		btnImport.addActionListener(ae -> {
			JPopupMenu menu = new JPopupMenu();

			JMenuItem mnuImportSearch = new JMenuItem(MTGControler.getInstance().getLangService().getCapitalize("IMPORT_FROM", MTGControler.getInstance().getLangService().get("SEARCH_MODULE")));
			mnuImportSearch.setIcon(MTGConstants.ICON_SEARCH);

			mnuImportSearch.addActionListener(importAE -> {
				CardSearchImportDialog cdSearch = new CardSearchImportDialog();
				cdSearch.setVisible(true);
				if (cdSearch.getSelection() != null) {
					for (MagicCard mc : cdSearch.getSelection())
						addCard(mc);
				}
			});
			menu.add(mnuImportSearch);

			for (final MTGCardsExport exp : MTGControler.getInstance().listEnabled(MTGCardsExport.class)) {
				if (exp.getMods() == MODS.BOTH || exp.getMods() == MODS.IMPORT) {

					JMenuItem it = new JMenuItem();
					it.setIcon(exp.getIcon());
					it.setText(exp.getName());
					it.addActionListener(itEvent -> {
						JFileChooser jf = new JFileChooser(".");
						jf.setFileFilter(new FileFilter() {
							@Override
							public String getDescription() {
								return exp.getName();
							}

							@Override
							public boolean accept(File f) {
								return (f.isDirectory() || f.getName().endsWith(exp.getFileExtension()));
							}
						});
						int res = -1;
						f = new File("");

						if (!exp.needDialogGUI()) {
							res = jf.showOpenDialog(null);
							f = jf.getSelectedFile();
						} else {

							try {
								exp.importDeck(null).getMap().keySet().forEach(this::addCard);
							} catch (IOException e1) {
								logger.error(e1);
							}

						}

						if (res == JFileChooser.APPROVE_OPTION)
						{

							AbstractObservableWorker<MagicDeck, MagicCard, MTGCardsExport> sw = new AbstractObservableWorker<>(lblLoading,exp) {

								@Override
								protected MagicDeck doInBackground() throws Exception {
									return plug.importDeck(f);
								}

								@Override
								protected void done() {
									super.done();

									if(getResult()!=null)
										for (MagicCard mc : getResult().getMap().keySet())
											addCard(mc);
								}
							};
							ThreadManager.getInstance().runInEdt(sw,"import alarms");
						}
					});

					menu.add(it);
				}
			}

			Component b = (Component) ae.getSource();
			Point point = b.getLocationOnScreen();
			menu.show(b, 0, 0);
			menu.setLocation(point.x, point.y + b.getHeight());

		});

	}

	private void initActions() {

		table.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent evt) {
				resultListModel.removeAllElements();

				int viewRow = table.getSelectedRow();
				if (viewRow > -1) {
					int modelRow = table.convertRowIndexToModel(viewRow);
					MagicCardAlert selected = (MagicCardAlert) table.getModel().getValueAt(modelRow, 0);
					updateInfo(selected);
					table.setRowSelectionInterval(viewRow, viewRow);
					for (MagicPrice mp : selected.getOffers())
						resultListModel.addElement(mp);
				}
			}
		});

		list.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				try {

					if (e.getClickCount() == 2 && (list.getSelectedValue() != null)) {
						Desktop.getDesktop().browse(new URI(list.getSelectedValue().getUrl()));
					}
				} catch (Exception e1) {
					MTGControler.getInstance().notify(e1);
				}

			}
		});

		btnRefresh.addActionListener(e -> model.fireTableDataChanged());

		btnSuggestPrice.addActionListener(ae->{

			if(table.getSelectedRows().length<=0)
				return;

			lblLoading.start(table.getSelectedRows().length);
			SwingWorker<Void, MagicCardAlert> sw = new SwingWorker<Void, MagicCardAlert>()
					{
						@Override
						protected void done() {
							lblLoading.end();
							model.fireTableDataChanged();
						}

						@Override
						protected void process(List<MagicCardAlert> chunks) {
							lblLoading.progressSmooth(chunks.size());
						}

						@Override
						protected Void doInBackground(){
							List<MagicCardAlert> alerts = extract(table.getSelectedRows());
							for (MagicCardAlert alert : alerts)
							{
								List<MagicPrice> prices=new ArrayList<>();
								MTGControler.getInstance().listEnabled(MTGPricesProvider.class).forEach(p->{
									try {
										prices.addAll(p.getPrice(alert.getCard().getCurrentSet(), alert.getCard()));
									} catch (IOException e1) {
										logger.error("error adding price for" + alert.getCard() + " with " + p,e1);
									}

								});

								Collections.sort(prices,new MagicPricesComparator());
								if(!prices.isEmpty())
								{
									alert.setPrice(prices.get(0).getValue());
									try {
										MTGControler.getInstance().getEnabled(MTGDao.class).updateAlert(alert);
									} catch (SQLException e) {
										logger.error("error updating " + alert,e);
									}
								}
								publish(alert);
							}
							return null;
						}

					};

					ThreadManager.getInstance().runInEdt(sw,"suggest prices");
		});

		btnDelete.addActionListener(event -> {
			int res = JOptionPane.showConfirmDialog(null,MTGControler.getInstance().getLangService().getCapitalize("CONFIRM_DELETE",table.getSelectedRows().length + " item(s)"),
					MTGControler.getInstance().getLangService().getCapitalize("DELETE") + " ?",JOptionPane.YES_NO_OPTION);

			if (res == JOptionPane.YES_OPTION)
			{
				int[] selected = table.getSelectedRows();
				lblLoading.start(selected.length);

				SwingWorker<List<MagicCardAlert>, MagicCardAlert> sw = new SwingWorker<List<MagicCardAlert>, MagicCardAlert>()
				{

					@Override
					protected List<MagicCardAlert> doInBackground() throws Exception {
						List<MagicCardAlert> alerts = extract(selected);
						for (MagicCardAlert alert : alerts)
						{
							MTGControler.getInstance().getEnabled(MTGDao.class).deleteAlert(alert);
							publish(alert);
						}
						return alerts;
					}

					@Override
					protected void done() {
						try {
							get();
						}
						catch(Exception e)
						{
							MTGControler.getInstance().notify(e);
						}

						model.fireTableDataChanged();
						lblLoading.end();
					}

					@Override
					protected void process(List<MagicCardAlert> chunks) {
						lblLoading.progress(chunks.size());
					}
				};

				ThreadManager.getInstance().runInEdt(sw, "delete alerts");

			}
		});

		btnImport.addActionListener(ae -> {
			JPopupMenu menu = new JPopupMenu();

			JMenuItem mnuImportSearch = new JMenuItem(MTGControler.getInstance().getLangService().getCapitalize("IMPORT_FROM", MTGControler.getInstance().getLangService().get("SEARCH_MODULE")));
			mnuImportSearch.setIcon(MTGConstants.ICON_SEARCH);

			mnuImportSearch.addActionListener(importAE -> {
				CardSearchImportDialog cdSearch = new CardSearchImportDialog();
				cdSearch.setVisible(true);
				if (cdSearch.getSelection() != null) {
					for (MagicCard mc : cdSearch.getSelection())
						addCard(mc);
				}
			});
			menu.add(mnuImportSearch);

			for (final MTGCardsExport exp : MTGControler.getInstance().listEnabled(MTGCardsExport.class)) {
				if (exp.getMods() == MODS.BOTH || exp.getMods() == MODS.IMPORT) {

					JMenuItem it = new JMenuItem();
					it.setIcon(exp.getIcon());
					it.setText(exp.getName());
					it.addActionListener(itEvent -> {
						JFileChooser jf = new JFileChooser(".");
						jf.setFileFilter(new FileFilter() {
							@Override
							public String getDescription() {
								return exp.getName();
							}

							@Override
							public boolean accept(File f) {
								return (f.isDirectory() || f.getName().endsWith(exp.getFileExtension()));
							}
						});
						int res = -1;
						f = new File("");

						if (!exp.needDialogGUI()) {
							res = jf.showOpenDialog(null);
							f = jf.getSelectedFile();
						} else {

							try {
								exp.importDeck(null).getMap().keySet().forEach(this::addCard);
							} catch (IOException e1) {
								logger.error(e1);
							}

						}

						if (res == JFileChooser.APPROVE_OPTION)
						{

							AbstractObservableWorker<MagicDeck, MagicCard, MTGCardsExport> sw = new AbstractObservableWorker<MagicDeck, MagicCard, MTGCardsExport>(lblLoading,exp) {

								@Override
								protected MagicDeck doInBackground() throws Exception {
									return plug.importDeck(f);
								}

								@Override
								protected void done() {
									super.done();

									if(getResult()!=null)
										for (MagicCard mc : getResult().getMap().keySet())
											addCard(mc);
								}
							};
							ThreadManager.getInstance().runInEdt(sw,"import alarms");
						}
					});

					menu.add(it);
				}
			}

			Component b = (Component) ae.getSource();
			Point point = b.getLocationOnScreen();
			menu.show(b, 0, 0);
			menu.setLocation(point.x, point.y + b.getHeight());

		});

	}

Replace Generic With Diamond SwingWorker<Void,MagicCardAlert> with SwingWorker<> in method private initActions() : void from class org.magic.gui.AlarmGUI


	public CardBuilder2GUI() {
		try {
			//////////////////////////////////////////////////// INIT LOCAL COMPONENTS
			JPanel panelEditionHaut = new JPanel();
			JPanel panelSets = new JPanel();
			JButton btnSaveEdition = new JButton("");
			JButton btnNewSet = new JButton("");
			JButton btnRemoveEdition = new JButton("");
			JPanel buttonsForeignNamesPanel = new JPanel();
			JButton btnRemoveName = new JButton("Remove");
			JSplitPane splitcardEdPanel = new JSplitPane();
			JPanel panelCards = new JPanel();
			JPanel panelCardsHaut = new JPanel();
			JButton btnImport = new JButton(MTGConstants.ICON_IMPORT);
			JButton btnRefreshSet = new JButton(MTGConstants.ICON_REFRESH);

			JButton btnSaveCard = new JButton(MTGConstants.ICON_SAVE);
			JButton btnAddName = new JButton("add Languages");
			JTabbedPane tabbedResult = new JTabbedPane(JTabbedPane.TOP);
			JButton btnRemoveCard = new JButton("");
			JButton btnNewCard = new JButton("");
			JPanel panelBooster = new JPanel();
			JLabel lblCommon = new JLabel("Common :");
			JLabel lblUncommon = new JLabel("Uncommon :");
			JLabel lblRareMythic = new JLabel("Rare/Mythic :");

			JTabbedPane tabbedCards = new JTabbedPane(JTabbedPane.TOP);
			JPanel panelMisc = new JPanel();
			JPanel panelCardEditions = new JPanel();
			JPanel legalitiesPanel = new JPanel();
			legalitiesPanel.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0), 1, true), "",TitledBorder.LEADING, TitledBorder.TOP, null, null));

			JToggleButton tglStd = new JToggleButton("STD");
			JToggleButton tglMdn = new JToggleButton("MDN");
			JToggleButton tglVin = new JToggleButton("VIN");
			JToggleButton tglLeg = new JToggleButton("LEG");

			//////////////////////////////////////////////////// INIT GLOBAL COMPONENTS
			editionModel = new MagicEditionsTableModel();
			provider = new PrivateMTGSetProvider();
			provider.init();
			btnRefresh = new JButton("");
			picturesProvider = new PersonalSetPicturesProvider();
			spinCommon = new JSpinner();
			spinRare = new JSpinner();
			spinUnco = new JSpinner();
			cardsModel = new MagicCardTableModel();
			jsonPanel = new ObjectViewerPanel();
			jsonPanel.setMaximumSize(new Dimension(400, 10));
			editionsTable = new JXTable();
			cardsTable = new JXTable();
			tabbedPane = new JTabbedPane(JTabbedPane.TOP);
			cboSets = new JComboBox<>();
			namesModel = new MagicCardNamesTableModel();
			panelPictures = new JPanel() {
				private static final long serialVersionUID = 1L;
				@Override
				protected void paintComponent(Graphics g) {
					super.paintComponent(g);
					g.drawImage(cardImage, 0, 0, null);

					if (magicCardEditorPanel.getImagePanel().getCroppedImage() != null && MTGControler.getInstance().getEnabled(MTGPictureEditor.class).getMode()==MOD.LOCAL)
						g.drawImage(magicCardEditorPanel.getImagePanel().getCroppedImage(), 35, 68, 329, 242, null);

					revalidate();
				}
			};

			foreignNamesEditorPanel = new JPanel();
			listNames = new JXTable();
			magicCardEditorPanel = new MagicCardEditorPanel();
			magicEditionDetailPanel = new MagicEditionDetailPanel(false);

			//////////////////////////////////////////////////// MODELS INIT
			editionsTable.setModel(editionModel);
			cardsTable.setModel(cardsModel);
			listNames.setModel(namesModel);

			spinCommon.setModel(new SpinnerNumberModel(0, 0, null, 1));
			spinUnco.setModel(new SpinnerNumberModel(0, 0, null, 1));
			spinRare.setModel(new SpinnerNumberModel(0, 0, null, 1));

			List<MagicEdition> eds = provider.loadEditions();
			cboSets.setModel(new DefaultComboBoxModel<>(eds.toArray(new MagicEdition[eds.size()])));

			//////////////////////////////////////////////////// LAYOUT CONFIGURATION
			setLayout(new BorderLayout(0, 0));
			panelSets.setLayout(new BorderLayout(0, 0));
			panelCards.setLayout(new BorderLayout(0, 0));
			panelMisc.setLayout(new BorderLayout(0, 0));

			GridBagLayout gblPanelBooster = new GridBagLayout();
			gblPanelBooster.columnWidths = new int[] { 218, 218, 0 };
			gblPanelBooster.rowHeights = new int[] { 38, 41, 37, 0 };
			gblPanelBooster.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
			gblPanelBooster.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE };
			GridBagConstraints gbcLblCommon = UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 0, 0);
			GridBagConstraints gbcSpinCommon = UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 1, 0);
			GridBagConstraints gbcLblUncommon = UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 0, 1);
			GridBagConstraints gbcSpinUnco = UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 1, 1);
			GridBagConstraints gbcLblRareMythic = UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 0, 2);
			GridBagConstraints gbcSpinRare = UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 1, 2);

			GridBagLayout gridBagLayout = (GridBagLayout) magicCardEditorPanel.getLayout();
			gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0};
			gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 };
			gridBagLayout.columnWeights = new double[] { 0.0, 1.0, 0.0, 0.0 };

			panelBooster.setLayout(gblPanelBooster);
			splitcardEdPanel.setDividerLocation(0.5);
			splitcardEdPanel.setResizeWeight(0.5);

			//////////////////////////////////////////////////// PANEL ADDS
			add(tabbedPane);
			panelCards.add(panelCardsHaut, BorderLayout.NORTH);
			panelSets.add(panelEditionHaut, BorderLayout.NORTH);
			panelEditionHaut.add(btnNewSet);
			panelEditionHaut.add(btnSaveEdition);
			panelEditionHaut.add(btnRemoveEdition);
			panelSets.add(splitcardEdPanel, BorderLayout.CENTER);
			panelCardsHaut.add(cboSets);
			panelCardsHaut.add(btnNewCard);
			panelCardsHaut.add(btnImport);
			panelCardsHaut.add(btnSaveCard);
			panelCardsHaut.add(btnRefresh);
			panelCards.add(tabbedResult, BorderLayout.EAST);
			panelCardsHaut.add(btnRemoveCard);
			tabbedPane.addTab("Set", MTGConstants.ICON_BACK, panelSets, null);
			tabbedPane.addTab("Cards", MTGConstants.ICON_TAB_DECK, panelCards, null);
			tabbedResult.addTab("Pictures", MTGConstants.ICON_TAB_PICTURE, panelPictures, null);
			tabbedResult.addTab("Object",MTGConstants.ICON_TAB_JSON, jsonPanel,null);
			panelBooster.add(lblCommon, gbcLblCommon);
			panelBooster.add(spinCommon, gbcSpinCommon);
			panelBooster.add(lblUncommon, gbcLblUncommon);
			panelBooster.add(spinUnco, gbcSpinUnco);
			panelBooster.add(lblRareMythic, gbcLblRareMythic);
			panelBooster.add(spinRare, gbcSpinRare);
			panelCards.add(tabbedCards, BorderLayout.CENTER);
			tabbedCards.addTab("Details", MTGConstants.ICON_TAB_DETAILS, magicCardEditorPanel, null);
			tabbedCards.addTab("Editions", MTGConstants.ICON_BACK, panelCardEditions, null);
			tabbedCards.addTab("Misc", MTGConstants.ICON_TAB_ADMIN, panelMisc, null);
			panelMisc.add(legalitiesPanel, BorderLayout.SOUTH);
			legalitiesPanel.add(tglStd);
			legalitiesPanel.add(tglMdn);
			legalitiesPanel.add(tglLeg);
			legalitiesPanel.add(tglVin);
			splitcardEdPanel.setLeftComponent(new JScrollPane(editionsTable));

			splitcardEdPanel.setRightComponent( new JScrollPane(cardsTable));
			panelSets.add(magicEditionDetailPanel, BorderLayout.EAST);
			panelMisc.add(foreignNamesEditorPanel);
			foreignNamesEditorPanel.setLayout(new BorderLayout(0, 0));
			foreignNamesEditorPanel.add(new JScrollPane(listNames), BorderLayout.CENTER);
			foreignNamesEditorPanel.add(buttonsForeignNamesPanel, BorderLayout.NORTH);
			buttonsForeignNamesPanel.add(btnAddName);
			buttonsForeignNamesPanel.add(btnRemoveName);

			//////////////////////////////////////////////////// COMPONENT CONFIG
			editionModel.init(provider.loadEditions());
			editionModel.fireTableDataChanged();
			splitcardEdPanel.setOrientation(JSplitPane.VERTICAL_SPLIT);

			btnSaveEdition.setIcon(MTGConstants.ICON_SAVE);
			btnNewSet.setIcon(MTGConstants.ICON_NEW);
			btnRemoveEdition.setIcon(MTGConstants.ICON_DELETE);

			btnSaveEdition.setToolTipText("Save the set");
			btnNewSet.setToolTipText("New set");
			btnRemoveEdition.setToolTipText("Delete Set");

			panelEditionHaut.add(btnRefreshSet);
			btnImport.setToolTipText("Import existing card");
			btnSaveCard.setToolTipText("Save the card");
			btnRefresh.setToolTipText("Refresh");
			btnNewCard.setToolTipText("New Card");
			btnRemoveCard.setToolTipText("Delete the card");

			magicEditionDetailPanel.setEditable(true);

			btnRefresh.setIcon(MTGConstants.ICON_REFRESH);
			btnRemoveCard.setIcon(MTGConstants.ICON_DELETE);
			btnNewCard.setIcon(MTGConstants.ICON_NEW);
			cardsTable.getColumnModel().getColumn(2).setCellRenderer(new ManaCellRenderer());
			panelPictures.setBackground(Color.WHITE);
			panelPictures.setPreferredSize(new Dimension(400, 10));
			listNames.getColumnModel().getColumn(0).setCellEditor(new MagicCardNameEditor());
			buttonsForeignNamesPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));

			//////////////////////////////////////////////////// ACTION LISTENER

			magicCardEditorPanel.getSizeSpinner().addChangeListener(ce->MTGControler.getInstance().getEnabled(MTGPictureEditor.class).setTextSize((Integer)magicCardEditorPanel.getSizeSpinner().getValue()));
			magicCardEditorPanel.getColorIndicatorJCheckBox().addActionListener(ae->MTGControler.getInstance().getEnabled(MTGPictureEditor.class).setColorIndicator(magicCardEditorPanel.getColorIndicatorJCheckBox().isSelected()));
			magicCardEditorPanel.getChboxFoil().addActionListener(ae->MTGControler.getInstance().getEnabled(MTGPictureEditor.class).setFoil(magicCardEditorPanel.getChboxFoil().isSelected()));
			magicCardEditorPanel.getCboColorAccent().addItemListener(ie-> MTGControler.getInstance().getEnabled(MTGPictureEditor.class).setColorAccentuation(magicCardEditorPanel.getCboColorAccent().getSelectedItem().toString()));

			btnRefreshSet.addActionListener(e->{

				MagicEdition ed = (MagicEdition) editionsTable.getValueAt(editionsTable.getSelectedRow(), 1);
				try {
					List<MagicCard> cards = provider.getCards(ed);
					ed.setCardCount(cards.size());

					cards.forEach(mc->mc.getCurrentSet().setNumber(null));
					Collections.sort(cards,new CardsEditionSorter());
					for(int i=0;i<cards.size();i++)
						{
							cards.get(i).setNumber(String.valueOf((i+1)));
							cards.get(i).getCurrentSet().setNumber(String.valueOf((i+1)));
						}
					provider.saveEdition(ed,cards);

				} catch (IOException e1) {
					logger.error(e1);
				}

			});

			btnRemoveName.addActionListener(e -> {
				int row = listNames.getSelectedRow();
				namesModel.removeRow(row);
				namesModel.fireTableDataChanged();
			});

			btnAddName.addActionListener(e -> {

				MagicCardNames name = new MagicCardNames();
				name.setLanguage("");
				name.setName("");
				magicCardEditorPanel.getMagicCard().getForeignNames().add(name);
				namesModel.init(magicCardEditorPanel.getMagicCard());
			});

			btnNewCard.addActionListener(e -> {
				MagicCard mc = new MagicCard();
				try {
					mc.setNumber(
							String.valueOf(provider.getCards((MagicEdition) cboSets.getSelectedItem()).size() + 1));
					logger.debug("create new card for " + cboSets.getSelectedItem() + " num = " + mc.getNumber());
				} catch (IOException e1) {
					logger.error(e1);
				}
				initCard(mc);
			});

			btnRemoveCard.addActionListener(e -> {
				try {
					int res = JOptionPane.showConfirmDialog(null, MTGControler.getInstance().getLangService().get("CONFIRM_DELETE", magicCardEditorPanel.getMagicCard()));
					if (res == JOptionPane.YES_OPTION) {
						provider.removeCard((MagicEdition) cboSets.getSelectedItem(),
								magicCardEditorPanel.getMagicCard());
						picturesProvider.removePicture((MagicEdition) cboSets.getSelectedItem(),
								magicCardEditorPanel.getMagicCard());
						initCard(new MagicCard());
					}
				} catch (IOException ex) {
					MTGControler.getInstance().notify(ex);
				}
			});

			btnSaveEdition.addActionListener(e -> {
				try {
					MagicEdition ed = magicEditionDetailPanel.getMagicEdition();
					List<Object> boos = new ArrayList<>();
					for (int i = 0; i < (Integer) spinCommon.getValue(); i++)
						boos.add("common");
					for (int i = 0; i < (Integer) spinUnco.getValue(); i++)
						boos.add("uncommon");
					for (int i = 0; i < (Integer) spinRare.getValue(); i++)
						boos.add(new String[] { "rare", "mythic rare" });

					ed.setBooster(boos);
					provider.saveEdition(ed);

					cboSets.removeAllItems();
					cboSets.setModel(new DefaultComboBoxModel<>(
							provider.loadEditions().toArray(new MagicEdition[provider.loadEditions().size()])));

					editionModel.init(provider.loadEditions());
					editionModel.fireTableDataChanged();
				} catch (Exception ex) {
					MTGControler.getInstance().notify(ex);
				}
			});

			btnImport.addActionListener(e -> {
				CardSearchImportDialog l = new CardSearchImportDialog();
				l.setVisible(true);
				if (l.getSelected() != null)
					initCard(l.getSelected());

			});

			btnNewSet.addActionListener(e -> magicEditionDetailPanel.setMagicEdition(new MagicEdition(), true));

			btnRemoveEdition.addActionListener(e -> {

				int viewRow = editionsTable.getSelectedRow();
				int modelRow = editionsTable.convertRowIndexToModel(viewRow);
				MagicEdition ed = (MagicEdition) editionsTable.getModel().getValueAt(modelRow, 1);

				int res = JOptionPane.showConfirmDialog(null,
						MTGControler.getInstance().getLangService().get("CONFIRM_DELETE", ed),
						MTGControler.getInstance().getLangService().get("DELETE"), JOptionPane.YES_NO_OPTION);
				if (res == JOptionPane.YES_OPTION) {
					provider.removeEdition(ed);
					try {
						editionModel.init(provider.loadEditions());
						editionModel.fireTableDataChanged();
					} catch (Exception ex) {
						MTGControler.getInstance().notify(ex);
					}
				}

			});

			cardsTable.addMouseListener(new MouseAdapter() {
				@Override
				public void mouseClicked(MouseEvent me) {

					if(UITools.getTableSelections(cardsTable, 1).isEmpty())
						return;

					MagicCard ed = UITools.getTableSelection(cardsTable, 0);
					if (me.getClickCount() == 2) {
						initCard(ed);
						tabbedPane.setSelectedIndex(1);
					}

				}
			});
			editionsTable.addMouseListener(new MouseAdapter() {
				@Override
				public void mouseClicked(MouseEvent me) {

					if(UITools.getTableSelections(editionsTable, 1).isEmpty())
						return;

					MagicEdition ed =UITools.getTableSelection(editionsTable, 1);
					try {
						initEdition(ed);
						cardsModel.init(provider.getCards(ed));
						cardsModel.fireTableDataChanged();
					} catch (IOException e) {
						MTGControler.getInstance().notify(e);
					}
				}
			});

			btnSaveCard.addActionListener(e -> {

				btnRefresh.doClick();

				MagicEdition me = (MagicEdition) cboSets.getSelectedItem();
				MagicCard mc = magicCardEditorPanel.getMagicCard();
				me.setNumber(mc.getNumber());
				me.setRarity(mc.getRarity());
				me.setArtist(mc.getArtist());
				me.setFlavor(mc.getFlavor());

				if (mc.getId() == null)
					mc.setId(DigestUtils.sha1Hex(me.getSet() + mc.getId() + mc.getName()));

				if ((mc.getCurrentSet()!=me))
					mc.getEditions().add(0, me);
				try {
					provider.addCard(me, mc);
					BufferedImage bi = new BufferedImage(panelPictures.getSize().width, 560,BufferedImage.TYPE_INT_ARGB);
					Graphics2D g = bi.createGraphics();
					panelPictures.paint(g);
					g.dispose();
					picturesProvider.savePicture(bi, mc, me);
				} catch (IOException ex) {
					MTGControler.getInstance().notify(ex);
				}
			});

			btnRefresh.addActionListener(e -> {
				try {
					BufferedImage img = MTGControler.getInstance().getEnabled(MTGPictureEditor.class).getPicture(magicCardEditorPanel.getMagicCard(),(MagicEdition) cboSets.getSelectedItem());

					if(img!=null)
					{
						cardImage = ImageTools.scaleResize(img,panelPictures.getWidth());
					}
					panelPictures.revalidate();
					panelPictures.repaint();
					jsonPanel.show(magicCardEditorPanel.getMagicCard());

				} catch (Exception ex) {
					logger.error("error painting",ex);
					MTGControler.getInstance().notify(ex);
				}

			});

		} catch (Exception e) {
			MTGControler.getInstance().notify(e);
		}
	}

	public CardBuilder2GUI() {
		try {
			//////////////////////////////////////////////////// INIT LOCAL COMPONENTS
			JPanel panelEditionHaut = new JPanel();
			JPanel panelSets = new JPanel();
			JButton btnSaveEdition = new JButton("");
			JButton btnNewSet = new JButton("");
			JButton btnRemoveEdition = new JButton("");
			JPanel buttonsForeignNamesPanel = new JPanel();
			JButton btnRemoveName = new JButton("Remove");
			JSplitPane splitcardEdPanel = new JSplitPane();
			JPanel panelCards = new JPanel();
			JPanel panelCardsHaut = new JPanel();
			JButton btnImport = new JButton(MTGConstants.ICON_IMPORT);
			JButton btnRefreshSet = new JButton(MTGConstants.ICON_REFRESH);

			JButton btnSaveCard = new JButton(MTGConstants.ICON_SAVE);
			JButton btnAddName = new JButton("add Languages");
			JTabbedPane tabbedResult = new JTabbedPane(JTabbedPane.TOP);
			JButton btnRemoveCard = new JButton("");
			JButton btnNewCard = new JButton("");
			JPanel panelBooster = new JPanel();
			JLabel lblCommon = new JLabel("Common :");
			JLabel lblUncommon = new JLabel("Uncommon :");
			JLabel lblRareMythic = new JLabel("Rare/Mythic :");

			JTabbedPane tabbedCards = new JTabbedPane(JTabbedPane.TOP);
			JPanel panelMisc = new JPanel();
			JPanel panelCardEditions = new JPanel();
			JPanel legalitiesPanel = new JPanel();
			legalitiesPanel.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0), 1, true), "",TitledBorder.LEADING, TitledBorder.TOP, null, null));

			JToggleButton tglStd = new JToggleButton("STD");
			JToggleButton tglMdn = new JToggleButton("MDN");
			JToggleButton tglVin = new JToggleButton("VIN");
			JToggleButton tglLeg = new JToggleButton("LEG");

			//////////////////////////////////////////////////// INIT GLOBAL COMPONENTS
			editionModel = new MagicEditionsTableModel();
			provider = new PrivateMTGSetProvider();
			provider.init();
			btnRefresh = new JButton("");
			picturesProvider = new PersonalSetPicturesProvider();
			spinCommon = new JSpinner();
			spinRare = new JSpinner();
			spinUnco = new JSpinner();
			cardsModel = new MagicCardTableModel();
			jsonPanel = new ObjectViewerPanel();
			jsonPanel.setMaximumSize(new Dimension(400, 10));
			editionsTable = new JXTable();
			cardsTable = new JXTable();
			tabbedPane = new JTabbedPane(JTabbedPane.TOP);
			cboSets = new JComboBox<>();
			namesModel = new MagicCardNamesTableModel();
			panelPictures = new JPanel() {
				private static final long serialVersionUID = 1L;
				@Override
				protected void paintComponent(Graphics g) {
					super.paintComponent(g);
					g.drawImage(cardImage, 0, 0, null);

					if (magicCardEditorPanel.getImagePanel().getCroppedImage() != null && MTGControler.getInstance().getEnabled(MTGPictureEditor.class).getMode()==MOD.LOCAL)
						g.drawImage(magicCardEditorPanel.getImagePanel().getCroppedImage(), 35, 68, 329, 242, null);

					revalidate();
				}
			};

			foreignNamesEditorPanel = new JPanel();
			listNames = new JXTable();
			magicCardEditorPanel = new MagicCardEditorPanel();
			magicEditionDetailPanel = new MagicEditionDetailPanel(false);

			//////////////////////////////////////////////////// MODELS INIT
			editionsTable.setModel(editionModel);
			cardsTable.setModel(cardsModel);
			listNames.setModel(namesModel);

			spinCommon.setModel(new SpinnerNumberModel(0, 0, null, 1));
			spinUnco.setModel(new SpinnerNumberModel(0, 0, null, 1));
			spinRare.setModel(new SpinnerNumberModel(0, 0, null, 1));

			List<MagicEdition> eds = provider.loadEditions();
			cboSets.setModel(new DefaultComboBoxModel<MagicEdition>(eds.toArray(new MagicEdition[eds.size()])));

			//////////////////////////////////////////////////// LAYOUT CONFIGURATION
			setLayout(new BorderLayout(0, 0));
			panelSets.setLayout(new BorderLayout(0, 0));
			panelCards.setLayout(new BorderLayout(0, 0));
			panelMisc.setLayout(new BorderLayout(0, 0));

			GridBagLayout gblPanelBooster = new GridBagLayout();
			gblPanelBooster.columnWidths = new int[] { 218, 218, 0 };
			gblPanelBooster.rowHeights = new int[] { 38, 41, 37, 0 };
			gblPanelBooster.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
			gblPanelBooster.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE };
			GridBagConstraints gbcLblCommon = UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 0, 0);
			GridBagConstraints gbcSpinCommon = UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 1, 0);
			GridBagConstraints gbcLblUncommon = UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 0, 1);
			GridBagConstraints gbcSpinUnco = UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 1, 1);
			GridBagConstraints gbcLblRareMythic = UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 0, 2);
			GridBagConstraints gbcSpinRare = UITools.createGridBagConstraints(null, GridBagConstraints.BOTH, 1, 2);

			GridBagLayout gridBagLayout = (GridBagLayout) magicCardEditorPanel.getLayout();
			gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0};
			gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 };
			gridBagLayout.columnWeights = new double[] { 0.0, 1.0, 0.0, 0.0 };

			panelBooster.setLayout(gblPanelBooster);
			splitcardEdPanel.setDividerLocation(0.5);
			splitcardEdPanel.setResizeWeight(0.5);

			//////////////////////////////////////////////////// PANEL ADDS
			add(tabbedPane);
			panelCards.add(panelCardsHaut, BorderLayout.NORTH);
			panelSets.add(panelEditionHaut, BorderLayout.NORTH);
			panelEditionHaut.add(btnNewSet);
			panelEditionHaut.add(btnSaveEdition);
			panelEditionHaut.add(btnRemoveEdition);
			panelSets.add(splitcardEdPanel, BorderLayout.CENTER);
			panelCardsHaut.add(cboSets);
			panelCardsHaut.add(btnNewCard);
			panelCardsHaut.add(btnImport);
			panelCardsHaut.add(btnSaveCard);
			panelCardsHaut.add(btnRefresh);
			panelCards.add(tabbedResult, BorderLayout.EAST);
			panelCardsHaut.add(btnRemoveCard);
			tabbedPane.addTab("Set", MTGConstants.ICON_BACK, panelSets, null);
			tabbedPane.addTab("Cards", MTGConstants.ICON_TAB_DECK, panelCards, null);
			tabbedResult.addTab("Pictures", MTGConstants.ICON_TAB_PICTURE, panelPictures, null);
			tabbedResult.addTab("Object",MTGConstants.ICON_TAB_JSON, jsonPanel,null);
			panelBooster.add(lblCommon, gbcLblCommon);
			panelBooster.add(spinCommon, gbcSpinCommon);
			panelBooster.add(lblUncommon, gbcLblUncommon);
			panelBooster.add(spinUnco, gbcSpinUnco);
			panelBooster.add(lblRareMythic, gbcLblRareMythic);
			panelBooster.add(spinRare, gbcSpinRare);
			panelCards.add(tabbedCards, BorderLayout.CENTER);
			tabbedCards.addTab("Details", MTGConstants.ICON_TAB_DETAILS, magicCardEditorPanel, null);
			tabbedCards.addTab("Editions", MTGConstants.ICON_BACK, panelCardEditions, null);
			tabbedCards.addTab("Misc", MTGConstants.ICON_TAB_ADMIN, panelMisc, null);
			panelMisc.add(legalitiesPanel, BorderLayout.SOUTH);
			legalitiesPanel.add(tglStd);
			legalitiesPanel.add(tglMdn);
			legalitiesPanel.add(tglLeg);
			legalitiesPanel.add(tglVin);
			splitcardEdPanel.setLeftComponent(new JScrollPane(editionsTable));

			splitcardEdPanel.setRightComponent( new JScrollPane(cardsTable));
			panelSets.add(magicEditionDetailPanel, BorderLayout.EAST);
			panelMisc.add(foreignNamesEditorPanel);
			foreignNamesEditorPanel.setLayout(new BorderLayout(0, 0));
			foreignNamesEditorPanel.add(new JScrollPane(listNames), BorderLayout.CENTER);
			foreignNamesEditorPanel.add(buttonsForeignNamesPanel, BorderLayout.NORTH);
			buttonsForeignNamesPanel.add(btnAddName);
			buttonsForeignNamesPanel.add(btnRemoveName);

			//////////////////////////////////////////////////// COMPONENT CONFIG
			editionModel.init(provider.loadEditions());
			editionModel.fireTableDataChanged();
			splitcardEdPanel.setOrientation(JSplitPane.VERTICAL_SPLIT);

			btnSaveEdition.setIcon(MTGConstants.ICON_SAVE);
			btnNewSet.setIcon(MTGConstants.ICON_NEW);
			btnRemoveEdition.setIcon(MTGConstants.ICON_DELETE);

			btnSaveEdition.setToolTipText("Save the set");
			btnNewSet.setToolTipText("New set");
			btnRemoveEdition.setToolTipText("Delete Set");

			panelEditionHaut.add(btnRefreshSet);
			btnImport.setToolTipText("Import existing card");
			btnSaveCard.setToolTipText("Save the card");
			btnRefresh.setToolTipText("Refresh");
			btnNewCard.setToolTipText("New Card");
			btnRemoveCard.setToolTipText("Delete the card");

			magicEditionDetailPanel.setEditable(true);

			btnRefresh.setIcon(MTGConstants.ICON_REFRESH);
			btnRemoveCard.setIcon(MTGConstants.ICON_DELETE);
			btnNewCard.setIcon(MTGConstants.ICON_NEW);
			cardsTable.getColumnModel().getColumn(2).setCellRenderer(new ManaCellRenderer());
			panelPictures.setBackground(Color.WHITE);
			panelPictures.setPreferredSize(new Dimension(400, 10));
			listNames.getColumnModel().getColumn(0).setCellEditor(new MagicCardNameEditor());
			buttonsForeignNamesPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));

			//////////////////////////////////////////////////// ACTION LISTENER

			magicCardEditorPanel.getSizeSpinner().addChangeListener(ce->MTGControler.getInstance().getEnabled(MTGPictureEditor.class).setTextSize((Integer)magicCardEditorPanel.getSizeSpinner().getValue()));
			magicCardEditorPanel.getColorIndicatorJCheckBox().addActionListener(ae->MTGControler.getInstance().getEnabled(MTGPictureEditor.class).setColorIndicator(magicCardEditorPanel.getColorIndicatorJCheckBox().isSelected()));
			magicCardEditorPanel.getChboxFoil().addActionListener(ae->MTGControler.getInstance().getEnabled(MTGPictureEditor.class).setFoil(magicCardEditorPanel.getChboxFoil().isSelected()));
			magicCardEditorPanel.getCboColorAccent().addItemListener(ie-> MTGControler.getInstance().getEnabled(MTGPictureEditor.class).setColorAccentuation(magicCardEditorPanel.getCboColorAccent().getSelectedItem().toString()));

			btnRefreshSet.addActionListener(e->{

				MagicEdition ed = (MagicEdition) editionsTable.getValueAt(editionsTable.getSelectedRow(), 1);
				try {
					List<MagicCard> cards = provider.getCards(ed);
					ed.setCardCount(cards.size());

					cards.forEach(mc->mc.getCurrentSet().setNumber(null));
					Collections.sort(cards,new CardsEditionSorter());
					for(int i=0;i<cards.size();i++)
						{
							cards.get(i).setNumber(String.valueOf((i+1)));
							cards.get(i).getCurrentSet().setNumber(String.valueOf((i+1)));
						}
					provider.saveEdition(ed,cards);

				} catch (IOException e1) {
					logger.error(e1);
				}

			});

			btnRemoveName.addActionListener(e -> {
				int row = listNames.getSelectedRow();
				namesModel.removeRow(row);
				namesModel.fireTableDataChanged();
			});

			btnAddName.addActionListener(e -> {

				MagicCardNames name = new MagicCardNames();
				name.setLanguage("");
				name.setName("");
				magicCardEditorPanel.getMagicCard().getForeignNames().add(name);
				namesModel.init(magicCardEditorPanel.getMagicCard());
			});

			btnNewCard.addActionListener(e -> {
				MagicCard mc = new MagicCard();
				try {
					mc.setNumber(
							String.valueOf(provider.getCards((MagicEdition) cboSets.getSelectedItem()).size() + 1));
					logger.debug("create new card for " + cboSets.getSelectedItem() + " num = " + mc.getNumber());
				} catch (IOException e1) {
					logger.error(e1);
				}
				initCard(mc);
			});

			btnRemoveCard.addActionListener(e -> {
				try {
					int res = JOptionPane.showConfirmDialog(null, MTGControler.getInstance().getLangService().get("CONFIRM_DELETE", magicCardEditorPanel.getMagicCard()));
					if (res == JOptionPane.YES_OPTION) {
						provider.removeCard((MagicEdition) cboSets.getSelectedItem(),
								magicCardEditorPanel.getMagicCard());
						picturesProvider.removePicture((MagicEdition) cboSets.getSelectedItem(),
								magicCardEditorPanel.getMagicCard());
						initCard(new MagicCard());
					}
				} catch (IOException ex) {
					MTGControler.getInstance().notify(ex);
				}
			});

			btnSaveEdition.addActionListener(e -> {
				try {
					MagicEdition ed = magicEditionDetailPanel.getMagicEdition();
					List<Object> boos = new ArrayList<>();
					for (int i = 0; i < (Integer) spinCommon.getValue(); i++)
						boos.add("common");
					for (int i = 0; i < (Integer) spinUnco.getValue(); i++)
						boos.add("uncommon");
					for (int i = 0; i < (Integer) spinRare.getValue(); i++)
						boos.add(new String[] { "rare", "mythic rare" });

					ed.setBooster(boos);
					provider.saveEdition(ed);

					cboSets.removeAllItems();
					cboSets.setModel(new DefaultComboBoxModel<MagicEdition>(
							provider.loadEditions().toArray(new MagicEdition[provider.loadEditions().size()])));

					editionModel.init(provider.loadEditions());
					editionModel.fireTableDataChanged();
				} catch (Exception ex) {
					MTGControler.getInstance().notify(ex);
				}
			});

			btnImport.addActionListener(e -> {
				CardSearchImportDialog l = new CardSearchImportDialog();
				l.setVisible(true);
				if (l.getSelected() != null)
					initCard(l.getSelected());

			});

			btnNewSet.addActionListener(e -> magicEditionDetailPanel.setMagicEdition(new MagicEdition(), true));

			btnRemoveEdition.addActionListener(e -> {

				int viewRow = editionsTable.getSelectedRow();
				int modelRow = editionsTable.convertRowIndexToModel(viewRow);
				MagicEdition ed = (MagicEdition) editionsTable.getModel().getValueAt(modelRow, 1);

				int res = JOptionPane.showConfirmDialog(null,
						MTGControler.getInstance().getLangService().get("CONFIRM_DELETE", ed),
						MTGControler.getInstance().getLangService().get("DELETE"), JOptionPane.YES_NO_OPTION);
				if (res == JOptionPane.YES_OPTION) {
					provider.removeEdition(ed);
					try {
						editionModel.init(provider.loadEditions());
						editionModel.fireTableDataChanged();
					} catch (Exception ex) {
						MTGControler.getInstance().notify(ex);
					}
				}

			});

			cardsTable.addMouseListener(new MouseAdapter() {
				@Override
				public void mouseClicked(MouseEvent me) {

					if(UITools.getTableSelections(cardsTable, 1).isEmpty())
						return;

					MagicCard ed = UITools.getTableSelection(cardsTable, 0);
					if (me.getClickCount() == 2) {
						initCard(ed);
						tabbedPane.setSelectedIndex(1);
					}

				}
			});
			editionsTable.addMouseListener(new MouseAdapter() {
				@Override
				public void mouseClicked(MouseEvent me) {

					if(UITools.getTableSelections(editionsTable, 1).isEmpty())
						return;

					MagicEdition ed =UITools.getTableSelection(editionsTable, 1);
					try {
						initEdition(ed);
						cardsModel.init(provider.getCards(ed));
						cardsModel.fireTableDataChanged();
					} catch (IOException e) {
						MTGControler.getInstance().notify(e);
					}
				}
			});

			btnSaveCard.addActionListener(e -> {

				btnRefresh.doClick();

				MagicEdition me = (MagicEdition) cboSets.getSelectedItem();
				MagicCard mc = magicCardEditorPanel.getMagicCard();
				me.setNumber(mc.getNumber());
				me.setRarity(mc.getRarity());
				me.setArtist(mc.getArtist());
				me.setFlavor(mc.getFlavor());

				if (mc.getId() == null)
					mc.setId(DigestUtils.sha1Hex(me.getSet() + mc.getId() + mc.getName()));

				if ((mc.getCurrentSet()!=me))
					mc.getEditions().add(0, me);
				try {
					provider.addCard(me, mc);
					BufferedImage bi = new BufferedImage(panelPictures.getSize().width, 560,BufferedImage.TYPE_INT_ARGB);
					Graphics2D g = bi.createGraphics();
					panelPictures.paint(g);
					g.dispose();
					picturesProvider.savePicture(bi, mc, me);
				} catch (IOException ex) {
					MTGControler.getInstance().notify(ex);
				}
			});

			btnRefresh.addActionListener(e -> {
				try {
					BufferedImage img = MTGControler.getInstance().getEnabled(MTGPictureEditor.class).getPicture(magicCardEditorPanel.getMagicCard(),(MagicEdition) cboSets.getSelectedItem());

					if(img!=null)
					{
						cardImage = ImageTools.scaleResize(img,panelPictures.getWidth());
					}
					panelPictures.revalidate();
					panelPictures.repaint();
					jsonPanel.show(magicCardEditorPanel.getMagicCard());

				} catch (Exception ex) {
					logger.error("error painting",ex);
					MTGControler.getInstance().notify(ex);
				}

			});

		} catch (Exception e) {
			MTGControler.getInstance().notify(e);
		}
	}

Replace Generic With Diamond DefaultComboBoxModel<MagicEdition> with DefaultComboBoxModel<> in method public CardBuilder2GUI() from class org.magic.gui.CardBuilder2GUI


	private void initActions()
	{

		btnRefresh.addActionListener(e -> {

		progressBar.start();

		SwingWorker<Void, Void> sw = new SwingWorker<>()
		{
			@Override
			protected void process(List<Void> chunks) {
				progressBar.progress();
			}

			 protected Void doInBackground() {
					try {
						model.calculate();
					} catch (Exception ex) {
						logger.error(ex);
					}
				 return null;
			 }

			 @Override
			protected void done() {
				lblTotal.setText("Total : " + model.getCountDefaultLibrary() + "/" + model.getCountTotal());
				model.fireTableDataChanged();
				tree.refresh();
				progressBar.end();
			}
		};

		ThreadManager.getInstance().runInEdt(sw,"calculate collection");
		});

		btnExport.addActionListener(ae -> {
			JPopupMenu menu = new JPopupMenu();

			for (final MTGCardsExport exp : MTGControler.getInstance().listEnabled(MTGCardsExport.class))
			{
				if (exp.getMods() == MODS.BOTH || exp.getMods() == MODS.EXPORT) {
					JMenuItem it = new JMenuItem();
					it.setIcon(exp.getIcon());
					it.setText(exp.getName());
					it.addActionListener(al -> {

								DefaultMutableTreeNode curr = (DefaultMutableTreeNode) path.getLastPathComponent();
								JFileChooser jf = new JFileChooser();

								MagicCollection mc = null;
								MagicEdition ed = null;

								if (curr.getUserObject() instanceof MagicEdition) {
									ed = (MagicEdition) curr.getUserObject();
									mc = (MagicCollection) ((DefaultMutableTreeNode) curr.getParent()).getUserObject();
								} else {
									mc = (MagicCollection) curr.getUserObject();
								}

								jf.setSelectedFile(new File(mc.getName() + exp.getFileExtension()));
								int result = jf.showSaveDialog(null);
								File f = jf.getSelectedFile();

								if (result == JFileChooser.APPROVE_OPTION) {
									try {
										if (ed == null)
											listExport= dao.listCardsFromCollection(mc);
										else
											listExport= dao.listCardsFromCollection(mc, ed);

									AbstractObservableWorker<Void, MagicCard, MTGCardsExport> swExp = new AbstractObservableWorker<>(progressBar,exp,listExport.size()){

										@Override
										protected Void doInBackground() throws Exception {
											plug.export(listExport, f);
											return null;
										}

										@Override
										protected void notifyEnd() {
											MTGControler.getInstance().notify(new MTGNotification(
													MTGControler.getInstance().getLangService().getCapitalize("FINISHED"),
													MTGControler.getInstance().getLangService().combine("EXPORT", "FINISHED"),
													MESSAGE_TYPE.INFO
													));
										}

										@Override
										protected void error(Exception e) {
											MTGControler.getInstance().notify(e);
										}
									};
									ThreadManager.getInstance().runInEdt(swExp,"export collection");

									}
									catch(Exception e)
									{
										MTGControler.getInstance().notify(e);
									}

								}

					});
					menu.add(it);
				}

			}

			Component b = (Component) ae.getSource();
			Point p = b.getLocationOnScreen();
			menu.show(b, 0, 0);
			menu.setLocation(p.x, p.y + b.getHeight());

		});

		splitPane.addComponentListener(new ComponentAdapter() {

			@Override
			public void componentShown(ComponentEvent componentEvent) {
				splitPane.setDividerLocation(.5);
				removeComponentListener(this);
			}
		});

		tree.addTreeSelectionListener(tse -> {
			path = tse.getPath();
			btnRemove.setEnabled(true);
			btnAddAllSet.setEnabled(false);
			btnExport.setEnabled(true);
			final DefaultMutableTreeNode curr = (DefaultMutableTreeNode) path.getLastPathComponent();

			if (curr.getUserObject() instanceof String) {
				btnExport.setEnabled(false);
				statsPanel.enabledAdd(false);
			}

			if (curr.getUserObject() instanceof MagicCollection) {
				selectedcol = (MagicCollection) curr.getUserObject();
				statsPanel.enabledAdd(false);
				ThreadManager.getInstance().executeThread(() -> {
					try {

						List<MagicCard> list = dao.listCardsFromCollection(selectedcol);
						rarityRepartitionPanel.init(list);
						typeRepartitionPanel.init(list);
						manaRepartitionPanel.init(list);
						jsonPanel.show(curr.getUserObject());

					} catch (Exception e) {
						logger.error("error",e);
					}
				}, "Calculate Collection cards");

			}

			if (curr.getUserObject() instanceof MagicEdition) {
				magicEditionDetailPanel.setMagicEdition((MagicEdition) curr.getUserObject());
				packagePanel.setMagicEdition((MagicEdition) curr.getUserObject());
				statsPanel.enabledAdd(false);
				ThreadManager.getInstance().executeThread(() -> {
					try {

						MagicCollection collec = (MagicCollection) ((DefaultMutableTreeNode) curr.getParent()).getUserObject();
						List<MagicCard> list = dao.listCardsFromCollection(collec, (MagicEdition) curr.getUserObject());
						rarityRepartitionPanel.init(list);
						typeRepartitionPanel.init(list);
						manaRepartitionPanel.init(list);
						historyPricesPanel.init(null, (MagicEdition) curr.getUserObject(),curr.getUserObject().toString());
						jsonPanel.show(curr.getUserObject());

					} catch (Exception e) {
						logger.error("error refresh " + curr.getUserObject() +":"+e.getLocalizedMessage());
					}
				}, "Calculate Editions cards");
			}

			if (curr.getUserObject() instanceof MagicCard) {
				final MagicCard card = (MagicCard) ((DefaultMutableTreeNode) path.getLastPathComponent()).getUserObject();
				try {
					initCardSelectionGui(card,(MagicCollection) ((DefaultMutableTreeNode) curr.getParent().getParent()).getUserObject());
				}catch(Exception e)
				{
					logger.error("error updating " + card + " in " + curr.getParent());
				}
			}
		});

		cardsSetPanel.getTable().getSelectionModel().addListSelectionListener(me-> {

			if(!me.getValueIsAdjusting() && cardsSetPanel.getSelectedCard()!=null) {
					cardsSetPanel.enabledImport(true);
					initCardSelectionGui(cardsSetPanel.getSelectedCard(),null);
			}
		});

		tree.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {

				if (SwingUtilities.isRightMouseButton(e)) {
					int row = tree.getClosestRowForLocation(e.getX(), e.getY());
					tree.setSelectionRow(row);

					final DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();

					if (node.getUserObject() instanceof MagicEdition) {
						popupMenuEdition.show(e.getComponent(), e.getX(), e.getY());

					}
					if (node.getUserObject() instanceof MagicCard) {
						popupMenuCards.show(e.getComponent(), e.getX(), e.getY());
					}
					if (node.getUserObject() instanceof MagicCollection) {
						JPopupMenu p = new JPopupMenu();
						JMenuItem it = new JMenuItem(MTGControler.getInstance().getLangService().getCapitalize("MASS_MOVEMENTS"),MTGConstants.ICON_COLLECTION);

						p.add(it);

						it.addActionListener(ae -> {
							MassMoverDialog d = new MassMoverDialog((MagicCollection) node.getUserObject(), null);
							d.setVisible(true);
							if(d.hasChange())
								tree.refresh(node);

							logger.trace("closing mass import with change =" + d.hasChange());
						});
						p.show(e.getComponent(), e.getX(), e.getY());
					}

				}
			}
		});

		btnMassCollection.addActionListener(ae -> {
			MassCollectionImporterDialog diag = new MassCollectionImporterDialog();

			if(magicEditionDetailPanel.getMagicEdition()!=null)
				diag.setDefaultEdition(magicEditionDetailPanel.getMagicEdition());

			diag.setVisible(true);
			try {
				model.calculate();
			} catch (Exception e) {
				logger.error(e);
			}
			model.fireTableDataChanged();
		});

		btnGenerateWebSite.addActionListener(ae -> ThreadManager.getInstance().invokeLater(() -> {
			try {

				WebSiteGeneratorDialog diag = new WebSiteGeneratorDialog(dao.listCollections());
				diag.setVisible(true);
				if (diag.value()) {
					int max = 0;
					for (MagicCollection col : diag.getSelectedCollections())
						max += dao.getCardsCount(col, null);

					progressBar.start(max);
					WebsiteExportWorker sw = new WebsiteExportWorker(diag.getTemplate(), diag.getDest(), diag.getSelectedCollections(), diag.getPriceProviders(), progressBar);
					ThreadManager.getInstance().runInEdt(sw,"website generation");
				}

			} catch (Exception e) {
				logger.error("error generating website", e);
				progressBar.end();
				MTGControler.getInstance().notify(e);
			}
		}));

	    btnAddAllSet.addActionListener(ae ->{
			JPopupMenu popupMenu = new JPopupMenu("Title");
			try {
					for(MagicCollection c : MTGControler.getInstance().getEnabled(MTGDao.class).listCollections())
					{
						JMenuItem cutMenuItem = new JMenuItem(c.getName(),MTGConstants.ICON_COLLECTION);
						initAddAllSet(cutMenuItem);
						popupMenu.add(cutMenuItem);
					}
				} catch (Exception e1) {
					logger.error(e1);
			}
			btnAddAllSet.setComponentPopupMenu(popupMenu);
	    	Component b=(Component)ae.getSource();
	    	Point p=b.getLocationOnScreen();
	    	popupMenu.show(this,0,0);
	    	popupMenu.setLocation(p.x,p.y+b.getHeight());
	    });

		tableEditions.getSelectionModel().addListSelectionListener(me-> {
			if(!me.getValueIsAdjusting()) {
		    	  try {
		    		 int row = tableEditions.getSelectedRow();
					MagicEdition ed = (MagicEdition) tableEditions.getValueAt(row, 1);
					magicEditionDetailPanel.setMagicEdition(ed);
					packagePanel.setMagicEdition(ed);
					historyPricesPanel.init(null, ed, ed.getSet());
					jsonPanel.show(ed);
					btnRemove.setEnabled(false);
					btnAddAllSet.setEnabled(true);
					btnExport.setEnabled(false);
					cardsSetPanel.init(ed);
					panneauTreeTable.setTitleAt(1, ed.getSet());
					panneauTreeTable.setSelectedIndex(1);
		    	  }
		    	  catch(Exception e)
		    	  {
		    		  progressBar.end();
		    	  }
			}
		});

		btnAdd.addActionListener(e -> {
			String name = JOptionPane
					.showInputDialog(MTGControler.getInstance().getLangService().getCapitalize("NAME") + " ?");
			MagicCollection collectionAdd = new MagicCollection(name);
			try {
				dao.saveCollection(collectionAdd);
				((LazyLoadingTree.MyNode) getJTree().getModel().getRoot()).add(new DefaultMutableTreeNode(collectionAdd));
				getJTree().refresh();
				initPopupCollection();
			} catch (Exception ex) {
				logger.error(ex);
				MTGControler.getInstance().notify(ex);
			}
		});

		btnRemove.addActionListener(evt -> {

			MagicCollection col = (MagicCollection) ((DefaultMutableTreeNode) path.getPathComponent(1)).getUserObject();
			int res = 0;

			DefaultMutableTreeNode curr = (DefaultMutableTreeNode) path.getLastPathComponent();
			if (curr.getUserObject() instanceof MagicCard) {
				MagicCard card = (MagicCard) ((DefaultMutableTreeNode) path.getLastPathComponent()).getUserObject();

				try {
					res = JOptionPane.showConfirmDialog(null, MTGControler.getInstance().getLangService().getCapitalize("CONFIRM_COLLECTION_ITEM_DELETE", card, col));
					if (res == JOptionPane.YES_OPTION) {
						MTGControler.getInstance().removeCard(card, col);
					}
				} catch (SQLException e) {
					MTGControler.getInstance().notify(e);
				}
			}
			if (curr.getUserObject() instanceof MagicEdition) {
				MagicEdition me = (MagicEdition) ((DefaultMutableTreeNode) path.getPathComponent(2)).getUserObject();

				try {
					res = JOptionPane.showConfirmDialog(null, MTGControler.getInstance().getLangService()
							.getCapitalize("CONFIRM_COLLECTION_ITEM_DELETE", me, col));
					if (res == JOptionPane.YES_OPTION) {
						dao.removeEdition(me, col);
					}
				} catch (SQLException e) {
					MTGControler.getInstance().notify(e);
				}
			}
			if (curr.getUserObject() instanceof MagicCollection) {
				try {
					res = JOptionPane.showConfirmDialog(null, MTGControler.getInstance().getLangService().getCapitalize("CONFIRM_COLLECTION_DELETE", col, dao.getCardsCount(col, null)));
					if (res == JOptionPane.YES_OPTION) {
						dao.removeCollection(col);
					}
				} catch (SQLException e) {
					MTGControler.getInstance().notify(e);
				}
			}

			if (res == JOptionPane.YES_OPTION) {
				try {
					tree.removeNodeFromParent(curr);
				} catch (Exception e) {
					MTGControler.getInstance().notify(e);
				}

			}
		});
	}

	private void initActions()
	{

		btnRefresh.addActionListener(e -> {

		progressBar.start();

		SwingWorker<Void, Void> sw = new SwingWorker<>()
		{
			@Override
			protected void process(List<Void> chunks) {
				progressBar.progress();
			}

			 protected Void doInBackground() {
					try {
						model.calculate();
					} catch (Exception ex) {
						logger.error(ex);
					}
				 return null;
			 }

			 @Override
			protected void done() {
				lblTotal.setText("Total : " + model.getCountDefaultLibrary() + "/" + model.getCountTotal());
				model.fireTableDataChanged();
				tree.refresh();
				progressBar.end();
			}
		};

		ThreadManager.getInstance().runInEdt(sw,"calculate collection");
		});

		btnExport.addActionListener(ae -> {
			JPopupMenu menu = new JPopupMenu();

			for (final MTGCardsExport exp : MTGControler.getInstance().listEnabled(MTGCardsExport.class))
			{
				if (exp.getMods() == MODS.BOTH || exp.getMods() == MODS.EXPORT) {
					JMenuItem it = new JMenuItem();
					it.setIcon(exp.getIcon());
					it.setText(exp.getName());
					it.addActionListener(al -> {

								DefaultMutableTreeNode curr = (DefaultMutableTreeNode) path.getLastPathComponent();
								JFileChooser jf = new JFileChooser();

								MagicCollection mc = null;
								MagicEdition ed = null;

								if (curr.getUserObject() instanceof MagicEdition) {
									ed = (MagicEdition) curr.getUserObject();
									mc = (MagicCollection) ((DefaultMutableTreeNode) curr.getParent()).getUserObject();
								} else {
									mc = (MagicCollection) curr.getUserObject();
								}

								jf.setSelectedFile(new File(mc.getName() + exp.getFileExtension()));
								int result = jf.showSaveDialog(null);
								File f = jf.getSelectedFile();

								if (result == JFileChooser.APPROVE_OPTION) {
									try {
										if (ed == null)
											listExport= dao.listCardsFromCollection(mc);
										else
											listExport= dao.listCardsFromCollection(mc, ed);

									AbstractObservableWorker<Void, MagicCard, MTGCardsExport> swExp = new AbstractObservableWorker<Void, MagicCard, MTGCardsExport>(progressBar,exp,listExport.size()){

										@Override
										protected Void doInBackground() throws Exception {
											plug.export(listExport, f);
											return null;
										}

										@Override
										protected void notifyEnd() {
											MTGControler.getInstance().notify(new MTGNotification(
													MTGControler.getInstance().getLangService().getCapitalize("FINISHED"),
													MTGControler.getInstance().getLangService().combine("EXPORT", "FINISHED"),
													MESSAGE_TYPE.INFO
													));
										}

										@Override
										protected void error(Exception e) {
											MTGControler.getInstance().notify(e);
										}
									};
									ThreadManager.getInstance().runInEdt(swExp,"export collection");

									}
									catch(Exception e)
									{
										MTGControler.getInstance().notify(e);
									}

								}

					});
					menu.add(it);
				}

			}

			Component b = (Component) ae.getSource();
			Point p = b.getLocationOnScreen();
			menu.show(b, 0, 0);
			menu.setLocation(p.x, p.y + b.getHeight());

		});

		splitPane.addComponentListener(new ComponentAdapter() {

			@Override
			public void componentShown(ComponentEvent componentEvent) {
				splitPane.setDividerLocation(.5);
				removeComponentListener(this);
			}
		});

		tree.addTreeSelectionListener(tse -> {
			path = tse.getPath();
			btnRemove.setEnabled(true);
			btnAddAllSet.setEnabled(false);
			btnExport.setEnabled(true);
			final DefaultMutableTreeNode curr = (DefaultMutableTreeNode) path.getLastPathComponent();

			if (curr.getUserObject() instanceof String) {
				btnExport.setEnabled(false);
				statsPanel.enabledAdd(false);
			}

			if (curr.getUserObject() instanceof MagicCollection) {
				selectedcol = (MagicCollection) curr.getUserObject();
				statsPanel.enabledAdd(false);
				ThreadManager.getInstance().executeThread(() -> {
					try {

						List<MagicCard> list = dao.listCardsFromCollection(selectedcol);
						rarityRepartitionPanel.init(list);
						typeRepartitionPanel.init(list);
						manaRepartitionPanel.init(list);
						jsonPanel.show(curr.getUserObject());

					} catch (Exception e) {
						logger.error("error",e);
					}
				}, "Calculate Collection cards");

			}

			if (curr.getUserObject() instanceof MagicEdition) {
				magicEditionDetailPanel.setMagicEdition((MagicEdition) curr.getUserObject());
				packagePanel.setMagicEdition((MagicEdition) curr.getUserObject());
				statsPanel.enabledAdd(false);
				ThreadManager.getInstance().executeThread(() -> {
					try {

						MagicCollection collec = (MagicCollection) ((DefaultMutableTreeNode) curr.getParent()).getUserObject();
						List<MagicCard> list = dao.listCardsFromCollection(collec, (MagicEdition) curr.getUserObject());
						rarityRepartitionPanel.init(list);
						typeRepartitionPanel.init(list);
						manaRepartitionPanel.init(list);
						historyPricesPanel.init(null, (MagicEdition) curr.getUserObject(),curr.getUserObject().toString());
						jsonPanel.show(curr.getUserObject());

					} catch (Exception e) {
						logger.error("error refresh " + curr.getUserObject() +":"+e.getLocalizedMessage());
					}
				}, "Calculate Editions cards");
			}

			if (curr.getUserObject() instanceof MagicCard) {
				final MagicCard card = (MagicCard) ((DefaultMutableTreeNode) path.getLastPathComponent()).getUserObject();
				try {
					initCardSelectionGui(card,(MagicCollection) ((DefaultMutableTreeNode) curr.getParent().getParent()).getUserObject());
				}catch(Exception e)
				{
					logger.error("error updating " + card + " in " + curr.getParent());
				}
			}
		});

		cardsSetPanel.getTable().getSelectionModel().addListSelectionListener(me-> {

			if(!me.getValueIsAdjusting() && cardsSetPanel.getSelectedCard()!=null) {
					cardsSetPanel.enabledImport(true);
					initCardSelectionGui(cardsSetPanel.getSelectedCard(),null);
			}
		});

		tree.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {

				if (SwingUtilities.isRightMouseButton(e)) {
					int row = tree.getClosestRowForLocation(e.getX(), e.getY());
					tree.setSelectionRow(row);

					final DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();

					if (node.getUserObject() instanceof MagicEdition) {
						popupMenuEdition.show(e.getComponent(), e.getX(), e.getY());

					}
					if (node.getUserObject() instanceof MagicCard) {
						popupMenuCards.show(e.getComponent(), e.getX(), e.getY());
					}
					if (node.getUserObject() instanceof MagicCollection) {
						JPopupMenu p = new JPopupMenu();
						JMenuItem it = new JMenuItem(MTGControler.getInstance().getLangService().getCapitalize("MASS_MOVEMENTS"),MTGConstants.ICON_COLLECTION);

						p.add(it);

						it.addActionListener(ae -> {
							MassMoverDialog d = new MassMoverDialog((MagicCollection) node.getUserObject(), null);
							d.setVisible(true);
							if(d.hasChange())
								tree.refresh(node);

							logger.trace("closing mass import with change =" + d.hasChange());
						});
						p.show(e.getComponent(), e.getX(), e.getY());
					}

				}
			}
		});

		btnMassCollection.addActionListener(ae -> {
			MassCollectionImporterDialog diag = new MassCollectionImporterDialog();

			if(magicEditionDetailPanel.getMagicEdition()!=null)
				diag.setDefaultEdition(magicEditionDetailPanel.getMagicEdition());

			diag.setVisible(true);
			try {
				model.calculate();
			} catch (Exception e) {
				logger.error(e);
			}
			model.fireTableDataChanged();
		});

		btnGenerateWebSite.addActionListener(ae -> ThreadManager.getInstance().invokeLater(() -> {
			try {

				WebSiteGeneratorDialog diag = new WebSiteGeneratorDialog(dao.listCollections());
				diag.setVisible(true);
				if (diag.value()) {
					int max = 0;
					for (MagicCollection col : diag.getSelectedCollections())
						max += dao.getCardsCount(col, null);

					progressBar.start(max);
					WebsiteExportWorker sw = new WebsiteExportWorker(diag.getTemplate(), diag.getDest(), diag.getSelectedCollections(), diag.getPriceProviders(), progressBar);
					ThreadManager.getInstance().runInEdt(sw,"website generation");
				}

			} catch (Exception e) {
				logger.error("error generating website", e);
				progressBar.end();
				MTGControler.getInstance().notify(e);
			}
		}));

	    btnAddAllSet.addActionListener(ae ->{
			JPopupMenu popupMenu = new JPopupMenu("Title");
			try {
					for(MagicCollection c : MTGControler.getInstance().getEnabled(MTGDao.class).listCollections())
					{
						JMenuItem cutMenuItem = new JMenuItem(c.getName(),MTGConstants.ICON_COLLECTION);
						initAddAllSet(cutMenuItem);
						popupMenu.add(cutMenuItem);
					}
				} catch (Exception e1) {
					logger.error(e1);
			}
			btnAddAllSet.setComponentPopupMenu(popupMenu);
	    	Component b=(Component)ae.getSource();
	    	Point p=b.getLocationOnScreen();
	    	popupMenu.show(this,0,0);
	    	popupMenu.setLocation(p.x,p.y+b.getHeight());
	    });

		tableEditions.getSelectionModel().addListSelectionListener(me-> {
			if(!me.getValueIsAdjusting()) {
		    	  try {
		    		 int row = tableEditions.getSelectedRow();
					MagicEdition ed = (MagicEdition) tableEditions.getValueAt(row, 1);
					magicEditionDetailPanel.setMagicEdition(ed);
					packagePanel.setMagicEdition(ed);
					historyPricesPanel.init(null, ed, ed.getSet());
					jsonPanel.show(ed);
					btnRemove.setEnabled(false);
					btnAddAllSet.setEnabled(true);
					btnExport.setEnabled(false);
					cardsSetPanel.init(ed);
					panneauTreeTable.setTitleAt(1, ed.getSet());
					panneauTreeTable.setSelectedIndex(1);
		    	  }
		    	  catch(Exception e)
		    	  {
		    		  progressBar.end();
		    	  }
			}
		});

		btnAdd.addActionListener(e -> {
			String name = JOptionPane
					.showInputDialog(MTGControler.getInstance().getLangService().getCapitalize("NAME") + " ?");
			MagicCollection collectionAdd = new MagicCollection(name);
			try {
				dao.saveCollection(collectionAdd);
				((LazyLoadingTree.MyNode) getJTree().getModel().getRoot()).add(new DefaultMutableTreeNode(collectionAdd));
				getJTree().refresh();
				initPopupCollection();
			} catch (Exception ex) {
				logger.error(ex);
				MTGControler.getInstance().notify(ex);
			}
		});

		btnRemove.addActionListener(evt -> {

			MagicCollection col = (MagicCollection) ((DefaultMutableTreeNode) path.getPathComponent(1)).getUserObject();
			int res = 0;

			DefaultMutableTreeNode curr = (DefaultMutableTreeNode) path.getLastPathComponent();
			if (curr.getUserObject() instanceof MagicCard) {
				MagicCard card = (MagicCard) ((DefaultMutableTreeNode) path.getLastPathComponent()).getUserObject();

				try {
					res = JOptionPane.showConfirmDialog(null, MTGControler.getInstance().getLangService().getCapitalize("CONFIRM_COLLECTION_ITEM_DELETE", card, col));
					if (res == JOptionPane.YES_OPTION) {
						MTGControler.getInstance().removeCard(card, col);
					}
				} catch (SQLException e) {
					MTGControler.getInstance().notify(e);
				}
			}
			if (curr.getUserObject() instanceof MagicEdition) {
				MagicEdition me = (MagicEdition) ((DefaultMutableTreeNode) path.getPathComponent(2)).getUserObject();

				try {
					res = JOptionPane.showConfirmDialog(null, MTGControler.getInstance().getLangService()
							.getCapitalize("CONFIRM_COLLECTION_ITEM_DELETE", me, col));
					if (res == JOptionPane.YES_OPTION) {
						dao.removeEdition(me, col);
					}
				} catch (SQLException e) {
					MTGControler.getInstance().notify(e);
				}
			}
			if (curr.getUserObject() instanceof MagicCollection) {
				try {
					res = JOptionPane.showConfirmDialog(null, MTGControler.getInstance().getLangService().getCapitalize("CONFIRM_COLLECTION_DELETE", col, dao.getCardsCount(col, null)));
					if (res == JOptionPane.YES_OPTION) {
						dao.removeCollection(col);
					}
				} catch (SQLException e) {
					MTGControler.getInstance().notify(e);
				}
			}

			if (res == JOptionPane.YES_OPTION) {
				try {
					tree.removeNodeFromParent(curr);
				} catch (Exception e) {
					MTGControler.getInstance().notify(e);
				}

			}
		});
	}

Replace Generic With Diamond AbstractObservableWorker<Void,MagicCard,MTGCardsExport> with AbstractObservableWorker<> in method private initActions() : void from class org.magic.gui.CollectionPanelGUI


	private void loadFinancialBook()
	{
		SwingWorker<List<OrderEntry>, OrderEntry> sw = new SwingWorker<>()
				{

					@Override
					protected List<OrderEntry> doInBackground() throws Exception {
						return MTGControler.getInstance().getEnabled(MTGDao.class).listOrders();
					}

					@Override
					protected void done() {
						try {
							model.addItems(get());
							calulate(model.getItems());
						} catch (Exception e) {
							logger.error(e);
						}
						table.packAll();
						UITools.initTableFilter(table);
					}

				};

			ThreadManager.getInstance().runInEdt(sw,"loading orders");
	}

	private void loadFinancialBook()
	{
		SwingWorker<List<OrderEntry>, OrderEntry> sw = new SwingWorker<List<OrderEntry>, OrderEntry>()
				{

					@Override
					protected List<OrderEntry> doInBackground() throws Exception {
						return MTGControler.getInstance().getEnabled(MTGDao.class).listOrders();
					}

					@Override
					protected void done() {
						try {
							model.addItems(get());
							calulate(model.getItems());
						} catch (Exception e) {
							logger.error(e);
						}
						table.packAll();
						UITools.initTableFilter(table);
					}

				};

			ThreadManager.getInstance().runInEdt(sw,"loading orders");
	}

Replace Generic With Diamond SwingWorker<List<OrderEntry>,OrderEntry> with SwingWorker<> in method private loadFinancialBook() : void from class org.magic.gui.OrdersGUI