public void changeGUISize() { setGUISize(); for (Component component : cardArea.getComponents()) { if (component instanceof CardPanel) { component.setBounds(0, 0, cardDimension.width, cardDimension.height); } } }
public void cleanUp() { for (Component c : this.jPanel.getComponents()) { if (c instanceof Permanent || c instanceof MagePermanent) { this.jPanel.remove(c); } } permanents.clear(); // Plugins.getInstance().sortPermanents(uiComponentsList, permanents.values()); this.bigCard = null; }
public void setPopupMenu(JPopupMenu popupMenu) { for (Component component : cardArea.getComponents()) { if (component instanceof MageCard) { MageCard mageCard = (MageCard) component; mageCard.setPopupMenu(popupMenu); } } }
public void cleanUp() { for (Component comp : cardArea.getComponents()) { if (comp instanceof CardPanel) { ((CardPanel) comp).cleanUp(); cardArea.remove(comp); } } }
public void selectCards(List<UUID> selected) { for (Component component : cardArea.getComponents()) { if (component instanceof MageCard) { MageCard mageCard = (MageCard) component; if (selected.contains(mageCard.getOriginal().getId())) { mageCard.setSelected(true); } } } }
public void markCards(List<UUID> marked) { for (Component component : cardArea.getComponents()) { if (component instanceof MageCard) { MageCard mageCard = (MageCard) component; if (marked.contains(mageCard.getOriginal().getId())) { mageCard.setChoosable(true); } } } }
private void removePermanent(UUID permanentId, final int count) { for (Component c : this.jPanel.getComponents()) { final Component comp = c; if (comp instanceof Permanent) { if (((Permanent) comp).getPermanentId().equals(permanentId)) { comp.setVisible(false); this.jPanel.remove(comp); } } else if (comp instanceof MagePermanent) { if (((MagePermanent) comp).getOriginal().getId().equals(permanentId)) { Thread t = new Thread(() -> { Plugins.instance.onRemoveCard((MagePermanent) comp, count); comp.setVisible(false); BattlefieldPanel.this.jPanel.remove(comp); }); t.start(); } if (((MagePermanent) comp).getOriginal().isCreature()) { removedCreature = true; } } } }
currentView.clearCardEventListeners(); for (Component comp : cardArea.getComponents()) { if (comp instanceof CardPanel) { ((CardPanel) comp).cleanUp();
private void rebound() { for (Component c : layers.getComponents()) { c.setBounds(layers.getBounds()); } this.updateUI(); }
/** * internal method to remove a layerpanel. Only call from the AWT thread. * * @param layerPanel */ private void internalRemoveLayerPanel(final LayerPanel layerPanel) { if (this.layerPanels.contains(layerPanel)) { this.layerPanels.remove(layerPanel); } for (Component c : layerPanelContainer.getComponents()) { if (c.equals(layerPanel)) { layerPanelContainer.remove(layerPanel); } } mouseHandler.removeMapMouseListener(layerPanel); getMapViewer().repaint(); }
Component[] components = layeredPane.getComponents();
for( Component cLayerPanel : cLayerPanels.getComponents() )