-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more custom commands and properties
- Loading branch information
1 parent
a8d81eb
commit 7e7e467
Showing
43 changed files
with
609 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/com/github/sh0nk/matplotlib4j/builder/AxLineBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/main/java/com/github/sh0nk/matplotlib4j/builder/BarBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/main/java/com/github/sh0nk/matplotlib4j/builder/CLabelBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/main/java/com/github/sh0nk/matplotlib4j/builder/ContourBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/com/github/sh0nk/matplotlib4j/builder/CustomBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.github.sh0nk.matplotlib4j.builder; | ||
|
||
import com.github.sh0nk.matplotlib4j.kwargs.KwArgsBuilder; | ||
import java.util.List; | ||
|
||
public interface CustomBuilder extends Builder, KwArgsBuilder<CustomBuilder> { | ||
|
||
CustomBuilder addToArgs(List<?> objs); | ||
|
||
CustomBuilder add2DimListToArgs(List<? extends List<? extends Number>> numbers); | ||
|
||
CustomBuilder addToArgs(String v); | ||
|
||
CustomBuilder addToArgsWithoutQuoting(String v); | ||
|
||
CustomBuilder addToArgs(Number n); | ||
|
||
} |
93 changes: 93 additions & 0 deletions
93
src/main/java/com/github/sh0nk/matplotlib4j/builder/CustomBuilderImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
package com.github.sh0nk.matplotlib4j.builder; | ||
|
||
import java.util.List; | ||
|
||
public class CustomBuilderImpl implements CustomBuilder { | ||
|
||
private final CompositeBuilder<CustomBuilder> innerBuilder = new CompositeBuilder<>(this); | ||
private final String key; | ||
private final String methodPrefix; | ||
private final Boolean returns; | ||
|
||
public CustomBuilderImpl(String key) { | ||
this(null, key, null); | ||
} | ||
|
||
public CustomBuilderImpl(String methodPrefix, String key, Boolean returns) { | ||
this.methodPrefix = methodPrefix; | ||
this.key = key; | ||
this.returns = returns; | ||
} | ||
|
||
@Override | ||
public CustomBuilder addToArgs(List<?> objs) { | ||
return innerBuilder.addToArgs(objs); | ||
} | ||
|
||
@Override | ||
public CustomBuilder add2DimListToArgs(List<? extends List<? extends Number>> numbers) { | ||
return innerBuilder.addToArgs(numbers); | ||
} | ||
|
||
@Override | ||
public CustomBuilder addToArgs(String v) { | ||
return innerBuilder.addToArgs(v); | ||
} | ||
|
||
@Override | ||
public CustomBuilder addToArgsWithoutQuoting(String v) { | ||
return innerBuilder.addToArgsWithoutQuoting(v); | ||
} | ||
|
||
@Override | ||
public CustomBuilder addToArgs(Number n) { | ||
return innerBuilder.addToArgs(n); | ||
} | ||
|
||
@Override | ||
public CustomBuilder addToKwargs(String k, String v) { | ||
return innerBuilder.addToKwargs(k, v); | ||
} | ||
|
||
@Override | ||
public CustomBuilder addToKwargsWithoutQuoting(String k, String v) { | ||
return innerBuilder.addToKwargsWithoutQuoting(k, v); | ||
} | ||
|
||
@Override | ||
public CustomBuilder addToKwargs(String k, Number n) { | ||
return innerBuilder.addToKwargs(k, n); | ||
} | ||
|
||
@Override | ||
public CustomBuilder addToKwargs(String k, List<? extends Number> v) { | ||
return innerBuilder.addToKwargs(k, v); | ||
} | ||
|
||
@Override | ||
public CustomBuilder addToKwargs(String k, boolean v) { | ||
return innerBuilder.addToKwargs(k, v); | ||
} | ||
|
||
@Override | ||
public String build() { | ||
return innerBuilder.build(); | ||
} | ||
|
||
@Override | ||
public boolean returns() { | ||
if (returns != null) return returns; | ||
return CustomBuilder.super.returns(); | ||
} | ||
|
||
@Override | ||
public String getMethodPrefix() { | ||
if (methodPrefix != null) return methodPrefix; | ||
return CustomBuilder.super.getMethodPrefix(); | ||
} | ||
|
||
@Override | ||
public String getMethodName() { | ||
return key; | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
src/main/java/com/github/sh0nk/matplotlib4j/builder/GridBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.