Skip to content

Commit

Permalink
Merge pull request #5 from umjammer/1.0.3
Browse files Browse the repository at this point in the history
1.0.3
  • Loading branch information
umjammer authored Apr 6, 2024
2 parents ddd7256 + 9003bcb commit c00c6be
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 28 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>vavi</groupId>
<artifactId>vavi-apps-jwinzip</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>

<name>Vavi JWinZip Application</name>
<organization>
Expand Down Expand Up @@ -178,7 +178,7 @@
<dependency>
<groupId>com.github.umjammer</groupId> <!-- org.hid4java / com.github.umjammer -->
<artifactId>hid4java</artifactId>
<version>0.14.10v</version>
<version>0.14.11v</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
22 changes: 12 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,32 @@

🐣 Incubation for table bindings.

### samples

* jwinzip
* gamepad
* epub

## Install

* [maven](https://jitpack.io/#umjammer/vavi-apps-jwinzip)

## Usage

### samples

* jwinzip
* gamepad
* epub

## References

* [connons compress](http://jakarta.apache.org/commons/sandbox/compress/apidocs/index.html)
* [vavi-util-archive](https://github.com/umjammer/vavi-util-archive)
* [vavi-util-archive-sandbox](https://github.com/umjammer/vavi-util-archive-sandbox)

### License

* ~~[JGT](http://www.gjt.org/doc/gpl/)~~ removed

## TODO

* canExtract(InputStream)'s argument InputStream should be an Object? ... see ImageIO
* getXXXInstance(File) should be no argument?
* ~~NativeStuffIt almost completed~~
* ~~epub editor~~
* backport bindings into vavi-awt

## License

* ~~[JGT](http://www.gjt.org/doc/gpl/)~~ removed
35 changes: 19 additions & 16 deletions src/test/java/vavi/awt/gamepad/GamepadModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ public VO(String name, int min, int max, float value) {
this.value = value;
}

public void set(String name, int min, int max, float value) {
this.name = name;
this.min = min;
this.max = max;
this.value = value;
}

@Override public String toString() {
return new StringJoiner(", ", VO.class.getSimpleName() + "[", "]")
.add("name='" + name + "'")
Expand All @@ -93,11 +100,18 @@ public GamepadModel(HidController controller) {
public void setUpdater(Runnable repaint) throws IOException {
controller.addInputEventListener(e -> {
Event event = new Event();
vos.clear();
while (e.getNextEvent(event)) {
Field field = ((WrappedComponent<Field>) event.getComponent()).getWrappedObject();
VO vo = new VO(event.getComponent().getName(), field.getLogicalMinimum(), field.getLogicalMaximum(), event.getValue());
vos.add(vo);
if (vos.isEmpty()) {
while (e.getNextEvent(event)) {
Field field = ((WrappedComponent<Field>) event.getComponent()).getWrappedObject();
VO vo = new VO(event.getComponent().getName(), field.getLogicalMinimum(), field.getLogicalMaximum(), event.getValue());
vos.add(vo);
}
} else {
int i = 0;
while (e.getNextEvent(event)) {
Field field = ((WrappedComponent<Field>) event.getComponent()).getWrappedObject();
vos.get(i++).set(event.getComponent().getName(), field.getLogicalMinimum(), field.getLogicalMaximum(), event.getValue());
}
}
repaint.run();
});
Expand All @@ -108,15 +122,4 @@ public void setUpdater(Runnable repaint) throws IOException {
public Iterable<VO> entries() {
return vos;
}

/** */
private static String getFileName(String path) {
return new File(path).getName();
}

/** */
private static String getFilePath(String path) {
path = new File(path).getParent();
return path == null ? "" : path + File.separator;
}
}

0 comments on commit c00c6be

Please sign in to comment.