Package tiled.mapeditor.widget

Examples of tiled.mapeditor.widget.VerticalStaticJPanel


        unitName = new JTextField(UNTITLED_UNIT);
        unitType = new JTextField();
        unitWidth = new IntegerSpinner(0, 0, 1024);
        unitHeight = new IntegerSpinner(0, 0, 1024);

        JPanel miscPropPanel = new VerticalStaticJPanel();
        miscPropPanel.setLayout(new GridBagLayout());
        miscPropPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
        GridBagConstraints c = new GridBagConstraints();
        c.anchor = GridBagConstraints.EAST;
        c.gridx = 0;
        c.gridy = 0;
        c.weightx = 0;
        c.fill = GridBagConstraints.NONE;
        c.insets = new Insets(5, 0, 0, 5);
        miscPropPanel.add(nameLabel, c);
        c.gridy = 1;
        miscPropPanel.add(typeLabel, c);
        c.gridy = 2;
        miscPropPanel.add(widthLabel, c);
        c.gridy = 3;
        miscPropPanel.add(heightLabel, c);
        c.insets = new Insets(5, 0, 0, 0);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.gridx = 1;
        c.gridy = 0;
        c.weightx = 1;
        miscPropPanel.add(unitName, c);
        c.gridy = 1;
        miscPropPanel.add(unitType, c);
        c.gridy = 2;
        miscPropPanel.add(unitWidth, c);
        c.gridy = 3;
        miscPropPanel.add(unitHeight, c);

        mainPanel.add(miscPropPanel, 0);
    }
View Full Code Here


        zoneName = new JTextField(UNTITLED_OBJECT);
        zoneWidth = new IntegerSpinner(0, 0, 1024);
        zoneHeight = new IntegerSpinner(0, 0, 1024);

        JPanel miscPropPanel = new VerticalStaticJPanel();
        miscPropPanel.setLayout(new GridBagLayout());
        miscPropPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
        GridBagConstraints c = new GridBagConstraints();
        c.anchor = GridBagConstraints.EAST;
        c.gridx = 0;
        c.gridy = 0;
        c.weightx = 0;
        c.fill = GridBagConstraints.NONE;
        c.insets = new Insets(5, 0, 0, 5);
        miscPropPanel.add(nameLabel, c);
        c.gridy = 1;
        miscPropPanel.add(widthLabel, c);
        c.gridy = 2;
        miscPropPanel.add(heightLabel, c);
        c.insets = new Insets(5, 0, 0, 0);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.gridx = 1;
        c.gridy = 0;
        c.weightx = 1;
        miscPropPanel.add(zoneName, c);
        c.gridy = 1;
        miscPropPanel.add(zoneWidth, c);
        c.gridy = 2;
        miscPropPanel.add(zoneHeight, c);
       
        JPanel buttons = new VerticalStaticJPanel();
        buttons.setLayout(new GridBagLayout());
        buttons.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
        c = new GridBagConstraints();
        c.anchor = GridBagConstraints.EAST;
        c.gridx = 0;
        c.gridy = 0;
        c.weightx = 0;
        c.fill = GridBagConstraints.NONE;
        c.insets = new Insets(5, 0, 0, 5);
        buttons.add(okButton, c);
        c.gridx = 1;
        buttons.add(cancelButton, c);

        mainPanel = new JPanel();
        mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        mainPanel.setLayout(new GridBagLayout());
        c = new GridBagConstraints();
View Full Code Here

        JButton applyButton = new JButton(APPLY_BUTTON);
        applyButton.setToolTipText(APPLY_TOOLTIP);
        JButton deleteButton = new JButton(Resources.getIcon("gnome-delete.png"));
        deleteButton.setToolTipText(DELETE_BUTTON);

        JPanel user = new VerticalStaticJPanel();
        user.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
        user.setLayout(new BoxLayout(user, BoxLayout.X_AXIS));
        user.add(Box.createGlue());
        user.add(Box.createRigidArea(new Dimension(5, 0)));
        user.add(deleteButton);

        JPanel buttons = new VerticalStaticJPanel();
        buttons.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
        buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
        buttons.add(Box.createGlue());
        buttons.add(applyButton);

        JPanel mainPanel = new JPanel();
        mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
        mainPanel.add(propScrollPane);
