Examples of JXPanel


Examples of org.jdesktop.swingx.JXPanel

        bigCard.showTextComponent();
      } else {
        bigCard.hideTextComponent();
      }
    } else {
      JXPanel panel = GuiDisplayUtil.getDescription(card.getOriginal(), bigCard.getWidth(), bigCard.getHeight());
      panel.setVisible(true);
      bigCard.hideTextComponent();
      bigCard.addJXPanel(card.getOriginal().getId(), panel);
    }
  }
View Full Code Here

Examples of org.jdesktop.swingx.JXPanel

public class GuiDisplayUtil {
  private static final Font cardNameFont = new Font("Calibri", Font.BOLD, 15);
 
    public static JXPanel getDescription(CardView card, int width, int height) {
      JXPanel descriptionPanel = new JXPanel();
   
      //descriptionPanel.setAlpha(.8f);
    descriptionPanel.setBounds(0, 0,  width, height);
    descriptionPanel.setVisible(false);
    descriptionPanel.setLayout(null);
   
    //descriptionPanel.setBorder(BorderFactory.createLineBorder(Color.green));
   
    JButton j = new JButton("");
    j.setBounds(0, 0,  width, height);
    j.setBackground(Color.black);
    j.setLayout(null);

    JLabel name = new JLabel("Wrath of God");
    name.setBounds(5, 5,  width - 90, 20);
    name.setForeground(Color.white);
    name.setFont(cardNameFont);
    //name.setBorder(BorderFactory.createLineBorder(Color.green));
    j.add(name);
   
    JLabel cost = new JLabel("B R G W U");
    cost.setBounds(width - 85, 5, 77, 20);
    cost.setForeground(Color.white);
    cost.setFont(cardNameFont);
    //cost.setBorder(BorderFactory.createLineBorder(Color.green));
    cost.setHorizontalAlignment(SwingConstants.RIGHT);
    j.add(cost);
   
    JLabel type = new JLabel("Creature - Goblin Shaman");
    type.setBounds(5, 70,  width - 8, 20);
    type.setForeground(Color.white);
    type.setFont(cardNameFont);
    //type.setBorder(BorderFactory.createLineBorder(Color.green));
    j.add(type);
   
    JLabel cardText = new JLabel();
    cardText.setBounds(5, 100,  width - 8, 260);
    cardText.setForeground(Color.white);
    cardText.setFont(cardNameFont);
    cardText.setVerticalAlignment(SwingConstants.TOP);
    //cardText.setBorder(new EtchedBorder());
    j.add(cardText);
   
    name.setText(card.getName());
    cost.setText(card.getManaCost().toString());
    String typeText = "";
    String delimiter = card.getCardTypes().size() > 1 ? " - " : "";
    for (CardType t : card.getCardTypes()) {
      typeText += t;
      typeText += delimiter;
      delimiter = " "; // next delimiters are just spaces
    }
    type.setText(typeText);
    cardText.setText("<html>"+card.getRules()+"</html>");
   
    if (CardUtil.isCreature(card)) {
      JLabel pt = new JLabel(card.getPower() + "/" + card.getToughness());
      pt.setBounds(width - 50, height - 30, 40, 20);
      pt.setForeground(Color.white);
      pt.setFont(cardNameFont);
      pt.setHorizontalAlignment(JLabel.RIGHT);
      j.add(pt);
    }
   
    descriptionPanel.add(j);
   
    return descriptionPanel;
    }
View Full Code Here

Examples of org.jdesktop.swingx.JXPanel

public class GuiDisplayUtil {
  private static final Font cardNameFont = new Font("Calibri", Font.BOLD, 15);
 
