Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package test;
- import javax.swing.*;
- import bibliothek.extension.gui.dock.*;
- import bibliothek.gui.dock.common.*;
- import java.awt.*;
- /**
- *
- * @author master
- */
- public class Main extends JFrame{
- /**
- * @param args the command line arguments
- */
- public Main() {
- this.setVisible(true);
- this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- CControl control = new CControl(this);
- JButton tileset = new JButton();
- tileset.setMinimumSize(new Dimension(200,72));
- tileset.setPreferredSize(new Dimension(200,200));
- JButton toolProps = new JButton();
- JButton toolbox = new JButton();
- JButton tilemap = new JButton();
- tilemap.setMinimumSize(new Dimension(256,256));
- JButton palette = new JButton();
- palette.setMinimumSize(new Dimension(228,236));
- JButton palprop = new JButton();
- JPanel tilePanel = new JPanel(new BorderLayout());
- JPanel pal=new JPanel(new BorderLayout());
- pal.add(palette, BorderLayout.CENTER);
- pal.add(palprop, BorderLayout.NORTH);
- JPanel contentPane = new JPanel(new BorderLayout());
- CGrid grid = new CGrid(control);
- grid.add(0,0,1, 2, create("tools", "Tools", toolbox, true, true,false, new Dimension(80, 120)));
- grid.add(1,1, 2, 4, create("tilemap", "Canvas", tilemap, false, false,true, new Dimension(3 * 128,3 * 128)));
- grid.add(3,3, 1, 1, create("tile", "Set", tilePanel, true, true,false, new Dimension(192,75)));
- grid.add(3,4, 1, 1, create("pal", "Palette", pal));
- grid.add(0,1, 1, 4, create("side", "sisde", toolProps, true, true,false, new Dimension(80,400)));
- CContentArea content = control.getContentArea();
- control.handleResizeRequests();
- content.setPreferredSize(new Dimension(800,600));
- content.deploy(grid);
- contentPane.add(content, BorderLayout.CENTER);
- this.add(contentPane);
- this.pack();
- }
- private static SingleCDockable create(String id, String title, JComponent comp) {
- DefaultSingleCDockable dockable = new DefaultSingleCDockable(id, title);
- dockable.setTitleText(title);
- dockable.setCloseable(false);
- dockable.add(comp);
- dockable.setMaximizable(false);
- return dockable;
- }
- private static SingleCDockable create(String id, String title, JComponent comp, boolean LH, boolean LV,boolean maxim, Dimension dim) {
- DefaultSingleCDockable dockable = new DefaultSingleCDockable(id, title);
- dockable.setTitleText(title);
- dockable.setCloseable(false);
- dockable.add(comp);
- dockable.setResizeRequest(dim, true);
- dockable.setResizeLockedVertically(LV);
- dockable.setResizeLockedHorizontally(LH);
- dockable.setMaximizable(maxim);
- return dockable;
- }
- public static void main(String[] args) {
- Main app = new Main();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement