Package javax.swing

Examples of javax.swing.JLayeredPane


     * Returns the {@code layeredPane} object for the wrapped component.
     *
     * @return the {@code layeredPane} property
     */
    public JLayeredPane getLayeredPane() {
        JLayeredPane pane = null;

        if (getRootContainer() instanceof RootPaneContainer) {
            pane = ((RootPaneContainer) getRootContainer()).getLayeredPane();
        }

View Full Code Here


            Container cont = (Container)parent;
            // use a copy of 1.3 Container.findComponentAt
            Component child = findComponentAt(cont, cont.getWidth(), cont.getHeight(), x, y);
            if (child != null && child != cont) {
                if (child instanceof JRootPane) {
                    JLayeredPane lp = ((JRootPane)child).getLayeredPane();
                    Rectangle b = lp.getBounds();
                    child = (Component)getDeepestObjectAt(lp, x - b.x, y - b.y);
                }
                if (child != null) {
                    return child;
                }
View Full Code Here

    gridBagLayout.rowHeights = new int[] { 0, 0 };
    gridBagLayout.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
    gridBagLayout.rowWeights = new double[] { 1.0, Double.MIN_VALUE };
    setLayout(gridBagLayout);

    JLayeredPane layeredPane = new JLayeredPane();
    GridBagConstraints gbc_layeredPane = new GridBagConstraints();
    gbc_layeredPane.fill = GridBagConstraints.BOTH;
    gbc_layeredPane.gridx = 0;
    gbc_layeredPane.gridy = 0;
    add(layeredPane, gbc_layeredPane);

    ImageIcon background = new ImageIcon(getClass().getResource(
        "/shadowrun/gui/document/character/attributs.png"));

    JPanel panelBackground = new ImagePanel(background.getImage());
    panelBackground.setLocation(0, 0);
    layeredPane.add(panelBackground, new Integer(1));

    textFieldCon = new FocusTextField();
    textFieldCon.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldCon.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldCon.setText("1");
    textFieldCon.setBounds(28, 39, 52, 32);
    panelBackground.add(textFieldCon);
    textFieldCon.setColumns(10);

    textFieldAgi = new FocusTextField();
    textFieldAgi.setText("1");
    textFieldAgi.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldAgi.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldAgi.setColumns(10);
    textFieldAgi.setBounds(126, 39, 52, 32);
    panelBackground.add(textFieldAgi);

    textFieldRea = new FocusTextField();
    textFieldRea.setText("1");
    textFieldRea.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldRea.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldRea.setColumns(10);
    textFieldRea.setBounds(232, 39, 52, 32);
    panelBackground.add(textFieldRea);

    textFieldFor = new FocusTextField();
    textFieldFor.setText("1");
    textFieldFor.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldFor.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldFor.setColumns(10);
    textFieldFor.setBounds(332, 39, 52, 32);
    panelBackground.add(textFieldFor);

    textFieldCha = new FocusTextField();
    textFieldCha.setText("1");
    textFieldCha.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldCha.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldCha.setColumns(10);
    textFieldCha.setBounds(429, 39, 52, 32);
    panelBackground.add(textFieldCha);

    textFieldInt = new FocusTextField();
    textFieldInt.setText("1");
    textFieldInt.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldInt.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldInt.setColumns(10);
    textFieldInt.setBounds(528, 39, 52, 32);
    panelBackground.add(textFieldInt);

    textFieldLog = new FocusTextField();
    textFieldLog.setText("1");
    textFieldLog.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldLog.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldLog.setColumns(10);
    textFieldLog.setBounds(618, 39, 52, 32);
    panelBackground.add(textFieldLog);

    textFieldVol = new FocusTextField();
    textFieldVol.setText("1");
    textFieldVol.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldVol.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldVol.setColumns(10);
    textFieldVol.setBounds(28, 118, 52, 32);
    panelBackground.add(textFieldVol);

    textFieldChance = new FocusTextField();
    textFieldChance.setText("1");
    textFieldChance.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldChance.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldChance.setColumns(10);
    textFieldChance.setBounds(126, 118, 52, 32);
    panelBackground.add(textFieldChance);

    textFieldMagie = new FocusTextField();
    textFieldMagie.setText("1");
    textFieldMagie.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldMagie.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldMagie.setColumns(10);
    textFieldMagie.setBounds(227, 118, 52, 32);
    panelBackground.add(textFieldMagie);

    textFieldEss = new FocusTextField();
    textFieldEss.setText("1");
    textFieldEss.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldEss.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldEss.setColumns(10);
    textFieldEss.setBounds(332, 118, 52, 32);
    panelBackground.add(textFieldEss);

    textFieldInit = new FocusTextField();
    textFieldInit.setText("1");
    textFieldInit.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldInit.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldInit.setColumns(10);
    textFieldInit.setBounds(429, 118, 52, 32);
    panelBackground.add(textFieldInit);

    textFieldPI = new FocusTextField();
    textFieldPI.setText("1");
    textFieldPI.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldPI.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldPI.setColumns(10);
    textFieldPI.setBounds(528, 118, 52, 32);
    panelBackground.add(textFieldPI);

    JPanel panelTextFields = new JPanel();
    layeredPane.add(panelTextFields, new Integer(0));

    layeredPane.setPreferredSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
    layeredPane.setMaximumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
    layeredPane.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));

    this.setPreferredSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
    this.setMaximumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
    this.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
  }
