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

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

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

JLayeredPane.setPreferredSize介绍

暂无

代码示例

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

private void loadCardsFew(CardsView showCards, BigCard bigCard, UUID gameId) {
  Rectangle rectangle = new Rectangle(cardDimension.width, cardDimension.height);
  for (CardView card : showCards.values()) {
    addCard(card, bigCard, gameId, rectangle);
    rectangle.translate(cardDimension.width, 0);
  }
  cardArea.setPreferredSize(new Dimension(cardDimension.width * showCards.size(), cardDimension.height));
}

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

cardContent.setPreferredSize(new Dimension(maxWidth, currentY - COUNT_LABEL_HEIGHT + GRID_PADDING));

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

private void loadCardsMany(CardsView showCards, BigCard bigCard, UUID gameId) {
  int rowsOfCards = 20;
  int columns = 1;
  if (showCards != null && !showCards.isEmpty()) {
    Rectangle rectangle = new Rectangle(cardDimension.width, cardDimension.height);
    int count = 0;
    for (CardView card : showCards.values()) {
      addCard(card, bigCard, gameId, rectangle);
      if (count >= rowsOfCards) {
        rectangle.translate(cardDimension.width, -(rowsOfCards * verticalCardOffset));
        columns++;
        count = 0;
      } else {
        rectangle.translate(0, verticalCardOffset);
        count++;
      }
    }
  }
  cardArea.setPreferredSize(new Dimension(cardDimension.width * columns, cardDimension.height + (rowsOfCards * verticalCardOffset)));
}

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

@Override
public void doLayout(BattlefieldPanel battlefieldPanel, int width) {
  Map<UUID, MagePermanent> permanents = battlefieldPanel.getPermanents();
  JLayeredPane mainPanel = battlefieldPanel.getMainPanel();
  // does the basic layout of rows and colums
  int height = Plugins.instance.sortPermanents(battlefieldPanel.getUiComponentsList(), permanents, battlefieldPanel.isTopPanelBattlefield());
  mainPanel.setPreferredSize(new Dimension(width - 30, height));
  for (PermanentView permanent : battlefieldPanel.getBattlefield().values()) {
    if (permanent.getAttachments() != null && !permanent.isAttachedTo()) { // Layout only permanents that are not attached to other permanents itself
      groupAttachments(battlefieldPanel, mainPanel, permanents, permanent);
    }
  }
}

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

maxColumn = Math.max(maxColumn, curColumn);
updateCounts();
cardArea.setPreferredSize(new Dimension((maxColumn + 1) * cardDimension.width, cardDimension.height + maxRow * rowHeight));
cardArea.revalidate();
this.revalidate();

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

/**
 *  Constructor of the PeriodicTablePanel object
 */
public PeriodicTablePanel()
{
  super();
  setLayout( new BorderLayout());
  layeredPane = new JLayeredPane();
  layeredPane.setPreferredSize(new Dimension(581, 435));
  JPanel tp = PTPanel();
  tp.setBounds(8,85,570, 340);
  panel = CreateLabelProperties(null);
  layeredPane.add(tp, new Integer(0));
  layeredPane.add(panel, new Integer(1));
  add(layeredPane);
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

public StackableJPanelContainer() {
  this.setOpaque(false);
  
  layeredPane = new JLayeredPane();
  layeredPane.setOpaque(false);
  this.setLayout(new BorderLayout());
  this.add(layeredPane, BorderLayout.CENTER);
  layeredPane.setPreferredSize(new Dimension(300, 300));
  panels = new Stack<JPanel>();
  this.addComponentListener(new ComponentListener() {
    @Override
    public void componentResized(ComponentEvent e) {
      resetBounds();
    }
    @Override
    public void componentMoved(ComponentEvent e) {
    }
    @Override
    public void componentShown(ComponentEvent e) {
      resetBounds();
    }
    @Override
    public void componentHidden(ComponentEvent e) {
    }
  });
}

代码示例来源:origin: stackoverflow.com

JLayeredPane p = new JLayeredPane();
p.setBorder(BorderFactory.createLineBorder(Color.BLACK));
p.setPreferredSize(new Dimension(200, 100));
MouseAdapter adapter = new MouseAdapter() {
  @Override

代码示例来源:origin: com.googlecode.gstreamer-java/gstreamer-java

full.getMediaPlayer().play();
layeredPane.add(full, JLayeredPane.DEFAULT_LAYER);
layeredPane.setPreferredSize(new Dimension(640, 480));

代码示例来源:origin: stackoverflow.com

layeredPane.add(swingButton);
layeredPane.add(webBrowser);
layeredPane.setPreferredSize(new Dimension(WIDTH + OFFSET_X * (layerIndex - 1), HEIGHT + OFFSET_Y * (layerIndex - 1)));
add(new JScrollPane(layeredPane), BorderLayout.CENTER);

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

layeredPane.setPreferredSize(new Dimension(300, 310));
layeredPane.setBorder(BorderFactory.createTitledBorder(
              "Move the Mouse to Move Duke"));

代码示例来源:origin: sing-group/GC4S

protected void paintComponent(Graphics g) {
  super.paintComponent(g);
  genomeBrowser.changeCursor(Cursor.WAIT_CURSOR);
  int height = GenomeBrowserUtil.computeHeight(genomeBrowser);
  Graphics2D realGraphics = (Graphics2D) g;
  realGraphics.drawImage(doubleBuffer, 0, 0, width, height, this);
  genomeBrowser.setOptionTrackButtonEnabled(genomeBrowser.getFiles().size() > 0);
  genomeBrowser.setRemoveTrackButtonEnabled(genomeBrowser.getFiles().size() > 0);
  this.setBounds(0, 0, (int) (genomeBrowser.getWidth() * 0.985), height);
  genomeBrowser.getToolTipsPane().setBounds(0, 0,
    (int) (genomeBrowser.getWidth() * 0.985), height);
  genomeBrowser.getDraggingPane().setBounds(0, 0,
    (int) (genomeBrowser.getWidth() * 0.985), height);
  genomeBrowser.getLayeredPane().setPreferredSize(
    new Dimension((int) (genomeBrowser.getWidth() * 0.985), height));
  genomeBrowser.changeCursor(Cursor.DEFAULT_CURSOR);
}

代码示例来源:origin: sing-group/GC4S

this.draggingPane.setBorder(BorderFactory.createLineBorder(Color.BLACK));
this.draggingPane.setBounds(0, 0, 1182, height);
this.layeredPane.setPreferredSize(scroll.getPreferredSize());
this.rightPanel.setBounds(0, 0, 1182, height);
this.layeredPane.add(rightPanel, new Integer(0));

相关文章