1 package org.woehlke.computer.kurzweil.tabs.mandelbrot2julia;
2
3 import lombok.Getter;
4 import lombok.experimental.Delegate;
5 import lombok.extern.log4j.Log4j2;
6 import org.woehlke.computer.kurzweil.commons.Startable;
7 import org.woehlke.computer.kurzweil.commons.Updateable;
8 import org.woehlke.computer.kurzweil.commons.widgets.PanelStartStopButtons;
9 import org.woehlke.computer.kurzweil.commons.widgets.SubTabImpl;
10 import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas.PanelChooseMouseClickMode;
11 import org.woehlke.computer.kurzweil.tabs.mandelbrotzoom.canvas.PanelZoom;
12
13 import javax.swing.*;
14
15 @Log4j2
16 @Getter
17 public class MandelbrotTabPane extends JTabbedPane implements Startable {
18
19 @Delegate(excludes={SubTabImpl.class,JPanel.class, Updateable.class})
20 private final PanelStartStopButtons startStopButtonsPanel;
21 private final PanelChooseMouseClickMode panelChooseMouseClickMode;
22 private final PanelZoom panelZoom;
23
24 private final MandelbrotTab tab;
25
26 public MandelbrotTabPane(MandelbrotTab tab) {
27 this.tab = tab;
28 this.startStopButtonsPanel = new PanelStartStopButtons( tab );
29 this.addTab(this.startStopButtonsPanel.getTitle(), this.startStopButtonsPanel);
30 this.panelChooseMouseClickMode = new PanelChooseMouseClickMode(this.tab.getTabCtx());
31 this.panelZoom = new PanelZoom(this.tab.getTabCtx());
32 this.addTab(panelChooseMouseClickMode.getTitle(),panelChooseMouseClickMode);
33 this.addTab(panelZoom.getTitle(),panelZoom);
34 this.startStopButtonsPanel.stop();
35 this.disableZoomButton();
36 }
37
38
39 public void enableZoomButton() {
40 this.panelZoom.setEnabled(false);
41 }
42
43 public void disableZoomButton() {
44 this.panelZoom.setEnabled(true);
45 }
46
47 public JRadioButton getRadioButtonsSwitch() {
48 return this.panelChooseMouseClickMode.getRadioButtonsSwitch();
49 }
50
51 public JRadioButton getRadioButtonsZoom() {
52 return this.panelChooseMouseClickMode.getRadioButtonsZoom();
53 }
54
55 public AbstractButton getZoomOutButton() {
56 return this.panelZoom.getZoomOutButton();
57 }
58
59 }