View Full Code Here

    gridBagLayout.rowHeights = new int[] { 0, 0 };
    gridBagLayout.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
    gridBagLayout.rowWeights = new double[] { 1.0, Double.MIN_VALUE };
    setLayout(gridBagLayout);

    JLayeredPane layeredPane = new JLayeredPane();
    GridBagConstraints gbc_layeredPane = new GridBagConstraints();
    gbc_layeredPane.fill = GridBagConstraints.BOTH;
    gbc_layeredPane.gridx = 0;
    gbc_layeredPane.gridy = 0;
    add(layeredPane, gbc_layeredPane);

    ImageIcon background = new ImageIcon(getClass().getResource(
        "/shadowrun/gui/document/character/attributs.png"));

    JPanel panelBackground = new ImagePanel(background.getImage());
    panelBackground.setLocation(0, 0);
    layeredPane.add(panelBackground, new Integer(1));

    textFieldCon = new JLabel();
    textFieldCon.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldCon.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldCon.setText("1");
    textFieldCon.setBounds(28, 39, 52, 32);
    panelBackground.add(textFieldCon);

    textFieldAgi = new JLabel();
    textFieldAgi.setText("1");
    textFieldAgi.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldAgi.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldAgi.setBounds(126, 39, 52, 32);
    panelBackground.add(textFieldAgi);

    textFieldRea = new JLabel();
    textFieldRea.setText("1");
    textFieldRea.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldRea.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldRea.setBounds(232, 39, 52, 32);
    panelBackground.add(textFieldRea);

    textFieldFor = new JLabel();
    textFieldFor.setText("1");
    textFieldFor.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldFor.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldFor.setBounds(332, 39, 52, 32);
    panelBackground.add(textFieldFor);

    textFieldCha = new JLabel();
    textFieldCha.setText("1");
    textFieldCha.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldCha.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldCha.setBounds(429, 39, 52, 32);
    panelBackground.add(textFieldCha);

    textFieldInt = new JLabel();
    textFieldInt.setText("1");
    textFieldInt.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldInt.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldInt.setBounds(528, 39, 52, 32);
    panelBackground.add(textFieldInt);

    textFieldLog = new JLabel();
    textFieldLog.setText("1");
    textFieldLog.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldLog.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldLog.setBounds(618, 39, 52, 32);
    panelBackground.add(textFieldLog);

    textFieldVol = new JLabel();
    textFieldVol.setText("1");
    textFieldVol.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldVol.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldVol.setBounds(28, 118, 52, 32);
    panelBackground.add(textFieldVol);

    textFieldChance = new JLabel();
    textFieldChance.setText("1");
    textFieldChance.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldChance.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldChance.setBounds(126, 118, 52, 32);
    panelBackground.add(textFieldChance);

    textFieldMagie = new JLabel();
    textFieldMagie.setText("1");
    textFieldMagie.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldMagie.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldMagie.setBounds(227, 118, 52, 32);
    panelBackground.add(textFieldMagie);

    textFieldEss = new JLabel();
    textFieldEss.setText("1");
    textFieldEss.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldEss.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldEss.setBounds(332, 118, 52, 32);
    panelBackground.add(textFieldEss);

    textFieldInit = new JLabel();
    textFieldInit.setText("1");
    textFieldInit.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldInit.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldInit.setBounds(429, 118, 52, 32);
    panelBackground.add(textFieldInit);

    textFieldPI = new JLabel();
    textFieldPI.setText("1");
    textFieldPI.setHorizontalAlignment(SwingConstants.CENTER);
    textFieldPI.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldPI.setBounds(528, 118, 52, 32);
    panelBackground.add(textFieldPI);

    JPanel panelTextFields = new JPanel();
    layeredPane.add(panelTextFields, new Integer(0));

    layeredPane.setPreferredSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
    layeredPane.setMaximumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
    layeredPane.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));

    this.setPreferredSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
    this.setMaximumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
    this.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
  }
