Skip to content

Commit

Permalink
Javaのプログラムをコードフォーマットした #19
Browse files Browse the repository at this point in the history
  • Loading branch information
jiro4989 committed Nov 24, 2021
1 parent bef7a39 commit c734edc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
15 changes: 4 additions & 11 deletions src/main/java/com/jiro4989/tkite/MainController.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,7 @@ private void updateOutputImageTitlePane() { // {{{

private void selectToggleWithIndex(String fontSize) { // {{{

fontGroup
.getToggles()
.stream()
fontGroup.getToggles().stream()
.map(t -> (RadioMenuItem) t)
.filter(t -> t.getText().equals(fontSize))
.forEach(t -> t.setSelected(true));
Expand Down Expand Up @@ -320,9 +318,7 @@ private void setOpenRecentMenuItems() { // {{{
Path path = logFile.toPath();
try (BufferedReader br = Files.newBufferedReader(path, Charset.forName("UTF-8"))) {

br.lines()
.collect(Collectors.toCollection(LinkedHashSet::new))
.stream()
br.lines().collect(Collectors.toCollection(LinkedHashSet::new)).stream()
.forEach(
line -> {
setOpenRecentMenuItem(line);
Expand Down Expand Up @@ -371,8 +367,7 @@ private void openMenuItemOnAction() { // {{{
files -> {
preferences.setProperty(IMAGE_INIT_DIR.KEY, files.get(0).getParent());

files
.stream()
files.stream()
.forEach(
file -> {
MyFile myFile = new MyFile(file);
Expand Down Expand Up @@ -621,9 +616,7 @@ private void fileListViewOnDragDropped(DragEvent event) { // {{{

// 大文字小文字を区別せずにpngファイルのみをファイルリストに追加
Pattern p = Pattern.compile("^.*\\.((?i)png)");
board
.getFiles()
.stream()
board.getFiles().stream()
.filter(f -> p.matcher(f.getName()).matches())
.forEach(
file -> {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/jiro4989/tkite/image/OutputImagePane.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ public void outputImageFile(File outputFile) { // {{{
// パネルの画像を出力画像に書き込む//{{{

AtomicInteger atom = new AtomicInteger(0);
stackImageViewList
.stream()
stackImageViewList.stream()
.forEach(
siv -> {
int i = atom.getAndIncrement();
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/jiro4989/tkite/util/ImageUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ public static Image joinImageFiles(List<File> imageList) { // {{{

// 基準値と等しい横幅の画像のみを抽出したリストを生成
List<Image> filteredImageList =
imageList
.stream()
imageList.stream()
.map(f -> new Image("file:" + f.getPath()))
.filter(
img -> {
Expand All @@ -156,8 +155,7 @@ public static Image joinImageFiles(List<File> imageList) { // {{{

// 画像の連結
AtomicInteger atom = new AtomicInteger(0);
filteredImageList
.stream()
filteredImageList.stream()
.forEach(
img -> {
int i = atom.getAndIncrement();
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/jiro4989/tkite/util/RecentFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ public static void writeRecentOpenedFile(ObservableList<MenuItem> recentList) {
Files.newBufferedWriter(path, Charset.forName("UTF-8"), StandardOpenOption.WRITE)) {

List<String> list =
recentList
.stream()
recentList.stream()
.map(item -> item.getText())
.map(text -> text.replaceAll("\\\\", "/"))
.distinct()
Expand Down

0 comments on commit c734edc

Please sign in to comment.