View Full Code Here

        tileWidth = new IntegerSpinner(defaultTileWidth, 1);
        tileHeight = new IntegerSpinner(defaultTileHeight, 1);

        // Map size fields

        JPanel mapSize = new VerticalStaticJPanel();
        mapSize.setLayout(new GridBagLayout());
        mapSize.setBorder(BorderFactory.createCompoundBorder(
                    BorderFactory.createTitledBorder(MAPSIZE_TITLE),
                    BorderFactory.createEmptyBorder(0, 5, 5, 5)));
        GridBagConstraints c = new GridBagConstraints();
        c.anchor = GridBagConstraints.EAST;
        c.fill = GridBagConstraints.NONE;
        c.insets = new Insets(5, 0, 0, 5);
        mapSize.add(new JLabel(WIDTH_LABEL), c);
        c.gridy = 1;
        mapSize.add(new JLabel(HEIGHT_LABEL), c);
      c.insets = new Insets(5, 0, 0, 0);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.gridx = 1; c.gridy = 0; c.weightx = 1;
        mapSize.add(mapWidth, c);
        c.gridy = 1;
        mapSize.add(mapHeight, c);

        // Tile size fields

        JPanel tileSize = new VerticalStaticJPanel();
        tileSize.setLayout(new GridBagLayout());
        tileSize.setBorder(BorderFactory.createCompoundBorder(
                    BorderFactory.createTitledBorder(TILESIZE_TITLE),
                    BorderFactory.createEmptyBorder(0, 5, 5, 5)));
        c.gridx = 0; c.gridy = 0; c.weightx = 0;
        c.fill = GridBagConstraints.NONE;
      c.insets = new Insets(5, 0, 0, 5);
        tileSize.add(new JLabel(WIDTH_LABEL), c);
        c.gridy = 1;
        tileSize.add(new JLabel(HEIGHT_LABEL), c);
      c.insets = new Insets(5, 0, 0, 0);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.gridx = 1; c.gridy = 0; c.weightx = 1;
        tileSize.add(tileWidth, c);
        c.gridy = 1;
        tileSize.add(tileHeight, c);

        // OK and Cancel buttons

        JButton okButton = new JButton(OK_BUTTON);
        JButton cancelButton = new JButton(CANCEL_BUTTON);
        okButton.addActionListener(this);
        cancelButton.addActionListener(this);

        JPanel buttons = new VerticalStaticJPanel();
        buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
        buttons.add(Box.createGlue());
        buttons.add(okButton);
        buttons.add(Box.createRigidArea(new Dimension(5, 0)));
        buttons.add(cancelButton);

        // Map type and name inputs

        mapTypeChooser = new JComboBox();
        mapTypeChooser.addItem(ORTHOGONAL_MAPTYPE);
        mapTypeChooser.addItem(ISOMETRIC_MAPTYPE);
        mapTypeChooser.addItem(HEXAGONAL_MAPTYPE);
        // TODO: Enable views when implemented decently
        //mapTypeChooser.addItem(SHIFTED_MAPTYPE);

        JPanel miscPropPanel = new VerticalStaticJPanel();
        miscPropPanel.setLayout(new GridBagLayout());
        miscPropPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
        c.gridx = 0; c.gridy = 0; c.weightx = 0;
        c.fill = GridBagConstraints.NONE;
      c.insets = new Insets(5, 0, 0, 5);
        miscPropPanel.add(new JLabel(MAPTYPE_LABEL), c);
      c.insets = new Insets(5, 0, 0, 0);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.gridx = 1; c.gridy = 0; c.weightx = 1;
        miscPropPanel.add(mapTypeChooser, c);

        // Putting two size panels next to eachother

        JPanel sizePanels = new JPanel();
        sizePanels.setLayout(new BoxLayout(sizePanels, BoxLayout.X_AXIS));
View Full Code Here

                    50, sRandomAmount.getPreferredSize().height));
        sRandomAmount.setToolTipText(RANDOM_AMOUNT_TOOLTIP);
        sRandomAmount.addChangeListener(this);

        // Brush options section
        JPanel opts = new VerticalStaticJPanel();
        opts.setLayout(new GridBagLayout());
        opts.setBorder(BorderFactory.createCompoundBorder(
                    BorderFactory.createTitledBorder(OPTIONS_TITLE),
                    BorderFactory.createEmptyBorder(0, 5, 5, 5)));
        GridBagConstraints c = new GridBagConstraints();
        c.fill = GridBagConstraints.NONE;
        c.anchor = GridBagConstraints.NORTHWEST;
        c.weightx = 0;
        c.insets = new Insets(0, 0, 5, 0);
        opts.add(new JLabel(BRUSH_SIZE_LABEL), c);
        c.gridy = 1;
        opts.add(new JLabel(AFFECTED_LAYERS_LABEL), c);
        c.gridy = 2;
        opts.add(cbRandomBrush, c);
        c.gridy = 0; c.gridx = 1; c.weightx = 0.3;
        c.fill = GridBagConstraints.HORIZONTAL;
        opts.add(brushSize, c);
        c.gridy = 1;
        opts.add(affectLayers, c);
        c.gridy = 2;
        opts.add(sRandomAmount, c);

        JPanel shapePanel = new JPanel();
        shapePanel.setLayout(new BoxLayout(shapePanel, BoxLayout.Y_AXIS));
        shapePanel.add(presets);
        shapePanel.add(opts);