View Full Code Here

            Color bg = transparent ? new Color(0, 0, 0, 0) : null;
            if (w instanceof RootPaneContainer) {
                RootPaneContainer rpc = (RootPaneContainer)w;
                JRootPane root = rpc.getRootPane();
                JLayeredPane lp = root.getLayeredPane();
                Container c = root.getContentPane();
                JComponent content =
                    (c instanceof JComponent) ? (JComponent)c : null;
                if (transparent) {
                    lp.putClientProperty(TRANSPARENT_OLD_OPAQUE,
                                         Boolean.valueOf(lp.isOpaque()));
                    lp.setOpaque(false);
                    root.putClientProperty(TRANSPARENT_OLD_OPAQUE,
                                           Boolean.valueOf(root.isOpaque()));
                    root.setOpaque(false);
                    if (content != null) {
                        content.putClientProperty(TRANSPARENT_OLD_OPAQUE,
                                                  Boolean.valueOf(content.isOpaque()));
                        content.setOpaque(false);
                    }
                    root.putClientProperty(TRANSPARENT_OLD_BG,
                                           root.getParent().getBackground());
                }
                else {
                    lp.setOpaque(Boolean.TRUE.equals(lp.getClientProperty(TRANSPARENT_OLD_OPAQUE)));
                    lp.putClientProperty(TRANSPARENT_OLD_OPAQUE, null);
                    root.setOpaque(Boolean.TRUE.equals(root.getClientProperty(TRANSPARENT_OLD_OPAQUE)));
                    root.putClientProperty(TRANSPARENT_OLD_OPAQUE, null);
                    if (content != null) {
                        content.setOpaque(Boolean.TRUE.equals(content.getClientProperty(TRANSPARENT_OLD_OPAQUE)));
                        content.putClientProperty(TRANSPARENT_OLD_OPAQUE, null);
View Full Code Here

                public void run() {
                    User32 user = User32.INSTANCE;
                    HWND hWnd = getHWnd(w);
                    int flags = user.GetWindowLong(hWnd, WinUser.GWL_EXSTYLE);
                    JRootPane root = ((RootPaneContainer)w).getRootPane();
                    JLayeredPane lp = root.getLayeredPane();
                    Container content = root.getContentPane();
                    if (content instanceof W32TransparentContentPane) {
                        ((W32TransparentContentPane)content).setTransparent(transparent);
                    }
                    else if (transparent) {
                        W32TransparentContentPane w32content =
                            new W32TransparentContentPane(content);
                        root.setContentPane(w32content);
                        lp.add(new RepaintTrigger(w32content),
                               JLayeredPane.DRAG_LAYER);
                    }
                    if (transparent && !usingUpdateLayeredWindow(w)) {
                        flags |= WinUser.WS_EX_LAYERED;
                        user.SetWindowLong(hWnd, WinUser.GWL_EXSTYLE, flags);
View Full Code Here

            if (transparent == isTransparent)
                return;
            whenDisplayable(w, new Runnable() {
                public void run() {
                    JRootPane root = ((RootPaneContainer)w).getRootPane();
                    JLayeredPane lp = root.getLayeredPane();
                    Container content = root.getContentPane();
                    if (content instanceof X11TransparentContentPane) {
                        ((X11TransparentContentPane)content).setTransparent(transparent);
                    }
                    else if (transparent) {
                        X11TransparentContentPane x11content =
                            new X11TransparentContentPane(content);
                        root.setContentPane(x11content);
                        lp.add(new RepaintTrigger(x11content),
                               JLayeredPane.DRAG_LAYER);
                    }
                    setLayersTransparent(w, transparent);
                    setForceHeavyweightPopups(w, transparent);
                    setDoubleBuffered(w, !transparent);
View Full Code Here

        Container panel = frame.getContentPane();
        panel.setBackground(SColor.BLACK);
        panel.setLayout(new BorderLayout());

        JLayeredPane layers = new JLayeredPane();
        TextCellFactory textFactory = new TextCellFactory(font, cellWidth, cellHeight, true, 0, CHARS_USED);
        mapPanel = new SwingPane(width, height, textFactory, null);
        mapPanel.put(width / 2 - 4, height / 2, "Loading");
        mapPanel.refresh();
        mapBackPanel = new SwingPane(width, height, textFactory, null);
        mapBackPanel.refresh();
        layers.setLayer(mapPanel, JLayeredPane.PALETTE_LAYER);
        layers.setLayer(mapBackPanel, JLayeredPane.DEFAULT_LAYER);
        layers.add(mapPanel);
        layers.add(mapBackPanel);

        layers.setSize(mapPanel.getPreferredSize());
        layers.setPreferredSize(mapPanel.getPreferredSize());
        panel.add(layers, BorderLayout.WEST);

        statsPanel = new SwingPane(statWidth, mapPanel.gridHeight(), textFactory, null);
        statsPanel.setDefaultForeground(SColor.RUST);
        statsPanel.refresh();
View Full Code Here

                    if (_container == null) {
                        _container = createContainer();
                    } else {
                        _container.removeAll();
                    }
                    _layers = new JLayeredPane();
                    _container.add(_layers, BorderLayout.CENTER);
                    _patchNotes = new JButton(new AbstractAction(_msgs.getString("m.patch_notes")) {
                        @Override public void actionPerformed (ActionEvent event) {
                            showDocument(_ifc.patchNotesUrl);
                        }
View Full Code Here

        textFactory = new TextCellFactory(control.getFontFace(), control.getCellWidth(), control.getCellHeight());
        display = new SwingPane(width, height, textFactory, null);
        back = new SwingPane(width, height, textFactory, null);

        final JLayeredPane layers = new JLayeredPane();
        layers.setLayer(display, JLayeredPane.PALETTE_LAYER);
        layers.setLayer(back, JLayeredPane.DEFAULT_LAYER);
        layers.add(display);
        layers.add(back);
        layers.setSize(display.getPreferredSize());
        layers.setPreferredSize(display.getPreferredSize());
        layers.setMinimumSize(display.getPreferredSize());
        frame.add(layers, BorderLayout.SOUTH);
        frame.getContentPane().setBackground(SColor.BLACK);

        String text = "";
        for (char c = 33; c <= 125; c++) {
            text += c;
        }
        control.inputTextArea.setText(text);

        control.updateButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                control.validateInput();
                layers.remove(display);
                layers.remove(back);
               
                textFactory = new TextCellFactory(control.getFontFace(), control.getCellWidth(), control.getCellHeight(),
                        control.antialiasBox.isSelected(), control.getTopPad(), control.getBottomPad(), control.getLeftPad(), control.getRightPad(),
                        control.inputTextArea.getText());
                display = new SwingPane(width, height, textFactory, null);
                back = new SwingPane(width, height, textFactory, null);
               
                layers.setLayer(display, JLayeredPane.PALETTE_LAYER);
                layers.setLayer(back, JLayeredPane.DEFAULT_LAYER);
                layers.add(display);
                layers.add(back);
                layers.setSize(display.getPreferredSize());
                layers.setPreferredSize(display.getPreferredSize());
                layers.setMinimumSize(display.getPreferredSize());
                changeDisplay();
            }
        });

        control.validateInput();
View Full Code Here

TOP

Related Classes of javax.swing.JLayeredPane

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.