diff --git a/.idea/misc.xml b/.idea/misc.xml index 639900d..5295b2c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index 88ede91..f669a0e 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/.idea/pibd-21_yahontov_o.u._trolleybus_hard_2.iml b/.idea/src.iml similarity index 57% rename from .idea/pibd-21_yahontov_o.u._trolleybus_hard_2.iml rename to .idea/src.iml index d6ebd48..6e2c775 100644 --- a/.idea/pibd-21_yahontov_o.u._trolleybus_hard_2.iml +++ b/.idea/src.iml @@ -2,7 +2,10 @@ - + + + + diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2e1d8cd --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Images/1.png b/Images/1.png new file mode 100644 index 0000000..ac1daa0 Binary files /dev/null and b/Images/1.png differ diff --git a/Images/2.png b/Images/2.png new file mode 100644 index 0000000..6f41dd2 Binary files /dev/null and b/Images/2.png differ diff --git a/Images/3.png b/Images/3.png new file mode 100644 index 0000000..e29b053 Binary files /dev/null and b/Images/3.png differ diff --git a/Images/4.png b/Images/4.png new file mode 100644 index 0000000..916fa6d Binary files /dev/null and b/Images/4.png differ diff --git a/Main.java b/Main.java deleted file mode 100644 index a48401f..0000000 --- a/Main.java +++ /dev/null @@ -1,6 +0,0 @@ -package src; -public class Main { - public static void main(String[] args) { - - } -} \ No newline at end of file diff --git a/out/production/src/.gitignore b/out/production/src/.gitignore new file mode 100644 index 0000000..9154f4c --- /dev/null +++ b/out/production/src/.gitignore @@ -0,0 +1,26 @@ +# ---> Java +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + diff --git a/out/production/src/.idea/.gitignore b/out/production/src/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/out/production/src/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/out/production/src/.idea/misc.xml b/out/production/src/.idea/misc.xml new file mode 100644 index 0000000..5295b2c --- /dev/null +++ b/out/production/src/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/out/production/src/.idea/modules.xml b/out/production/src/.idea/modules.xml new file mode 100644 index 0000000..f669a0e --- /dev/null +++ b/out/production/src/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/out/production/src/.idea/src.iml b/out/production/src/.idea/src.iml new file mode 100644 index 0000000..6e2c775 --- /dev/null +++ b/out/production/src/.idea/src.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/out/production/src/.idea/uiDesigner.xml b/out/production/src/.idea/uiDesigner.xml new file mode 100644 index 0000000..2e1d8cd --- /dev/null +++ b/out/production/src/.idea/uiDesigner.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/out/production/src/.idea/vcs.xml b/out/production/src/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/out/production/src/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/out/production/src/Images/1.png b/out/production/src/Images/1.png new file mode 100644 index 0000000..ac1daa0 Binary files /dev/null and b/out/production/src/Images/1.png differ diff --git a/out/production/src/Images/2.png b/out/production/src/Images/2.png new file mode 100644 index 0000000..6f41dd2 Binary files /dev/null and b/out/production/src/Images/2.png differ diff --git a/out/production/src/Images/3.png b/out/production/src/Images/3.png new file mode 100644 index 0000000..e29b053 Binary files /dev/null and b/out/production/src/Images/3.png differ diff --git a/out/production/src/Images/4.png b/out/production/src/Images/4.png new file mode 100644 index 0000000..916fa6d Binary files /dev/null and b/out/production/src/Images/4.png differ diff --git a/out/production/src/README.md b/out/production/src/README.md new file mode 100644 index 0000000..948ba2e --- /dev/null +++ b/out/production/src/README.md @@ -0,0 +1,2 @@ +# PIbd-21_Yahontov_O.U._Trolleybus_Hard + diff --git a/src/Additional_Enum.java b/src/Additional_Enum.java new file mode 100644 index 0000000..0c8a5d5 --- /dev/null +++ b/src/Additional_Enum.java @@ -0,0 +1,13 @@ +public enum Additional_Enum { + One(1), + Two(2), + Three(3), + ; + private final int addEnum; + Additional_Enum(int i) { + this.addEnum=i; + } + public int GetAddEnum() { + return addEnum; + } +} diff --git a/src/Direction.java b/src/Direction.java new file mode 100644 index 0000000..5517133 --- /dev/null +++ b/src/Direction.java @@ -0,0 +1,13 @@ +public enum Direction { + Up(1), + Down(2), + Left (3), + Right(4); + private final int Direct; + Direction(int i) { + this.Direct=i; + } + public int GetDirect() { + return Direct; + } +} diff --git a/src/DrawingDeck.java b/src/DrawingDeck.java new file mode 100644 index 0000000..7b1b4ca --- /dev/null +++ b/src/DrawingDeck.java @@ -0,0 +1,40 @@ +import javax.swing.*; +import java.awt.*; +public class DrawingDeck extends JComponent { + private Additional_Enum _decksEnum; + public void SetAddEnum(Additional_Enum addEnum) { + _decksEnum = addEnum; + } + public void DrawDeck(Color colorDeck, Graphics g,float _startPosX,float _startPosY) + { + super.paintComponent(g); + Graphics2D g2d = (Graphics2D) g; + switch (_decksEnum.GetAddEnum()) + { + case 1: + g2d.setPaint(colorDeck); + g2d.fillRect((int)_startPosX+40, (int)_startPosY+15, 30*2, 5); + g2d.setPaint(Color.BLACK); + g2d.drawRect((int)_startPosX+40, (int)_startPosY+15, 30*2, 5); + break; + case 2: + g2d.setPaint(colorDeck); + g2d.fillRect((int)_startPosX+40, (int)_startPosY+15, 70, 5); + g2d.fillRect((int)_startPosX+50, (int)_startPosY+10, 60, 5); + g2d.setPaint(Color.BLACK); + g2d.drawRect((int)_startPosX+40, (int)_startPosY+15, 70, 5); + g2d.drawRect((int)_startPosX+50, (int)_startPosY+10, 60, 5); + break; + case 3: + g2d.setPaint(colorDeck); + g2d.fillRect((int)_startPosX+40, (int)_startPosY+15, 70, 5); + g2d.fillRect((int)_startPosX+50, (int)_startPosY+10, 60, 5); + g2d.fillRect((int)_startPosX+60, (int)_startPosY+5, 50, 5); + g2d.setPaint(Color.BLACK); + g2d.drawRect((int)_startPosX+40, (int)_startPosY+15, 70, 5); + g2d.drawRect((int)_startPosX+50, (int)_startPosY+10, 60, 5); + g2d.drawRect((int)_startPosX+60, (int)_startPosY+5, 50, 5); + break; + } + } +} diff --git a/src/DrawingTrolleybus.java b/src/DrawingTrolleybus.java new file mode 100644 index 0000000..f081e7b --- /dev/null +++ b/src/DrawingTrolleybus.java @@ -0,0 +1,134 @@ +import javax.swing.*; +import java.awt.*; +import java.util.Random; +public class DrawingTrolleybus extends JPanel { + private EntityTrolleybus Trolleybus; + public DrawingDeck Deck; + public void SetEnum() { + Random r = new Random(); + int numbEnum = r.nextInt(1, 4); + if (numbEnum == 1) { + Deck.SetAddEnum(Additional_Enum.One); + } + if (numbEnum == 2) { + Deck.SetAddEnum(Additional_Enum.Two); + } + if (numbEnum == 3) { + Deck.SetAddEnum(Additional_Enum.Three); + } + } + public EntityTrolleybus GetTrolleybus() { + return Trolleybus; + } + private float _startPosX; + private float _startPosY; + private Integer _pictureWidth = null; + private Integer _pictureHeight = null; + protected final int _TrolleybusWidth = 200; + protected final int _TrolleybusHeight = 50; + public void Init(int speed, float weight, Color bodycolor) { + Trolleybus = new EntityTrolleybus(); + Trolleybus.Init(speed, weight, bodycolor); + Deck = new DrawingDeck(); + SetEnum(); + } + public void SetPosition(int x, int y, int width, int height) { + if (width <= _TrolleybusWidth + x || height <= _TrolleybusHeight + y || x < 0 || y < 0) { + _pictureWidth = null; + _pictureHeight = null; + return; + } + _startPosX = x; + _startPosY = y; + _pictureWidth = width; + _pictureHeight = height; + } + public void MoveTransport(Direction direction) { + if (GetTrolleybus() == null) { + return; + } + switch (direction.GetDirect()) { + case 4: + if (_startPosX + _TrolleybusWidth + Trolleybus.Step() < _pictureWidth) { + _startPosX += Trolleybus.Step(); + } + break; + case 3: + if (_startPosX - Trolleybus.Step() > 0) { + _startPosX -= Trolleybus.Step(); + } + break; + case 1: + if (_startPosY - Trolleybus.Step() > 0) { + _startPosY -= Trolleybus.Step(); + } + break; + case 2: + if (_startPosY + _TrolleybusHeight + Trolleybus.Step() < _pictureHeight) { + _startPosY += Trolleybus.Step(); + } + break; + } + } + public void DrawTransport() { + if (_startPosX < 0 || _startPosY < 0 || _pictureWidth == null || _pictureHeight == null) { + return; + } + repaint(); + } + @Override + public void paintComponent(Graphics g) { + if (GetTrolleybus() == null) { + return; + } + if (_startPosX < 0 || _startPosY < 0 || _pictureWidth == null || _pictureHeight == null) { + return; + } + super.paintComponent(g); + Graphics2D g2d = (Graphics2D) g; + g2d.setPaint(Trolleybus.GetBodyColor()); + /* int xValues[]={(int) _startPosX,(int) _startPosX + 60 * 2,(int) _startPosX + 100,(int) _startPosX + 20}; + int yValues[]={(int) _startPosY + 20,(int) _startPosY + 20,(int) _startPosY + 20 * 2,(int) _startPosY + 40}; + g2d.fillPolygon(xValues,yValues,4); + g2d.setPaint(Color.BLACK); + g2d.drawPolygon(xValues,yValues,4); + Deck.DrawDeck(Trolleybus.GetBodyColor(), g, _startPosX, _startPosY);*/ + g2d.setPaint(Color.BLACK); + g2d.drawRect((int)_startPosX, (int)_startPosY, 200, 50); + g2d.drawRect((int)_startPosX + 100, (int)_startPosY + 10, 20, 40); + g2d.setPaint(Color.BLUE); + g2d.fillOval((int)_startPosX, (int)_startPosY + 5, 20, 25); + g2d.drawOval((int)_startPosX, (int)_startPosY + 5, 20, 25); + g2d.fillOval((int)_startPosX + 25, (int)_startPosY + 5, 20, 25); + g2d.drawOval((int)_startPosX + 25, (int)_startPosY + 5, 20, 25); + g2d.fillOval((int)_startPosX + 50, (int)_startPosY + 5, 20, 25); + g2d.drawOval((int)_startPosX + 50, (int)_startPosY + 5, 20, 25); + g2d.fillOval((int)_startPosX + 75, (int)_startPosY + 5, 20, 25); + g2d.drawOval((int)_startPosX + 75, (int)_startPosY + 5, 20, 25); + g2d.fillOval((int)_startPosX + 120, (int)_startPosY + 5, 20, 25); + g2d.drawOval((int)_startPosX + 120, (int)_startPosY + 5, 20, 25); + g2d.fillOval((int)_startPosX + 145, (int)_startPosY + 5, 20, 25); + g2d.drawOval((int)_startPosX + 145, (int)_startPosY + 5, 20, 25); + g2d.fillOval((int)_startPosX + 170, (int)_startPosY + 5, 20, 25); + g2d.drawOval((int)_startPosX + 170, (int)_startPosY + 5, 20, 25); + g2d.fillOval((int)_startPosX, (int)_startPosY + 40, 30, 30); + g2d.drawOval((int)_startPosX, (int)_startPosY + 40, 30, 30); + g2d.fillOval((int)_startPosX + 170, (int)_startPosY + 40, 30, 30); + g2d.drawOval((int)_startPosX + 170, (int)_startPosY + 40, 30, 30); + } + public void ChangeBorders(int width, int height) { + _pictureWidth = width; + _pictureHeight = height; + if (_pictureWidth <= _TrolleybusWidth || _pictureHeight <= _TrolleybusHeight) { + _pictureWidth = null; + _pictureHeight = null; + return; + } + if (_startPosX + _TrolleybusWidth > _pictureWidth) { + _startPosX = _pictureWidth - _TrolleybusWidth; + } + if (_startPosY + _TrolleybusHeight > _pictureHeight) { + _startPosY = _pictureHeight - _TrolleybusHeight; + } + } +} \ No newline at end of file diff --git a/src/EntityTrolleybus.java b/src/EntityTrolleybus.java new file mode 100644 index 0000000..f280b43 --- /dev/null +++ b/src/EntityTrolleybus.java @@ -0,0 +1,25 @@ +import java.awt.*; +public class EntityTrolleybus { + private int Speed; + public int GetSpeed() { + return Speed; + } + private float Weight; + public float GetWeight() { + return Weight; + } + private Color BodyColor; + public Color GetBodyColor() { + return BodyColor; + } + public float Step() + { + return Speed*100/Weight; + } + public void Init(int speed,float weight, Color bodyColor) + { + Speed = speed; + Weight=weight; + BodyColor=bodyColor; + } +} diff --git a/src/FormTrolleybus.form b/src/FormTrolleybus.form new file mode 100644 index 0000000..d4659cb --- /dev/null +++ b/src/FormTrolleybus.form @@ -0,0 +1,100 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/FormTrolleybus.java b/src/FormTrolleybus.java new file mode 100644 index 0000000..830f15c --- /dev/null +++ b/src/FormTrolleybus.java @@ -0,0 +1,150 @@ +import javax.imageio.ImageIO; +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.util.Random; + +public class FormTrolleybus { + public JPanel Mainpanel; + private JButton ButtonCreate; + private JButton ButtonLeft; + private JButton ButtonUp; + private JButton ButtonDown; + private JButton ButtonRight; + protected DrawingTrolleybus PictureBoxTrolleybus; + private JToolBar StatusStrip; + private JLabel JLabelSpeed = new JLabel(); + private JLabel JLabelWeight = new JLabel(); + private JLabel JLabelColor = new JLabel(); + + public void Draw() { + if (PictureBoxTrolleybus.GetTrolleybus() == null) { + return; + } + PictureBoxTrolleybus.DrawTransport(); + } + + public FormTrolleybus() { + Box LabelBox = Box.createHorizontalBox(); + LabelBox.setMinimumSize(new Dimension(1, 20)); + LabelBox.add(JLabelSpeed); + LabelBox.add(JLabelWeight); + LabelBox.add(JLabelColor); + StatusStrip.add(LabelBox); + try { + Image img = ImageIO.read(FormTrolleybus.class.getResource("Images/4.png")); + ButtonUp.setIcon(new ImageIcon(img)); + img = ImageIO.read(FormTrolleybus.class.getResource("Images/2.png")); + ButtonDown.setIcon(new ImageIcon(img)); + img = ImageIO.read(FormTrolleybus.class.getResource("Images/1.png")); + ButtonLeft.setIcon(new ImageIcon(img)); + img = ImageIO.read(FormTrolleybus.class.getResource("Images/3.png")); + ButtonRight.setIcon(new ImageIcon(img)); + } catch (Exception ex) { + System.out.println(ex); + } + ButtonCreate.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + Random random = new Random(); + PictureBoxTrolleybus.Init(random.nextInt(100, 300), random.nextInt(1000, 2000), new Color(random.nextInt(256), random.nextInt(256), random.nextInt(256))); + PictureBoxTrolleybus.SetPosition(random.nextInt(10, 100), random.nextInt(10, 100), PictureBoxTrolleybus.getWidth(), PictureBoxTrolleybus.getHeight()); + JLabelSpeed.setText("Скорость: " + PictureBoxTrolleybus.GetTrolleybus().GetSpeed() + " "); + JLabelWeight.setText("Вес: " + PictureBoxTrolleybus.GetTrolleybus().GetWeight() + " "); + JLabelColor.setText(("Цвет: " + PictureBoxTrolleybus.GetTrolleybus().GetBodyColor() + " ")); + Draw(); + } + }); + PictureBoxTrolleybus.addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent e) { + super.componentResized(e); + PictureBoxTrolleybus.ChangeBorders(PictureBoxTrolleybus.getWidth(), PictureBoxTrolleybus.getHeight()); + Draw(); + } + }); + ButtonUp.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + PictureBoxTrolleybus.MoveTransport(Direction.Up); + Draw(); + } + }); + ButtonDown.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + PictureBoxTrolleybus.MoveTransport(Direction.Down); + Draw(); + } + }); + ButtonRight.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + PictureBoxTrolleybus.MoveTransport(Direction.Right); + Draw(); + } + }); + ButtonLeft.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + PictureBoxTrolleybus.MoveTransport(Direction.Left); + Draw(); + } + }); + } + + { +// GUI initializer generated by IntelliJ IDEA GUI Designer +// >>> IMPORTANT!! <<< +// DO NOT EDIT OR ADD ANY CODE HERE! + $$$setupUI$$$(); + } + + /** + * Method generated by IntelliJ IDEA GUI Designer + * >>> IMPORTANT!! <<< + * DO NOT edit this method OR call it in your code! + * + * @noinspection ALL + */ + private void $$$setupUI$$$() { + Mainpanel = new JPanel(); + Mainpanel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(4, 5, new Insets(0, 0, 0, 0), -1, -1)); + ButtonDown = new JButton(); + ButtonDown.setText(""); + Mainpanel.add(ButtonDown, new com.intellij.uiDesigner.core.GridConstraints(2, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, new Dimension(30, 30), new Dimension(30, 30), new Dimension(30, 30), 0, false)); + ButtonLeft = new JButton(); + ButtonLeft.setText(""); + Mainpanel.add(ButtonLeft, new com.intellij.uiDesigner.core.GridConstraints(2, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, new Dimension(30, 30), new Dimension(30, 30), new Dimension(30, 30), 0, false)); + ButtonRight = new JButton(); + ButtonRight.setHorizontalAlignment(0); + ButtonRight.setText(""); + Mainpanel.add(ButtonRight, new com.intellij.uiDesigner.core.GridConstraints(2, 4, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, new Dimension(30, 30), new Dimension(30, 30), new Dimension(30, 30), 0, false)); + PictureBoxTrolleybus = new DrawingTrolleybus(); + Mainpanel.add(PictureBoxTrolleybus, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 5, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); + ButtonUp = new JButton(); + ButtonUp.setText(""); + Mainpanel.add(ButtonUp, new com.intellij.uiDesigner.core.GridConstraints(1, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, new Dimension(30, 30), new Dimension(30, 30), new Dimension(30, 30), 0, false)); + StatusStrip = new JToolBar(); + StatusStrip.setEnabled(false); + Mainpanel.add(StatusStrip, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 5, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, new Dimension(-1, 20), new Dimension(-1, 20), new Dimension(-1, 20), 0, false)); + final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer(); + Mainpanel.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(1, 1, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + ButtonCreate = new JButton(); + ButtonCreate.setText("Создать"); + Mainpanel.add(ButtonCreate, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final com.intellij.uiDesigner.core.Spacer spacer2 = new com.intellij.uiDesigner.core.Spacer(); + Mainpanel.add(spacer2, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return Mainpanel; + } + +} diff --git a/src/Main.java b/src/Main.java new file mode 100644 index 0000000..611053d --- /dev/null +++ b/src/Main.java @@ -0,0 +1,13 @@ +import javax.swing.*; + +public class Main { + public static void main(String[] args) { + JFrame frame = new JFrame("Лайнер"); + frame.setContentPane(new FormTrolleybus().Mainpanel); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setLocation(500, 200); + frame.pack(); + frame.setSize(500, 500); + frame.setVisible(true); + } +}