    public static JXPanel getDescription(CardView card, int width, int height) {
      JXPanel descriptionPanel = new JXPanel();
   
      //descriptionPanel.setAlpha(.8f);
    descriptionPanel.setBounds(0, 0,  width, height);
    descriptionPanel.setVisible(false);
    descriptionPanel.setLayout(null);
   
    //descriptionPanel.setBorder(BorderFactory.createLineBorder(Color.green));
   
    JButton j = new JButton("");
    j.setBounds(0, 0,  width, height);
    j.setBackground(Color.black);
    j.setLayout(null);

    JLabel name = new JLabel("Wrath of God");
    name.setBounds(5, 5,  width - 90, 20);
    name.setForeground(Color.white);
    name.setFont(cardNameFont);
    //name.setBorder(BorderFactory.createLineBorder(Color.green));
    j.add(name);
   
    JLabel cost = new JLabel("B R G W U");
    cost.setBounds(width - 85, 5, 77, 20);
    cost.setForeground(Color.white);
    cost.setFont(cardNameFont);
    //cost.setBorder(BorderFactory.createLineBorder(Color.green));
    cost.setHorizontalAlignment(SwingConstants.RIGHT);
    j.add(cost);
   
    JLabel type = new JLabel("Creature - Goblin Shaman");
    type.setBounds(5, 70,  width - 8, 20);
    type.setForeground(Color.white);
    type.setFont(cardNameFont);
    //type.setBorder(BorderFactory.createLineBorder(Color.green));
    j.add(type);
   
    JLabel cardText = new JLabel();
    cardText.setBounds(5, 100,  width - 8, 260);
    cardText.setForeground(Color.white);
    cardText.setFont(cardNameFont);
    cardText.setVerticalAlignment(SwingConstants.TOP);
    //cardText.setBorder(new EtchedBorder());
    j.add(cardText);
   
    name.setText(card.getName());
    cost.setText(card.getManaCost().toString());
    String typeText = "";
    String delimiter = card.getCardTypes().size() > 1 ? " - " : "";
    for (CardType t : card.getCardTypes()) {
      typeText += t;
      typeText += delimiter;
      delimiter = " "; // next delimiters are just spaces
    }
    type.setText(typeText);
    cardText.setText("<html>"+card.getRules()+"</html>");
   
    if (CardUtil.isCreature(card)) {
      JLabel pt = new JLabel(card.getPower() + "/" + card.getToughness());
      pt.setBounds(width - 50, height - 30, 40, 20);
      pt.setForeground(Color.white);
      pt.setFont(cardNameFont);
      pt.setHorizontalAlignment(JLabel.RIGHT);
      j.add(pt);
    }
   
    descriptionPanel.add(j);
   
    return descriptionPanel;
    }
View Full Code Here

Examples of org.jdesktop.swingx.JXPanel

              bigCard.showTextComponent();
            } else {
              bigCard.hideTextComponent();
            }
          } else {
            JXPanel panel = GuiDisplayUtil.getDescription(card.getOriginal(), bigCard.getWidth(), bigCard.getHeight());
            panel.setVisible(true);
            bigCard.hideTextComponent();
            bigCard.addJXPanel(card.getOriginal().getId(), panel);
          }
        }
      }
View Full Code Here

Examples of org.jdesktop.swingx.JXPanel

        doBtnSetImageActionPerformed(e);
      }
    });
    contentsPanel.add(this.btnSetImage, "cell 6 0");

    this.panelImage = new JXPanel();
    this.panelImage.setBorder(new TitledBorder(null, "Employee Photo",
        TitledBorder.LEADING, TitledBorder.TOP, null, null));
    contentsPanel.add(this.panelImage, "cell 7 0 1 7,grow");

    final JLabel lblId = new JLabel("ID");
View Full Code Here

Examples of org.jdesktop.swingx.JXPanel

        modelPanel = new ModelBrowser(_playerActions, _defaultAction, character, SpritesChar.HIGH, modelPanelSp, sw_state = new JLabel("No state"));
        modelPanel.setOnRefreshAction(action_customize_fileMask);
        splitCfgNModel.setRightComponent(modelPanelSp);
        JXTaskPaneContainer XContainer = new JXTaskPaneContainer();
        // controller panel
        JXPanel controller = new JXPanel(true);
        controller.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(), "controller", TitledBorder.RIGHT, TitledBorder.TOP));
        controller.setLayout(new BorderLayout());
        statusBarPanel = new JPanel(true);
        statusBarPanel.setLayout(new GridBagLayout());
        GridBagConstraints cl = new GridBagConstraints();
        cl.fill = cl.BOTH;
        cl.weightx = cl.weighty = 1;
        cl.weightx = .5;
        statusBarPanel.add(statusBarLabel = new JLabel(UIMessage._getIcon(UIMessage.ENABLED_TYPE, false)), cl);
        cl.weightx = 1;
        statusBarPanel.add(statusBar = new JProgressMemory(0, 100), cl);
        JPanel ledPanel = new JPanel(new GridLayout(0, 1), true);
        ledPanel.add(rLed = new Led(Led.READ));
        ledPanel.add(wLed = new Led(Led.WRITE));
        cl.weightx = .5;
        statusBarPanel.add(ledPanel, cl);
        controller.add(statusBarPanel, BorderLayout.NORTH);
        ((JProgressMemory) statusBar).setLabels("CACHE", "HEAP", "");
        applet.add(controller, BorderLayout.SOUTH);        // config panel

        panel = new JXTaskPane();
        /*
         * panel.setCollapsed(false);
         */
        if (System.getProperty("os.name").startsWith("Linux")) {
            try {
                SpritesCacheManager.callback("setCollapsed", panel, new Object[]{false}, new Class[]{boolean.class});
            } catch (Exception e) {
                if (JXAenvUtils._debug) {
                    e.printStackTrace();
                }
            }
        } else {
            try {
                SpritesCacheManager.callback("setExpanded", panel, new Object[]{true}, new Class[]{boolean.class});
            } catch (Exception e) {
                if (JXAenvUtils._debug) {
                    e.printStackTrace();
                }
            }
        }

        XContainer.add(panel);
        // init data to config
        // maps config panel
        XContainer.add(modelPanel.panelMaps);
        XContainer.add(modelPanel.panelFX);
        // play panel
        JPanel panelPlay = new JPanel(new GridLayout(2, 0), true);
        final JXPanel paramFrame = new JXPanel(true);
        paramFrame.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(), "Parameters config.", TitledBorder.RIGHT, TitledBorder.TOP));
        paramFrame.add(XContainer);
        viewerPanel = new JPanel(new BorderLayout(), true);
        viewerPanel.setPreferredSize(_iconSize);
        viewerPanel.add(new JLabel(UIMessage._getIcon(UIMessage.DROPTARGET_TYPE, false)), BorderLayout.CENTER);
        viewerPanel.validate();
        viewerPanel.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(), "Let's drag'n'drop a Model here !", TitledBorder.LEFT, TitledBorder.TOP));
