Package net.miginfocom.swing

Examples of net.miginfocom.swing.MigLayout


        Component leftPanel = createEventsAndInvetoryPanel();
        splitPane.setLeftComponent( leftPanel );

        JPanel test = new JPanel();
        splitPane.setRightComponent( test );
        test.setLayout( new MigLayout( "",
                                       "[][][]",
                                       "[][grow, fill][][][][][fill][]" ) );

        createpOutputPanel( test );
        createCharacterPanel( test );
View Full Code Here


            JComponent c = (JComponent) e.getSource();
            LayoutManager lm = c.getParent().getLayout();
            if ( lm instanceof MigLayout == false ) lm = c.getLayout();

            if ( lm instanceof MigLayout ) {
                MigLayout layout = (MigLayout) lm;
                boolean isComp = layout.isManagingComponent( c );

                Object compConstr = isComp ? layout.getComponentConstraints( c ) : null;
                if ( isComp && compConstr == null ) compConstr = "";

                Object rowsConstr = isComp ? null : layout.getRowConstraints();
                Object colsConstr = isComp ? null : layout.getColumnConstraints();
                Object layoutConstr = isComp ? null : layout.getLayoutConstraints();

                ConstraintsDialog cDlg = new ConstraintsDialog( AdventureFrame.this,
                                                                //                       layoutConstr instanceof LC ? IDEUtil.getConstraintString((LC) layoutConstr, false) : (String) layoutConstr,
                                                                //                       rowsConstr instanceof AC ? IDEUtil.getConstraintString((AC) rowsConstr, false, false) : (String) rowsConstr,
                                                                //                       colsConstr instanceof AC ? IDEUtil.getConstraintString((AC) colsConstr, false, false) : (String) colsConstr,
                                                                //                       compConstr instanceof CC ? IDEUtil.getConstraintString((CC) compConstr, false) : (String) compConstr);
                                                                (String) layoutConstr,
                                                                (String) rowsConstr,
                                                                (String) colsConstr,
                                                                (String) compConstr );

                cDlg.pack();
                cDlg.setLocationRelativeTo( c );

                if ( cDlg.showDialog() ) {
                    try {
                        if ( isComp ) {
                            String constrStr = cDlg.componentConstrTF.getText().trim();
                            layout.setComponentConstraints( c,
                                                            constrStr );
                            if ( c instanceof JButton ) {
                                c.setFont( BUTT_FONT );
                                ((JButton) c).setText( constrStr.length() == 0 ? "<Empty>" : constrStr );
                            }
                        } else {
                            layout.setLayoutConstraints( cDlg.layoutConstrTF.getText() );
                            layout.setRowConstraints( cDlg.rowsConstrTF.getText() );
                            layout.setColumnConstraints( cDlg.colsConstrTF.getText() );
                        }
                    } catch ( Exception ex ) {
                        StringWriter sw = new StringWriter();
                        ex.printStackTrace( new PrintWriter( sw ) );
                        JOptionPane.showMessageDialog( SwingUtilities.getWindowAncestor( c ),
View Full Code Here

        frame = new JFrame( "Wumpus World" );
        frame.getContentPane().setBackground( Color.WHITE );
        frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

        frame.setSize( 926, 603 );
        frame.getContentPane().setLayout( new MigLayout("", "[540px:n][grow,fill]", "[30px,top][300px,top][100px,top][grow]") );
       
        JPanel scorePanel = new JPanel();
        FlowLayout flowLayout = (FlowLayout) scorePanel.getLayout();
        flowLayout.setAlignment(FlowLayout.LEFT);
        scorePanel.setBackground(Color.WHITE);
        frame.getContentPane().add(scorePanel, "cell 0 0,grow");
       
        JLabel lblScore = new JLabel("Score");
        scorePanel.add(lblScore);
       
        final JTextField txtScore = new JTextField();
        gameView.getKsession().getChannels().put( "score", new Channel() {           
            public void send(Object object) {
                txtScore.setText( "" + ((Score ) object).getValue() );
            }
        } );
       
        txtScore.setEditable(false);
        scorePanel.add(txtScore);
        txtScore.setColumns(10);
       
        JScrollPane scrollPane = new JScrollPane();
        frame.getContentPane().add(scrollPane, "cell 1 0 1 4,grow");

        JPanel actionPanel = new JPanel();
        actionPanel.setBackground( Color.WHITE );
        frame.getContentPane().add( actionPanel, "cell 0 1,grow" );
        actionPanel.setLayout( new MigLayout("", "[200px,left][320px:n]", "[grow]") );

        JPanel controls = new JPanel();
        controls.setBackground( Color.WHITE );
        controls.setLayout( new MigLayout( "", "[grow,fill]", "[::100px,top][200px,top]" ) );
        controls.add( drawActionPanel(), "cell 0 0,alignx left,aligny top" );

        controls.add( drawMovePanel(), "cell 0 1,alignx left,growy" );

        actionPanel.add( controls, "cell 0 0,grow" );
View Full Code Here

        Component leftPanel = createEventsAndInvetoryPanel();
        splitPane.setLeftComponent( leftPanel );

        JPanel test = new JPanel();
        splitPane.setRightComponent( test );
        test.setLayout( new MigLayout( "",
                                       "[][][]",
                                       "[][grow, fill][][][][][fill][]" ) );

        createpOutputPanel( test );
        createCharacterPanel( test );
View Full Code Here

            JComponent c = (JComponent) e.getSource();
            LayoutManager lm = c.getParent().getLayout();
            if ( lm instanceof MigLayout == false ) lm = c.getLayout();

            if ( lm instanceof MigLayout ) {
                MigLayout layout = (MigLayout) lm;
                boolean isComp = layout.isManagingComponent( c );

                Object compConstr = isComp ? layout.getComponentConstraints( c ) : null;
                if ( isComp && compConstr == null ) compConstr = "";

                Object rowsConstr = isComp ? null : layout.getRowConstraints();
                Object colsConstr = isComp ? null : layout.getColumnConstraints();
                Object layoutConstr = isComp ? null : layout.getLayoutConstraints();

                ConstraintsDialog cDlg = new ConstraintsDialog( AdventureFrame.this,
                                                                //                       layoutConstr instanceof LC ? IDEUtil.getConstraintString((LC) layoutConstr, false) : (String) layoutConstr,
                                                                //                       rowsConstr instanceof AC ? IDEUtil.getConstraintString((AC) rowsConstr, false, false) : (String) rowsConstr,
                                                                //                       colsConstr instanceof AC ? IDEUtil.getConstraintString((AC) colsConstr, false, false) : (String) colsConstr,
                                                                //                       compConstr instanceof CC ? IDEUtil.getConstraintString((CC) compConstr, false) : (String) compConstr);
                                                                (String) layoutConstr,
                                                                (String) rowsConstr,
                                                                (String) colsConstr,
                                                                (String) compConstr );

                cDlg.pack();
                cDlg.setLocationRelativeTo( c );

                if ( cDlg.showDialog() ) {
                    try {
                        if ( isComp ) {
                            String constrStr = cDlg.componentConstrTF.getText().trim();
                            layout.setComponentConstraints( c,
                                                            constrStr );
                            if ( c instanceof JButton ) {
                                c.setFont( BUTT_FONT );
                                ((JButton) c).setText( constrStr.length() == 0 ? "<Empty>" : constrStr );
                            }
                        } else {
                            layout.setLayoutConstraints( cDlg.layoutConstrTF.getText() );
                            layout.setRowConstraints( cDlg.rowsConstrTF.getText() );
                            layout.setColumnConstraints( cDlg.colsConstrTF.getText() );
                        }
                    } catch ( Exception ex ) {
                        StringWriter sw = new StringWriter();
                        ex.printStackTrace( new PrintWriter( sw ) );
                        JOptionPane.showMessageDialog( SwingUtilities.getWindowAncestor( c ),
View Full Code Here

    popupMenu.add(separator_1);
   
    JMenuItem mntmUpdateOfflineRepo = new JMenuItem("Update offline repo");
    mntmUpdateOfflineRepo.setName("update-offline-repo-btn");
    popupMenu.add(mntmUpdateOfflineRepo);
    setLayout(new MigLayout("", "[][][][][][grow]", "[][][][grow][]"));
   
    JLabel lblNamespace = new JLabel("Namespaces");
    lblNamespace.setName("ns-header-lbl");
    lblNamespace.setFont(new Font("Lucida Grande", Font.BOLD, 15));
    add(lblNamespace, "cell 0 0 3 1,alignx center");
View Full Code Here

  private static Color TEXT_COLOR = new Color(219, 213, 137);

  public PanelDice(int maxWidth, Integer total, Integer dice,
      Integer modifier, List<Integer> vals) {

    this.setLayout(new MigLayout("insets 5 5 0 0, hmin 40, w " + maxWidth
        + ", hmax " + maxWidth, "[][]", "[]"));

    String totalStr = String.valueOf(total);

    int resWidth = 20 + totalStr.length() * 10;
 
View Full Code Here

    scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    int scrollWidth = scroll.getVerticalScrollBar().getWidth();

    maxWidth = dim.width - scrollWidth;
    allMessage.setLayout(new MigLayout(
        "insets 5 5 5 5, flowy, novisualpadding, wmax " + maxWidth,
        "[grow]", "[fill]"));

    // make autoscroll
    scroll.getVerticalScrollBar().addAdjustmentListener(
View Full Code Here

public class PanelTextMessage extends JPanel {
  private static final long serialVersionUID = 1L;

  public PanelTextMessage(int maxWidth, Message msg) {
    this.setLayout(new MigLayout("insets 0 0 0 0, wmax " + maxWidth,
        "[][grow]", "[]"));

    /*
     * JLabel lblName = new JLabel(msg.getSender() + ":");
     * lblName.setFont(lblName.getFont().deriveFont(Font.BOLD));
 
View Full Code Here


        JButton nextButton = new JButton("Next");
        JButton backButton = new JButton("Back");

        setLayout(new MigLayout("fill", "[|]push[|]push[]push[]"));

        add(copiesLabel);
        add(m_copiesField, "w 50lp");
        add(columnsLabel);
        add(m_columnsField, "w 50lp");
View Full Code Here

TOP

Related Classes of net.miginfocom.swing.MigLayout

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.