Skip to content

Commit

Permalink
merge test and bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaswoehlke committed Feb 16, 2020
1 parent 80da6ab commit 30db0d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.woehlke.computer.kurzweil.commons.GuiComponentTab;

import javax.swing.*;
import javax.swing.border.CompoundBorder;
import java.awt.*;

@Log
Expand All @@ -17,20 +18,23 @@ public class CyclicCellularAutomatonButtons extends JPanel implements GuiCompone
private final String buttonLabelVonNeumann;
private final String buttonLabelMoore;
private final String buttonLabelWoehlke;
private final String title;
private final CyclicCellularAutomatonCanvas canvas;

public CyclicCellularAutomatonButtons(
CyclicCellularAutomatonCanvas canvas
) {
this.canvas = canvas;
this.title = this.canvas.getTabCtx().getCtx().getProperties().getCca().getView().getNeighborhood().getTitle();
this.buttonLabelVonNeumann = this.canvas.getTabCtx().getCtx().getProperties().getCca().getView().getNeighborhood().getTypeVonNeumann();
this.buttonLabelMoore =this.canvas.getTabCtx().getCtx().getProperties().getCca().getView().getNeighborhood().getTypeMoore();
this.buttonLabelWoehlke =this.canvas.getTabCtx().getCtx().getProperties().getCca().getView().getNeighborhood().getTypeWoehlke();
this.buttonVonNeumann = new JButton(this.buttonLabelVonNeumann);
this.buttonMoore = new JButton(this.buttonLabelMoore );
this.buttonWoehlke = new JButton(this.buttonLabelWoehlke);
CompoundBorder border = this.canvas.getTabCtx().getCtx().getBorder( this.title);
this.setBorder(border);
this.setLayout(new FlowLayout());
this.add(new JLabel(this.canvas.getTabCtx().getCtx().getProperties().getCca().getView().getNeighborhood().getTitle()));
this.add(this.buttonVonNeumann);
this.add(this.buttonMoore);
this.add(this.buttonWoehlke);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ public PanelZoomButtons(MandelbrotContext tabCtx) {
FlowLayout layout = new FlowLayout();
String buttonsZoomOut = this.tabCtx.getCtx().getProperties().getMandelbrot().getView().getButtonsZoomOut();
String buttonsZoomLabel = this.tabCtx.getCtx().getProperties().getMandelbrot().getView().getButtonsZoomLabel();
CompoundBorder borderPanelPushButtons = this.tabCtx.getCtx().getBorder();
CompoundBorder borderPanelPushButtons = this.tabCtx.getCtx().getBorder(buttonsZoomLabel);
this.zoomLevelFieldLabel = new JLabel(buttonsZoomLabel);
this.zoomLevelField = new TextField("1",3);
this.zoomOutButton = new JButton(buttonsZoomOut);
this.setLayout(layout);
this.setBorder(borderPanelPushButtons);
this.add(this.zoomLevelFieldLabel);
//this.add(this.zoomLevelFieldLabel);
this.add(this.zoomLevelField);
this.add(this.zoomOutButton);
}
Expand Down

0 comments on commit 30db0d2

Please sign in to comment.