Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ http://codemetropolis.github.io/CodeMetropolis/
1. navigate to `sources` folder
1. `mvn clean package`
1. The current distribution will be aviable under `source/distro`.

## Demo
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package codemetropolis.toolchain.gui.metricgenerators;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.Map;

import javax.swing.JFileChooser;
import javax.swing.filechooser.FileFilter;

Expand Down Expand Up @@ -42,6 +42,8 @@ public SourceMeterGenerator() {

addProjectRootField();
addSourceMeterExecutableField();
addSourceMeterDownloadButton();

}

/**
Expand All @@ -66,10 +68,31 @@ public void addSourceMeterExecutableField() {
sourceMeterPath = new CMTextField(130, 40, 225, 30);
CMButton browseButton = new CMButton(Translations.t("gui_b_browse"), 360, 40, 100, 30);
browseButton.addActionListener(new BrowseListener(sourceMeterPath, JFileChooser.FILES_ONLY, EXE_FILTER));

add(label);
add(sourceMeterPath);
add(browseButton);

}

/***
* Adds the Download SourceMeter button to the panel which opens the user default browser.
* @author Taskovics Lorinc Karoly {@literal <IT4VZW>}
*/
public void addSourceMeterDownloadButton() {
CMButton downloadSrcM = new CMButton("Download SourceMeter", 30, 100, 300, 30);
downloadSrcM.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
String url = "https://sourcemeter.com/download";
java.awt.Desktop.getDesktop().browse(java.net.URI.create(url));
} catch (java.io.IOException exp) {
System.out.println(exp.getMessage());
}
}
});
add(downloadSrcM);
}

/**
Expand Down