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

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

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

JLayeredPane.setLayer介绍

暂无

代码示例

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

int y = currentY + i * cardTopHeight;
view.setCardBounds(x, y, cardWidth, cardHeight);
cardContent.setLayer(view, layerIndex++);

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

if (parent != null && !parent.equals(layeredPane)) {
  layeredPane.add(animationPanel);
  layeredPane.setLayer(animationPanel, JLayeredPane.MODAL_LAYER);

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

if (parent != null && !parent.equals(layeredPane)) {
  layeredPane.add(animationPanel);
  layeredPane.setLayer(animationPanel, JLayeredPane.MODAL_LAYER);

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

layeredPane.setLayer(animationPanel, JLayeredPane.MODAL_LAYER);

代码示例来源:origin: ron190/jsql-injection

layeredPane.setLayer(this.verticalScrollBar, JLayeredPane.PALETTE_LAYER);
layeredPane.setLayer(this.horizontalScrollBar, JLayeredPane.PALETTE_LAYER);

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

JLayeredPane layeredPane = new JLayeredPane();
{
  JPanel imagePanel = new JPanel();
  layeredPane.add(imagePanel);
  layeredPane.setLayer(imagePanel, 0);
  imagePanel.setLayout(new GridLayout(1, 2, 0, 0));
  {
    imagePanel.add(new JLabel (windows));
    imagePanel.add(new JLabel (giraffe));
  }

  layeredPane.add(status);
  layeredPane.setLayer(status, 1);
}
giraffewindow.add(layeredPane);

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

public void actionPerformed(ActionEvent e) {
  String cmd = e.getActionCommand();
  if (ON_TOP_COMMAND.equals(cmd)) {
    if (onTop.isSelected())
      layeredPane.moveToFront(dukeLabel);
    else
      layeredPane.moveToBack(dukeLabel);
  } else if (LAYER_COMMAND.equals(cmd)) {
    int position = onTop.isSelected() ? 0 : 1;
    layeredPane.setLayer(dukeLabel,
               layerList.getSelectedIndex(),
               position);
  }
}

代码示例来源:origin: cmu-phil/tetrad

private void initComponents() {
  layeredPane.setLayer(innerComponent, JLayeredPane.DEFAULT_LAYER);
  GroupLayout layeredPaneLayout = new GroupLayout(layeredPane);
  layeredPane.setLayout(layeredPaneLayout);
  layeredPaneLayout.setHorizontalGroup(layeredPaneLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
      .addGroup(layeredPaneLayout.createSequentialGroup()
          .addContainerGap()
          .addComponent(innerComponent, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addContainerGap())
  );
  layeredPaneLayout.setVerticalGroup(layeredPaneLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
      .addGroup(layeredPaneLayout.createSequentialGroup()
          .addContainerGap()
          .addComponent(innerComponent, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addContainerGap())
  );
  GroupLayout layout = new GroupLayout(this);
  this.setLayout(layout);
  layout.setHorizontalGroup(
      layout.createParallelGroup(GroupLayout.Alignment.LEADING)
          .addComponent(layeredPane, GroupLayout.Alignment.TRAILING)
  );
  layout.setVerticalGroup(
      layout.createParallelGroup(GroupLayout.Alignment.LEADING)
          .addComponent(layeredPane, GroupLayout.Alignment.TRAILING)
  );
}

代码示例来源:origin: edu.toronto.cs.savant/savant-core

/**
 * Get a panel for a plugin to draw on. If necessary, a new one will be
 * created.
 */
@Override
public JPanel getLayerCanvas(SavantPanelPlugin plugin, boolean mayCreate) {
  JPanel p = pluginLayers.get(plugin);
  if (p == null && mayCreate) {
    p = new JPanel();
    p.setOpaque(false);
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 1.0;
    c.weighty = 1.0;
    c.gridx = 0;
    c.gridy = 0;
    c.gridwidth = 3;
    c.gridheight = 2;
    jlp.add(p, c, 2);
    jlp.setLayer(p, 50);
    pluginLayers.put(plugin, p);
    if (plugin != null) {
      p.setVisible(plugin.isVisible());
    }
  }
  return p;
}

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

public void propertyChange(PropertyChangeEvent evt) {
  if (descriptor.getToolWindow().getType() == ToolWindowType.FLOATING_LIVE) {
    if (Boolean.TRUE.equals(evt.getNewValue())) {
      if (timer != null) {
        timer.stop();
        if (animation.isAnimating())
          animation.stop();
      }
      layeredPane.setLayer(sheet, JLayeredPane.DEFAULT_LAYER + 4);
      sheet.setAlphaModeRatio(1.0f);
    } else {
      FloatingLiveTypeDescriptor floatingLiveTypeDescriptor = (FloatingLiveTypeDescriptor) descriptor.getTypeDescriptor(ToolWindowType.FLOATING_LIVE);
      if (floatingLiveTypeDescriptor.isTransparentMode()) {
        timer = new Timer(floatingLiveTypeDescriptor.getTransparentDelay(), this);
        timer.start();
      }
      layeredPane.setLayer(sheet, JLayeredPane.DEFAULT_LAYER + 3);
    }
    SwingUtil.repaint(layeredPane);
  }
}

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

layerpanel.add(panel2, gbc);
layerpanel.setLayer(panel1, new Integer(0));
layerpanel.setLayer(panel2, new Integer(1));

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

swingPanel.setBackground(Color.GREEN);
swingPanel.setBounds(OFFSET_X * layerIndex, OFFSET_Y * layerIndex, WIDTH, HEIGHT);
layeredPane.setLayer(swingPanel, layerIndex++);
layeredPane.add(swingPanel);
  "</html>");
webBrowser.setBounds(OFFSET_X * layerIndex, OFFSET_Y * layerIndex, WIDTH, HEIGHT);
layeredPane.setLayer(webBrowser, layerIndex++);
layeredPane.setLayer(swingButton, layerIndex++);
layeredPane.add(swingButton);
layeredPane.add(webBrowser);

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

one.setRotation( 270 );
JLayeredPane pane = new JLayeredPane();
pane.setLayer( one, JLayeredPane.DEFAULT_LAYER );
pane.add( one );
pane.setBorder(new javax.swing.border.LineBorder(Color.BLACK,1));

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

JButton button = new JButton(" Menu \u25be ");

JFrame frame = new JFrame("Title");
frame.setUndecorated(true);
frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);

// Force creation of title bar components.
frame.setPreferredSize(new Dimension(400, 400));
frame.pack();

JLayeredPane layeredPane = frame.getLayeredPane();
JComponent titlePane = (JComponent) layeredPane.getComponentAt(0, 0);
for (Component c : titlePane.getComponents()) {
  if (c instanceof Container &&
    ((Container) c).getLayout() instanceof DefaultMenuLayout) {

    int layer = layeredPane.getLayer(titlePane);
    layeredPane.setLayer(button, layer + 1);

    button.setLocation(c.getX() + c.getWidth() + 3, 1);
    Dimension size = button.getPreferredSize();
    size.height = Math.min(size.height, titlePane.getHeight() - 2);
    button.setSize(size);
    layeredPane.add(button);

    break;
  }
}

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

gbc.gridy = 0;
add(background, gbc);
setLayer(background, 0);
setLayer(foreground, 1);

代码示例来源:origin: xyz.cofe/docking-frames-ext-toolbar

base.add(button);
base.add(elsewhere);
base.setLayer(button, JLayeredPane.DEFAULT_LAYER);
base.setLayer(elsewhere, JLayeredPane.MODAL_LAYER);
base.setLayout(new LayoutManager(){
  @Override

代码示例来源:origin: tinyMediaManager/tinyMediaManager

new FormLayout(new ColumnSpec[] { ColumnSpec.decode("default:grow") }, new RowSpec[] { RowSpec.decode("fill:max(500px;default):grow") }));
content.add(mainPanel, "1, 1, 3, 1, fill, fill");
content.setLayer(mainPanel, 1);

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

modalInterceptor.setOpaque(false);
JLayeredPane lp = JLayeredPane.getLayeredPaneAbove(f);
lp.setLayer(modalInterceptor, JLayeredPane.MODAL_LAYER.intValue());
modalInterceptor.setBounds(0, 0, lp.getWidth(), lp.getHeight());
modalInterceptor.addMouseListener(new MouseAdapter(){});

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

protected void update() {
  // Reset Layout
  titleBarButtons.setType(ToolWindowType.SLIDING);
  TableLayout layout = (TableLayout) sheet.getLayout();
  layout.setColumn(0, 0);
  layout.setColumn(2, 0);
  layout.setRow(0, 0);
  layout.setRow(2, 0);
  if (barContainer != null)
    barContainer.getParent().getLayout().layoutContainer(barContainer.getParent());
  resize();
  Component content = dockedContainer.getContentContainer();
  sheet.remove(content);
  sheet.add(content, "1,1,FULL,FULL");
  // Prepare sheet
  border.setAnchor(toolWindow.getAnchor());
  sheet.setBorder(border);
  int height = mainPanel.getHeight();
  Point point = SwingUtilities.convertPoint(mainPanel, 0, 0, layeredPane);
  sheet.setBounds(point.x, point.y, mainPanel.getWidth(), height);
  layeredPane.remove(sheet);
  layeredPane.setLayer(sheet, JLayeredPane.DEFAULT_LAYER + 2);
  layeredPane.add(sheet);
  layeredPane.validate();
}

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

layeredPane.setLayer(sheet, JLayeredPane.DEFAULT_LAYER + 2);
layeredPane.add(sheet);

相关文章