clearLabel.addMouseListener(onClearLabelClick);
importLabel.addMouseListener(onImportLabelClick);
exportLabel.addMouseListener(onExportLabelClick);
settingsLabel.addMouseListener(onSettingsLabelClick);
GroupLayout controlPanelLayout = new GroupLayout(controlPanel);
controlPanel.setLayout(controlPanelLayout);
controlPanelLayout.setHorizontalGroup(
controlPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(controlPanelLayout.createSequentialGroup()
.addGroup(controlPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(controlPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(controlPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(importLabel)
.addComponent(solveLabel)
.addComponent(exportLabel)))
.addGroup(controlPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(clearLabel))
.addGroup(controlPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(settingsLabel)))
.addContainerGap(19, Short.MAX_VALUE))
);
controlPanelLayout.setVerticalGroup(
controlPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(controlPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(solveLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(importLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(exportLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(clearLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(settingsLabel)
.addContainerGap(19, Short.MAX_VALUE))
);
graphBackgroundPanel.setBorder(BorderFactory.createLineBorder(Color.WHITE));
//graphBackgroundPanel.setName("graphBackgroundPanel");
graphDrawPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
//graphDrawPanel.setName("graphDrawPanel");
graphDrawPanel.setBackground(Color.WHITE);
graphMouseListener = new GraphMouseListener(graphDrawPanel, controller, null);
graphDrawPanel.addMouseListener(graphMouseListener);
graphDrawPanel.addMouseMotionListener(mouseMotionListener);
GroupLayout graphBackgroundPanelLayout = new GroupLayout(graphBackgroundPanel);
graphBackgroundPanel.setLayout(graphBackgroundPanelLayout);
graphBackgroundPanelLayout.setHorizontalGroup(
graphBackgroundPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(GroupLayout.Alignment.TRAILING, graphBackgroundPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(graphDrawPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
graphBackgroundPanelLayout.setVerticalGroup(
graphBackgroundPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(graphBackgroundPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(graphDrawPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(controlPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(graphBackgroundPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(controlPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addComponent(graphBackgroundPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);