View Full Code Here

Examples of org.jdesktop.swingx.JXPanel

        this.panelRevisiones.addSVNLogEntradaListener(this);

        // PANEL FILTRADO DE DATOS
        panelFiltrado = new JXPanelFiltrado(this.controlador, this);

        JXPanel panelSuperiorRevisiones = new JXPanel();
        panelSuperiorRevisiones.setLayout(new BorderLayout());
        panelSuperiorRevisiones.add(this.panelFiltrado, BorderLayout.NORTH);
        panelSuperiorRevisiones.add(this.panelRevisiones, BorderLayout.CENTER);

        // PANEL MENSAJE
        JScrollPane scrollPanelMensaje = new JScrollPane();
        this.panelMensaje = new SVNPanelMensaje(this.controlador);
        scrollPanelMensaje.setViewportView(this.panelMensaje);
View Full Code Here

Examples of org.jdesktop.swingx.JXPanel

        visorFicheroEdicion = owner;

        tabbedPaneBuscarReemplazar = new JTabbedPane();

        // "Find" panel
        JXPanel p1 = new JXPanel(new BorderLayout());

        JXPanel pc1 = new JXPanel(new BorderLayout());

        JXPanel pf = new JXPanel();
        // pf.setLayout(new DialogLayout(20, 5));
        pf.setBorder(new EmptyBorder(8, 5, 8, 0));
        pf.add(new JXLabel("Buscar:"));

        txtBuscar1 = new JTextField();
        txtBuscar1.setPreferredSize(new Dimension(100, txtBuscar1.getPreferredSize().height));
        docBusqueda = txtBuscar1.getDocument();

        pf.add(txtBuscar1);
        pc1.add(pf, BorderLayout.CENTER);

        JXPanel po = new JXPanel(new GridLayout(2, 2, 8, 2));
        po.setBorder(new TitledBorder(new EtchedBorder(), "Options"));

        JCheckBox chkWord = new JCheckBox("Palabra completa");
        chkWord.setMnemonic('p');
        m_modelWord = chkWord.getModel();
        po.add(chkWord);

        ButtonGroup bg = new ButtonGroup();
        JRadioButton rdUp = new JRadioButton("Hacia arriba");
        rdUp.setMnemonic('r');
        m_modelUp = rdUp.getModel();
        bg.add(rdUp);
        po.add(rdUp);

        JCheckBox chkCase = new JCheckBox("Contiene");
        chkCase.setMnemonic('c');
        m_modelCase = chkCase.getModel();
        po.add(chkCase);

        JRadioButton rdDown = new JRadioButton("Hacia abajo", true);
        rdDown.setMnemonic('b');
        m_modelDown = rdDown.getModel();
        bg.add(rdDown);
        po.add(rdDown);
        pc1.add(po, BorderLayout.SOUTH);

        p1.add(pc1, BorderLayout.CENTER);

        JXPanel p01 = new JXPanel(new FlowLayout());
        JXPanel p = new JXPanel(new GridLayout(2, 1, 2, 8));

        ActionListener findAction = new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                findNext(false, true);
            }
        };
        JButton btFind = new JButton("Siguiente");
        btFind.addActionListener(findAction);
        btFind.setMnemonic('S');
        p.add(btFind);

        ActionListener closeAction = new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                setVisible(false);
            }
        };
        JButton btClose = new JButton("Cerrar");
        btClose.addActionListener(closeAction);
        btClose.setDefaultCapable(true);
        p.add(btClose);
        p01.add(p);
        p1.add(p01, BorderLayout.EAST);

        tabbedPaneBuscarReemplazar.addTab("Buscar", p1);

        // "Replace" panel
        JXPanel p2 = new JXPanel(new BorderLayout());

        JXPanel pc2 = new JXPanel(new BorderLayout());

        JXPanel pc = new JXPanel();
        // pc.setLayout(new BoxLayout(20, 5));
        pc.setBorder(new EmptyBorder(8, 5, 8, 0));

        pc.add(new JXLabel("Buscar:"));
        txtBuscar2 = new JTextField();
        txtBuscar2.setDocument(docBusqueda);
        txtBuscar2.setPreferredSize(new Dimension(100, txtBuscar2.getPreferredSize().height));
        pc.add(txtBuscar2);

        pc.add(new JXLabel("Reemplazar:"));
        JTextField txtReplace = new JTextField();
        txtReplace.setPreferredSize(new Dimension(100, txtReplace.getPreferredSize().height));
        docReemplazar = txtReplace.getDocument();
        pc.add(txtReplace);
        pc2.add(pc, BorderLayout.CENTER);

        po = new JXPanel(new GridLayout(2, 2, 8, 2));
        po.setBorder(new TitledBorder(new EtchedBorder(), "Options"));

        chkWord = new JCheckBox("Palabra completa");
        chkWord.setMnemonic('P');
        chkWord.setModel(m_modelWord);
        po.add(chkWord);

        bg = new ButtonGroup();
        rdUp = new JRadioButton("Hacia arriba");
        rdUp.setMnemonic('r');
        rdUp.setModel(m_modelUp);
        bg.add(rdUp);
        po.add(rdUp);

        chkCase = new JCheckBox("Contiene");
        chkCase.setMnemonic('C');
        chkCase.setModel(m_modelCase);
        po.add(chkCase);

        rdDown = new JRadioButton("Hacia abajo", true);
        rdDown.setMnemonic('b');
        rdDown.setModel(m_modelDown);
        bg.add(rdDown);
        po.add(rdDown);
        pc2.add(po, BorderLayout.SOUTH);

        p2.add(pc2, BorderLayout.CENTER);

        JXPanel p02 = new JXPanel(new FlowLayout());
        p = new JXPanel(new GridLayout(3, 1, 2, 8));

        ActionListener replaceAction = new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                findNext(true, true);
            }
        };
        JButton btReplace = new JButton("Reemplazar");
        btReplace.addActionListener(replaceAction);
        btReplace.setMnemonic('r');
        p.add(btReplace);

        ActionListener replaceAllAction = new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                int counter = 0;
                while (true) {
                    int result = findNext(true, false);
                    if (result < 0) // error
                        return;
                    else if (result == 0) // no more
                        break;
                    counter++;
                }
                JOptionPane.showMessageDialog(visorFicheroEdicion, counter + " reemplazos", "Info", JOptionPane.INFORMATION_MESSAGE);
            }
        };
        JButton btReplaceAll = new JButton("Reemplazar todo");
        btReplaceAll.addActionListener(replaceAllAction);
        btReplaceAll.setMnemonic('a');
        p.add(btReplaceAll);

        btClose = new JButton("Cerrar");
        btClose.addActionListener(closeAction);
        btClose.setDefaultCapable(true);
        p.add(btClose);
        p02.add(p);
        p2.add(p02, BorderLayout.EAST);

        // Make button columns the same size
        p01.setPreferredSize(p02.getPreferredSize());

        tabbedPaneBuscarReemplazar.addTab("Reemplazar", p2);

        tabbedPaneBuscarReemplazar.setSelectedIndex(index);
View Full Code Here

Examples of org.jdesktop.swingx.JXPanel

            }
        }
    }

    private void drawCardText(CardView card) {
        JXPanel panel = GuiDisplayUtil.getDescription(card, bigCard.getWidth(), bigCard.getHeight());
        panel.setVisible(true);
        bigCard.hideTextComponent();
        bigCard.addJXPanel(card.getId(), panel);
    }
View Full Code Here

Examples of org.jdesktop.swingx.JXPanel

                bigCard.showTextComponent();
            } else {
                bigCard.hideTextComponent();
            }
        } else {
            JXPanel panel = GuiDisplayUtil.getDescription(mageCard.getOriginal(), bigCard.getWidth(), bigCard.getHeight());
            panel.setVisible(true);
            bigCard.hideTextComponent();
            bigCard.addJXPanel(mageCard.getOriginal().getId(), panel);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.