View Full Code Here

        bApply.addActionListener(this);
        bCancel.addActionListener(this);
        bApply.setEnabled(false);

        /* BUTTONS PANEL */
        JPanel buttons = new VerticalStaticJPanel();
        buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
        buttons.add(Box.createGlue());
        buttons.add(okButton);
        buttons.add(Box.createRigidArea(new Dimension(5, 0)));
        buttons.add(bApply);
        buttons.add(Box.createRigidArea(new Dimension(5, 0)));
        buttons.add(bCancel);

        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
        mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        mainPanel.add(tabs);
View Full Code Here

        c.gridx = 1;
        tileColorPanel.add(colorButton);

        // Create the tile bitmap import setting panel

        JPanel tilebmpPanel = new VerticalStaticJPanel();
        tilebmpPanel.setLayout(new GridBagLayout());
        tilebmpPanel.setBorder(BorderFactory.createCompoundBorder(
                BorderFactory.createTitledBorder(FROM_TILESET_IMG_TITLE),
                BorderFactory.createEmptyBorder(0, 5, 5, 5)));
        c.gridx = 0;
        c.gridy = 0;
        c.weightx = 0;
        c.insets = new Insets(5, 0, 0, 0);
        c.anchor = GridBagConstraints.EAST;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.gridwidth = 2;
        tilebmpPanel.add(tilebmpCheck, c);
        c.gridy = 1;
        c.gridwidth = 1;
        c.insets = new Insets(5, 0, 0, 5);
        c.fill = GridBagConstraints.NONE;
        tilebmpPanel.add(tilebmpFileLabel, c);
        c.gridy = 2;
        tilebmpPanel.add(spacingLabel, c);
        /*
        c.gridy = 4;
        tilebmpPanel.add(cutterLabel, c);
        */
        c.gridx = 1;
        c.gridy = 1;
        c.weightx = 1;
        c.insets = new Insets(5, 0, 0, 0);
        c.fill = GridBagConstraints.HORIZONTAL;
        tilebmpPanel.add(tilebmpPathPanel, c);
        c.gridy = 2;
        tilebmpPanel.add(tileSpacing, c);
        /*
        c.gridy = 4;
        tilebmpPanel.add(cutterBox, c);
        */
        c.gridx = 0;
        c.gridy = 4;
        c.gridwidth = 2;
        tilebmpPanel.add(tileColorPanel, c);
        c.gridx = 1;
        c.gridwidth = 1;

        // OK and Cancel buttons

        JPanel buttons = new VerticalStaticJPanel();
        buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
        buttons.add(Box.createGlue());
        buttons.add(okButton);
        //buttons.add(Box.createRigidArea(new Dimension(5, 0)));
        //buttons.add(previewButton);
        buttons.add(Box.createRigidArea(new Dimension(5, 0)));
        buttons.add(cancelButton);

        // Top part of form

        JPanel miscPropPanel = new VerticalStaticJPanel();
        miscPropPanel.setLayout(new GridBagLayout());
        miscPropPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
        c.gridx = 0;
        c.gridy = 0;
        c.weightx = 0;
        c.fill = GridBagConstraints.NONE;
        c.insets = new Insets(5, 0, 0, 5);
        miscPropPanel.add(nameLabel, c);
        c.gridy = 1;
        miscPropPanel.add(tileWidthLabel, c);
        c.gridy = 2;
        miscPropPanel.add(tileHeightLabel, c);
        c.insets = new Insets(5, 0, 0, 0);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.gridx = 1;
        c.gridy = 0;
        c.weightx = 1;
        miscPropPanel.add(tilesetName, c);
        c.gridy = 1;
        miscPropPanel.add(tileWidth, c);
        c.gridy = 2;
        miscPropPanel.add(tileHeight, c);
        c.gridy = 3;
        miscPropPanel.add(propsButton, c);

        // Main panel

        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.PAGE_AXIS));
View Full Code Here

    JButton okButton = new JButton("OK");
    JButton newButton = new JButton("New");
    JButton editButton = new JButton("Edit");
    JButton deleteButton = new JButton("Delete");

    JPanel buttons = new VerticalStaticJPanel();
    buttons.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
    buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
    buttons.add(Box.createGlue());
    buttons.add(okButton);
    buttons.add(Box.createRigidArea(new Dimension(5, 0)));
    buttons.add(newButton);
    buttons.add(editButton);
    buttons.add(deleteButton);

    mainPanel = new JPanel();
    mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
    mainPanel.add(scriptsScrollPane);
View Full Code Here

TOP

Related Classes of tiled.mapeditor.widget.VerticalStaticJPanel

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.