Skip to content

Commit

Permalink
Cleaned up code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
derekprovance committed May 9, 2016
1 parent 80ed4e9 commit bef6641
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion freemind/main/FreeMind.java
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ private void setScreenBounds() {
getContentPane().add(mContentComponent, BorderLayout.CENTER);
}
getContentPane().add(status, BorderLayout.SOUTH);

// Disable the default close button, instead use windowListener
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

Expand Down
45 changes: 23 additions & 22 deletions freemind/modes/mindmapmode/MindMapToolBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ public java.awt.Dimension getMaximumSize() {
}
}

private static final String[] sizes = { "8", "10", "12", "14", "16", "18",
"20", "24", "28" };
private static final String[] sizes = { "8", "10", "12", "14", "16", "18", "20", "24", "28" };
private static final String FONT_COMBO_BOX_DISPLAY_TEXT = "xxxxxxxxxx";
private MindMapController c;
private MindMapController controller;
private JComboBox fonts, size;
private JAutoScrollBarPane iconToolBarScrollPane;
private JToolBar iconToolBar;
Expand All @@ -81,11 +80,11 @@ public java.awt.Dimension getMaximumSize() {

public MindMapToolBar(MindMapController controller) {
super();
this.c = controller;
this.controller = controller;
if (logger == null) {
logger = freemind.main.Resources.getInstance().getLogger(
this.getClass().getName());
logger = freemind.main.Resources.getInstance().getLogger(this.getClass().getName());
}

this.setRollover(true);

createIconToolbar();
Expand Down Expand Up @@ -115,7 +114,7 @@ private void createFontSizeComboBox() {
if (fontSize_IgnoreChangeEvent) {
return;
}
c.fontSize.actionPerformed((String) e.getItem());
controller.fontSize.actionPerformed((String) e.getItem());
};
size.addItemListener(sizeListener);
}
Expand All @@ -132,7 +131,7 @@ private void createFontsComboBox() {
return;
}
fontFamily_IgnoreChangeEvent = true;
c.fontFamily.actionPerformed((String) e.getItem());
controller.fontFamily.actionPerformed((String) e.getItem());
fontFamily_IgnoreChangeEvent = false;
};
fonts.addItemListener(fontsListener);
Expand All @@ -147,6 +146,7 @@ private void createColorComboBox() {
if(color_IgnoreChangeEvent){
return;
}

if (e.getStateChange() == ItemEvent.SELECTED) {
color_IgnoreChangeEvent = true;
setFontColorByItem((ColorPair) e.getItem());
Expand All @@ -156,9 +156,9 @@ private void createColorComboBox() {
}

private void createZoomComboBox() {
userDefinedZoom = this.c.getText("user_defined_zoom");
userDefinedZoom = this.controller.getText("user_defined_zoom");

zoom = new FreeMindComboBox(this.c.getController().getZooms());
zoom = new FreeMindComboBox(this.controller.getController().getZooms());
zoom.setPreferredSize(new Dimension(90,15));
zoom.setSelectedItem("100%");
zoom.addItem(userDefinedZoom);
Expand All @@ -177,21 +177,21 @@ private void setZoomByItem(Object item) {
return;
String dirty = (String) item;
String cleaned = dirty.substring(0, dirty.length() - 1);
// change representation ("125" to 1.25)
float zoomValue = Float.parseFloat(cleaned) / 100F; // nothing to do...

float zoomValue = Float.parseFloat(cleaned) / 100F;
// remove '%' sign
getController().setZoom(zoomValue);
}

private void setFontColorByItem(ColorPair pItem) {
for (Object o : c.getSelecteds()) {
for (Object o : controller.getSelecteds()) {
MindMapNode node = (MindMapNode) o;
c.setNodeColor(node, pItem.color);
controller.setNodeColor(node, pItem.color);
}
}

protected Controller getController() {
return c.getController();
return controller.getController();
}

public void update(StructuredMenuHolder holder) {
Expand All @@ -213,11 +213,11 @@ public void update(StructuredMenuHolder holder) {

// button tool bar.
iconToolBar.removeAll();
iconToolBar.add(c.removeLastIconAction);
iconToolBar.add(c.removeAllIconsAction);
iconToolBar.add(controller.removeLastIconAction);
iconToolBar.add(controller.removeAllIconsAction);
iconToolBar.addSeparator();
for (int i = 0; i < c.iconActions.size(); ++i) {
iconToolBar.add((Action) c.iconActions.get(i));
for (int i = 0; i < controller.iconActions.size(); ++i) {
iconToolBar.add((Action) controller.iconActions.get(i));
}
}

Expand All @@ -229,7 +229,7 @@ public JLabel addIcon(String iconPath) {
return label;
}

void selectFontSize(String fontSize) // (DiPo)
void selectFontSize(String fontSize)
{
fontSize_IgnoreChangeEvent = true;
size.setSelectedItem(fontSize);
Expand All @@ -240,11 +240,12 @@ Component getLeftToolBar() {
return iconToolBarScrollPane;
}

void selectFontName(String fontName) // (DiPo)
void selectFontName(String fontName)
{
if (fontFamily_IgnoreChangeEvent) {
return;
}

fontFamily_IgnoreChangeEvent = true;
fonts.setEditable(true);
fonts.setSelectedItem(fontName);
Expand All @@ -261,7 +262,7 @@ public void setZoom(float f) {
logger.fine("setZoomComboBox is called with " + f + ".");
String toBeFound = getItemForZoom(f);
for (int i = 0; i < zoom.getItemCount(); ++i) {
if (toBeFound.equals((String) zoom.getItemAt(i))) {
if (toBeFound.equals(zoom.getItemAt(i))) {
// found
zoom.setSelectedItem(toBeFound);
return;
Expand Down

0 comments on commit bef6641

Please sign in to comment.