public void changeGUISize() { layoutGrid(); cardScroll.getVerticalScrollBar().setUnitIncrement(CardRenderer.getCardTopHeight(getCardWidth())); cardContent.repaint(); }
public void removeSelection() { for (ArrayList<ArrayList<CardView>> gridRow : cardGrid) { for (ArrayList<CardView> stack : gridRow) { for (int i = 0; i < stack.size(); ++i) { CardView card = stack.get(i); if (card.isSelected()) { eventSource.fireEvent(card, ClientEventType.REMOVE_SPECIFIC_CARD); stack.set(i, null); removeCardView(card); } } } } trimGrid(); layoutGrid(); cardContent.repaint(); }
public int showTokens() { jLayeredPane.removeAll(); List<Token> tokens = getTokens(currentPage, currentSet); if (tokens != null && tokens.size() > 0) { int size = tokens.size(); Rectangle rectangle = new Rectangle(); rectangle.translate(OFFSET_X, OFFSET_Y); for (int i = 0; i < min(conf.CARDS_PER_PAGE / 2, size); i++) { Token token = tokens.get(i); addToken(token, bigCard, null, rectangle); rectangle = CardPosition.translatePosition(i, rectangle, conf); } // calculate the x offset of the second (right) page int second_page_x = (conf.WIDTH - 2 * LEFT_RIGHT_PAGES_WIDTH) - (cardDimensions.frameWidth + CardPosition.GAP_X) * conf.CARD_COLUMNS + CardPosition.GAP_X - OFFSET_X; rectangle.setLocation(second_page_x, OFFSET_Y); for (int i = conf.CARDS_PER_PAGE / 2; i < min(conf.CARDS_PER_PAGE, size); i++) { Token token = tokens.get(i); addToken(token, bigCard, null, rectangle); rectangle = CardPosition.translatePosition(i - conf.CARDS_PER_PAGE / 2, rectangle, conf); } jLayeredPane.repaint(); return tokens.size(); } return 0; }
cardContent.repaint();
cardContent.repaint();
public void showCards() { jLayeredPane.removeAll(); // stats info updateCardStats(currentSet, true); List<CardInfo> cards = getCards(currentPage, currentSet); int size = cards.size(); Rectangle rectangle = new Rectangle(); rectangle.translate(OFFSET_X, OFFSET_Y); for (int i = 0; i < min(conf.CARDS_PER_PAGE / 2, size); i++) { Card card = cards.get(i).getMockCard(); addCard(new CardView(card), bigCard, null, rectangle); rectangle = CardPosition.translatePosition(i, rectangle, conf); } // calculate the x offset of the second (right) page int second_page_x = (conf.WIDTH - 2 * LEFT_RIGHT_PAGES_WIDTH) - (cardDimensions.frameWidth + CardPosition.GAP_X) * conf.CARD_COLUMNS + CardPosition.GAP_X - OFFSET_X; rectangle.setLocation(second_page_x, OFFSET_Y); for (int i = conf.CARDS_PER_PAGE / 2; i < min(conf.CARDS_PER_PAGE, size); i++) { Card card = cards.get(i).getMockCard(); addCard(new CardView(card), bigCard, null, rectangle); rectangle = CardPosition.translatePosition(i - conf.CARDS_PER_PAGE / 2, rectangle, conf); } jLayeredPane.repaint(); }
jLayeredPane.repaint();
jLayeredPane.repaint();
/** * removes the tag from the layered pane * * @param tag which will be removed */ public void removeTag(Tag tag) { tags.remove(tag); jLayeredPane.remove(tag); jLayeredPane.repaint(); }
/** * removes the tag from the layered pane * * @param tag which will be removed */ public void removeTag(Tag tag) { tags.remove(tag); jLayeredPane.remove(tag); jLayeredPane.repaint(); }
private void restore() { layeredPane.remove(panel); layeredPane.repaint(); } });
@Override public void mouseExited(MouseEvent e) { layeredPane.remove(panel); layeredPane.repaint(); } });
public void actionPerformed(ActionEvent e) { layeredPane.remove(panel); panel = CreateLabelProperties(null); layeredPane.add(panel, new Integer(1)); layeredPane.repaint(); } }
public void addDecoration(MapDecoration deco) { if (deco != null && !userDecorations.contains(deco)) { deco.setMap2D(THIS_MAP); userDecorations.add(deco); userDecorationPane.add(deco.geComponent(), new Integer(userDecorations.indexOf(deco))); userDecorationPane.revalidate(); userDecorationPane.repaint(); } }
public void addDecoration(int index, MapDecoration deco) { if (deco != null && !userDecorations.contains(deco)) { deco.setMap2D(THIS_MAP); userDecorations.add(index, deco); userDecorationPane.add(deco.geComponent(), new Integer(userDecorations.indexOf(deco))); userDecorationPane.revalidate(); userDecorationPane.repaint(); } }
public void focusGained(FocusEvent e) { //it will be the first focus gained event, so go select //whatever matches the first character processSearchText(((JTextField) e.getSource()).getText()); JRootPane root = getRootPane(); if (root != null) { // #57417 NPE root.getLayeredPane().repaint(); } }
public void removeDecoration(MapDecoration deco) { if (deco != null && userDecorations.contains(deco)) { deco.setMap2D(null); deco.dispose(); userDecorations.remove(deco); userDecorationPane.remove(deco.geComponent()); userDecorationPane.revalidate(); userDecorationPane.repaint(); } }
public void setInformationDecoration(InformationDecoration info) { if (info == null) { throw new NullPointerException("info decoration can't be null"); } mainDecorationPane.remove(informationDecoration.geComponent()); informationDecoration = info; mainDecorationPane.add(informationDecoration.geComponent(), new Integer(3)); mainDecorationPane.revalidate(); mainDecorationPane.repaint(); }
public void setBackgroundDecoration(MapDecoration back) { if (back == null) { throw new NullPointerException("background decoration can't be null"); } mainDecorationPane.remove(backDecoration.geComponent()); backDecoration = back; mainDecorationPane.add(backDecoration.geComponent(), new Integer(0)); mainDecorationPane.revalidate(); mainDecorationPane.repaint(); }
public void mouseEntered(MouseEvent e) { ElementButton button = (ElementButton) e.getSource(); setSelectedElement(button.getElement()); layeredPane.remove(panel); panel = CreateLabelProperties(button.getElement()); layeredPane.add(panel, new Integer(1)); layeredPane.repaint(); button.setBackground(Color.LIGHT_GRAY); }