本文整理了Java中javax.swing.JLayeredPane.removeAll()
方法的一些代码示例,展示了JLayeredPane.removeAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JLayeredPane.removeAll()
方法的具体详情如下:
包路径:javax.swing.JLayeredPane
类名称:JLayeredPane
方法名:removeAll
暂无
代码示例来源:origin: magefree/mage
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;
}
代码示例来源:origin: magefree/mage
public void loadCardsNarrow(CardsView showCards, BigCard bigCard, UUID gameId) {
this.reloaded = true;
cardArea.removeAll();
yCardCaptionOffsetPercent = 0; // TODO: need to test
loadCardsMany(showCards, bigCard, gameId);
cardArea.revalidate();
this.revalidate();
this.repaint();
}
代码示例来源:origin: magefree/mage
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();
}
代码示例来源:origin: magefree/mage
public void loadCards(CardsView showCards, BigCard bigCard, UUID gameId) {
this.reloaded = true;
cardArea.removeAll();
if (showCards != null && showCards.size() < 10) {
yCardCaptionOffsetPercent = 8; // TODO: need to test
loadCardsFew(showCards, bigCard, gameId);
} else {
yCardCaptionOffsetPercent = 0;
loadCardsMany(showCards, bigCard, gameId);
}
cardArea.revalidate();
this.revalidate();
this.repaint();
}
代码示例来源:origin: magefree/mage
cardArea.removeAll();
this.bigCard = null;
代码示例来源:origin: org.cytoscape/swing-application-impl
private void disposeFrame(final JInternalFrame frame) throws PropertyVetoException {
if (!SwingUtilities.isEventDispatchThread()) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
try {
disposeFrame(frame);
} catch (PropertyVetoException e) {
logger.error("Network View unable to be killed", e);
}
}
});
return;
}
frame.getRootPane().getLayeredPane().removeAll();
frame.getRootPane().getContentPane().removeAll();
frame.setClosed(true);
frame.removeInternalFrameListener(this);
InternalFrameListener frameListener = frameListeners.remove(frame);
if (frameListener != null)
frame.removeInternalFrameListener(frameListener);
frame.dispose();
}
代码示例来源:origin: openstreetmap/osmembrane
layeredPane.removeAll();
System.gc();
内容来源于网络,如有侵权,请联系作者删除!