javax.swing.JLayeredPane.repaint()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中javax.swing.JLayeredPane.repaint()方法的一些代码示例,展示了JLayeredPane.repaint()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JLayeredPane.repaint()方法的具体详情如下:
包路径:javax.swing.JLayeredPane
类名称:JLayeredPane
方法名:repaint

JLayeredPane.repaint介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

public void changeGUISize() {
  layoutGrid();
  cardScroll.getVerticalScrollBar().setUnitIncrement(CardRenderer.getCardTopHeight(getCardWidth()));
  cardContent.repaint();
}

代码示例来源:origin: magefree/mage

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();
}

代码示例来源: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

cardContent.repaint();

代码示例来源:origin: magefree/mage

cardContent.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

jLayeredPane.repaint();

代码示例来源:origin: magefree/mage

jLayeredPane.repaint();

代码示例来源:origin: org.fosstrak.hal/hal-impl-sim

/**
 * 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();
}

代码示例来源:origin: org.fosstrak.hal/hal-impl-sim

/**
 * 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();
}

代码示例来源:origin: omegat-org/omegat

private void restore() {
    layeredPane.remove(panel);
    layeredPane.repaint();
  }
});

代码示例来源:origin: omegat-org/omegat

@Override
  public void mouseExited(MouseEvent e) {
    layeredPane.remove(panel);
    layeredPane.repaint();
  }
});

代码示例来源:origin: JChemPaint/jchempaint

public void actionPerformed(ActionEvent e)
  {
    layeredPane.remove(panel);
    panel = CreateLabelProperties(null);
    layeredPane.add(panel, new Integer(1));
    layeredPane.repaint();
  }
}

代码示例来源:origin: org.geotools/gt-widgets-swing-pending

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();
  }
}

代码示例来源:origin: org.geotools/gt-widgets-swing-pending

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();
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

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();
  }
}

代码示例来源:origin: org.geotools/gt-widgets-swing-pending

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();
  }
}

代码示例来源:origin: org.geotools/gt-widgets-swing-pending

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();
}

代码示例来源:origin: org.geotools/gt-widgets-swing-pending

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();
}

代码示例来源:origin: JChemPaint/jchempaint

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);
}

相关文章